From 388acc293c0fa05a05ce8a63ee389d6446cf8de7 Mon Sep 17 00:00:00 2001 From: ibizaman <ibizapeanut@gmail.com> Date: Mon, 2 Sep 2024 08:53:56 +0200 Subject: [PATCH] revert: make sure fox nginx to wait on authelia This was not the root cause of Nginx not starting. The root cause was the DNS server was restarting at the same time as Nginx and wasn't ready yet. There is no DNS block yet in Self Host Blocks so the code is removed for now. --- modules/blocks/authelia.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/blocks/authelia.nix b/modules/blocks/authelia.nix index bf07174..d27db34 100644 --- a/modules/blocks/authelia.nix +++ b/modules/blocks/authelia.nix @@ -416,15 +416,6 @@ in ${pkgs.bash}/bin/bash -c '(while ! ${pkgs.netcat-openbsd}/bin/nc -z -v -w1 ${cfg.ldapHostname} ${toString cfg.ldapPort}; do echo "Waiting for port ${cfg.ldapHostname}:${toString cfg.ldapPort} to open..."; sleep 2; done); sleep 2' ''); - - # Need to wait on auth endpoint to be available otherwise nginx can fail to start. - # For example when DNS server is restarting at the same time or Auth endpoint itself. - systemd.services.nginx = - { - wants = [ "authelia-${fqdn}.service" ]; - after = [ "authelia-${fqdn}.service" ]; - }; - services.nginx.virtualHosts.${fqdn} = { forceSSL = !(isNull cfg.ssl); sslCertificate = lib.mkIf (!(isNull cfg.ssl)) cfg.ssl.paths.cert;