Health check do publicador em /up e /login em vez de /dashboard

/dashboard exige sessão e responde 302 para /login, também na entrega
activa; o publicador fazia rollback de todas as entregas (c574df4 a
01/12: cinco tentativas com HTTP 302). Passa a exigir HTTP 200 em /up
e em /login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 20:45:14 +02:00
co-authored by Claude Opus 5.5
parent c574df4d39
commit 2c24032ec3
+18 -13
View File
@@ -185,22 +185,27 @@ log "Executar health check local."
HEALTH_OK=0
# /dashboard exige sessão e responde 302 para /login; o health check usa
# /up (arranque do Laravel) e /login (página pública renderizada).
health_code() {
/usr/bin/curl \
--noproxy '*' \
--silent \
--show-error \
--output /dev/null \
--write-out '%{http_code}' \
--resolve "$HOST:443:127.0.0.1" \
--max-time 15 \
"https://$HOST$1" || true
}
for attempt in 1 2 3 4 5; do
HTTP_CODE="$(
/usr/bin/curl \
--noproxy '*' \
--silent \
--show-error \
--output /dev/null \
--write-out '%{http_code}' \
--resolve "$HOST:443:127.0.0.1" \
--max-time 15 \
"https://$HOST/dashboard" || true
)"
UP_CODE="$(health_code /up)"
LOGIN_CODE="$(health_code /login)"
log "Health check $attempt: HTTP $HTTP_CODE"
log "Health check $attempt: /up HTTP $UP_CODE, /login HTTP $LOGIN_CODE"
if [ "$HTTP_CODE" = "200" ]; then
if [ "$UP_CODE" = "200" ] && [ "$LOGIN_CODE" = "200" ]; then
HEALTH_OK=1
break
fi