Merge pull request #84 from Ma27/restart-worker

module: restart worker when cert is changed
This commit is contained in:
Maximilian Bosch 2026-01-12 13:13:36 +01:00 committed by GitHub
commit 94c544f6cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -300,6 +300,16 @@ in
);
in
{
assertions = [
{
assertion = cfg.nginx.enableACME -> cfg.nginx.enable;
message = ''
Cannot enable `services.authentik.nginx.enableACME` when
`services.authentik.nginx.enable` is `false`.
'';
}
];
services = {
authentik.settings = {
blueprints_dir = mkDefault "${cfg.authentikComponents.staticWorkdirDeps}/blueprints";
@ -441,6 +451,12 @@ in
};
};
security.acme.certs = mkIf cfg.nginx.enableACME {
${cfg.nginx.host}.postRun = ''
systemctl restart authentik-worker.service
'';
};
services.nginx = mkIf cfg.nginx.enable {
enable = true;
recommendedTlsSettings = true;