[TUTORIAL] Etherpad Integration In Jitsi Meetings

This is just a longer version of Etherpad addition example · jitsi/jitsi-meet Wiki · GitHub, with few extra checks and images. I was able to install and integrate etherpad in jitsi using that link without any issues, but observed that a few users could not. See that all etherpad install and config steps are not in one place, hence this one with everything on this page, hoping it would help at least a few…

Assumptions

  1. Your jitsi meet server url is: meet.example.com
  2. Install directory for etherpad, where git source code is cloned, is: $HOME/etherpad (If you need in a different directory, remember to change this accordingly, wherever needed)

What is etherpad?
Etherpad lite is a real time collaborative editor which allows multiple users to simultaneously work with the same document.

How to install etherpad on Debian/Ubuntu?
Reference: GitHub - ether/etherpad-lite: Etherpad: A modern really-real-time collaborative document editor.

  1. Install npm

sudo apt install npm -y

  1. Install nodejs. Minimum required Node version: 10.17.0

sudo apt install nodejs -y

Check version:

nodejs --version

  1. Etherpad runs on port 9001/tcp. So first make sure that port is not in use already.
    image

Open this port in firewall on the machine(and also on AWS or other cloud). This is only temporary and it can be removed later*. We will do this at the end.

sudo ufw allow 9001/tcp

  1. Change to directory where you want to download etherpad. In this post, it is $HOME/etherpad. Change to that directory and clone the git repository.

cd $HOME/etherpad
git clone --branch master https://github.com/ether/etherpad-lite.git

  1. Change to etherpad-lite directory and start etherpad-lite

cd etherpad-lite
./src/bin/run.sh

Wait for a minute. Once it is started, you should see this at the end:
image

  1. Now verify that it is listening on 9001
    image

If you see above output, it is in fact running and listening on tcp port 9001. So now access etherpad using http://meet.example.com:9001. You should see:
image

Config changes in Jitsi

  1. Add this value of etherpad_base in /etc/jitsi/meet/meet.example.com-config.js. Note that the line is terminated by a ‘,’

etherpad_base: ‘https://meet.example.com/etherpad/p/’,

  1. Add below block in /etc/nginx/sites-available/, towards the end of ssl block
   # Etherpad-lite
    location ^~ /etherpad/ {
        proxy_pass http://localhost:9001/;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_buffering off;
        proxy_set_header       Host $host;
    }

Note: Add above towards the end of SSL block:
image

After addition, it looks like this:
image

  1. That’s it, restart nginx now:

systemctl restart nginx

Now start a jitsi meeting. You should see “Open shared document” in options. If you do not see that option, make sure ‘etherpad’ is present in toolbarButtons in /etc/jitsi/meet/meet.example.com-config.js
image

Once you click on it(“Open shared document”), you shoud see:
image

Now other participants too can click on “Open shared document” and see the shared document.

You can close it using "Close shared document".
image

Configure etherpad-lite as a service
Now that etherpad is running and also can be accessed from jitsi, let’s configure it to run as a service.

  1. Stop etherpad, that was started earlier using ./src/bin/run.sh and make sure it is not listening on port 9001, using netstat.

  2. Create etherpad user and groupd

adduser --system --home=$HOME/etherpad/etherpad-lite/ --group etherpad
chown -R etherpad: $HOME/etherpad/etherpad-lite/

  1. Copy and paste below text in /etc/init.d/etherpad-lite. And modify

LOGFILE="/var/www/etherpad-lite/etherpad-lite.log"
EPLITE_DIR="/var/www/etherpad-lite"

to match the etherpad directory on your system.

#!/bin/sh

### BEGIN INIT INFO
# Provides:          etherpad-lite
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts etherpad lite
# Description:       starts etherpad lite using start-stop-daemon
### END INIT INFO

PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin"
LOGFILE="/var/www/etherpad-lite/etherpad-lite.log"
EPLITE_DIR="/var/www/etherpad-lite"
EPLITE_BIN="bin/safeRun.sh"
USER="etherpad"
GROUP="etherpad"
DESC="Etherpad Lite"
NAME="etherpad-lite"

set -e

. /lib/lsb/init-functions

start() {
  echo "Starting $DESC... "

    start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true
  echo "done"
}

#We need this function to ensure the whole process tree will be killed
killtree() {
    local _pid=$1
    local _sig=${2-TERM}
    for _child in $(ps -o pid --no-headers --ppid ${_pid}); do
        killtree ${_child} ${_sig}
    done
    kill -${_sig} ${_pid}
}

