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.
This commit is contained in:
Gmer4Lfe
2026-07-04 00:28:50 -04:00
parent 6623d1e776
commit 997f9d9117
+11 -3
View File
@@ -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
────────────────────────────────────────────────────────────────────────────────
-->
<FILE Run="/bin/bash" Method="install">
@@ -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