fix: portable vault path resolution across Windows/Mac/Linux

Replace hardcoded D:/vault references with candidate-list pattern
that also checks $HOME/vault, ~/.vault, and respects VAULT_PATH
env var override. Fixes vault.sh lookup failures on Mac and
Howard's machine.

Affected: CLAUDE.md, syncro.md, get-token.sh, patch-tenant-admin-manifest.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 18:58:22 -07:00
parent 347b2d30a9
commit 0a7cd6b778
4 changed files with 32 additions and 14 deletions

View File

@@ -173,14 +173,23 @@ When user references previous work, use `/context` command. Never ask for info i
### Credential Access (SOPS Vault)
Always resolve vault path portably — never hardcode `D:/vault`:
```bash
bash D:/vault/scripts/vault.sh search "keyword" # Search without decrypting
bash D:/vault/scripts/vault.sh get-field <path> <field> # Get specific field
bash D:/vault/scripts/vault.sh get <path> # Decrypt full entry
bash D:/vault/scripts/vault.sh list # List all entries
VAULT_SH=""
for _c in "D:/vault/scripts/vault.sh" "$HOME/vault/scripts/vault.sh" "/d/vault/scripts/vault.sh" "$HOME/.vault/scripts/vault.sh"; do
[[ -f "$_c" ]] && VAULT_SH="$_c" && break
done
[[ -z "$VAULT_SH" ]] && { echo "ERROR: vault not found" >&2; exit 1; }
bash "$VAULT_SH" search "keyword" # Search without decrypting
bash "$VAULT_SH" get-field <path> <field> # Get specific field
bash "$VAULT_SH" get <path> # Decrypt full entry
bash "$VAULT_SH" list # List all entries
```
Vault repo: `D:\vault` — structure: `infrastructure/`, `clients/`, `services/`, `projects/`, `msp-tools/`
Vault repo: cloned at `D:\vault` (Windows) or `~/vault` (Mac/Linux) — set `VAULT_PATH` env var to override.
Structure: `infrastructure/`, `clients/`, `services/`, `projects/`, `msp-tools/`
**1Password fallback:** service account token in `infrastructure/1password-service-account.sops.yaml`