From 60ff6581814d70de267030cda49ead10f5bde13e Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sat, 13 Jun 2026 10:22:02 -0400 Subject: [PATCH] Fix conf_upgrade template naming bugs that caused false ADDED/REMOVED on every nightly pull MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - REMOTE_ID_TIER*_DELAY renamed to HOSTN_TIER*_DELAY — these are own-host outage timers - HOSTN_RADARR_MOVIE_ROOT → HOSTN_RADARR_MOVIES_ROOT (matches common.sh) - HOSTN_SYS_WATCHDOG_CHECK_DOCKER → CHECK_DOCKER_DAEMON, CHECK_TEMP → CHECK_CPU_TEMP - Add REMOTE_ID substitution to the sed in git_pull_execute.sh so COVERS_REMOTE_ID resolves to the actual remote host (e.g. FALLBACK_HOST1_COVERS_HOST2_TIER1) - Add HOSTN_PARTNERSHIP_REPLACE_CONTAINERS, HOSTN_PARTNERSHIP_ARR_REPLACE_CONTAINERS, and HOSTN_WATCHDOG_CONTAINER_API_CHECKS to template so they aren't removed each pull --- Configurations/host.conf.template | 29 ++++++++++++++++++++--------- git_pull_execute.sh | 7 ++++++- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Configurations/host.conf.template b/Configurations/host.conf.template index 8e8d4cb..82e3c04 100644 --- a/Configurations/host.conf.template +++ b/Configurations/host.conf.template @@ -160,6 +160,14 @@ # "Emby" ) +# Containers stopped on THIS server before deploying the mirror's stack on onboard. + HOSTN_PARTNERSHIP_REPLACE_CONTAINERS=( + ) + +# Arr containers stopped on this server when mirror's arr stack is deployed. + HOSTN_PARTNERSHIP_ARR_REPLACE_CONTAINERS=( + ) + # Emby admin provisioning — owner controls whether Emby is shared. HOSTN_PARTNERSHIP_PROVISION_EMBY_ADMIN=false HOSTN_PARTNERSHIP_EMBY_PORT=8096 @@ -259,12 +267,11 @@ # "container-placeholder" ) -# ━━━ Tier Delays — Partner's Containers on this Host ━━━ -# How long the partner must be down before each tier activates here — in minutes. -# Replace REMOTE_ID with the actual remote host ID (HOST1, HOST2, etc.) - REMOTE_ID_TIER2_DELAY=240 # 4 hours - REMOTE_ID_TIER3_DELAY=720 # 12 hours - REMOTE_ID_TIER4_DELAY=1440 # 24 hours +# ━━━ Tier Delays — This Host's Outage Timers ━━━ +# How long THIS host must be down before each tier activates on the partner. + HOSTN_TIER2_DELAY=240 # 4 hours + HOSTN_TIER3_DELAY=720 # 12 hours + HOSTN_TIER4_DELAY=1440 # 24 hours # ━━━ Rsync Writeback ━━━ HOSTN_TIER1_WRITEBACK_DELAY=60 # skip Emby writeback if outage under 1hr @@ -314,6 +321,10 @@ # ["Emby"]="http://localhost:8096" ) +# API-level health checks. Format: ["ContainerName"]="url|expected_json_key|expected_value" + declare -A HOSTN_WATCHDOG_CONTAINER_API_CHECKS=( + ) + # Required containers — must always be running. HOSTN_WATCHDOG_REQUIRED_CONTAINERS=( # "NginxProxyManager" @@ -412,7 +423,7 @@ HOSTN_RADARR_URL="http://localhost:7878" HOSTN_RADARR_API_KEY="" HOSTN_TMDB_API_KEY="" - HOSTN_RADARR_MOVIE_ROOT="/mnt/user/Movies" + HOSTN_RADARR_MOVIES_ROOT="/mnt/user/Movies" declare -A HOSTN_RADARR_PATH_MAP=( # ["/movies"]="/mnt/user/Movies" @@ -474,7 +485,7 @@ HOSTN_SYS_WATCHDOG_NIC="" # e.g. eth0 — for network monitoring - HOSTN_SYS_WATCHDOG_CHECK_DOCKER=true + HOSTN_SYS_WATCHDOG_CHECK_DOCKER_DAEMON=true HOSTN_SYS_WATCHDOG_CHECK_ROOTFS=true HOSTN_SYS_WATCHDOG_CHECK_KERNEL_OOPS=true HOSTN_SYS_WATCHDOG_CHECK_FD=true @@ -483,7 +494,7 @@ HOSTN_SYS_WATCHDOG_CHECK_RAM=true HOSTN_SYS_WATCHDOG_CHECK_LOG=true HOSTN_SYS_WATCHDOG_CHECK_ARC=true - HOSTN_SYS_WATCHDOG_CHECK_TEMP=true + HOSTN_SYS_WATCHDOG_CHECK_CPU_TEMP=true HOSTN_SYS_WATCHDOG_CHECK_LOAD=true HOSTN_SYS_WATCHDOG_CHECK_ZOMBIES=true HOSTN_SYS_WATCHDOG_CHECK_CONTAINERS=true diff --git a/git_pull_execute.sh b/git_pull_execute.sh index bf7d2b3..a944103 100755 --- a/git_pull_execute.sh +++ b/git_pull_execute.sh @@ -303,10 +303,15 @@ elif [[ "$SYNC_SUCCESS" == true ]]; then # This server's host conf only — sparse checkout ensures we have it HOST_CONF="$CONF_DIR/${MY_ID,,}.conf" if [[ -f "$CONF_DIR/host.conf.template" && -f "$HOST_CONF" ]]; then + # Template uses HOSTN_ as generic prefix. Substitute MY_ID before merging + # so keys match the target (HOST1_* or HOST2_*) and real values are preserved. + TMPL_RESOLVED=$(mktemp) + sed "s/HOSTN_/${MY_ID}_/g; s/REMOTE_ID/${REMOTE_ID}/g" "$CONF_DIR/host.conf.template" > "$TMPL_RESOLVED" bash "$UPGRADE_SCRIPT" \ - --template "$CONF_DIR/host.conf.template" \ + --template "$TMPL_RESOLVED" \ --target "$HOST_CONF" \ --backup $_DRY + rm -f "$TMPL_RESOLVED" else warn "${MY_ID,,}.conf or host.conf.template not found — skipping" fi