authelia: do not use dots in systemd service name

This commit is contained in:
ibizaman 2025-12-13 15:00:58 +01:00
parent a3fd215638
commit 8db96e92ce
3 changed files with 6 additions and 3 deletions

View file

@ -11,7 +11,7 @@ let
cfg = config.shb.authelia;
opt = options.shb.authelia;
fqdn = "${cfg.subdomain}.${cfg.domain}";
fqdn = builtins.replaceStrings [ "." ] [ "_" ] "${cfg.subdomain}.${cfg.domain}";
fqdnWithPort = if isNull cfg.port then fqdn else "${fqdn}:${toString cfg.port}";
autheliaCfg = config.services.authelia.instances.${fqdn};

View file

@ -133,7 +133,7 @@ in
def tests():
machine.wait_for_unit("lldap.service")
machine.wait_for_unit("authelia-authelia.machine.com.target")
machine.wait_for_unit("authelia-authelia_machine_com.target")
machine.wait_for_open_port(9091)
endpoints = json.loads(machine.succeed("curl -s http://machine.com/.well-known/openid-configuration"))

View file

@ -75,7 +75,9 @@ let
''
+ lib.strings.concatMapStrings (s: ''server.wait_for_unit("${s}")'' + "\n") (
waitForServices args
++ (lib.optionals autheliaEnabled [ "authelia-auth.${cfg.domain}.service" ])
++ (lib.optionals autheliaEnabled [
"authelia-auth_${builtins.replaceStrings [ "." ] [ "_" ] cfg.domain}.service"
])
++ (lib.optionals lldapEnabled [ "lldap.service" ])
)
+ lib.strings.concatMapStrings (p: ''server.wait_for_open_port(${toString p})'' + "\n") (
@ -230,6 +232,7 @@ in
baseImports
../modules/blocks/hardcodedsecret.nix
../modules/blocks/nginx.nix
../modules/blocks/postgresql.nix
];
config = {
# HTTP(s) server port.