Skip to content

Commit

Permalink
acme: share accounts between certificates
Browse files Browse the repository at this point in the history
There are strict rate limits on account creation for Let's Encrypt
certificates. It is important to reuse credentails when possible.

(cherry picked from commit 827d5e6)
  • Loading branch information
m1cr0man authored and dtzWill committed May 21, 2020
1 parent f83d41a commit a50644f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nixos/modules/security/acme.nix
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,14 @@ in
User = data.user;
Group = data.group;
PrivateTmp = true;
StateDirectory = "acme/.lego/${cert} ${lpath}";
StateDirectory = "acme/.lego/${cert} acme/.lego/accounts ${lpath}";
StateDirectoryMode = if data.allowKeysForGroup then "750" else "700";
WorkingDirectory = spath;
# Only try loading the credentialsFile if the dns challenge is enabled
EnvironmentFile = if data.dnsProvider != null then data.credentialsFile else null;
ExecStart = pkgs.writeScript "acme-start" ''
#!${pkgs.runtimeShell} -e
test -L ${spath}/accounts -o -d ${spath}/accounts || ln -s ../accounts ${spath}/accounts
${pkgs.lego}/bin/lego ${renewOpts} || ${pkgs.lego}/bin/lego ${runOpts}
'';
ExecStartPost =
Expand Down

0 comments on commit a50644f

Please sign in to comment.