diff --git a/docker-compose.yml b/docker-compose.yml index f7b9c7866f..69a31161a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -151,6 +151,7 @@ services: - XMPP_RECORDER_DOMAIN - XMPP_PORT - WHITEBOARD_ENABLED + - WHITEBOARD_URL_BASE - WHITEBOARD_COLLAB_SERVER_PUBLIC_URL networks: meet.jitsi: diff --git a/env.example b/env.example index 1e328f87f1..6e97971a71 100644 --- a/env.example +++ b/env.example @@ -214,3 +214,8 @@ JIBRI_XMPP_PASSWORD= # Jitsi image version (useful for local development) #JITSI_IMAGE_VERSION=latest + +# whiteboard support +WHITEBOARD_ENABLED=1 +WHITEBOARD_URL_BASE=whiteboard.meet.jitsi +WHITEBOARD_COLLAB_SERVER_PUBLIC_URL=https://meet.example.com \ No newline at end of file diff --git a/web/rootfs/defaults/meet.conf b/web/rootfs/defaults/meet.conf index 8fc7beb493..6de59684d0 100644 --- a/web/rootfs/defaults/meet.conf +++ b/web/rootfs/defaults/meet.conf @@ -131,6 +131,20 @@ location ^~ /etherpad/ { } {{ end }} +{{ if .Env.WHITEBOARD_URL_BASE }} +# whiteboard (excalidraw-backend) +location = /socket.io/ { + tcp_nodelay on; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + + proxy_pass http://{{ .Env.WHITEBOARD_URL_BASE }}/socket.io/?$args; +} +{{ end }} + location ~ ^/([^/?&:'"]+)$ { try_files $uri @root_path; } diff --git a/web/rootfs/defaults/settings-config.js b/web/rootfs/defaults/settings-config.js index 62d3dfbb1c..97ead8b38e 100644 --- a/web/rootfs/defaults/settings-config.js +++ b/web/rootfs/defaults/settings-config.js @@ -468,4 +468,8 @@ config.e2eping.maxMessagePerSecond = {{ .Env.E2EPING_MAX_MESSAGE_PER_SECOND }}; // Settings for the Excalidraw whiteboard integration. if (!config.hasOwnProperty('whiteboard')) config.whiteboard = {}; config.whiteboard.enabled = {{ $WHITEBOARD_ENABLED }}; -config.whiteboard.collabServerBaseUrl = '{{ $WHITEBOARD_COLLAB_SERVER_PUBLIC_URL }}'; \ No newline at end of file +{{ if .Env.WHITEBOARD_COLLAB_SERVER_PUBLIC_URL -}} +config.whiteboard.collabServerBaseUrl = '{{ $WHITEBOARD_COLLAB_SERVER_PUBLIC_URL }}'; +{{ else if .Env.WHITEBOARD_URL_BASE -}} +config.whiteboard.collabServerBaseUrl = '{{ $PUBLIC_URL }}'; +{{ end -}} \ No newline at end of file diff --git a/whiteboard.yml b/whiteboard.yml new file mode 100644 index 0000000000..4311bf17cf --- /dev/null +++ b/whiteboard.yml @@ -0,0 +1,12 @@ +version: '3.5' + +services: + whiteboard: + image: tgrl/excalidraw-backend:latest + restart: ${RESTART_POLICY:-unless-stopped} + depends_on: + - web + networks: + meet.jitsi: + aliases: + - ${WHITEBOARD_URL_BASE:-whiteboard.meet.jitsi} \ No newline at end of file