From eba405ccc7e3bbfb7087b59b44b410ffed2e014e Mon Sep 17 00:00:00 2001 From: Ark74 Date: Tue, 15 Nov 2022 02:11:08 -0600 Subject: [PATCH 1/2] add-jibri-node.sh: set openjdk-jre-headless default version to 11 --- add-jibri-node.sh | 2 +- quick_jibri_installer.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/add-jibri-node.sh b/add-jibri-node.sh index 6ae2fc5..80652e9 100644 --- a/add-jibri-node.sh +++ b/add-jibri-node.sh @@ -265,7 +265,7 @@ echo " " apt-get -y install \ jibri \ - openjdk-8-jre-headless + openjdk-11-jre-headless echo "# Installing Google Chrome / ChromeDriver" if [ "$GOOGLE_ACTIVE_REPO" = "main" ]; then diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index ba8ad49..4b3efa4 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_12.x | sudo -E bash - + curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - apt-get install -yq2 nodejs echo "Installing nodejs esprima package..." npm install -g esprima From 3c2d70086675ff1e51765f9bd928344fd113a8ca Mon Sep 17 00:00:00 2001 From: Ark74 Date: Tue, 15 Nov 2022 02:14:27 -0600 Subject: [PATCH 2/2] jitsi-updater.sh: add checks for openjdk and nodejs supported versions --- jitsi-updater.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/jitsi-updater.sh b/jitsi-updater.sh index cbac459..5dd9f83 100644 --- a/jitsi-updater.sh +++ b/jitsi-updater.sh @@ -72,7 +72,12 @@ 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) +else + echo "Seems no nodejs repo installed" +fi # True if $1 is greater than $2 version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } @@ -110,6 +115,11 @@ update_google_repo() { echo "No Google repository found" fi } +update_nodejs_repo() { + apt-get update -o Dir::Etc::sourcelist="sources.list.d/nodesource.list" \ + -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" + apt-get install -q2 --only-upgrade <<< printf "${nodejs_package[@]}" +} printwc "${Purple}" "Checking for Google Chrome\n" if [ -f /usr/bin/google-chrome ]; then GOOGL_VER_2D="$(/usr/bin/google-chrome --version|awk '{printf "%.1f\n", $NF}')" @@ -167,6 +177,13 @@ else echo "Please check your repositories, something is not right." exit 1 fi +printwc "${Blue}" "Check for supported nodejs LTS version" +if version_gt "14" "$(dpkg-query -W -f='${Version}' nodejs)"; then + curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - + apt-get install -yq2 nodejs +else + update_nodejs_repo +fi check_if_installed(){ if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then echo "1" @@ -218,6 +235,12 @@ else printwc "${Purple}" "========== Disable Blur my background ==========\n" sed -i "s|'videobackgroundblur', ||" "$INT_CONF" fi +if [ "$(check_if_installed openjdk-8-jre-headless)" = 1 ]; then + printwc "${Red}" "\n::: Unsupported OpenJDK JRE version found :::\n" + apt-get install -y openjdk-11-jre-headless + apt-get purge -y openjdk-8-jre-headless + printwc "${Green}" "\n::: Updated to supported OpenJDK JRE version 11 :::\n" +fi [ "$JIBRI_NODE" != yes ] && \ if [ "$NC_DOMAIN" != "TBD" ]; then