Two-phase onboard + partner card enhancements
partnership_onboard.sh: - --phase1-only (OWNER): SSH key exchange + conf push only; safe to run before HOST2 has Varaverk installed; writes HOST2_PHASE1_DONE to setup.db - --phase2-only (OWNER): skips SSH, runs Steps 2-9 (containers, arr stack, onboard, arr sync, conf push); writes HOST2_PHASE2_DONE to setup.db - Mirror path: after SSH setup, SSHes OWNER and fires --phase2-only in background (nohup); reads OWNER's SCRIPTS_DIR from varaverk.cfg first; falls back to manual instruction if SSH fails partnership.php (include): vv_pt_nodes() reads setup.db and exposes onboard_phase (0/1/2) per remote node partnership.php (page): phase-aware Actions section per partner host; node cards show phase badge (not provisioned / awaiting onboard / done); Phase 1 and Phase 2 buttons call run.php with extra_args monitor.php: partner card logo (top-right), CPU thread count, RAM total GB, unRAID version row in remote stats grid
This commit is contained in:
@@ -108,6 +108,7 @@ function vv_pt_nodes(): array {
|
||||
$vars = vv_conf_vars();
|
||||
$tsPeers = vv_pt_ts_peers();
|
||||
$ownerSlot = strtolower($vars['PARTNERSHIP_OWNER_HOST'] ?? '');
|
||||
$setupDb = vv_setup_state_read();
|
||||
|
||||
// SSH key for this host
|
||||
$myId = strtoupper($currentHost);
|
||||
@@ -150,18 +151,24 @@ function vv_pt_nodes(): array {
|
||||
? vv_pt_local_system()
|
||||
: ($ts['online'] && $ts['ip'] && $mySshKey ? vv_pt_remote_system($ts['ip'], $mySshKey) : []);
|
||||
|
||||
// Onboard phase from setup.db — 0=not started, 1=SSH+conf done, 2=fully onboarded
|
||||
$nodeIdUpper = strtoupper($slot);
|
||||
$onboardPhase = ($setupDb[$nodeIdUpper . '_PHASE2_DONE'] ?? '') === 'true' ? 2
|
||||
: (($setupDb[$nodeIdUpper . '_PHASE1_DONE'] ?? '') === 'true' ? 1 : 0);
|
||||
|
||||
$nodes[] = [
|
||||
'slot' => $slot,
|
||||
'id' => strtoupper($slot),
|
||||
'hostname' => $hostname,
|
||||
'is_me' => $isMe,
|
||||
'is_owner' => $isOwner,
|
||||
'ts_online' => $ts['online'],
|
||||
'ts_active' => $ts['active'],
|
||||
'ts_ip' => $ts['ip'],
|
||||
'fallback' => $fbState,
|
||||
'partnership' => $ptDb,
|
||||
'system' => $system,
|
||||
'slot' => $slot,
|
||||
'id' => $nodeIdUpper,
|
||||
'hostname' => $hostname,
|
||||
'is_me' => $isMe,
|
||||
'is_owner' => $isOwner,
|
||||
'ts_online' => $ts['online'],
|
||||
'ts_active' => $ts['active'],
|
||||
'ts_ip' => $ts['ip'],
|
||||
'fallback' => $fbState,
|
||||
'partnership' => $ptDb,
|
||||
'system' => $system,
|
||||
'onboard_phase' => $isMe ? null : $onboardPhase,
|
||||
];
|
||||
}
|
||||
return $nodes;
|
||||
|
||||
Reference in New Issue
Block a user