From 99bda8740f199528ba287d891adcf607527cf1fe Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Sun, 15 Nov 2026 23:45:54 -0500 Subject: [PATCH] fix(nixos,authelia): grant homelab-operators read access to rendered env templates and fix Authelia env syntax - Add group = "homelab-operators" and mode = "0440" to sops.templates."homeserver.env" and "traefik-deployments.env" so homelab-appctl.service can read rendered env files - Remove unsupported second fallback argument from {{ env "LLDAP_LDAP_BASE_DN" }} in config/authelia/configuration.yml --- config/authelia/configuration.yml | 4 ++-- nixos/modules/homeserver.nix | 2 ++ nixos/modules/traefik-deployments.nix | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/authelia/configuration.yml b/config/authelia/configuration.yml index d9348e4..257b03e 100644 --- a/config/authelia/configuration.yml +++ b/config/authelia/configuration.yml @@ -13,7 +13,7 @@ authentication_backend: address: 'ldap://lldap:3890' timeout: 5s start_tls: false - base_dn: '{{ env "LLDAP_LDAP_BASE_DN" "dc=example,dc=test" }}' + base_dn: '{{ env "LLDAP_LDAP_BASE_DN" }}' additional_users_dn: 'ou=people' users_filter: '(&({username_attribute}={input})(objectClass=person))' additional_groups_dn: 'ou=groups' @@ -24,7 +24,7 @@ authentication_backend: display_name: 'displayName' mail: 'mail' group_name: 'cn' - user: 'uid=admin,ou=people,{{ env "LLDAP_LDAP_BASE_DN" "dc=example,dc=test" }}' + user: 'uid=admin,ou=people,{{ env "LLDAP_LDAP_BASE_DN" }}' access_control: default_policy: deny diff --git a/nixos/modules/homeserver.nix b/nixos/modules/homeserver.nix index 2fc4234..3be8fba 100644 --- a/nixos/modules/homeserver.nix +++ b/nixos/modules/homeserver.nix @@ -63,6 +63,8 @@ # Generate the unified environment file at runtime in /run/secrets/homeserver.env sops.templates."homeserver.env" = { owner = config.homelab.operatorUser; + group = "homelab-operators"; + mode = "0440"; content = lib.generators.toKeyValue {} { DOMAIN = config.homelab.domain; LLDAP_LDAP_BASE_DN = ldapBaseDn; diff --git a/nixos/modules/traefik-deployments.nix b/nixos/modules/traefik-deployments.nix index 66b0b6a..31bbfc4 100644 --- a/nixos/modules/traefik-deployments.nix +++ b/nixos/modules/traefik-deployments.nix @@ -20,6 +20,8 @@ # Generate the unified environment file at runtime in /run/secrets/traefik-deployments.env sops.templates."traefik-deployments.env" = { owner = config.homelab.operatorUser; + group = "homelab-operators"; + mode = "0440"; content = lib.generators.toKeyValue {} { # --- Core / Infrastructure Settings --- PROXY_NETWORK = "proxy-net";