Commit inicial - estructura base del proyecto
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
# Runbook: Baserow en Coolify
|
||||
|
||||
Dominio: `https://baserow.urieljareth.org`
|
||||
|
||||
Aplicacion verificada: `vngcvnhbfqboov4nln88zc73`
|
||||
|
||||
Recurso Coolify: `baserow:main-md9t2bo1h9wdcp69mbw1cppc`
|
||||
|
||||
Contenedor principal: `baserow-vngcvnhbfqboov4nln88zc73-164230166388`
|
||||
|
||||
## Estado
|
||||
|
||||
```powershell
|
||||
.\coolify_skill\scripts\Get-CoolifyDockerStatus.ps1 -Filter "baserow|s10bvby|vztgldo"
|
||||
curl.exe -k -sSI --max-time 30 https://baserow.urieljareth.org/login
|
||||
```
|
||||
|
||||
Resultado verificado el 2026-05-31:
|
||||
|
||||
- Baserow: `healthy`
|
||||
- `BASEROW_PUBLIC_URL`: `https://baserow.urieljareth.org`
|
||||
- `/login`: `302 Found` hacia `/signup`
|
||||
- `/signup`: `200 OK`
|
||||
- Postgres externo: `s10bvby71tb1fpbcl4tnxzzh`
|
||||
- Redis externo: `vztgldo9cap3s0oj240tokgj`
|
||||
- servicio duplicado `baserow-f3payqxqgnfv3l47zr0q25t6`: detenido
|
||||
|
||||
## Fix aplicado
|
||||
|
||||
Baserow no arrancaba de forma publica por dos problemas:
|
||||
|
||||
1. El compose intentaba publicar puertos host `80:80` y `443:443`, que deben
|
||||
pertenecer a `coolify-proxy`.
|
||||
2. Baserow necesitaba resolver Postgres y Redis en la red global `coolify`.
|
||||
|
||||
La resolucion DNS de estos hosts depende de esa red:
|
||||
|
||||
- `s10bvby71tb1fpbcl4tnxzzh`
|
||||
- `vztgldo9cap3s0oj240tokgj`
|
||||
|
||||
El compose de Baserow debe dejar que Traefik sirva el dominio y debe usar la
|
||||
red `coolify`:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
baserow:
|
||||
networks:
|
||||
coolify: null
|
||||
|
||||
networks:
|
||||
coolify:
|
||||
name: coolify
|
||||
external: true
|
||||
```
|
||||
|
||||
Tambien se corrigio la regla de Traefik. No usar `Host(\baserow...)`; debe
|
||||
usar backticks:
|
||||
|
||||
```text
|
||||
Host(`baserow.urieljareth.org`) && PathPrefix(`/`)
|
||||
```
|
||||
|
||||
## Aplicar compose
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- sh -lc 'cd /data/coolify/applications/vngcvnhbfqboov4nln88zc73 && docker compose config --quiet && docker compose up -d'"
|
||||
```
|
||||
|
||||
## Logs
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker logs baserow-vngcvnhbfqboov4nln88zc73-164230166388 --tail 160"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker logs coolify-proxy --tail 120 | grep -Ei 'baserow|vng|error'"
|
||||
```
|
||||
|
||||
## Primer uso
|
||||
|
||||
En una instalacion nueva, `/login` redirige a `/signup` para crear el primer
|
||||
usuario administrador.
|
||||
@@ -0,0 +1,54 @@
|
||||
# Runbook: Conexion
|
||||
|
||||
## 1. Cargar entorno
|
||||
|
||||
Usa un archivo privado `.env.local.ps1` con estos valores:
|
||||
|
||||
```powershell
|
||||
$env:PROXMOX_HOST = "192.168.0.200"
|
||||
$env:PROXMOX_NODE = "thinkcentre"
|
||||
$env:PROXMOX_USER = "root"
|
||||
$env:PROXMOX_SSH_KEY = "C:\Users\Uriel Jareth\.openclaw\workspace\proxmox_key_win"
|
||||
$env:PROXMOX_API_BASE_URL = "https://192.168.0.200:8006/api2/json"
|
||||
$env:PROXMOX_API_TOKEN_ID = "root@pam!openclaw"
|
||||
$env:PROXMOX_API_TOKEN_SECRET = "REPLACE_WITH_TOKEN_SECRET"
|
||||
$env:PROXMOX_COOLIFY_LXC = "102"
|
||||
```
|
||||
|
||||
Luego:
|
||||
|
||||
```powershell
|
||||
. .\.env.local.ps1
|
||||
```
|
||||
|
||||
## 2. Probar conexion
|
||||
|
||||
```powershell
|
||||
.\scripts\Test-ProxmoxConnection.ps1
|
||||
```
|
||||
|
||||
Resultados esperados:
|
||||
|
||||
- `config`: `PASS`
|
||||
- `ssh-read`: `PASS`
|
||||
- `docker-lxc-102`: `PASS`
|
||||
- `api-auth`: `PASS` si el token esta cargado, `SKIP` si no lo esta
|
||||
|
||||
## 3. Comandos base
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "hostname && pveversion"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct list && qm list"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'"
|
||||
```
|
||||
|
||||
## 4. API REST
|
||||
|
||||
Desde PowerShell:
|
||||
|
||||
```powershell
|
||||
. .\scripts\ProxmoxAgent.ps1
|
||||
Invoke-ProxmoxApi -Path "/version"
|
||||
Invoke-ProxmoxApi -Path "/nodes"
|
||||
Invoke-ProxmoxApi -Path "/cluster/resources"
|
||||
```
|
||||
@@ -0,0 +1,41 @@
|
||||
# Runbook: Coolify y Docker
|
||||
|
||||
Docker corre dentro del LXC `102`, no directamente sobre el host Proxmox.
|
||||
|
||||
## Estado general
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker stats --no-stream"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker volume ls"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker network ls"
|
||||
```
|
||||
|
||||
## Logs de un contenedor
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker logs <container> --tail 100"
|
||||
```
|
||||
|
||||
## Inspect
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker inspect <container>"
|
||||
```
|
||||
|
||||
## Reinicio controlado
|
||||
|
||||
Requiere confirmacion explicita.
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker restart <container>"
|
||||
```
|
||||
|
||||
## Shell interactivo
|
||||
|
||||
Usar solo cuando haga falta inspeccion manual.
|
||||
|
||||
```powershell
|
||||
ssh -i "C:\Users\Uriel Jareth\.openclaw\workspace\proxmox_key_win" root@192.168.0.200
|
||||
pct exec 102 -- docker exec -it <container> /bin/sh
|
||||
```
|
||||
@@ -0,0 +1,36 @@
|
||||
# Runbook: Diagnostico
|
||||
|
||||
Empieza siempre con lectura. Si algo apunta a una accion destructiva o de
|
||||
reinicio, confirma primero.
|
||||
|
||||
## Salud del host
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "hostname && uptime && pveversion"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "df -h && free -h"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "systemctl --failed --no-pager"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pvesh get /cluster/resources"
|
||||
```
|
||||
|
||||
## LXC
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct list"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct status 102"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct config 102"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- df -h"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- free -h"
|
||||
```
|
||||
|
||||
## Tareas Proxmox
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pvesh get /nodes/thinkcentre/tasks --limit 20"
|
||||
```
|
||||
|
||||
## Logs
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "journalctl -p warning -n 100 --no-pager"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- journalctl -p warning -n 100 --no-pager"
|
||||
```
|
||||
@@ -0,0 +1,47 @@
|
||||
# Runbook: Incidentes OpenClaw Browser/CDP
|
||||
|
||||
Historial resumido de incidentes previos con OpenClaw y su browser container.
|
||||
|
||||
## Sintomas comunes
|
||||
|
||||
- Browser container aparece `unhealthy`.
|
||||
- OpenClaw no conecta al browser via CDP.
|
||||
- Timeouts contra el puerto CDP.
|
||||
|
||||
## Diagnostico
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep -E 'openclaw|browser'"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker exec <browser-container> ss -tlnp"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker logs <browser-container> --tail 100"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker logs <openclaw-container> --tail 100"
|
||||
```
|
||||
|
||||
## Puerto CDP
|
||||
|
||||
En un incidente previo, Chromium escuchaba en `127.0.0.1:9222` dentro del
|
||||
container y nginx exponia `0.0.0.0:9223` para otros containers. No asumas que
|
||||
`9222` o `9223` es correcto sin probar desde la red Docker actual.
|
||||
|
||||
Prueba desde el container OpenClaw:
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker exec <openclaw-container> curl -sf http://<browser-host>:9223/json/version"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker exec <openclaw-container> curl -sf http://<browser-host>:9222/json/version"
|
||||
```
|
||||
|
||||
## Acciones que requieren confirmacion
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker exec <browser-container> pkill -f chromium"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker restart <browser-container>"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker restart <openclaw-container>"
|
||||
```
|
||||
|
||||
## Notas de configuracion
|
||||
|
||||
- Montar `/dev/shm` o usar `shm_size` suficiente suele mejorar estabilidad de
|
||||
Chromium en Docker.
|
||||
- Limpiar locks de perfil en startup puede resolver arranques atascados.
|
||||
- Cambios de capacidades como `SYS_ADMIN` o `seccomp:unconfined` son sensibles;
|
||||
revisarlos antes de aplicarlos.
|
||||
@@ -0,0 +1,98 @@
|
||||
# Runbook: Nextcloud en Coolify
|
||||
|
||||
Servicio verificado: `hdcdpkm0jko3qqvn5683ercc`
|
||||
|
||||
Dominio: `https://nextcloudsuite.urieljareth.org`
|
||||
|
||||
## Estado de contenedores
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep -Ei 'nextcloud|hdcdpkm0'"
|
||||
```
|
||||
|
||||
## Redeploy manual desde compose generado por Coolify
|
||||
|
||||
Si el endpoint API de Coolify no esta disponible o no hay token cargado:
|
||||
|
||||
```powershell
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- sh -lc 'cd /data/coolify/services/hdcdpkm0jko3qqvn5683ercc && docker compose up -d'"
|
||||
```
|
||||
|
||||
## Fix HTTPS reverse proxy
|
||||
|
||||
No usar `sed` para editar `config.php`. Usar el script PHP del repo:
|
||||
|
||||
```powershell
|
||||
scp -o StrictHostKeyChecking=no -i "C:\Users\Uriel Jareth\.openclaw\workspace\proxmox_key_win" .\scripts\fix-nextcloud-config.php root@192.168.0.200:/tmp/fix-nextcloud-config.php
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct push 102 /tmp/fix-nextcloud-config.php /tmp/fix-nextcloud-config.php"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker cp /tmp/fix-nextcloud-config.php nextcloud-hdcdpkm0jko3qqvn5683ercc:/tmp/fix-nextcloud-config.php"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker exec nextcloud-hdcdpkm0jko3qqvn5683ercc php /tmp/fix-nextcloud-config.php /config/www/nextcloud/config/config.php nextcloudsuite.urieljareth.org nextcloud-db"
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker exec nextcloud-hdcdpkm0jko3qqvn5683ercc sh -lc 'chown abc:users /config/www/nextcloud/config/config.php && chmod 640 /config/www/nextcloud/config/config.php'"
|
||||
```
|
||||
|
||||
Debe quedar:
|
||||
|
||||
```php
|
||||
'overwriteprotocol' => 'https',
|
||||
'overwritehost' => 'nextcloudsuite.urieljareth.org',
|
||||
'overwrite.cli.url' => 'https://nextcloudsuite.urieljareth.org',
|
||||
'dbhost' => 'nextcloud-db',
|
||||
```
|
||||
|
||||
En el instalador web, el campo de host PostgreSQL debe ser `nextcloud-db`, no
|
||||
`localhost`. `localhost` apunta al contenedor de Nextcloud, no al contenedor
|
||||
PostgreSQL.
|
||||
|
||||
## Pruebas
|
||||
|
||||
```powershell
|
||||
curl.exe -k -i -L --max-time 30 https://nextcloudsuite.urieljareth.org/status.php
|
||||
curl.exe -k -sSI --max-time 30 https://nextcloudsuite.urieljareth.org/login
|
||||
curl.exe -k -sSI --max-time 30 https://nextcloudsuite.urieljareth.org/remote.php/dav
|
||||
```
|
||||
|
||||
## Error `permission denied for table oc_migrations`
|
||||
|
||||
Si el instalador muestra:
|
||||
|
||||
```text
|
||||
SQLSTATE[42501]: Insufficient privilege: 7 ERROR: permission denied for table oc_migrations
|
||||
```
|
||||
|
||||
primero verificar el estado real antes de resetear volumenes. En una instalacion
|
||||
parcial, el formulario puede fallar mientras la base queda creada.
|
||||
|
||||
Comprobaciones seguras:
|
||||
|
||||
```powershell
|
||||
curl.exe -k -sS --max-time 30 https://nextcloudsuite.urieljareth.org/status.php
|
||||
.\scripts\Invoke-ProxmoxSsh.ps1 -Command "pct exec 102 -- docker exec nextcloud-hdcdpkm0jko3qqvn5683ercc sh -lc 'cd /app/www/public && s6-setuidgid abc php occ status'"
|
||||
```
|
||||
|
||||
Verificar desde Nextcloud con el usuario real de `config.php`, sin imprimir la
|
||||
password: conectar por PDO y ejecutar `select count(*) from oc_migrations`.
|
||||
Si funciona, no reparar permisos: la instancia ya puede usar la tabla.
|
||||
|
||||
Estado verificado el 2026-05-31:
|
||||
|
||||
- `installed`: `true`
|
||||
- `maintenance`: `false`
|
||||
- `needsDbUpgrade`: `false`
|
||||
- `dbhost`: `nextcloud-db`
|
||||
- usuario activo de Nextcloud en PostgreSQL: `oc_admin`
|
||||
- `oc_admin` puede leer `oc_migrations`
|
||||
- `oc_users`: 1 usuario
|
||||
|
||||
Resultado verificado tras recuperacion:
|
||||
|
||||
- `status.php`: `200 OK`
|
||||
- `installed`: `true`
|
||||
- `maintenance`: `false`
|
||||
- container Nextcloud: `running healthy`
|
||||
- redirects HTTPS probados sin `Location: http://...`
|
||||
|
||||
## Pendiente tras reset de volumenes
|
||||
|
||||
Si el volumen de configuracion/base de datos fue eliminado, Nextcloud queda como
|
||||
instancia fresca. Hay que completar instalacion inicial antes de usar la app de
|
||||
escritorio.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Runbook: Seguridad
|
||||
|
||||
## Secretos
|
||||
|
||||
No guardar en el repo:
|
||||
|
||||
- Passwords de Proxmox o LXC.
|
||||
- Secretos de token API.
|
||||
- Claves privadas SSH.
|
||||
- Tickets, cookies o backups de configuracion con credenciales.
|
||||
|
||||
Usar:
|
||||
|
||||
- `.env.local.ps1` para entorno local.
|
||||
- `.env.example` para plantilla sin secretos reales.
|
||||
- Rotacion de tokens si un secreto fue expuesto en Markdown o logs.
|
||||
|
||||
## Politica de cambios
|
||||
|
||||
Antes de cambios con impacto:
|
||||
|
||||
1. Capturar estado actual.
|
||||
2. Confirmar el objetivo exacto.
|
||||
3. Identificar rollback posible.
|
||||
4. Ejecutar una accion pequena y verificable.
|
||||
5. Verificar servicio, logs y recursos.
|
||||
|
||||
## Acciones sensibles
|
||||
|
||||
Requieren confirmacion explicita:
|
||||
|
||||
- Reinicios de host, LXC, VM o containers productivos.
|
||||
- Cambios de red, firewall, storage o volumenes.
|
||||
- `destroy`, `rm`, `prune`, `wipe`, `resize`, updates masivos.
|
||||
- Cambios en permisos, tokens, claves o usuarios.
|
||||
Reference in New Issue
Block a user