fix: prevent system backups from swallowing backup_dir recursively (+ split config mounts) #128
No reviewers
Labels
No labels
architecture
backend
bug
ci
config
database
docker
documentation
duplicate
enhancement
frontend
help wanted
invalid
issue-25
issue-26
issue-42
issue-65
issue-67
issue-82
migrations
p0-critical
p1-high
p2-medium
p3-low
performance
quality
question
security
state-management
testing
timezone
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
fastie81/honbu-manager!128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/backup-dir-collision"
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?
Root cause
On prod (Tower 192.168.10.10) the running container binds BOTH /app/backups and /app/app/data/content_images to the SAME host folder (/mnt/user/appdata/honbu-manager/backup). In create_system_backup() the content walk (os.walk(self.content_dir)) then embeds every prior system_backup_.zip inside the new archive - runaway GB growth. The job dies mid-write (OOM on the giant archive), leaving a truncated, unrestorable zip (no EOCD). All 3 existing system_backup_.zip on prod are corrupt (verified: 87M/126M/145M, all rejected by zipfile/unzip). The scheduled daily backup has silently failed since Jul 8.
Fixes (2 commits)
1. backup_service.py - code
2. docker-compose.yml + env templates - config
The compose fed both mounts from the SAME ${HOST_DATA_PATH} variable - the exact mis-config live on prod. Split into BACKUP_PATH (-> /app/backups) and CONTENT_PATH (-> /app/app/data/content_images) with distinct defaults so they can never collapse. Documented in .env.example, .env.prod, .env.test.
Test
Follow-on (separate)
Deploy to prod requires setting BACKUP_PATH/CONTENT_PATH to distinct real paths in .env.prod and restarting the compose stack. Registry-based CI prod-deploy migration tracked separately.
The compose file fed both /app/backups and /app/app/data/content_images from the same ${HOST_DATA_PATH} variable. If set, both collapses to one host folder; that is the exact mis-config live on prod that made system backups recursively embed themselves. Split into BACKUP_PATH and CONTENT_PATH with distinct defaults, and document both in the env templates.b686a4ac261fe881643cCI verified green on this PR (post-rebase onto main after #127 merged):
test✅ (2m13s push / 2m12s PR)lint-frontend✅ (57s push / 1m1s PR)build-test/build-releasenon-gating;deploy-test/deploy-prodcorrectly blocked (gated to protected branch/version tags)Note: the push-run failure earlier was the pre-existing
DATABASE_URLplaceholder bug (#127), not this branch — resolved by merging #127 and rebasing. ~200 lines total (code + regression test + config split), mergeable clean againstmain.