Compare commits

..

No commits in common. "a943997ea96e521f68d24da7429388d05f8141fd" and "079ddfde03c0e07959b8feb2057e5f4fe742bf3c" have entirely different histories.

2 changed files with 147 additions and 197 deletions

View File

@ -26,31 +26,6 @@ printwc "${Blue}" "\n#--------------------------------------------------"
printwc "${Blue}" "\n# $1" printwc "${Blue}" "\n# $1"
printwc "${Blue}" "\n#--------------------------------------------------\n" printwc "${Blue}" "\n#--------------------------------------------------\n"
} }
restart_jibri() {
if [ "$(dpkg-query -W -f='${Status}' "jibri" 2>/dev/null | grep -c "ok installed")" == "1" ]
then
systemctl restart jibri
systemctl restart jibri-icewm
systemctl restart jibri-xorg
else
echo "Jibri service not installed"
fi
}
restart_services() {
systemctl restart jitsi-videobridge2
systemctl restart jicofo
restart_jibri
systemctl restart prosody
}
test_match() {
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
}
while getopts m: option while getopts m: option
do do
@ -86,12 +61,23 @@ WS_MATCH1='# ensure all static content can always be found first'
PROS_MATCH1='"av_moderation";' PROS_MATCH1='"av_moderation";'
PROS_MATCH2='breakout_rooms_muc = "breakout.' PROS_MATCH2='breakout_rooms_muc = "breakout.'
PROS_MATCH3='VirtualHost "recorder.' PROS_MATCH3='VirtualHost "recorder.'
CONFIG_MATCH1='List of undocumented settings used in jitsi-meet' CONFIG_MATCH1='Settings for the GIPHY integration'
EXCALIDRAW_HOME="/opt/excalidraw" EXCALIDRAW_HOME="/opt/excalidraw"
EXCAL_MATCH1="prometheus.metrics(io" EXCAL_MATCH1="prometheus.metrics(io"
EXCAL_NEW_PORT="9091" EXCAL_NEW_PORT="9091"
EXCAL_PORT_FILE="$EXCALIDRAW_HOME/backend/src/index.ts" EXCAL_PORT_FILE="$EXCALIDRAW_HOME/backend/src/index.ts"
# Test for matches
test_match() {
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
}
# Make sure we can rely on the match strings. # Make sure we can rely on the match strings.
printf "Testing match strings on config files.\n" printf "Testing match strings on config files.\n"
test_match "$WS_MATCH1" "$WS_CONF" test_match "$WS_MATCH1" "$WS_CONF"
@ -114,14 +100,14 @@ sudo -u excalidraw cp .env.development .env.production
# Use documented port to get some sort of standarization. # Use documented port to get some sort of standarization.
if sed -n "/$EXCAL_MATCH1/,/});/p" "$EXCAL_PORT_FILE" |grep -q port: ; then if sed -n "/$EXCAL_MATCH1/,/});/p" "$EXCAL_PORT_FILE" |grep -q port: ; then
echo -e "> Update predefined port for metrics to $EXCAL_NEW_PORT\n" echo "> Update predefined port for metrics to $EXCAL_NEW_PORT\n"
sed -i "/$EXCAL_MATCH1/,/});/s|port:.*,|port: $EXCAL_NEW_PORT,|" "$EXCAL_PORT_FILE" sed -i "/$EXCAL_MATCH1/,/});/s|port:.*,|port: $EXCAL_NEW_PORT,|" "$EXCAL_PORT_FILE"
else else
echo -e "> Define new port from default to $EXCAL_NEW_PORT\n" echo "> Define new port from default to $EXCAL_NEW_PORT\n"
sed -i "/$EXCAL_MATCH1/a \ \ \ \ port: $EXCAL_NEW_PORT," "$EXCAL_PORT_FILE" sed -i "/$EXCAL_MATCH1/a \ \ \ \ port: $EXCAL_NEW_PORT," "$EXCAL_PORT_FILE"
fi fi
printf "Installing npm backend.\n" printf "\nInstalling npm backend.\n"
sudo -u excalidraw npm install sudo -u excalidraw npm install
sudo -u excalidraw npm run build sudo -u excalidraw npm run build
@ -156,7 +142,7 @@ else
sed -i "/$PROS_MATCH3/i \\\n" "$PROSODY_FILE" sed -i "/$PROS_MATCH3/i \\\n" "$PROSODY_FILE"
fi fi
printf "\n# Checking for whitebord setup at %s.\n" "$(basename "$MEET_CONF")" printf "\n# Checking for whitebord setup at $(basename "$MEET_CONF").\n"
if [ -z "$(sed -n '/whiteboard: {/,/},/p' "$MEET_CONF")" ]; then if [ -z "$(sed -n '/whiteboard: {/,/},/p' "$MEET_CONF")" ]; then
echo "> No present configuration on current config.js file" echo "> No present configuration on current config.js file"
sed -i "/$CONFIG_MATCH1/i \\\n" "$MEET_CONF" sed -i "/$CONFIG_MATCH1/i \\\n" "$MEET_CONF"
@ -205,4 +191,3 @@ systemctl enable excalidraw.service
systemctl start excalidraw.service systemctl start excalidraw.service
printwc "${Green}" "\nExcalidraw setup complete!\n" printwc "${Green}" "\nExcalidraw setup complete!\n"
restart_services

