Put the join inside the wizard, send a partner to Partnership when it finishes, and say what is left

This commit is contained in:
Gmer4Lfe
2026-08-17 06:16:36 -04:00
parent 366e2a269f
commit 069815790b
4 changed files with 278 additions and 158 deletions
+14 -2
View File
@@ -182,6 +182,18 @@ if ($action === 'ssh_generate') {
exit;
}
// Where setup hands the operator next, by role.
//
// Both exits used to be hardcoded to the Scheduler. For HOST1 that is defensible — it has just
// written a conf and Scheduler is where you would tune it. For a partner it is a dead end: a
// mirror that finishes setup has exactly one job left, installing its key and joining, and that
// lives on the Partnership tab. The role was already known here and simply not consulted.
function vv_setup_redirect(string $mySlot, string $confFile = 'master.conf'): string {
return strtolower($mySlot) === 'host1'
? '?tab=scheduler&vv_setup=' . $confFile
: '?tab=partnership&vv_setup=' . $confFile;
}
// ── POST: run conf_populate.sh ─────────────────────────────────────────────────────────────────
if ($action === 'populate') {
$script = DEPLOY_DIR . '/conf_populate.sh';
@@ -342,7 +354,7 @@ if ($action === 'pull') {
echo json_encode(['ok' => true, 'host_id' => $hostId, 'conf_file' => $confFile,
'api_key' => $apiKeyResult,
'redirect' => '?tab=scheduler&vv_setup=' . $confFile]);
'redirect' => vv_setup_redirect($hostId, $confFile)]);
exit;
}
@@ -495,5 +507,5 @@ echo json_encode([
'api_key' => $apiKeyResult,
'needs_migration'=> $needsMigration,
'migrate_to' => $needsMigration ? ($storageInternal === 'true' ? 'internal' : 'flash') : null,
'redirect' => '?tab=scheduler&vv_setup=master.conf',
'redirect' => vv_setup_redirect($mySlot),
]);