Graceful degradation before partnership/SSH is set up

Fix 1 — Monitor partner card (common.php + monitor.php):
  vv_remote_hosts_stats() no longer skips hosts with no API key.
  Returns no_api_key:true entry instead. Monitor JS renders
  "API key not configured — complete Onboard to enable" instead
  of a blank space.

Fix 2 — rawconf push not alarming pre-onboard (config.php + scheduler.php):
  Probe failures (Tailscale not found, plugin not installed) now carry
  ready:false. JS treats ready:false results silently — button shows
  "✓ Saved" not "push failed: HOST2" before SSH is set up.
  Only genuine post-onboard failures (ready not false) show as errors.

Fix 3 — Partnership Onboard button (partnership.php):
  Disabled with tooltip when no partner hostname is in master.conf.
  When partner configured but not onboarded, adds explanation note:
  "Onboard will generate your SSH key, exchange it with the partner..."
  No partner configured: "Edit master.conf and set HOST2."
This commit is contained in:
Gmer4Lfe
2026-05-30 16:01:44 -04:00
parent 974e3cf2cf
commit 0121462576
5 changed files with 36 additions and 11 deletions
+5 -1
View File
@@ -572,7 +572,11 @@ function vv_remote_hosts_stats(): array {
foreach ($hostIds as $id) {
if (strtolower($id) === strtolower($myHost)) continue;
$key = $vars[strtoupper($id) . '_UNRAID_API_KEY'] ?? '';
if (!$key) continue;
if (!$key) {
$results[$id] = ['available' => false, 'no_api_key' => true,
'host_id' => $id, 'hostname' => $vars[$id]];
continue;
}
$cacheFile = "/tmp/vv_remote_{$id}.json";
if (file_exists($cacheFile) && (time() - filemtime($cacheFile)) < 30) {
+2 -2
View File
@@ -84,7 +84,7 @@ function vv_push_master_conf(): array {
$hostname = trim($m[2][$i]);
$ip = vv_resolve_tailscale_ip($hostname);
if (!$ip) {
$results[] = ['host' => $hostKey, 'ok' => false, 'error' => 'Tailscale IP not found'];
$results[] = ['host' => $hostKey, 'ok' => false, 'ready' => false, 'error' => 'Tailscale IP not found'];
continue;
}
@@ -102,7 +102,7 @@ function vv_push_master_conf(): array {
) ?: '');
if ($probe === '') {
$results[] = ['host' => $hostKey, 'ok' => false,
$results[] = ['host' => $hostKey, 'ok' => false, 'ready' => false,
'error' => 'plugin not installed, dir missing, or master.conf absent — skipped'];
continue;
}