Fixes the warm-canonical advance failure surfaced by the cc-ci sweep: cold deploy + cold 3.5.3->3.6.0 upgrade are green, but the in-place warm reattach-advance to 3.6.0 crash-loops at config load.
Root cause: Gitea 1.24+ (re)generates and SAVES the [oauth2] JWT secret to /etc/gitea/app.ini during LoadCommonSettings(). With app.ini mounted directly as a read-only swarm config, this fails fatally:
LoadCommonSettings() [F] ... error saving JWT Secret for custom config: failed to save "/etc/gitea/app.ini": open /etc/gitea/app.ini: read-only file system
(crash before any DB migration; observed deterministically on a warm reattach to 3.6.0).
Fix: mount the rendered config read-only at /etc/gitea/app.ini.init and seed it once into the writableconfig:/etc/gitea volume via docker-setup.sh, so Gitea owns a writable /etc/gitea/app.ini and can persist the JWT secret. Seed-once preserves runtime state across restarts. Bumps DOCKER_SETUP_SH_VERSION so the new entrypoint actually deploys (swarm configs are immutable).
Fixes the warm-canonical advance failure surfaced by the cc-ci sweep: cold deploy + cold 3.5.3->3.6.0 upgrade are green, but the in-place warm reattach-advance to 3.6.0 crash-loops at config load.
**Root cause:** Gitea 1.24+ (re)generates and SAVES the `[oauth2]` JWT secret to `/etc/gitea/app.ini` during `LoadCommonSettings()`. With `app.ini` mounted directly as a **read-only** swarm config, this fails fatally:
```
LoadCommonSettings() [F] ... error saving JWT Secret for custom config: failed to save "/etc/gitea/app.ini": open /etc/gitea/app.ini: read-only file system
```
(crash before any DB migration; observed deterministically on a warm reattach to 3.6.0).
**Fix:** mount the rendered config read-only at `/etc/gitea/app.ini.init` and seed it once into the **writable** `config:/etc/gitea` volume via `docker-setup.sh`, so Gitea owns a writable `/etc/gitea/app.ini` and can persist the JWT secret. Seed-once preserves runtime state across restarts. Bumps `DOCKER_SETUP_SH_VERSION` so the new entrypoint actually deploys (swarm configs are immutable).
Verified by cc-ci on the warm-advance path.
cc @trav @notplants
Gitea 1.24+ (re)generates and SAVES the [oauth2] JWT secret to /etc/gitea/app.ini at
LoadCommonSettings. With app.ini mounted directly as a read-only swarm config this fails fatally
(open /etc/gitea/app.ini: read-only file system) on a warm reattach/redeploy, crash-looping the
container before any DB migration. Mount the rendered config at /etc/gitea/app.ini.init (read-only)
and seed it once into the writable config volume via docker-setup.sh, so Gitea owns a writable
/etc/gitea/app.ini. Bumps DOCKER_SETUP_SH_VERSION so the new entrypoint actually deploys.
A release that mounted app.ini directly as a read-only swarm config leaves a 0-byte placeholder at
/etc/gitea/app.ini in the reattached config volume on upgrade; the original seed guard (! -f) treated
that as present and skipped, so Gitea booted the install wizard on an empty config (/api/v1/version
404). Guard on ! -s (missing OR empty) so the rendered config is seeded; bump DOCKER_SETUP_SH_VERSION
so the corrected entrypoint deploys (immutable swarm configs).
This fix is now included in PR #3 (upgrade to gitea 1.26.2-rootless + postgres 15.18). The app.ini-writable patch was cherry-picked into the upgrade branch. Superseded by #3
This fix is now included in PR #3 (upgrade to gitea 1.26.2-rootless + postgres 15.18). The app.ini-writable patch was cherry-picked into the upgrade branch. Superseded by https://git.autonomic.zone/recipe-maintainers/gitea/pulls/3
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes the warm-canonical advance failure surfaced by the cc-ci sweep: cold deploy + cold 3.5.3->3.6.0 upgrade are green, but the in-place warm reattach-advance to 3.6.0 crash-loops at config load.
Root cause: Gitea 1.24+ (re)generates and SAVES the
[oauth2]JWT secret to/etc/gitea/app.iniduringLoadCommonSettings(). Withapp.inimounted directly as a read-only swarm config, this fails fatally:(crash before any DB migration; observed deterministically on a warm reattach to 3.6.0).
Fix: mount the rendered config read-only at
/etc/gitea/app.ini.initand seed it once into the writableconfig:/etc/giteavolume viadocker-setup.sh, so Gitea owns a writable/etc/gitea/app.iniand can persist the JWT secret. Seed-once preserves runtime state across restarts. BumpsDOCKER_SETUP_SH_VERSIONso the new entrypoint actually deploys (swarm configs are immutable).Verified by cc-ci on the warm-advance path.
cc @trav @notplants
d41452663ftoa0f2db8872autonomic-bot referenced this pull request2026-06-19 03:01:06 +00:00
This fix is now included in PR #3 (upgrade to gitea 1.26.2-rootless + postgres 15.18). The app.ini-writable patch was cherry-picked into the upgrade branch. Superseded by #3
Pull request closed