From 9cf7a4e694854d766d7db0d8ccf315071682b4b5 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Tue, 10 Jun 2025 11:53:51 +0100 Subject: [PATCH] Fix up env vars and nginx config, working web sockets --- abra.sh | 2 +- compose.yml | 15 ++++++++------- nginx.conf | 27 +-------------------------- 3 files changed, 10 insertions(+), 34 deletions(-) diff --git a/abra.sh b/abra.sh index ed9b42c..8bdccaa 100755 --- a/abra.sh +++ b/abra.sh @@ -1,3 +1,3 @@ # Set any config versions here # Docs: https://docs.coopcloud.tech/maintainers/handbook/#manage-configs -export NGINX_CONF_VERSION=v1 +export NGINX_CONF_VERSION=v2 diff --git a/compose.yml b/compose.yml index cbff96d..a044941 100644 --- a/compose.yml +++ b/compose.yml @@ -1,4 +1,7 @@ --- + +# NOTE: based on https://github.com/suitenumerique/docs/pull/855/ and https://github.com/suitenumerique/docs/pull/583/ + x-common-env: &common-env DJANGO_CONFIGURATION: Demo DJANGO_ALLOWED_HOSTS: "*" @@ -48,10 +51,6 @@ x-common-env: &common-env AI_MODEL: llama # Collaboration COLLABORATION_API_URL: https://$DOMAIN/collaboration/api/ - COLLABORATION_BACKEND_BASE_URL: http://app:8000 - COLLABORATION_SERVER_ORIGIN: https://$DOMAIN - COLLABORATION_SERVER_SECRET: my-secret - COLLABORATION_WS_URL: wss://${DOMAIN}/collaboration/ws/ x-postgres-env: &postgres-env # Postgresql db container configuration @@ -70,9 +69,11 @@ x-postgres-env: &postgres-env x-yprovider-env: &yprovider-env COLLABORATION_LOGGING: "true" Y_PROVIDER_API_KEY: foobar - COLLABORATION_API_URL: https://impress.127.0.0.1.nip.io/collaboration/api/ - COLLABORATION_SERVER_ORIGIN: https://impress.127.0.0.1.nip.io - COLLABORATION_SERVER_SECRET: barbar + COLLABORATION_API_URL: http://y-provider:4444/api/ + COLLABORATION_SERVER_ORIGIN: https://${DOMAIN} + COLLABORATION_SERVER_SECRET: my-secret + COLLABORATION_BACKEND_BASE_URL: https://${DOMAIN} + COLLABORATION_WS_URL: wss://${DOMAIN}/collaboration/ws/ x-minio-env: &minio-env MINIO_ROOT_USER: user diff --git a/nginx.conf b/nginx.conf index 3f800a4..08566cb 100644 --- a/nginx.conf +++ b/nginx.conf @@ -43,20 +43,9 @@ server { try_files $uri @proxy_to_docs_backend; } + # Proxy auth for collaboration server location /collaboration/ws/ { - # Collaboration Auth request configuration - auth_request /collaboration-auth; - proxy_set_header X-Forwarded-Proto https; - auth_request_set $authHeader $upstream_http_authorization; - auth_request_set $canEdit $upstream_http_x_can_edit; - auth_request_set $userId $upstream_http_x_user_id; - - # Pass specific headers from the auth response - proxy_set_header Authorization $authHeader; - proxy_set_header X-Can-Edit $canEdit; - proxy_set_header X-User-Id $userId; - # Ensure WebSocket upgrade proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -75,20 +64,6 @@ server { proxy_set_header Host $host; } - location /collaboration-auth { - proxy_pass http://docs_backend/api/v1.0/documents/collaboration-auth/; - proxy_set_header X-Forwarded-Proto https; - 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-Original-URL $request_uri; - - # Prevent the body from being passed - proxy_pass_request_body off; - proxy_set_header Content-Length ""; - proxy_set_header X-Original-Method $request_method; - } - location /collaboration/api/ { # Collaboration server proxy_pass http://y-provider:4444;