chore(forgejo): track compose file with retention/cleanup settings #3543
No reviewers
Labels
No labels
Fable 5 ревью
GG-форсайт
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
feedback/max
generative
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
ИРД
вторичка
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#3543
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "chore/forgejo-retention-settings"
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?
Summary
app.inion prod had no[cron.archive_cleanup]section and no retention keys under[actions]-- everything ran on Forgejo defaults (archive cache swept once/24h, no cap on Actions log/artifact age). That's how the repo-archive cache grew to ~48GB/145GB disk before the daily sweep caught up (Caddy now blocks that URL path in #3534 -- this PR is the second line of defense if that rule is ever lifted).Forgejo is not part of the automated deploy pipeline, and its compose file only ever existed on the host (
/home/gendesign/forgejo/docker-compose.yml-- confirmed it's a plain directory, not a git checkout). So there was nowhere for this config to live, survive a redeploy, or be reviewed. This PR adds a tracked copy atops/forgejo/docker-compose.yml, matching the existing pattern ofops/backup.sh/ops/restore.shfor host-level infra not covered bydocker-compose.prod.yml.What's managed, and how
Config is driven entirely by
FORGEJO__*env vars in the compose file (confirmed -- the live compose already used this fordatabase/server/service/actions), not by hand-editingapp.ini. Env vars are declarative/versioned/redeploy-safe, vs. editing the bind-mountedapp.inidirectly which survives container recreation via the volume but isn't reviewable or reproducible.New keys added:
Dotted section name (
[cron.archive_cleanup]) needs the_0x2E_escape for.-- per the container's ownenvironment-to-ini --help, and confirmed empirically with a dry-run (environment-to-ini --config /dev/null --out /tmp/...inside the container, scratch path only, no prod file touched) that produced exactly[cron.archive_cleanup]with the expected keys.How key names were verified
Not from memory -- a wrong key is silently dropped and creates a false sense of safety. Verified by extracting Go struct
ini:"..."tags directly from the running binary (codeberg.org/forgejo/forgejo:10, Forgejo 10.0.3+gitea-1.22.0):ArtifactRetentionDays int64 ini:"ARTIFACT_RETENTION_DAYS",LogRetentionDays int64 ini:"LOG_RETENTION_DAYS"-- explicit tags, found literally in the binary under the[actions]struct (same struct as the existingENABLED/DEFAULT_ACTIONS_URLkeys).cron.OlderThanConfig/cron.BaseConfig(used byregisterArchiveCleanup) have no explicit ini tags -- Gitea/Forgejo's globalAllCapsUnderscorename mapper applies, the well-established convention for every[cron.*]section (Enabled->ENABLED,RunAtStart->RUN_AT_START,Schedule->SCHEDULE,OlderThan->OLDER_THAN).Retention values vs. current workflows
Checked
.forgejo/workflows/and.github/workflows/(ci.yml,deploy.yml,deploy-obsidian.yml) for artifact usage -- none upload or download artifacts today, so 14-day artifact retention can't break a cross-job dependency. 30-day log retention keeps a full month of CI run logs for failure triage. If a workflow ever addsactions/upload-artifactwith a longer inter-job gap, bumpARTIFACT_RETENTION_DAYSaccordingly.Not applied to prod
This PR only adds the tracked file. To take effect on the VM:
up -d --force-recreateis required, notrestart-- Forgejo regeneratesapp.inifromFORGEJO__*env vars viaenvironment-to-iniat container start, andrestartdoesn't re-read a changedenvironment:block.After restart, sanity-check with (read-only):
Test plan
python -c "import yaml; yaml.safe_load(...)"-- YAML parsesenvironment-to-iniinside the container confirmed the_0x2E_escape produces the correct[cron.archive_cleanup]section (scratch path, not prod config)app.inipicks up new sections, watch/data/gitea/repo-archivesize andactions_logdir over the next 24h🤖 Generated with Claude Code
https://claude.ai/code/session_01JY6iWDnGDthdvsMWgK1BMG