fix: seed app.ini into a writable config volume for Gitea 1.24+ #4

Open
autonomic-bot wants to merge 1 commits from fix-app-ini-writable into main
3 changed files with 10 additions and 2 deletions
Showing only changes of commit d0243cf724 - Show all commits
+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