Watchdog and Monitor looked the partner up by exact key, and the remote probe passed a quote to cut as a filename

This commit is contained in:
Gmer4Lfe
2026-08-22 00:59:24 -04:00
parent 0f228020ef
commit a89b704fa1
3 changed files with 31 additions and 10 deletions
+6 -1
View File
@@ -1,5 +1,6 @@
<?php
require_once __DIR__ . '/common.php';
require_once __DIR__ . '/partnership.php'; // vv_pt_peer_match() — tailnet name vs conf hostname
// ═══════════════════════════════════════════════════════════════════════════════════════════════
// PURPOSE
@@ -94,7 +95,11 @@ function vv_partner_state(): array {
if (!$hostname) continue;
$isMe = ($id === $myHostId);
$isOwner = strcasecmp($id, $vars['PARTNERSHIP_OWNER_HOST'] ?? '') === 0;
$online = $isMe ? true : ($tsPeers[strtolower($hostname)] ?? null);
// Exact-key lookup, until now. The tailnet name and the conf hostname differ by one
// character on this mesh, so the partner card reported a host that was up as unknown.
// Same unambiguous-prefix rule as everywhere else — one candidate or none.
$peerKey = $isMe ? null : vv_pt_peer_match(array_keys($tsPeers), $hostname);
$online = $isMe ? true : ($peerKey !== null ? $tsPeers[$peerKey] : null);
$onboardPhase = $isMe ? null
: (($setupDb[$id . '_PHASE2_DONE'] ?? '') === 'true' ? 2
: (($setupDb[$id . '_PHASE1_DONE'] ?? '') === 'true' ? 1 : 0));