mirror of
https://github.com/casjaysdevdocker/gitea
synced 2026-06-24 14:01:00 -04:00
🐛 Re-seed config if REPLACE_ tokens remain from a broken prior run 🐛
The previous guard (check for missing primary config file) left stale app.ini/daemon.json/default_config.yaml files in place when the volume had an unprocessed copy from a broken earlier run. Gitea then read REPLACE_DATABASE_DIR as a literal path, failed to open the SQLite DB, and redirected to the install wizard. Now also re-copy from /etc if the existing config file still contains any REPLACE_ token, ensuring a clean template is always in place before variable substitution runs. - rootfs/usr/local/etc/docker/init.d/08-gitea.sh: re-seed if REPLACE_ tokens present in app.ini - rootfs/usr/local/etc/docker/init.d/05-dockerd.sh: re-seed if REPLACE_ tokens present in daemon.json - rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh: re-seed if REPLACE_ tokens present in default_config.yaml rootfs/usr/local/etc/docker/init.d/05-dockerd.sh rootfs/usr/local/etc/docker/init.d/08-gitea.sh rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
This commit is contained in:
@@ -337,7 +337,7 @@ __run_precopy() {
|
||||
# then replace the /etc/$SERVICE_NAME directory with a symlink to /config/$SERVICE_NAME
|
||||
# so both paths always resolve to the same processed config.
|
||||
if [ -d "$ETC_DIR" ] && ! [ -L "$ETC_DIR" ]; then
|
||||
if [ ! -f "$CONF_DIR/default_config.yaml" ]; then
|
||||
if [ ! -f "$CONF_DIR/default_config.yaml" ] || grep -q "REPLACE_" "$CONF_DIR/default_config.yaml" 2>/dev/null; then
|
||||
mkdir -p "$CONF_DIR"
|
||||
cp -Rf "$ETC_DIR/." "$CONF_DIR/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user