2018-09-25 08:25:32 +00:00
#!/bin/bash
2020-04-11 05:08:30 +00:00
# Quick Jibri Installer - *buntu (LTS) based systems.
2020-04-11 09:51:31 +00:00
# SwITNet Ltd © - 2020, https://switnet.net/
2018-09-25 08:25:32 +00:00
# GPLv3 or later.
2020-03-26 00:47:37 +00:00
{
echo " Started at $( date +'%Y-%m-%d %H:%M:%S' ) " >> qj-installer.log
2018-09-25 08:25:32 +00:00
2020-03-25 18:25:50 +00:00
while getopts m: option
do
case " ${ option } "
in
m) MODE = ${ OPTARG } ; ;
\? ) echo "Usage: sudo ./quick_jibri_installer.sh [-m debug]" && exit; ;
esac
done
#DEBUG
if [ " $MODE " = "debug" ] ; then
set -x
fi
2018-09-25 08:25:32 +00:00
# SYSTEM SETUP
2020-05-09 02:46:18 +00:00
JITSI_REPO = $( apt-cache policy | grep http | grep jitsi | grep stable | awk '{print $3}' | head -n 1 | cut -d "/" -f1)
2018-09-25 08:25:32 +00:00
APACHE_2 = $( dpkg-query -W -f= '${Status}' apache2 2>/dev/null | grep -c "ok installed" )
NGINX = $( dpkg-query -W -f= '${Status}' nginx 2>/dev/null | grep -c "ok installed" )
DIST = $( lsb_release -sc)
GOOGL_REPO = "/etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list"
2020-05-03 00:21:53 +00:00
PROSODY_REPO = $( apt-cache policy | grep http | grep prosody| awk '{print $3}' | head -n 1 | cut -d "/" -f2)
2020-08-15 07:08:51 +00:00
CR = ` echo $'\n> ' `
2018-09-25 08:25:32 +00:00
if [ $DIST = flidas ] ; then
DIST = "xenial"
fi
2020-04-11 05:08:30 +00:00
if [ $DIST = etiona ] ; then
DIST = "bionic"
fi
2019-04-01 20:29:03 +00:00
install_ifnot( ) {
if [ " $( dpkg-query -W -f= '${Status}' $1 2>/dev/null | grep -c "ok installed" ) " = = "1" ] ; then
echo " $1 is installed, skipping... "
else
echo -e " \n---- Installing $1 ---- "
2020-04-14 16:49:11 +00:00
apt-get -yq2 install $1
2019-04-01 20:29:03 +00:00
fi
}
2018-09-25 08:25:32 +00:00
check_serv( ) {
2020-04-10 22:34:39 +00:00
if [ " $APACHE_2 " -eq 1 ] ; then
2018-09-25 08:25:32 +00:00
echo "
2020-04-10 22:34:39 +00:00
The recommended setup is using NGINX, exiting...
2018-09-25 08:25:32 +00:00
"
2020-04-10 22:34:39 +00:00
exit
elif [ " $NGINX " -eq 1 ] ; then
2019-03-04 12:31:34 +00:00
2019-04-02 05:15:11 +00:00
echo "
2020-04-10 22:34:39 +00:00
Webserver already installed!
2019-04-02 05:15:11 +00:00
"
2019-03-04 12:31:34 +00:00
2018-09-25 08:25:32 +00:00
else
echo "
2020-04-14 03:24:05 +00:00
Installing nginx webserver!
2018-09-25 08:25:32 +00:00
"
2019-04-02 05:15:11 +00:00
install_ifnot nginx
2018-09-25 08:25:32 +00:00
fi
}
check_snd_driver( ) {
modprobe snd-aloop
echo "snd-aloop" >> /etc/modules
if [ " $( lsmod | grep snd_aloop | head -n 1 | cut -d " " -f1) " = "snd_aloop" ] ; then
2020-04-07 02:08:39 +00:00
echo "
2020-04-28 01:18:33 +00:00
#-----------------------------------------------------------------------
2020-04-11 05:08:30 +00:00
# Audio driver seems - OK.
2020-04-28 01:18:33 +00:00
#-----------------------------------------------------------------------"
2018-09-25 08:25:32 +00:00
else
2020-04-07 02:08:39 +00:00
echo "
2020-04-28 01:18:33 +00:00
#-----------------------------------------------------------------------
# Your audio driver might not be able to load, once the installation
2020-04-29 11:36:51 +00:00
# is complete and server restarted, please run: \`lsmod | grep snd_aloop'
2020-04-28 01:18:33 +00:00
# to make sure it did. If not, any feedback for your setup is welcome.
#-----------------------------------------------------------------------"
2020-04-29 11:36:51 +00:00
read -n 1 -s -r -p "Press any key to continue..." $'\n'
2018-09-25 08:25:32 +00:00
fi
}
2020-05-09 02:46:18 +00:00
# sed limiters for add-jibri-node.sh variables
var_dlim( ) {
grep -n $1 add-jibri-node.sh| head -n1| cut -d ":" -f1
}
2020-07-01 02:41:31 +00:00
add_prosody_repo( ) {
echo "Add Prosody repo"
if [ " $PROSODY_REPO " = "main" ] ; then
echo "Prosody repository already installed"
else
echo " deb http://packages.prosody.im/debian $( lsb_release -sc) main " > /etc/apt/sources.list.d/prosody.list
wget -qO - https://prosody.im/files/prosody-debian-packages.key | apt-key add -
fi
}
2020-07-23 07:23:12 +00:00
dpkg-compare( ) {
dpkg --compare-versions $( dpkg-query -f= '${Version}' --show $1 ) $2 $3
}
2020-08-07 22:32:16 +00:00
wait_seconds( ) {
secs = $(( $1 ))
while [ $secs -gt 0 ] ; do
echo -ne " $secs \033[0K\r "
sleep 1
: $(( secs--))
done
}
2018-09-25 08:25:32 +00:00
clear
2020-08-15 07:08:51 +00:00
echo -e '
2018-09-25 08:25:32 +00:00
########################################################################
Welcome to Jitsi/Jibri Installer
########################################################################
by Software, IT & Networks Ltd
2020-04-11 09:51:31 +00:00
Featuring:
2020-04-11 10:20:42 +00:00
- Jibri Recording and YouTube Streaming
2020-04-11 09:51:31 +00:00
- Jibri Recordings Access via Nextcloud
2020-04-30 19:43:37 +00:00
- Jigasi Transcription ( Advanced)
2020-04-11 10:20:42 +00:00
- Customized brandless mode
2020-04-11 09:51:31 +00:00
- Recurring changes updater
2020-04-15 05:27:34 +00:00
Learn more about these at,
Main repository: https://github.com/switnet-ltd/quick-jibri-installer
2020-08-15 07:08:51 +00:00
Wiki and documentation: https://github.com/switnet-ltd/quick-jibri-installer/wiki\n ' \
&& \
2020-04-15 05:34:29 +00:00
read -n 1 -s -r -p "Press any key to continue..." $'\n'
2018-09-25 08:25:32 +00:00
2019-08-09 05:45:24 +00:00
#Check if user is root
if ! [ $( id -u) = 0 ] ; then
echo "You need to be root or have sudo privileges!"
exit 0
2018-09-25 08:25:32 +00:00
fi
2020-07-20 05:47:34 +00:00
if [ " $DIST " = "xenial" ] || \
[ " $DIST " = "bionic" ] || \
[ " $DIST " = "focal" ] ; then
echo " OS: $( lsb_release -sd) "
echo "Good, this is a supported platform!"
2020-04-07 02:08:39 +00:00
else
2020-07-20 05:47:34 +00:00
echo " OS: $( lsb_release -sd) "
echo "Sorry, this platform is not supported... exiting"
2020-04-11 11:52:08 +00:00
exit
2020-04-07 02:08:39 +00:00
fi
2020-04-11 07:32:45 +00:00
#Suggest 18.04 LTS release over 16.04
2020-04-11 11:52:08 +00:00
if [ " $DIST " = "xenial" ] ; then
2020-08-08 08:44:37 +00:00
echo " > $( lsb_release -sc) , even when it's compatible and functional.
2020-08-11 07:23:40 +00:00
We suggest to use the next ( LTS) release, for longer support and security reasons."
2020-04-15 05:34:29 +00:00
read -n 1 -s -r -p "Press any key to continue..." $'\n'
2020-04-11 07:32:45 +00:00
fi
2020-10-05 08:51:06 +00:00
#Check system resources
2020-06-29 07:45:17 +00:00
echo "Verifying System Resources:"
if [ " $( nproc --all) " -lt 4 ] ; then
2020-07-01 02:11:26 +00:00
echo "
2020-07-01 02:16:51 +00:00
Warning!: The system do not meet the minimum CPU requirements for Jibri to run.
2020-07-01 02:11:26 +00:00
>> We recommend 4 cores/threads for Jibri!
"
2020-06-29 07:45:17 +00:00
CPU_MIN = "N"
else
echo " CPU Cores/Threads: OK ( $( nproc --all) ) "
CPU_MIN = "Y"
fi
### Test RAM size (8GB min) ###
mem_available = $( grep MemTotal /proc/meminfo| grep -o '[0-9]\+' )
if [ ${ mem_available } -lt 7700000 ] ; then
2020-07-01 02:11:26 +00:00
echo "
2020-07-01 02:16:51 +00:00
Warning!: The system do not meet the minimum RAM requirements for Jibri to run.
2020-07-01 02:11:26 +00:00
>> We recommend 8GB RAM for Jibri!
"
2020-06-29 07:45:17 +00:00
MEM_MIN = "N"
else
echo " Memory: OK ( $(( mem_available/1024)) MiB) "
MEM_MIN = "Y"
fi
2020-07-01 01:54:37 +00:00
if [ " $CPU_MIN " = "Y" ] && [ " $MEM_MIN " = "Y" ] ; then
2020-06-29 07:45:17 +00:00
echo "All requirements seems meet!"
2020-08-07 22:32:16 +00:00
echo "
- We hope you have a nice recording/streaming session
"
2020-06-29 07:45:17 +00:00
else
2020-07-01 02:07:22 +00:00
echo " CPU ( $( nproc --all) )/RAM ( $(( mem_available/1024)) MiB) does NOT meet minimum recommended requirements! "
2020-09-09 07:35:17 +00:00
echo "Even when you can use the videconference sessions, we advice to increase the resources in order to user Jibri."
2020-06-29 07:45:17 +00:00
while [ [ " $CONTINUE_LOW_RES " != "yes" && " $CONTINUE_LOW_RES " != "no" ] ]
do
read -p "> Do you want to continue?: (yes or no)" $'\n' -r CONTINUE_LOW_RES
if [ " $CONTINUE_LOW_RES " = "no" ] ; then
echo "See you next time with more resources!..."
2020-06-29 19:26:03 +00:00
exit
2020-06-29 07:45:17 +00:00
elif [ " $CONTINUE_LOW_RES " = "yes" ] ; then
echo "Please keep in mind that trying to use Jibri with low resources might fail."
fi
done
fi
2020-05-03 00:21:53 +00:00
#Prosody repository
2020-07-23 07:23:12 +00:00
add_prosody_repo
2020-08-08 06:37:50 +00:00
2018-09-25 08:25:32 +00:00
# Jitsi-Meet Repo
2020-08-07 22:32:16 +00:00
echo "
Add Jitsi repo
"
2020-08-08 06:13:10 +00:00
if [ " $JITSI_REPO " = "stable" ] ; then
echo "Jitsi stable repository already installed"
2018-09-25 08:25:32 +00:00
else
2020-08-08 06:13:10 +00:00
echo 'deb http://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list
2018-09-25 08:25:32 +00:00
wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add -
2020-10-01 07:09:47 +00:00
JITSI_REPO = "stable"
2018-09-25 08:25:32 +00:00
fi
2020-04-30 22:11:35 +00:00
#Default to LE SSL?
while [ [ $LE_SSL != yes && $LE_SSL != no ] ]
do
read -p "> Do you plan to use Let's Encrypt SSL certs?: (yes or no)" $'\n' -r LE_SSL
2020-04-30 22:23:13 +00:00
if [ $LE_SSL = yes ] ; then
2020-07-20 09:56:46 +00:00
echo "We'll defaul to Let's Encrypt SSL certs."
2020-06-30 19:19:23 +00:00
else
2020-04-30 22:11:35 +00:00
echo "We'll let you choose later on for it."
fi
done
2018-09-25 08:25:32 +00:00
# Requirements
echo "We'll start by installing system requirements this may take a while please be patient..."
2020-04-14 16:49:11 +00:00
apt-get update -q2
apt-get dist-upgrade -yq2
2020-04-07 02:08:39 +00:00
2020-04-14 16:49:11 +00:00
apt-get -y install \
2020-10-05 08:14:31 +00:00
apt-show-versions \
2018-09-25 08:25:32 +00:00
bmon \
curl \
ffmpeg \
git \
htop \
2020-10-05 08:14:31 +00:00
jq \
2019-03-04 12:31:34 +00:00
letsencrypt \
2020-08-31 08:01:26 +00:00
net-tools \
2020-10-05 06:43:24 +00:00
rsync \
2020-10-05 11:41:22 +00:00
ssh \
2018-09-25 08:25:32 +00:00
unzip \
wget
2020-04-07 02:08:39 +00:00
2020-07-20 05:47:34 +00:00
echo "# Check and Install HWE kernel if possible..."
2020-09-30 02:37:28 +00:00
HWE_VIR_MOD = $( apt-cache madison linux-modules-extra-virtual-hwe-$( lsb_release -sr) 2>/dev/null| head -n1| grep -c "extra-virtual-hwe" )
2020-07-20 05:47:34 +00:00
if [ " $HWE_VIR_MOD " = = "1" ] ; then
apt-get -y install \
linux-image-generic-hwe-$( lsb_release -sr) \
linux-modules-extra-virtual-hwe-$( lsb_release -sr)
else
apt-get -y install \
linux-modules-extra-$( uname -r)
fi
2018-09-25 08:25:32 +00:00
check_serv
echo "
2018-10-05 15:00:57 +00:00
#--------------------------------------------------
# Install Jitsi Framework
#--------------------------------------------------
2018-09-25 08:25:32 +00:00
"
2020-04-30 22:11:35 +00:00
if [ " $LE_SSL " = "yes" ] ; then
2020-04-30 19:43:37 +00:00
echo "set jitsi-meet/cert-choice select Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate)" | debconf-set-selections
2020-04-30 22:11:35 +00:00
fi
2020-04-14 16:49:11 +00:00
apt-get -y install \
2018-09-25 08:25:32 +00:00
jitsi-meet \
2020-03-26 00:52:44 +00:00
jibri \
openjdk-8-jre-headless
# Fix RAND_load_file error
#https://github.com/openssl/openssl/issues/7754#issuecomment-444063355
sed -i "/RANDFILE/d" /etc/ssl/openssl.cnf
2018-09-25 08:25:32 +00:00
2018-10-05 15:00:57 +00:00
echo "
#--------------------------------------------------
# Install NodeJS
#--------------------------------------------------
"
if [ " $( dpkg-query -W -f= '${Status}' nodejs 2>/dev/null | grep -c "ok" ) " = = "1" ] ; then
echo "Nodejs is installed, skipping..."
else
2019-10-20 16:04:45 +00:00
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
2020-04-14 16:49:11 +00:00
apt-get install -yq2 nodejs
2019-08-09 05:45:24 +00:00
echo "Installing nodejs esprima package..."
2018-10-05 15:00:57 +00:00
npm install -g esprima
fi
2019-08-09 05:45:24 +00:00
if [ " $( npm list -g esprima 2>/dev/null | grep -c "empty" ) " = = "1" ] ; then
echo "Installing nodejs esprima package..."
npm install -g esprima
elif [ " $( npm list -g esprima 2>/dev/null | grep -c "esprima" ) " = = "1" ] ; then
echo "Good. Esprima package is already installed"
fi
2018-09-25 08:25:32 +00:00
# ALSA - Loopback
echo "snd-aloop" | tee -a /etc/modules
check_snd_driver
2019-02-25 04:10:26 +00:00
CHD_VER = $( curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
2020-04-07 02:08:39 +00:00
GCMP_JSON = "/etc/opt/chrome/policies/managed/managed_policies.json"
2018-09-25 08:25:32 +00:00
echo "# Installing Google Chrome / ChromeDriver"
if [ -f $GOOGL_REPO ] ; then
2020-04-11 10:38:36 +00:00
echo "Google repository already set."
2018-09-25 08:25:32 +00:00
else
2020-04-11 10:38:36 +00:00
echo "Installing Google Chrome Stable"
2018-09-25 08:25:32 +00:00
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee $GOOGL_REPO
fi
2020-04-14 16:49:11 +00:00
apt-get -q2 update
apt-get install -yq2 google-chrome-stable
2018-09-25 08:25:32 +00:00
rm -rf /etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list
if [ -f /usr/local/bin/chromedriver ] ; then
echo "Chromedriver already installed."
else
echo "Installing Chromedriver"
2020-04-11 16:27:40 +00:00
wget -q https://chromedriver.storage.googleapis.com/$CHD_VER /chromedriver_linux64.zip -O /tmp/chromedriver_linux64.zip
2018-09-25 08:25:32 +00:00
unzip /tmp/chromedriver_linux64.zip -d /usr/local/bin/
chown root:root /usr/local/bin/chromedriver
chmod 0755 /usr/local/bin/chromedriver
rm -rf /tpm/chromedriver_linux64.zip
fi
2019-03-04 12:31:34 +00:00
echo "
Check Google Software Working...
"
2018-09-25 08:25:32 +00:00
/usr/bin/google-chrome --version
2019-03-04 12:31:34 +00:00
/usr/local/bin/chromedriver --version | awk '{print$1,$2}'
2018-09-25 08:25:32 +00:00
2020-04-07 02:08:39 +00:00
echo "
Remove Chrome warning...
"
mkdir -p /etc/opt/chrome/policies/managed
2020-04-15 05:34:29 +00:00
echo '{ "CommandLineFlagSecurityWarningsEnabled": false }' > $GCMP_JSON
2020-04-07 02:08:39 +00:00
2018-09-25 08:25:32 +00:00
echo '
########################################################################
2020-05-05 14:18:59 +00:00
Please Setup Your Installation
2018-09-25 08:25:32 +00:00
########################################################################
'
# MEET / JIBRI SETUP
2019-07-02 21:00:10 +00:00
DOMAIN = $( ls /etc/prosody/conf.d/ | grep -v localhost | awk -F'.cfg' '{print $1}' | awk '!NF || !seen[$0]++' )
2020-04-11 05:08:30 +00:00
WS_CONF = /etc/nginx/sites-enabled/$DOMAIN .conf
2020-04-07 02:08:39 +00:00
JB_AUTH_PASS = " $( tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 10 | head -n1) "
JB_REC_PASS = " $( tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 10 | head -n1) "
2018-09-25 08:25:32 +00:00
PROSODY_FILE = /etc/prosody/conf.d/$DOMAIN .cfg.lua
2020-04-07 02:08:39 +00:00
PROSODY_SYS = /etc/prosody/prosody.cfg.lua
2018-09-25 08:25:32 +00:00
JICOFO_SIP = /etc/jitsi/jicofo/sip-communicator.properties
MEET_CONF = /etc/jitsi/meet/$DOMAIN -config.js
2020-09-30 02:37:28 +00:00
JIBRI_CONF = /etc/jitsi/jibri/jibri.conf
2020-04-07 02:08:39 +00:00
DIR_RECORD = /var/jbrecord
2018-09-25 08:25:32 +00:00
REC_DIR = /home/jibri/finalize_recording.sh
JB_NAME = "Jibri Sessions"
2019-11-20 06:48:04 +00:00
LE_RENEW_LOG = "/var/log/letsencrypt/renew.log"
2020-04-11 05:08:30 +00:00
MOD_LISTU = "https://prosody.im/files/mod_listusers.lua"
MOD_LIST_FILE = "/usr/lib/prosody/modules/mod_listusers.lua"
2020-04-30 19:43:37 +00:00
ENABLE_SA = "yes"
2020-07-20 17:30:59 +00:00
CERTBOT_REPO = $( apt-cache policy | grep http | grep certbot | head -n 1 | awk '{print $2}' | cut -d "/" -f4)
CERTBOT_REL_FILE = " http://ppa.launchpad.net/certbot/certbot/ubuntu/dists/ $( lsb_release -sc) /Release "
GC_SDK_REL_FILE = " http://packages.cloud.google.com/apt/dists/cloud-sdk- $( lsb_release -sc) /Release "
2020-08-08 06:37:50 +00:00
2020-10-05 08:45:01 +00:00
# Rename hostname for jitsi server
#hostnamectl set-hostname "jibri.${DOMAIN}"
#sed -i "1i ${PUBLIC_IP} jibri.${DOMAIN}" /etc/hosts
2020-07-04 16:48:58 +00:00
#Sysadmin email
while [ [ -z $SYSADMIN_EMAIL ] ]
do
read -p "Set sysadmin email (this is a mandatory field):" $'\n' -r SYSADMIN_EMAIL
done
2020-04-12 16:14:04 +00:00
#Language
2019-08-09 05:45:24 +00:00
echo " ## Setting up Jitsi Meet language ##
2020-04-12 16:14:04 +00:00
You can define the language, for a complete list of the supported languages
2019-08-09 05:45:24 +00:00
2020-04-12 16:14:04 +00:00
See here:
https://github.com/jitsi/jitsi-meet/blob/master/lang/languages.json
Jitsi Meet web interface will be set to use such language.
2019-08-09 05:45:24 +00:00
"
2020-04-14 03:24:05 +00:00
read -p "Please set your language (Press enter to default to 'en'):" $'\n' -r LANG
2020-04-11 05:08:30 +00:00
#Drop unsecure TLS
2020-06-03 11:22:16 +00:00
while [ [ " $DROP_TLS1 " != "yes" && " $DROP_TLS1 " != "no" ] ]
2020-04-10 22:34:39 +00:00
do
2020-04-11 19:19:12 +00:00
read -p "> Do you want to drop support for unsecure protocols TLSv1.0/1.1 now: (yes or no)" $'\n' -r DROP_TLS1
2020-06-03 11:22:16 +00:00
if [ " $DROP_TLS1 " = "no" ] ; then
2020-04-10 22:34:39 +00:00
echo "TLSv1.0/1.1 will remain."
2020-06-03 11:22:16 +00:00
elif [ " $DROP_TLS1 " = "yes" ] ; then
2020-04-10 22:34:39 +00:00
echo "TLSv1.0/1.1 will be dropped"
fi
2020-04-11 05:08:30 +00:00
done
#SSL LE
2020-04-30 22:11:35 +00:00
if [ " $LE_SSL " = "yes" ] ; then
2020-06-30 19:19:23 +00:00
ENABLE_SSL = yes
2020-04-30 22:11:35 +00:00
else
2020-06-03 11:22:16 +00:00
while [ [ " $ENABLE_SSL " != "yes" && " $ENABLE_SSL " != "no" ] ]
do
read -p "> Do you want to setup LetsEncrypt with your domain: (yes or no)" $'\n' -r ENABLE_SSL
if [ " $ENABLE_SSL " = "no" ] ; then
echo "Please run letsencrypt.sh manually post-installation."
2020-06-30 19:19:23 +00:00
else
2020-06-03 11:22:16 +00:00
echo "SSL will be enabled."
2020-06-03 11:36:51 +00:00
fi
done
2018-09-25 08:25:32 +00:00
fi
2020-05-20 18:57:11 +00:00
#Dropbox -- no longer requirement for localrecording
#while [[ $ENABLE_DB != yes && $ENABLE_DB != no ]]
#do
#read -p "> Do you want to setup the Dropbox feature now: (yes or no)"$'\n' -r ENABLE_DB
#if [ $ENABLE_DB = no ]; then
# echo "Dropbox won't be enable"
#elif [ $ENABLE_DB = yes ]; then
# read -p "Please set your Drobbox App key: "$'\n' -r DB_CID
#fi
#done
2020-04-11 09:59:29 +00:00
#Brandless Mode
2020-06-03 11:22:16 +00:00
while [ [ " $ENABLE_BLESSM " != "yes" && " $ENABLE_BLESSM " != "no" ] ]
2020-04-11 09:59:29 +00:00
do
2020-04-11 19:19:12 +00:00
read -p "> Do you want to install customized \"brandless mode\"?: (yes or no)" $'\n' -r ENABLE_BLESSM
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_BLESSM " = "no" ] ; then
2020-04-11 09:59:29 +00:00
echo "Brandless mode won't be set."
2020-06-03 11:22:16 +00:00
elif [ " $ENABLE_BLESSM " = "yes" ] ; then
2020-04-11 09:59:29 +00:00
echo "Brandless mode will be set."
fi
done
2020-09-10 03:03:52 +00:00
echo -e "\nWe'll take a minute to localize some UI excerpts if you need.\n"
2020-04-12 16:14:04 +00:00
#Participant
2020-09-10 03:38:45 +00:00
echo -e "> Do you want to translate 'Participant' to your own language?" && \
2020-04-15 05:34:29 +00:00
read -p "Leave empty to use the default one (English): " $'\n' L10N_PARTICIPANT
2020-04-12 16:14:04 +00:00
#Me
2020-09-10 03:38:45 +00:00
echo -e " \n> Do you want to translate 'me' to your own language?
2020-04-12 16:14:04 +00:00
This must be a really small word to present one self.
2020-09-10 03:03:52 +00:00
Some suggestions might be: yo ( Spanish) | je ( French) | ich ( German) \n " && \
2020-04-15 05:34:29 +00:00
read -p "Leave empty to use the default one (English): " $'\n' L10N_ME
2020-04-12 16:14:04 +00:00
#Welcome Page
2020-06-03 11:22:16 +00:00
while [ [ " $ENABLE_WELCP " != "yes" && " $ENABLE_WELCP " != "no" ] ]
2019-07-29 09:24:32 +00:00
do
2020-04-12 16:14:04 +00:00
read -p "> Do you want to disable the Welcome page: (yes or no)" $'\n' -r ENABLE_WELCP
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_WELCP " = "yes" ] ; then
2020-04-12 16:14:04 +00:00
echo "Welcome page will be disabled."
2020-06-03 11:22:16 +00:00
elif [ " $ENABLE_WELCP " = "no" ] ; then
2020-04-12 16:14:04 +00:00
echo "Welcome page will be enabled."
2019-07-29 09:24:32 +00:00
fi
done
2020-04-11 05:08:30 +00:00
#Enable static avatar
while [ [ " $ENABLE_SA " != "yes" && " $ENABLE_SA " != "no" ] ]
do
2020-05-01 01:32:59 +00:00
read -p "> (Legacy) Do you want to enable static avatar?: (yes or no)" $'\n' -r ENABLE_SA
2020-04-11 05:08:30 +00:00
if [ " $ENABLE_SA " = "no" ] ; then
2020-04-11 07:19:54 +00:00
echo "Static avatar won't be enabled"
2020-04-11 05:08:30 +00:00
elif [ " $ENABLE_SA " = "yes" ] ; then
2020-04-11 07:19:54 +00:00
echo "Static avatar will be enabled"
fi
done
2020-08-11 07:46:31 +00:00
# #Enable local audio recording - disabling
#while [[ "$ENABLE_LAR" != "yes" && "$ENABLE_LAR" != "no" ]]
#do
#read -p "> Do you want to enable local audio recording option?: (yes or no)"$'\n' -r ENABLE_LAR
#if [ "$ENABLE_LAR" = "no" ]; then
# echo "Local audio recording option won't be enabled"
#elif [ "$ENABLE_LAR" = "yes" ]; then
# echo "Local audio recording option will be enabled"
#fi
#done
2020-04-11 05:08:30 +00:00
#Secure room initial user
while [ [ " $ENABLE_SC " != "yes" && " $ENABLE_SC " != "no" ] ]
do
2020-04-11 16:52:10 +00:00
read -p "> Do you want to enable secure rooms?: (yes or no)" $'\n' -r ENABLE_SC
2020-04-11 05:08:30 +00:00
if [ " $ENABLE_SC " = "no" ] ; then
echo "-- Secure rooms won't be enabled."
elif [ " $ENABLE_SC " = "yes" ] ; then
2020-04-11 21:35:50 +00:00
echo "-- Secure rooms will be enabled."
2020-04-11 05:08:30 +00:00
read -p "Set username for secure room moderator: " $'\n' -r SEC_ROOM_USER
2020-04-11 19:19:12 +00:00
read -p "Secure room moderator password: " $'\n' -r SEC_ROOM_PASS
2020-04-11 05:08:30 +00:00
fi
done
2020-04-12 16:14:04 +00:00
#Jibri Records Access (JRA) via Nextcloud
2020-06-03 11:22:16 +00:00
while [ [ " $ENABLE_NC_ACCESS " != "yes" && " $ENABLE_NC_ACCESS " != "no" ] ]
2020-04-11 05:08:30 +00:00
do
2020-04-16 01:38:31 +00:00
read -p " > Do you want to setup Jibri Records Access via Nextcloud: (yes or no)
( Please check requirements at: https://github.com/switnet-ltd/quick-jibri-installer ) " $'\n' -r ENABLE_NC_ACCESS
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_NC_ACCESS " = "no" ] ; then
2020-08-11 08:20:44 +00:00
echo -e "-- JRA via Nextcloud won't be enabled.\n"
2020-06-03 11:22:16 +00:00
elif [ " $ENABLE_NC_ACCESS " = "yes" ] ; then
2020-08-11 08:20:44 +00:00
echo -e "-- JRA via Nextcloud will be enabled.\n"
2020-04-12 16:14:04 +00:00
fi
done
#Jigasi
2020-07-20 17:30:59 +00:00
if [ " $( curl -s -o /dev/null -w "%{http_code}" $GC_SDK_REL_FILE ) " = = "404" ] ; then
2020-08-08 08:44:37 +00:00
echo " > Sorry Google SDK doesn't have support yet for $( lsb_release -sd) ,
2020-08-08 09:44:08 +00:00
thus, Jigasi Transcript can' t be enable."
2020-07-20 17:30:59 +00:00
elif [ " $( curl -s -o /dev/null -w "%{http_code}" $GC_SDK_REL_FILE ) " = = "200" ] ; then
2020-07-20 18:04:46 +00:00
while [ [ " $ENABLE_TRANSCRIPT " != "yes" && " $ENABLE_TRANSCRIPT " != "no" ] ]
do
2020-04-16 01:38:31 +00:00
read -p " > Do you want to setup Jigasi Transcription: (yes or no)
( Please check requirements at: https://github.com/switnet-ltd/quick-jibri-installer ) " $'\n' -r ENABLE_TRANSCRIPT
2020-07-20 18:04:46 +00:00
if [ " $ENABLE_TRANSCRIPT " = "no" ] ; then
2020-08-11 08:20:44 +00:00
echo -e "-- Jigasi Transcription won't be enabled.\n"
2020-07-20 18:04:46 +00:00
elif [ " $ENABLE_TRANSCRIPT " = "yes" ] ; then
2020-08-11 08:20:44 +00:00
echo -e "-- Jigasi Transcription will be enabled.\n"
2020-07-20 18:04:46 +00:00
fi
done
2020-07-20 17:30:59 +00:00
else
2020-09-30 02:37:28 +00:00
echo " No valid option for Jigasi. Please report this to
2020-07-20 17:30:59 +00:00
https://github.com/switnet-ltd/quick-jibri-installer/issues "
fi
2020-07-04 12:23:24 +00:00
#Grafana
while [ [ " $ENABLE_GRAFANA_DSH " != "yes" && " $ENABLE_GRAFANA_DSH " != "no" ] ]
do
read -p " > Do you want to setup Grafana Dashboard: (yes or no)
( Please check requirements at: https://github.com/switnet-ltd/quick-jibri-installer ) " $'\n' -r ENABLE_GRAFANA_DSH
if [ " $ENABLE_GRAFANA_DSH " = "no" ] ; then
2020-08-11 08:20:44 +00:00
echo -e "-- Grafana Dashboard won't be enabled.\n"
2020-07-04 12:23:24 +00:00
elif [ " $ENABLE_GRAFANA_DSH " = "yes" ] ; then
2020-08-11 08:20:44 +00:00
echo -e "-- Grafana Dashboard will be enabled. \n"
2020-07-04 12:23:24 +00:00
fi
done
2020-08-11 07:52:48 +00:00
#Docker Etherpad
2020-08-15 07:08:51 +00:00
#while [[ "$ENABLE_DOCKERPAD" != "yes" && "$ENABLE_DOCKERPAD" != "no" ]]
#do
#read -p "> Do you want to setup Docker Etherpad: (yes or no)
#( Please check requirements at: https://github.com/switnet-ltd/quick-jibri-installer )"$'\n' -r ENABLE_DOCKERPAD
#if [ "$ENABLE_DOCKERPAD" = "no" ]; then
# echo -e "-- Docker Etherpad won't be enabled.\n"
#elif [ "$ENABLE_DOCKERPAD" = "yes" ]; then
# echo -e "-- Docker Etherpad will be enabled.\n"
#fi
#done
2020-04-11 05:08:30 +00:00
#Start configuration
echo '
########################################################################
Start Jitsi Framework configuration
########################################################################
'
2018-09-25 08:25:32 +00:00
JibriBrewery = JibriBrewery
2020-04-11 09:59:29 +00:00
INT_CONF = "/usr/share/jitsi-meet/interface_config.js"
2020-09-09 08:17:07 +00:00
INT_CONF_ETC = " /etc/jitsi/meet/ $DOMAIN -interface_config.js "
2018-09-25 08:25:32 +00:00
WAN_IP = $( dig +short myip.opendns.com @resolver1.opendns.com)
2019-03-04 12:31:34 +00:00
ssl_wa( ) {
2020-04-07 21:00:38 +00:00
systemctl stop $1
2019-04-02 05:15:11 +00:00
letsencrypt certonly --standalone --renew-by-default --agree-tos --email $5 -d $6
sed -i " s|/etc/jitsi/meet/ $3 .crt|/etc/letsencrypt/live/ $3 /fullchain.pem| " $4
sed -i " s|/etc/jitsi/meet/ $3 .key|/etc/letsencrypt/live/ $3 /privkey.pem| " $4
2020-04-07 21:00:38 +00:00
systemctl restart $1
2019-03-04 12:31:34 +00:00
#Add cron
2020-04-13 18:39:25 +00:00
crontab -l | { cat; echo " @weekly certbot renew -- ${ 2 } > $LE_RENEW_LOG 2>&1 " ; } | crontab -
2019-03-04 12:31:34 +00:00
crontab -l
}
2018-09-25 08:25:32 +00:00
enable_letsencrypt( ) {
2018-11-05 04:54:08 +00:00
if [ " $ENABLE_SSL " = "yes" ] ; then
2018-09-25 08:25:32 +00:00
echo '
2020-04-11 05:08:30 +00:00
#--------------------------------------------------
# Starting LetsEncrypt configuration
#--------------------------------------------------
2018-09-25 08:25:32 +00:00
'
2019-03-04 12:31:34 +00:00
#Disabled 'til fixed upstream
#bash /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
2020-07-20 05:47:34 +00:00
echo "#Set and upgrade certbot PPA if posssible..."
if [ " $CERTBOT_REPO " = "certbot" ] ; then
echo "
Cerbot repository already on the system!
Checking for updates...
"
apt-get -q2 update
apt-get -yq2 dist-upgrade
2020-07-20 17:30:59 +00:00
elif [ " $( curl -s -o /dev/null -w "%{http_code}" $CERTBOT_REL_FILE ) " = = "200" ] ; then
2020-07-20 05:47:34 +00:00
echo "
Adding cerbot ( formerly letsencrypt) PPA repository for latest updates
"
echo " deb http://ppa.launchpad.net/certbot/certbot/ubuntu $DIST main " > /etc/apt/sources.list.d/certbot.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 75BCA694
apt-get -q2 update
apt-get -yq2 dist-upgrade
2020-07-20 17:30:59 +00:00
elif [ " $( curl -s -o /dev/null -w "%{http_code}" $CERTBOT_REL_FILE ) " = = "404" ] ; then
2020-07-20 05:47:34 +00:00
echo "
Certbot PPA is not available for $( lsb_release -sc) just yet, it won' t be installed...
"
fi
2019-03-04 12:31:34 +00:00
2018-09-25 08:25:32 +00:00
else
echo "SSL setup will be skipped."
fi
}
check_jibri( ) {
if [ " $( dpkg-query -W -f= '${Status}' "jibri" 2>/dev/null | grep -c "ok installed" ) " = = "1" ]
then
2020-04-07 21:00:38 +00:00
systemctl restart jibri
systemctl restart jibri-icewm
systemctl restart jibri-xorg
2018-09-25 08:25:32 +00:00
else
echo "Jibri service not installed"
fi
}
# Restarting services
restart_services( ) {
2020-04-13 17:46:47 +00:00
systemctl restart jitsi-videobridge2
2020-04-07 21:00:38 +00:00
systemctl restart jicofo
systemctl restart prosody
2019-02-25 04:10:26 +00:00
check_jibri
2018-09-25 08:25:32 +00:00
}
# Configure Jibri
## PROSODY
2020-07-23 07:23:12 +00:00
if dpkg-compare prosody lt 0.11.0 ; then
2018-09-25 08:25:32 +00:00
cat << MUC-JIBRI >> $PROSODY_FILE
-- internal muc component, meant to enable pools of jibri and jigasi clients
Component " internal.auth. $DOMAIN " "muc"
modules_enabled = {
"ping" ;
}
storage = "null"
muc_room_cache_size = 1000
MUC-JIBRI
2020-07-23 07:23:12 +00:00
fi
2018-09-25 08:25:32 +00:00
cat << REC-JIBR I >> $PROSODY_FILE
VirtualHost " recorder. $DOMAIN "
modules_enabled = {
"ping" ;
}
authentication = "internal_plain"
REC-JIBRI
2020-07-23 07:23:12 +00:00
#Enable Jibri withelist
2020-08-07 22:32:16 +00:00
sed -i "s| -- muc_lobby_whitelist| muc_lobby_whitelist|" $PROSODY_FILE
2018-09-25 08:25:32 +00:00
2020-04-07 02:08:39 +00:00
#Fix Jibri conectivity issues
2020-08-07 22:32:16 +00:00
#if dpkg-compare prosody lt 0.11.0 ; then
2020-04-07 02:08:39 +00:00
sed -i "s|c2s_require_encryption = .*|c2s_require_encryption = false|" $PROSODY_SYS
sed -i " /c2s_require_encryption = false/a \\
\\
consider_bosh_secure = true" $PROSODY_SYS
2020-08-07 22:32:16 +00:00
#fi
2020-07-23 07:23:12 +00:00
2020-04-12 16:14:04 +00:00
if [ ! -z $L10N_PARTICIPANT ] ; then
2020-04-14 04:48:01 +00:00
sed -i " s|PART_USER=.*|PART_USER=\" $L10N_PARTICIPANT \"| " jm-bm.sh
2020-04-12 16:14:04 +00:00
fi
if [ ! -z $L10N_ME ] ; then
2020-04-27 22:24:47 +00:00
sed -i " s|LOCAL_USER=.*|LOCAL_USER=\" $L10N_ME \"| " jm-bm.sh
2020-04-12 16:14:04 +00:00
fi
2020-04-11 05:08:30 +00:00
if [ ! -f $MOD_LIST_FILE ] ; then
2020-04-07 02:08:39 +00:00
echo "
-> Adding external module to list prosody users...
"
2020-04-11 05:08:30 +00:00
curl -s $MOD_LISTU > $MOD_LIST_FILE
2020-04-07 02:08:39 +00:00
echo " Now you can check registered users with:
prosodyctl mod_listusers
"
else
echo " Prosody support for listing users seems to be enabled.
check with: prosodyctl mod_listusers
"
fi
2018-09-25 08:25:32 +00:00
### Prosody users
prosodyctl register jibri auth.$DOMAIN $JB_AUTH_PASS
prosodyctl register recorder recorder.$DOMAIN $JB_REC_PASS
## JICOFO
# /etc/jitsi/jicofo/sip-communicator.properties
cat << BREWERY >> $JICOFO_SIP
2019-04-05 06:14:57 +00:00
#org.jitsi.jicofo.auth.URL=XMPP:$DOMAIN
2018-09-25 08:25:32 +00:00
org.jitsi.jicofo.jibri.BREWERY= $JibriBrewery @internal.auth.$DOMAIN
org.jitsi.jicofo.jibri.PENDING_TIMEOUT= 90
2019-04-01 20:29:03 +00:00
#org.jitsi.jicofo.auth.DISABLE_AUTOLOGIN=true
2018-09-25 08:25:32 +00:00
BREWERY
# Jibri tweaks for /etc/jitsi/meet/$DOMAIN-config.js
2019-02-25 04:10:26 +00:00
sed -i " s|// anonymousdomain: 'guest.example.com'|anonymousdomain: \'guest. $DOMAIN \'| " $MEET_CONF
2018-09-25 08:25:32 +00:00
sed -i " s|conference. $DOMAIN |internal.auth. $DOMAIN | " $MEET_CONF
sed -i "s|// fileRecordingsEnabled: false,|fileRecordingsEnabled: true,| " $MEET_CONF
sed -i " s|// liveStreamingEnabled: false,|liveStreamingEnabled: true,\\
\\
2018-10-05 15:00:57 +00:00
hiddenDomain: \' recorder.$DOMAIN \' ,| " $MEET_CONF
#Dropbox feature
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_DB " = "yes" ] ; then
2018-10-05 15:00:57 +00:00
DB_STR = $( grep -n "dropbox:" $MEET_CONF | cut -d ":" -f1)
2019-04-02 16:33:33 +00:00
DB_END = $(( DB_STR + 10 ))
2018-10-05 15:00:57 +00:00
sed -i " $DB_STR , $DB_END {s|// dropbox: {|dropbox: {|} " $MEET_CONF
sed -i " $DB_STR , $DB_END {s|// appKey: '<APP_KEY>'|appKey: \' $DB_CID \'|} " $MEET_CONF
sed -i " $DB_STR , $DB_END {s|// },|},|} " $MEET_CONF
fi
2018-09-25 08:25:32 +00:00
#LocalRecording
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_LAR " = "yes" ] ; then
2020-03-26 06:10:33 +00:00
echo "# Enabling local recording (audio only)."
2018-10-05 15:00:57 +00:00
LR_STR = $( grep -n "// Local Recording" $MEET_CONF | cut -d ":" -f1)
LR_END = $(( LR_STR + 18 ))
sed -i " $LR_STR , $LR_END {s|// localRecording: {|localRecording: {|} " $MEET_CONF
sed -i " $LR_STR , $LR_END {s|// enabled: true,|enabled: true,|} " $MEET_CONF
sed -i " $LR_STR , $LR_END {s|// format: 'flac'|format: 'flac'|} " $MEET_CONF
sed -i " $LR_STR , $LR_END {s|// }|}|} " $MEET_CONF
2018-09-25 08:25:32 +00:00
sed -i "s|'tileview'|'tileview', 'localrecording'|" $INT_CONF
2020-04-11 07:19:54 +00:00
sed -i "s|LOC_REC=.*|LOC_REC=\"on\"|" jitsi-updater.sh
fi
2018-09-25 08:25:32 +00:00
2019-08-09 05:45:24 +00:00
#Setup main language
if [ -z $LANG ] || [ " $LANG " = "en" ] ; then
echo "Leaving English (en) as default language..."
2019-11-20 07:38:52 +00:00
sed -i "s|// defaultLanguage: 'en',|defaultLanguage: 'en',|" $MEET_CONF
2019-08-09 05:45:24 +00:00
else
echo " Changing default language to: $LANG "
2019-11-20 07:38:52 +00:00
sed -i " s|// defaultLanguage: 'en',|defaultLanguage: \' $LANG \',| " $MEET_CONF
2019-08-09 05:45:24 +00:00
fi
2018-10-05 15:00:57 +00:00
#Check config file
echo "
# Checking $MEET_CONF file for errors
"
CHECKJS = $( esvalidate $MEET_CONF | cut -d ":" -f2)
2018-10-24 10:03:05 +00:00
if [ [ -z " $CHECKJS " ] ] ; then
2018-10-05 15:00:57 +00:00
echo "
# The $MEET_CONF configuration seems correct. =)
"
else
echo "
Watch out!, there seems to be an issue on $MEET_CONF line:
$CHECKJS
Most of the times this is due upstream changes, please report to
https://github.com/switnet-ltd/quick-jibri-installer/issues
"
fi
2018-09-25 08:25:32 +00:00
# Recording directory
2020-04-30 19:43:37 +00:00
if [ ! -d $DIR_RECORD ] ; then
2020-04-07 02:08:39 +00:00
mkdir $DIR_RECORD
2020-04-30 19:43:37 +00:00
fi
2020-04-07 02:08:39 +00:00
chown -R jibri:jibri $DIR_RECORD
2018-09-25 08:25:32 +00:00
cat << REC_DIR > $REC_DIR
#!/bin/bash
2020-04-07 02:08:39 +00:00
RECORDINGS_DIR = $DIR_RECORD
2018-09-25 08:25:32 +00:00
echo "This is a dummy finalize script" > /tmp/finalize.out
echo " The script was invoked with recordings directory $RECORDINGS_DIR . " >> /tmp/finalize.out
echo "You should put any finalize logic (renaming, uploading to a service" >> /tmp/finalize.out
echo "or storage provider, etc.) in this script" >> /tmp/finalize.out
2020-04-07 02:08:39 +00:00
chmod -R 770 \$ RECORDINGS_DIR
2018-09-25 08:25:32 +00:00
exit 0
REC_DIR
2020-04-07 02:08:39 +00:00
chown jibri:jibri $REC_DIR
chmod +x $REC_DIR
2018-09-25 08:25:32 +00:00
2020-10-01 07:09:47 +00:00
## New Jibri Config (2020)
mv $JIBRI_CONF ${ JIBRI_CONF } -dpkg-file
cat << NEW_CON F > $JIBRI_CONF
// New XMPP environment config.
jibri {
recording {
recordings-directory = $DIR_RECORD
finalize-script = $REC_DIR
}
api {
xmpp {
environments = [
{
// A user-friendly name for this environment
name = " $JB_NAME "
// A list of XMPP server hosts to which we' ll connect
xmpp-server-hosts = [ " $DOMAIN " ]
// The base XMPP domain
xmpp-domain = " $DOMAIN "
// The MUC we' ll join to announce our presence for
// recording and streaming services
control-muc {
domain = " internal.auth. $DOMAIN "
room-name = " $JibriBrewery "
nickname = "Live"
}
// The login information for the control MUC
control-login {
domain = " auth. $DOMAIN "
username = "jibri"
password = " $JB_AUTH_PASS "
}
// An ( optional) MUC configuration where we' ll
// join to announce SIP gateway services
// sip-control-muc {
// domain = "domain"
// room-name = "room-name"
// nickname = "nickname"
// }
// The login information the selenium web client will use
call-login {
domain = " recorder. $DOMAIN "
username = "recorder"
password = " $JB_REC_PASS "
}
// The value we' ll strip from the room JID domain to derive
// the call URL
strip-from-room-domain = "conference."
// How long Jibri sessions will be allowed to last before
// they are stopped. A value of 0 allows them to go on
// indefinitely
usage-timeout = 0 hour
// Whether or not we' ll automatically trust any cert on
// this XMPP domain
trust-all-xmpp-certs = true
}
]
2018-09-25 08:25:32 +00:00
}
2020-10-01 07:09:47 +00:00
}
2018-09-25 08:25:32 +00:00
}
2020-10-01 07:09:47 +00:00
NEW_CONF
2018-09-25 08:25:32 +00:00
2020-05-09 02:46:18 +00:00
#Setting varibales for add-jibri-node.sh
sed -i " s|MAIN_SRV_DIST=.*|MAIN_SRV_DIST=\" $DIST \"| " add-jibri-node.sh
sed -i " s|MAIN_SRV_REPO=.*|MAIN_SRV_REPO=\" $JITSI_REPO \"| " add-jibri-node.sh
sed -i " s|MAIN_SRV_DOMAIN=.*|MAIN_SRV_DOMAIN=\" $DOMAIN \"| " add-jibri-node.sh
sed -i " s|JB_NAME=.*|JB_NAME=\" $JB_NAME \"| " add-jibri-node.sh
sed -i " s|JibriBrewery=.*|JibriBrewery=\" $JibriBrewery \"| " add-jibri-node.sh
sed -i " s|JB_AUTH_PASS=.*|JB_AUTH_PASS=\" $JB_AUTH_PASS \"| " add-jibri-node.sh
sed -i " s|JB_REC_PASS=.*|JB_REC_PASS=\" $JB_REC_PASS \"| " add-jibri-node.sh
sed -i " $( var_dlim 0_LAST) , $( var_dlim 1_LAST) {s|LETS: .*|LETS: $( date -R) |} " add-jibri-node.sh
echo " Last file edition at: $( grep "LETS:" add-jibri-node.sh| head -n1| awk -F'LETS:' '{print$2}' ) "
2019-02-25 04:10:26 +00:00
#Tune webserver for Jitsi App control
2020-04-11 05:08:30 +00:00
if [ -f $WS_CONF ] ; then
sed -i "/Anything that didn't match above/i \\\n" $WS_CONF
sed -i "/Anything that didn't match above/i \ \ \ \ location = \/external_api.min.js {" $WS_CONF
sed -i "/Anything that didn't match above/i \ \ \ \ \ \ \ \ alias \/usr\/share\/jitsi-meet\/libs\/external_api.min.js;" $WS_CONF
sed -i "/Anything that didn't match above/i \ \ \ \ }" $WS_CONF
sed -i "/Anything that didn't match above/i \\\n" $WS_CONF
systemctl reload nginx
2018-11-06 04:43:41 +00:00
else
echo " No app configuration done to server file, please report to:
-> https://github.com/switnet-ltd/quick-jibri-installer/issues"
fi
2020-04-11 05:08:30 +00:00
#Static avatar
if [ " $ENABLE_SA " = "yes" ] && [ -f $WS_CONF ] ; then
2020-04-11 07:19:54 +00:00
#wget https://switnet.net/static/avatar.png -O /usr/share/jitsi-meet/images/avatar2.png
cp images/avatar2.png /usr/share/jitsi-meet/images/
2020-04-11 05:08:30 +00:00
sed -i "/location \/external_api.min.js/i \ \ \ \ location \~ \^\/avatar\/\(.\*\)\\\.png {" $WS_CONF
sed -i "/location \/external_api.min.js/i \ \ \ \ \ \ \ \ alias /usr/share/jitsi-meet/images/avatar2.png;" $WS_CONF
sed -i " /location \/external_api.min.js/i \ \ \ \ }\\
2019-02-25 04:10:26 +00:00
\ " $WS_CONF
2019-04-05 06:14:57 +00:00
sed -i " /RANDOM_AVATAR_URL_PREFIX/ s|false|\'https:// $DOMAIN /avatar/\'| " $INT_CONF
2019-02-25 04:10:26 +00:00
sed -i "/RANDOM_AVATAR_URL_SUFFIX/ s|false|\'.png\'|" $INT_CONF
fi
2020-04-11 05:08:30 +00:00
#nginx -tlsv1/1.1
2020-08-08 08:44:37 +00:00
if [ " $DROP_TLS1 " = "yes" ] && [ " $DIST " != "xenial" ] ; then
2020-04-10 22:34:39 +00:00
echo "Dropping TLSv1/1.1 in favor of v1.3"
2020-04-11 05:08:30 +00:00
sed -i "s|TLSv1 TLSv1.1|TLSv1.3|" /etc/nginx/nginx.conf
#sed -i "s|TLSv1 TLSv1.1|TLSv1.3|" $WS_CONF
2020-08-07 23:10:52 +00:00
elif [ " $DROP_TLS1 " = "yes" ] && [ " $DIST " = "xenial" ] ; then
2020-04-10 22:34:39 +00:00
echo "Only dropping TLSv1/1.1"
2020-04-11 05:08:30 +00:00
sed -i "s|TLSv1 TLSv1.1||" /etc/nginx/nginx.conf
2020-08-11 07:23:40 +00:00
sed -i "s| TLSv1.3||" $WS_CONF
2020-09-10 03:03:52 +00:00
elif [ " $DROP_TLS1 " = "no" ] ; then
echo "No TLSv1/1.1 dropping was done."
2020-04-11 05:08:30 +00:00
else
2020-09-10 03:03:52 +00:00
echo " No contidion meet, please report to
2020-04-11 05:08:30 +00:00
https://github.com/switnet-ltd/quick-jibri-installer/issues "
2020-04-10 22:34:39 +00:00
fi
2020-09-09 08:17:07 +00:00
echo "Disable \"Blur my background\" until new notice"
2019-11-18 08:55:44 +00:00
sed -i "s|'videobackgroundblur', ||" $INT_CONF
2020-09-09 08:17:07 +00:00
2020-09-05 20:22:37 +00:00
#================== Setup prosody conf file =================
2019-11-18 08:55:44 +00:00
2020-04-11 05:08:30 +00:00
#Setup secure rooms
2020-05-01 01:32:59 +00:00
SRP_STR = $( grep -n " VirtualHost \" $DOMAIN \" " $PROSODY_FILE | head -n1 | cut -d ":" -f1)
SRP_END = $(( SRP_STR + 10 ))
sed -i " $SRP_STR , $SRP_END {s|authentication = \"anonymous\"|authentication = \"internal_plain\"|} " $PROSODY_FILE
2020-07-23 07:23:12 +00:00
if dpkg-compare prosody gt 0.11.0 ; then
2020-08-07 22:32:16 +00:00
cat << P_SR >> $P ROSODY_FILE
2019-04-05 06:14:57 +00:00
VirtualHost " guest. $DOMAIN "
authentication = "anonymous"
2020-07-23 07:23:12 +00:00
c2s_require_encryption = false
2020-05-01 01:32:59 +00:00
speakerstats_component = " speakerstats. $DOMAIN "
2020-07-23 07:23:12 +00:00
conference_duration_component = " conferenceduration. $DOMAIN "
2020-08-08 05:36:08 +00:00
lobby_muc = " lobby. $DOMAIN "
main_muc = " conference. $DOMAIN "
2020-09-05 20:04:32 +00:00
muc_lobby_whitelist = { " recorder. $DOMAIN " , " auth. $DOMAIN " }
2020-09-05 20:22:37 +00:00
2020-07-23 07:23:12 +00:00
modules_enabled = {
"speakerstats" ;
"conference_duration" ;
"muc_lobby_rooms" ;
}
2020-08-08 05:36:08 +00:00
2020-07-23 07:23:12 +00:00
P_SR
else
2020-08-07 22:32:16 +00:00
cat << P_SR >> $P ROSODY_FILE
2020-07-23 07:23:12 +00:00
VirtualHost " guest. $DOMAIN "
authentication = "anonymous"
2019-04-05 06:14:57 +00:00
c2s_require_encryption = false
P_SR
2020-08-07 22:32:16 +00:00
2020-07-23 07:23:12 +00:00
fi
2020-08-07 22:32:16 +00:00
#======================
2019-04-01 20:29:03 +00:00
#Secure room initial user
2020-04-11 05:08:30 +00:00
if [ " $ENABLE_SC " = "yes" ] ; then
echo "Secure rooms are being enabled..."
2019-04-01 20:29:03 +00:00
echo " You'll be able to login Secure Room chat with ' ${ SEC_ROOM_USER } ' \
or '${SEC_ROOM_USER}@${DOMAIN}' using the password you just entered.
If you have issues with the password refer to your sysadmin."
2019-04-05 06:14:57 +00:00
sed -i "s|#org.jitsi.jicofo.auth.URL=XMPP:|org.jitsi.jicofo.auth.URL=XMPP:|" $JICOFO_SIP
2019-04-01 20:29:03 +00:00
prosodyctl register $SEC_ROOM_USER $DOMAIN $SEC_ROOM_PASS
2020-04-13 17:46:47 +00:00
sed -i "s|SEC_ROOM=.*|SEC_ROOM=\"on\"|" jm-bm.sh
2019-01-07 08:00:55 +00:00
fi
2019-02-25 04:10:26 +00:00
#Start with video muted by default
sed -i "s|// startWithVideoMuted: false,|startWithVideoMuted: true,|" $MEET_CONF
#Start with audio muted but admin
sed -i "s|// startAudioMuted: 10,|startAudioMuted: 1,|" $MEET_CONF
2019-03-04 12:31:34 +00:00
#Disable/enable welcome page
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_WELCP " = "yes" ] ; then
2020-04-02 20:47:24 +00:00
sed -i "s|.*enableWelcomePage:.*| enableWelcomePage: false,|" $MEET_CONF
2020-06-03 11:22:16 +00:00
elif [ " $ENABLE_WELCP " = "no" ] ; then
2020-04-02 20:47:24 +00:00
sed -i "s|.*enableWelcomePage:.*| enableWelcomePage: true,|" $MEET_CONF
2019-11-20 07:29:46 +00:00
fi
2019-03-04 12:31:34 +00:00
#Set displayname as not required since jibri can't set it up.
sed -i "s|// requireDisplayName: true,|requireDisplayName: false,|" $MEET_CONF
2019-02-25 06:15:25 +00:00
2018-09-25 08:25:32 +00:00
#Enable jibri services
systemctl enable jibri
systemctl enable jibri-xorg
systemctl enable jibri-icewm
restart_services
enable_letsencrypt
2020-08-08 05:36:08 +00:00
if dpkg-compare prosody gt 0.11.0 && [ " $ENABLE_SC " = "yes" ] ; then
2020-09-10 04:03:53 +00:00
echo "Waiting prosody restart, wait 15s..."
2020-08-07 22:32:16 +00:00
wait_seconds 15
2020-09-05 20:04:32 +00:00
#Move mucs when using secure rooms - https://community.jitsi.org/t/27752/112
2020-08-07 22:32:16 +00:00
sed -i "s| lobby_muc = \"lobby.|-- lobby_muc = \"lobby.|" $PROSODY_FILE
2020-08-08 06:13:10 +00:00
sed -i "s| main_muc = \"conference.|-- main_muc = \"conference.|" $PROSODY_FILE
2020-09-05 20:04:32 +00:00
sed -i "s| muc_lobby_whitelist = { \"recorder.|-- muc_lobby_whitelist = { \"recorder.|" $PROSODY_FILE
2020-08-07 22:32:16 +00:00
#EO_TF
fi
2020-08-31 08:01:26 +00:00
# Fix prosody not able to read SSL Certs
chown -R root:prosody /etc/prosody/certs/
chmod -R 650 /etc/prosody/certs/
2019-04-02 05:15:11 +00:00
#SSL workaround
2020-04-10 22:34:39 +00:00
if [ " $( dpkg-query -W -f= '${Status}' nginx 2>/dev/null | grep -c "ok installed" ) " -eq 1 ] ; then
2019-04-05 06:14:57 +00:00
ssl_wa nginx nginx $DOMAIN $WS_CONF $SYSADMIN_EMAIL $DOMAIN
install_ifnot python3-certbot-nginx
2019-04-02 05:15:11 +00:00
else
2019-04-05 06:14:57 +00:00
echo "No webserver found please report."
2019-04-02 05:15:11 +00:00
fi
2020-04-11 09:59:29 +00:00
#Brandless Mode
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_BLESSM " = "yes" ] ; then
2020-04-11 12:46:24 +00:00
echo "Custom brandless mode will be enabled."
2020-04-11 09:59:29 +00:00
sed -i "s|ENABLE_BLESSM=.*|ENABLE_BLESSM=\"on\"|" jitsi-updater.sh
bash $PWD /jm-bm.sh
fi
2020-09-10 03:03:52 +00:00
# Applying best practives for interface config.js
2020-09-10 03:38:45 +00:00
echo -e "\n> Setting up custom interface_config.js according to best practices."
2020-09-10 03:03:52 +00:00
cp " $INT_CONF " " $INT_CONF_ETC "
#Tune webserver for interface_config.js
if [ -f $WS_CONF ] ; then
sed -i "/external_api.js/i \\\n" $WS_CONF
sed -i "/external_api.js/i \ \ \ \ location = \/interface_config.js {" $WS_CONF
sed -i " /external_api.js/i \ \ \ \ \ \ \ \ alias \/etc\/jitsi\/meet\/ $DOMAIN -interface_config.js; " $WS_CONF
sed -i "/external_api.js/i \ \ \ \ }" $WS_CONF
sed -i "/external_api.js/i \\\n" $WS_CONF
systemctl reload nginx
else
echo " No interface_config.js configuration done to server file, please report to:
-> https://github.com/switnet-ltd/quick-jibri-installer/issues"
fi
2020-04-11 07:19:54 +00:00
#JRA via Nextcloud
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_NC_ACCESS " = "yes" ] ; then
2020-10-05 08:14:31 +00:00
echo -n "\nJRA via Nextcloud will be enabled."
2020-09-30 08:14:08 +00:00
if [ " $MODE " = "debug" ] ; then
bash $PWD /jra_nextcloud.sh -m debug
else
bash $PWD /jra_nextcloud.sh
fi
2020-04-11 07:19:54 +00:00
fi
2020-06-03 09:52:36 +00:00
} > >( tee -a qj-installer.log) 2> >( tee -a qj-installer.log >& 2)
2020-04-11 07:19:54 +00:00
#Jigasi Transcript
2020-06-03 11:22:16 +00:00
if [ " $ENABLE_TRANSCRIPT " = "yes" ] ; then
2020-10-05 08:14:31 +00:00
echo -e "\nJigasi Transcription will be enabled."
2020-09-30 08:14:08 +00:00
# ToDo: Analyze behavior on debug
#if [ "$MODE" = "debug" ]; then
# bash $PWD/jigasi.sh -m debug
#else
bash $PWD /jigasi.sh
#fi
2019-07-29 09:24:32 +00:00
fi
2020-06-03 09:52:36 +00:00
{
2020-07-04 12:23:24 +00:00
#Grafana Dashboard
if [ " $ENABLE_GRAFANA_DSH " = "yes" ] ; then
2020-10-05 08:14:31 +00:00
echo -e "\nGrafana Dashboard will be enabled."
2020-09-30 08:14:08 +00:00
if [ " $MODE " = "debug" ] ; then
bash $PWD /grafana.sh -m debug
else
bash $PWD /grafana.sh
fi
2020-07-04 12:23:24 +00:00
fi
2020-08-11 07:52:48 +00:00
#Docker Etherpad
if [ " $ENABLE_DOCKERPAD " = "yes" ] ; then
2020-10-05 08:14:31 +00:00
echo -e "\nDocker Etherpad will be enabled."
2020-09-30 08:14:08 +00:00
if [ " $MODE " = "debug" ] ; then
bash $PWD /etherpad.sh -m debug
else
bash $PWD /etherpad.sh
fi
2020-08-11 07:52:48 +00:00
fi
2020-04-07 02:08:39 +00:00
#Prevent Jibri conecction issue
2020-08-07 22:32:16 +00:00
if [ -z " $( grep -n $DOMAIN /etc/hosts) " ] ; then
2020-04-07 02:08:39 +00:00
sed -i " /127.0.0.1/a \\
127.0.0.1 $DOMAIN " /etc/hosts
2020-08-07 22:32:16 +00:00
else
echo "Local host already in place..."
fi
2020-04-07 02:08:39 +00:00
2018-09-25 08:25:32 +00:00
echo "
########################################################################
Installation complete!!
2019-01-07 08:07:59 +00:00
for customized support: http://switnet.net
2018-09-25 08:25:32 +00:00
########################################################################
"
2020-04-14 16:49:11 +00:00
apt-get -y autoremove
apt-get autoclean
2018-09-25 08:25:32 +00:00
echo "Rebooting in..."
2020-08-07 22:32:16 +00:00
wait_seconds 15
2020-03-26 00:47:37 +00:00
} > >( tee -a qj-installer.log) 2> >( tee -a qj-installer.log >& 2)
2018-09-25 08:25:32 +00:00
reboot