Actualiza toolkit operativo y documentación

This commit is contained in:
urieljareth
2026-09-10 20:53:50 -06:00
parent 3b7209dcc1
commit 714057bfc8
69 changed files with 6023 additions and 384 deletions
+64 -15
View File
@@ -6,19 +6,51 @@ All commands assume PowerShell from the project root. Load env first:
. .\.env.local.ps1
```
> **Canonical catalog:** [`docs/TOOL-INDEX.md`](../docs/TOOL-INDEX.md) — verified
> signatures, env requirements, and which scripts are broken on this instance.
## Which pipelines actually work here (re-verified 2026-08-29, v4.3.14)
Through the **public hostname**, `/applications/*` still 404s — but that block is
**Cloudflare's edge, not Coolify's**: against the origin
(`http://192.168.0.117:8000/api/v1`, `$env:COOLIFY_API_URL_ORIGIN`) the full
applications namespace responds 200 with the same token. State-changing
endpoints are POST-only since v4.2. Script status today:
| Script | Status | Why |
|---|---|---|
| `Publish-ProjectToCoolify.ps1` | ⚠️ untested on 4.3.14 | calls `New-CoolifyApplication.ps1` → point `COOLIFY_API_URL` at the origin |
| `New-CoolifyApplication.ps1` | ⚠️ untested on 4.3.14 | `POST /applications/public`, `PATCH /applications/{uuid}` — respond via the origin |
| `Invoke-CoolifyRollback.ps1` | ⚠️ untested on 4.3.14 | `PATCH /applications/{uuid}` — responds via the origin |
| `New-CoolifyService.ps1` | ✅ works | `POST /services` |
| `coolify-ui/*.mjs` (Playwright) | ✅ works | drives the web UI |
| `New-CoolifyAppViaDB.ps1` | ⚠️ last resort | direct `INSERT` into Coolify's DB |
**Working paths, in order of preference:**
1. Multi-container stack with `docker-compose.coolify.yml` → `New-CoolifyService.ps1`.
2. Git build-from-source app → try the API against the origin
(`New-CoolifyApplication.ps1` with `COOLIFY_API_URL` pointed at the origin);
if it misbehaves, fall back to the Playwright UI flow below.
3. Last resort → `New-CoolifyAppViaDB.ps1` (no validation, no rollback).
The scaffold/validate/verify scripts (`Initialize-CoolifyProject.ps1`,
`Test-PreDeployChecklist.ps1`, `Test-ServiceOnline.ps1`, `New-GitHubRepo.ps1`)
are unaffected and work normally.
Required env vars (in `.env.local.ps1`, gitignored):
- `COOLIFY_TOKEN` — for Coolify API.
- `GITHUB_TOKEN` — PAT for GitHub API (create repo, list). `git push` uses
wincred, NOT this PAT.
- (Optional) `GITHUB_OWNER` — override the default `urieljarethbusiness-cpu`.
- `COOLIFY_EMAIL` / `COOLIFY_PASSWORD` — Coolify **web UI** login. Required for the
UI-driven flow below (this instance's `/applications/*` API is 404 — see
`references/coolify-4.1.2-notes.md`).
- `COOLIFY_EMAIL` / `COOLIFY_PASSWORD` — Coolify **web UI** login. Required for
the UI-driven fallback flow below (see `references/coolify-4.1.2-notes.md`;
the probable values are already in `.env.local.ps1`).
## UI-driven config for git build-from-source apps (this instance, v4.1.2)
## UI-driven config for git build-from-source apps (fallback path)
Because `/applications/*` is 404 here, configure git-based Docker-Compose apps through the
If the API-via-origin path misbehaves, configure git-based Docker-Compose apps through the
UI with Playwright (run from the manager repo root so `require('playwright')` resolves):
```powershell
@@ -38,8 +70,8 @@ $env:CF_ENVBULK = (Get-Content .\myapp\.env.coolify -Raw) # KEY=VALUE lines ->
$env:CF_DOMAINS = '{"web":"https://myapp.urieljareth.org"}' # pin per-service domains (else Coolify assigns random ones -> 503)
node .\deploy_skill\scripts\coolify-ui\Configure-CoolifyComposeApp.mjs
# 3. Trigger the deploy (API works even though app CRUD is 404) and watch it
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/deploy?uuid=<app>"
# 3. Trigger the deploy (POST since v4.2) and watch it
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Method POST -Path "/deploy?uuid=<app>"
# poll GET /deployments/{deployment_uuid} for status+logs; then verify:
.\deploy_skill\scripts\Test-ServiceOnline.ps1 -Fqdn https://myapp.urieljareth.org -ExpectTitle "<regex>"
```
@@ -55,8 +87,16 @@ node .\deploy_skill\scripts\coolify-ui\Configure-CoolifyComposeApp.mjs
> Dockerfile builds (POST /applications/public). `New-CoolifyService.ps1` is
> for multi-container Docker Compose stacks (POST /services). Use the right
> one for your project shape.
>
> Since 2026-08-29 the first pipeline should also work by pointing
> `COOLIFY_API_URL` at the origin (`http://192.168.0.117:8000/api/v1`) — the 404
> on `/applications/*` was Cloudflare's edge, not Coolify's. Verify on the next
> deploy before relying on it.
### Full pipeline (one shot)
### Full pipeline (one shot) — via the origin
Blocked only through the public hostname (Cloudflare 404 on
`/applications/*`). Point the API at the origin and step 5 should succeed:
```powershell
.\deploy_skill\scripts\Publish-ProjectToCoolify.ps1 `
@@ -168,18 +208,27 @@ You will be prompted for the SHA if you omit `-CommitSha`.
## Coolify API (already documented in coolify_skill)
The deploy skill reuses `coolify_skill/scripts/Invoke-CoolifyApi.ps1`. Useful
endpoints for the deploy flow:
The deploy skill reuses `coolify_skill/scripts/Invoke-CoolifyApi.ps1`. Endpoints
that **work here**, useful for the deploy flow:
```powershell
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/projects"
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/servers"
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/applications"
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/applications/<uuid>"
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/applications/<uuid>/deployments"
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Method POST -Path "/deploy" -BodyJson (@{ uuid = "<uuid>" } | ConvertTo-Json)
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/services"
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/resources" # enumerate apps + get uuids
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Method POST -Path "/deploy?uuid=<uuid>" # trigger a deploy (POST-only since v4.2)
.\coolify_skill\scripts\Invoke-CoolifyApi.ps1 -Path "/deployments/<deployment-uuid>"
```
⚠️ `/applications*` and `/github-apps` **404 through the public hostname
(Cloudflare edge block, re-verified 2026-08-29)** — call them via the origin
(`$env:COOLIFY_API_URL_ORIGIN` = `http://192.168.0.117:8000/api/v1`), where the
full namespace works. `/resources` remains the simplest inventory;
`/deployments/<uuid>` covers deployment status.
Remember `-Raw` if you need objects instead of a JSON string — see
[`docs/TOOL-INDEX.md`](../docs/TOOL-INDEX.md) §1.1.
For per-endpoint schemas, search `coolify_skill/references/ops/` with `rg`.
## Templates
@@ -239,7 +288,7 @@ the manager repo root.
| Symptom | Likely cause | Fix |
|---------|--------------|-----|
| `git push` asks for username/password | wincred cache miss | Run any git HTTPS op once interactively; or `cmdkey /generic:git:https://github.com /user:urieljarethbusiness-cpu /pass:<PAT>` |
| GitHub API 401 | `GITHUB_TOKEN` not loaded or expired | `. .\.env.local.ps1`; regenerate PAT at https://github.com/settings/tokens |
| GitHub API 401 | `GITHUB_TOKEN` not loaded or expired | `. .\.env.local.ps1` (carries the wincred token since 2026-08-29); re-extract with `git credential fill` if it rotates |
| Coolify API 401 | `COOLIFY_TOKEN` not loaded | `. .\.env.local.ps1` |
| App at 502 after deploy | `ports_exposes` mismatch (default is 3000) | `New-CoolifyApplication.ps1 -PortsExposes <real-port>` |
| App can't reach DB | used `localhost` or wrong network | Use service name + external `coolify` network (see §2.1, §2.2 in AGENTS-coolify-apps.md) |