Commit 04e33d3
Fix install-secrets.sh sentinel check for non-task invocation
PR #29's e2e workflow surfaced this: when invoked directly (not via
`task install`), the script silently no-ops and the stack comes up
with mariadb running on the literal CHANGE_ME password while
DATABASE_URL has the would-be-random hex. Doctrine: access denied,
exit code 1045.
Root cause: the sentinel check reads `$MARIADB_PASSWORD` from the env,
which is populated by Taskfile's `dotenv:` directive — but only when
the script runs as part of a `task` invocation. Direct invocation
(CI workflow, operator running from a fresh shell) leaves both
$MARIADB_PASSWORD and $MARIADB_ROOT_PASSWORD empty. The condition
"if NEITHER is CHANGE_ME, skip" then matches because both are "" —
not "CHANGE_ME" — and the script exits 0 without doing anything.
Fix: source .env.mariadb at the top of the script. Idempotent when
the env is already populated; load-bearing for direct invocation.
Same pattern env-init.sh uses for .env.
Verified: `env -i ./install-secrets.sh` (empty env) now correctly
detects the CHANGE_ME sentinel, generates random passwords, and
syncs DATABASE_URL.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 64f2783 commit 04e33d3
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
23 | 34 | | |
24 | 35 | | |
25 | 36 | | |
| |||
0 commit comments