From 5a6d31c147067fab56bced5a45a8a135562159eb Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Wed, 8 Jul 2026 01:41:12 -0600 Subject: [PATCH] fix: make Evolution CRM and Evolution GO templates respond on their domains evolutioncrm: - Point the evo-crm-frontend domain at port 80 instead of 5173: the community frontend image serves the built app via nginx on port 80 (5173 is the vite dev port), so the domain returned 502. - Set EVOLUTION_API_ONLY_SERVER=true on evo-crm: the community image ships without the Rails dashboard views (the UI lives in the separate evo-crm-frontend service), so the default root route (dashboard#index) can never render and returned 406 for every request. With the flag the root serves the API status JSON; all /api routes are unaffected. - Drop the evolution-go-* volumes that were left over from the other template. evolutiongo: - Evolution GO has no route on "/" and answers 503 (LICENSE_REQUIRED) on API routes until a license is activated through the bundled manager UI, so the single domain never responded. Add a small nginx gateway that redirects "/" to /manager/login and proxies everything else (WebSockets included) 1:1 to evolution-go:8080, and point the domain at it. - Persist /app/dbdata and /app/logs. Co-Authored-By: Claude Fable 5 --- blueprints/evolutioncrm/docker-compose.yml | 3 +- blueprints/evolutioncrm/template.toml | 2 +- blueprints/evolutiongo/docker-compose.yml | 15 +++++++- blueprints/evolutiongo/template.toml | 40 ++++++++++++++++++++-- 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/blueprints/evolutioncrm/docker-compose.yml b/blueprints/evolutioncrm/docker-compose.yml index ab1da2d5..50a37b8b 100644 --- a/blueprints/evolutioncrm/docker-compose.yml +++ b/blueprints/evolutioncrm/docker-compose.yml @@ -92,6 +92,7 @@ services: - BACKEND_URL=${BACK_URL} - FRONTEND_URL=${FRONT_URL} - CORS_ORIGINS=${FRONT_URL},${BACK_URL} + - EVOLUTION_API_ONLY_SERVER=true - DISABLE_TELEMETRY=true - LOG_LEVEL=info - ENABLE_ACCOUNT_SIGNUP=true @@ -248,5 +249,3 @@ volumes: redis-data: evo-processor-data: evo-crm-data: - evolution-go-logs: - evolution-go-data: diff --git a/blueprints/evolutioncrm/template.toml b/blueprints/evolutioncrm/template.toml index 90a6c36d..a81c5e4e 100644 --- a/blueprints/evolutioncrm/template.toml +++ b/blueprints/evolutioncrm/template.toml @@ -51,7 +51,7 @@ host = "${auth_domain}" [[config.domains]] serviceName = "evo-crm-frontend" -port = 5173 +port = 80 host = "${front_domain}" diff --git a/blueprints/evolutiongo/docker-compose.yml b/blueprints/evolutiongo/docker-compose.yml index 062709eb..2ad80181 100644 --- a/blueprints/evolutiongo/docker-compose.yml +++ b/blueprints/evolutiongo/docker-compose.yml @@ -11,9 +11,20 @@ services: - DATABASE_SAVE_MESSAGES=${DATABASE_SAVE_MESSAGES} - WADEBUG=${WADEBUG} - LOGTYPE=${LOGTYPE} + volumes: + - evolution-go-data:/app/dbdata + - evolution-go-logs:/app/logs depends_on: - evolution-postgres + evolution-gateway: + image: nginx:alpine + restart: always + volumes: + - ../files/gateway.conf:/etc/nginx/conf.d/default.conf:ro + depends_on: + - evolution-go + evolution-postgres: image: postgres:16-alpine restart: always @@ -25,4 +36,6 @@ services: - evolution-postgres-data:/var/lib/postgresql/data volumes: - evolution-postgres-data: \ No newline at end of file + evolution-postgres-data: + evolution-go-data: + evolution-go-logs: diff --git a/blueprints/evolutiongo/template.toml b/blueprints/evolutiongo/template.toml index c178703a..37957061 100644 --- a/blueprints/evolutiongo/template.toml +++ b/blueprints/evolutiongo/template.toml @@ -17,9 +17,43 @@ env = [ "POSTGRES_PASSWORD=${postgres_password}", "DATABASE_CONNECTION_URI=postgres://postgresql:${postgres_password}@evolution-postgres:5432", ] -mounts = [] + +[[config.mounts]] +filePath = "gateway.conf" +content = """ +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +server { + listen 80; + server_name _; + absolute_redirect off; + client_max_body_size 100m; + + # Evolution GO has no route on "/" (and the API answers 503 until the + # license is activated), so send visitors to the bundled manager UI. + location = / { + return 302 /manager/login; + } + + location / { + proxy_pass http://evolution-go:8080; + 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 Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_read_timeout 3600s; + proxy_send_timeout 3600s; + } +} +""" [[config.domains]] -serviceName = "evolution-go" -port = 8_080 +serviceName = "evolution-gateway" +port = 80 host = "${main_domain}"