<# .SYNOPSIS Verify a Coolify application after a deploy. .DESCRIPTION Implements section 8 of docs/AGENTS-coolify-apps.md: runs the public endpoint check, the sibling DNS check from inside the app container, the container status snapshot, and the proxy logs for routing/cert errors. Requires the existing repo scripts (Invoke-ProxmoxSsh.ps1, Get-CoolifyDockerStatus.ps1, Invoke-CoolifyApi.ps1). No new dependencies. .PARAMETER Fqdn Full public URL, e.g. https://myapp.urieljareth.org. .PARAMETER ContainerName App container name as seen by `docker ps` inside LXC 102 (used for the sibling DNS check and the proxy log filter). .PARAMETER SiblingService Optional Docker service name to verify with `getent hosts` from inside the app container. Example: 'postgres' or 'app-db'. .PARAMETER ApplicationUuid Optional Coolify application UUID. If provided, also fetches the app status via API and lists recent deployments. .EXAMPLE .\Test-PostDeploy.ps1 -Fqdn https://myapp.urieljareth.org ` -ContainerName my-app-main -SiblingService postgres #> param( [Parameter(Mandatory = $true)] [string]$Fqdn, [Parameter(Mandatory = $true)] [string]$ContainerName, [string]$SiblingService, [string]$ApplicationUuid ) $ErrorActionPreference = "Stop" $here = Split-Path -Parent $MyInvocation.MyCommand.Path $repoRoot = (Resolve-Path (Join-Path $here "..\..")).Path $ssh = Join-Path $repoRoot "scripts\Invoke-ProxmoxSsh.ps1" $dockerStatus = Join-Path $repoRoot "coolify_skill\scripts\Get-CoolifyDockerStatus.ps1" $coolifyApi = Join-Path $repoRoot "coolify_skill\scripts\Invoke-CoolifyApi.ps1" function Get-SectionTitle($t) { Write-Host "`n=== $t ===" -ForegroundColor Cyan } Get-SectionTitle "1. Public endpoint HTTP check ($Fqdn)" & curl.exe -sSI $Fqdn --max-time 15 | Select-Object -First 8 Get-SectionTitle "2. Container status in LXC 102" & $dockerStatus -Filter $ContainerName if ($SiblingService) { Get-SectionTitle "3. Sibling DNS from inside '$ContainerName' -> '$SiblingService'" & $ssh -Command "pct exec 102 -- docker exec $ContainerName getent hosts $SiblingService" 2>&1 } Get-SectionTitle "4. coolify-proxy logs (filter: error | acme | certificate | $ContainerName)" $cmd = "pct exec 102 -- docker logs coolify-proxy --tail 80 2>&1 | grep -iE 'error|certificate|acme|$ContainerName' | tail -30" & $ssh -Command $cmd 2>&1 if ($ApplicationUuid) { Get-SectionTitle "5. Coolify API: app status + recent deployments" & $coolifyApi -Path "/applications/$ApplicationUuid" 2>&1 | Select-String -Pattern '"status"|"fqdn"|"name"|"ports_exposes"' & $coolifyApi -Path "/applications/$ApplicationUuid/deployments" 2>&1 | Select-Object -First 40 } Write-Host "`nVerification complete." -ForegroundColor Green