From 9983828e01375e1f46ecc82f8d37346fbf2675c6 Mon Sep 17 00:00:00 2001 From: Andy Librian Date: Sat, 2 Oct 2021 17:41:25 +0700 Subject: [PATCH] feat(tarianctl): support setting tls params through env vars --- pkg/tarianctl/cmd/flags.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkg/tarianctl/cmd/flags.go b/pkg/tarianctl/cmd/flags.go index caef914d..4205ec68 100644 --- a/pkg/tarianctl/cmd/flags.go +++ b/pkg/tarianctl/cmd/flags.go @@ -25,19 +25,22 @@ func CmdFlags() []cli.Flag { EnvVars: []string{"TARIAN_SERVER_ADDRESS"}, }, &cli.BoolFlag{ - Name: "server-tls-enabled", - Usage: "If enabled, it will communicate with the server using TLS", - Value: false, + Name: "server-tls-enabled", + Usage: "If enabled, it will communicate with the server using TLS", + Value: false, + EnvVars: []string{"TARIAN_TLS_ENABLED"}, }, &cli.StringFlag{ - Name: "server-tls-ca-file", - Usage: "The CA the server uses for TLS connection.", - Value: "", + Name: "server-tls-ca-file", + Usage: "The CA the server uses for TLS connection.", + Value: "", + EnvVars: []string{"TARIAN_TLS_CA_FILE"}, }, &cli.BoolFlag{ - Name: "server-tls-insecure-skip-verify", - Usage: "If set to true, it will skip server's certificate chain and hostname verification", - Value: true, + Name: "server-tls-insecure-skip-verify", + Usage: "If set to true, it will skip server's certificate chain and hostname verification", + Value: true, + EnvVars: []string{"TARIAN_TLS_INSECURE_SKIP_VERIFY"}, }, } }