Infra: unit systemd de Odoo (autoarranque) y vhost nginx

This commit is contained in:
2026-08-13 23:30:50 +00:00
parent 01f6007e30
commit 07e05a643e
2 changed files with 146 additions and 0 deletions

21
infra/odoo-skeen.service Normal file
View File

@@ -0,0 +1,21 @@
[Unit]
Description=Odoo SKEEN (skeen-odoo venv)
After=network.target postgresql.service docker.service
Wants=postgresql.service
[Service]
Type=simple
User=root
WorkingDirectory=/root/skeen-odoo
Environment=SUPABASE_URL=http://192.168.10.114:8000
Environment=SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaXNzIjoic3VwYWJhc2UiLCJpYXQiOjE2NDE3NjkyMDAsImV4cCI6MTc5OTUzNTYwMH0.XA05Pgn-gkEKaZEaHYFc9DAyP45uNJdsl8DL9axUxbc
Environment=WACRM_API_URL=http://localhost:3000
Environment=WACRM_API_KEY=wacrm_live_1m2xkLq9S75b8AWGB4a_tPPiFmJlJJ7wJHAPi9BZWcs
Environment=HERMES_BRIDGE_URL=http://localhost:8090
ExecStart=/root/odoo-venv/bin/python /root/skeen-odoo/odoo-bin -c /root/skeen-odoo/odoo.conf --logfile=/tmp/odoo.log
Restart=always
RestartSec=5
TimeoutStartSec=120
[Install]
WantedBy=multi-user.target

125
infra/skeen-crm Normal file
View File

@@ -0,0 +1,125 @@
server {
listen 80;
server_name skeencrm.consultoria-as.com;
# Portal nativo WACRM (Next.js en localhost:3000)
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_read_timeout 120s;
proxy_buffering off;
}
# WebSocket / hot reload (Next.js usa WS en dev; en prod es SSE para HMR si aplica)
location /_next/webpack-hmr {
proxy_pass http://127.0.0.1:3000/_next/webpack-hmr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
# APIs y assets de Next.js
location /_next/ {
proxy_pass http://127.0.0.1:3000/_next/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_cache_valid 200 1d;
}
location /api/ {
proxy_pass http://127.0.0.1:3000/api/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
}
server {
listen 80;
server_name skeen.consultoria-as.com localhost _;
# Frontend React (SKEEN Classic)
location / {
root /var/www/skeen-frontend;
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache";
}
# Odoo API para el frontend
location /api/odoo/ {
proxy_pass http://127.0.0.1:8069/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
# WACRM API
location /api/v1/ {
proxy_pass http://127.0.0.1:3000/api/v1/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# WACRM WhatsApp webhook de Meta
location /api/whatsapp/webhook {
proxy_pass http://127.0.0.1:3000/api/whatsapp/webhook;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Odoo backend web (acceso directo al ERP)
location /web/ {
proxy_pass http://127.0.0.1:8069/web/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
location /web/static/ {
proxy_pass http://127.0.0.1:8069/web/static/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_cache_valid 200 1d;
}
# Hermes / OpenClaw webhooks (puerto 8080)
location /webhook/ {
proxy_pass http://127.0.0.1:8080/webhook/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# SKEEN Hermes WACRM bridge (puerto 8090)
location /webhook/wacrm {
proxy_pass http://127.0.0.1:8090/webhook/wacrm;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 60s;
}
}