sshConfig prints an example SSH config to stdout
(c *cli.Context)
| 410 | |
| 411 | // sshConfig prints an example SSH config to stdout |
| 412 | func sshConfig(c *cli.Context) error { |
| 413 | genCertBool := c.Bool(sshGenCertFlag) |
| 414 | hostname := c.String(sshHostnameFlag) |
| 415 | if hostname == "" { |
| 416 | hostname = "[your hostname]" |
| 417 | } |
| 418 | |
| 419 | type config struct { |
| 420 | Home string |
| 421 | ShortLivedCerts bool |
| 422 | Hostname string |
| 423 | Cloudflared string |
| 424 | } |
| 425 | |
| 426 | t := template.Must(template.New("sshConfig").Parse(sshConfigTemplate)) |
| 427 | return t.Execute(os.Stdout, config{Home: os.Getenv("HOME"), ShortLivedCerts: genCertBool, Hostname: hostname, Cloudflared: cloudflaredPath()}) |
| 428 | } |
| 429 | |
| 430 | // sshGen generates a short lived certificate for provided hostname |
| 431 | func sshGen(c *cli.Context) error { |
nothing calls this directly
no test coverage detected