View File

@ -38,25 +38,20 @@ DIST=$(lsb_release -sc)
GOOGL_REPO="/etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list" GOOGL_REPO="/etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list"
GOOGLE_ACTIVE_REPO=$(apt-cache policy | awk '/chrome/{print$3}' | awk -F "/" 'NR==1{print$2}') GOOGLE_ACTIVE_REPO=$(apt-cache policy | awk '/chrome/{print$3}' | awk -F "/" 'NR==1{print$2}')
PROSODY_REPO="$(apt-cache policy | awk '/prosody/{print$3}' | awk -F "/" 'NR==1{print$2}')" PROSODY_REPO="$(apt-cache policy | awk '/prosody/{print$3}' | awk -F "/" 'NR==1{print$2}')"
PUBLIC_IP="$(dig -4 +short myip.opendns.com @resolver1.opendns.com)" PUBLIC_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)"
NL="$(printf '\n ')" NL="$(printf '\n ')"
NODEJS_VER="18" NODEJS_VER="18"
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)"
printwc() { printwc() {
printf "%b$2%b" "$1" "${Color_Off}" printf "%b$2%b" "$1" "${Color_Off}"
} }
exit_ifinstalled() { exit_ifinstalled() {
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then 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 "
echo -e "Please try again on a clean system." This instance already has $1 installed, exiting...
echo -e " If you think this is an error, please report to:" Please try again on a clean system.
echo -e " -> https://forge.switnet.net/switnet/quick-jibri-installer/issues" If you think this is an error, please report to:
-> https://forge.switnet.net/switnet/quick-jibri-installer/issues"
exit exit
fi fi
} }
@ -81,10 +76,14 @@ install_ifnot() {
} }
check_serv() { check_serv() {
if [ "$APACHE_2" -eq 1 ]; then if [ "$APACHE_2" -eq 1 ]; then
echo -e "\nThe recommended setup is using NGINX, exiting...\n" echo "
The recommended setup is using NGINX, exiting...
"
exit exit
elif [ "$NGINX" -eq 1 ]; then elif [ "$NGINX" -eq 1 ]; then
printf "\nWebserver already installed!\n" printf "\nWebserver already installed!\n"
else else
printf "\nInstalling nginx webserver!\n" printf "\nInstalling nginx webserver!\n"
install_ifnot nginx install_ifnot nginx
@ -95,14 +94,16 @@ check_snd_driver() {
echo "snd-aloop" | tee -a /etc/modules echo "snd-aloop" | tee -a /etc/modules
modprobe snd-aloop modprobe snd-aloop
if [ "$(lsmod|awk '/snd_aloop/{print$1}'|awk 'NR==1')" = "snd_aloop" ]; then if [ "$(lsmod|awk '/snd_aloop/{print$1}'|awk 'NR==1')" = "snd_aloop" ]; then
echo -e "\n#-----------------------------------------------------------------------" echo "
echo "# Audio driver seems - OK." #-----------------------------------------------------------------------
echo -e "#-----------------------------------------------------------------------\n" # Audio driver seems - OK.
#-----------------------------------------------------------------------"
else else
echo -e "\n#-----------------------------------------------------------------------" echo "
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." # Your audio driver might not be able to load.
echo -e "#-----------------------------------------------------------------------\n" # We'll check the state of this Jibri with our 'test-jibri-env.sh' tool.
#-----------------------------------------------------------------------"
#Test tool #Test tool
if [ "$MODE" = "debug" ]; then if [ "$MODE" = "debug" ]; then
bash "$PWD"/tools/test-jibri-env.sh -m debug bash "$PWD"/tools/test-jibri-env.sh -m debug
@ -116,21 +117,13 @@ check_snd_driver() {
var_dlim() { var_dlim() {
grep -n "$1" add-jibri-node.sh|head -n1|cut -d ":" -f1 grep -n "$1" add-jibri-node.sh|head -n1|cut -d ":" -f1
} }
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/
}
add_prosody_repo() { add_prosody_repo() {
echo "Add Prosody repo" echo "Add Prosody repo"
if [ "$PROSODY_REPO" = "main" ]; then if [ "$PROSODY_REPO" = "main" ]; then
echo "Prosody repository already installed" echo "Prosody repository already installed"
else else
echo "deb [signed-by=$PROSODY_GPG_KEY] http://packages.prosody.im/debian $DIST main" \ echo "deb [signed-by=/etc/apt/trusted.gpg.d/prosody-debian-packages.key] http://packages.prosody.im/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/prosody.list
> /etc/apt/sources.list.d/prosody.list curl -s https://prosody.im/files/prosody-debian-packages.key > /etc/apt/trusted.gpg.d/prosody-debian-packages.key
curl -s https://prosody.im/files/prosody-debian-packages.key \
> "$PROSODY_GPG_KEY"
fi fi
} }
dpkg-compare() { dpkg-compare() {
@ -177,7 +170,7 @@ Featuring:
Learn more about these at, Learn more about these at,
Main repository: https://forge.switnet.net/switnet/quick-jibri-installer Main repository: https://forge.switnet.net/switnet/quick-jibri-installer
Wiki and documentation: https://forge.switnet.net/switnet/quick-jibri-installer/wiki\n\n' Wiki and documentation: https://forge.switnet.net/switnet/quick-jibri-installer/wiki\n\n'
sleep .1
read -n 1 -s -r -p "Press any key to continue..."$'\n' read -n 1 -s -r -p "Press any key to continue..."$'\n'
#Check if user is root #Check if user is root
@ -195,11 +188,13 @@ else
exit exit
fi fi
#Suggest 22.04 LTS release over 20.04 in April 2024 #Suggest 22.04 LTS release over 20.04 in April 2024
TODAY=$(date +%s)
NEXT_LTS_DATE=$(date -d 2024-04-01 +%s)
if [ "$DIST" = "focal" ]; then if [ "$DIST" = "focal" ]; then
if [ "$TODAY" -gt "$NEXT_LTS_DATE" ]; then if [ "$TODAY" -gt "$NEXT_LTS_DATE" ]; then
echo " > $(lsb_release -sc), even when it's compatible and functional." echo " > $(lsb_release -sc), even when it's compatible and functional.
echo -n " We suggest to use the next (LTS) release, for longer" We suggest to use the next (LTS) release, for longer support and security reasons."
echo " support and security reasons."
read -n 1 -s -r -p "Press any key to continue..."$'\n' read -n 1 -s -r -p "Press any key to continue..."$'\n'
else else
echo "Focal is supported." echo "Focal is supported."
@ -209,8 +204,7 @@ fi
#Check system resources #Check system resources
printf "\n\nVerifying System Resources:" printf "\n\nVerifying System Resources:"
if [ "$(nproc --all)" -lt 4 ];then if [ "$(nproc --all)" -lt 4 ];then
printf "\nWarning!: The system do not meet the minimum CPU" printf "\nWarning!: The system do not meet the minimum CPU requirements for Jibri to run."
printf " requirements for Jibri to run."
printf "\n>> We recommend 4 cores/threads for Jibri!\n" printf "\n>> We recommend 4 cores/threads for Jibri!\n"
CPU_MIN="N" CPU_MIN="N"
else else
@ -221,8 +215,7 @@ sleep .1
### Test RAM size (8GB min) ### ### Test RAM size (8GB min) ###
mem_available="$(grep MemTotal /proc/meminfo| grep -o '[0-9]\+')" mem_available="$(grep MemTotal /proc/meminfo| grep -o '[0-9]\+')"
if [ "$mem_available" -lt 7700000 ]; then if [ "$mem_available" -lt 7700000 ]; then
printf "\nWarning!: The system do not meet the minimum RAM" printf "\nWarning!: The system do not meet the minimum RAM requirements for Jibri to run."
printf " requirements for Jibri to run."
printf "\n>> We recommend 8GB RAM for Jibri!\n\n" printf "\n>> We recommend 8GB RAM for Jibri!\n\n"
MEM_MIN="N" MEM_MIN="N"
else else
@ -234,10 +227,8 @@ if [ "$CPU_MIN" = "Y" ] && [ "$MEM_MIN" = "Y" ];then
echo "All requirements seems meet!" echo "All requirements seems meet!"
printf "\n - We hope you have a nice recording/streaming session\n" printf "\n - We hope you have a nice recording/streaming session\n"
else else
printf "CPU (%s)/RAM (%s MiB)" "$(nproc --all)" "$((mem_available/1024))" printf "CPU (%s)/RAM (%s MiB) does NOT meet minimum recommended requirements!" "$(nproc --all)" "$((mem_available/1024))"
printf " does NOT meet minimum recommended requirements!" printf "\nEven when you can use the videoconferencing sessions, we advice to increase the resources in order to user Jibri.\n\n"
printf "\nEven when you can use the videoconferencing sessions, we"
printf " advice to increase the resources in order to user Jibri.\n\n"
sleep .1 sleep .1
while [ "$CONTINUE_LOW_RES" != "yes" ] && [ "$CONTINUE_LOW_RES" != "no" ] while [ "$CONTINUE_LOW_RES" != "yes" ] && [ "$CONTINUE_LOW_RES" != "no" ]
do do
@ -247,8 +238,7 @@ sleep .1
exit exit
elif [ "$CONTINUE_LOW_RES" = "yes" ]; then elif [ "$CONTINUE_LOW_RES" = "yes" ]; then
printf "\n - We highly recommend to increase the server resources." printf "\n - We highly recommend to increase the server resources."
printf "\n - Otherwise, please think about adding dedicated" printf "\n - Otherwise, please think about adding dedicated jibri nodes instead.\n\n"
printf " jibri nodes instead.\n\n"
fi fi
done done
fi fi
@ -276,32 +266,27 @@ sleep .1
do do
read -p "> Do you want to disable local jibri service?: (yes or no)$NL" -r DISABLE_LOCAL_JIBRI read -p "> Do you want to disable local jibri service?: (yes or no)$NL" -r DISABLE_LOCAL_JIBRI
if [ "$DISABLE_LOCAL_JIBRI" = "no" ]; then if [ "$DISABLE_LOCAL_JIBRI" = "no" ]; then
printf " - Please keep in mind that we might not support" printf " - Please keep in mind that we might not support underpowered servers.\n"
printf " underpowered servers.\n"
elif [ "$DISABLE_LOCAL_JIBRI" = "yes" ]; then elif [ "$DISABLE_LOCAL_JIBRI" = "yes" ]; then
printf " - You can add dedicated jibri nodes later, see more" printf " - You can add dedicated jibri nodes later, see more at the wiki.\n"
printf " at the wiki.\n"
fi fi
done done
fi fi
sleep .1 sleep .1
#Check system oriented porpuse #Check system oriented porpuse
apt-get -q2 update apt-get -yq2 update
SYSTEM_DE="$(apt-cache search "ubuntu-(desktop|mate-desktop)"|awk '{print$1}'|xargs|sed 's|$| trisquel triskel trisquel-mini|')" SYSTEM_DE="$(apt-cache search "ubuntu-(desktop|mate-desktop)"|awk '{print$1}'|xargs|sed 's|$| trisquel triskel trisquel-mini|')"
SYSTEM_DE_ARRAY=( "$SYSTEM_DE" ) SYSTEM_DE_ARRAY=( "$SYSTEM_DE" )
printf "\nChecking for common desktop system oriented purpose....\n" printf "\nChecking for common desktop system oriented purpose....\n"
for de in "${SYSTEM_DE_ARRAY[@]}" for de in "${SYSTEM_DE_ARRAY[@]}"
do do
if [ "$(dpkg-query -W -f='${Status}' "$de" 2>/dev/null | grep -c "ok installed")" == "1" ]; then if [ "$(dpkg-query -W -f='${Status}' "$de" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
printf "\n > This instance has %s installed, exiting...\n" "$de" printf "\n > This instance has %s installed, exiting...
printf "\nPlease avoid using this installer on a desktop-user" \nPlease avoid using this installer on a desktop-user oriented GNU/Linux system.
printf " oriented GNU/Linux system.\n" This is an unsupported use, as it will likely BREAK YOUR SYSTEM, so please don't." "$de"
printf "This is an unsupported use, as it will likely BREAK YOUR"
printf " SYSTEM, so please don't.\n"
exit exit
else else
printf " > No standard desktop environment for user oriented" printf " > No standard desktop environment for user oriented porpuse detected, good!, continuing...\n\n"
printf " porpuse detected, good!, continuing...\n\n"
fi fi
done done
sleep .1 sleep .1
@ -313,10 +298,8 @@ printf "\nAdd Jitsi repo\n"
if [ "$JITSI_REPO" = "stable" ]; then if [ "$JITSI_REPO" = "stable" ]; then
printf " - Jitsi stable repository already installed\n\n" printf " - Jitsi stable repository already installed\n\n"
else else
echo "deb [signed-by=$JITSI_GPG_KEY] http://download.jitsi.org stable/" \ echo 'deb [signed-by=/etc/apt/trusted.gpg.d/jitsi-key.gpg.key] http://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list
> /etc/apt/sources.list.d/jitsi-stable.list curl -s https://download.jitsi.org/jitsi-key.gpg.key > /etc/apt/trusted.gpg.d/jitsi-key.gpg.key
curl -s https://download.jitsi.org/jitsi-key.gpg.key \
> "$JITSI_GPG_KEY"
JITSI_REPO="stable" JITSI_REPO="stable"
fi fi
sleep .1 sleep .1
@ -328,8 +311,7 @@ if [ "$LE_SSL" = yes ]; then
printf " - We'll setup Let's Encrypt SSL certs.\n\n" printf " - We'll setup Let's Encrypt SSL certs.\n\n"
else else
printf " - We'll let you choose later on for it." printf " - We'll let you choose later on for it."
printf " Please be aware that a valid SSL cert is required for" printf " Please be aware that a valid SSL cert is required for some features to work properly.\n\n"
printf " some features to work properly.\n\n"
fi fi
done done
sleep .1 sleep .1
@ -356,13 +338,10 @@ sleep .1
sleep .1 sleep .1
#Simple DNS test #Simple DNS test
if [ "$PUBLIC_IP" = "$(dig -4 +short "$JITSI_DOMAIN"||awk -v RS='([0-9]+\\.){3}[0-9]+' 'RT{print RT}')" ]; then if [ "$PUBLIC_IP" = "$(dig -4 +short "$JITSI_DOMAIN"||awk -v RS='([0-9]+\\.){3}[0-9]+' 'RT{print RT}')" ]; then
printf "\nServer public IP & DNS record for" printf "\nServer public IP & DNS record for %s seems to match, continuing..." "$JITSI_DOMAIN"
printf " %s seems to match, continuing..." "$JITSI_DOMAIN"
else else
echo -n "Server public IP ($PUBLIC_IP) & DNS record for $JITSI_DOMAIN" echo "Server public IP ($PUBLIC_IP) & DNS record for $JITSI_DOMAIN don't seem to match."
echo " don't seem to match." echo " > Please check your dns records are applied and updated, otherwise components may fail."
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 read -p " > Do you want to continue?: (yes or no)$NL" -r DNS_CONTINUE
if [ "$DNS_CONTINUE" = "yes" ]; then if [ "$DNS_CONTINUE" = "yes" ]; then
echo " - We'll continue anyway..." echo " - We'll continue anyway..."
@ -374,8 +353,8 @@ sleep .1
fi fi
sleep .1 sleep .1
# Requirements # Requirements
printf "\nWe'll start by installing system requirements this may take" printf "\nWe'll start by installing system requirements this may take a while please be patient...\n"
printf " a while please be patient...\n" apt-get update -q2
apt-get dist-upgrade -yq2 apt-get dist-upgrade -yq2
apt-get -y install \ apt-get -y install \
@ -396,15 +375,14 @@ if [ "$LE_SSL" = "yes" ]; then
apt-get -y install \ apt-get -y install \
certbot certbot
if [ "$(dpkg-query -W -f='${Status}' ufw 2>/dev/null | grep -c "ok installed")" == "1" ]; then if [ "$(dpkg-query -W -f='${Status}' ufw 2>/dev/null | grep -c "ok installed")" == "1" ]; then
echo "# Disable pre-installed ufw, more on firewall see:" echo "# Disable pre-installed ufw, more on firewall see:
echo " > https://forge.switnet.net/switnet/quick-jibri-installer/wiki/Firewall" > https://forge.switnet.net/switnet/quick-jibri-installer/wiki/Firewall"
ufw disable ufw disable
fi fi
fi fi
echo "# Check and Install HWE kernel if possible..." echo "# Check and Install HWE kernel if possible..."
HWE_VIR_MOD="$(apt-cache madison linux-image-generic-hwe-"$(lsb_release -sr)" \ HWE_VIR_MOD="$(apt-cache madison linux-image-generic-hwe-"$(lsb_release -sr)" 2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)")"
2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)")"
if [ "$HWE_VIR_MOD" = "1" ]; then if [ "$HWE_VIR_MOD" = "1" ]; then
apt-get -y install \ apt-get -y install \
linux-image-generic-hwe-"$(lsb_release -sr)" \ linux-image-generic-hwe-"$(lsb_release -sr)" \
@ -423,15 +401,11 @@ echo "
#-------------------------------------------------- #--------------------------------------------------
" "
if [ "$LE_SSL" = "yes" ]; then if [ "$LE_SSL" = "yes" ]; then
echo "set jitsi-meet/cert-choice select $CERT_CHOICE_DEBCONF" \ 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
| debconf-set-selections echo "jitsi-videobridge2 jitsi-videobridge/jvb-hostname string $JITSI_DOMAIN" | debconf-set-selections
echo "jitsi-videobridge2 jitsi-videobridge/jvb-hostname string $JITSI_DOMAIN" \ echo "jitsi-meet-web-config jitsi-meet/email string $SYSADMIN_EMAIL" | debconf-set-selections
| debconf-set-selections
echo "jitsi-meet-web-config jitsi-meet/email string $SYSADMIN_EMAIL" \
| debconf-set-selections
fi fi
echo "jitsi-meet-web-config jitsi-meet/jaas-choice boolean false" \ echo "jitsi-meet-web-config jitsi-meet/jaas-choice boolean false" | debconf-set-selections
| debconf-set-selections
apt-get -y install \ apt-get -y install \
jitsi-meet \ jitsi-meet \
jibri \ jibri \
@ -448,9 +422,8 @@ if [ "$(dpkg-query -W -f='${Status}' nodejs 2>/dev/null | grep -c "ok")" == "1"
echo "Nodejs is installed, skipping..." echo "Nodejs is installed, skipping..."
else else
mkdir -p /etc/apt/keyrings mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
| gpg --dearmor -o "$NODEJS_GPG_KEY" echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODEJS_VER.x nodistro main" | \
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 tee /etc/apt/sources.list.d/nodesource.list
apt-get update -yq2 apt-get update -yq2
apt-get install -yq2 nodejs apt-get install -yq2 nodejs
@ -477,7 +450,7 @@ else
fi fi
apt-get -q2 update apt-get -q2 update
apt-get install -yq2 google-chrome-stable apt-get install -yq2 google-chrome-stable
rm -rf "$GOOGL_REPO" rm -rf /etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list
G_CHROME=$(apt-cache madison google-chrome-stable|awk '{print$3}'|cut -d. -f1-3) G_CHROME=$(apt-cache madison google-chrome-stable|awk '{print$3}'|cut -d. -f1-3)
CHROMELAB_URL="https://googlechromelabs.github.io/chrome-for-testing" CHROMELAB_URL="https://googlechromelabs.github.io/chrome-for-testing"
@ -641,20 +614,17 @@ select opt in "${options[@]}"
do do
case $opt in case $opt in
"Local") "Local")
printf "\n > Users are created manually using prosodyctl," printf "\n > Users are created manually using prosodyctl, only moderators can open a room or launch recording.\n"
printf " only moderators can open a room or launch recording.\n"
ENABLE_SC="yes" ENABLE_SC="yes"
break break
;; ;;
"JWT") "JWT")
printf "\n > A external app manage the token usage/creation," printf "\n > A external app manage the token usage/creation, like RocketChat does.\n"
printf " like RocketChat does.\n"
ENABLE_JWT="yes" ENABLE_JWT="yes"
break break
;; ;;
"None") "None")
printf "\n > Everyone can access the room as moderators as" printf "\n > Everyone can access the room as moderators as there is no auth mechanism.\n"
printf " there is no auth mechanism.\n"
break break
;; ;;
*) echo "Invalid option $REPLY, choose 1, 2 or 3";; *) echo "Invalid option $REPLY, choose 1, 2 or 3";;
@ -662,22 +632,19 @@ do
done done
sleep .1 sleep .1
# Set jibris default resolution # Set jibris default resolution
printf "\n> What jibri resolution should be the default for this and all" printf "\n> What jibri resolution should be the default for this and all the following jibri nodes?\n"
printf " the following jibri nodes?\n"
PS3='The more resolution the more resources jibri will require to record properly: ' PS3='The more resolution the more resources jibri will require to record properly: '
jib_res=("HD 720" "FHD 1080") jib_res=("HD 720" "FHD 1080")
select res in "${jib_res[@]}" select res in "${jib_res[@]}"
do do
case $res in case $res in
"HD 720") "HD 720")
printf "\n > HD (1280x720) is good enough for most cases," printf "\n > HD (1280x720) is good enough for most cases, and requires a moderate high hw requirements.\n\n"
printf " and requires a moderate high hw requirements.\n\n"
JIBRI_RES="720" JIBRI_RES="720"
break break
;; ;;
"FHD 1080") "FHD 1080")
printf "\n > Full HD (1920x1080) is the best resolution" printf "\n > Full HD (1920x1080) is the best resolution available, it also requires high hw requirements.\n\n"
printf " available, it also requires high hw requirements.\n\n"
JIBRI_RES="1080" JIBRI_RES="1080"
break break
;; ;;
@ -1111,8 +1078,8 @@ if [ -f "$WS_CONF" ]; then
sed -i "/$WS_MATCH1/i \\\n" "$WS_CONF" sed -i "/$WS_MATCH1/i \\\n" "$WS_CONF"
systemctl reload nginx systemctl reload nginx
else else
echo "No app configuration done to server file, please report to:" echo "No app configuration done to server file, please report to:
echo " -> https://forge.switnet.net/switnet/quick-jibri-installer/issues" -> https://forge.switnet.net/switnet/quick-jibri-installer/issues"
fi fi
#Static avatar #Static avatar
if [ "$ENABLE_SA" = "yes" ] && [ -f "$WS_CONF" ]; then if [ "$ENABLE_SA" = "yes" ] && [ -f "$WS_CONF" ]; then
@ -1131,8 +1098,8 @@ if [ "$DROP_TLS1" = "yes" ];then
elif [ "$DROP_TLS1" = "no" ];then elif [ "$DROP_TLS1" = "no" ];then
printf "\nNo TLSv1/1.1 dropping was done.\n\n" printf "\nNo TLSv1/1.1 dropping was done.\n\n"
else else
echo -n "No condition meet, please report to:" echo "No condition meet, please report to
echo "https://forge.switnet.net/switnet/quick-jibri-installer/issues" https://forge.switnet.net/switnet/quick-jibri-installer/issues "
fi fi
sleep .1 sleep .1
#================== Setup prosody conf file ================= #================== Setup prosody conf file =================
@ -1150,9 +1117,9 @@ if [ "$ENABLE_SC" = "yes" ]; then
prosodyctl register "$SEC_ROOM_USER" "$DOMAIN" "$SEC_ROOM_PASS" prosodyctl register "$SEC_ROOM_USER" "$DOMAIN" "$SEC_ROOM_PASS"
sleep .1 sleep .1
printf "\nSecure rooms are being enabled...\n" printf "\nSecure rooms are being enabled...\n"
echo -n "You'll be able to login Secure Room chat with '${SEC_ROOM_USER}' " echo "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." or '${SEC_ROOM_USER}@${DOMAIN}' using the password you just entered.
echo "If you have issues with the password refer to your sysadmin." If you have issues with the password refer to your sysadmin."
sed -i "s|#org.jitsi.jicofo.auth.URL=XMPP:|org.jitsi.jicofo.auth.URL=XMPP:|" "$JICOFO_SIP" sed -i "s|#org.jitsi.jicofo.auth.URL=XMPP:|org.jitsi.jicofo.auth.URL=XMPP:|" "$JICOFO_SIP"
sed -i "s|SEC_ROOM=.*|SEC_ROOM=\"on\"|" jm-bm.sh sed -i "s|SEC_ROOM=.*|SEC_ROOM=\"on\"|" jm-bm.sh
fi fi
@ -1252,8 +1219,7 @@ if [ "$DISABLE_LOCAL_JIBRI" = "yes" ]; then
systemctl disable jibri systemctl disable jibri
systemctl disable jibri-xorg systemctl disable jibri-xorg
systemctl disable jibri-icewm systemctl disable jibri-icewm
# Manually apply permissions since finalize_recording.sh won't be # Manually apply permissions since finalize_recording.sh won't be triggered under this server options.
# triggered under this server options.
chmod -R 770 "$DIR_RECORD" chmod -R 770 "$DIR_RECORD"
fi fi
@ -1292,9 +1258,8 @@ if [ -f "$WS_CONF" ]; then
sed -i "/external_api.js/i \\\n" "$WS_CONF" sed -i "/external_api.js/i \\\n" "$WS_CONF"
systemctl reload nginx systemctl reload nginx
else else
printf "No interface_config.js configuration done to server file," echo "No interface_config.js configuration done to server file, please report to:
printf " please report to:" -> https://forge.switnet.net/switnet/quick-jibri-installer/issues"
printf " -> https://forge.switnet.net/switnet/quick-jibri-installer/issues"
fi fi
#JRA via Nextcloud #JRA via Nextcloud
if [ "$ENABLE_NC_ACCESS" = "yes" ]; then if [ "$ENABLE_NC_ACCESS" = "yes" ]; then