From 997f9d9117067e7c3c3622c46c734e1fffb6abee Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sat, 4 Jul 2026 00:28:50 -0400 Subject: [PATCH] Add GITEA_DOMAIN fallback tier to plugin installer Local container and Tailscale peer probe both failing (as happened on HOST2) left GitHub as the only fallback, which requires the repo to be public. Adds a domain-based Gitea path in between, matching git_pull_execute.sh. --- Plugin/varaverk.plg | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Plugin/varaverk.plg b/Plugin/varaverk.plg index 0db8c0a..a8fa99c 100644 --- a/Plugin/varaverk.plg +++ b/Plugin/varaverk.plg @@ -69,8 +69,9 @@ echo "[Varaverk] web dir symlinked → $SRC" varaverk-*.txz etc. are already there). Never auto-pulls — updates via the UI git pull. Clone source priority: - 1. Gitea (internal) — reads settings from varaverk.cfg; detects container IP at runtime - 2. GitHub (public) — HTTPS fallback if Gitea is unreachable + 1. Gitea (local container, then Tailscale peer probe) — reads settings from varaverk.cfg + 2. Gitea (GITEA_DOMAIN) — public domain fallback if local/Tailscale lookup fails + 3. GitHub (public) — HTTPS fallback if Gitea is unreachable by any path ──────────────────────────────────────────────────────────────────────────────── --> @@ -115,6 +116,7 @@ SCRIPTS_DIR="/boot/config/plugins/varaverk" GITEA_CONTAINER="Gitea" GITEA_REPO_PATH="FailedProxy/Varaverk.git" GITEA_SSH_KEY="/root/.ssh/unraid_gitea" +GITEA_DOMAIN="" SSH_PORT="221" CFGEOF log "seeded varaverk.cfg" @@ -125,13 +127,14 @@ _read_cfg() { grep -oP "(?<=^${1}=\")[^\"]*" "$CFG_FILE" 2>/dev/null || echo "${ GITEA_CONTAINER=$(_read_cfg GITEA_CONTAINER "Gitea") GITEA_REPO_PATH=$(_read_cfg GITEA_REPO_PATH "FailedProxy/Varaverk.git") GITEA_SSH_KEY=$(_read_cfg GITEA_SSH_KEY "/root/.ssh/unraid_gitea") +GITEA_DOMAIN=$(_read_cfg GITEA_DOMAIN "") SSH_PORT=$(_read_cfg SSH_PORT "221") # Clone on first install only; never auto-pull (updates via the UI git pull). if [[ ! -d "$SCRIPTS_DIR/.git" ]]; then log "initialising repo in $SCRIPTS_DIR ($BRANCH)..." - # Locate Gitea: local container → local IP; else Tailscale; else fall back to GitHub. + # Locate Gitea: local container → Tailscale → GITEA_DOMAIN → GitHub. GITEA_IP="" if command -v docker >/dev/null 2>&1 && \ docker ps --format "{{.Names}}" 2>/dev/null | grep -q "^${GITEA_CONTAINER}$"; then @@ -153,6 +156,11 @@ if [[ ! -d "$SCRIPTS_DIR/.git" ]]; then if v.get('TailscaleIPs')]" 2>/dev/null) fi + if [[ -z "$GITEA_IP" && -n "$GITEA_DOMAIN" ]]; then + log "local/Tailscale lookup failed — falling back to domain: $GITEA_DOMAIN" + GITEA_IP="$GITEA_DOMAIN" + fi + # init-in-place — git clone would fail because the dir already has files. git -C "$SCRIPTS_DIR" init >> "$LOG" 2>&1