fix: [nomad-step-2] S2-fix-F — wire tools/vault-seed-<svc>.sh into bin/disinto --with <svc> (#928) #929
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#929
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-928"
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 #928
Changes
AI Review
Summary\n\nDry-run path and test are correct. The real-run seed path has one blocking bug in the non-root execution branch.\n\n### Findings\n\n- blocker
bin/disinto:947: sudo does not passVAR=valuearguments throughenv_reset. The line:\nbash\n sudo -n "VAULT_ADDR=$vault_addr" -- "$seed_script" || exit $?\n\n treatsVAULT_ADDR=...as a sudoers env-assignment argument. With the defaultenv_reset=onsudoers policy (almost all distros), sudo silently discards env assignments unless the variable is listed inenv_keep.VAULT_ADDRis not a standardenv_keepentry. The script will execute withoutVAULT_ADDRset, andvault-seed-forgejo.shline 109 immediately dies:\n\n [ -n "${VAULT_ADDR:-}" ] || die "VAULT_ADDR unset"\n\n Fix: runenvas the command under sudo so the variable is set inside the subprocess regardless of sudoers policy:\nbash\n sudo -n -- env VAULT_ADDR="$vault_addr" "$seed_script" || exit $?\n\n The root (non-sudo) branch at line 941 is correct:VAULT_ADDR="$vault_addr" "$seed_script"uses shell-level env assignment and is unaffected.\n\n### Confirmation test\n\nAfter the fix, a non-root run with a seed script that doesecho $VAULT_ADDRshould print the resolved address rather than an empty string.Verdict
REQUEST_CHANGES — sudo -n VAR=value is silently stripped by env_reset; VAULT_ADDR will be unset when the seeder runs as non-root, causing vault-seed-forgejo.sh to die at its own precondition check
Reviewed at
5e83ecc| AGENTS.mdAI Review: REQUEST_CHANGES — sudo -n VAR=value is silently stripped by env_reset; VAULT_ADDR will be unset when the seeder runs as non-root, causing vault-seed-forgejo.sh to die at its own precondition check
AI Re-review (round 2)
Previous Findings\n- blocker
bin/disinto:947sudo drops VAULT_ADDR via env_reset → FIXED: line 954 now usessudo -n -- env "VAULT_ADDR=$vault_addr" "$seed_script";envis the actual command executed as root, so the variable is set in the child process regardless of sudoers policy.\n\n### New Issues\n\nNone. The fix is a minimal one-line substitution. The added regression test (positive grep for safe form + negative grep for unsafe form) is a clean guard against revert.Verdict
APPROVE — Previous blocker fixed: sudo now invokes env as the command, passing VAULT_ADDR through env_reset; regression test guards against revert
Reviewed at
f214080| Previous:5e83ecc| AGENTS.mdAI Re-review (round 2): APPROVE — Previous blocker fixed: sudo now invokes env as the command, passing VAULT_ADDR through env_reset; regression test guards against revert