push_data.sh: no hardcoded deploy user — WOCO_DEPLOY_USER from .env; refuse --import with --dry-run#79
Merged
Merged
Conversation
….env No username is baked into the script anymore. Host resolution is now WOCO_HOST env > WOCO_DEPLOY_USER env > WOCO_DEPLOY_USER in the gitignored .env, failing with a clear message when none is set. The .env is parsed with sed rather than sourced because its Django-style unquoted values are not valid bash. Server-side ownership is unchanged: everything still lands as wocod on both boxes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
--dry-run only ever applied to the rsyncs while --import still executed the real truncate-reload — a destructive operation inside a supposed preview. The combination now exits 2 before any rsync runs. Header no longer endorses blanket passwordless sudo; the two-command scoped drop-in is the documented requirement. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 2, 2026
Merged
Code review overview
Syntax ErrorsFinding 1
Code SmellsFinding 1
Finding 2
Finding 3
BugsFinding 1
Finding 2
Finding 3
Security VulnerabilitiesFinding 1
Finding 2
|
Review-bot findings on #79: a value like 'alice # ssh user' previously became part of the SSH target and failed silently at connect time; the help test now asserts on --dry-run instead of the filename. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
grubermeister
pushed a commit
that referenced
this pull request
Jul 3, 2026
…del (#82) Successor to PRs #77 and #78, whose payloads are now superseded: - #77 (default push_data.sh host to reese@) — superseded by #79, which removes the username default entirely per Michael's instruction. - #78 (CI deploy as reese + WOCO_DEV_SSH_KEY) — superseded by staging's own rework: CI now SSHes directly as wocod with dedicated STAGING/PROD_DEPLOY_SSH_KEY keys and scoped sudo -n, which is stronger. What remained true from their intent is that the docs still described the old root-deploy world: STAGING_WOCO_DEV.md told operators to push data as root@woco.dev and AUTH_SYNC.md to scp as root@ — both impossible now that root login is disabled, and contrary to the deploy model. Updated to <your-user>@ with notes that files still land owned by wocod, and marked the provisioning section's root SSH as initial-setup-only. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per Michael's request: remove any specific user from push_data.sh and rely on the local .env for the username. wocod remains the owner/runtime user on both boxes — nothing changes server-side.
Changes
WOCO_HOSTenv >WOCO_DEPLOY_USERenv >WOCO_DEPLOY_USERin the gitignored repo-root.env; fails with a clear message when none is set. No username default remains in the script..envis sed-extracted, not sourced — it's a Django-style env file whose unquoted values (DEFAULT_FROM_EMAIL=WorldCovers <no-reply@...>) are not valid bash and would kill the script underset -e.WOCO_DEPLOY_USER=documented in.env.example.--dry-runnow refuses--import— previously the rsyncs were previewed but the import still really truncate-reloaded the live DB.Tests
tools/tests/test_push_data.py(new, 5 tests): missing-user failure,--helpwithout config,.envresolution buildsuser@hellowoco.app(with a Django-style.envfixture),WOCO_HOSToverride precedence, and dry-run/import refusal with no rsync executed (PATH-stubbed rsync).Note for reviewers: I read "wocod user should be who deploys on both boxes" as the ownership/runtime invariant (
--chown=wocod:wocod,sudo -u wocod), which is unchanged — not as "SSH in as wocod". Please confirm.🤖 Generated with Claude Code