Skip to content

Commit 538acd9

Browse files
Pierre-Etienne Meunierglobin
Pierre-Etienne Meunier
authored andcommittedNov 2, 2017
ACME module: add server option (#31122)
1 parent ccbcf15 commit 538acd9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed
 

‎nixos/modules/security/acme.nix

+17-1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ in
139139
'';
140140
};
141141

142+
production = mkOption {
143+
type = types.bool;
144+
default = true;
145+
description = ''
146+
If set to true, use Let's Encrypt's production environment
147+
instead of the staging environment. The main benefit of the
148+
staging environment is to get much higher rate limits.
149+
150+
See
151+
<literal>https://letsencrypt.org/docs/staging-environment</literal>
152+
for more detail.
153+
'';
154+
};
155+
142156
certs = mkOption {
143157
default = { };
144158
type = with types; attrsOf (submodule certOpts);
@@ -177,7 +191,9 @@ in
177191
cmdline = [ "-v" "-d" domain "--default_root" data.webroot "--valid_min" cfg.validMin ]
178192
++ optionals (data.email != null) [ "--email" data.email ]
179193
++ concatMap (p: [ "-f" p ]) data.plugins
180-
++ concatLists (mapAttrsToList (name: root: [ "-d" (if root == null then name else "${name}:${root}")]) data.extraDomains);
194+
++ concatLists (mapAttrsToList (name: root: [ "-d" (if root == null then name else "${name}:${root}")]) data.extraDomains)
195+
++ (if cfg.production then []
196+
else ["--server" "https://acme-staging.api.letsencrypt.org/directory"]);
181197
acmeService = {
182198
description = "Renew ACME Certificate for ${cert}";
183199
after = [ "network.target" "network-online.target" ];

0 commit comments

Comments
 (0)
Please sign in to comment.