From 7ae510ed28f37592b3d20e980a432d4e18902622 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Mon, 17 Aug 2026 11:52:33 -0400 Subject: [PATCH] Point the WebGUI symlink at the actual install, and report this host's identity rather than HOST1's MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .plg hardcoded the flash path and runs every boot, so an appdata node served a stale copy that never receives pulls — fixes appeared to do nothing, indefinitely. --- Plugin/unraid/Tools/storage_migrate.sh | 18 ++++++++++++++++++ Plugin/unraid/api/checklist.php | 15 +++++++++++++-- Plugin/varaverk.plg | 17 ++++++++++++++++- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/Plugin/unraid/Tools/storage_migrate.sh b/Plugin/unraid/Tools/storage_migrate.sh index 03a0cc4..cab23b4 100755 --- a/Plugin/unraid/Tools/storage_migrate.sh +++ b/Plugin/unraid/Tools/storage_migrate.sh @@ -395,6 +395,24 @@ else fi fi +# ── Repoint the WebGUI at the new location ──────────────────────────────────── +# The .plg rebuilds this symlink on every boot and now follows SCRIPTS_DIR, but a migration is +# not a boot. Without this the WebGUI keeps serving the old copy until the next restart, so a +# migration appears to work while every page, endpoint and pull-target is still the old tree. +WEB_DIR="/usr/local/emhttp/plugins/varaverk" +if [[ "$DRY_RUN" == true ]]; then + warn "DRY RUN — would repoint $WEB_DIR → $DST/Plugin/unraid" +elif [[ -d "$DST/Plugin/unraid" ]]; then + ln -sfn "$DST/Plugin/unraid" "$WEB_DIR" + if [[ "$(readlink -f "$WEB_DIR")" == "$(readlink -f "$DST/Plugin/unraid")" ]]; then + echo "WebGUI repointed → $DST/Plugin/unraid ✅" + else + warn "Could not repoint $WEB_DIR — the WebGUI will keep serving the old tree until reboot" + fi +else + warn "$DST/Plugin/unraid missing — WebGUI left pointing at the old tree" +fi + # ────────────────────────────────────────────────────────────────────────────── echo "" echo "━━━━━ $ICON_DONE Migration complete ━━━━━" diff --git a/Plugin/unraid/api/checklist.php b/Plugin/unraid/api/checklist.php index 1a7f731..4af5a31 100644 --- a/Plugin/unraid/api/checklist.php +++ b/Plugin/unraid/api/checklist.php @@ -91,11 +91,22 @@ $items = []; // ── Identity ────────────────────────────────────────────────────────────────── preg_match('/^\s*HOST1\s*=\s*"([^"]*)"/m', $master, $m1); $host1 = trim($m1[1] ?? ''); +// "Server identity" is this server's, not HOST1's. It was hardcoded to read master.conf's HOST1 +// and print "HOST1: ", so on the mirror the row that answers "which host am I" confidently +// named the other machine — and reported ok purely because the owner's slot was filled in, which +// says nothing about whether this host resolved to a slot at all. +$myName = ''; +if ($hostId !== 'unknown') { + preg_match('/^\s*' . preg_quote($hostIdUp, '/') . '\s*=\s*"([^"]*)"/m', $master, $mSelf); + $myName = trim($mSelf[1] ?? ''); +} $items[] = [ 'id' => 'identity', 'label' => 'Server identity', - 'ok' => !empty($host1), - 'detail' => $host1 ? "HOST1: $host1" : 'HOST1 blank in master.conf', + 'ok' => $hostId !== 'unknown' && !empty($myName), + 'detail' => ($hostId !== 'unknown' && $myName) + ? "$hostIdUp: $myName" + : 'This host does not match any HOST* entry in master.conf', ]; // ── Host conf ───────────────────────────────────────────────────────────────── diff --git a/Plugin/varaverk.plg b/Plugin/varaverk.plg index 6df8a81..4ad0e0e 100644 --- a/Plugin/varaverk.plg +++ b/Plugin/varaverk.plg @@ -52,7 +52,22 @@ /dev/null 2>&1 || true + printf '%s' "${SCRIPTS_DIR:-}" ) + [[ -n "$_sd" && -d "$_sd/Plugin/unraid" ]] && SRC="$_sd/Plugin/unraid" +fi +[[ -z "$SRC" ]] && SRC="/boot/config/plugins/varaverk/Plugin/unraid" + [[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR" [[ -d "$WEB_DIR" ]] && rm -rf "$WEB_DIR" ln -sf "$SRC" "$WEB_DIR"