[nomad-step-2] S2-fix-D — forgejo.hcl template fallback for missing kv/disinto/shared/forgejo #922
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#922
Loading…
Add table
Add a link
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?
Part of the Nomad+Vault migration. Step-2 sub-bugfix (4/4). Replaces part of the consolidated #912.
Goal
Make
nomad/jobs/forgejo.hcldeployable against an empty Vault (nokv/disinto/shared/forgejopath populated yet). Currently the template waits forever withMissing: vault.read(kv/data/disinto/shared/forgejo)and the alloc staysClient Status = pending, blocking the Step-1 "deploy forgejo" verification when no secrets have been imported yet.Spec reference from #882 (S2.4):
Scope
Pick one of two approaches (either is acceptable):
Approach A — template
{{ with }}{{ else }}fallbackIn
nomad/jobs/forgejo.hcl, change the template block to tolerate the missing path:Add
error_on_missing_key = falseif the template engine still 404s on the{{ with }}branch (behavior varies by Consul Template version; test in the LXC).Approach B — auto-seed on deploy
In
bin/disinto's--with forgejopath, before callingdeploy.sh, call a small helper that checks forkv/disinto/shared/forgejoand, if absent,vault kv puts generated random values. Cleaner because the invariant "forgejo always reads real creds from Vault" holds on first boot.Prefer Approach B — it produces real secrets on first boot rather than shared fallback strings that would matter if someone skipped the seeding.
Acceptance criteria
.envimported), run: Forgejo alloc reachesStatus = running, deploymentsuccessful,curl :3000/api/v1/versionreturns 200. Deploy completes within deploy.sh's 240s timeout.vault-import.shhas run), forgejo reads the real values — no fallback path taken. Verify by comparingnomad alloc exec <forgejo> env | grep SECRET_KEYwithvault kv get -format=json kv/disinto/shared/forgejo.disinto init --backend=nomad --with forgejois a no-op and does not overwrite seeded keys.nomad job validate nomad/jobs/forgejo.hclclean.Non-goals
Labels / meta
[nomad-step-2] S2-fix-D— no hard dependencies.Resolved by merged PR #923 (merge commit
cfe1ef95) which landed all 4 sub-issue fixes at once. Closing as superseded.