fix: prevent excessive disk usage from repo backups#235
Conversation
Legacy configs with backupBeforeSync: true but no explicit backupStrategy
silently resolved to "always", creating full git bundles on every sync
cycle. This caused repo-backups to grow to 17GB+ for users with many
repositories.
Changes:
- Fix resolveBackupStrategy to map backupBeforeSync: true → "on-force-push"
instead of "always", so legacy configs only backup when force-push is detected
- Fix config mapper to always set backupStrategy explicitly ("on-force-push")
preventing the backward-compat fallback from triggering
- Lower default backupRetentionCount from 20 to 5 bundles per repo
- Add time-based retention (backupRetentionDays, default 30 days) alongside
count-based retention, with safety net to always keep at least 1 bundle
- Add "high disk usage" warning on "Always Backup" UI option
- Update docs and tests to reflect new defaults and behavior
…se retention days P1: mapDbToUiConfig now checks backupBeforeSync === false before defaulting backupStrategy, preventing legacy "disabled" configs from silently becoming "on-force-push" after any auto-save round-trip. P3: Added "Snapshot retention days" input field to the backup settings UI, matching the documented setting in FORCE_PUSH_PROTECTION.md.
Deploying gitea-mirror-website with
|
| Latest commit: |
67e085f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://85fe8e95.gitea-mirror-website.pages.dev |
| Branch Preview URL: | https://fix-234-disk-space-backup-re.gitea-mirror-website.pages.dev |
🐳 Docker Image Built SuccessfullyYour PR image is available for testing: Image Tag: Pull and Testdocker pull ghcr.io/raylabshq/gitea-mirror:pr-235
docker run -d -p 4321:4321 -e BETTER_AUTH_SECRET=your-secret-here -e BETTER_AUTH_URL=http://localhost:4321 --name gitea-mirror-test ghcr.io/raylabshq/gitea-mirror:pr-235Docker Compose Testingservices:
gitea-mirror:
image: ghcr.io/raylabshq/gitea-mirror:pr-235
ports:
- "4321:4321"
environment:
- BETTER_AUTH_SECRET=your-secret-here
- BETTER_AUTH_URL=http://localhost:4321
- BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:4321
📦 View in GitHub Packages |
🔍 Vulnerabilities of
|
| digest | sha256:416159814b999bec1fa112a4f01db206745af3c136e6fd7573049e9c28db5253 |
| vulnerabilities | |
| platform | linux/amd64 |
| size | 283 MB |
| packages | 800 |
📦 Base Image debian:trixie
| digest | sha256:13f29b6806e531c3ff3b565bb6eed73f2132506c8c9d41bb996065ca20fb27f2 |
| vulnerabilities |
Description
Description
Description
| ||||||||||||||||||||||||
Description
|
Overview
Labels (8 changes)
-org.opencontainers.image.created=2026-03-18T09:27:42.378Z
+org.opencontainers.image.created=2026-02-26T07:10:54.054Z
-org.opencontainers.image.description=Gitea Mirror auto-syncs GitHub repos to your self-hosted Gitea/Forgejo, with a sleek Web UI and easy Docker deployment.
+org.opencontainers.image.description=Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
-org.opencontainers.image.licenses=AGPL-3.0
+org.opencontainers.image.licenses=NOASSERTION
-org.opencontainers.image.revision=67e085f6c0729a6d3abcabe28425d06de73363c7
+org.opencontainers.image.revision=30e609e08073cf7114bfb278506962a5b19d0677
-org.opencontainers.image.source=https://github.com/RayLabsHQ/gitea-mirror
+org.opencontainers.image.source=https://github.com/oven-sh/bun
-org.opencontainers.image.title=gitea-mirror
+org.opencontainers.image.title=bun
-org.opencontainers.image.url=https://github.com/RayLabsHQ/gitea-mirror
+org.opencontainers.image.url=https://github.com/oven-sh/bun
-org.opencontainers.image.version=pr-235
+org.opencontainers.image.version=1.3.10-debian |
Summary
Fixes #234 — repo-backups directory growing to 17GB+ due to a backward-compatibility trap where legacy configs silently resolve to "always backup" mode.
backupBeforeSync: true(the mapper default) was silently mapping to"always"inresolveBackupStrategy, creating full git bundles on every sync. Now maps to"on-force-push"(smart backup) instead.backupBeforeSync: falseconfigs were being overwritten to"on-force-push"after any auto-save.mapDbToUiConfignow correctly preserves the"disabled"state.backupRetentionCountfrom 20 to 5 bundles per repo across all layers (schema, defaults, mapper, UI).backupRetentionDaysfield (default 30 days) deletes old bundles alongside count-based retention, with a safety net to always keep at least 1 bundle.FORCE_PUSH_PROTECTION.mdupdated with new defaults and backward-compat table.Test plan
backupBeforeSync: falseround-trip with direct mapper reprobackupBeforeSync: false+ no strategy →"disabled"backupBeforeSync: true+ no strategy →"on-force-push"backupStrategy→ preserved as-is"on-force-push"(default)