fix(secrets): wizard expands ~ and re-prompts for the offline-copy directory #146

Merged
jfraeys merged 4 commits from jfraeys/fix/wizard-offline-dir-prompt into main 2026-10-14 10:49:19 -04:00
Owner

Found on the first real run of scripts/project-keys-wizard.sh: entering ~/Documents/recovery_codes was rejected (not a directory) because read does not expand ~, and the stage then exited the whole wizard.

  • Expand a leading ~ to $HOME.
  • Loop on an invalid path instead of exiting; blank still skips.

Re-running was already safe (existing Keychain/Bitwarden items are not overwritten; their public keys are derived), so nothing was lost.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ

Found on the first real run of `scripts/project-keys-wizard.sh`: entering `~/Documents/recovery_codes` was rejected (`not a directory`) because `read` does not expand `~`, and the stage then exited the whole wizard. - Expand a leading `~` to `$HOME`. - Loop on an invalid path instead of exiting; blank still skips. Re-running was already safe (existing Keychain/Bitwarden items are not overwritten; their public keys are derived), so nothing was lost. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(secrets): wizard expands ~ and re-prompts for the offline-copy directory
Some checks failed
Lint / lint (pull_request) Has started running
Secret scan / scan (pull_request) Has been cancelled
998a5af7cb
read does not expand a leading ~, so "~/Documents/x" was rejected as "not a
directory" and the whole wizard exited. Expand it, and loop on a bad path
instead of exiting (blank still skips).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(secrets): wizard reads bare KEY names from .env.example
Some checks failed
Lint / lint (pull_request) Has started running
Secret scan / scan (pull_request) Has been cancelled
f78320520c
forge-agent's .env.example lists bare names (no "="), which the parser skipped,
so it emitted nothing and sops failed with "Error unmarshalling file: EOF".
Accept bare names, KEY=..., export KEY=..., and trailing comments; fail with a
clear message when no names are found.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(secrets): wizard keeps an existing offline copy of the recovery key on re-run
Some checks failed
Lint / lint (pull_request) Has started running
Secret scan / scan (pull_request) Has been cancelled
1567fc29dc
A re-run hit "already exists; refusing to overwrite" after the first run had
written the file. Never overwrite it, but keep it when its public key matches
the recovery key, and refuse with a clear message when it does not.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(secrets): sops exec-env takes one quoted command, not "-- cmd args"
All checks were successful
Lint / lint (pull_request) Successful in 1m37s
Secret scan / scan (pull_request) Successful in 12s
b03e8d23ef
exec-env requires exactly two arguments (file, command string) and has no "--"
handling, so "sops exec-env FILE -- go run ./dev integration" fails with the
misleading "error: missing file to decrypt" (cmd/sops/main.go: c.NArg() != 2).
Found on the first real wizard run. Fix the wizard (run + printed command + the
recovery doc it writes) and the two docs that recommended the "--" form.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!146
No description provided.