From d09ea1169488e4e6bc40fa1cb3b089b6c6b551c5 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sat, 30 May 2026 16:14:07 -0400 Subject: [PATCH] Onboard Step 9: push master.conf to all listed hosts on completion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After Step 8 (arr bootstrap), owner calls vv_push_master_conf() and vv_push_setup_state() via php -r. SSH is established at this point so the probe passes and all listed hosts get the authoritative master.conf immediately — no manual save required. Skipped if onboard failed, dry-run mode, or php unavailable (with fallback instruction). Result shown in onboard summary as Step 9. --- Partnership/partnership_onboard.sh | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Partnership/partnership_onboard.sh b/Partnership/partnership_onboard.sh index 342001d..4381e96 100755 --- a/Partnership/partnership_onboard.sh +++ b/Partnership/partnership_onboard.sh @@ -28,6 +28,7 @@ # Step 6: Deploy arr stack — push arr XMLs, pull images, create + start on mirror # Step 7: Partnership onboard — configure WebUIs → owner IP, write state, FolderView3, Emby # Step 8: Arr bootstrap — bidirectional library sync (arr_sync.sh) +# Step 9: Conf push — push master.conf + setup state to all listed hosts # # ============================================================================================== # DESIGN PRINCIPLES @@ -486,6 +487,7 @@ ARR_DEPLOYED=0 ARR_FAILED=0 ONBOARD_OK=false ARR_SYNC_OK=false +MASTER_PUSH_OK=false # ── Step 1: SSH ─────────────────────────────────────────────────────────────────────────────── echo "━━━ Step 1/8 — SSH Key Setup ━━━" @@ -614,6 +616,42 @@ else warn "Re-run Media/arr_sync.sh once all arr containers are live" fi +# ── Step 9: Push master.conf to all listed hosts ────────────────────────────────────────────── +# SSH is now established and all partners have the plugin installed. +# Push the authoritative master.conf so every listed host is in sync immediately. +echo "" +echo "━━━ $ICON_GEAR Step 9/9 — master.conf Push ━━━" + +if [[ "$ONBOARD_OK" == false ]]; then + warn "Skipping — onboard did not complete" +elif [[ "$DRY_RUN" == true ]]; then + warn "DRY RUN — would push master.conf to all listed hosts" + MASTER_PUSH_OK=true +elif ! command -v php &>/dev/null; then + warn "php not available — push master.conf manually via Scheduler → master.conf → Save Conf" +else + push_output=$(php -r " +require_once '/usr/local/emhttp/plugins/varaverk/include/config.php'; +\$results = vv_push_master_conf(); +vv_push_setup_state(); +if (empty(\$results)) { echo 'no remote hosts'; exit(0); } +\$failed = 0; +foreach (\$results as \$r) { + echo \$r['host'] . ': ' . (\$r['ok'] ? 'pushed' : 'FAILED — ' . \$r['error']) . PHP_EOL; + if (!\$r['ok']) \$failed++; +} +exit(\$failed > 0 ? 1 : 0); +" 2>/dev/null) + push_rc=$? + echo "$push_output" + if [[ $push_rc -eq 0 ]]; then + echo "master.conf sync complete ✅" + MASTER_PUSH_OK=true + else + warn "master.conf push had failures — retry via Scheduler → master.conf → Save Conf" + fi +fi + # ── Summary ─────────────────────────────────────────────────────────────────────────────────── END=$(date +%s) echo "" @@ -633,6 +671,7 @@ echo " Step 5 — Stop arr: $(_skip "$SKIP_ARR_STACK" "$STEP_STOP_ARR_OK echo " Step 6 — Arr stack: $( [[ "$SKIP_ARR_STACK" == true ]] && echo "skipped" || echo "${ARR_DEPLOYED} deployed, ${ARR_FAILED} failed" )" echo " Step 7 — Onboard: $(_ok "$ONBOARD_OK")" echo " Step 8 — Arr bootstrap: $( [[ "$SKIP_ARR_SYNC" == true || "$ONBOARD_OK" == false ]] && echo "skipped" || echo "$(_ok "$ARR_SYNC_OK")" )" +echo " Step 9 — Conf push: $( [[ "$ONBOARD_OK" == false ]] && echo "skipped" || echo "$(_ok "$MASTER_PUSH_OK")" )" echo "" if [[ "$ONBOARD_OK" == true ]]; then