Mesh partnership leg reads this host's own state file, not one named after the remote
This commit is contained in:
@@ -391,6 +391,9 @@ function vv_pt_nodes(): array {
|
|||||||
$hosts = vv_arr_known_hosts(); // ['host1' => 'hostname', ...]
|
$hosts = vv_arr_known_hosts(); // ['host1' => 'hostname', ...]
|
||||||
$vars = vv_conf_vars();
|
$vars = vv_conf_vars();
|
||||||
$tsPeers = vv_pt_ts_peers();
|
$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'] ?? '');
|
$ownerSlot = strtolower($vars['PARTNERSHIP_OWNER_HOST'] ?? '');
|
||||||
$setupDb = vv_setup_state_read();
|
$setupDb = vv_setup_state_read();
|
||||||
|
|
||||||
@@ -554,7 +557,11 @@ function vv_pt_nodes(): array {
|
|||||||
'mesh' => $isMe ? null : [
|
'mesh' => $isMe ? null : [
|
||||||
'tailscale' => $ts['online'] === true,
|
'tailscale' => $ts['online'] === true,
|
||||||
'ssh' => !empty($system['unraid_version']) || !empty($system['uptime_sec']),
|
'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,
|
'onboarded' => $onboardPhase >= 2,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user