diff --git a/README.md b/README.md index b4452831e3..a35319eda3 100644 --- a/README.md +++ b/README.md @@ -369,7 +369,7 @@ Examples: $ scw exec myserver bash $ scw exec --gateway=myotherserver myserver bash $ scw exec myserver 'tmux a -t joe || tmux new -s joe || bash' - $ exec_secure=1 scw exec myserver bash + $ SCW_SECURE_EXEC=1 scw exec myserver bash $ scw exec -w $(scw start $(scw create ubuntu-trusty)) bash $ scw exec $(scw start -w $(scw create ubuntu-trusty)) bash $ scw exec myserver tmux new -d sleep 10 @@ -1183,6 +1183,8 @@ $ scw inspect myserver | jq '.[0].public_ip.address' ### master (unreleased) +* Use `SCW_SECURE_EXEC` instead of `exec_exec` +* Remove `scaleway_api_endpoint` environment variable * `scw login` don't ask to upload ssh key when there is no keys View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.8.0...master) diff --git a/pkg/cli/cmd_exec.go b/pkg/cli/cmd_exec.go index 90cd6bf075..071f9b6122 100644 --- a/pkg/cli/cmd_exec.go +++ b/pkg/cli/cmd_exec.go @@ -16,7 +16,7 @@ var cmdExec = &Command{ $ scw exec myserver bash $ scw exec --gateway=myotherserver myserver bash $ scw exec myserver 'tmux a -t joe || tmux new -s joe || bash' - $ exec_secure=1 scw exec myserver bash + $ SCW_SECURE_EXEC=1 scw exec myserver bash $ scw exec -w $(scw start $(scw create ubuntu-trusty)) bash $ scw exec $(scw start -w $(scw create ubuntu-trusty)) bash $ scw exec myserver tmux new -d sleep 10 diff --git a/pkg/cli/main.go b/pkg/cli/main.go index a1709325b9..dd9abac3e5 100644 --- a/pkg/cli/main.go +++ b/pkg/cli/main.go @@ -50,13 +50,6 @@ func Start(rawArgs []string, streams *commands.Streams) (int, error) { return 1, fmt.Errorf("unable to open .scwrc config file: %v", cfgErr) } - if config != nil { - defaultComputeAPI := os.Getenv("scaleway_api_endpoint") - if defaultComputeAPI == "" { - defaultComputeAPI = config.ComputeAPI - } - } - if *flVersion { fmt.Fprintf(streams.Stderr, "scw version %s, build %s\n", scwversion.VERSION, scwversion.GITCOMMIT) return 0, nil diff --git a/pkg/commands/info.go b/pkg/commands/info.go index e98ad1412c..0e446f660c 100644 --- a/pkg/commands/info.go +++ b/pkg/commands/info.go @@ -11,6 +11,7 @@ import ( "github.com/kardianos/osext" + "github.com/scaleway/scaleway-cli/pkg/api" "github.com/scaleway/scaleway-cli/pkg/config" ) @@ -25,7 +26,7 @@ func RunInfo(ctx CommandContext, args InfoArgs) error { fmt.Fprintf(ctx.Stdout, "Organization:\t\t%s\n", ctx.API.Organization) // FIXME: add partially-masked token - fmt.Fprintf(ctx.Stdout, "API Endpoint:\t\t%s\n", ctx.Getenv("scaleway_api_endpoint")) + fmt.Fprintf(ctx.Stdout, "API Endpoint:\t\t%s\n", api.ComputeAPI) configPath, _ := config.GetConfigFilePath() fmt.Fprintf(ctx.Stdout, "RC file:\t\t%s\n", configPath) fmt.Fprintf(ctx.Stdout, "User:\t\t\t%s\n", ctx.Getenv("USER")) diff --git a/pkg/config/config.go b/pkg/config/config.go index 0be1f3ec33..aea800174f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -83,9 +83,6 @@ func GetConfig() (*Config, error) { config.AccountAPI = "https://account.scaleway.com" config.Save() } - if os.Getenv("scaleway_api_endpoint") == "" { - os.Setenv("scaleway_api_endpoint", config.ComputeAPI) - } return &config, nil } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 4e35cffb78..db20c53a67 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -79,7 +79,7 @@ func SSHExec(publicIPAddress string, privateIPAddress string, command []string, // NewSSHExecCmd computes execve compatible arguments to run a command via ssh func NewSSHExecCmd(publicIPAddress string, privateIPAddress string, allocateTTY bool, command []string, gatewayIPAddress string) *sshcommand.Command { quiet := os.Getenv("DEBUG") != "1" - secureExec := os.Getenv("exec_secure") == "1" + secureExec := os.Getenv("SCW_SECURE_EXEC") == "1" sshCommand := &sshcommand.Command{ AllocateTTY: true, Command: command,