From 95251e1250949306d2e5216be4926821d025091f Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Mon, 29 Jun 2026 14:38:49 -0500 Subject: [PATCH] fix(secrets): correct sops-nix rendered template paths This commit corrects the file paths for the dynamically generated environment variables and Authelia `users.yml` file. `sops-nix` outputs evaluated templates to `/run/secrets/rendered/`, instead of the base secrets directory. - Update `docker-compose.yml` volume mounts to use `/run/secrets/rendered/` - Fix CLI examples in `README.md` and `setup_guide.md` to use the updated path - Update architecture documentation to reflect accurate SOPS behavior --- README.md | 2 +- docker-compose.yml | 2 +- docs/setup_guide.md | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3b7b28e..915e272 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ journalctl -u homeserver-core -f ### Manual Verification If running manually (or troubleshooting config edits): ```bash -docker compose --env-file /run/secrets/homeserver.env up -d --remove-orphans +docker compose --env-file /run/secrets/rendered/homeserver.env up -d --remove-orphans ``` --- diff --git a/docker-compose.yml b/docker-compose.yml index 43252a6..708ddf8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -101,7 +101,7 @@ services: restart: always volumes: - ./config/authelia:/config - - /run/secrets/users.yml:/config/users.yml:ro + - /run/secrets/rendered/users.yml:/config/users.yml:ro environment: - DOMAIN=${DOMAIN} - AUTHELIA_SESSION_SECRET=${AUTHELIA_SESSION_SECRET} diff --git a/docs/setup_guide.md b/docs/setup_guide.md index ee1df95..6d15fd1 100644 --- a/docs/setup_guide.md +++ b/docs/setup_guide.md @@ -27,7 +27,7 @@ Secrets are managed declaratively using **`sops-nix`** (Mozilla SOPS + age keys) [~/Config/hosts/desktop/secrets.yaml] (Encrypted) │ ▼ (Decrypted at boot by sops-nix using SSH host key) -[/run/secrets/homeserver.env] (Runtime Environment File) +[/run/secrets/rendered/homeserver.env] (Runtime Environment File) │ ▼ (Fed via --env-file flag into Docker Compose) [Docker Containers] (Active environment variables) @@ -69,7 +69,7 @@ To add or modify credentials (e.g. changing your Dynu API key or updating Authel The stack is managed as a declarative systemd service inside `/home/kiskaadee/Config/hosts/desktop/homeserver.nix`: ### 1. Secret Environment Template -The module defines a SOPS template to gather all secrets and structure them as key-value pairs at `/run/secrets/homeserver.env`: +The module defines a SOPS template to gather all secrets and structure them as key-value pairs at `/run/secrets/rendered/homeserver.env`: ```nix sops.templates."homeserver.env" = { owner = "kiskaadee"; @@ -136,6 +136,6 @@ Because the systemd service manages the containers, standard `systemctl` command If you modify `docker-compose.yml` (e.g. adding a new Traefik routing label), you do **not** need to rebuild NixOS! You can apply it instantly: ```bash cd /home/kiskaadee/Deployments/homeserver -docker compose --env-file /run/secrets/homeserver.env up -d --remove-orphans +docker compose --env-file /run/secrets/rendered/homeserver.env up -d --remove-orphans ``` This preserves the extreme agility of Docker Compose while keeping your system configuration and secrets declaratively managed.