From 3c900ae5c131e57add3bbea325c9c746782a47c4 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 14 Jun 2026 01:09:53 -0400 Subject: [PATCH] Resolve remote storage path from host*.conf for true cross-platform SSH support detect_hosts() now sets REMOTE_STORAGE_PATH from HOST*_STORAGE_PATH in the remote's conf instead of calling platform_storage_path() locally. SSH commands that check the remote's storage (check_remote_array, check_remote_disks, check_both_healthy) use $REMOTE_STORAGE_PATH so they work correctly when the remote is a different platform with a different storage root. --- Partnership/partnership_manager.sh | 5 ++--- common.sh | 24 ++++++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Partnership/partnership_manager.sh b/Partnership/partnership_manager.sh index 00645b3..f9f2f7e 100755 --- a/Partnership/partnership_manager.sh +++ b/Partnership/partnership_manager.sh @@ -876,14 +876,13 @@ revoke_emby_admin() { check_both_healthy() { platform_storage_healthy || { error "Local array not healthy"; return 1; } - local mirror_ip _spath + local mirror_ip mirror_ip=$(resolve_tailscale_ip "$MIRROR") [[ -z "$mirror_ip" ]] && { error "Cannot resolve $MIRROR Tailscale IP"; return 1; } - _spath=$(platform_storage_path) timeout "$SSH_TIMEOUT" ssh -i "$MIRROR_SSH_KEY" \ -o ConnectTimeout="$SSH_TIMEOUT" root@"$mirror_ip" \ - "mountpoint -q '$_spath' && timeout 10 docker ps" >/dev/null 2>&1 || { + "mountpoint -q '$REMOTE_STORAGE_PATH' && timeout 10 docker ps" >/dev/null 2>&1 || { error "Mirror $MIRROR not healthy" return 1 } diff --git a/common.sh b/common.sh index 85bd6ca..ef05bc1 100755 --- a/common.sh +++ b/common.sh @@ -362,11 +362,13 @@ validate_int() { # all HOST* values discovered from host*.conf files. # # Sets: -# MY_ID — "HOST1" or "HOST2" (the role key, not the hostname) -# REMOTE_ID — the peer's role key -# LOCAL_SERVER_NAME — local hostname string (e.g. "unRAID-Gmer4Lfe") -# REMOTE_SERVER_NAME — remote hostname string -# SSH_KEY — SSH key for server-to-server operations +# MY_ID — "HOST1" or "HOST2" (the role key, not the hostname) +# REMOTE_ID — the peer's role key +# LOCAL_SERVER_NAME — local hostname string (e.g. "unRAID-Gmer4Lfe") +# REMOTE_SERVER_NAME — remote hostname string +# SSH_KEY — SSH key for server-to-server operations +# REMOTE_STORAGE_PATH — remote's storage root from HOST*_STORAGE_PATH in host*.conf; +# falls back to platform_storage_path() for unconfigured pairs # # Also sets aliases for all host-specific arrays so scripts use unprefixed names: # DAILY_SYNC_SHARES ← HOST*_DAILY_SYNC_SHARES @@ -609,6 +611,13 @@ detect_hosts() { _alias_assoc "WATCHDOG_DEPENDENCIES" _alias_assoc "WATCHDOG_APPDATA_SIZES" + # ── Remote storage path ─────────────────────────────────────────────────── + # Resolved from REMOTE_ID's host*.conf so SSH commands use the correct path + # even when the remote is a different platform. Falls back to the local + # platform_storage_path() for unconfigured same-platform pairs. + local _rsp_var="${REMOTE_ID}_STORAGE_PATH" + REMOTE_STORAGE_PATH="${!_rsp_var:-$(platform_storage_path)}" + # ── Output ──────────────────────────────────────────────────────────────── log "$ICON_HOST Host: $LOCAL_SERVER_NAME → $REMOTE_SERVER_NAME" } @@ -773,7 +782,7 @@ check_local_array() { check_remote_array() { log "Checking remote array on $REMOTE_SERVER_NAME..." local _spath result - _spath=$(platform_storage_path) + _spath="$REMOTE_STORAGE_PATH" result=$(ssh -i "$SSH_KEY" -o ConnectTimeout=10 root@"$REMOTE_SERVER" \ "mountpoint -q '$_spath' && echo yes || echo no" 2>/dev/null) if [[ "$result" != "yes" ]]; then @@ -1000,8 +1009,7 @@ check_remote_disks() { done | sort -u" 2>/dev/null) # Tier 3 — storage root fallback - local _spath - _spath=$(platform_storage_path) + local _spath="$REMOTE_STORAGE_PATH" if [[ -z "$backing_disks" ]] && [[ -z "$zfs_pool_paths" ]]; then local on_user on_user=$(ssh -i "$SSH_KEY" root@"$REMOTE_SERVER" \