From c847ac4a4c55d6a5a457f6ef494cf45a47299e01 Mon Sep 17 00:00:00 2001 From: pschou Date: Fri, 12 Jan 2024 16:11:42 -0500 Subject: [PATCH] feat(cli): add environment variable for specifying alternate directory URL (#2061) --- cmd/flags.go | 1 + docs/data/zz_cli_help.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/flags.go b/cmd/flags.go index b014a1ff..5d08fa20 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -18,6 +18,7 @@ func CreateFlags(defaultPath string) []cli.Flag { &cli.StringFlag{ Name: "server", Aliases: []string{"s"}, + EnvVars: []string{"LEGO_SERVER"}, Usage: "CA hostname (and optionally :port). The server certificate must be trusted in order to avoid further modifications to the client.", Value: lego.LEDirectoryProduction, }, diff --git a/docs/data/zz_cli_help.toml b/docs/data/zz_cli_help.toml index 782fe2af..b6fd50c0 100644 --- a/docs/data/zz_cli_help.toml +++ b/docs/data/zz_cli_help.toml @@ -20,7 +20,7 @@ COMMANDS: GLOBAL OPTIONS: --domains value, -d value [ --domains value, -d value ] Add a domain to the process. Can be specified multiple times. - --server value, -s value CA hostname (and optionally :port). The server certificate must be trusted in order to avoid further modifications to the client. (default: "https://acme-v02.api.letsencrypt.org/directory") + --server value, -s value CA hostname (and optionally :port). The server certificate must be trusted in order to avoid further modifications to the client. (default: "https://acme-v02.api.letsencrypt.org/directory") [$LEGO_SERVER] --accept-tos, -a By setting this flag to true you indicate that you accept the current Let's Encrypt terms of service. (default: false) --email value, -m value Email used for registration and recovery contact. --csr value, -c value Certificate signing request filename, if an external CSR is to be used.