From dd0de86c714f9721028700a90dde871e354a0c9a Mon Sep 17 00:00:00 2001 From: Ark74 Date: Tue, 15 Nov 2022 02:56:26 -0600 Subject: [PATCH 01/15] changelog: add changelog --- changelog | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..17c6eac --- /dev/null +++ b/changelog @@ -0,0 +1,76 @@ +quick-jibri-installer (7.0.6) + + * jitsi-updater.sh: fix jitsi repo package update filtering. + +-- Software, IT & Networks Fri Sep 30 04:04:31 2022 -0500 + +quick-jibri-installer (7.0.5) + + * quick_jibri_installer.sh: use new setup to enable local recording feature. + +-- Software, IT & Networks Fri Aug 19 07:23:41 2022 -0500 + +quick-jibri-installer (7.0.4) + + * quick_jibri_installer.sh,jwt.sh: update anonymous string on prosody setup. + -fix small format issues. + +-- Software, IT & Networks Fri Aug 19 06:47:21 2022 -0500 + +quick-jibri-installer (7.0.3) + + * jitsi-updater: fix condition to set turn config. + * quick-jibri-installer: fix typo on path. + +-- Software, IT & Networks Thu Jun 30 09:57:12 2022 -0500 + +quick-jibri-installer (7.0.2) + + * Detect jibri node by jitsi-updater. + +-- Software, IT & Networks Fri Jun 17 16:36:15 2022 -0500 + +quick-jibri-installer (7.0.1) + + * Fix debug mode on triggered scripts. + * Fix grep condition. + +-- Software, IT & Networks Mon May 23 23:17:39 2022 -0500 + +quick-jibri-installer (7.0) + + * Major rework, comply with shellcheck + + ## Add + * Add experimental tool for AWS grub setup. + + ## Fix + * Fix grafana configuration + * Actually apply changes to nginx conf instead of symlink. + * Actually require to run with admin rights. + * Improve comments. + * Rename and fix set_once function. + * Fix jibri domain. + + ## Improve + * Comply mode section with shellcheck recommendations. + * Comply tools section with shellcheck recommendations. + * Comply main scripts with shellcheck recommendations. + * Improve shell quality + * Change JDK version to 11 + * Make warning visible. + * Change email position, and small fixes + * Several indenting changes + * Set warning instead of "note". + * Yet again more fixes on echo and printf + * Standarize jra_nextcloud + * Add comment on debconf state + * Update SwITNet copyright and standarize debug option for scripts. + + ## Remove + * Rename deprecated scripts folder + * Remove old + * Remove unused code + * Finally remove jigasi deprecated script. + +-- Software, IT & Networks Fri May 20 20:07:02 2022 -0500 -- 2.34.1 From b67dda5efac7b34438ef495ab57322c7bed52d79 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Tue, 15 Nov 2022 02:58:25 -0600 Subject: [PATCH 02/15] bump version 7.0.8 --- changelog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/changelog b/changelog index 17c6eac..29fcc08 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,17 @@ +quick-jibri-installer (7.0.8) + + * jitsi-updater.sh: add checks for openjdk and nodejs supported versions + * add-jibri-node.sh: set openjdk-jre-headless default version to 11 + * changelog: add changelog + +-- Software, IT & Networks Tue Nov 15 02:56:26 2022 -0600 + +quick-jibri-installer (7.0.7) + + * quick_jibri_installer.sh: fix jaas & acme integration + +-- Software, IT & Networks Sun Oct 23 23:52:23 2022 -0500 + quick-jibri-installer (7.0.6) * jitsi-updater.sh: fix jitsi repo package update filtering. -- 2.34.1 From 18e4b5ca407c154a03f9aa1f37276fc0276ce293 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 22 Feb 2023 03:44:44 -0600 Subject: [PATCH 03/15] quick_jibri_installer.sh: increase support to 22.04 fix key agregation and remove deprecated letsencrypt ppa --- quick_jibri_installer.sh | 62 ++++++++++------------------------------ 1 file changed, 15 insertions(+), 47 deletions(-) diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index 4b3efa4..e952dee 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -108,8 +108,8 @@ echo "Add Prosody repo" if [ "$PROSODY_REPO" = "main" ]; then echo "Prosody repository already installed" else - echo "deb http://packages.prosody.im/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/prosody.list - wget -qO - https://prosody.im/files/prosody-debian-packages.key | apt-key add - + 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 + curl -s https://prosody.im/files/prosody-debian-packages.key > /etc/apt/trusted.gpg.d/prosody-debian-packages.key fi } dpkg-compare() { @@ -150,24 +150,24 @@ if ! [ "$(id -u)" = 0 ]; then fi printf "\nOS: %s" "$(lsb_release -sd)" -if [ "$DIST" = "bionic" ] || \ - [ "$DIST" = "focal" ]; then +if [ "$DIST" = "focal" ] || \ + [ "$DIST" = "jammy" ]; then printf "\nGood, this is a supported platform!" else printf "\nSorry, this platform is not supported... exiting" exit fi -#Suggest 20.04 LTS release over 18.04 in April 2022 +#Suggest 22.04 LTS release over 20.04 in April 2024 TODAY=$(date +%s) -NEXT_LTS_DATE=$(date -d 2022-04-01 +%s) +NEXT_LTS_DATE=$(date -d 2024-04-01 +%s) -if [ "$DIST" = "bionic" ]; then +if [ "$DIST" = "focal" ]; then if [ "$TODAY" -gt "$NEXT_LTS_DATE" ]; then echo " > $(lsb_release -sc), even when it's compatible and functional. We suggest to use the next (LTS) release, for longer support and security reasons." read -n 1 -s -r -p "Press any key to continue..."$'\n' else - echo "Bionic is supported." + echo "Focal is supported." fi fi @@ -266,8 +266,8 @@ printf "\nAdd Jitsi repo\n" if [ "$JITSI_REPO" = "stable" ]; then printf " - Jitsi stable repository already installed\n\n" else - echo 'deb http://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list - wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add - + 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 + curl -s https://download.jitsi.org/jitsi-key.gpg.key > /etc/apt/trusted.gpg.d/jitsi-key.gpg.key JITSI_REPO="stable" fi sleep .1 @@ -279,7 +279,7 @@ if [ "$LE_SSL" = yes ]; then printf " - We'll setup Let's Encrypt SSL certs.\n\n" else printf " - We'll let you choose later on for it." - printf" Please be aware that a valid SSL cert is required for some features to work properly.\n\n" + printf " Please be aware that a valid SSL cert is required for some features to work properly.\n\n" fi done sleep .1 @@ -341,7 +341,7 @@ apt-get -y install \ if [ "$LE_SSL" = "yes" ]; then apt-get -y install \ - letsencrypt + certbot 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: > https://github.com/switnet-ltd/quick-jibri-installer/wiki/Firewall" @@ -412,7 +412,8 @@ if [ "$GOOGLE_ACTIVE_REPO" = "main" ]; then echo "Google repository already set." else echo "Installing Google Chrome Stable" - wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - + 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 echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee "$GOOGL_REPO" fi apt-get -q2 update @@ -470,8 +471,6 @@ LE_RENEW_LOG="/var/log/letsencrypt/renew.log" MOD_LISTU="https://prosody.im/files/mod_listusers.lua" MOD_LIST_FILE="/usr/lib/prosody/modules/mod_listusers.lua" ENABLE_SA="yes" -CERTBOT_REPO="$(apt-cache policy | awk '/certbot/{print$2}' | awk -F '/' 'NR==1{print$4}')" -CERTBOT_REL_FILE="http://ppa.launchpad.net/certbot/certbot/ubuntu/dists/$(lsb_release -sc)/Release" GC_SDK_REL_FILE="http://packages.cloud.google.com/apt/dists/cloud-sdk-$(lsb_release -sc)/Release" MJS_RAND_TAIL="$(tr -dc "a-zA-Z0-9" < /dev/urandom | fold -w 4 | head -n1)" MJS_USER="jbsync_$MJS_RAND_TAIL" @@ -686,7 +685,7 @@ INT_CONF_ETC="/etc/jitsi/meet/$DOMAIN-interface_config.js" ssl_wa() { if [ "$LE_SSL" = "yes" ]; then systemctl stop "$1" - letsencrypt certonly --standalone --renew-by-default --agree-tos --email "$5" -d "$6" + certbot certonly --standalone --renew-by-default --agree-tos --email "$5" -d "$6" sed -i "s|/etc/jitsi/meet/$3.crt|/etc/letsencrypt/live/$3/fullchain.pem|" "$4" sed -i "s|/etc/jitsi/meet/$3.key|/etc/letsencrypt/live/$3/privkey.pem|" "$4" systemctl restart "$1" @@ -700,35 +699,6 @@ if [ "$LE_SSL" = "yes" ]; then fi } -enable_letsencrypt() { -if [ "$LE_SSL" = "yes" ]; then - echo ' -#-------------------------------------------------- -# Starting LetsEncrypt configuration -#-------------------------------------------------- -' -#Disabled 'til fixed upstream -#bash /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh - - echo "#Set and upgrade certbot PPA if posssible..." - if [ "$CERTBOT_REPO" = "certbot" ]; then - printf "\nCertbot repository already on the system!\nChecking for updates...\n" - apt-get -q2 update - apt-get -yq2 dist-upgrade - elif [ "$(curl -s -o /dev/null -w "%{http_code}" "$CERTBOT_REL_FILE" )" == "200" ]; then - printf "\nAdding cerbot (formerly letsencrypt) PPA repository for latest updates\n" - echo "deb http://ppa.launchpad.net/certbot/certbot/ubuntu $DIST main" > /etc/apt/sources.list.d/certbot.list - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 75BCA694 - apt-get -q2 update - apt-get -yq2 dist-upgrade - elif [ "$(curl -s -o /dev/null -w "%{http_code}" "$CERTBOT_REL_FILE" )" == "404" ]; then - printf "\nCertbot PPA is not available for %s just yet, it won't be installed...\n" "$(lsb_release -sc)" - fi -else - echo "SSL setup will be skipped." -fi -} - check_jibri() { if [ "$(dpkg-query -W -f='${Status}' "jibri" 2>/dev/null | grep -c "ok installed")" == "1" ] then @@ -1194,8 +1164,6 @@ if [ "$DISABLE_LOCAL_JIBRI" = "yes" ]; then chmod -R 770 "$DIR_RECORD" fi -enable_letsencrypt - # Fix prosody not able to read SSL Certs chown -R root:prosody /etc/prosody/certs/ chmod -R 650 /etc/prosody/certs/ -- 2.34.1 From 89f03fdbe4c33142f23077aa147ca21101f6c034 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 22 Feb 2023 03:50:59 -0600 Subject: [PATCH 04/15] etherpad-docker.sh: fix key agregation and variable collection. --- etherpad-docker.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etherpad-docker.sh b/etherpad-docker.sh index e78be9c..72999d1 100644 --- a/etherpad-docker.sh +++ b/etherpad-docker.sh @@ -45,7 +45,7 @@ fi DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js" WS_CONF="/etc/nginx/sites-available/$DOMAIN.conf" -PSGVER="$(apt-cache madison postgresql|awk -F'[ +]' 'NR==1{print $3}')" +PSGVER="$(apt-cache madison postgresql|tr -d '[:blank:]'|awk -F'[|+]' 'NR==1{print $2}')" ETHERPAD_DB_USER="dockerpad" ETHERPAD_DB_NAME="etherpad" ETHERPAD_DB_PASS="$(tr -dc "a-zA-Z0-9#*=" < /dev/urandom | fold -w 10 | head -n1)" @@ -56,7 +56,8 @@ if [ "$DOCKER_CE_REPO" = "stable" ]; then echo "Docker repository already installed" else echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker-ce.list - wget -qO - https://download.docker.com/linux/ubuntu/gpg | apt-key add - + wget -qO - https://download.docker.com/linux/ubuntu/gpg | \ + gpg --dearmor | tee /etc/apt/trusted.gpg.d/docker-gpg-key.gpg >/dev/null apt -q2 update fi -- 2.34.1 From 1b016ffb6811ec1d5daeb25cd75a4447d8aee0d0 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 22 Feb 2023 03:52:00 -0600 Subject: [PATCH 05/15] grafana.sh: fix gpg key agregation --- grafana.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/grafana.sh b/grafana.sh index 029a9a8..fb3910f 100644 --- a/grafana.sh +++ b/grafana.sh @@ -60,15 +60,16 @@ apt-get install -y gnupg2 \ echo " # Setup InfluxDB Packages " -wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - -echo "deb https://repos.influxdata.com/debian buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list +curl -s https://repos.influxdata.com/influxdata-archive.key > /etc/apt/trusted.gpg.d/influxdata-archive.key +echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.key] https://repos.influxdata.com/debian buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list apt-get update && apt-get install influxdb -y run_service influxdb echo " # Setup Grafana Packages " -curl -s https://packages.grafana.com/gpg.key | sudo apt-key add - +curl -s https://apt.grafana.com/gpg-full.key | \ +gpg --dearmor | tee /etc/apt/trusted.gpg.d/grafana-full-key.gpg >/dev/null add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" apt-get update && apt-get install grafana -y run_service grafana-server @@ -76,8 +77,6 @@ run_service grafana-server echo " # Setup Telegraf Packages " -wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - -echo "deb https://repos.influxdata.com/debian buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list apt-get update && apt-get install telegraf -y mv /etc/telegraf/telegraf.conf /etc/telegraf/telegraf.conf.original @@ -134,7 +133,7 @@ JITSI_TELEGRAF run_service telegraf -echo -n "\n# Setup videobridge options\n" +echo -e "\n# Setup videobridge options\n" echo ' # extra options to pass to the JVB daemon JVB_OPTS="--apis=rest,xmpp"' >> /etc/jitsi/videobridge/config -- 2.34.1 From 243a8eb500d2ea26adbee6b9ca92d751d699c794 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 22 Feb 2023 03:53:04 -0600 Subject: [PATCH 06/15] jm-bm.sh: tweak sed --- jm-bm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jm-bm.sh b/jm-bm.sh index 9fb3a9e..dc1127e 100644 --- a/jm-bm.sh +++ b/jm-bm.sh @@ -74,7 +74,7 @@ fi #Customize room title sed -i "s|Jitsi Meet|$APP_NAME|g" "$TITLE_FILE" sed -i "s| powered by the Jitsi Videobridge||g" "$TITLE_FILE" -sed -i "/appNotInstalled/ s|{{app}}|$MOVILE_APP_NAME|" /usr/share/jitsi-meet/lang/* +sed -i "/appNotInstalled/ s|{{app}}|$MOVILE_APP_NAME|g" /usr/share/jitsi-meet/lang/* #Custom UI changes if [ -f "$INT_CONF_ETC" ]; then -- 2.34.1 From 01b90941653e2ab08dff4790d4b98292f7f6d910 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 22 Feb 2023 03:54:21 -0600 Subject: [PATCH 07/15] jra_nextcloud.sh: fix key agregation and variable collection. --- jra_nextcloud.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/jra_nextcloud.sh b/jra_nextcloud.sh index e21e8a8..0cd645e 100644 --- a/jra_nextcloud.sh +++ b/jra_nextcloud.sh @@ -41,8 +41,8 @@ exit_if_not_installed jitsi-meet DISTRO_RELEASE="$(lsb_release -sc)" DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" PHP_REPO="$(apt-cache policy | awk '/http/&&/php/{print$2}' | awk -F "/" 'NR==1{print$5}')" -PHPVER="7.4" -PSGVER="$(apt-cache madison postgresql|awk -F'[ +]' 'NR==1{print $3}')" +PHPVER="$(apt-cache madison php|grep -v ppa|awk -F'[:+]' 'NR==1{print $2}')" +PSGVER="$(apt-cache madison postgresql|tr -d '[:blank:]'|awk -F'[|+]' 'NR==1{print $2}')" PHP_FPM_DIR="/etc/php/$PHPVER/fpm" PHP_INI="$PHP_FPM_DIR/php.ini" PHP_CONF="/etc/php/$PHPVER/fpm/pool.d/www.conf" @@ -58,12 +58,19 @@ NC_DB_PASSWD="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 14 | head -n1)" DIR_RECORD="$(awk -F '"' '/RECORDING/{print$2}' /home/jibri/finalize_recording.sh|awk 'NR==1{print$1}')" REDIS_CONF="/etc/redis/redis.conf" JITSI_MEET_PROXY="/etc/nginx/modules-enabled/60-jitsi-meet.conf" -if [ -f $JITSI_MEET_PROXY ];then -PREAD_PROXY=$(grep -nr "preread_server_name" $JITSI_MEET_PROXY | cut -d ":" -f1) +if [ -f "$JITSI_MEET_PROXY" ];then +PREAD_PROXY=$(grep -nr "preread_server_name" "$JITSI_MEET_PROXY" | cut -d ":" -f1) fi PUBLIC_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)" ISO3166_CODE=TBD NL="$(printf '\n ')" +TMP_GPG_REPO="$(mktemp)" +add_gpg_keyring() { +apt-key adv --recv-keys --keyserver keyserver.ubuntu.com "$1" +apt-key export "$1" | gpg --dearmour | tee "$TMP_GPG_REPO"/"$1".gpg >/dev/null +apt-key del "$1" +mv "$TMP_GPG_REPO"/"$1".gpg /etc/apt/trusted.gpg.d/ +} while [[ "$ANS_NCD" != "yes" ]] do @@ -171,8 +178,8 @@ if [ "$PHP_REPO" = "php" ]; then apt-get -yq2 dist-upgrade else echo "# Adding Ondrej PHP $PHPVER PPA Repository" - apt-key adv --recv-keys --keyserver keyserver.ubuntu.com E5267A6C - echo "deb [arch=amd64] http://ppa.launchpad.net/ondrej/php/ubuntu $DISTRO_RELEASE main" > /etc/apt/sources.list.d/php7x.list + add_gpg_keyring E5267A6C + echo "deb [arch=amd64] http://ppa.launchpad.net/ondrej/php/ubuntu $DISTRO_RELEASE main" > /etc/apt/sources.list.d/php"$PHPVER".list apt-get update -q2 fi } -- 2.34.1 From 42703a005f29a6e2927bceab5ccca8ec7f03b055 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 22 Feb 2023 04:54:12 -0600 Subject: [PATCH 08/15] jra_nextcloud.sh: fix add gpgp key function and add install available version pacjage --- jra_nextcloud.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/jra_nextcloud.sh b/jra_nextcloud.sh index 0cd645e..eb3ad86 100644 --- a/jra_nextcloud.sh +++ b/jra_nextcloud.sh @@ -64,13 +64,27 @@ fi PUBLIC_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)" ISO3166_CODE=TBD NL="$(printf '\n ')" -TMP_GPG_REPO="$(mktemp)" +TMP_GPG_REPO="$(mktemp -d)" add_gpg_keyring() { apt-key adv --recv-keys --keyserver keyserver.ubuntu.com "$1" apt-key export "$1" | gpg --dearmour | tee "$TMP_GPG_REPO"/"$1".gpg >/dev/null apt-key del "$1" mv "$TMP_GPG_REPO"/"$1".gpg /etc/apt/trusted.gpg.d/ } +install_aval_package() { +for i in $1 + do + if [ -z "$(apt-cache madison $i 2>/dev/null)" ]; then + echo " > Package $i not available on repo." + else + echo " > Add package $i to the install list" + packages="$packages $i" + fi + done + echo "$packages" + apt-get -y install $packages + packages="" +} while [[ "$ANS_NCD" != "yes" ]] do @@ -171,7 +185,7 @@ else apt-get -yq2 install "$1" fi } -add_php74() { +add_php() { if [ "$PHP_REPO" = "php" ]; then echo "PHP $PHPVER already installed" apt-get -q2 update @@ -193,8 +207,8 @@ exit_ifinstalled postgresql-"$PSGVER" install_ifnot postgresql-"$PSGVER" # PHP 7.4 -add_php74 -apt-get install -y \ +add_php +install_aval_package \ imagemagick \ php"$PHPVER"-fpm \ php"$PHPVER"-bcmath \ -- 2.34.1 From 8df68aeb56d12c37f930cb260dd4b542b1037d0a Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 22 Feb 2023 05:23:19 -0600 Subject: [PATCH 09/15] jra_nextcloud.sh: small fix for install_aval_package function --- jra_nextcloud.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jra_nextcloud.sh b/jra_nextcloud.sh index eb3ad86..bd8ff03 100644 --- a/jra_nextcloud.sh +++ b/jra_nextcloud.sh @@ -208,7 +208,7 @@ install_ifnot postgresql-"$PSGVER" # PHP 7.4 add_php -install_aval_package \ +install_aval_package " \ imagemagick \ php"$PHPVER"-fpm \ php"$PHPVER"-bcmath \ @@ -228,7 +228,8 @@ install_aval_package \ php"$PHPVER"-xmlrpc \ php"$PHPVER"-zip \ redis-server \ - unzip + unzip \ + " #System related install_ifnot smbclient -- 2.34.1 From ad507b9d18ed4a4b69902dd59057cce3ab38bb57 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Sun, 2 Apr 2023 01:37:06 -0600 Subject: [PATCH 10/15] jitsi-updater.sh: fix check chrome driver version. --- jitsi-updater.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jitsi-updater.sh b/jitsi-updater.sh index 5dd9f83..08b0ec0 100644 --- a/jitsi-updater.sh +++ b/jitsi-updater.sh @@ -66,12 +66,6 @@ read -r -a google_package < <(grep ^Package /var/lib/apt/lists/dl.google.com_*_P else echo "Seems no Google repo installed" fi -if [ -z "$CHDB" ]; then - echo "Seems no chromedriver installed" -else - CHD_VER_LOCAL="$($CHDB -v | awk '{print $2}')" - CHD_VER_2D="$(awk '{printf "%.1f\n", $NF}' <<< "$CHD_VER_LOCAL")" -fi if [ -f "$apt_repo"/nodesource.list ]; then read -r -a nodejs_package < <(grep ^Package /var/lib/apt/lists/deb.nodesource.com_node*_Packages | \ sort -u | awk '{print $2}' | xargs) @@ -114,6 +108,12 @@ update_google_repo() { else echo "No Google repository found" fi + if [ -z "$CHDB" ]; then + echo "Seems no chromedriver installed" + else + CHD_VER_LOCAL="$($CHDB -v | awk '{print $2}')" + CHD_VER_2D="$(awk '{printf "%.1f\n", $NF}' <<< "$CHD_VER_LOCAL")" + fi } update_nodejs_repo() { apt-get update -o Dir::Etc::sourcelist="sources.list.d/nodesource.list" \ -- 2.34.1 From 1879337307cc6bb9e9595c7fdfc906c2acff5167 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Mon, 24 Jul 2023 02:34:43 -0600 Subject: [PATCH 11/15] jra_nextcloud.sh: organize functions, add apt checks, higher password lenght and small fixes. --- jra_nextcloud.sh | 77 +++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/jra_nextcloud.sh b/jra_nextcloud.sh index bd8ff03..530fbbb 100644 --- a/jra_nextcloud.sh +++ b/jra_nextcloud.sh @@ -37,6 +37,10 @@ echo -e '\n by Software, IT & Networks Ltd \n' exit_if_not_installed jitsi-meet +## APT checks +apt-get update -q2 +# Manually add prerequisites. +apt-get install -y curl letsencrypt nginx DISTRO_RELEASE="$(lsb_release -sc)" DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" @@ -47,6 +51,7 @@ 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-available/"$DOMAIN".conf | awk '{print$2}')" +[ -z $NC_NGINX_SSL_PORT ] && NC_NGINX_SSL_PORT="443" 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" @@ -58,13 +63,12 @@ NC_DB_PASSWD="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 14 | head -n1)" DIR_RECORD="$(awk -F '"' '/RECORDING/{print$2}' /home/jibri/finalize_recording.sh|awk 'NR==1{print$1}')" REDIS_CONF="/etc/redis/redis.conf" JITSI_MEET_PROXY="/etc/nginx/modules-enabled/60-jitsi-meet.conf" -if [ -f "$JITSI_MEET_PROXY" ];then -PREAD_PROXY=$(grep -nr "preread_server_name" "$JITSI_MEET_PROXY" | cut -d ":" -f1) -fi +[ -f "$JITSI_MEET_PROXY" ] && PREAD_PROXY=$(grep -nr "preread_server_name" "$JITSI_MEET_PROXY" | cut -d ":" -f1) PUBLIC_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)" ISO3166_CODE=TBD NL="$(printf '\n ')" TMP_GPG_REPO="$(mktemp -d)" + add_gpg_keyring() { apt-key adv --recv-keys --keyserver keyserver.ubuntu.com "$1" apt-key export "$1" | gpg --dearmour | tee "$TMP_GPG_REPO"/"$1".gpg >/dev/null @@ -85,7 +89,34 @@ for i in $1 apt-get -y install $packages packages="" } - +exit_ifinstalled() { +if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then + echo " This instance already has $1 installed, exiting..." + echo " If you think this is an error, please report to: + -> https://github.com/switnet-ltd/quick-jibri-installer/issues " + exit +fi +} +install_ifnot() { +if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then + echo " $1 is installed, skipping..." +else + echo -e "\n---- Installing $1 ----" + apt-get -yq2 install "$1" +fi +} +add_php() { +if [ "$PHP_REPO" = "php" ]; then + echo "PHP $PHPVER already installed" + apt-get -q2 update + apt-get -yq2 dist-upgrade +else + echo "# Adding Ondrej PHP $PHPVER PPA Repository" + add_gpg_keyring E5267A6C + echo "deb [arch=amd64] http://ppa.launchpad.net/ondrej/php/ubuntu $DISTRO_RELEASE main" > /etc/apt/sources.list.d/php"$PHPVER".list + apt-get update -q2 +fi +} while [[ "$ANS_NCD" != "yes" ]] do read -p "> Please set your domain (or subdomain) here for Nextcloud: (e.g.: cloud.domain.com)$NL" -r NC_DOMAIN @@ -124,11 +155,11 @@ do echo " - This field is mandatory." fi done -while [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 6 ] +while [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 8 ] do read -p "Nextcloud user password: " -r NC_PASS - if [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 6 ]; then - echo -e " - This field is mandatory. \nPlease make sure it's at least 6 characters.\n" + if [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt8 ]; then + echo -e " - This field is mandatory. \nPlease make sure it's at least 8 characters.\n" fi done #Enable HSTS @@ -169,34 +200,6 @@ else exit fi -exit_ifinstalled() { -if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then - echo " This instance already has $1 installed, exiting..." - echo " If you think this is an error, please report to: - -> https://github.com/switnet-ltd/quick-jibri-installer/issues " - exit -fi -} -install_ifnot() { -if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then - echo " $1 is installed, skipping..." -else - echo -e "\n---- Installing $1 ----" - apt-get -yq2 install "$1" -fi -} -add_php() { -if [ "$PHP_REPO" = "php" ]; then - echo "PHP $PHPVER already installed" - apt-get -q2 update - apt-get -yq2 dist-upgrade -else - echo "# Adding Ondrej PHP $PHPVER PPA Repository" - add_gpg_keyring E5267A6C - echo "deb [arch=amd64] http://ppa.launchpad.net/ondrej/php/ubuntu $DISTRO_RELEASE main" > /etc/apt/sources.list.d/php"$PHPVER".list - apt-get update -q2 -fi -} #Prevent root folder permission issues cp "$PWD"/files/jra-nc-app-ef.json /tmp @@ -206,7 +209,7 @@ exit_ifinstalled postgresql-"$PSGVER" # PostgresSQL install_ifnot postgresql-"$PSGVER" -# PHP 7.4 +# PHP 7.4 / 8.1 add_php install_aval_package " \ imagemagick \ @@ -488,7 +491,7 @@ echo -e "\nApply custom mods...\n" sed -i "/datadirectory/a \ \ \'skeletondirectory\' => \'\'," "$NC_CONFIG" sed -i "/skeletondirectory/a \ \ \'simpleSignUpLink.shown\' => false," "$NC_CONFIG" sed -i "/simpleSignUpLink.shown/a \ \ \'knowledgebaseenabled\' => false," "$NC_CONFIG" -sed -i "s|http://localhost|http://$NC_DOMAIN|" "$NC_CONFIG" +sed -i "s|http://localhost|https://$NC_DOMAIN|" "$NC_CONFIG" echo -e "\nAdd crontab...\n" crontab -u www-data -l | { cat; echo "*/5 * * * * php -f $NC_PATH/cron.php"; } | crontab -u www-data - -- 2.34.1 From 728eb82d45f7043a7b598c27d024a1424ef3467f Mon Sep 17 00:00:00 2001 From: Ark74 Date: Fri, 18 Aug 2023 15:39:28 -0600 Subject: [PATCH 12/15] quick_jibri_installer.sh,jitsi-updater.sh: update chromedriver 115+ version download. --- jitsi-updater.sh | 8 ++++++-- quick_jibri_installer.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/jitsi-updater.sh b/jitsi-updater.sh index 08b0ec0..1339f16 100644 --- a/jitsi-updater.sh +++ b/jitsi-updater.sh @@ -40,7 +40,10 @@ fi support="https://switnet.net/support" apt_repo="/etc/apt/sources.list.d" ENABLE_BLESSM="TBD" -CHD_LTST="$(curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE)" +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") CHD_LTST_2D="$(cut -d "." -f 1,2 <<< "$CHD_LTST")" CHDB="$(whereis chromedriver | awk '{print$2}')" if [ -d /etc/prosody/conf.d/ ]; then @@ -131,9 +134,10 @@ upgrade_cd() { if [ -n "$GOOGL_VER_2D" ]; then if version_gt "$GOOGL_VER_2D" "$CHD_VER_2D" ; then echo "Upgrading Chromedriver to Google Chromes version" - wget -q https://chromedriver.storage.googleapis.com/"$CHD_LTST"/chromedriver_linux64.zip \ + wget -q "$CHD_LTST_DWNL" \ -O /tmp/chromedriver_linux64.zip unzip -o /tmp/chromedriver_linux64.zip -d /usr/local/bin/ + mv /usr/local/bin/chromedriver-linux64/chromedriver "$CHDB" chown root:root "$CHDB" chmod 0755 "$CHDB" rm -rf /tpm/chromedriver_linux64.zip diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index e952dee..a623fcb 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -404,7 +404,10 @@ elif [ "$(npm list -g esprima 2>/dev/null | grep -c "esprima")" == "1" ]; then echo "Good. Esprima package is already installed" fi -CHD_LTST=$(curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE) +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" echo "# Installing Google Chrome / ChromeDriver" @@ -424,9 +427,10 @@ if [ -f /usr/local/bin/chromedriver ]; then echo "Chromedriver already installed." else echo "Installing Chromedriver" - wget -q https://chromedriver.storage.googleapis.com/"$CHD_LTST"/chromedriver_linux64.zip \ + wget -q "$CHD_LTST_DWNL" \ -O /tmp/chromedriver_linux64.zip unzip -o /tmp/chromedriver_linux64.zip -d /usr/local/bin/ + mv /usr/local/bin/chromedriver-linux64/chromedriver "$CHDB" chown root:root /usr/local/bin/chromedriver chmod 0755 /usr/local/bin/chromedriver rm -rf /tmp/chromedriver_linux64.zip -- 2.34.1 From ec37c01d9550f261c7e3fb427568d02097271ba3 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Tue, 22 Aug 2023 05:30:26 -0600 Subject: [PATCH 13/15] quick_jibri_installer.sh: update nodejs to a stable release. --- quick_jibri_installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index a623fcb..bfbc358 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -391,7 +391,7 @@ echo " if [ "$(dpkg-query -W -f='${Status}' nodejs 2>/dev/null | grep -c "ok")" == "1" ]; then echo "Nodejs is installed, skipping..." else - curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - + curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - apt-get install -yq2 nodejs echo "Installing nodejs esprima package..." npm install -g esprima -- 2.34.1 From e877980f46531b48f2dd753268792b1ed8bec649 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Tue, 22 Aug 2023 05:33:33 -0600 Subject: [PATCH 14/15] quick_jibri_installer.sh: fix empty varible usage. --- quick_jibri_installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index bfbc358..de82e78 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -430,7 +430,7 @@ else wget -q "$CHD_LTST_DWNL" \ -O /tmp/chromedriver_linux64.zip unzip -o /tmp/chromedriver_linux64.zip -d /usr/local/bin/ - mv /usr/local/bin/chromedriver-linux64/chromedriver "$CHDB" + mv /usr/local/bin/chromedriver-linux64/chromedriver /usr/local/bin/chromedriver chown root:root /usr/local/bin/chromedriver chmod 0755 /usr/local/bin/chromedriver rm -rf /tmp/chromedriver_linux64.zip -- 2.34.1 From e42157cddd48354ec37f8ae70f0cd9294a5366ff Mon Sep 17 00:00:00 2001 From: Ark74 Date: Tue, 22 Aug 2023 20:22:24 -0600 Subject: [PATCH 15/15] quick_jibri_installer.sh: rearrange chromedriver variables. --- quick_jibri_installer.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index de82e78..2233b76 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -404,12 +404,6 @@ elif [ "$(npm list -g esprima 2>/dev/null | grep -c "esprima")" == "1" ]; then echo "Good. Esprima package is already installed" fi -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" - echo "# Installing Google Chrome / ChromeDriver" if [ "$GOOGLE_ACTIVE_REPO" = "main" ]; then echo "Google repository already set." @@ -423,6 +417,12 @@ apt-get -q2 update apt-get install -yq2 google-chrome-stable 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) +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" + if [ -f /usr/local/bin/chromedriver ]; then echo "Chromedriver already installed." else -- 2.34.1