Browse Source

feat(whiteboard) add builtin whiteboard integration

Closes: https://github.com/jitsi/docker-jitsi-meet/pull/1480

Co-authored-by: Tugrul Dogan <tugrul.ufuk@gmail.com>
Co-authored-by: Saúl Ibarra Corretgé <saghul@jitsi.org>
loli10K 1 year ago
parent
commit
b4604f3078
5 changed files with 46 additions and 5 deletions
  1. 1 1
      docker-compose.yml
  2. 12 1
      env.example
  3. 15 0
      web/rootfs/defaults/meet.conf
  4. 6 3
      web/rootfs/defaults/settings-config.js
  5. 12 0
      whiteboard.yml

+ 1 - 1
docker-compose.yml

@@ -171,8 +171,8 @@ services:
             - XMPP_MUC_DOMAIN
             - XMPP_RECORDER_DOMAIN
             - XMPP_PORT
-            - WHITEBOARD_ENABLED
             - WHITEBOARD_COLLAB_SERVER_PUBLIC_URL
+            - WHITEBOARD_COLLAB_SERVER_URL_BASE
         networks:
             meet.jitsi:
         depends_on:

+ 12 - 1
env.example

@@ -73,13 +73,24 @@ TZ=UTC
 # Etherpad integration (for document sharing)
 #
 
-# Set etherpad-lite URL in docker local network (uncomment to enable)
+# Set the etherpad-lite URL in the docker local network (uncomment to enable)
 #ETHERPAD_URL_BASE=http://etherpad.meet.jitsi:9001
 
 # Set etherpad-lite public URL, including /p/ pad path fragment (uncomment to enable)
 #ETHERPAD_PUBLIC_URL=https://etherpad.my.domain/p/
 
 
+#
+# Whiteboard integration
+#
+
+# Set the excalidraw-backend URL in the docker local network (uncomment to enable)
+#WHITEBOARD_COLLAB_SERVER_URL_BASE=http://whiteboard.meet.jitsi
+
+# Set the excalidraw-backend public URL (uncomment to enable)
+#WHITEBOARD_COLLAB_SERVER_PUBLIC_URL=https://whiteboard.meet.my.domain
+
+
 #
 # Basic Jigasi configuration options (needed for SIP gateway support)
 #

+ 15 - 0
web/rootfs/defaults/meet.conf

@@ -134,6 +134,21 @@ location ^~ /etherpad/ {
 }
 {{ end }}
 
+{{ if .Env.WHITEBOARD_COLLAB_SERVER_URL_BASE }}
+# whiteboard (excalidraw-backend)
+location = /socket.io/ {
+    proxy_buffering off;
+    proxy_cache_bypass $http_upgrade;
+
+    proxy_http_version 1.1;
+    proxy_set_header Upgrade $http_upgrade;
+    proxy_set_header Connection "upgrade";
+    proxy_set_header X-Forwarded-For $remote_addr;
+
+    proxy_pass {{ .Env.WHITEBOARD_COLLAB_SERVER_URL_BASE }}/socket.io/?$args;
+}
+{{ end }}
+
 location ~ ^/([^/?&:'"]+)$ {
     try_files $uri @root_path;
 }

+ 6 - 3
web/rootfs/defaults/settings-config.js

@@ -62,8 +62,7 @@
 {{ $ENABLE_LOCAL_RECORDING_SELF_START := .Env.ENABLE_LOCAL_RECORDING_SELF_START | default "false" | toBool -}}
 {{ $DISABLE_PROFILE := .Env.DISABLE_PROFILE | default "false" | toBool -}}
 {{ $ROOM_PASSWORD_DIGITS := .Env.ROOM_PASSWORD_DIGITS | default "false" -}}
-{{ $WHITEBOARD_COLLAB_SERVER_PUBLIC_URL := .Env.WHITEBOARD_COLLAB_SERVER_PUBLIC_URL | default "" -}}
-{{ $WHITEBOARD_ENABLED := .Env.WHITEBOARD_ENABLED | default "false" | toBool -}}
+{{ $WHITEBOARD_ENABLED := or (.Env.WHITEBOARD_COLLAB_SERVER_PUBLIC_URL | default "" | toBool) (.Env.WHITEBOARD_COLLAB_SERVER_URL_BASE | default "" | toBool) }}
 {{ $TESTING_AV1_SUPPORT := .Env.TESTING_AV1_SUPPORT | default "false" | toBool -}}
 
 // Video configuration.
@@ -554,7 +553,11 @@ config.e2eping.maxMessagePerSecond = {{ .Env.E2EPING_MAX_MESSAGE_PER_SECOND }};
 // Settings for the Excalidraw whiteboard integration.
 config.whiteboard = {
     enabled: {{ $WHITEBOARD_ENABLED }},
-    collabServerBaseUrl: '{{ $WHITEBOARD_COLLAB_SERVER_PUBLIC_URL }}'
+{{ if .Env.WHITEBOARD_COLLAB_SERVER_PUBLIC_URL -}}
+    collabServerBaseUrl: '{{ .Env.WHITEBOARD_COLLAB_SERVER_PUBLIC_URL }}';
+{{ else if .Env.WHITEBOARD_COLLAB_SERVER_URL_BASE -}}
+    collabServerBaseUrl: '{{ $PUBLIC_URL }}'
+{{ end -}}
 };
 
 // Testing

+ 12 - 0
whiteboard.yml

@@ -0,0 +1,12 @@
+version: '3.5'
+
+services:
+    whiteboard:
+        image: jitsi/excalidraw-backend:21
+        restart: ${RESTART_POLICY:-unless-stopped}
+        depends_on:
+            - web
+        networks:
+            meet.jitsi:
+              aliases:
+                  - whiteboard.meet.jitsi