diff --git a/Plugin/unraid/include/partnership.php b/Plugin/unraid/include/partnership.php index dafd069..318e767 100644 --- a/Plugin/unraid/include/partnership.php +++ b/Plugin/unraid/include/partnership.php @@ -408,8 +408,28 @@ function vv_pt_nodes(): array { $isOwner = (strtolower($ownerSlot) === $slot); // Tailscale + // + // Exact key first, then a single unambiguous prefix match in either direction. The + // tailnet name and the OS hostname are not the same string and nothing keeps them in + // step: this mesh has master.conf saying "unRAID-Jayred36" while the tailnet device is + // "unraid-jayred365". An exact-key lookup found nothing, so every remote card rendered + // with no IP, no online state and no container count — a partner that was answering SSH + // the whole time displayed as though it were not there. + // + // Same rule as vv_resolve_tailscale_ip(), and the same refusal: one candidate or none. + // server1 must never resolve to server10 because it happens to share a prefix. $tsLabel = strtolower($hostname); - $ts = $tsPeers[$tsLabel] ?? ['online' => null, 'active' => false, 'ip' => null]; + $ts = $tsPeers[$tsLabel] ?? null; + if ($ts === null) { + $cand = []; + foreach ($tsPeers as $peerName => $peer) { + if (str_starts_with($peerName, $tsLabel) || str_starts_with($tsLabel, $peerName)) { + $cand[] = $peer; + } + } + if (count($cand) === 1) $ts = $cand[0]; + } + if ($ts === null) $ts = ['online' => null, 'active' => false, 'ip' => null]; // Fallback state $fbState = 'UNKNOWN';