fix: [nomad-step-2] S2.4 — forgejo.hcl reads admin creds from Vault via template stanza (#882) #897
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#897
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-882"
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?
Fixes #882
Changes
AI Review
Summary
S2.4 adds two things: (1) a
vault { role }+templatestanza toforgejo.hclthat pullsSECRET_KEYandINTERNAL_TOKENfrom Vault KV v2 at runtime, and (2)tools/vault-seed-forgejo.shto populate that path on a fresh box. Both pieces are reviewed below.forgejo.hcl
secrets/forgejo.envis the per-alloc Nomad secrets dir (never on host FS, never innomad job inspectoutput). Correct.kv/data/disinto/shared/forgejouses the required/data/segment for KV v2 API access. Correct.{{- with secret ... -}}/{{- else -}}/{{- end -}}is valid;.Data.data.secret_keyis the correct accessor for a KV v2 response. Correct.seed-me(7 chars) stays under the 16-char secret-scan threshold. The behavior is intentional and documented; prior commit shortened these from longer strings that tripped CI.service-forgejois defined invault/roles.yamlwithjob_id: forgejobound claim matching this jobspec name. Correct.tools/vault-seed-forgejo.sh
desired_*vars are never set in dry-run so the write block is never reached; thegenerated[]array still populates to produce accurate output. Correct._hvault_request(private) directly for mount-enable and KV write, correctly targeting thekv/mount. The publichvault_kv_putinlib/hvault.shhardcodes asecret/data/prefix (pre-existing issue, not in this diff) and would have been wrong here; the seed script bypasses it appropriately.case " ${generated[*]} "pattern is valid for whitespace-safe element names (secret_key,internal_token). Correct.Pre-existing tech-debt filed
vault/policies/service-forgejo.hcl:9: Policy pathkv/data/disinto/shared/forgejo/*uses a glob that requires at least one path segment afterforgejo/. The template reads the exact pathkv/data/disinto/shared/forgejo(no trailing component), which is not covered by the/*glob. At runtime, consul-template'swithblock would receive 403, fall to theelsebranch, and renderseed-meplaceholders even aftervault-seed-forgejo.shhas run. This file was not changed in this PR. Filed as tech-debt #900.Verdict
APPROVE — Vault workload identity + template stanza are correctly wired; seed script is idempotent and handles all key states; one pre-existing policy-path bug filed as tech-debt #900
Reviewed at
0bc6f9c| AGENTS.mdAI Review: APPROVE — Vault workload identity + template stanza are correctly wired; seed script is idempotent and handles all key states; one pre-existing policy-path bug filed as tech-debt #900