From 17f38bc01dd51958c94d51b8c46fee02292f71cd Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 19 Jan 2025 12:19:00 +0300 Subject: [PATCH] nixos/acme: disable rate limiting to fix the test Sometimes the nginx reload service fires too fast so systemd kills it. --- nixos/modules/services/web-servers/nginx/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix index 70726f126226..7bf52b43f3f7 100644 --- a/nixos/modules/services/web-servers/nginx/default.nix +++ b/nixos/modules/services/web-servers/nginx/default.nix @@ -1333,7 +1333,14 @@ in restartTriggers = optionals cfg.enableReload [ configFile ]; # Block reloading if not all certs exist yet. # Happens when config changes add new vhosts/certs. - unitConfig.ConditionPathExists = optionals (sslServices != []) (map (certName: certs.${certName}.directory + "/fullchain.pem") vhostCertNames); + unitConfig = { + ConditionPathExists = optionals (sslServices != []) (map (certName: certs.${certName}.directory + "/fullchain.pem") vhostCertNames); + # Disable rate limiting for this, because it may be triggered quickly a bunch of times + # if a lot of certificates are renewed in quick succession. The reload itself is cheap, + # so even doing a lot of them in a short burst is fine. + # FIXME: there's probably a better way to do this. + StartLimitIntervalSec = 0; + }; serviceConfig = { Type = "oneshot"; TimeoutSec = 60;