Skip to content

Websocket installation

holema edited this page Jan 19, 2023 · 8 revisions

Install the jitsi websocket

After version 0.75.x we change from mercure HUB, who was a SSE service to a real node websocket. With this service we have a lot of more opportunities and can go in a modern future with the jitsi-admin. To install the jwebsocket on your system follow these steps on an ubuntu or debian.

IMPORTANT: The WEBSOCKET_SECRET parameter in the service must match the MERCURE_JWT_SECRET parameter in the jitsi-admin .env.local file.

Install Node 16

       sudo apt update
       sudo apt upgrade
       sudo apt install -y curl
       curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
       sudo apt install -y nodejs
       node --version
       v16.1.0

Copy node files into bin directory

make sure you have a Version with a websocket. This is >0.75.0

cd /bin
git clone https://github.com/H2-invent/jitsi-admin.git
cd jitsi-admin/nodejs
npm install

Create systemd file to run node as a service

#/etc/systemd/system/jitsi-admin-websocket.service
[Unit]
     Description=Jitsi-Admin Websocket Service
     After=network.target
     StartLimitBurst=5
     StartLimitIntervalSec=33


     [Service]
     Type=simple
     WorkingDirectory=/bin/jitsi-admin/nodejs
    
     Environment= WEBSOCKET_SECRET='secret_jwt_goes_here' AWAY_TIME='time in min when user is automaticaly away' PORT=3000
     ExecStart=node websocket.js
     StandardOutput=file:/var/log/jitsi-websocket/access.log
     StandardError=file:/var/log/jitsi-websocket/error.log
     Restart=always
     RestartSec=5

     [Install]
     WantedBy=multi-user.target

Enable the Websocket Service

mkdir mkdir /var/log/jitsi-websocket/
systemctl daemon-reload
systemctl enable jitsi-admin-websocket.service
systemctl start jitsi-admin-websocket.service
systemctl restart jitsi-admin-websocket.service