mirror of
https://github.com/casjaysdevdocker/gitea
synced 2026-10-15 14:12:54 -04:00
🐛 Never overwrite existing config when seeding /config 🐛
gitea / release-gitea (push) Successful in 18m49s
gitea / release-gitea (push) Successful in 18m49s
Without the .initialized marker, startup copied the baked template over existing files in /config, resetting app.ini and regenerating secrets. Seeding now only adds files that are missing. - rootfs/usr/local/etc/docker/init.d/08-gitea.sh: seed copy uses cp -Rn instead of cp -Rf - rootfs/usr/local/etc/docker/init.d/05-dockerd.sh: same change, protects a user-edited daemon.json - rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh: same change, protects user-edited runner config - TODO.AI.md: record the bug, the verification, and the upstream template follow-up Claude-Session: https://claude.ai/code/session_01Kae22tmhzhmfHyqc34PZbx
This commit is contained in:
4 files changed
+15
-4
No files matched your search
+11
@@ -7,6 +7,17 @@
|
||||
and the container exits 1 (empty days value passed to `openssl req -days`). The file is
|
||||
generated, so the fix belongs in the upstream gen-dockerfile template, then regenerate.
|
||||
|
||||
## Fixed — startup overwrote user config when `.initialized` marker was missing (init.d seed copy)
|
||||
|
||||
- `__run_precopy` in `08-gitea.sh`, `05-dockerd.sh` and `zz-act_runner.sh` did
|
||||
`cp -Rf "$ETC_DIR/." "$CONF_DIR/"` whenever `$CONF_DIR/.initialized` was absent (since commit
|
||||
`42d0439`), replacing an existing `app.ini` with the template: custom settings lost and
|
||||
SECRET_KEY/INTERNAL_TOKEN/LFS_JWT_SECRET regenerated. Now `cp -Rn` (fills missing files, never
|
||||
overwrites). Verified with a real 428-line `app.ini` and no marker: all lines and all four secrets
|
||||
preserved; before the fix the same test changed SECRET_KEY and INTERNAL_TOKEN.
|
||||
- The same `__run_precopy` block is generated: the upstream start-service template needs the same
|
||||
`cp -Rn` change or the next regeneration will bring the bug back.
|
||||
|
||||
## Fixed — Gitea retention/cleanup defaults (app.ini, 08-gitea.sh)
|
||||
|
||||
- Template: `[actions]` artifacts 30d, logs 90d, runs 180d; enabled `cron.gc_lfs` (daily),
|
||||
|
||||
Reference in new issue
Block a user