Jot Server is the server-side component of UNA Messenger, designed to support multiple sites with the UNACMS Messenger module, enabling real-time messaging.
-
Install Node.js and npm package manager:
- Ensure you have the latest stable Node.js version and npm on your server. For more details, visit Node.js.
-
Download Jot Server:
- Download the latest release from GitHub.
- Downloaded and unzip file and upload the jot-server folder to your server.
-
Configure Jot Server:
- Edit the
config/config.json
file in the jot-server folder. Ensure you follow the JSON format rules carefully.
{ /* The port number on which the server will run */ "port": 5443, /* The mode in which the server runs. "development" mode allows real-time viewing of request and response details. Leave this empty for production environments. */ "mode": "development", /* The file used to log errors and warnings that may occur */ "log": "log.log", /* A list of allowed IP addresses that can connect to the server. Specify individual IPs like "127.0.0.1", "127.0.0.2", or use "*" to allow any IP to connect. (Using "*" allows any domain to use your server for the Jot Messenger module) */ "domains": ["*"], /* The transformer used by Primus, with "sockjs" selected as the default due to its stability. Learn more about transformers on the Primus page: https://github.com/primus/primus */ "transformer": "sockjs", /* Enable JWT token authentication instead of allowed IP list in `domain` config option `secret` is randomly generated string, this config value must match `Jot Server's JWT token secret word` value in Messenger options */ "secret": "", /* Fill in the fields below if you have an HTTPS server (recommended) */ "root": "/folder/with/https/cert/files", "cert": "myfilename.cert", "key": "myfilename.key" }
- Edit the
-
Install Dependencies:
- Navigate to the Jot Server root folder (where the
package.json
file is located). - Run the following command to install all necessary dependencies:
npm install
- Navigate to the Jot Server root folder (where the
-
Start the Server:
-
Start the server by running the
app.js
file. You can use any tool that allows running a Node.js application as a background service (e.g., forever, PM2). -
Example using forever:
- Install forever globally on the server:
npm install -g forever
- Install forever globally on the server:
-
Start the Jot Server:
forever start app.js
-
If you are using an HTTPS server with certificates, make Jot Server watch for changes in the certificate folder:
forever -w --watchDirectory=/path/to/certificates start app.js
Ensure the path to the certificate folder matches the
root
parameter value in theconfig.json
file.
-
You can also run Jot Server in a Docker container:
docker run -p 5000:5000 -d unaio/jot-server:latest