docker-jitsi-meet icon indicating copy to clipboard operation
docker-jitsi-meet copied to clipboard

whiteboard support

Open tgrld opened this issue 2 years ago • 8 comments

tgrld avatar Feb 22 '23 11:02 tgrld

demo: https://meet.tugrul.dev/

tgrld avatar Feb 22 '23 11:02 tgrld

jitsi/web docker image must be rebuild

tgrld avatar Mar 08 '23 06:03 tgrld

I would like to have this integrated as well, any news on this @tgrld?

Does this require some sort of official jitsi/excalidraw-backend docker image published by you guys @saghul?

loli10K avatar Mar 23 '24 16:03 loli10K

Yes, we need to publish that image indeed.

I plan to do that and come back to this PR soon.

saghul avatar Mar 23 '24 17:03 saghul

Thanks. I am currently running the following patch locally and it seems to work without issues (jitsi/excalidraw-backend is a local build)

diff --git a/web/rootfs/defaults/meet.conf b/web/rootfs/defaults/meet.conf
index 6ec7c03..986e9da 100644
--- a/web/rootfs/defaults/meet.conf
+++ b/web/rootfs/defaults/meet.conf
@@ -8,6 +8,7 @@
 {{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
 {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
 {{ $XMPP_BOSH_URL_BASE := .Env.XMPP_BOSH_URL_BASE | default "http://xmpp.meet.jitsi:5280" -}}
+{{ $WHITEBOARD_ENABLED := .Env.WHITEBOARD_ENABLED | default "0" | toBool }}
 
 server_name _;
 
@@ -133,6 +134,20 @@ location ^~ /etherpad/ {
 }
 {{ end }}
 
+{{ if $WHITEBOARD_ENABLED }}
+# 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://whiteboard.meet.jitsi/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 4a5fbb1..9fae33a 100644
--- a/web/rootfs/defaults/settings-config.js
+++ b/web/rootfs/defaults/settings-config.js
@@ -554,7 +554,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 -}}
+    config.whiteboard.collabServerBaseUrl = '{{ $WHITEBOARD_COLLAB_SERVER_PUBLIC_URL }}';
+{{ else }}
+    collabServerBaseUrl: '{{ $PUBLIC_URL }}'
+{{ end }}
 };
 
 // Testing
diff --git a/whiteboard.yml b/whiteboard.yml
new file mode 100644
index 0000000..d7817ae
--- /dev/null
+++ b/whiteboard.yml
@@ -0,0 +1,12 @@
+version: '3.5'
+
+services:
+  whiteboard:
+        image: jitsi/excalidraw-backend:${JITSI_IMAGE_VERSION:-unstable}
+        restart: ${RESTART_POLICY:-unless-stopped}
+        depends_on:
+            - web
+        networks:
+            meet.jitsi:
+              aliases:
+                    - whiteboard.meet.jitsi

However as soon as i move the excalidraw location to a different path as requested in the code review things start to break:

diff --git a/web/rootfs/defaults/meet.conf b/web/rootfs/defaults/meet.conf
index 986e9da..6ade033 100644
--- a/web/rootfs/defaults/meet.conf
+++ b/web/rootfs/defaults/meet.conf
@@ -136,7 +136,7 @@ location ^~ /etherpad/ {
 
 {{ if $WHITEBOARD_ENABLED }}
 # whiteboard (excalidraw-backend)
-location = /socket.io/ {
+location = /excalidraw-collab/socket.io/ {
     tcp_nodelay on;
 
     proxy_http_version 1.1;
diff --git a/web/rootfs/defaults/settings-config.js b/web/rootfs/defaults/settings-config.js
index 9fae33a..a828a2d 100644
--- a/web/rootfs/defaults/settings-config.js
+++ b/web/rootfs/defaults/settings-config.js
@@ -557,7 +557,7 @@ config.whiteboard = {
 {{ if .Env.WHITEBOARD_COLLAB_SERVER_PUBLIC_URL -}}
     config.whiteboard.collabServerBaseUrl = '{{ $WHITEBOARD_COLLAB_SERVER_PUBLIC_URL }}';
 {{ else }}
-    collabServerBaseUrl: '{{ $PUBLIC_URL }}'
+    collabServerBaseUrl: '{{ $PUBLIC_URL }}/excalidraw-collab/'
 {{ end }}
 };
 

For some reason my browser keeps trying to connect to $PUBLIC_URL/socket.io instead of $PUBLIC_URL/excalidraw-collab/socket.io.

loli10K avatar Mar 23 '24 19:03 loli10K

I'm sorry for being persistent here but how soon-ish can we expect this to move forward @saghul? I am having trouble keeping up with master while also manually applying patches for this functionality (plus #1737).

Also should we open a new PR for this? From his activity history it seems @tgrld is no longer active on GitHub.

loli10K avatar Apr 25 '24 07:04 loli10K

I can't provide an ETA, sorry. Things are busy at the moment.

I'd say open a new PR.

(plus #1737).

How is that one related? AFAIS my feedback has yet to be addressed.

saghul avatar Apr 25 '24 07:04 saghul

How is that one related? AFAIS my feedback has yet to be addressed.

It is indeed not related to this one, i was just saying that since i also need that functionality i am required to apply both patches manually every time master gets updated which is kind of troublesome, so at least having this merged would really help. I will open a new PR.

loli10K avatar Apr 25 '24 08:04 loli10K

With the completion of https://github.com/jitsi/excalidraw-backend/issues/5 (publishing backend to docker hub) this would be great to have completed as well. @loli10K are you still working on this? If not I may use this branch as a start and try to get something out there sooner

bmagistro avatar Jul 02 '24 20:07 bmagistro

See: https://github.com/jitsi/docker-jitsi-meet/pull/1794

saghul avatar Jul 02 '24 20:07 saghul