From c9f8cdb51b136e61d0414a885c6f526830fe8263 Mon Sep 17 00:00:00 2001 From: Vishnu Narayanan Date: Tue, 19 Dec 2023 10:48:42 +0530 Subject: [PATCH] fix: switch to nodejs ppa for linux installations (#8337) Nodesource script-based installation is deprecated. Switch to a different ppa for nodejs. Fixes: https://linear.app/chatwoot/issue/CW-2686/upgrade-warning Fixes: #8151 --- VERSION_CW | 2 +- VERSION_CWCTL | 2 +- deployment/setup_20.04.sh | 22 ++++++++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/VERSION_CW b/VERSION_CW index fd2a01863..bea438e9a 100644 --- a/VERSION_CW +++ b/VERSION_CW @@ -1 +1 @@ -3.1.0 +3.3.1 diff --git a/VERSION_CWCTL b/VERSION_CWCTL index e70b4523a..24ba9a38d 100644 --- a/VERSION_CWCTL +++ b/VERSION_CWCTL @@ -1 +1 @@ -2.6.0 +2.7.0 diff --git a/deployment/setup_20.04.sh b/deployment/setup_20.04.sh index 411e43e85..c5060f869 100644 --- a/deployment/setup_20.04.sh +++ b/deployment/setup_20.04.sh @@ -2,7 +2,7 @@ # Description: Install and manage a Chatwoot installation. # OS: Ubuntu 20.04 LTS -# Script Version: 2.6.0 +# Script Version: 2.7.0 # Run this script as root set -eu -o errexit -o pipefail -o noclobber -o nounset @@ -19,7 +19,7 @@ fi # option --output/-o requires 1 argument LONGOPTS=console,debug,help,install,Install:,logs:,restart,ssl,upgrade,webserver,version OPTIONS=cdhiI:l:rsuwv -CWCTL_VERSION="2.6.0" +CWCTL_VERSION="2.7.0" pg_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 15 ; echo '') CHATWOOT_HUB_URL="https://hub.2.chatwoot.com/events" @@ -173,15 +173,19 @@ EOF function install_dependencies() { apt update && apt upgrade -y apt install -y curl - curl -sL https://deb.nodesource.com/setup_20.x | bash - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list + mkdir -p /etc/apt/keyrings + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + NODE_MAJOR=20 + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list + apt update apt install -y \ - git software-properties-common imagemagick libpq-dev \ + git software-properties-common ca-certificates imagemagick libpq-dev \ libxml2-dev libxslt1-dev file g++ gcc autoconf build-essential \ libssl-dev libyaml-dev libreadline-dev gnupg2 \ postgresql-client redis-tools \ @@ -779,8 +783,14 @@ function upgrade_node() { fi echo "Upgrading Node.js version to v20.x" - curl -sL https://deb.nodesource.com/setup_20.x | sudo bash - - apt install -y nodejs + mkdir -p /etc/apt/keyrings + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + NODE_MAJOR=20 + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list + + apt update + apt install nodejs -y + } ##############################################################################