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.
|
2024-03-21 20:09:38 +00:00
|
|
|
# SwITNet Ltd © - 2024, 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
|
2022-05-21 00:54:27 +00:00
|
|
|
case "${option}"
|
|
|
|
in
|
|
|
|
m) MODE=${OPTARG};;
|
|
|
|
\?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;;
|
|
|
|
esac
|
2020-03-25 18:25:50 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
#DEBUG
|
|
|
|
if [ "$MODE" = "debug" ]; then
|
2023-10-02 21:12:11 +00:00
|
|
|
set -x
|
2020-03-25 18:25:50 +00:00
|
|
|
fi
|
|
|
|
|
2023-10-02 21:12:11 +00:00
|
|
|
# Reset
|
|
|
|
Color_Off='\e[0m' # Text Reset
|
|
|
|
# Regular Colors
|
|
|
|
Black='\e[0;30m' # Black
|
|
|
|
Red='\e[0;31m' # Red
|
|
|
|
Green='\e[0;32m' # Green
|
|
|
|
Yellow='\e[0;33m' # Yellow
|
|
|
|
Blue='\e[0;34m' # Blue
|
|
|
|
Purple='\e[0;35m' # Purple
|
|
|
|
Cyan='\e[0;36m' # Cyan
|
|
|
|
|
2018-09-25 08:25:32 +00:00
|
|
|
# SYSTEM SETUP
|
2021-04-16 06:09:43 +00:00
|
|
|
JITSI_REPO=$(apt-cache policy | awk '/jitsi/&&/stable/{print$3}' | awk -F / 'NR==1{print$1}')
|
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"
|
2021-04-16 06:09:43 +00:00
|
|
|
GOOGLE_ACTIVE_REPO=$(apt-cache policy | awk '/chrome/{print$3}' | awk -F "/" 'NR==1{print$2}')
|
2022-05-12 04:53:51 +00:00
|
|
|
PROSODY_REPO="$(apt-cache policy | awk '/prosody/{print$3}' | awk -F "/" 'NR==1{print$2}')"
|
2023-11-14 04:42:27 +00:00
|
|
|
PUBLIC_IP="$(dig -4 +short myip.opendns.com @resolver1.opendns.com)"
|
2022-05-20 15:43:34 +00:00
|
|
|
NL="$(printf '\n ')"
|
2023-10-02 21:12:11 +00:00
|
|
|
NODEJS_VER="18"
|
2023-11-14 05:59:59 +00:00
|
|
|
JITSI_GPG_KEY="/etc/apt/trusted.gpg.d/jitsi-key.gpg.key"
|
|
|
|
PROSODY_GPG_KEY="/etc/apt/trusted.gpg.d/prosody-debian-packages.key"
|
|
|
|
NODEJS_GPG_KEY="/etc/apt/keyrings/nodesource.gpg"
|
|
|
|
TODAY=$(date +%s)
|
|
|
|
NEXT_LTS_DATE=$(date -d 2024-04-01 +%s)
|
|
|
|
CERT_CHOICE_DEBCONF="Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate)"
|
2018-09-25 08:25:32 +00:00
|
|
|
|
2023-10-02 21:12:11 +00:00
|
|
|
printwc() {
|
|
|
|
printf "%b$2%b" "$1" "${Color_Off}"
|
|
|
|
}
|
2021-01-25 09:26:00 +00:00
|
|
|
exit_ifinstalled() {
|
2023-11-14 04:39:41 +00:00
|
|
|
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
|
|
|
echo -e "\nThis instance already has $1 installed, exiting..."
|
|
|
|
echo -e "Please try again on a clean system."
|
|
|
|
echo -e " If you think this is an error, please report to:"
|
|
|
|
echo -e " -> https://forge.switnet.net/switnet/quick-jibri-installer/issues"
|
|
|
|
exit
|
|
|
|
fi
|
2021-01-25 09:26:00 +00:00
|
|
|
}
|
|
|
|
exit_ifinstalled jitsi-meet
|
|
|
|
|
2021-05-05 00:43:12 +00:00
|
|
|
rename_distro() {
|
2023-11-14 04:39:41 +00:00
|
|
|
if [ "$DIST" = "$1" ]; then
|
|
|
|
DIST="$2"
|
|
|
|
fi
|
2021-05-05 00:43:12 +00:00
|
|
|
}
|
2023-11-10 06:58:13 +00:00
|
|
|
#Trisquel distro upstream referencing.
|
2021-05-05 00:43:12 +00:00
|
|
|
rename_distro nabia focal
|
2023-11-10 06:58:13 +00:00
|
|
|
rename_distro aramo jammy
|
2021-05-05 00:43:12 +00:00
|
|
|
|
2019-04-01 20:29:03 +00:00
|
|
|
install_ifnot() {
|
2023-11-14 04:39:41 +00:00
|
|
|
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
|
|
|
echo " $1 is installed, skipping..."
|
2019-04-01 20:29:03 +00:00
|
|
|
else
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\n---- Installing %s ----" "$1"
|
2022-05-12 04:53:51 +00:00
|
|
|
apt-get -yq2 install "$1"
|
2023-11-14 04:39:41 +00:00
|
|
|
fi
|
2019-04-01 20:29:03 +00:00
|
|
|
}
|
2018-09-25 08:25:32 +00:00
|
|
|
check_serv() {
|
2023-11-14 04:39:41 +00:00
|
|
|
if [ "$APACHE_2" -eq 1 ]; then
|
|
|
|
echo -e "\nThe recommended setup is using NGINX, exiting...\n"
|
|
|
|
exit
|
|
|
|
elif [ "$NGINX" -eq 1 ]; then
|
|
|
|
printf "\nWebserver already installed!\n"
|
|
|
|
else
|
|
|
|
printf "\nInstalling nginx webserver!\n"
|
|
|
|
install_ifnot nginx
|
|
|
|
fi
|
2018-09-25 08:25:32 +00:00
|
|
|
}
|
|
|
|
check_snd_driver() {
|
2023-11-14 04:39:41 +00:00
|
|
|
printf "\n# Checking ALSA - Loopback module..."
|
|
|
|
echo "snd-aloop" | tee -a /etc/modules
|
|
|
|
modprobe snd-aloop
|
|
|
|
if [ "$(lsmod|awk '/snd_aloop/{print$1}'|awk 'NR==1')" = "snd_aloop" ]; then
|
|
|
|
echo -e "\n#-----------------------------------------------------------------------"
|
|
|
|
echo "# Audio driver seems - OK."
|
|
|
|
echo -e "#-----------------------------------------------------------------------\n"
|
|
|
|
else
|
|
|
|
echo -e "\n#-----------------------------------------------------------------------"
|
|
|
|
echo "# Your audio driver might not be able to load."
|
|
|
|
echo "# We'll check the state of this Jibri with our 'test-jibri-env.sh' tool."
|
|
|
|
echo -e "#-----------------------------------------------------------------------\n"
|
|
|
|
#Test tool
|
|
|
|
if [ "$MODE" = "debug" ]; then
|
|
|
|
bash "$PWD"/tools/test-jibri-env.sh -m debug
|
|
|
|
else
|
|
|
|
bash "$PWD"/tools/test-jibri-env.sh
|
|
|
|
fi
|
|
|
|
read -n 1 -s -r -p "Press any key to continue..."$'\n'
|
|
|
|
fi
|
2018-09-25 08:25:32 +00:00
|
|
|
}
|
2020-05-09 02:46:18 +00:00
|
|
|
# sed limiters for add-jibri-node.sh variables
|
|
|
|
var_dlim() {
|
2022-05-12 04:53:51 +00:00
|
|
|
grep -n "$1" add-jibri-node.sh|head -n1|cut -d ":" -f1
|
2020-05-09 02:46:18 +00:00
|
|
|
}
|
2023-11-14 04:39:41 +00:00
|
|
|
add_gpg_keyring() {
|
|
|
|
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com \$1
|
|
|
|
apt-key export \$1 | gpg --dearmour | tee /tmp/\$1.gpg >/dev/null
|
|
|
|
apt-key del \$1
|
|
|
|
mv /tmp/\$1.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
}
|
2020-07-01 02:41:31 +00:00
|
|
|
add_prosody_repo() {
|
2023-11-14 04:39:41 +00:00
|
|
|
echo "Add Prosody repo"
|
|
|
|
if [ "$PROSODY_REPO" = "main" ]; then
|
|
|
|
echo "Prosody repository already installed"
|
|
|
|
else
|
2023-11-14 05:59:59 +00:00
|
|
|
echo "deb [signed-by=$PROSODY_GPG_KEY] http://packages.prosody.im/debian $DIST main" \
|
|
|
|
> /etc/apt/sources.list.d/prosody.list
|
|
|
|
curl -s https://prosody.im/files/prosody-debian-packages.key \
|
|
|
|
> "$PROSODY_GPG_KEY"
|
2024-01-23 08:46:53 +00:00
|
|
|
apt-get update -q2
|
2023-11-14 04:39:41 +00:00
|
|
|
fi
|
2020-07-01 02:41:31 +00:00
|
|
|
}
|
2020-07-23 07:23:12 +00:00
|
|
|
dpkg-compare() {
|
2023-11-14 04:39:41 +00:00
|
|
|
dpkg --compare-versions "$(dpkg-query -f='${Version}' --show "$1")" "$2" "$3"
|
2020-07-23 07:23:12 +00:00
|
|
|
}
|
2020-08-07 22:32:16 +00:00
|
|
|
wait_seconds() {
|
2023-11-14 04:39:41 +00:00
|
|
|
secs=$(($1))
|
|
|
|
while [ $secs -gt 0 ]; do
|
|
|
|
echo -ne "$secs\033[0K\r"
|
|
|
|
sleep 1
|
|
|
|
: $((secs--))
|
|
|
|
done
|
2020-08-07 22:32:16 +00:00
|
|
|
}
|
2023-10-02 21:12:11 +00:00
|
|
|
print_title() {
|
2023-11-14 04:39:41 +00:00
|
|
|
printwc "${Blue}" "\n#--------------------------------------------------"
|
|
|
|
printwc "${Blue}" "\n# $1"
|
|
|
|
printwc "${Blue}" "\n#--------------------------------------------------\n"
|
2023-10-02 21:12:11 +00:00
|
|
|
}
|
2023-11-10 06:58:13 +00:00
|
|
|
test_match() {
|
2023-11-14 04:39:41 +00:00
|
|
|
if grep -q "$1" "$2" ; then
|
|
|
|
echo "$(basename "$2") - OK..."
|
|
|
|
else
|
|
|
|
echo "$(basename "$2"), FAIL..."
|
|
|
|
echo "Please report this to https://forge.switnet.net/switnet/quick-jibri-installer"
|
|
|
|
exit
|
|
|
|
fi
|
2023-11-10 06:58:13 +00:00
|
|
|
}
|
2018-09-25 08:25:32 +00:00
|
|
|
clear
|
2023-11-10 05:29:32 +00:00
|
|
|
printwc "${Green}" '
|
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
|
2023-11-09 00:10:39 +00:00
|
|
|
- Grafana Statistics
|
|
|
|
- Etherpad
|
|
|
|
- Whiteboard
|
2020-04-11 10:20:42 +00:00
|
|
|
- Customized brandless mode
|
2023-11-09 00:10:39 +00:00
|
|
|
- Recurring updater
|
2020-04-11 09:51:31 +00:00
|
|
|
|
2020-04-15 05:27:34 +00:00
|
|
|
Learn more about these at,
|
2023-11-07 20:42:50 +00:00
|
|
|
Main repository: https://forge.switnet.net/switnet/quick-jibri-installer
|
2023-11-10 06:58:13 +00:00
|
|
|
Wiki and documentation: https://forge.switnet.net/switnet/quick-jibri-installer/wiki\n\n'
|
2023-11-14 04:39:41 +00:00
|
|
|
sleep .1
|
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
|
2022-05-12 04:53:51 +00:00
|
|
|
if ! [ "$(id -u)" = 0 ]; then
|
2019-08-09 05:45:24 +00:00
|
|
|
echo "You need to be root or have sudo privileges!"
|
|
|
|
exit 0
|
2018-09-25 08:25:32 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
|
|
|
|
printf "\nOS: %s" "$(lsb_release -sd)"
|
2023-02-22 11:56:20 +00:00
|
|
|
if [ "$DIST" = "focal" ] || \
|
|
|
|
[ "$DIST" = "jammy" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nGood, this is a supported platform!"
|
2020-04-07 02:08:39 +00:00
|
|
|
else
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nSorry, this platform is not supported... exiting"
|
2021-04-10 22:13:19 +00:00
|
|
|
exit
|
2020-04-07 02:08:39 +00:00
|
|
|
fi
|
2023-02-22 11:56:20 +00:00
|
|
|
#Suggest 22.04 LTS release over 20.04 in April 2024
|
|
|
|
if [ "$DIST" = "focal" ]; then
|
2021-04-27 13:33:46 +00:00
|
|
|
if [ "$TODAY" -gt "$NEXT_LTS_DATE" ]; then
|
2023-11-14 04:39:41 +00:00
|
|
|
echo " > $(lsb_release -sc), even when it's compatible and functional."
|
2023-11-14 05:59:59 +00:00
|
|
|
echo -n " We suggest to use the next (LTS) release, for longer"
|
|
|
|
echo " support and security reasons."
|
2021-04-27 13:33:46 +00:00
|
|
|
read -n 1 -s -r -p "Press any key to continue..."$'\n'
|
|
|
|
else
|
2023-02-22 11:56:20 +00:00
|
|
|
echo "Focal is supported."
|
2021-04-27 13:33:46 +00:00
|
|
|
fi
|
2020-04-11 07:32:45 +00:00
|
|
|
fi
|
2021-04-27 13:33:46 +00:00
|
|
|
|
2020-10-05 08:51:06 +00:00
|
|
|
#Check system resources
|
2022-08-19 11:35:49 +00:00
|
|
|
printf "\n\nVerifying System Resources:"
|
2020-06-29 07:45:17 +00:00
|
|
|
if [ "$(nproc --all)" -lt 4 ];then
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\nWarning!: The system do not meet the minimum CPU"
|
|
|
|
printf " requirements for Jibri to run."
|
2022-08-19 11:35:49 +00:00
|
|
|
printf "\n>> We recommend 4 cores/threads for Jibri!\n"
|
2022-05-20 15:43:34 +00:00
|
|
|
CPU_MIN="N"
|
2020-06-29 07:45:17 +00:00
|
|
|
else
|
2022-08-19 11:35:49 +00:00
|
|
|
printf "\nCPU Cores/Threads: OK (%s)\n" "$(nproc --all)"
|
2022-05-20 15:43:34 +00:00
|
|
|
CPU_MIN="Y"
|
2020-06-29 07:45:17 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-06-29 07:45:17 +00:00
|
|
|
### Test RAM size (8GB min) ###
|
2022-05-12 04:53:51 +00:00
|
|
|
mem_available="$(grep MemTotal /proc/meminfo| grep -o '[0-9]\+')"
|
|
|
|
if [ "$mem_available" -lt 7700000 ]; then
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\nWarning!: The system do not meet the minimum RAM"
|
|
|
|
printf " requirements for Jibri to run."
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\n>> We recommend 8GB RAM for Jibri!\n\n"
|
|
|
|
MEM_MIN="N"
|
2020-06-29 07:45:17 +00:00
|
|
|
else
|
2022-08-19 11:35:49 +00:00
|
|
|
printf "\nMemory: OK (%s) MiB\n\n" "$((mem_available/1024))"
|
2022-05-20 15:43:34 +00:00
|
|
|
MEM_MIN="Y"
|
2020-06-29 07:45:17 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
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!"
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\n - We hope you have a nice recording/streaming session\n"
|
2020-06-29 07:45:17 +00:00
|
|
|
else
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "CPU (%s)/RAM (%s MiB)" "$(nproc --all)" "$((mem_available/1024))"
|
|
|
|
printf " does NOT meet minimum recommended requirements!"
|
|
|
|
printf "\nEven when you can use the videoconferencing sessions, we"
|
|
|
|
printf " advice to increase the resources in order to user Jibri.\n\n"
|
2022-10-24 04:44:48 +00:00
|
|
|
sleep .1
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$CONTINUE_LOW_RES" != "yes" ] && [ "$CONTINUE_LOW_RES" != "no" ]
|
2020-06-29 07:45:17 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Do you want to continue?: (yes or no)$NL" -r CONTINUE_LOW_RES
|
2020-06-29 07:45:17 +00:00
|
|
|
if [ "$CONTINUE_LOW_RES" = "no" ]; then
|
2022-05-20 12:00:57 +00:00
|
|
|
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
|
2022-10-24 04:44:48 +00:00
|
|
|
printf "\n - We highly recommend to increase the server resources."
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\n - Otherwise, please think about adding dedicated"
|
|
|
|
printf " jibri nodes instead.\n\n"
|
2020-10-08 15:38:39 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-10-08 15:38:39 +00:00
|
|
|
if [ "$CONTINUE_LOW_RES" = "yes" ]; then
|
2022-05-20 12:00:57 +00:00
|
|
|
echo 'This server will likely have issues due the lack of resources.
|
2020-10-08 15:38:39 +00:00
|
|
|
If you plan to enable other components such as,
|
|
|
|
|
|
|
|
- JRA via Nextcloud
|
2023-11-09 00:10:39 +00:00
|
|
|
- Grafana
|
|
|
|
- Etherpad
|
|
|
|
- Whiteboards
|
2023-11-10 05:29:32 +00:00
|
|
|
- Connect additional Jibri Nodes
|
|
|
|
- Others
|
2020-10-08 15:38:39 +00:00
|
|
|
|
2023-11-07 20:42:50 +00:00
|
|
|
>>> We highly recommend to increase resources of this server. <<<
|
2020-10-08 15:38:39 +00:00
|
|
|
|
|
|
|
For now we advice to disable the Jibri service locally and add an external
|
|
|
|
Jibri node once this installation has finished, using our script:
|
|
|
|
|
2022-05-20 15:43:34 +00:00
|
|
|
>> add-jibri-node.sh'
|
|
|
|
printf "\nSo you can add a Jibri server on a instance with enough resources.\n\n"
|
|
|
|
sleep .1
|
|
|
|
while [ "$DISABLE_LOCAL_JIBRI" != "yes" ] && [ "$DISABLE_LOCAL_JIBRI" != "no" ]
|
2020-10-08 15:38:39 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Do you want to disable local jibri service?: (yes or no)$NL" -r DISABLE_LOCAL_JIBRI
|
2022-05-20 12:00:57 +00:00
|
|
|
if [ "$DISABLE_LOCAL_JIBRI" = "no" ]; then
|
2023-11-14 05:59:59 +00:00
|
|
|
printf " - Please keep in mind that we might not support"
|
|
|
|
printf " underpowered servers.\n"
|
2022-05-20 12:00:57 +00:00
|
|
|
elif [ "$DISABLE_LOCAL_JIBRI" = "yes" ]; then
|
2023-11-14 05:59:59 +00:00
|
|
|
printf " - You can add dedicated jibri nodes later, see more"
|
|
|
|
printf " at the wiki.\n"
|
2022-05-20 12:00:57 +00:00
|
|
|
fi
|
2020-06-29 07:45:17 +00:00
|
|
|
done
|
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2021-05-21 21:23:23 +00:00
|
|
|
#Check system oriented porpuse
|
2023-11-14 05:59:59 +00:00
|
|
|
apt-get -q2 update
|
2021-05-21 21:23:23 +00:00
|
|
|
SYSTEM_DE="$(apt-cache search "ubuntu-(desktop|mate-desktop)"|awk '{print$1}'|xargs|sed 's|$| trisquel triskel trisquel-mini|')"
|
2022-05-12 04:53:51 +00:00
|
|
|
SYSTEM_DE_ARRAY=( "$SYSTEM_DE" )
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nChecking for common desktop system oriented purpose....\n"
|
2021-05-21 21:23:23 +00:00
|
|
|
for de in "${SYSTEM_DE_ARRAY[@]}"
|
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
if [ "$(dpkg-query -W -f='${Status}' "$de" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
2023-11-14 04:39:41 +00:00
|
|
|
printf "\n > This instance has %s installed, exiting...\n" "$de"
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\nPlease avoid using this installer on a desktop-user"
|
|
|
|
printf " oriented GNU/Linux system.\n"
|
|
|
|
printf "This is an unsupported use, as it will likely BREAK YOUR"
|
|
|
|
printf " SYSTEM, so please don't.\n"
|
2021-05-21 21:23:23 +00:00
|
|
|
exit
|
|
|
|
else
|
2023-11-14 05:59:59 +00:00
|
|
|
printf " > No standard desktop environment for user oriented"
|
|
|
|
printf " porpuse detected, good!, continuing...\n\n"
|
2021-05-21 21:23:23 +00:00
|
|
|
fi
|
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-05-03 00:21:53 +00:00
|
|
|
#Prosody repository
|
2020-07-23 07:23:12 +00:00
|
|
|
add_prosody_repo
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2018-09-25 08:25:32 +00:00
|
|
|
# Jitsi-Meet Repo
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nAdd Jitsi repo\n"
|
2020-08-08 06:13:10 +00:00
|
|
|
if [ "$JITSI_REPO" = "stable" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Jitsi stable repository already installed\n\n"
|
2018-09-25 08:25:32 +00:00
|
|
|
else
|
2023-11-14 05:59:59 +00:00
|
|
|
echo "deb [signed-by=$JITSI_GPG_KEY] http://download.jitsi.org stable/" \
|
|
|
|
> /etc/apt/sources.list.d/jitsi-stable.list
|
|
|
|
curl -s https://download.jitsi.org/jitsi-key.gpg.key \
|
|
|
|
> "$JITSI_GPG_KEY"
|
2024-01-23 08:46:53 +00:00
|
|
|
apt-get update -q2
|
2021-04-10 22:13:19 +00:00
|
|
|
JITSI_REPO="stable"
|
2018-09-25 08:25:32 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-04-30 22:11:35 +00:00
|
|
|
#Default to LE SSL?
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$LE_SSL" != "yes" ] && [ "$LE_SSL" != "no" ]
|
2020-04-30 22:11:35 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Do you plan to use Let's Encrypt SSL certs?: (yes or no)$NL" -r LE_SSL
|
|
|
|
if [ "$LE_SSL" = yes ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - We'll setup Let's Encrypt SSL certs.\n\n"
|
2020-06-30 19:19:23 +00:00
|
|
|
else
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - We'll let you choose later on for it."
|
2023-11-14 05:59:59 +00:00
|
|
|
printf " Please be aware that a valid SSL cert is required for"
|
|
|
|
printf " some features to work properly.\n\n"
|
2020-04-30 22:11:35 +00:00
|
|
|
fi
|
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2021-01-25 10:22:30 +00:00
|
|
|
#Set domain
|
2022-05-20 15:43:34 +00:00
|
|
|
if [ "$LE_SSL" = "yes" ]
|
|
|
|
then
|
|
|
|
while [ "$ANS_JD" != "yes" ]
|
2021-01-28 16:34:28 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Please set your domain (or subdomain) here: (e.g.: jitsi.domain.com)$NL" -r JITSI_DOMAIN
|
2022-05-20 15:43:34 +00:00
|
|
|
read -p " > Did you mean?: $JITSI_DOMAIN (yes or no)$NL" -r ANS_JD
|
|
|
|
if [ "$ANS_JD" = "yes" ]
|
|
|
|
then
|
|
|
|
echo " - Alright, let's use $JITSI_DOMAIN."
|
2021-04-12 03:32:55 +00:00
|
|
|
else
|
2022-05-20 15:43:34 +00:00
|
|
|
echo " - Please try again."
|
2021-04-12 03:32:55 +00:00
|
|
|
fi
|
2021-01-28 16:34:28 +00:00
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2022-05-20 11:07:18 +00:00
|
|
|
#Sysadmin email
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ -z "$SYSADMIN_EMAIL" ]
|
2022-05-20 11:07:18 +00:00
|
|
|
do
|
2022-08-19 12:20:44 +00:00
|
|
|
read -p "$NL > Set sysadmin email (this is a mandatory field):$NL" -r SYSADMIN_EMAIL
|
2022-05-20 11:07:18 +00:00
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2021-01-28 16:34:28 +00:00
|
|
|
#Simple DNS test
|
2022-05-12 04:53:51 +00:00
|
|
|
if [ "$PUBLIC_IP" = "$(dig -4 +short "$JITSI_DOMAIN"||awk -v RS='([0-9]+\\.){3}[0-9]+' 'RT{print RT}')" ]; then
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\nServer public IP & DNS record for"
|
|
|
|
printf " %s seems to match, continuing..." "$JITSI_DOMAIN"
|
2021-04-12 03:32:55 +00:00
|
|
|
else
|
2023-11-14 04:39:41 +00:00
|
|
|
echo -n "Server public IP ($PUBLIC_IP) & DNS record for $JITSI_DOMAIN"
|
|
|
|
echo " don't seem to match."
|
|
|
|
echo -n " > Please check your dns records are applied and updated,"
|
|
|
|
echo " otherwise components may fail."
|
|
|
|
read -p " > Do you want to continue?: (yes or no)$NL" -r DNS_CONTINUE
|
2021-04-10 22:13:19 +00:00
|
|
|
if [ "$DNS_CONTINUE" = "yes" ]; then
|
2023-11-14 04:39:41 +00:00
|
|
|
echo " - We'll continue anyway..."
|
2021-04-10 22:13:19 +00:00
|
|
|
else
|
2023-11-14 04:39:41 +00:00
|
|
|
echo " - Exiting for now..."
|
|
|
|
exit
|
2021-04-10 22:13:19 +00:00
|
|
|
fi
|
2022-05-20 11:07:18 +00:00
|
|
|
fi
|
2021-01-25 10:22:30 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2018-09-25 08:25:32 +00:00
|
|
|
# Requirements
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\nWe'll start by installing system requirements this may take"
|
|
|
|
printf " a while please be patient...\n"
|
2020-04-14 16:49:11 +00:00
|
|
|
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 \
|
2021-04-12 03:32:55 +00:00
|
|
|
apt-show-versions \
|
|
|
|
bmon \
|
|
|
|
curl \
|
|
|
|
ffmpeg \
|
|
|
|
git \
|
|
|
|
htop \
|
|
|
|
jq \
|
|
|
|
net-tools \
|
|
|
|
rsync \
|
|
|
|
ssh \
|
|
|
|
unzip \
|
|
|
|
wget
|
2020-04-07 02:08:39 +00:00
|
|
|
|
2021-01-28 16:34:28 +00:00
|
|
|
if [ "$LE_SSL" = "yes" ]; then
|
|
|
|
apt-get -y install \
|
2023-02-22 11:56:20 +00:00
|
|
|
certbot
|
2022-02-19 02:08:25 +00:00
|
|
|
if [ "$(dpkg-query -W -f='${Status}' ufw 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
2023-11-14 04:39:41 +00:00
|
|
|
echo "# Disable pre-installed ufw, more on firewall see:"
|
|
|
|
echo " > https://forge.switnet.net/switnet/quick-jibri-installer/wiki/Firewall"
|
2022-02-19 02:08:25 +00:00
|
|
|
ufw disable
|
|
|
|
fi
|
2021-01-28 16:34:28 +00:00
|
|
|
fi
|
|
|
|
|
2020-07-20 05:47:34 +00:00
|
|
|
echo "# Check and Install HWE kernel if possible..."
|
2023-11-14 05:59:59 +00:00
|
|
|
HWE_VIR_MOD="$(apt-cache madison linux-image-generic-hwe-"$(lsb_release -sr)" \
|
|
|
|
2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)")"
|
2021-01-26 22:11:14 +00:00
|
|
|
if [ "$HWE_VIR_MOD" = "1" ]; then
|
2020-07-20 05:47:34 +00:00
|
|
|
apt-get -y install \
|
2022-05-12 04:53:51 +00:00
|
|
|
linux-image-generic-hwe-"$(lsb_release -sr)" \
|
|
|
|
linux-tools-generic-hwe-"$(lsb_release -sr)"
|
2021-04-12 03:32:55 +00:00
|
|
|
else
|
2020-07-20 05:47:34 +00:00
|
|
|
apt-get -y install \
|
2020-12-16 00:57:15 +00:00
|
|
|
linux-image-generic \
|
2022-05-12 04:53:51 +00:00
|
|
|
linux-modules-extra-"$(uname -r)"
|
2020-07-20 05:47:34 +00:00
|
|
|
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
|
2023-11-14 05:59:59 +00:00
|
|
|
echo "set jitsi-meet/cert-choice select $CERT_CHOICE_DEBCONF" \
|
|
|
|
| debconf-set-selections
|
|
|
|
echo "jitsi-videobridge2 jitsi-videobridge/jvb-hostname string $JITSI_DOMAIN" \
|
|
|
|
| debconf-set-selections
|
|
|
|
echo "jitsi-meet-web-config jitsi-meet/email string $SYSADMIN_EMAIL" \
|
|
|
|
| debconf-set-selections
|
2021-01-28 16:34:28 +00:00
|
|
|
fi
|
2023-11-14 05:59:59 +00:00
|
|
|
echo "jitsi-meet-web-config jitsi-meet/jaas-choice boolean false" \
|
|
|
|
| debconf-set-selections
|
2020-04-14 16:49:11 +00:00
|
|
|
apt-get -y install \
|
2021-04-18 13:35:38 +00:00
|
|
|
jitsi-meet \
|
2021-04-10 22:13:19 +00:00
|
|
|
jibri \
|
2022-05-12 04:53:51 +00:00
|
|
|
openjdk-11-jre-headless
|
2020-03-26 00:52:44 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
#--------------------------------------------------
|
2023-10-02 21:12:11 +00:00
|
|
|
print_title "Install NodeJS $NODEJS_VER.x"
|
2018-10-05 15:00:57 +00:00
|
|
|
#--------------------------------------------------
|
|
|
|
if [ "$(dpkg-query -W -f='${Status}' nodejs 2>/dev/null | grep -c "ok")" == "1" ]; then
|
2021-04-12 03:32:55 +00:00
|
|
|
echo "Nodejs is installed, skipping..."
|
|
|
|
else
|
2023-10-02 21:12:11 +00:00
|
|
|
mkdir -p /etc/apt/keyrings
|
2023-11-14 05:59:59 +00:00
|
|
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
|
|
|
|
| gpg --dearmor -o "$NODEJS_GPG_KEY"
|
|
|
|
echo "deb [signed-by=$NODEJS_GPG_KEY] https://deb.nodesource.com/node_$NODEJS_VER.x nodistro main" | \
|
|
|
|
tee /etc/apt/sources.list.d/nodesource.list
|
2024-01-23 08:46:53 +00:00
|
|
|
apt-get update -q2
|
2021-04-12 03:32:55 +00:00
|
|
|
apt-get install -yq2 nodejs
|
2023-10-02 21:12:11 +00:00
|
|
|
|
2021-04-12 03:32:55 +00:00
|
|
|
echo "Installing nodejs esprima package..."
|
|
|
|
npm install -g esprima
|
2018-10-05 15:00:57 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-09 05:45:24 +00:00
|
|
|
if [ "$(npm list -g esprima 2>/dev/null | grep -c "empty")" == "1" ]; then
|
2021-04-10 22:13:19 +00:00
|
|
|
echo "Installing nodejs esprima package..."
|
|
|
|
npm install -g esprima
|
2019-08-09 05:45:24 +00:00
|
|
|
elif [ "$(npm list -g esprima 2>/dev/null | grep -c "esprima")" == "1" ]; then
|
2021-04-10 22:13:19 +00:00
|
|
|
echo "Good. Esprima package is already installed"
|
2019-08-09 05:45:24 +00:00
|
|
|
fi
|
|
|
|
|
2018-09-25 08:25:32 +00:00
|
|
|
echo "# Installing Google Chrome / ChromeDriver"
|
2020-12-16 01:52:44 +00:00
|
|
|
if [ "$GOOGLE_ACTIVE_REPO" = "main" ]; then
|
2021-04-10 22:13:19 +00:00
|
|
|
echo "Google repository already set."
|
2018-09-25 08:25:32 +00:00
|
|
|
else
|
2021-04-10 22:13:19 +00:00
|
|
|
echo "Installing Google Chrome Stable"
|
2023-02-22 11:56:20 +00:00
|
|
|
curl -s https://dl.google.com/linux/linux_signing_key.pub | \
|
|
|
|
gpg --dearmor | tee /etc/apt/trusted.gpg.d/google-chrome-key.gpg >/dev/null
|
2022-05-12 04:53:51 +00:00
|
|
|
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee "$GOOGL_REPO"
|
2018-09-25 08:25:32 +00:00
|
|
|
fi
|
2020-04-14 16:49:11 +00:00
|
|
|
apt-get -q2 update
|
|
|
|
apt-get install -yq2 google-chrome-stable
|
2023-11-14 05:59:59 +00:00
|
|
|
rm -rf "$GOOGL_REPO"
|
2018-09-25 08:25:32 +00:00
|
|
|
|
2023-08-23 06:51:24 +00:00
|
|
|
G_CHROME=$(apt-cache madison google-chrome-stable|awk '{print$3}'|cut -d. -f1-3)
|
|
|
|
CHROMELAB_URL="https://googlechromelabs.github.io/chrome-for-testing"
|
|
|
|
CHD_LTST_DWNL=$(curl -s $CHROMELAB_URL/known-good-versions-with-downloads.json | jq -r ".versions[].downloads.chromedriver | select(. != null) | .[].url" | grep linux64 | grep "$G_CHROME" | tail -1)
|
|
|
|
CHD_LTST=$(awk -F '/' '{print$7}' <<< "$CHD_LTST_DWNL")
|
|
|
|
GCMP_JSON="/etc/opt/chrome/policies/managed/managed_policies.json"
|
|
|
|
|
2018-09-25 08:25:32 +00:00
|
|
|
if [ -f /usr/local/bin/chromedriver ]; then
|
2021-04-10 22:13:19 +00:00
|
|
|
echo "Chromedriver already installed."
|
2018-09-25 08:25:32 +00:00
|
|
|
else
|
2021-04-10 22:13:19 +00:00
|
|
|
echo "Installing Chromedriver"
|
2023-08-23 06:51:24 +00:00
|
|
|
wget -q "$CHD_LTST_DWNL" \
|
2021-04-10 22:13:19 +00:00
|
|
|
-O /tmp/chromedriver_linux64.zip
|
|
|
|
unzip -o /tmp/chromedriver_linux64.zip -d /usr/local/bin/
|
2023-08-23 06:51:24 +00:00
|
|
|
mv /usr/local/bin/chromedriver-linux64/chromedriver /usr/local/bin/chromedriver
|
2021-04-10 22:13:19 +00:00
|
|
|
chown root:root /usr/local/bin/chromedriver
|
|
|
|
chmod 0755 /usr/local/bin/chromedriver
|
2022-06-23 17:45:38 +00:00
|
|
|
rm -rf /tmp/chromedriver_linux64.zip
|
2018-09-25 08:25:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nCheck Google Software Working...\n"
|
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
|
|
|
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nRemove Chrome warning...\n"
|
2020-04-07 02:08:39 +00:00
|
|
|
mkdir -p /etc/opt/chrome/policies/managed
|
2022-05-12 04:53:51 +00:00
|
|
|
echo '{ "CommandLineFlagSecurityWarningsEnabled": false }' > "$GCMP_JSON"
|
2020-04-07 02:08:39 +00:00
|
|
|
|
2021-05-14 01:21:18 +00:00
|
|
|
## JMS system tune up
|
|
|
|
if [ "$MODE" = "debug" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
bash "$PWD"/mode/jms-stu.sh -m debug
|
2021-05-14 01:21:18 +00:00
|
|
|
else
|
2022-05-12 04:53:51 +00:00
|
|
|
bash "$PWD"/mode/jms-stu.sh
|
2021-05-14 01:21:18 +00:00
|
|
|
fi
|
|
|
|
|
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
|
2022-05-12 04:53:51 +00:00
|
|
|
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
2022-04-07 05:26:36 +00:00
|
|
|
WS_CONF="/etc/nginx/sites-available/$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)"
|
2020-12-07 17:28:28 +00:00
|
|
|
PROSODY_FILE="/etc/prosody/conf.d/$DOMAIN.cfg.lua"
|
|
|
|
PROSODY_SYS="/etc/prosody/prosody.cfg.lua"
|
|
|
|
JICOFO_SIP="/etc/jitsi/jicofo/sip-communicator.properties"
|
|
|
|
MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js"
|
|
|
|
JIBRI_CONF="/etc/jitsi/jibri/jibri.conf"
|
|
|
|
JVB2_CONF="/etc/jitsi/videobridge/config"
|
|
|
|
JVB2_SIP="/etc/jitsi/videobridge/sip-communicator.properties"
|
2022-05-12 04:53:51 +00:00
|
|
|
DIR_RECORD="/var/jbrecord"
|
2020-12-07 17:28:28 +00:00
|
|
|
REC_DIR="/home/jibri/finalize_recording.sh"
|
2018-09-25 08:25:32 +00:00
|
|
|
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-10-05 21:11:06 +00:00
|
|
|
MJS_RAND_TAIL="$(tr -dc "a-zA-Z0-9" < /dev/urandom | fold -w 4 | head -n1)"
|
|
|
|
MJS_USER="jbsync_$MJS_RAND_TAIL"
|
|
|
|
MJS_USER_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 32 | head -n1)"
|
2021-04-26 22:06:54 +00:00
|
|
|
FQDN_HOST="fqdn"
|
2021-06-28 06:39:32 +00:00
|
|
|
JIBRI_XORG_CONF="/etc/jitsi/jibri/xorg-video-dummy.conf"
|
2023-11-10 06:58:13 +00:00
|
|
|
WS_MATCH1="# ensure all static content can always be found first"
|
2024-07-06 22:14:42 +00:00
|
|
|
WS_MATCH2="external_api.js"
|
2023-11-10 06:58:13 +00:00
|
|
|
MEET_MATCH1="disable simulcast support."
|
2023-11-08 07:12:27 +00:00
|
|
|
#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
|
|
|
|
2023-11-10 06:58:13 +00:00
|
|
|
# Make sure we can rely on the match strings.
|
|
|
|
printf "> Testing match strings on config files.\n"
|
|
|
|
test_match "$WS_MATCH1" "$WS_CONF"
|
2024-07-06 22:14:42 +00:00
|
|
|
test_match "$WS_MATCH2" "$WS_CONF"
|
2023-11-10 06:58:13 +00:00
|
|
|
test_match "$MEET_MATCH1" "$MEET_CONF"
|
|
|
|
|
2020-10-05 08:45:01 +00:00
|
|
|
# Rename hostname for jitsi server
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$FQDN_HOST" != "yes" ] && [ "$FQDN_HOST" != "no" ] && [ -n "$FQDN_HOST" ]
|
2021-04-26 22:06:54 +00:00
|
|
|
do
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "> Set %s as a fqdn hostname?: (yes or no)\n" "$DOMAIN" && \
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "Leave empty to default to your current one ($(hostname -f)):$NL" -r FQDN_HOST
|
2021-04-26 22:06:54 +00:00
|
|
|
if [ "$FQDN_HOST" = "yes" ]; then
|
2022-05-20 17:25:56 +00:00
|
|
|
printf " - %s will be used as fqdn hostname, changes will show on reboot.\n\n" "$DOMAIN"
|
2021-04-26 22:06:54 +00:00
|
|
|
hostnamectl set-hostname "${DOMAIN}"
|
|
|
|
sed -i "1i ${PUBLIC_IP} ${DOMAIN}" /etc/hosts
|
|
|
|
else
|
2022-05-20 17:25:56 +00:00
|
|
|
printf " - %s will be keep.\n\n" "$(hostname -f)"
|
2021-04-26 22:06:54 +00:00
|
|
|
fi
|
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-12-13 01:14:25 +00:00
|
|
|
#Participant
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "> Do you want to translate 'Participant' to your own language?\n"
|
|
|
|
sleep .1
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "Leave empty to use the default one (English):$NL" -r L10N_PARTICIPANT
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-12-13 01:14:25 +00:00
|
|
|
#Me
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\n> Do you want to translate 'me' to your own language?
|
2020-12-13 01:14:25 +00:00
|
|
|
This must be a really small word to present one self.
|
2022-05-20 15:43:34 +00:00
|
|
|
Some suggestions might be: yo (Spanish) | je (French) | ich (German)\n"
|
|
|
|
sleep .1
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "Leave empty to use the default one (English):$NL" -r L10N_ME
|
2020-12-13 01:14:25 +00:00
|
|
|
|
2020-04-11 05:08:30 +00:00
|
|
|
#Drop unsecure TLS
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$DROP_TLS1" != "yes" ] && [ "$DROP_TLS1" != "no" ]
|
2020-04-10 22:34:39 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Do you want to drop support for unsecure protocols TLSv1.0/1.1 now: (yes or no)$NL" -r DROP_TLS1
|
2021-04-12 03:32:55 +00:00
|
|
|
if [ "$DROP_TLS1" = "no" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - TLSv1.0/1.1 will remain.\n\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
elif [ "$DROP_TLS1" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - TLSv1.0/1.1 will be dropped\n\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
fi
|
2020-04-11 05:08:30 +00:00
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-04-11 09:59:29 +00:00
|
|
|
#Brandless Mode
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$ENABLE_BLESSM" != "yes" ] && [ "$ENABLE_BLESSM" != "no" ]
|
2020-04-11 09:59:29 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Do you want to install customized \"brandless mode\"?: (yes or no)$NL" -r ENABLE_BLESSM
|
2021-04-12 03:32:55 +00:00
|
|
|
if [ "$ENABLE_BLESSM" = "no" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Brandless mode won't be set.\n\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
elif [ "$ENABLE_BLESSM" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Brandless mode will be set.\n\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
fi
|
2020-04-11 09:59:29 +00:00
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-04-12 16:14:04 +00:00
|
|
|
#Welcome Page
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$ENABLE_WELCP" != "yes" ] && [ "$ENABLE_WELCP" != "no" ]
|
2019-07-29 09:24:32 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Do you want to disable the Welcome page: (yes or no)$NL" -r ENABLE_WELCP
|
2021-04-12 03:32:55 +00:00
|
|
|
if [ "$ENABLE_WELCP" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Welcome page will be disabled.\n\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
elif [ "$ENABLE_WELCP" = "no" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Welcome page will be enabled.\n\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
fi
|
2019-07-29 09:24:32 +00:00
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2021-04-23 11:57:44 +00:00
|
|
|
#Close page
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$ENABLE_CLOCP" != "yes" ] && [ "$ENABLE_CLOCP" != "no" ]
|
2021-04-23 11:57:44 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Do you want to enable the close page on room exit: (yes or no)$NL" -r ENABLE_CLOCP
|
2021-04-23 11:57:44 +00:00
|
|
|
if [ "$ENABLE_CLOCP" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Close page will be enabled.\n\n"
|
2021-04-23 11:57:44 +00:00
|
|
|
elif [ "$ENABLE_CLOCP" = "no" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Close page will be kept disabled.\n\n"
|
2021-04-23 11:57:44 +00:00
|
|
|
fi
|
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2021-06-28 06:39:32 +00:00
|
|
|
# Set authentication method
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\n> Jitsi Meet Auth Method selection.\n"
|
2020-12-11 22:06:15 +00:00
|
|
|
PS3='Select the authentication method for your Jitsi Meet instance: '
|
|
|
|
options=("Local" "JWT" "None")
|
|
|
|
select opt in "${options[@]}"
|
2020-04-11 05:08:30 +00:00
|
|
|
do
|
2020-12-11 22:06:15 +00:00
|
|
|
case $opt in
|
|
|
|
"Local")
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\n > Users are created manually using prosodyctl,"
|
|
|
|
printf " only moderators can open a room or launch recording.\n"
|
2020-12-11 22:06:15 +00:00
|
|
|
ENABLE_SC="yes"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
"JWT")
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\n > A external app manage the token usage/creation,"
|
|
|
|
printf " like RocketChat does.\n"
|
2020-12-11 22:06:15 +00:00
|
|
|
ENABLE_JWT="yes"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
"None")
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\n > Everyone can access the room as moderators as"
|
|
|
|
printf " there is no auth mechanism.\n"
|
2020-12-11 22:06:15 +00:00
|
|
|
break
|
|
|
|
;;
|
|
|
|
*) echo "Invalid option $REPLY, choose 1, 2 or 3";;
|
|
|
|
esac
|
2020-04-11 05:08:30 +00:00
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2021-06-28 06:39:32 +00:00
|
|
|
# Set jibris default resolution
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\n> What jibri resolution should be the default for this and all"
|
|
|
|
printf " the following jibri nodes?\n"
|
2021-06-28 06:39:32 +00:00
|
|
|
PS3='The more resolution the more resources jibri will require to record properly: '
|
|
|
|
jib_res=("HD 720" "FHD 1080")
|
|
|
|
select res in "${jib_res[@]}"
|
|
|
|
do
|
|
|
|
case $res in
|
|
|
|
"HD 720")
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\n > HD (1280x720) is good enough for most cases,"
|
|
|
|
printf " and requires a moderate high hw requirements.\n\n"
|
2021-06-28 06:39:32 +00:00
|
|
|
JIBRI_RES="720"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
"FHD 1080")
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "\n > Full HD (1920x1080) is the best resolution"
|
|
|
|
printf " available, it also requires high hw requirements.\n\n"
|
2021-06-28 06:39:32 +00:00
|
|
|
JIBRI_RES="1080"
|
|
|
|
break
|
|
|
|
;;
|
2022-05-20 17:25:56 +00:00
|
|
|
*) printf "\nInvalid option «%s», choose 1 or 2\n\n" "$REPLY"
|
2022-05-20 15:43:34 +00:00
|
|
|
;;
|
2021-06-28 06:39:32 +00:00
|
|
|
esac
|
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2021-06-28 08:37:21 +00:00
|
|
|
if [ "$JIBRI_RES" = "720" ]; then
|
2021-06-28 06:39:32 +00:00
|
|
|
JIBRI_RES_CONF="\"1280x720\""
|
|
|
|
JIBRI_RES_XORG_CONF="1280 720"
|
|
|
|
fi
|
|
|
|
|
2021-06-28 08:37:21 +00:00
|
|
|
if [ "$JIBRI_RES" = "1080" ]; then
|
2021-06-28 06:39:32 +00:00
|
|
|
JIBRI_RES_CONF="\"1920x1080\""
|
|
|
|
JIBRI_RES_XORG_CONF="1920 1080"
|
|
|
|
fi
|
|
|
|
|
2020-04-12 16:14:04 +00:00
|
|
|
#Jibri Records Access (JRA) via Nextcloud
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$ENABLE_NC_ACCESS" != "yes" ] && [ "$ENABLE_NC_ACCESS" != "no" ]
|
2020-04-11 05:08:30 +00:00
|
|
|
do
|
2021-04-12 03:32:55 +00:00
|
|
|
read -p "> Do you want to setup Jibri Records Access via Nextcloud: (yes or no)
|
2023-11-07 20:42:50 +00:00
|
|
|
( Please check requirements at: https://forge.switnet.net/switnet/quick-jibri-installer )$NL" -r ENABLE_NC_ACCESS
|
2021-04-12 03:32:55 +00:00
|
|
|
if [ "$ENABLE_NC_ACCESS" = "no" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - JRA via Nextcloud won't be enabled.\n\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
elif [ "$ENABLE_NC_ACCESS" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - JRA via Nextcloud will be enabled.\n\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
fi
|
2020-04-12 16:14:04 +00:00
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2023-11-08 07:12:27 +00:00
|
|
|
##Jigasi
|
|
|
|
#if [ "$(curl -s -o /dev/null -w "%{http_code}" "$GC_SDK_REL_FILE" )" == "404" ]; then
|
|
|
|
#printf "> Sorry Google SDK doesn't have support yet for %s,
|
|
|
|
#thus, Jigasi Transcript can't be enable.\n\n" "$(lsb_release -sd)"
|
|
|
|
#elif [ "$(curl -s -o /dev/null -w "%{http_code}" "$GC_SDK_REL_FILE" )" == "200" ]; then
|
|
|
|
#while [ "$ENABLE_TRANSCRIPT" != "yes" ] && [ "$ENABLE_TRANSCRIPT" != "no" ]
|
|
|
|
#do
|
|
|
|
#read -p "> Do you want to setup Jigasi Transcription: (yes or no)
|
|
|
|
#( Please check requirements at: https://forge.switnet.net/switnet/quick-jibri-installer )$NL" -r ENABLE_TRANSCRIPT
|
|
|
|
#if [ "$ENABLE_TRANSCRIPT" = "no" ]; then
|
|
|
|
#printf " - Jigasi Transcription won't be enabled.\n\n"
|
|
|
|
#elif [ "$ENABLE_TRANSCRIPT" = "yes" ]; then
|
|
|
|
#printf " - Jigasi Transcription will be enabled.\n\n"
|
|
|
|
#fi
|
|
|
|
#done
|
|
|
|
#else
|
|
|
|
#echo "No valid option for Jigasi. Please report this to
|
|
|
|
#https://forge.switnet.net/switnet/quick-jibri-installer/issues"
|
|
|
|
#fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-07-04 12:23:24 +00:00
|
|
|
#Grafana
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$ENABLE_GRAFANA_DSH" != "yes" ] && [ "$ENABLE_GRAFANA_DSH" != "no" ]
|
2020-07-04 12:23:24 +00:00
|
|
|
do
|
|
|
|
read -p "> Do you want to setup Grafana Dashboard: (yes or no)
|
2023-11-07 20:42:50 +00:00
|
|
|
( Please check requirements at: https://forge.switnet.net/switnet/quick-jibri-installer )$NL" -r ENABLE_GRAFANA_DSH
|
2020-07-04 12:23:24 +00:00
|
|
|
if [ "$ENABLE_GRAFANA_DSH" = "no" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Grafana Dashboard won't be enabled.\n\n"
|
2020-07-04 12:23:24 +00:00
|
|
|
elif [ "$ENABLE_GRAFANA_DSH" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf " - Grafana Dashboard will be enabled.\n\n"
|
2020-07-04 12:23:24 +00:00
|
|
|
fi
|
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-08-11 07:52:48 +00:00
|
|
|
#Docker Etherpad
|
2022-05-20 15:43:34 +00:00
|
|
|
while [ "$ENABLE_DOCKERPAD" != "yes" ] && [ "$ENABLE_DOCKERPAD" != "no" ]
|
2021-05-16 21:18:51 +00:00
|
|
|
do
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "> Do you want to setup Docker Etherpad: (yes or no)$NL" -r ENABLE_DOCKERPAD
|
2021-05-16 21:18:51 +00:00
|
|
|
if [ "$ENABLE_DOCKERPAD" = "no" ]; then
|
2023-11-10 06:58:13 +00:00
|
|
|
printf " - Docker Etherpad won't be enabled.\n\n"
|
2021-05-16 21:18:51 +00:00
|
|
|
elif [ "$ENABLE_DOCKERPAD" = "yes" ]; then
|
2023-11-10 06:58:13 +00:00
|
|
|
printf " - Docker Etherpad will be enabled.\n\n"
|
2021-05-16 21:18:51 +00:00
|
|
|
fi
|
|
|
|
done
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2023-11-08 07:12:27 +00:00
|
|
|
#Excalidraw Whiteboard
|
|
|
|
while [ "$ENABLE_WHITEBOARD" != "yes" ] && [ "$ENABLE_WHITEBOARD" != "no" ]
|
|
|
|
do
|
|
|
|
read -p "> Do you want to setup Excalidraw Whiteboard backend: (yes or no)$NL" -r ENABLE_WHITEBOARD
|
|
|
|
if [ "$ENABLE_WHITEBOARD" = "no" ]; then
|
2023-11-10 06:58:13 +00:00
|
|
|
printf " - Excalidraw Whiteboard won't be enabled.\n\n"
|
2023-11-08 07:12:27 +00:00
|
|
|
elif [ "$ENABLE_WHITEBOARD" = "yes" ]; then
|
2023-11-10 06:58:13 +00:00
|
|
|
printf " - Excalidraw Whiteboard will be enabled.\n\n"
|
2023-11-08 07:12:27 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
sleep .1
|
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
|
|
|
|
2019-03-04 12:31:34 +00:00
|
|
|
ssl_wa() {
|
2021-01-28 16:34:28 +00:00
|
|
|
if [ "$LE_SSL" = "yes" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
systemctl stop "$1"
|
2023-11-07 20:42:50 +00:00
|
|
|
certbot certonly --standalone --renew-by-default --agree-tos --email "$5" -d "$6" --non-interactive
|
2022-05-12 04:53:51 +00:00
|
|
|
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"
|
|
|
|
systemctl restart "$1"
|
2021-05-06 06:08:25 +00:00
|
|
|
#Add cron
|
2022-05-12 04:53:51 +00:00
|
|
|
if [ "$(crontab -l|sed 's|#.*$||g'|grep -c 'weekly certbot renew')" = 0 ];then
|
2021-07-03 00:56:45 +00:00
|
|
|
crontab -l | { cat; echo "@weekly certbot renew --${2} > $LE_RENEW_LOG 2>&1"; } | crontab -
|
|
|
|
else
|
|
|
|
echo "Crontab seems to be already in place, skipping."
|
|
|
|
fi
|
2021-05-06 06:08:25 +00:00
|
|
|
crontab -l
|
2021-01-28 16:34:28 +00:00
|
|
|
fi
|
2019-03-04 12:31:34 +00:00
|
|
|
}
|
|
|
|
|
2018-09-25 08:25:32 +00:00
|
|
|
check_jibri() {
|
|
|
|
if [ "$(dpkg-query -W -f='${Status}' "jibri" 2>/dev/null | grep -c "ok installed")" == "1" ]
|
|
|
|
then
|
2021-04-10 22:13:19 +00:00
|
|
|
systemctl restart jibri
|
|
|
|
systemctl restart jibri-icewm
|
|
|
|
systemctl restart jibri-xorg
|
2018-09-25 08:25:32 +00:00
|
|
|
else
|
2021-04-10 22:13:19 +00:00
|
|
|
echo "Jibri service not installed"
|
2018-09-25 08:25:32 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Restarting services
|
|
|
|
restart_services() {
|
2021-04-10 22:13:19 +00:00
|
|
|
systemctl restart jitsi-videobridge2
|
|
|
|
systemctl restart jicofo
|
|
|
|
systemctl restart prosody
|
|
|
|
check_jibri
|
2018-09-25 08:25:32 +00:00
|
|
|
}
|
|
|
|
|
2020-12-07 17:28:28 +00:00
|
|
|
# Configure Jvb2
|
2023-11-10 06:58:13 +00:00
|
|
|
sed -i "/shard.HOSTNAME/s|localhost|$DOMAIN|" "$JVB2_SIP"
|
2020-12-07 17:28:28 +00:00
|
|
|
|
2020-12-17 13:24:34 +00:00
|
|
|
# Configure Jibri
|
|
|
|
if [ "$ENABLE_SC" = "yes" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
if [ ! -f "$MOD_LIST_FILE" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\n-> Adding external module to list prosody users...\n"
|
2022-05-12 04:53:51 +00:00
|
|
|
curl -s "$MOD_LISTU" > "$MOD_LIST_FILE"
|
2020-12-17 13:24:34 +00:00
|
|
|
|
2023-11-10 06:58:13 +00:00
|
|
|
printf "Now you can check registered users with:"
|
|
|
|
printf " \n prosodyctl mod_listusers\n"
|
2020-12-17 13:24:34 +00:00
|
|
|
else
|
2023-11-10 06:58:13 +00:00
|
|
|
printf "Prosody support for listing users seems to be enabled.check with:"
|
|
|
|
printf " \n prosodyctl mod_listusers\n"
|
2020-12-17 13:24:34 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-12-17 13:24:34 +00:00
|
|
|
#Enable jibri recording
|
2022-05-12 04:53:51 +00:00
|
|
|
cat << REC-JIBRI >> "$PROSODY_FILE"
|
2020-12-17 13:24:34 +00:00
|
|
|
|
|
|
|
VirtualHost "recorder.$DOMAIN"
|
|
|
|
modules_enabled = {
|
|
|
|
"ping";
|
|
|
|
}
|
2021-04-23 11:57:44 +00:00
|
|
|
authentication = "internal_hashed"
|
2020-12-17 13:24:34 +00:00
|
|
|
|
|
|
|
REC-JIBRI
|
|
|
|
|
|
|
|
#Enable Jibri withelist
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|-- muc_lobby_whitelist|muc_lobby_whitelist|" "$PROSODY_FILE"
|
2020-12-17 13:24:34 +00:00
|
|
|
|
|
|
|
#Fix Jibri conectivity issues
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|c2s_require_encryption = .*|c2s_require_encryption = false|" "$PROSODY_SYS"
|
2020-12-17 13:24:34 +00:00
|
|
|
sed -i "/c2s_require_encryption = false/a \\
|
|
|
|
\\
|
2022-05-12 04:53:51 +00:00
|
|
|
consider_bosh_secure = true" "$PROSODY_SYS"
|
2020-12-17 13:24:34 +00:00
|
|
|
|
2022-05-12 04:53:51 +00:00
|
|
|
if [ -n "$L10N_PARTICIPANT" ]; then
|
2021-04-10 22:13:19 +00:00
|
|
|
sed -i "s|PART_USER=.*|PART_USER=\"$L10N_PARTICIPANT\"|" jm-bm.sh
|
2020-04-12 16:14:04 +00:00
|
|
|
fi
|
2022-05-12 04:53:51 +00:00
|
|
|
if [ -n "$L10N_ME" ]; then
|
2021-04-10 22:13:19 +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-07 02:08:39 +00:00
|
|
|
|
|
|
|
|
2018-09-25 08:25:32 +00:00
|
|
|
### Prosody users
|
2022-05-12 04:53:51 +00:00
|
|
|
prosodyctl register jibri auth."$DOMAIN" "$JB_AUTH_PASS"
|
|
|
|
prosodyctl register recorder recorder."$DOMAIN" "$JB_REC_PASS"
|
2018-09-25 08:25:32 +00:00
|
|
|
|
|
|
|
## JICOFO
|
|
|
|
# /etc/jitsi/jicofo/sip-communicator.properties
|
2022-05-12 04:53:51 +00:00
|
|
|
cat << BREWERY >> "$JICOFO_SIP"
|
2019-04-05 06:14:57 +00:00
|
|
|
#org.jitsi.jicofo.auth.URL=XMPP:$DOMAIN
|
2020-12-16 04:44:06 +00:00
|
|
|
#org.jitsi.jicofo.auth.URL=EXT_JWT:$DOMAIN
|
2022-05-20 17:25:56 +00:00
|
|
|
org.jitsi.jicofo.jibri.BREWERY=$JibriBrewery@internal.auth.$DOMAIN
|
2018-09-25 08:25:32 +00:00
|
|
|
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
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|conference.$DOMAIN|internal.auth.$DOMAIN|" "$MEET_CONF"
|
2022-08-19 12:20:44 +00:00
|
|
|
#New recording implementation.
|
|
|
|
sed -i "s|// recordingService:|recordingService:|" "$MEET_CONF"
|
|
|
|
sed -i "/recordingService/,/hideStorageWarning/s|// enabled: false,| enabled: true,|" "$MEET_CONF"
|
|
|
|
sed -i "/hideStorageWarning: false/,/Local recording configuration/s|// },|},|" "$MEET_CONF"
|
2024-07-03 14:29:09 +00:00
|
|
|
sed -i "/fileRecordingsServiceEnabled: false,/a \\
|
|
|
|
hiddenDomain: \'recorder.$DOMAIN\'," "$MEET_CONF"
|
2018-10-05 15:00:57 +00:00
|
|
|
|
2018-09-25 08:25:32 +00:00
|
|
|
# Recording directory
|
2022-05-12 04:53:51 +00:00
|
|
|
if [ ! -d "$DIR_RECORD" ]; then
|
|
|
|
mkdir "$DIR_RECORD"
|
2020-04-30 19:43:37 +00:00
|
|
|
fi
|
2022-05-12 04:53:51 +00:00
|
|
|
chown -R jibri:jibri "$DIR_RECORD"
|
2020-04-07 02:08:39 +00:00
|
|
|
|
2022-05-12 04:53:51 +00:00
|
|
|
cat << REC_DIR > "$REC_DIR"
|
2018-09-25 08:25:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-05-12 04:53:51 +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
|
|
|
|
|
2021-01-26 21:26:38 +00:00
|
|
|
LJF_PATH="\$(find \$RECORDINGS_DIR -exec stat --printf="%Y\t%n\n" {} \; | sort -n -r|awk '{print\$2}'| grep -v "meta\|-" | head -n1)"
|
|
|
|
NJF_NAME="\$(find \$LJF_PATH |grep -e "-"|sed "s|\$LJF_PATH/||"|cut -d "." -f1)"
|
|
|
|
NJF_PATH="\$RECORDINGS_DIR/\$NJF_NAME"
|
|
|
|
mv \$LJF_PATH \$NJF_PATH
|
|
|
|
|
2018-09-25 08:25:32 +00:00
|
|
|
exit 0
|
|
|
|
REC_DIR
|
2022-05-12 04:53:51 +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)
|
2022-05-12 04:53:51 +00:00
|
|
|
mv "$JIBRI_CONF" ${JIBRI_CONF}-dpkg-file
|
2024-07-06 22:14:42 +00:00
|
|
|
cp files/jibri.conf "$JIBRI_CONF"
|
|
|
|
sed -i "s|JIBRI_RES_CONF|$JIBRI_RES_CONF|g" "$JIBRI_CONF"
|
|
|
|
sed -i "s|DIR_RECORD|$DIR_RECORD|g" "$JIBRI_CONF"
|
|
|
|
sed -i "s|REC_DIR|$REC_DIR|g" "$JIBRI_CONF"
|
|
|
|
sed -i "s|JB_NAME|$JB_NAME|g" "$JIBRI_CONF"
|
|
|
|
sed -i "s|DOMAIN|$DOMAIN|g" "$JIBRI_CONF"
|
|
|
|
sed -i "s|JibriBrewery|$JibriBrewery|g" "$JIBRI_CONF"
|
|
|
|
sed -i "s|JB_AUTH_PASS|$JB_AUTH_PASS|g" "$JIBRI_CONF"
|
|
|
|
sed -i "s|JB_REC_PASS|$JB_REC_PASS|g" "$JIBRI_CONF"
|
2021-06-28 06:39:32 +00:00
|
|
|
|
|
|
|
#Jibri xorg resolution
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|[[:space:]]Virtual .*|Virtual $JIBRI_RES_XORG_CONF|" "$JIBRI_XORG_CONF"
|
2021-06-28 06:39:32 +00:00
|
|
|
|
2020-10-05 21:11:06 +00:00
|
|
|
#Create receiver user
|
2022-05-12 04:53:51 +00:00
|
|
|
useradd -m -g jibri "$MJS_USER"
|
2020-10-05 21:11:06 +00:00
|
|
|
echo "$MJS_USER:$MJS_USER_PASS" | chpasswd
|
|
|
|
|
|
|
|
#Create ssh key and restrict connections
|
2022-05-12 04:53:51 +00:00
|
|
|
sudo su "$MJS_USER" -c "ssh-keygen -t rsa -f ~/.ssh/id_rsa -b 4096 -o -a 100 -q -N ''"
|
2020-10-07 10:13:32 +00:00
|
|
|
#Allow password authentication
|
|
|
|
sed -i "s|PasswordAuthentication .*|PasswordAuthentication yes|" /etc/ssh/sshd_config
|
|
|
|
systemctl restart sshd
|
|
|
|
|
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
|
2020-10-05 21:11:06 +00:00
|
|
|
sed -i "s|MJS_USER=.*|MJS_USER=\"$MJS_USER\"|" add-jibri-node.sh
|
|
|
|
sed -i "s|MJS_USER_PASS=.*|MJS_USER_PASS=\"$MJS_USER_PASS\"|" add-jibri-node.sh
|
2021-06-28 06:39:32 +00:00
|
|
|
sed -i "s|JIBRI_RES_CONF=.*|JIBRI_RES_CONF=\"$JIBRI_RES_CONF\"|" add-jibri-node.sh
|
|
|
|
sed -i "s|JIBRI_RES_XORG_CONF=.*|JIBRI_RES_XORG_CONF=\"$JIBRI_RES_XORG_CONF\"|" add-jibri-node.sh
|
2020-05-09 02:46:18 +00:00
|
|
|
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}')"
|
|
|
|
|
2020-12-07 17:28:28 +00:00
|
|
|
#-- Setting variables for add-jvb2-node.sh
|
|
|
|
g_conf_value() {
|
2022-05-12 04:53:51 +00:00
|
|
|
grep "$1" "$JVB2_CONF"|sed "s|$1||"
|
2020-12-07 17:28:28 +00:00
|
|
|
}
|
2020-12-07 22:58:20 +00:00
|
|
|
JVB_HOSTNAME=$(g_conf_value JVB_HOSTNAME=)
|
|
|
|
JVB_HOST=$(g_conf_value JVB_HOST=)
|
|
|
|
JVB_PORT=$(g_conf_value JVB_PORT=)
|
|
|
|
JVB_SECRET=$(g_conf_value JVB_SECRET=)
|
|
|
|
JVB_OPTS=$(g_conf_value JVB_OPTS=)
|
|
|
|
JAVA_SYS_PROPS=$(g_conf_value JAVA_SYS_PROPS=)
|
2020-12-07 17:28:28 +00:00
|
|
|
|
|
|
|
g_sip_value() {
|
2022-05-12 04:53:51 +00:00
|
|
|
grep "$1" "$JVB2_SIP" |cut -d "=" -f2
|
2020-12-07 17:28:28 +00:00
|
|
|
}
|
|
|
|
DISABLE_AWS_HARVESTER=$(g_sip_value DISABLE_AWS_HARVESTER=)
|
|
|
|
STUN_MAPPING_HARVESTER_ADDRESSES=$(g_sip_value STUN_MAPPING_HARVESTER_ADDRESSES=)
|
|
|
|
ENABLE_STATISTICS=$(g_sip_value ENABLE_STATISTICS=)
|
|
|
|
SHARD_HOSTNAME=$(g_sip_value shard.HOSTNAME=)
|
|
|
|
SHARD_DOMAIN=$(g_sip_value shard.DOMAIN=)
|
|
|
|
SHARD_PASSWORD=$(g_sip_value shard.PASSWORD=)
|
|
|
|
MUC_JID=$(g_sip_value MUC_JIDS=)
|
|
|
|
|
|
|
|
##-- Replacing on add-jvb2-node.sh
|
2020-12-11 12:09:39 +00:00
|
|
|
sed -i "s|JVB_HOSTNAME=.*|JVB_HOSTNAME=$JVB_HOSTNAME|" add-jvb2-node.sh
|
|
|
|
sed -i "s|JVB_HOST=.*|JVB_HOST=$JVB_HOST|" add-jvb2-node.sh
|
|
|
|
sed -i "s|JVB_PORT=.*|JVB_PORT=$JVB_PORT|" add-jvb2-node.sh
|
|
|
|
sed -i "s|JVB_SECRET=.*|JVB_SECRET=$JVB_SECRET|" add-jvb2-node.sh
|
|
|
|
sed -i "s|JVB_OPTS=.*|JVB_OPTS=$JVB_OPTS|" add-jvb2-node.sh
|
|
|
|
sed -i "s|SYS_PROPS=.*|SYS_PROPS=$JAVA_SYS_PROPS|" add-jvb2-node.sh
|
2020-12-07 17:28:28 +00:00
|
|
|
#-
|
2020-12-11 12:22:25 +00:00
|
|
|
sed -i "s|AWS_HARVEST=.*|AWS_HARVEST=$DISABLE_AWS_HARVESTER|" add-jvb2-node.sh
|
2020-12-11 12:09:39 +00:00
|
|
|
sed -i "s|STUN_MAPPING=.*|STUN_MAPPING=$STUN_MAPPING_HARVESTER_ADDRESSES|" add-jvb2-node.sh
|
|
|
|
sed -i "s|ENABLE_STATISTICS=.*|ENABLE_STATISTICS=$ENABLE_STATISTICS|" add-jvb2-node.sh
|
|
|
|
sed -i "s|SHARD_HOSTNAME=.*|SHARD_HOSTNAME=$SHARD_HOSTNAME|" add-jvb2-node.sh
|
|
|
|
sed -i "s|SHARD_DOMAIN=.*|SHARD_DOMAIN=$SHARD_DOMAIN|" add-jvb2-node.sh
|
|
|
|
sed -i "s|SHARD_PASS=.*|SHARD_PASS=$SHARD_PASSWORD|" add-jvb2-node.sh
|
|
|
|
sed -i "s|MUC_JID=.*|MUC_JID=$MUC_JID|" add-jvb2-node.sh
|
2020-12-07 20:47:07 +00:00
|
|
|
|
|
|
|
sed -i "s|MAIN_SRV_DIST=.*|MAIN_SRV_DIST=\"$DIST\"|" add-jvb2-node.sh
|
|
|
|
sed -i "s|MAIN_SRV_REPO=.*|MAIN_SRV_REPO=\"$JITSI_REPO\"|" add-jvb2-node.sh
|
|
|
|
sed -i "s|MAIN_SRV_DOMAIN=.*|MAIN_SRV_DOMAIN=\"$DOMAIN\"|" add-jvb2-node.sh
|
|
|
|
sed -i "s|MJS_USER=.*|MJS_USER=\"$MJS_USER\"|" add-jvb2-node.sh
|
|
|
|
sed -i "s|MJS_USER_PASS=.*|MJS_USER_PASS=\"$MJS_USER_PASS\"|" add-jvb2-node.sh
|
2020-12-07 17:28:28 +00:00
|
|
|
##--
|
|
|
|
|
2020-04-11 05:08:30 +00:00
|
|
|
#nginx -tlsv1/1.1
|
2021-05-14 01:36:10 +00:00
|
|
|
if [ "$DROP_TLS1" = "yes" ];then
|
2022-08-19 11:35:49 +00:00
|
|
|
printf "\nDropping TLSv1/1.1\n\n"
|
2021-04-10 22:13:19 +00:00
|
|
|
sed -i "s|TLSv1 TLSv1.1||" /etc/nginx/nginx.conf
|
2020-09-10 03:03:52 +00:00
|
|
|
elif [ "$DROP_TLS1" = "no" ];then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nNo TLSv1/1.1 dropping was done.\n\n"
|
2020-04-11 05:08:30 +00:00
|
|
|
else
|
2023-11-14 17:32:43 +00:00
|
|
|
echo -n "No condition meet, please report to:"
|
|
|
|
echo "https://forge.switnet.net/switnet/quick-jibri-installer/issues"
|
2020-04-10 22:34:39 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-09-05 20:22:37 +00:00
|
|
|
#================== Setup prosody conf file =================
|
2019-11-18 08:55:44 +00:00
|
|
|
|
2020-12-11 22:06:15 +00:00
|
|
|
###Setup secure rooms
|
2020-11-18 06:40:12 +00:00
|
|
|
if [ "$ENABLE_SC" = "yes" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
SRP_STR=$(grep -n "VirtualHost \"$DOMAIN\"" "$PROSODY_FILE" | awk -F ':' 'NR==1{print$1}')
|
2021-04-12 03:32:55 +00:00
|
|
|
SRP_END=$((SRP_STR + 10))
|
2022-08-19 11:35:49 +00:00
|
|
|
sed -i "$SRP_STR,$SRP_END{s|authentication = \"jitsi-anonymous\"|authentication = \"internal_hashed\"|}" "$PROSODY_FILE"
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|// anonymousdomain: 'guest.example.com'|anonymousdomain: \'guest.$DOMAIN\'|" "$MEET_CONF"
|
2021-04-12 03:32:55 +00:00
|
|
|
|
|
|
|
#Secure room initial user
|
2022-05-12 04:53:51 +00:00
|
|
|
read -p "Set username for secure room moderator:$NL" -r SEC_ROOM_USER
|
|
|
|
read -p "Secure room moderator password:$NL" -r SEC_ROOM_PASS
|
|
|
|
prosodyctl register "$SEC_ROOM_USER" "$DOMAIN" "$SEC_ROOM_PASS"
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
|
|
|
printf "\nSecure rooms are being enabled...\n"
|
2023-11-14 04:39:41 +00:00
|
|
|
echo -n "You'll be able to login Secure Room chat with '${SEC_ROOM_USER}' "
|
|
|
|
echo "or '${SEC_ROOM_USER}@${DOMAIN}' using the password you just entered."
|
|
|
|
echo "If you have issues with the password refer to your sysadmin."
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|#org.jitsi.jicofo.auth.URL=XMPP:|org.jitsi.jicofo.auth.URL=XMPP:|" "$JICOFO_SIP"
|
2021-04-12 03:32:55 +00:00
|
|
|
sed -i "s|SEC_ROOM=.*|SEC_ROOM=\"on\"|" jm-bm.sh
|
2020-11-18 06:40:12 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-12-11 22:06:15 +00:00
|
|
|
###JWT
|
2020-11-18 06:40:12 +00:00
|
|
|
if [ "$ENABLE_JWT" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nJWT auth is being setup...\n"
|
2022-05-24 04:06:58 +00:00
|
|
|
if [ "$MODE" = "debug" ]; then
|
|
|
|
bash "$PWD"/mode/jwt.sh -m debug
|
|
|
|
else
|
|
|
|
bash "$PWD"/mode/jwt.sh
|
|
|
|
fi
|
2020-11-18 06:40:12 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-11-18 06:40:12 +00:00
|
|
|
#Guest allow
|
2021-01-20 14:13:05 +00:00
|
|
|
#Change back lobby - https://community.jitsi.org/t/64769/136
|
2020-12-17 13:28:57 +00:00
|
|
|
if [ "$ENABLE_SC" = "yes" ];then
|
2022-05-12 04:53:51 +00:00
|
|
|
cat << P_SR >> "$PROSODY_FILE"
|
2021-01-20 14:13:05 +00:00
|
|
|
-- #Change back lobby - https://community.jitsi.org/t/64769/136
|
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-08-08 05:36:08 +00:00
|
|
|
main_muc = "conference.$DOMAIN"
|
2020-09-05 20:22:37 +00:00
|
|
|
|
2020-07-23 07:23:12 +00:00
|
|
|
modules_enabled = {
|
|
|
|
"speakerstats";
|
|
|
|
}
|
2020-08-08 05:36:08 +00:00
|
|
|
|
2020-07-23 07:23:12 +00:00
|
|
|
P_SR
|
|
|
|
fi
|
2020-12-17 13:28:57 +00:00
|
|
|
|
2020-08-07 22:32:16 +00:00
|
|
|
#======================
|
2021-01-05 07:11:42 +00:00
|
|
|
# Custom settings
|
2019-02-25 04:10:26 +00:00
|
|
|
#Start with video muted by default
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|// startWithVideoMuted: false,|startWithVideoMuted: true,|" "$MEET_CONF"
|
2019-02-25 04:10:26 +00:00
|
|
|
|
|
|
|
#Start with audio muted but admin
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|// startAudioMuted: 10,|startAudioMuted: 1,|" "$MEET_CONF"
|
2019-02-25 04:10:26 +00:00
|
|
|
|
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
|
2024-07-03 14:29:09 +00:00
|
|
|
sed -i "/ welcomePage: {/,/},/s|// ||" "$MEET_CONF"
|
|
|
|
sed -i "/ welcomePage: {/,/},/s|disabled: .*,|disabled: true,|" "$MEET_CONF"
|
2020-06-03 11:22:16 +00:00
|
|
|
elif [ "$ENABLE_WELCP" = "no" ]; then
|
2024-07-03 14:29:09 +00:00
|
|
|
sed -i "/ welcomePage: {/,/},/s|// ||" "$MEET_CONF"
|
|
|
|
sed -i "/ welcomePage: {/,/},/s|disabled: .*,|disabled: false,|" "$MEET_CONF"
|
2019-11-20 07:29:46 +00:00
|
|
|
fi
|
2021-04-23 11:57:44 +00:00
|
|
|
#Enable close page
|
|
|
|
if [ "$ENABLE_CLOCP" = "yes" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|.*enableClosePage:.*| enableClosePage: true,|" "$MEET_CONF"
|
2021-04-23 11:57:44 +00:00
|
|
|
elif [ "$ENABLE_CLOCP" = "no" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|.*enableClosePage:.*| enableClosePage: false,|" "$MEET_CONF"
|
2021-04-23 11:57:44 +00:00
|
|
|
fi
|
2019-02-25 06:15:25 +00:00
|
|
|
|
2021-03-11 10:20:35 +00:00
|
|
|
#Add pre-join screen by default, since it improves YouTube autoplay capabilities
|
|
|
|
#pre-join screen by itself don't require autorization by moderator, don't confuse with lobby which does.
|
2022-05-12 04:53:51 +00:00
|
|
|
sed -i "s|// prejoinPageEnabled:.*|prejoinPageEnabled: true,|" "$MEET_CONF"
|
2021-03-11 10:20:35 +00:00
|
|
|
|
2021-01-05 07:11:42 +00:00
|
|
|
#Set HD resolution and widescreen format
|
2023-11-10 06:58:13 +00:00
|
|
|
sed -i "/$MEET_MATCH1/i \/\/ Start QJI - Set resolution and widescreen format" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ resolution: 720," "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ constraints: {" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ aspectRatio: 16 \/ 9," "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ video: {" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ height: {" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ideal: 720," "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ max: 720," "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ min: 180" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ }," "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ width: {" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ideal: 1280," "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ max: 1280," "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ min: 320" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ \ \ \ \ }" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ \ \ \ \ }" "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \ \ \ \ \ }," "$MEET_CONF"
|
|
|
|
sed -i "/$MEET_MATCH1/i \/\/ End QJI" "$MEET_CONF"
|
2021-01-05 07:11:42 +00:00
|
|
|
|
|
|
|
#Check config file
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\n# Checking %s file for errors\n" "$MEET_CONF"
|
2022-05-12 04:53:51 +00:00
|
|
|
CHECKJS=$(esvalidate "$MEET_CONF"| cut -d ":" -f2)
|
2022-05-20 15:43:34 +00:00
|
|
|
if [ -z "$CHECKJS" ]; then
|
|
|
|
printf "\n# The %s configuration seems correct. =)\n" "$MEET_CONF"
|
2021-01-05 07:11:42 +00:00
|
|
|
else
|
2022-05-20 15:43:34 +00:00
|
|
|
echo -e "\nWatch out!, there seems to be an issue on $MEET_CONF line:
|
2021-01-05 07:11:42 +00:00
|
|
|
$CHECKJS
|
|
|
|
Most of the times this is due upstream changes, please report to
|
2023-11-07 20:42:50 +00:00
|
|
|
https://forge.switnet.net/switnet/quick-jibri-installer/issues\n"
|
2021-01-05 07:11:42 +00:00
|
|
|
fi
|
|
|
|
|
2018-09-25 08:25:32 +00:00
|
|
|
#Enable jibri services
|
|
|
|
systemctl enable jibri
|
|
|
|
systemctl enable jibri-xorg
|
|
|
|
systemctl enable jibri-icewm
|
|
|
|
restart_services
|
2020-10-08 15:38:39 +00:00
|
|
|
if [ "$DISABLE_LOCAL_JIBRI" = "yes" ]; then
|
|
|
|
systemctl stop jibri*
|
2020-10-11 06:26:05 +00:00
|
|
|
systemctl disable jibri
|
|
|
|
systemctl disable jibri-xorg
|
|
|
|
systemctl disable jibri-icewm
|
2023-11-14 04:39:41 +00:00
|
|
|
# Manually apply permissions since finalize_recording.sh won't be
|
|
|
|
# triggered under this server options.
|
2022-05-12 04:53:51 +00:00
|
|
|
chmod -R 770 "$DIR_RECORD"
|
2020-10-08 15:38:39 +00:00
|
|
|
fi
|
2018-09-25 08:25:32 +00:00
|
|
|
|
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
|
2022-05-12 04:53:51 +00:00
|
|
|
ssl_wa nginx nginx "$DOMAIN" "$WS_CONF" "$SYSADMIN_EMAIL" "$DOMAIN"
|
2021-04-10 22:13:19 +00:00
|
|
|
install_ifnot python3-certbot-nginx
|
2019-04-02 05:15:11 +00:00
|
|
|
else
|
2021-04-10 22:13:19 +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
|
2021-04-10 22:13:19 +00:00
|
|
|
echo "Custom brandless mode will be enabled."
|
|
|
|
sed -i "s|ENABLE_BLESSM=.*|ENABLE_BLESSM=\"on\"|" jitsi-updater.sh
|
2022-05-24 04:06:58 +00:00
|
|
|
if [ "$MODE" = "debug" ]; then
|
|
|
|
bash "$PWD"/jm-bm.sh -m debug
|
|
|
|
else
|
|
|
|
bash "$PWD"/jm-bm.sh
|
|
|
|
fi
|
2020-04-11 09:59:29 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
|
2020-09-10 03:03:52 +00:00
|
|
|
# Applying best practives for interface config.js
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\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
|
2022-05-12 04:53:51 +00:00
|
|
|
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"
|
2021-04-10 22:13:19 +00:00
|
|
|
systemctl reload nginx
|
2020-09-10 03:03:52 +00:00
|
|
|
else
|
2023-11-14 05:59:59 +00:00
|
|
|
printf "No interface_config.js configuration done to server file,"
|
|
|
|
printf " please report to:"
|
2023-11-14 17:32:43 +00:00
|
|
|
printf " -> https://forge.switnet.net/switnet/quick-jibri-installer/issues"
|
2020-09-10 03:03:52 +00:00
|
|
|
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
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nJRA via Nextcloud will be enabled."
|
2021-04-10 22:13:19 +00:00
|
|
|
if [ "$MODE" = "debug" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
bash "$PWD"/jra_nextcloud.sh -m debug
|
2021-04-10 22:13:19 +00:00
|
|
|
else
|
2022-05-12 04:53:51 +00:00
|
|
|
bash "$PWD"/jra_nextcloud.sh
|
2021-04-10 22:13:19 +00:00
|
|
|
fi
|
2020-04-11 07:19:54 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2022-05-20 23:21:28 +00:00
|
|
|
|
2020-07-04 12:23:24 +00:00
|
|
|
#Grafana Dashboard
|
|
|
|
if [ "$ENABLE_GRAFANA_DSH" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nGrafana Dashboard will be enabled."
|
2021-04-10 22:13:19 +00:00
|
|
|
if [ "$MODE" = "debug" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
bash "$PWD"/grafana.sh -m debug
|
2021-04-10 22:13:19 +00:00
|
|
|
else
|
2022-05-12 04:53:51 +00:00
|
|
|
bash "$PWD"/grafana.sh
|
2021-04-10 22:13:19 +00:00
|
|
|
fi
|
2020-07-04 12:23:24 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2020-08-11 07:52:48 +00:00
|
|
|
#Docker Etherpad
|
|
|
|
if [ "$ENABLE_DOCKERPAD" = "yes" ]; then
|
2022-05-20 15:43:34 +00:00
|
|
|
printf "\nDocker Etherpad will be enabled."
|
2021-04-10 22:13:19 +00:00
|
|
|
if [ "$MODE" = "debug" ]; then
|
2022-05-12 04:53:51 +00:00
|
|
|
bash "$PWD"/etherpad-docker.sh -m debug
|
2021-04-10 22:13:19 +00:00
|
|
|
else
|
2022-05-12 04:53:51 +00:00
|
|
|
bash "$PWD"/etherpad-docker.sh
|
2021-04-10 22:13:19 +00:00
|
|
|
fi
|
2020-08-11 07:52:48 +00:00
|
|
|
fi
|
2022-05-20 15:43:34 +00:00
|
|
|
sleep .1
|
2023-11-08 07:12:27 +00:00
|
|
|
#Excalidraw Whiteboard
|
|
|
|
if [ "$ENABLE_WHITEBOARD" = "yes" ]; then
|
|
|
|
printf "\nExcalidraw Whiteboard will be enabled."
|
|
|
|
if [ "$MODE" = "debug" ]; then
|
|
|
|
bash "$PWD"/excalidraw-backend.sh -m debug
|
|
|
|
else
|
|
|
|
bash "$PWD"/excalidraw-backend.sh
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
sleep .1
|
2021-05-06 20:17:11 +00:00
|
|
|
#Prevent JMS conecction issue
|
|
|
|
if [ -z "$(awk "/127.0.0.1/&&/$DOMAIN/{print\$1}" /etc/hosts)" ];then
|
2021-04-10 22:13:19 +00:00
|
|
|
sed -i "/127.0.0.1/a \\
|
2020-04-07 02:08:39 +00:00
|
|
|
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
|
|
|
|
2020-10-07 03:29:13 +00:00
|
|
|
check_snd_driver
|
|
|
|
|
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
|