2019-06-17 21:29:44 +00:00
# WBO
2014-01-07 22:18:45 +00:00
2019-06-17 21:29:44 +00:00
WBO is an online collaborative whiteboard that allows many users to draw simultaneously on a large virtual board.
The board is updated in real time for all connected users, and its state is always persisted. It can be used for many different purposes, including art, entertainment, design, teaching.
2014-01-07 22:18:45 +00:00
2020-04-05 16:23:57 +00:00
A demonstration server is available at [wbo.ophir.dev ](https://wbo.ophir.dev )
2018-11-28 09:02:16 +00:00
## Screenshots
2020-04-12 09:47:15 +00:00
< table >
< tr >
< td > The < i > < a href = "https://wbo.ophir.dev/boards/anonymous" > anonymous< / a > < / i > board
2020-04-12 11:50:02 +00:00
< td > < img width = "300" src = "https://user-images.githubusercontent.com/552629/59885574-06e02b80-93bc-11e9-9150-0670a1c5d4f3.png" >
2020-04-12 09:47:15 +00:00
< td > collaborative diagram editing
2020-04-12 11:50:02 +00:00
< td > < img alt = "Screenshot of WBO's user interface: architecture" width = "300" src = "https://user-images.githubusercontent.com/552629/59915054-07101380-941c-11e9-97c9-4980f50d302a.png" / >
2020-04-12 09:47:15 +00:00
< tr >
< td > teaching math on < b > WBO< / b >
2020-05-01 17:28:54 +00:00
< td > < img alt = "wbo teaching" width = "300" src = "https://user-images.githubusercontent.com/552629/59915737-a386e580-941d-11e9-81ff-db9e37f140db.png" / >
2020-04-12 09:47:15 +00:00
< td > drawing art
2021-06-06 09:40:49 +00:00
< td > < img alt = "kawai cats on WBO" width = "300" src = "https://user-images.githubusercontent.com/552629/120919822-dc2c3200-c6bb-11eb-94cd-57a4254fbe0a.png" / >
2020-04-12 09:47:15 +00:00
< / table >
2020-03-21 19:03:20 +00:00
## Running your own instance of WBO
2020-04-10 13:47:15 +00:00
If you have your own web server, and want to run a private instance of WBO on it, you can. It should be very easy to get it running on your own server.
2020-03-21 19:03:20 +00:00
### Running the code in a container (safer)
2020-04-10 13:47:15 +00:00
If you use the [docker ](https://www.docker.com/ ) containerization service, you can easily run WBO as a container.
2022-10-18 08:24:29 +00:00
An official docker image for WBO is hosted on dockerhub as [`lovasoa/wbo` ](https://hub.docker.com/r/lovasoa/wbo ): [![WBO 1M docker pulls ](https://img.shields.io/docker/pulls/lovasoa/wbo?style=flat )](https://hub.docker.com/repository/docker/lovasoa/wbo).
2020-03-21 19:03:20 +00:00
2021-01-27 17:15:04 +00:00
You can run the following bash command to launch WBO on port 5001, while persisting the boards outside of docker:
2020-03-21 19:03:20 +00:00
2021-01-27 17:15:04 +00:00
```bash
mkdir wbo-boards # Create a directory that will contain your whiteboards
chown -R 1000:1000 wbo-boards # Make this directory accessible to WBO
2021-06-09 15:39:51 +00:00
docker run -it --publish 5001:80 --volume "$(pwd)/wbo-boards:/opt/app/server-data" lovasoa/wbo:latest # run wbo
2020-03-21 19:03:20 +00:00
```
2020-04-10 13:47:15 +00:00
You can then access WBO at `http://localhost:5001` .
2020-03-21 19:03:20 +00:00
### Running the code without a container
2020-04-10 13:47:15 +00:00
Alternatively, you can run the code with [node.js ](https://nodejs.org/ ) directly, without docker.
First, download the sources:
```
2020-12-07 15:41:37 +00:00
git clone https://github.com/lovasoa/whitebophir.git
2020-04-10 13:47:15 +00:00
cd whitebophir
```
2020-03-21 19:03:20 +00:00
2020-12-08 09:31:25 +00:00
Then [install node.js ](https://nodejs.org/en/download/ ) (v10.0 or superior)
2020-04-15 12:58:26 +00:00
if you don't have it already, then install WBO's dependencies:
2020-03-21 19:03:20 +00:00
```
2020-04-27 21:49:15 +00:00
npm install --production
2020-03-21 19:03:20 +00:00
```
2020-04-10 13:47:15 +00:00
Finally, you can start the server:
```
PORT=5001 npm start
```
2021-01-13 09:02:03 +00:00
This will run WBO directly on your machine, on port 5001, without any isolation from the other services. You can also use an invokation like
```
PORT=5001 HOST=127.0.0.1 npm start
```
to make whitebophir only listen on the loopback device. This is useful if you want to put whitebophir behind a reverse proxy.
2020-03-21 19:03:20 +00:00
2020-05-01 10:33:13 +00:00
### Running WBO on a subfolder
2020-07-07 07:57:53 +00:00
By default, WBO launches its own web server and serves all of its content at the root of the server (on `/` ).
2020-05-01 10:38:11 +00:00
If you want to make the server accessible with a different path like `https://your.domain.com/wbo/` you have to setup a reverse proxy.
2020-05-01 10:33:13 +00:00
See instructions on our Wiki about [how to setup a reverse proxy for WBO ](https://github.com/lovasoa/whitebophir/wiki/Setup-behind-Reverse-Proxies ).
2020-07-06 16:49:55 +00:00
## Translations
WBO is available in multiple languages. The translations are stored in [`server/translations.json` ](./server/translations.json ).
If you feel like contributing to this collaborative project, you can [translate WBO into your own language ](https://github.com/lovasoa/whitebophir/wiki/How-to-translate-WBO-into-your-own-language ).
2022-01-10 11:47:50 +00:00
## Authentication
2022-10-18 08:24:29 +00:00
WBO supports authentication using [Json Web Tokens ](https://jwt.io/introduction ). This should be passed in as a query with the key `token` , eg, `http://myboard.com/boards/test?token={token}`
2022-01-10 11:47:50 +00:00
2022-01-17 09:33:25 +00:00
The `AUTH_SECRET_KEY` variable in [`configuration.js` ](./server/configuration.js ) should be filled with the secret key for the JWT.
2022-01-10 11:47:50 +00:00
2022-09-05 20:08:02 +00:00
Within the payload, you can declare the user's roles as an array.
Currently the only accepted roles are `moderator` and `editor` .
2022-07-25 15:39:04 +00:00
2022-09-05 20:08:02 +00:00
- `moderator` will give the user an additional tool to wipe all data from the board. To declare this role, see the example below.
- `editor` will give the user the ability to edit the board. This is the default role for all users.
```json
2022-07-25 15:39:04 +00:00
{
"iat": 1516239022,
"exp": 1516298489,
"roles": ["moderator"]
}
```
Moderators have access to the Clear tool, which will wipe all content from the board.
2022-09-03 14:49:23 +00:00
## Board name verification in the JWT
2022-09-04 17:37:27 +00:00
WBO supports verification of the board with a JWT.
2022-09-03 14:49:23 +00:00
2022-09-04 17:36:13 +00:00
To check for a valid board name just add the board name to the role with a ":". With this you can set a moderator for a specific board.
2022-09-03 14:49:23 +00:00
2022-09-05 20:08:02 +00:00
```json
2022-09-03 14:49:23 +00:00
{
2022-09-05 20:08:02 +00:00
"roles": ["moderator:< boardName1 > ","moderator:< boardName2 > ","editor:< boardName3 > ","editor:< boardName4 > "]
2022-09-03 14:49:23 +00:00
}
```
eg, `http://myboard.com/boards/mySecretBoardName?token={token}`
2022-09-05 20:08:02 +00:00
```json
2022-09-03 14:49:23 +00:00
{
"iat": 1516239022,
"exp": 1516298489,
2022-09-04 17:36:41 +00:00
"roles": ["moderator:mySecretBoardName"]
2022-09-03 14:49:23 +00:00
}
```
You can now be sure that only users who have the correct token have access to the board with the specific name.
2020-08-11 16:25:34 +00:00
## Configuration
When you start a WBO server, it loads its configuration from several environment variables.
You can see a list of these variables in [`configuration.js` ](./server/configuration.js ).
Some important environment variables are :
- `WBO_HISTORY_DIR` : configures the directory where the boards are saved. Defaults to `./server-data/` .
2020-08-11 17:54:46 +00:00
- `WBO_MAX_EMIT_COUNT` : the maximum number of messages that a client can send per unit of time. Increase this value if you want smoother drawings, at the expense of being susceptible to denial of service attacks if your server does not have enough processing power. By default, the units of this quantity are messages per 4 seconds, and the default value is `192` .
2022-01-05 14:30:40 +00:00
- `AUTH_SECRET_KEY` : If you would like to authenticate your boards using jwt, this declares the secret key.
2020-08-11 16:25:34 +00:00
2020-03-21 19:03:20 +00:00
## Troubleshooting
2020-05-01 10:38:11 +00:00
If you experience an issue or want to propose a new feature in WBO, please [open a github issue ](https://github.com/lovasoa/whitebophir/issues/new ).
2021-06-10 14:41:44 +00:00
## Monitoring
If you are self-hosting a WBO instance, you may want to monitor its load,
2021-06-11 06:46:08 +00:00
the number of connected users, and various other metrics.
2021-06-10 14:41:44 +00:00
2021-06-11 06:46:08 +00:00
You can start WBO with the `STATSD_URL` environment variable to send it to a statsd-compatible
2021-06-10 14:41:44 +00:00
metrics collection agent.
Example: `docker run -e STATSD_URL=udp://127.0.0.1:8125 lovasoa/wbo` .
- If you use **prometheus** , you can collect the metrics with [statsd-exporter ](https://hub.docker.com/r/prom/statsd-exporter ).
2021-06-11 06:46:08 +00:00
- If you use **datadog** , you can collect the metrics with [dogstatsd ](https://docs.datadoghq.com/developers/dogstatsd ).