fix(coolify): validate the dump bindings, and stop printing $EDITOR #10
No reviewers
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:bootstrap
scope:coolify
scope:db
scope:docs
scope:drill
scope:installer
scope:labels
scope:platform
scope:runner
scope:users
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/rig#10
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/backup-bindings-validation"
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?
Follow-up to #9, from running it on a real control-plane box for the first time. Both bugs
were invisible to the argument-parsing tests — they only exist once the thing actually
executes.
1.
$EDITORis unset on a fresh serverrig printed
$EDITOR /etc/coolify-dump.envas the next step. On a freshly-bootstrapped Debianbox — rig's entire target environment —
$EDITORis unset, so that expands to just thepath, bash tries to execute the
0600file, and you get:Which reads like a permissions bug and isn't one. Now prints
nano.2. Malformed bindings failed deep, and opaquely
S3_BUCKET=my-bucket(nos3://) reads toawsas a local path, so the run died with:— after
pg_dumphad run andagehad encrypted 14 MB, and with nothing in the errorpointing at the actual mistake. The script now validates up front, before spending a dump:
S3_BUCKETmust be ans3://URIS3_ENDPOINTmust carry a schemeBoth fail with the offending value quoted and the reason stated.
What still cannot be validated — and now says so
age's X25519 header does not reveal its recipient. A valid-but-wrong key (staging's
instead of prod's) produces a flawless backup that nobody can open, forever, silently. No check
in rig can catch that. Only decrypting an artifact can.
So the printed next-steps now walk through the read-back explicitly — stream the newest object
down and decrypt it from a machine holding the private key, never the box — and the script
carries a comment saying why that step is not optional. A backup you have never read back is
not yet a backup.
Testing
The dump script ships as an embedded heredoc, so a syntax error in it would be invisible to
CI and would first surface at 04:00 on a live control plane.
test/cli.shnow extracts it andasserts it is valid bash, and that both new guards fire.
bash test/cli.sh→ 39 passed, 0 failed (35 → 39). shellcheck clean.Verified on the real box: dump →
age→ Hetzner Object Storage → streamed back → decryptedwith the prod key → PostgreSQL SQL. The full path works; these are the two rough edges it hit
getting there.
🤖 Generated with Claude Code