gendesign/ops/forgejo
bot-backend 635ad2df35
All checks were successful
CI Trade-In / changes (pull_request) Successful in 10s
CI Trade-In / backend-tests (pull_request) Has been skipped
CI Trade-In / browser-tests (pull_request) Has been skipped
CI / changes (pull_request) Successful in 12s
CI Trade-In / frontend-checks (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 2m38s
CI / backend-tests (pull_request) Successful in 6m32s
chore(forgejo): track compose file with retention/cleanup settings
app.ini on prod has 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). An external
crawler hitting per-commit archive URLs grew repo-archive cache to
~48GB/145GB before the daily sweep caught up; Caddy now blocks that
path (#3534), but this is the second line of defense if that rule is
ever lifted.

Forgejo isn't part of the automated deploy pipeline and its compose
file only existed on the host (not a git checkout), so there was
nowhere for this config to survive a redeploy or even be reviewed.
Adds a tracked copy at ops/forgejo/docker-compose.yml, alongside the
existing ops/backup.sh and ops/restore.sh host scripts, with:

- [cron.archive_cleanup]: ENABLED/RUN_AT_START=true, SCHEDULE=@every
  1h, OLDER_THAN=1h — hourly sweep instead of daily, 1h grace window.
- [actions] LOG_RETENTION_DAYS=30, ARTIFACT_RETENTION_DAYS=14 — checked
  against .forgejo/workflows and .github/workflows first: no workflow
  uploads/downloads artifacts today, so nothing to break.

Key names verified against the running image (Forgejo 10.0.3) by
extracting Go struct ini-tags from the binary and dry-running
environment-to-ini in a container scratch dir — not from memory, since
a wrong key is silently dropped.

Not applied to prod. Needs manual scp + `up -d --force-recreate
forgejo` per the file's header comment — see PR description.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JY6iWDnGDthdvsMWgK1BMG
2026-09-16 22:30:27 +03:00
..
docker-compose.yml chore(forgejo): track compose file with retention/cleanup settings 2026-09-16 22:30:27 +03:00