mirror of
https://github.com/gravitational/teleport
synced 2024-10-22 18:23:25 +00:00
commit
e5cb47e168
|
@ -4,7 +4,8 @@
|
|||
{"name": "os", "value": "linux"}
|
||||
],
|
||||
"commands": [
|
||||
{"name": "start", "args": ["rootfs/usr/bin/teleport", "--env"]}
|
||||
{"name": "start", "args": ["rootfs/usr/bin/teleport", "--env"]},
|
||||
{"name": "tctl", "args": ["rootfs/usr/bin/tctl", "--env"]}
|
||||
],
|
||||
"config": {
|
||||
"params": [
|
||||
|
|
|
@ -59,6 +59,7 @@ func (cmd *Command) SetOut(out io.Writer) {
|
|||
func (cmd *Command) Run(args []string) error {
|
||||
app := kingpin.New("tctl", "CLI for key management of teleport SSH cluster")
|
||||
configPath := app.Flag("config", "Path to the Teleport configuration file").Default(DefaultConfigPath).String()
|
||||
useEnv := app.Flag("env", "read configuration parameters from environment").Default("false").Bool()
|
||||
|
||||
// SSH Key pair
|
||||
keyPair := app.Command("keypair", "Helper operations with SSH keypairs")
|
||||
|
@ -198,8 +199,14 @@ func (cmd *Command) Run(args []string) error {
|
|||
|
||||
if !strings.HasPrefix(selectedCommand, agent.FullCommand()) {
|
||||
var cfg service.Config
|
||||
if err := service.ParseYAMLFile(*configPath, &cfg); err != nil {
|
||||
return trace.Wrap(err)
|
||||
if *useEnv {
|
||||
if err := service.ParseEnv(&cfg); err != nil {
|
||||
return trace.Wrap(err)
|
||||
}
|
||||
} else {
|
||||
if err := service.ParseYAMLFile(*configPath, &cfg); err != nil {
|
||||
return trace.Wrap(err)
|
||||
}
|
||||
}
|
||||
service.SetDefaults(&cfg)
|
||||
if cfg.Auth.Enabled && len(cfg.AuthServers) == 0 {
|
||||
|
|
Loading…
Reference in a new issue