[nomad-step-2] S2.2 — tools/vault-import.sh (import .env + sops into KV) #880
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#880
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 — Vault policies + workload identity + secrets import.
Goal
Land
tools/vault-import.sh— the one-shot import tool that reads the existing.envand sops-encrypted.env.vault.encfrom the old docker stack and writes them to Vault KV paths matching the S2.1 policy layout.Scope
Create
tools/vault-import.shusinglib/hvault.shhelpers (P4). Invocation:Mapping (per the migration plan):
.env:FORGE_{ROLE}_TOKEN+FORGE_{ROLE}_PASS→kv/disinto/bots/<role>/{token,password}for each of review, dev, gardener, architect, planner, predictor, supervisor, vault.FORGE_TOKEN_LLAMA+FORGE_PASS_LLAMA→kv/disinto/bots/dev-qwen/{token,password}.FORGE_TOKEN+FORGE_PASS→kv/disinto/shared/forge/{token,password}(generic admin/app creds).FORGE_ADMIN_TOKEN→kv/disinto/shared/forge/admin_token.WOODPECKER_AGENT_SECRET,WP_FORGEJO_CLIENT,WP_FORGEJO_SECRET,WOODPECKER_TOKEN→kv/disinto/shared/woodpecker/<lowercase_key>.FORWARD_AUTH_SECRET,CHAT_OAUTH_CLIENT_ID,CHAT_OAUTH_CLIENT_SECRET→kv/disinto/shared/chat/<lowercase_key>..env.vault.enc(pipe throughsops -d --output-type dotenvwithSOPS_AGE_KEY_FILE=<path>):GITHUB_TOKEN,CODEBERG_TOKEN,CLAWHUB_TOKEN,DEPLOY_KEY,NPM_TOKEN,DOCKER_HUB_TOKEN→kv/disinto/runner/<NAME>/value.Idempotency:
lib/hvault.sh::hvault_kv_get. Reportunchanged/updated/createdper key.--dry-runflag: prints the full import plan (paths + which env var source), exits 0 without writing.Security:
VAULT_ADDRis not localhost (avoid accidentally writing to a prod Vault).Acceptance criteria
.env+ fixture sops file (both intests/fixtures/), writes expected paths to a dev-mode Vault launched in CI.unchanged.updated.--dry-runmode prints the plan, doesn't touch Vault.tests/fixtures/dot-env-incomplete(missing a required key) → clear error naming the missing key.shellcheckclean.Non-goals
disinto init(S2.5 does that).Labels / meta
[nomad-step-2] S2.2— no dependencies.secret/mount prefix but migration policies usekv/— agents will get 403 #890dev-bot referenced this issue2026-04-16 20:03:12 +00:00