deploy_skill: soporte para Coolify v4.1.2 (API /applications 404) + flujo UI Playwright

Aprendido desplegando cotizador (Next.js+FastAPI+Postgres, Docker Compose,
repo privado) en coolify.urieljareth.org (v4.1.2):

- Documenta que /applications/* devuelve 404 en esta instancia y que configurar
  apps git build-from-source solo es posible por la UI web.
- Nuevos scripts scripts/coolify-ui/: coolify-login.mjs (guarda storageState) y
  Configure-CoolifyComposeApp.mjs (build pack -> Docker Compose, Reload Compose
  File, env vars por Developer view, dominios por servicio).
- references/coolify-4.1.2-notes.md: mapa de API funcional/404, gotchas (BOM
  UTF-8 rompe el parser YAML de Coolify; Reload Compose File obligatorio; pin de
  dominios por servicio o 503; no encolar deploys concurrentes; PowerShell
  [IO.File]::ReadAllText para payloads de llaves).
- env.local.template.ps1: COOLIFY_EMAIL/COOLIFY_PASSWORD para la UI.
- SKILL.md/TOOLS.md: seccion "instance reality" y flujo UI paso a paso.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
urieljareth
2026-07-08 00:42:12 -06:00
co-authored by Claude Opus 4.8
parent cd998ce6b0
commit e7d1c33cd5
22 changed files with 2935 additions and 0 deletions
+75
View File
@@ -0,0 +1,75 @@
<#
.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