Skip to content

Commit

Permalink
fix: switch to nodejs ppa for linux installations (#8337)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vishnu-narayanan committed Dec 19, 2023
1 parent a2ebf92 commit c9f8cdb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION_CW
@@ -1 +1 @@
3.1.0
3.3.1
2 changes: 1 addition & 1 deletion VERSION_CWCTL
@@ -1 +1 @@
2.6.0
2.7.0
22 changes: 16 additions & 6 deletions deployment/setup_20.04.sh
Expand Up @@ -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
Expand All @@ -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"

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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

}

##############################################################################
Expand Down

0 comments on commit c9f8cdb

Please sign in to comment.