added dns lookup if local and tailscale fail for git
This commit is contained in:
+9
-4
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user