added dns lookup if local and tailscale fail for git

This commit is contained in:
2026-04-19 17:43:49 -04:00
parent 4103e1be65
commit b1d1bcc847
2 changed files with 12 additions and 4 deletions
+3
View File
@@ -113,6 +113,9 @@
GITEA_CONTAINER="Gitea" # exact Docker container name GITEA_CONTAINER="Gitea" # exact Docker container name
GITEA_REPO_PATH="FailedProxy/Unraid_Scripts.git" # repo path on Gitea 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" TARGET_DIR="/mnt/user/appdata/unraid_scripts"
GITEA_SSH_KEY="/root/.ssh/unraid_gitea" # SSH key for authenticating to Gitea GITEA_SSH_KEY="/root/.ssh/unraid_gitea" # SSH key for authenticating to Gitea
SSH_PORT=221 # Gitea SSH port SSH_PORT=221 # Gitea SSH port
+9 -4
View File
@@ -47,12 +47,17 @@ else
# Gitea is not running locally — find it on the remote server via Tailscale # Gitea is not running locally — find it on the remote server via Tailscale
info "$ICON_CONTAINERS Gitea not running locally — checking remote server" info "$ICON_CONTAINERS Gitea not running locally — checking remote server"
GITEA_IP=$(tailscale ip -4 "$REMOTE_SERVER_NAME" 2>/dev/null) GITEA_IP=$(tailscale ip -4 "$REMOTE_SERVER_NAME" 2>/dev/null)
if [[ -z "$GITEA_IP" ]]; then if [[ -n "$GITEA_IP" ]]; then
error "Cannot resolve Tailscale IP for $REMOTE_SERVER_NAME — is Tailscale running?" info "$ICON_NET Gitea on $REMOTE_SERVER_NAME — connecting via Tailscale $GITEA_IP"
notify "Git pull failed on $(hostname) — cannot find Gitea container or resolve remote IP" "Git Sync" "alert" 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 exit 1
fi fi
info "$ICON_NET Gitea on $REMOTE_SERVER_NAME — connecting via $GITEA_IP"
fi fi
REPO_SSH="git@${GITEA_IP}:${GITEA_REPO_PATH}" REPO_SSH="git@${GITEA_IP}:${GITEA_REPO_PATH}"