SOPS changes to secrets.app.env don't restart app containers #13
Labels
No labels
dependencies
major
security-pin
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
trails-cool/trails#13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrated from GitHub issue #294 (opened 2026-04-24 by @stigi, before the Forgejo migration). Re-verified against the current
.forgejo/workflows on 2026-07-26 — the bug is fully intact, and the ported workflows carried it over verbatim. Line references below are updated to the current files.Problem
Editing
infrastructure/secrets.app.env(SOPS) does not restart theplanner/journalcontainers on the flagship. The BRouter cutover (PR #293) exposed this: the PR only touched SOPS + tasks.md. After merge:cd-apps.ymldid not trigger — itspaths:only includeapps/**,packages/**,pnpm-lock.yaml.cd-infra.ymltriggered, but its default deploy path only recreatespostgres prometheus loki promtail grafana postgres-exporter node-exporter cadvisor(explicitly listed in thedocker compose upcommand). It copies the new.envto the server but leaves the Planner/Journal containers running with the old env.The workaround was to SSH and run
docker compose --env-file .env up -d plannermanually to pick up the newBROUTER_URL.Why it matters
docs/deployment.md:43§Secrets rotation says "Commit + push + merge →cd-appsredeploys the Planner with the new token" — not true today. Anyone rotatingBROUTER_AUTH_TOKEN,SENTRY_AUTH_TOKENetc. via SOPS will silently leave the old value in the running app containers, with nothing going red.This is a silent failure, which is what makes it worth fixing rather than documenting.
Fix options
infrastructure/secrets.app.envtocd-apps.ymlpaths:. Pro: simplest; cd-apps already rebuilds+deploys planner/journal. Con: a full image rebuild for a secret-only change is overkill.cd-infra.ymlto restartplanner journalwhensecrets.app.envchanged. Pro: fast (no image rebuild). Con: a little more logic (paths-filter or git diff in the workflow).restart_allrun after any SOPS app-secret edit. Pro: zero workflow change. Con: easy to forget; makes secret rotation a manual two-step.Option 2 is probably the right default. Happy to take suggestions.
Current evidence (re-checked 2026-07-26)
.forgejo/workflows/cd-apps.yml—paths:isapps/**,packages/**,pnpm-lock.yaml; noinfrastructure/**at all..forgejo/workflows/cd-infra.yml:80— the explicit service list indocker compose --env-file .env up -d --remove-orphans postgres prometheus loki promtail grafana postgres-exporter node-exporter cadvisorstill excludes planner/journal. (Line 78 is therestart_all=truebranch, which does cover them — that is the current manual escape hatch.)docs/deployment.md:43— the documentation claim still does not match behaviour.Changed since the original report
.github/workflows/to.forgejo/workflows/, so any fix belongs there. GitHub Actions is off and the GitHub repo is retired.docs/deployment.mdstill tells you to rungh workflow run cd-brouter.ymlfor step 4, which no longer works — worth fixing in the same pass, since a reader following those steps today gets stuck twice.restart_all=trueinput oncd-infrais the accurate description of today's workaround, so option 3 is at least now expressible without SSH.