stop() {
  echo "Stopping $DESC... "
   while test -d /proc/$(cat /var/run/$NAME.pid); do
    killtree $(cat /var/run/$NAME.pid) 15
    sleep 0.5
  done
  rm /var/run/$NAME.pid
  echo "done"
}

status() {
  status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $?
}

case "$1" in
  start)
      start
      ;;
  stop)
    stop
      ;;
  restart)
      stop
      start
      ;;
  status)
      status
      ;;
  *)
      echo "Usage: $NAME {start|stop|restart|status}" >&2
      exit 1
      ;;
esac

exit 0
  1. Change permissions

chmod +x /etc/init.d/etherpad-lite
update-rc.d etherpad-lite defaults

  1. Now start etherpad. Wait for a minute while it starts. Once it is up and running you should see “Etherpad is running” in the logfile that is configured. Also make sure it is running using netstat.

systemctl start etherpad-lite

image

All done…

Install extra features

  1. Run the following command in your Etherpad folder to get few extra feature. What they are, you may check the github page.

cd $HOME/etherpad/etherpad-lite
npm install --no-save --legacy-peer-deps ep_headings2 ep_markdown ep_comments_page ep_align ep_font_color ep_webrtc ep_embedded_hyperlinks2

  1. Disable audio & video in ‘ep_webrtc’(GitHub - ether/ep_webrtc: Audio & Video chat for Etherpad - Video Conferencing with a focus on collaboration) plugin we just added. Add below config to settings.json present in $HOME/etherpad/etherpad-lite directory.
  "ep_webrtc" : {
      "enabled": false,
      "audio" : {
          "disabled": "soft"
      },
      "video" : {
          "disabled": "soft"
      }
  },

image

Before adding this, in etherpad settings, you can see audio and video are enabled, which we do not need in jitsi:
image

After adding this to settings.json:
image

  1. Restart etherpad

systemctl restart etherpad-lite

Final step
Now that you can access etherpad from jitsi, and if you want to acess it only via jitsi and restrict via http://meet.example.com:9001, you may remove 9001 port from firewall on system(and also on AWS or other cloud)

ufw deny 9001/tcp

Notes and Limitations

  1. With these instructions there’s no authentication for etherpad. If someone knows how to add that, please comment.
  2. This is for nginx only. Search forum for apache config.
  3. When clicked on “Open shared document”, for a meeting, same document is opened everytime for that meeting. This may be a security issue for some. It would be better if a new document is opened for every meeting instance. If anyone knows the needed config change, please comment.
  4. With these instructions, I observed that shared document is not shown, on Ubuntu-18. Observed twice. If anyone had integrated etherpad on Ubuntu-18, please comment.

References

  1. Etherpad addition example · jitsi/jitsi-meet Wiki · GitHub
  2. GitHub - ether/etherpad-lite: Etherpad: A modern really-real-time collaborative document editor.
  3. How to Install Etherpad Lite on Debian Wheezy - RoseHosting
  4. Etherpad-liteInstallation - Community Help Wiki
2 Likes

Hi, thanks for the tutorial.

I’m tryin to configure Etherpad for Jitsi on an AWS server, port 9001 is open.

The domain is meet.iaps.institute and the address is 34.239.178.29

I was able to install Etherpad on the server and successfully open it:

I also configured the settings as instructed, the block for Etherpad is within the SSL block:

However, I’m unable to open it from a Jitsi meeting:

It just keeps opening a window of the conference within the window of the conference.

Do you have any ideas how to fix this, so that re-directs properly to the Etherpad page ?

Did you restart nginx after those etherpad changes?
If not, try doing that…

Also try clearing browser cache once…or in incognito mode…

Is it Ubuntu-18 by any chance…!?

I did restart nginx and tried it in multiple browsers, same result.

It’s Ubuntu 20.04

Move etherpad block, in nginx conf towards the end of ssl block…(not sure if it makes a difference, give it a try…)

Also check nginx logs and see if you have any errors…

Close firewall port 9001 and try once…

Try 0.0.0.0:9001, in nginx conf, instead of localhost:9001

I moved it towards the end again, I don’t think it plays any role, as long as it’s within the SSL block.

Nginx doesn’t have any errors, closed and re-opened the port, same effect.

I changed it to 0.0.0.0:9001 - same as before…

I think it might be something to do with the line:

etherpad_base: ‘https://meet.iaps.institute/etherpad/p/’,

I tried multiple variations, but it still doesn’t open Etherpad, it just shows an error message “34.239.178.29 sent an invalid response”

