2024-05-20 12:19:05 +02:00
|
|
|
{ config, ... }:
|
|
|
|
let
|
|
|
|
domain = "auth.${config.networking.domain}";
|
|
|
|
in
|
|
|
|
{
|
2024-05-23 09:25:08 +02:00
|
|
|
age.secrets.authentik-core = {
|
|
|
|
file = ../../../../secrets/nuc/authentik/core.age;
|
|
|
|
};
|
|
|
|
age.secrets.authentik-ldap = {
|
|
|
|
file = ../../../../secrets/nuc/authentik/ldap.age;
|
2024-05-20 12:19:05 +02:00
|
|
|
};
|
|
|
|
services.authentik = {
|
|
|
|
enable = true;
|
2024-05-23 09:25:08 +02:00
|
|
|
environmentFile = config.age.secrets.authentik-core.path;
|
|
|
|
};
|
|
|
|
services.authentik-ldap = {
|
|
|
|
enable = true;
|
|
|
|
environmentFile = config.age.secrets.authentik-ldap.path;
|
2024-05-20 12:19:05 +02:00
|
|
|
};
|
2024-05-21 18:44:04 +02:00
|
|
|
services.caddy.virtualHosts."${domain}".extraConfig = ''
|
|
|
|
reverse_proxy localhost:9000
|
|
|
|
'';
|
2024-05-24 00:22:19 +02:00
|
|
|
# open the firewall for proxy auth
|
|
|
|
networking.firewall.allowedTCPPorts = [ 9000 ];
|
2024-05-20 12:19:05 +02:00
|
|
|
}
|