summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jian <me@linj.tech>2022-06-29 10:32:52 +0800
committerLin Jian <me@linj.tech>2022-06-29 10:36:24 +0800
commitd1b90cf54005e690f30bdf991df05a68ca0762d3 (patch)
treea85c40da8c773b3e08216ddcab818d520fbcc76e
parentMerge pull request #179069 from r-ryantm/auto-update/fdm (diff)
downloadnixpkgs-d1b90cf54005e690f30bdf991df05a68ca0762d3.tar.gz
nixos/caddy: force caddy to reload config in ExecReload
This patch follows an upstream commit[1]. Before this patch, if acme module is used, caddy will still use an old cert even a new one is available. The cause is that without --force flag, caddy will not reload an unchanged config. Refer to that commit[1] message for more information. [1]: https://github.com/caddyserver/dist/commit/979e498d6d01e1fe7c22db848a3e3bc65369183f
-rw-r--r--nixos/modules/services/web-servers/caddy/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/web-servers/caddy/default.nix b/nixos/modules/services/web-servers/caddy/default.nix
index 2b8c6f2e308b..b262313577f1 100644
--- a/nixos/modules/services/web-servers/caddy/default.nix
+++ b/nixos/modules/services/web-servers/caddy/default.nix
@@ -299,7 +299,7 @@ in
# https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart=
# If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect.
ExecStart = [ "" "${cfg.package}/bin/caddy run --config ${cfg.configFile} --adapter ${cfg.adapter} ${optionalString cfg.resume "--resume"}" ];
- ExecReload = [ "" "${cfg.package}/bin/caddy reload --config ${cfg.configFile} --adapter ${cfg.adapter}" ];
+ ExecReload = [ "" "${cfg.package}/bin/caddy reload --config ${cfg.configFile} --adapter ${cfg.adapter} --force" ];
ExecStartPre = "${cfg.package}/bin/caddy validate --config ${cfg.configFile} --adapter ${cfg.adapter}";
User = cfg.user;