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:
@@ -924,9 +924,11 @@ function Wait-DockerHealthy {
|
||||
}
|
||||
|
||||
function Test-Endpoint {
|
||||
param([string]$Name, [string]$Url, [int]$TimeoutSecs = 120)
|
||||
param([string]$Name, [string]$Url, [int]$TimeoutSecs = 120, [string]$HostHeader = '')
|
||||
$start = Get-Date
|
||||
$lastDot = -1
|
||||
$headers = @{}
|
||||
if ($HostHeader) { $headers['Host'] = $HostHeader }
|
||||
while ($true) {
|
||||
$elapsed = [int]((Get-Date) - $start).TotalSeconds
|
||||
if ($elapsed -ge $TimeoutSecs) {
|
||||
@@ -935,7 +937,7 @@ function Test-Endpoint {
|
||||
}
|
||||
try {
|
||||
# -SkipCertificateCheck is PS6+ only; SSL trust is handled by Enable-TrustAllCerts above
|
||||
$resp = Invoke-WebRequest -Uri $Url -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop
|
||||
$resp = Invoke-WebRequest -Uri $Url -UseBasicParsing -TimeoutSec 5 -Headers $headers -ErrorAction Stop
|
||||
$dur = [int]((Get-Date) - $start).TotalSeconds
|
||||
Write-Host (" [ok] {0,-20} ready ({1}s)" -f $Name, $dur) -ForegroundColor Green
|
||||
return $true
|
||||
@@ -976,7 +978,7 @@ function Verify-Health {
|
||||
if (-not (Test-Endpoint 'Cameleer SaaS' "https://localhost:$($c.HttpsPort)/platform/api/config" 120)) { $failed = $true }
|
||||
}
|
||||
if (-not $failed) {
|
||||
if (-not (Test-Endpoint 'Traefik routing' "https://localhost:$($c.HttpsPort)/" 30)) { $failed = $true }
|
||||
if (-not (Test-Endpoint 'Traefik routing' "https://localhost:$($c.HttpsPort)/" 30 $c.PublicHost)) { $failed = $true }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user