diff --git a/hosts/rpi4/authelia.nix b/hosts/rpi4/authelia.nix index a47e46a..4141e6e 100644 --- a/hosts/rpi4/authelia.nix +++ b/hosts/rpi4/authelia.nix @@ -24,16 +24,18 @@ let instance: let inherit (config.services.authelia.instances.${instance}.settings) server; - inherit (server) port; - host = - if server.host == "0.0.0.0" then + port = server.port or 9091; + host = server.host or "127.0.0.1"; + + targetHost = + if host == "0.0.0.0" then "127.0.0.1" - else if lib.hasInfix ":" server.host then + else if lib.hasInfix ":" host then throw "TODO IPv6 not supported in Authelia server address (hard to parse, can't tell if it is [::])." else - server.host; + host; in - "http://${host}:${toString port}"; + "http://${targetHost}:${toString port}"; # use this when reverse proxying to authelia (and only authelia because i # like the nixos recommended proxy settings better)