From 60e87ba518e7a289e8128cf05927e7307d82b39f Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Mon, 17 Aug 2026 11:04:36 -0400 Subject: [PATCH] Clear the mirror from the blocklist before the provisioning sync, not after it A previous offboard blocklists the mirror and rsync.sh refuses blocklisted hosts, so on a re-onboard Step 1e was being refused and the auth stack would have deployed against empty directories. --- Partnership/partnership_onboard.sh | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Partnership/partnership_onboard.sh b/Partnership/partnership_onboard.sh index 34de173..fa8d6e8 100755 --- a/Partnership/partnership_onboard.sh +++ b/Partnership/partnership_onboard.sh @@ -22,6 +22,8 @@ # Step 1: SSH key setup — generate keypair, install on mirror, update conf # Step 1b: Docker network — ensure varaverk docker network exists on mirror # Step 1c: Share setup — create missing Unraid shares on mirror (pool-aware, idempotent) +# Step 1c2:Permit mirror — drop the mirror from the partnership blocklist a previous +# offboard wrote, or Step 1e's rsync is refused # Step 1d: Sync gates — Tier 1 + CONF_SYNC + ARR_SYNC on, every Tier 2 rsync gate # off. Here, not at the end, because Step 1e is an rsync # Step 1e: Auth appdata — rsync PARTNERSHIP_PROVISION_SHARES to the mirror BEFORE the @@ -874,6 +876,39 @@ else bash "$SCRIPT_DIR/share_setup.sh" fi +# ── Step 1c2: Permit the mirror ─────────────────────────────────────────────────────────────── +# A previous offboard blocklists the mirror, and rsync.sh refuses any host on that list outright +# — deliberately, so a stale cron cannot keep syncing to a partner that has been removed. +# +# The blocklist was cleared inside Step 8, which was fine while every rsync in the onboard came +# after it. Step 1e does not: it runs before the containers are deployed, which is the whole +# point of it. On a re-onboard that ordering means the provisioning sync is refused, the auth +# stack comes up against empty directories, and the step built to prevent exactly that reports +# a failure nobody can explain from its own output. +# +# Un-blocking here is not a loosening. The offboard's own summary says "re-onboard to permit +# access again" — an onboard is the event that permits it, and this is where the onboard starts +# needing it. Step 8 still runs its own clear; removing an absent entry is a no-op. +echo "" +echo "━━━ Step 1c2 — Permit $MIRROR ━━━" + +UNBLOCK_OK=true +_blocklist="${PARTNERSHIP_BLOCKLIST_FILE:-${STATE_DIR}/partnership_blocklist.db}" +if [[ ! -f "$_blocklist" ]] || ! grep -q "^${MIRROR}|" "$_blocklist" 2>/dev/null; then + echo " $MIRROR is not blocklisted ✅" +elif [[ "$DRY_RUN" == true ]]; then + warn "DRY RUN — would remove $MIRROR from the partnership blocklist" +else + sed -i "/^${MIRROR}|/d" "$_blocklist" 2>/dev/null + if grep -q "^${MIRROR}|" "$_blocklist" 2>/dev/null; then + error "Could not remove $MIRROR from $_blocklist — rsync.sh will refuse it" + UNBLOCK_OK=false + else + echo " Removed $MIRROR from the blocklist ✅" + fi +fi +unset _blocklist + # ── Step 1d: Sync gates ─────────────────────────────────────────────────────────────────────── # This was Step 9c, after the containers were already deployed. It has to run here instead, # because Step 1e below is itself an rsync and Tier 1 stops every rsync — arming afterwards @@ -1259,6 +1294,7 @@ _skip() { [[ "$1" == true ]] && echo "skipped" || echo "$(_ok "$2")"; } echo " Step 1 — SSH keys: $(_skip "$SKIP_SSH" "$STEP_SSH_OK")" echo " Step 1b — Docker network: $(_ok "$STEP_NETWORK_OK")" +echo " Step 1c2— Permit mirror: $(_ok "$UNBLOCK_OK")" echo " Step 1d — Sync gates: $( [[ "$SKIP_ARM" == true ]] && echo "skipped (--no-arm)" || { [[ "$AM_OWNER" != true ]] && echo "mirror — set by owner" || _ok "$ARM_OK"; } )" echo " Step 1e — Auth appdata: $( [[ "$SKIP_APPDATA_PROVISION" == true ]] && echo "skipped" || _ok "$APPDATA_PROVISION_OK" )" echo " Step 2 — Stop auth: $(_skip "$SKIP_AUTH_STACK" "$STEP_STOP_AUTH_OK")"