fix(installer): send correct Host header in Traefik routing check
The root redirect rule matches Host(`PUBLIC_HOST`), not localhost. Curl with --resolve (bash) and Host header (PS1) so the health check sends the right hostname when verifying Traefik routing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -885,8 +885,10 @@ wait_for_docker_healthy() {
|
||||
}
|
||||
|
||||
check_endpoint() {
|
||||
local name="$1" url="$2" timeout_secs="${3:-120}"
|
||||
local name="$1" url="$2" timeout_secs="${3:-120}" resolve="${4:-}"
|
||||
local start_time=$(date +%s)
|
||||
local extra_flags=""
|
||||
[ -n "$resolve" ] && extra_flags="--resolve $resolve"
|
||||
|
||||
while true; do
|
||||
local elapsed=$(( $(date +%s) - start_time ))
|
||||
@@ -894,7 +896,7 @@ check_endpoint() {
|
||||
printf " ${RED}[FAIL]${NC} %-20s not reachable after %ds\n" "$name" "$timeout_secs"
|
||||
return 1
|
||||
fi
|
||||
if curl -sfk -o /dev/null "$url" 2>/dev/null; then
|
||||
if curl -sfk $extra_flags -o /dev/null "$url" 2>/dev/null; then
|
||||
local duration=$(( $(date +%s) - start_time ))
|
||||
printf " ${GREEN}[ok]${NC} %-20s ready (%ds)\n" "$name" "$duration"
|
||||
return 0
|
||||
@@ -927,7 +929,7 @@ verify_health() {
|
||||
check_endpoint "Cameleer SaaS" "https://localhost:${HTTPS_PORT}/platform/api/config" 120 || failed=1
|
||||
|
||||
[ $failed -eq 0 ] && \
|
||||
check_endpoint "Traefik routing" "https://localhost:${HTTPS_PORT}/" 30 || failed=1
|
||||
check_endpoint "Traefik routing" "https://${PUBLIC_HOST}:${HTTPS_PORT}/" 30 "${PUBLIC_HOST}:${HTTPS_PORT}:127.0.0.1" || failed=1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user