Stop counting a gated-off critical rsync as an unreachable partner, and report the counter in the unit it is stored in

The guard tested Tier 1 only, so onboard Step 1d's posture — Tier 1 open, every Tier 2 closed — made a healthy partner climb toward auto-offboard every 30 minutes. The counter holds intervals, not days, and was rendered raw.
This commit is contained in:
Gmer4Lfe
2026-08-17 11:39:19 -04:00
parent 5fc53948c6
commit d8a77c700b
3 changed files with 28 additions and 6 deletions
+12 -2
View File
@@ -59,11 +59,20 @@ require_once __DIR__ . '/common.php'; // vv_system_info(), vv_docker_containers(
function vv_pt_config(): array {
$v = vv_conf_vars();
$offlineDays = null;
// The file is named ..._days.db and does not hold days. partnership_manager.sh --check runs
// from the 30-minute orchestrator and increments once per run, so the unit is INTERVALS, and
// the auto-offboard threshold it is compared against is computed as days × 48. Reading the
// raw number and printing it as days overstated the outage by 48× — a partner unreachable
// for half an hour rendered as "unreachable 1 day · auto-offboard in 29 days".
$offlineDays = null;
$offlineIntervals = null;
$odFile = STATE_DIR . '/partnership_offline_days.db';
if (file_exists($odFile)) {
$raw = trim(@file_get_contents($odFile) ?: '');
if (is_numeric($raw)) $offlineDays = (int)$raw;
if (is_numeric($raw)) {
$offlineIntervals = (int)$raw;
$offlineDays = $offlineIntervals / 48;
}
}
return [
'enabled' => ($v['PARTNERSHIP_ENABLED'] ?? 'false') === 'true',
@@ -72,6 +81,7 @@ function vv_pt_config(): array {
'grace_hours' => (int)($v['PARTNERSHIP_GRACE_HOURS'] ?? 6),
'offline_threshold' => (int)($v['PARTNERSHIP_OFFLINE_THRESHOLD'] ?? 30),
'offline_days' => $offlineDays,
'offline_intervals' => $offlineIntervals,
'remove_tailscale' => ($v['PARTNERSHIP_REMOVE_TAILSCALE'] ?? 'false') === 'true',
'folderview3' => ($v['PARTNERSHIP_FOLDERVIEW3'] ?? 'false') === 'true',
'tailscale_configured' => !empty($v['TAILSCALE_API_KEY']) && !empty($v['TAILSCALE_TAILNET']),