Skip to content

Commit d217064

Browse files
n0emisldez
andauthored
Allow to set EAB kid and hmac via environment variables (go-acme#1959)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent ae78237 commit d217064

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

cmd/flags.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,19 @@ func CreateFlags(defaultPath string) []cli.Flag {
3737
Usage: "Certificate signing request filename, if an external CSR is to be used.",
3838
},
3939
&cli.BoolFlag{
40-
Name: "eab",
41-
Usage: "Use External Account Binding for account registration. Requires --kid and --hmac.",
40+
Name: "eab",
41+
EnvVars: []string{"LEGO_EAB"},
42+
Usage: "Use External Account Binding for account registration. Requires --kid and --hmac.",
4243
},
4344
&cli.StringFlag{
44-
Name: "kid",
45-
Usage: "Key identifier from External CA. Used for External Account Binding.",
45+
Name: "kid",
46+
EnvVars: []string{"LEGO_EAB_KID"},
47+
Usage: "Key identifier from External CA. Used for External Account Binding.",
4648
},
4749
&cli.StringFlag{
48-
Name: "hmac",
49-
Usage: "MAC key from External CA. Should be in Base64 URL Encoding without padding format. Used for External Account Binding.",
50+
Name: "hmac",
51+
EnvVars: []string{"LEGO_EAB_HMAC"},
52+
Usage: "MAC key from External CA. Should be in Base64 URL Encoding without padding format. Used for External Account Binding.",
5053
},
5154
&cli.StringFlag{
5255
Name: "key-type",

docs/data/zz_cli_help.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ GLOBAL OPTIONS:
2424
--accept-tos, -a By setting this flag to true you indicate that you accept the current Let's Encrypt terms of service. (default: false)
2525
--email value, -m value Email used for registration and recovery contact.
2626
--csr value, -c value Certificate signing request filename, if an external CSR is to be used.
27-
--eab Use External Account Binding for account registration. Requires --kid and --hmac. (default: false)
28-
--kid value Key identifier from External CA. Used for External Account Binding.
29-
--hmac value MAC key from External CA. Should be in Base64 URL Encoding without padding format. Used for External Account Binding.
27+
--eab Use External Account Binding for account registration. Requires --kid and --hmac. (default: false) [$LEGO_EAB]
28+
--kid value Key identifier from External CA. Used for External Account Binding. [$LEGO_EAB_KID]
29+
--hmac value MAC key from External CA. Should be in Base64 URL Encoding without padding format. Used for External Account Binding. [$LEGO_EAB_HMAC]
3030
--key-type value, -k value Key type to use for private keys. Supported: rsa2048, rsa3072, rsa4096, rsa8192, ec256, ec384. (default: "ec256")
3131
--filename value (deprecated) Filename of the generated certificate.
3232
--path value Directory to use for storing the data. (default: "./.lego") [$LEGO_PATH]

0 commit comments

Comments
 (0)