From 98b0361fcf8e4efa687b9b354ae5fc1c1e06091e Mon Sep 17 00:00:00 2001 From: gabrc52 Date: Mon, 9 Nov 2020 13:08:37 -0600 Subject: [PATCH 01/11] Correct script file name in README The README suggests running a script called `quick-jibri-installer.sh`, but it doesn't exist. What exists is `quick_jibri_installer.sh`. I've also added `sudo` since it asks for root permissions. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 111df8b..6886f99 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Login into your clean server, clone git repository and run the installer, ``` git clone https://github.com/switnet-ltd/quick-jibri-installer cd quick-jibri-installer -bash quick-jibri-installer.sh +sudo bash quick_jibri_installer.sh ``` ### Add Jibri node -- 2.34.1 From 6c23e67632fa413e9c640d084eb15d6b0b2dbec2 Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Wed, 12 May 2021 13:40:20 -0500 Subject: [PATCH 02/11] Create FUNDING.yml --- .github/FUNDING.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..611be71 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +custom: ["https://www.paypal.me/switnet", switnet.net] -- 2.34.1 From 777bdea36af207b075a31820f7c36a9752867260 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Fri, 4 Jun 2021 04:53:51 -0500 Subject: [PATCH 03/11] Update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8498125..5a041c3 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ git clone https://github.com/switnet-ltd/quick-jibri-installer cd quick-jibri-installer sudo bash quick_jibri_installer.sh ``` +![QJI - Setup](https://raw.githubusercontent.com/wiki/switnet-ltd/quick-jibri-installer/images/qji-diagram-setup.png) + If your server meet the necessary resources, then at the end on the installer you should have a working Jitsi Meet Server along with a Jibri server ready to record. Additional jibris need to be set on separate servers, only necesary on simultaneous recordings for that please use add-jibri-node.sh. -- 2.34.1 From 6719c0ee7073d15f8966fcb4003acf74335a1ad0 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Thu, 7 Apr 2022 00:26:36 -0500 Subject: [PATCH 04/11] Use the original file, instead of overwrite the symlink. --- quick_jibri_installer.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index 0b9548b..dd077f7 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -341,7 +341,8 @@ if [ "$LE_SSL" = "yes" ]; then apt-get -y install \ letsencrypt if [ "$(dpkg-query -W -f='${Status}' ufw 2>/dev/null | grep -c "ok installed")" == "1" ]; then - echo "# Disable pre-installed ufw to allow ssl challenges validation." + echo "# Disable pre-installed ufw, more on firewall see: + > https://github.com/switnet-ltd/quick-jibri-installer/wiki/Firewall" ufw disable fi fi @@ -451,8 +452,8 @@ echo ' ######################################################################## ' # MEET / JIBRI SETUP -DOMAIN="$(ls /etc/prosody/conf.d/ | awk -F'.cfg' '!/localhost/{print $1}' | awk '!NF || !seen[$0]++')" -WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf" +DOMAIN="$(find /etc/prosody/conf.d/ -name *.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" +WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf" 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)" PROSODY_FILE="/etc/prosody/conf.d/$DOMAIN.cfg.lua" -- 2.34.1 From 44e9a98b76c65a0c861eae2d857a2d6cf9a6e78e Mon Sep 17 00:00:00 2001 From: Ark74 Date: Thu, 7 Apr 2022 00:29:06 -0500 Subject: [PATCH 05/11] Fix typo and increase countdown. --- tools/start-over.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/start-over.sh b/tools/start-over.sh index 0cdc991..4db729f 100644 --- a/tools/start-over.sh +++ b/tools/start-over.sh @@ -79,8 +79,8 @@ if [ "$CONTINUE_PURGE2" = "no" ]; then echo " Good, see you next time..." exit elif [ "$CONTINUE_PURGE2" = "yes" ]; then - echo "No going back, lets start..." - wait_seconds 5 + echo "No going back, let's start..." + wait_seconds 10 fi done -- 2.34.1 From 14fceeec6b1246041f7b5d3d268cf0c498665aa4 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Thu, 7 Apr 2022 02:50:22 -0500 Subject: [PATCH 06/11] Add tool for grub setup. --- tools/aws-grub-setup.sh | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 tools/aws-grub-setup.sh diff --git a/tools/aws-grub-setup.sh b/tools/aws-grub-setup.sh new file mode 100644 index 0000000..712423f --- /dev/null +++ b/tools/aws-grub-setup.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# Automated AWS generic kernel setup for jibri. +# SwITNet Ltd © - 2022, https://switnet.net/ +# GPLv3 or later. + +#### +# NOTE: Only use this script if you know what you are doing. +# Under your own risk. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY. +#### +wait_seconds() { +secs=$(($1)) +while [ $secs -gt 0 ]; do + echo -ne "$secs\033[0K\r" + sleep 1 + : $((secs--)) +done +} + +TMP_DIR="$(mktemp -d)" +KERNEL_LOG="$TMP_DIR/kernel_log" +GRUB_FILE="/etc/default/grub" + +echo "# Check and update HWE kernel if possible..." +apt-get -q2 update +HWE_VIR_MOD=$(apt-cache madison linux-image-generic-hwe-$(lsb_release -sr) 2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)") +if [ "$HWE_VIR_MOD" = "1" ]; then + apt-get -y install \ + linux-image-generic-hwe-$(lsb_release -sr) \ + linux-tools-generic-hwe-$(lsb_release -sr) +else + apt-get -y install \ + linux-image-generic \ + linux-modules-extra-$(uname -r) +fi +apt-get -y autoremove +apt-get autoclean + +#Write update-grub output +update-grub > $KERNEL_LOG 2>&1 + +#Get clean output +cat $KERNEL_LOG | awk -F'boot/' '{print$2}'|sed '/^[[:space:]]*$/d' | \ +tee ${KERNEL_LOG}.tmp +mv ${KERNEL_LOG}.tmp $KERNEL_LOG + +echo "Check if AWS kernel is installed." +[ $(grep -wc aws $KERNEL_LOG) = 0 ] && echo "No AWS kernel found, exiting..." && exit + +#Get kernel number +RAW_KERNEL_NUM="$(grep -Fn generic $KERNEL_LOG|head -n1|cut -d ':' -f1)" +FIXED_KERNEL_NUM="$(awk "BEGIN{ print $RAW_KERNEL_NUM - 1 }")" + +#Set up grub kernel number. +sed -i "s|GRUB_DEFAULT=.*|GRUB_DEFAULT=\"1\>$FIXED_KERNEL_NUM\"|" $GRUB_FILE + +update-grub + +echo "Time to reboot..." +echo "Rebooting in..." +wait_seconds 15 +reboot -- 2.34.1 From 7d162f8ade2d7ff22c196f03b1788ce0296a2196 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Thu, 7 Apr 2022 02:52:08 -0500 Subject: [PATCH 07/11] Require to run with sudo. --- tools/aws-grub-setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/aws-grub-setup.sh b/tools/aws-grub-setup.sh index 712423f..36e4291 100644 --- a/tools/aws-grub-setup.sh +++ b/tools/aws-grub-setup.sh @@ -18,6 +18,13 @@ while [ $secs -gt 0 ]; do done } +# Check if user is root +if [ $(id -u) = 0 ]; then + echo "Please don't run with root or sudo privileges! + > We'll request them when necessary." + exit 1 +fi + TMP_DIR="$(mktemp -d)" KERNEL_LOG="$TMP_DIR/kernel_log" GRUB_FILE="/etc/default/grub" -- 2.34.1 From 3acc41dc7f9ab6982666c5e045c2ae64af4ad959 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Thu, 7 Apr 2022 02:55:00 -0500 Subject: [PATCH 08/11] Actually require to run with admin rights. --- tools/aws-grub-setup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/aws-grub-setup.sh b/tools/aws-grub-setup.sh index 36e4291..ae83045 100644 --- a/tools/aws-grub-setup.sh +++ b/tools/aws-grub-setup.sh @@ -19,10 +19,9 @@ done } # Check if user is root -if [ $(id -u) = 0 ]; then - echo "Please don't run with root or sudo privileges! - > We'll request them when necessary." - exit 1 +if [ $UID != 0 ]; then + echo You need to run this script as root or sudo rights! + exit 1 fi TMP_DIR="$(mktemp -d)" -- 2.34.1 From 6c071098d56ed9b384e3c2639ebe6b09a0c135bb Mon Sep 17 00:00:00 2001 From: Ark74 Date: Thu, 7 Apr 2022 03:01:08 -0500 Subject: [PATCH 09/11] Improve comments. --- tools/aws-grub-setup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/aws-grub-setup.sh b/tools/aws-grub-setup.sh index ae83045..409bb4a 100644 --- a/tools/aws-grub-setup.sh +++ b/tools/aws-grub-setup.sh @@ -28,7 +28,7 @@ TMP_DIR="$(mktemp -d)" KERNEL_LOG="$TMP_DIR/kernel_log" GRUB_FILE="/etc/default/grub" -echo "# Check and update HWE kernel if possible..." +echo -e "# Check and update HWE kernel if possible...\n" apt-get -q2 update HWE_VIR_MOD=$(apt-cache madison linux-image-generic-hwe-$(lsb_release -sr) 2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)") if [ "$HWE_VIR_MOD" = "1" ]; then @@ -51,16 +51,17 @@ cat $KERNEL_LOG | awk -F'boot/' '{print$2}'|sed '/^[[:space:]]*$/d' | \ tee ${KERNEL_LOG}.tmp mv ${KERNEL_LOG}.tmp $KERNEL_LOG -echo "Check if AWS kernel is installed." +echo -e "Check if AWS kernel is installed.\n" [ $(grep -wc aws $KERNEL_LOG) = 0 ] && echo "No AWS kernel found, exiting..." && exit #Get kernel number RAW_KERNEL_NUM="$(grep -Fn generic $KERNEL_LOG|head -n1|cut -d ':' -f1)" FIXED_KERNEL_NUM="$(awk "BEGIN{ print $RAW_KERNEL_NUM - 1 }")" -#Set up grub kernel number. +echo -e "Set up GRUB for custom kernel.\n" sed -i "s|GRUB_DEFAULT=.*|GRUB_DEFAULT=\"1\>$FIXED_KERNEL_NUM\"|" $GRUB_FILE +echo -e "Saving changes...\n" update-grub echo "Time to reboot..." -- 2.34.1 From 299c288813822062c9d69343a4bb0181cce57ae3 Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Thu, 7 Apr 2022 03:48:52 -0500 Subject: [PATCH 10/11] 6.4.4 * Use the original file, instead of overwrite the symlink. * Fix typo and increase countdown. * Add tool for grub setup. --- quick_jibri_installer.sh | 7 ++-- tools/aws-grub-setup.sh | 70 ++++++++++++++++++++++++++++++++++++++++ tools/start-over.sh | 4 +-- 3 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 tools/aws-grub-setup.sh diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index 0b9548b..dd077f7 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -341,7 +341,8 @@ if [ "$LE_SSL" = "yes" ]; then apt-get -y install \ letsencrypt if [ "$(dpkg-query -W -f='${Status}' ufw 2>/dev/null | grep -c "ok installed")" == "1" ]; then - echo "# Disable pre-installed ufw to allow ssl challenges validation." + echo "# Disable pre-installed ufw, more on firewall see: + > https://github.com/switnet-ltd/quick-jibri-installer/wiki/Firewall" ufw disable fi fi @@ -451,8 +452,8 @@ echo ' ######################################################################## ' # MEET / JIBRI SETUP -DOMAIN="$(ls /etc/prosody/conf.d/ | awk -F'.cfg' '!/localhost/{print $1}' | awk '!NF || !seen[$0]++')" -WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf" +DOMAIN="$(find /etc/prosody/conf.d/ -name *.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" +WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf" 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)" PROSODY_FILE="/etc/prosody/conf.d/$DOMAIN.cfg.lua" diff --git a/tools/aws-grub-setup.sh b/tools/aws-grub-setup.sh new file mode 100644 index 0000000..409bb4a --- /dev/null +++ b/tools/aws-grub-setup.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# Automated AWS generic kernel setup for jibri. +# SwITNet Ltd © - 2022, https://switnet.net/ +# GPLv3 or later. + +#### +# NOTE: Only use this script if you know what you are doing. +# Under your own risk. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY. +#### +wait_seconds() { +secs=$(($1)) +while [ $secs -gt 0 ]; do + echo -ne "$secs\033[0K\r" + sleep 1 + : $((secs--)) +done +} + +# Check if user is root +if [ $UID != 0 ]; then + echo You need to run this script as root or sudo rights! + exit 1 +fi + +TMP_DIR="$(mktemp -d)" +KERNEL_LOG="$TMP_DIR/kernel_log" +GRUB_FILE="/etc/default/grub" + +echo -e "# Check and update HWE kernel if possible...\n" +apt-get -q2 update +HWE_VIR_MOD=$(apt-cache madison linux-image-generic-hwe-$(lsb_release -sr) 2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)") +if [ "$HWE_VIR_MOD" = "1" ]; then + apt-get -y install \ + linux-image-generic-hwe-$(lsb_release -sr) \ + linux-tools-generic-hwe-$(lsb_release -sr) +else + apt-get -y install \ + linux-image-generic \ + linux-modules-extra-$(uname -r) +fi +apt-get -y autoremove +apt-get autoclean + +#Write update-grub output +update-grub > $KERNEL_LOG 2>&1 + +#Get clean output +cat $KERNEL_LOG | awk -F'boot/' '{print$2}'|sed '/^[[:space:]]*$/d' | \ +tee ${KERNEL_LOG}.tmp +mv ${KERNEL_LOG}.tmp $KERNEL_LOG + +echo -e "Check if AWS kernel is installed.\n" +[ $(grep -wc aws $KERNEL_LOG) = 0 ] && echo "No AWS kernel found, exiting..." && exit + +#Get kernel number +RAW_KERNEL_NUM="$(grep -Fn generic $KERNEL_LOG|head -n1|cut -d ':' -f1)" +FIXED_KERNEL_NUM="$(awk "BEGIN{ print $RAW_KERNEL_NUM - 1 }")" + +echo -e "Set up GRUB for custom kernel.\n" +sed -i "s|GRUB_DEFAULT=.*|GRUB_DEFAULT=\"1\>$FIXED_KERNEL_NUM\"|" $GRUB_FILE + +echo -e "Saving changes...\n" +update-grub + +echo "Time to reboot..." +echo "Rebooting in..." +wait_seconds 15 +reboot diff --git a/tools/start-over.sh b/tools/start-over.sh index 0cdc991..4db729f 100644 --- a/tools/start-over.sh +++ b/tools/start-over.sh @@ -79,8 +79,8 @@ if [ "$CONTINUE_PURGE2" = "no" ]; then echo " Good, see you next time..." exit elif [ "$CONTINUE_PURGE2" = "yes" ]; then - echo "No going back, lets start..." - wait_seconds 5 + echo "No going back, let's start..." + wait_seconds 10 fi done -- 2.34.1 From ef5374f68c42e6cf7f6ed141e072469e4f0a384e Mon Sep 17 00:00:00 2001 From: Ark74 Date: Tue, 12 Apr 2022 23:11:59 -0500 Subject: [PATCH 11/11] Actually apply changes to nginx conf instead of symlink. --- etherpad-docker.sh | 2 +- grafana.sh | 2 +- jra_nextcloud.sh | 4 ++-- mode/chp-mode.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/etherpad-docker.sh b/etherpad-docker.sh index 5fabaac..c9568ff 100644 --- a/etherpad-docker.sh +++ b/etherpad-docker.sh @@ -44,7 +44,7 @@ fi } DOMAIN="$(ls /etc/prosody/conf.d/ | awk -F'.cfg' '!/localhost/{print $1}' | awk '!NF || !seen[$0]++')" MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js" -WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf" +WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf" PSGVER="$(apt-cache madison postgresql|awk -F'[ +]' 'NR==1{print $3}')" ETHERPAD_DB_USER="dockerpad" ETHERPAD_DB_NAME="etherpad" diff --git a/grafana.sh b/grafana.sh index 852d6fb..093b4db 100644 --- a/grafana.sh +++ b/grafana.sh @@ -47,7 +47,7 @@ MAIN_TEL="/etc/telegraf/telegraf.conf" TEL_JIT="/etc/telegraf/telegraf.d/jitsi.conf" GRAFANA_INI="/etc/grafana/grafana.ini" DOMAIN="$(ls /etc/prosody/conf.d/ | awk -F'.cfg' '!/localhost/{print $1}' | awk '!NF || !seen[$0]++')" -WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf" +WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf" GRAFANA_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 14 | head -n1)" # Min requirements diff --git a/jra_nextcloud.sh b/jra_nextcloud.sh index d7c8ce5..a366440 100644 --- a/jra_nextcloud.sh +++ b/jra_nextcloud.sh @@ -45,7 +45,7 @@ PSGVER="$(apt-cache madison postgresql|awk -F'[ +]' 'NR==1{print $3}')" PHP_FPM_DIR="/etc/php/$PHPVER/fpm" PHP_INI="$PHP_FPM_DIR/php.ini" PHP_CONF="/etc/php/$PHPVER/fpm/pool.d/www.conf" -NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-enabled/$DOMAIN.conf | awk '{print$2}')" +NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-available/$DOMAIN.conf | awk '{print$2}')" NC_REPO="https://download.nextcloud.com/server/releases" NCVERSION="$(curl -s -m 900 $NC_REPO/ | sed --silent 's/.*href="nextcloud-\([^"]\+\).zip.asc".*/\1/p' | sort --version-sort | tail -1)" STABLEVERSION="nextcloud-$NCVERSION" @@ -419,7 +419,7 @@ NC_NGINX systemctl stop nginx letsencrypt certonly --standalone --renew-by-default --agree-tos -d $NC_DOMAIN if [ -f /etc/letsencrypt/live/$NC_DOMAIN/fullchain.pem ];then - ln -s $NC_NGINX_CONF /etc/nginx/sites-enabled/ + ln -s $NC_NGINX_CONF /etc/nginx/sites-available/ else echo "There are issues on getting the SSL certs..." read -n 1 -s -r -p "Press any key to continue" diff --git a/mode/chp-mode.sh b/mode/chp-mode.sh index 7c4b760..d2e6dde 100644 --- a/mode/chp-mode.sh +++ b/mode/chp-mode.sh @@ -53,7 +53,7 @@ MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js" MEET_CONF_HP="/etc/jitsi/meet/${DOMAIN}-chp-config.js" INT_CONF_JS="/etc/jitsi/meet/${DOMAIN}-interface_config.js" INT_CONF_JS_HP="/etc/jitsi/meet/${DOMAIN}-chp-interface_config.js" -WS_CONF="/etc/nginx/sites-enabled/$DOMAIN.conf" +WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf" FSTAB="/etc/fstab" CHAT_DISABLED="TBD" -- 2.34.1