Jitsi Meet as a Docker image

jitsi meet | standalone | virtual host | image preparation | image usage

IntroductionIntroduction

we’re going for Devuan/dumb-init Docker image (not SVR4) and we’re going to start daemons in sequence within rc.local directly. No need to share ports nor volumes just yet.

docker pull pbraun9/devuan
docker run -d --name meet-tmp --hostname meet-tmp --workdir /root pbraun9/devuan
docker logs meet-tmp
docker exec -ti meet-tmp /bin/bash

WarningWarning

Note STUN_MAPPING_HARVESTER_ADDRESSES had to be disabled for NAT/Docker to work

SetupSetup

proceed with the jitsi-meet as Docker container guide but simply keep the default generated certs in there. no need to start nginx nor to run the LE script.

backup copy for maintenance

cp -pi /etc/jitsi/videobridge/sip-communicator.properties /etc/jitsi/videobridge/sip-communicator.properties.dist
mv -i /etc/prosody/conf.avail/meet-tmp.cfg.lua /etc/prosody/conf.avail/meet-tmp.cfg.lua.dist
mv -i /etc/nginx/sites-available/meet-tmp.conf /etc/nginx/sites-available/meet-tmp.conf.dist

handy symlinks

ln -s /etc/jitsi/videobridge/sip-communicator.properties
ln -s /etc/rc.local

The FQDNThe FQDN

custom wrapper script for hosting any FQDN according to the instance hostname

vi UPDATE-HOSTNAME

#!/bin/bash

[[ -z $HOSTNAME ]] && echo define HOSTNAME && exit 1
echo HOSTNAME is $HOSTNAME

for conf in \
    /etc/jitsi/jicofo/jicofo.conf \
    /etc/jitsi/jicofo/config \
    /etc/jitsi/meet/meet-tmp-config.js \
    /etc/jitsi/videobridge/config \
    /etc/jitsi/videobridge/jvb.conf \
    /etc/jitsi/videobridge/sip-communicator.properties \
    /etc/turnserver.conf \
    ; do
    echo -n updating $conf ...
    mv $conf $conf.tmp
    sed -r "s/meet-tmp/$HOSTNAME/" $conf.tmp > $conf && echo done || echo FAIL
    rm -f $conf.tmp
done; unset conf

for leftover in \
    /etc/prosody/conf.avail/meet-tmp.cfg.lua \
    /etc/nginx/sites-available/meet-tmp.conf \
    ; do
    echo -n removing $leftover ...
    rm -f $leftover && echo done || echo FAIL
done; unset leftover

chmod +x UPDATE-HOSTNAME

The Docker/NAT settingsThe Docker/NAT settings

for JVB to work behind Docker-or-NAT

vi BEHIND-NAT

#!/bin/bash

[[ -z $facingip ]] && echo ERROR did not grab \$facingip from environment && exit 1
localip=`ifconfig eth0 | grep 'inet ' | awk '{print $2}'`

echo -n adding $localip / $facingip to jvb properties...
mv /etc/jitsi/videobridge/sip-communicator.properties /etc/jitsi/videobridge/sip-communicator.properties.tmp

# GETTING RID OF STUN_MAPPING_HARVESTER_ADDRESSES
grep -vE '^org.ice4j.ice.harvest.NAT_HARVESTER_|^org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES=' \
    /etc/jitsi/videobridge/sip-communicator.properties.tmp > /etc/jitsi/videobridge/sip-communicator.properties

# BEWARE OF INDENTATION HERE, THERE IS AN EOF
cat >> /etc/jitsi/videobridge/sip-communicator.properties <<EOF && echo done || echo FAIL
org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=$localip
org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=$facingip
EOF
unset localip

chmod +x BEHIND-NAT

Boot-timeBoot-time

vi /etc/rc.local

enable the previously mentioned scripts

/root/UPDATE-HOSTNAME
/root/BEHIND-NAT

for jicofo and jvb init scripts not to complain about relying pid files

rm -f /var/run/jicofo.pid
rm -f /var/run/jitsi-videobridge.pid

enable the services at startup — this is dumb-init, not SVR4

service nginx start
service prosody start
service jicofo start
service jitsi-videobridge2 start
#service uuidd start

eventually disable uuid daemon now that all required packages are installed

service uuidd stop
update-rc.d uuidd defaults-disabled
update-rc.d uuidd disable

Ready to goReady to go

clean-up the instance before commit

ls -lF /var/run/jicofo.pid # nope
ls -lF /var/run/jitsi-videobridge.pid # nope
history -c
rm -f /root/.bash_history
^D

now convert the tweaked instance to an image

docker stop meet-tmp
docker commit meet-tmp pbraun9/meet
docker rm meet-tmp

OperationsOperations

see jitsi-meet-image-ops

Result on Docker HubResult on Docker Hub

docker login -u pbraun9
docker push pbraun9/meet

Jitsi Meet as a single instance, thanks to Devuan and dumb-init https://hub.docker.com/r/pbraun9/meet

TODOTODO

ChangelogChangelog

Sep 2021

ResourcesResources

rc.local busy

[SOLVED] Text file busy ? https://www.linuxquestions.org/questions/slackware-14/text-file-busy-4175671871/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Licensed under MIT