Repository navigation
fix(deploy): never upload .env, .git or local databases with --remote-build - #20
Merged
Merged
Conversation
…-build --remote-build rsynced the whole project root with no exclusions. It now excludes .env, .env.* (keeping .env.example), .git/, *.db/*.sqlite files with their -wal/-shm companions, node_modules/ and .togo/, and honours .gitignore. deploy.include opts paths back in. The scp fallback is refused for remote builds because it cannot exclude files. --dry-run lists the exclusions. Fixes #12 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closed
5 tasks
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.
Fixes #12
--remote-buildranrsync -az -e ssh <root>/ <remote>with no filters. It now passes (first match wins):--include=<p>for eachdeploy.includeentry (new opt-in key intogo.yaml),--include=.env.example,.env,.env.*,.git/,*.db,*.db-wal,*.db-shm,*.db-journal,*.sqlite,*.sqlite3,*.sqlite-wal,*.sqlite-shm,node_modules/,.togo/,--filter=:- .gitignore.Other changes:
--dry-runlists the exclusions.deploy.include.Tests (all in
cmd/deploy_remote_test.go): default filter set and rule order,deploy.includeprecedence, rsync argument construction, scp refusal, and an end-to-end test with the realrsyncinto a local directory asserting that.env,.env.local, nested.env,.git,togo.db(+wal),*.sqlite3,node_modules,.togoand a gitignored file are not delivered, while.env.example, the source and anincluded database are. The rsync test skips when rsync is missing (it was not available on my Windows host, so CI on ubuntu is the first run).Release note to include: behaviour change. Users who deployed with
--remote-buildbefore this version should remove stale.env,.gitand database files from the server deploy path and rotate any secrets that were in that.env.🤖 Generated with Claude Code