diff --git a/health_check.sh b/health_check.sh index 67769002..ca1e66b1 100644 --- a/health_check.sh +++ b/health_check.sh @@ -38,11 +38,10 @@ check_internal() { local port=$2 local path=$3 - # Führe curl *innerhalb* des gateway_proxy Containers aus - # Das umgeht alle Auth-, Host- und DNS-Probleme - http_code=$(docker exec gateway_proxy sh -c "apk add --no-cache curl > /dev/null && curl -s -o /dev/null -w '%{http_code}' --max-time 5 http://${service_name}:${port}${path}") + http_code=$(docker exec gateway_proxy sh -c "apk add --no-cache curl > /dev/null 2>&1 && curl -s -o /dev/null -w '%{http_code}' --max-time 5 http://${service_name}:${port}${path}") - if [ "$http_code" -eq 200 ]; then + # 401 ist für geschützte Endpunkte ein Erfolg, da der Server antwortet + if [ "$http_code" -eq 200 ] || [ "$http_code" -eq 401 ]; then printf " - ✅ %-25s: %s OK\n" "$service_name" "$http_code" else printf " - ❌ %-25s: %s FAILED\n" "$service_name" "$http_code" @@ -53,11 +52,11 @@ check_internal() { check_internal "company-explorer" 8000 "/api/health" check_internal "connector-superoffice" 8000 "/health" check_internal "lead-engine" 8501 "/" -check_internal "market-intelligence" 3001 "/" +check_internal "market-intelligence" 3001 "/api/projects" # Hat keinen Root, aber /api/projects check_internal "content-engine" 3006 "/" -check_internal "competitor-analysis" 8000 "/" # Uvicorn default +check_internal "competitor-analysis" 8000 "/" check_internal "heatmap-frontend" 80 "/" -check_internal "heatmap-backend" 8000 "/" +check_internal "heatmap-backend" 8000 "/" # Hat einen Root-Endpunkt echo "" echo "--- RESULT ---"