doc: updated README & created updating guide and node >= 12
This commit is contained in:
parent
f9804e750f
commit
2dfb1079a7
|
@ -1,3 +1,5 @@
|
||||||
|
/config.run.yml
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM node:11 as base
|
FROM node:12 as base
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
RUN mkdir -p /opt/app
|
RUN mkdir -p /opt/app
|
||||||
|
@ -19,7 +19,7 @@ RUN npm run build
|
||||||
# Final image
|
# Final image
|
||||||
#####################
|
#####################
|
||||||
|
|
||||||
FROM node:11-alpine
|
FROM node:12-alpine
|
||||||
ENV NODE_ENV=prod
|
ENV NODE_ENV=prod
|
||||||
|
|
||||||
MAINTAINER cracker0dks
|
MAINTAINER cracker0dks
|
||||||
|
@ -28,7 +28,7 @@ MAINTAINER cracker0dks
|
||||||
RUN mkdir -p /opt/app
|
RUN mkdir -p /opt/app
|
||||||
WORKDIR /opt/app
|
WORKDIR /opt/app
|
||||||
|
|
||||||
COPY ./package.json ./package-lock.json ./
|
COPY ./package.json ./package-lock.json config.default.yml ./
|
||||||
RUN npm ci --only=prod
|
RUN npm ci --only=prod
|
||||||
|
|
||||||
COPY scripts ./scripts
|
COPY scripts ./scripts
|
||||||
|
|
45
README.md
45
README.md
|
@ -8,6 +8,10 @@ This is a lightweight NodeJS collaborative Whiteboard/Sketchboard witch can easi
|
||||||
|
|
||||||
[HERE](https://cloud13.de/testwhiteboard/) (Reset every night)
|
[HERE](https://cloud13.de/testwhiteboard/) (Reset every night)
|
||||||
|
|
||||||
|
## Updating
|
||||||
|
|
||||||
|
Information related to updating this app can be found [here](./doc/updating_guide.md).
|
||||||
|
|
||||||
## Some Features
|
## Some Features
|
||||||
|
|
||||||
- Shows remote user cursors while drawing
|
- Shows remote user cursors while drawing
|
||||||
|
@ -34,7 +38,7 @@ You can run this app with and without docker
|
||||||
|
|
||||||
### Without Docker
|
### Without Docker
|
||||||
|
|
||||||
1. install the latest NodeJs
|
1. install the latest NodeJs (version >= 12)
|
||||||
2. Clone the app
|
2. Clone the app
|
||||||
3. Run `npm ci` inside the folder
|
3. Run `npm ci` inside the folder
|
||||||
4. Run `npm run start:prod`
|
4. Run `npm run start:prod`
|
||||||
|
@ -108,13 +112,26 @@ Call your site with GET parameters to change the WhiteboardID or the Username
|
||||||
- title => Change the name of the Browser Tab
|
- title => Change the name of the Browser Tab
|
||||||
- randomid => if set to true, a random whiteboardId will be generated if not given aswell
|
- randomid => if set to true, a random whiteboardId will be generated if not given aswell
|
||||||
|
|
||||||
## Security - AccessToken (Optional)
|
## Configuration
|
||||||
|
|
||||||
To prevent clients who might know or guess the base URL from abusing the server to upload files and stuff..., you can set an accesstoken at server start.
|
Many settings of this project can be set using a simple `yaml` file, to change some behaviors or tweak performances.
|
||||||
|
|
||||||
<b>Server (Without docker):</b> `node scripts/server.js --accesstoken="mySecToken"`
|
### Config. file
|
||||||
|
|
||||||
<b>Server (With docker):</b> `docker run -d -p 8080:8080 rofl256/whiteboard --accesstoken="mySecToken"`
|
To run the project with custom settings:
|
||||||
|
|
||||||
|
1. Create a `config.run.yml` file based on the content of [`config.default.yml`](./config.default.yml),
|
||||||
|
2. Change the settings,
|
||||||
|
3. Run the project with your custom configuration (it will be merged into the default one):
|
||||||
|
|
||||||
|
- locally: `node scripts/server.js --config=./config.run.yml`
|
||||||
|
- docker: `docker run -d -p 8080:8080 -v $(pwd)/config.run.yml:/config.run.yml:ro rofl256/whiteboard --config=/config.run.yml`
|
||||||
|
|
||||||
|
### Highlights
|
||||||
|
|
||||||
|
#### Security - AccessToken (Optional)
|
||||||
|
|
||||||
|
To prevent clients who might know or guess the base URL from abusing the server to upload files and stuff..., you can set an accesstoken at server start (see [here](./config.default.yml)).
|
||||||
|
|
||||||
Then set the same token on the client side as well:
|
Then set the same token on the client side as well:
|
||||||
|
|
||||||
|
@ -122,15 +139,11 @@ Then set the same token on the client side as well:
|
||||||
|
|
||||||
Done!
|
Done!
|
||||||
|
|
||||||
## WebDAV (Optional)
|
#### WebDAV (Optional)
|
||||||
|
|
||||||
This function allows your users to save the whiteboard directly to a webdav server (Nextcloud) as image without downloading it.
|
This function allows your users to save the whiteboard directly to a webdav server (Nextcloud) as image without downloading it.
|
||||||
|
|
||||||
To enable it:
|
To enable set `enableWebdav` to `true` in the [configuration](./config.default.yml).
|
||||||
|
|
||||||
<b>Server (Without docker):</b> `node scripts/server.js --webdav=true`
|
|
||||||
|
|
||||||
<b>Server (With docker):</b> `docker run -d -p 8080:8080 rofl256/whiteboard --webdav=true`
|
|
||||||
|
|
||||||
Then set the same parameter on the client side as well:
|
Then set the same parameter on the client side as well:
|
||||||
|
|
||||||
|
@ -142,17 +155,15 @@ Note: For the most owncloud/nextcloud setups you have to set the WebDav-Server U
|
||||||
|
|
||||||
Done!
|
Done!
|
||||||
|
|
||||||
|
### And many more (performance, etc.)
|
||||||
|
|
||||||
|
Many more settings can be tweaked. All of them are described in the [default config file](./config.default.yml).
|
||||||
|
|
||||||
## Things you may want to know
|
## Things you may want to know
|
||||||
|
|
||||||
- Whiteboards are gone if you restart the Server, so keep that in mind (or save your whiteboard)
|
- Whiteboards are gone if you restart the Server, so keep that in mind (or save your whiteboard)
|
||||||
- You should be able to customize the layout without ever touching the whiteboard.js (take a look at index.html & main.js)
|
- You should be able to customize the layout without ever touching the whiteboard.js (take a look at index.html & main.js)
|
||||||
|
|
||||||
## All server start parameters (also docker)
|
|
||||||
|
|
||||||
- accesstoken => take a look at "Security - AccessToken" for a full explanation
|
|
||||||
- disablesmallestscreen => set this to "true" if you don't want show the "smallest screen" indicator (A dotted gray line) to the users
|
|
||||||
- webdav => Enable the function to save to a webdav-server (Must also be enabled on the client; Take a look at the webdav section)
|
|
||||||
|
|
||||||
## ToDo
|
## ToDo
|
||||||
|
|
||||||
- Make undo function more reliable on texts
|
- Make undo function more reliable on texts
|
||||||
|
|
|
@ -3,7 +3,7 @@ backend:
|
||||||
# Access token required for interacting with the server -- string (empty string for no restrictions)
|
# Access token required for interacting with the server -- string (empty string for no restrictions)
|
||||||
accessToken: ""
|
accessToken: ""
|
||||||
|
|
||||||
# Is webdav saving enabled -- boolean
|
# Enable the function to save to a webdav-server (check README for more info) -- boolean
|
||||||
enableWebdav: false
|
enableWebdav: false
|
||||||
|
|
||||||
# Backend performance tweaks
|
# Backend performance tweaks
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Updating guide
|
||||||
|
|
||||||
|
## From v1.x to 2.x (or latest)
|
||||||
|
|
||||||
|
Configuration handling has been updated: the ability to change settings from the CLI or the environment has been removed.
|
||||||
|
|
||||||
|
**Configuration is now handled with a yml config file**, which can be overridden with the `--config` CLI argument.
|
||||||
|
|
||||||
|
Here is the mapping from old cli argument / env variables to the new config file object:
|
||||||
|
|
||||||
|
- accesstoken => `backend.accessToken`
|
||||||
|
- webdav => `backend.enableWebdav`
|
||||||
|
- disablesmallestscreen => `frontend.showSmallestScreenIndicator`
|
|
@ -5,5 +5,4 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080/tcp"
|
- "8080:8080/tcp"
|
||||||
environment:
|
command: --config=./config.default.yml
|
||||||
- ACCESSTOKEN=mysecrettoken
|
|
||||||
|
|
Loading…
Reference in New Issue