diff --git a/Master.conf b/Master.conf index 6b6792d..e1ba71e 100644 --- a/Master.conf +++ b/Master.conf @@ -113,6 +113,9 @@ GITEA_CONTAINER="Gitea" # exact Docker container name GITEA_REPO_PATH="FailedProxy/Unraid_Scripts.git" # repo path on Gitea + GITEA_DOMAIN="" # public domain fallback — e.g. git.gmer4lfe.com + # used if local and Tailscale both fail + # requires NPM + DNS setup before enabling TARGET_DIR="/mnt/user/appdata/unraid_scripts" GITEA_SSH_KEY="/root/.ssh/unraid_gitea" # SSH key for authenticating to Gitea SSH_PORT=221 # Gitea SSH port diff --git a/git_pull_execute.sh b/git_pull_execute.sh index c17ad91..8be341c 100644 --- a/git_pull_execute.sh +++ b/git_pull_execute.sh @@ -47,12 +47,17 @@ else # Gitea is not running locally — find it on the remote server via Tailscale info "$ICON_CONTAINERS Gitea not running locally — checking remote server" GITEA_IP=$(tailscale ip -4 "$REMOTE_SERVER_NAME" 2>/dev/null) - if [[ -z "$GITEA_IP" ]]; then - error "Cannot resolve Tailscale IP for $REMOTE_SERVER_NAME — is Tailscale running?" - notify "Git pull failed on $(hostname) — cannot find Gitea container or resolve remote IP" "Git Sync" "alert" + if [[ -n "$GITEA_IP" ]]; then + info "$ICON_NET Gitea on $REMOTE_SERVER_NAME — connecting via Tailscale $GITEA_IP" + elif [[ -n "$GITEA_DOMAIN" ]]; then + # Tailscale failed — fall back to public domain + warn "Tailscale resolution failed — falling back to $GITEA_DOMAIN" + GITEA_IP="$GITEA_DOMAIN" + else + error "Cannot find Gitea — local: not running, Tailscale: failed, domain: not configured" + notify "Git pull failed on $(hostname) — cannot locate Gitea container" "Git Sync" "alert" exit 1 fi - info "$ICON_NET Gitea on $REMOTE_SERVER_NAME — connecting via $GITEA_IP" fi REPO_SSH="git@${GITEA_IP}:${GITEA_REPO_PATH}"