Mesh partnership leg reads this host's own state file, not one named after the remote

This commit is contained in:
Gmer4Lfe
2026-08-17 14:43:03 -04:00
parent e7e9d9fecf
commit f58ff68ab3
+8 -1
View File
@@ -391,6 +391,9 @@ function vv_pt_nodes(): array {
$hosts = vv_arr_known_hosts(); // ['host1' => 'hostname', ...]
$vars = vv_conf_vars();
$tsPeers = vv_pt_ts_peers();
// Read once: the partnership state this host records for itself, used by every remote's
// mesh check below.
$localPtState = vv_pt_read_db(STATE_DIR . '/partnership_' . vv_get_hostname() . '.db')['state'] ?? '';
$ownerSlot = strtolower($vars['PARTNERSHIP_OWNER_HOST'] ?? '');
$setupDb = vv_setup_state_read();
@@ -554,7 +557,11 @@ function vv_pt_nodes(): array {
'mesh' => $isMe ? null : [
'tailscale' => $ts['online'] === true,
'ssh' => !empty($system['unraid_version']) || !empty($system['uptime_sec']),
'partnership' => ($ptDb['state'] ?? '') === 'ACTIVE',
// This host's own state file, not one named after the remote. A partnership is a
// single mutual fact, and each host writes it under its OWN hostname — so
// partnership_<remote>.db does not exist here, and reading it made a healthy
// partnership report as a failing leg on the owner's own page.
'partnership' => $localPtState === 'ACTIVE',
'onboarded' => $onboardPhase >= 2,
],
];