From fdba6ff5796a9d101b9204a520eea25a198f8631 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 9 Oct 2024 13:37:54 +0200 Subject: [PATCH 1/2] docs: Clarify connectivity requirements (fix #173) Signed-off-by: Julius Knorr --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ccadca8..a9729e5 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,14 @@ You can create whiteboards in the files app and share and collaborate on them. ### Standalone websocket server for Nextcloud Whiteboard -This is a standalone websocket server for the Nextcloud Whiteboard app. It is intended to be used as a standalone service that can be run in a container. +Running the whiteboard server is required for the whiteboard to work. The server will handle real-time collaboration events and broadcast them to all connected clients, which means that the server must be accessible from the users browser, so exposing it for example throuhg a reverse proxy is necessary. It is intended to be used as a standalone service that can be run in a container. -Both the server and the Nextcloud instance must be accessible from the same network and share a common secret key for JWT token generation. +We require the following connectivity: + +- The whiteboard server needs to be able to reach the Nextcloud server over HTTP(S) +- The Nextcloud server needs to be able to reach the whiteboard server over HTTP(S) +- The user's browser needs to be able to reach the whiteboard server over HTTP(S) in the browser +- Nextcloud and the whiteboard server share a secret key to sign and verify JWTs On the Nextcloud side, the server must be configured through: From 707a45a5e5be5df08edff931a2c1af354e80389b Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 9 Oct 2024 13:40:56 +0200 Subject: [PATCH 2/2] docs: Fix docker compose example in readme (fix #172) Signed-off-by: Julius Knorr --- README.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a9729e5..188ef8c 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ occ config:app:set whiteboard collabBackendUrl --value="http://nextcloud.local:3 occ config:app:set whiteboard jwt_secret_key --value="some-random" ``` +### Running the server + #### Local node This mode requires at least Node 20 and NPM 10 to be installed. You can clone this repository, checkout the release version matching your whiteboard app. @@ -49,22 +51,12 @@ JWT_SECRET_KEY="some-random" NEXTCLOUD_URL=http://nextcloud.local npm run server #### Docker -### Building the image - -The image can be built using the following command: - -```bash -docker build -t nextcloud-whiteboard-server -``` - -### Running the server - The server requires the `NEXTCLOUD_URL` environment variable to be set to the URL of the Nextcloud instance that the Whiteboard app is installed on. The server will connect to the Nextcloud instance and listen for whiteboard events. The server can be run in a container using the following command: ```bash -docker run -e JWT_SECRET_KEY=some-random -e NEXTCLOUD_URL=https://nextcloud.local --restart unless-stopped -d ghcr.io/nextcloud-releases/whiteboard:release +docker run -e JWT_SECRET_KEY=some-random -e NEXTCLOUD_URL=https://nextcloud.local --rm ghcr.io/nextcloud-releases/whiteboard:release ``` Docker compose can also be used to run the server: @@ -76,13 +68,20 @@ services: image: ghcr.io/nextcloud-releases/whiteboard:release ports: - 3002:3002 - environment: environment: - NEXTCLOUD_URL=https://nextcloud.local - JWT_SECRET_KEY=some-random-key ``` +#### Building the image locally + +While we publish image on the GitHub container registry you can build the image locally using the following command: + +```bash +docker build -t nextcloud-whiteboard-server -f Dockerfile . +``` + ### Reverse proxy #### Apache