diff --git a/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh b/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh index e6558cf..e1e0191 100755 --- a/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh +++ b/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh @@ -267,7 +267,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/daemon.json" ]; then + if [ ! -f "$CONF_DIR/daemon.json" ] || grep -q "REPLACE_" "$CONF_DIR/daemon.json" 2>/dev/null; then mkdir -p "$CONF_DIR" cp -Rf "$ETC_DIR/." "$CONF_DIR/" 2>/dev/null || true fi diff --git a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh index 7a06c71..1ffa6d6 100755 --- a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh +++ b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh @@ -304,11 +304,12 @@ __run_precopy() { # during container startup, after the entrypoint's initial copy. Applying it here # (in the init.d phase) ensures it takes effect after Docker finishes network setup. [ -f "/usr/local/etc/resolv.conf" ] && cp -f "/usr/local/etc/resolv.conf" "/etc/resolv.conf" 2>/dev/null || true - # Seed /config/$SERVICE_NAME from the baked /etc copy if app.ini is missing, + # Seed /config/$SERVICE_NAME from the baked /etc copy if app.ini is missing + # or still contains unprocessed REPLACE_ tokens from a previous broken run, # 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/app.ini" ]; then + if [ ! -f "$CONF_DIR/app.ini" ] || grep -q "REPLACE_" "$CONF_DIR/app.ini" 2>/dev/null; then mkdir -p "$CONF_DIR" cp -Rf "$ETC_DIR/." "$CONF_DIR/" 2>/dev/null || true fi diff --git a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh index a244991..029bae0 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh @@ -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