From f036fbfe4aff535a909ec2356be77122e44151ff Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Fri, 12 Jun 2026 21:55:15 -0400 Subject: [PATCH] Sync master.conf.template schema to match live master.conf STATE_DIR introduced, DATA_DIR path updated to flash, all state files migrated from /tmp and /boot/config root to $STATE_DIR. TRANSCODE_STATE_FILE and DOCKER_WATCHDOG_FAILED_FILE added; SYS_WATCHDOG_FAILED_FILE renamed to DOCKER_WATCHDOG_FAILED_FILE to reflect what it actually tracks. --- Configurations/master.conf.template | 42 ++++++++++++++++++----------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/Configurations/master.conf.template b/Configurations/master.conf.template index d21e744..e259ea7 100644 --- a/Configurations/master.conf.template +++ b/Configurations/master.conf.template @@ -111,11 +111,15 @@ # ============================================================================================== # ── SHARED HOST CONFIGURATION ───────────────────────────────────────────────────────────────── # ============================================================================================== -# DATA_DIR is the same path on all servers — persistent script state and statistics. -# Array share — survives reboots, no flash drive wear. -# Created automatically if it doesn't exist. -# Only truly critical files (fallback state, watchdog reboot log) stay on /boot/config. - DATA_DIR="/mnt/user/appdata/Varaverk/data" +# Requirement: internal NVMe/SSD boot drive. Everything lives in the plugin folder on flash — +# scripts, state, and data are all available before the array mounts. +# Both directories are created automatically if they don't exist. +# +# DATA_DIR — historical logs, statistics, discovery histories, blocklists +# STATE_DIR — runtime state files for all scripts (watchdogs, fallback, transcode, etc.) +# Requirement: ALL state files MUST use $STATE_DIR. No /tmp, no /boot/config root. + DATA_DIR="/boot/config/plugins/varaverk/data" + STATE_DIR="/boot/config/plugins/varaverk/State_Files" # ── Version Parity ── # Controls behaviour when local and remote unRAID versions differ. @@ -185,6 +189,11 @@ PARTNERSHIP_OFFLINE_THRESHOLD=30 # days either server unreachable before auto-offboard # works both directions independently +# Partnership and setup state files — all in STATE_DIR per the project requirement. +# Scripts use these variables; do not hardcode /boot/config paths in scripts. + PARTNERSHIP_BLOCKLIST_FILE="$STATE_DIR/partnership_blocklist.db" + VARAVERK_SETUP_FILE="$STATE_DIR/varaverk_setup.db" + # Tailscale removal on offboard. PARTNERSHIP_REMOVE_TAILSCALE=true # remove mirror from Tailscale tailnet on offboard # false = skip removal (manual or testing) @@ -421,7 +430,7 @@ MONTHLY_UPTIME_THRESHOLD_DAYS=30 # minimum uptime in days before maintenance fires MONTHLY_RUN_INTERVAL_DAYS=30 # minimum days since last run before running again - MONTHLY_LAST_RUN_FILE="/boot/config/monthly_maintenance_last_run.db" + MONTHLY_LAST_RUN_FILE="$STATE_DIR/monthly_maintenance_last_run.db" # ━━━ Sunday Morning Coffee Report ━━━ # Orchestrator that runs all Sunday monitor scripts in sequence. @@ -634,7 +643,7 @@ EXTERNAL_IP="8.8.8.8" FALLBACK_CHECK_INTERVAL=30 # seconds between fallback state checks FALLBACK_HANDBACK_STRIKES=3 # consecutive healthy checks before initiating handback (3×30s = 90s) - FALLBACK_STATE_FILE="/boot/config/fallback_state.db" + FALLBACK_STATE_FILE="$STATE_DIR/fallback_state.db" FALLBACK_ENABLED=false # set true once both servers are configured and paired # false = suppresses "not running" warnings in status scripts FALLBACK_PARTNERSHIP_REQUIRED=true # gate fallback on an active partnership @@ -702,7 +711,7 @@ # HOST*_WATCHDOG_DEPENDENCIES — dependency ordering for restart decisions # Strike state file — /tmp resets on reboot (correct — no stale strikes after reboot) - WATCHDOG_STATE_FILE="/tmp/container_watchdog_state.db" + WATCHDOG_STATE_FILE="$STATE_DIR/container_watchdog_state.db" # CPU thresholds — normalised against total core count at runtime SOFT_CPU_THRESHOLD=80 # warn at this % of total system CPU @@ -769,8 +778,8 @@ WATCHDOG_APPDATA_LOG_MAX_GB=2 # flag *.log files exceeding this size (absolute) WATCHDOG_APPDATA_TRUNCATE_LOGS=false # set true to auto-truncate oversized *.log files on action cycle WATCHDOG_APPDATA_STRIKE_LIMIT=3 # cycles before action fires (matches existing watchdog pattern) - WATCHDOG_APPDATA_GROWTH_FILE="/tmp/watchdog_appdata_growth.db" # /tmp — resets on reboot ✅ - STORAGE_WATCHDOG_STATE_FILE="/tmp/storage_watchdog_state.db" # /tmp — resets on reboot ✅ + WATCHDOG_APPDATA_GROWTH_FILE="$STATE_DIR/watchdog_appdata_growth.db" + STORAGE_WATCHDOG_STATE_FILE="$STATE_DIR/storage_watchdog_state.db" # ━━━ Docker Network Connect ━━━ # Ensures custom networks exist and connects containers at array start. @@ -856,7 +865,7 @@ NETWORK_WATCHDOG_CHECK_TAILSCALE=true NETWORK_WATCHDOG_NPM_TIMEOUT=10 NETWORK_WATCHDOG_NPM_STRIKE_LIMIT=2 - NETWORK_WATCHDOG_NPM_STATE_FILE="/tmp/network_watchdog_state.db" + NETWORK_WATCHDOG_NPM_STATE_FILE="$STATE_DIR/network_watchdog_state.db" # ━━━ WebGUI Watchdog ━━━ # Monitors unRAID WebGUI responsiveness — escalates through nginx restart → emhttp restart. @@ -1165,6 +1174,7 @@ TRANSCODE_MANAGER_MODE="smart" # Daily statistics log — read by weekly_health_digest.sh for transcode summary. + TRANSCODE_STATE_FILE="$STATE_DIR/transcode_state.db" TRANSCODE_DAILY_LOG="$DATA_DIR/transcode_daily.db" TRANSCODE_LOG_RETENTION=90 # days before old entries purged @@ -1265,7 +1275,7 @@ # HOST*_RW_STOP_CONTAINERS — docker stop at hard pressure (in host*.conf) RW_ENABLED=true - RW_STATE_FILE="/tmp/resource_watchdog_state.db" + RW_STATE_FILE="$STATE_DIR/resource_watchdog_state.db" # ━━━ Pressure Thresholds ━━━ # Graduated RAM response — resource_watchdog acts before system_watchdog reboots. @@ -1335,10 +1345,10 @@ # Warn/shutdown/recover RAM tiers are handled by resource_watchdog.sh # ━━━ State Files ━━━ - SYS_WATCHDOG_STATE_FILE="/tmp/system_watchdog_state.db" # /tmp — resets on reboot ✅ - SYS_WATCHDOG_FAILED_FILE="/boot/config/system_watchdog_failed.db" - SYS_WATCHDOG_REBOOT_LOG="/boot/config/system_watchdog_reboots.db" - SYS_WATCHDOG_OOM_FILE="/tmp/system_watchdog_oom.db" # /tmp — resets on reboot ✅ + SYS_WATCHDOG_STATE_FILE="$STATE_DIR/system_watchdog_state.db" + DOCKER_WATCHDOG_FAILED_FILE="$STATE_DIR/docker_watchdog_failed.db" + SYS_WATCHDOG_REBOOT_LOG="$STATE_DIR/system_watchdog_reboots.db" + SYS_WATCHDOG_OOM_FILE="$STATE_DIR/system_watchdog_oom.db" # ━━━ Strike and Reboot Loop Settings ━━━ # Strike system: a check must fail this many consecutive cycles before action is taken.