fix: seed app.ini into writable config volume for Gitea 1.24+
cc-ci/testme cc-ci: success

Gitea 1.24+ persists settings back to app.ini on boot (e.g. WORK_PATH).
Mounting app.ini directly as a read-only swarm config makes that write
fail (logged error, possible repo-access bugs). Mount the rendered config
as app.ini.init and seed a writable copy in the config volume instead.
This commit is contained in:
notplants
2026-08-11 16:49:26 +00:00
committed by cc-ci
parent 97fe2bf213
commit d0243cf724
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
export APP_INI_VERSION=v23
export DOCKER_SETUP_SH_VERSION=v1
export DOCKER_SETUP_SH_VERSION=v3
export PG_BACKUP_VERSION=v1
abra_backup_app() {
+1 -1
View File
@@ -6,7 +6,7 @@ services:
image: "gitea/gitea:1.27.1-rootless"
configs:
- source: app_ini
target: /etc/gitea/app.ini
target: /etc/gitea/app.ini.init
- source: docker_setup_sh
target: /usr/local/bin/docker-setup.sh
mode: 0555
+8
View File
@@ -13,3 +13,11 @@ mkdir -p ${GITEA_CUSTOM} && chmod 0500 ${GITEA_CUSTOM}
# Prepare temp folder
mkdir -p ${GITEA_TEMP} && chmod 0700 ${GITEA_TEMP}
if [ ! -w ${GITEA_TEMP} ]; then echo "${GITEA_TEMP} is not writable"; exit 1; fi
# Gitea 1.24+ writes settings back to app.ini on boot (e.g. WORK_PATH), which fails when app.ini is
# mounted directly as a read-only swarm config. So mount the rendered config as app.ini.init and seed
# a writable copy. Use `! -s` (empty), not `! -f`: old direct-mount upgrades leave a 0-byte app.ini.
if [ ! -s /etc/gitea/app.ini ]; then
cp /etc/gitea/app.ini.init /etc/gitea/app.ini
fi
chmod 0600 /etc/gitea/app.ini 2>/dev/null || true