I have no idea what’s causing this, literally every other function of the server is working perfectly - streaming, recording, etc… I’ve been busting my head for so long and read all of the information on the Internet on configuring Etherpad for Jitsi and there’s nothing specific about this error…

The value of etherpad_base is correct. No issue with that.

Check the status of port 9001, using netstat:

sudo netstat -antp|grep 9001

You do not need to reopen…Shouldn’t make any difference though…
Try it, with that port closed anyway and check if it works…

Try moving etherpad_base down, like it is shown in tutorial and check…(again, don’t think this should make any difference, but try it anyway)…

Hi, checked the port again, it’s working properly while the service is running:

Tried to do it, but again - same result, the position doesn’t matter, as long as it’s within the block.

Post contents of your /etc/hosts file here…

Here you go:

Looks good…

When you open shared document, do you see any errors in etherpad logs? Is it getting the request at least?

Not sure what’s the issue…Hope someone else can pitch in…

Can you please let me know what’s the exact location of the etherpad logs file, so I can show you ?

It should be the tab where etherpad service is running…as we haven’t specified a location yet…
You can do that when etherpad is configured as a service…

Hi, I did an interesting test and commented the entire block in Nginx, I think the problem is with the nginx configuration itself:

Etherpad was still running without an issue, while the problem with the window within window still persisted.

Can you think of any ideas, which might cause the block to be completely ignored ?

Etherpad running and nginx conf, are not related. If you remember you have started etherpad manually using run.sh, which is not related to nginx at all…

Not sure why nginx is ignoring the etherpad block, but I think it should be the last one in ssl block as there are other matching criteria…

Do you see anything going on the tab where etherpad is running?..it should atleast get a request and should contain the name of the room…

Hi, I was able to fix the issue !!!

There was an error in all of the guides on the Internet… the location for the Nginx block should not be sites-available BUT sites-enabled instead.

Once this was done, the looping error was resolved. You can add this into the guide too.

Thank you for all of your time and efforts, dude, really appreciate it !

Glad…

But the host.conf under sites-enabled, is just a symbolic link to the one in sites-available…!

May be it is broken in your case…good catch…

Sure, will add that so that people can make sure it is indeed a link…if not, add that link…

1 Like

Hi @Prashanth,

Thanks for your tutorial, it works for me… :+1:.

The only homework for me is running etherpad as a service, this is what I’ve already done:

  1. create etherpad user & group:

adduser --system --home=/home/my-user/etherpad/etherpad-lite/ --group etherpad
chown -R etherpad: /home/my-user/etherpad/etherpad-lite/

(I put etherpad-lite in /home/my-user/etherpad directory)

  1. copy & paste the text in /etc/init.d/etherpad-lite (I copy paste from your guide above)

  2. change permissions

  3. start etherpad with the following command:

systemctl start etherpad-lite

and when I check with netstat -antp|grep 9001, it shows nothing and the etherpad failed to start in jitsi meet.
Is there any steps that I miss?

This is the content of /etc/init.d/etherpad-lite:

#!/bin/sh

### BEGIN INIT INFO
# Provides:          etherpad-lite
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts etherpad lite
# Description:       starts etherpad lite using start-stop-daemon
### END INIT INFO

PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin"
LOGFILE="/var/www/etherpad-lite/etherpad-lite.log"
EPLITE_DIR="/var/www/etherpad-lite"
EPLITE_BIN="bin/safeRun.sh"
USER="etherpad"
GROUP="etherpad"
DESC="Etherpad Lite"
NAME="etherpad-lite"

set -e

. /lib/lsb/init-functions

start() {
  echo "Starting $DESC... "

    start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true
  echo "done"
}

#We need this function to ensure the whole process tree will be killed
killtree() {
    local _pid=$1
    local _sig=${2-TERM}
    for _child in $(ps -o pid --no-headers --ppid ${_pid}); do
        killtree ${_child} ${_sig}
    done
    kill -${_sig} ${_pid}
}

stop() {
  echo "Stopping $DESC... "
   while test -d /proc/$(cat /var/run/$NAME.pid); do
    killtree $(cat /var/run/$NAME.pid) 15
    sleep 0.5
  done
  rm /var/run/$NAME.pid
  echo "done"
}

status() {
  status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $?
}

case "$1" in
  start)
      start
      ;;
  stop)
    stop
      ;;
  restart)
      stop
      start
      ;;
  status)
      status
      ;;
  *)
      echo "Usage: $NAME {start|stop|restart|status}" >&2
      exit 1
      ;;
esac

exit 0