Fix up env vars and nginx config, working web sockets
This commit is contained in:
parent
b8cae21f52
commit
9cf7a4e694
2
abra.sh
2
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
|
||||
|
15
compose.yml
15
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
|
||||
|
27
nginx.conf
27
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user