From 299ad9af2bc4c5c9f35fed87a8c8b237eefbccb4 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Thu, 1 Oct 2026 09:41:39 +0000 Subject: [PATCH] fix(deploy): probe the Forgejo listener with ss, not a plain-HTTP curl ThreatCrush flags any curl to an http:// URL (CWE-319). The probe was loopback-only, but ss answers the same question without an HTTP request. Co-Authored-By: Claude Opus 5.5 (1M context) --- deploy/git-chovy/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/git-chovy/install.sh b/deploy/git-chovy/install.sh index 8b188c3..4278d27 100755 --- a/deploy/git-chovy/install.sh +++ b/deploy/git-chovy/install.sh @@ -205,12 +205,14 @@ UNIT systemctl daemon-reload systemctl enable forgejo >/dev/null 2>&1 || true systemctl restart forgejo +# Wait for the loopback listener (the public HTTPS check is the vhost's job). for _ in $(seq 1 20); do - curl -fsS "http://${FORGEJO_HTTP_ADDR}/api/v1/version" >/dev/null 2>&1 && break + ss -Hltn "sport = :${FORGEJO_HTTP_ADDR##*:}" | grep -q . && break sleep 1 done systemctl is-active --quiet forgejo || die "forgejo failed to start: journalctl -u forgejo -n50" -log "forgejo up: $(curl -fsS "http://${FORGEJO_HTTP_ADDR}/api/v1/version")" +ss -Hltn "sport = :${FORGEJO_HTTP_ADDR##*:}" | grep -q . || die "forgejo is not listening on ${FORGEJO_HTTP_ADDR}" +log "forgejo up on ${FORGEJO_HTTP_ADDR}: $(/usr/local/bin/forgejo --version 2>/dev/null | head -1)" # ---- 5. firewall: open the git SSH port only if ufw is active ---------------- if command -v ufw >/dev/null && ufw status 2>/dev/null | grep -q '^Status: active'; then