From 98b0361fcf8e4efa687b9b354ae5fc1c1e06091e Mon Sep 17 00:00:00 2001 From: gabrc52 Date: Mon, 9 Nov 2020 13:08:37 -0600 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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