mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 02:57:57 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -1 +1 @@ | |||||||
| 3.1.0 | 3.3.1 | ||||||
|   | |||||||
| @@ -1 +1 @@ | |||||||
| 2.6.0 | 2.7.0 | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
|  |  | ||||||
| # Description: Install and manage a Chatwoot installation. | # Description: Install and manage a Chatwoot installation. | ||||||
| # OS: Ubuntu 20.04 LTS | # OS: Ubuntu 20.04 LTS | ||||||
| # Script Version: 2.6.0 | # Script Version: 2.7.0 | ||||||
| # Run this script as root | # Run this script as root | ||||||
|  |  | ||||||
| set -eu -o errexit -o pipefail -o noclobber -o nounset | set -eu -o errexit -o pipefail -o noclobber -o nounset | ||||||
| @@ -19,7 +19,7 @@ fi | |||||||
| # option --output/-o requires 1 argument | # option --output/-o requires 1 argument | ||||||
| LONGOPTS=console,debug,help,install,Install:,logs:,restart,ssl,upgrade,webserver,version | LONGOPTS=console,debug,help,install,Install:,logs:,restart,ssl,upgrade,webserver,version | ||||||
| OPTIONS=cdhiI:l:rsuwv | 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 '') | pg_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 15 ; echo '') | ||||||
| CHATWOOT_HUB_URL="https://hub.2.chatwoot.com/events" | CHATWOOT_HUB_URL="https://hub.2.chatwoot.com/events" | ||||||
|  |  | ||||||
| @@ -173,15 +173,19 @@ EOF | |||||||
| function install_dependencies() { | function install_dependencies() { | ||||||
|   apt update && apt upgrade -y |   apt update && apt upgrade -y | ||||||
|   apt install -y curl |   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 - |   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 |   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 |   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 |   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 update | ||||||
|  |  | ||||||
|   apt install -y \ |   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 \ |       libxml2-dev libxslt1-dev file g++ gcc autoconf build-essential \ | ||||||
|       libssl-dev libyaml-dev libreadline-dev gnupg2 \ |       libssl-dev libyaml-dev libreadline-dev gnupg2 \ | ||||||
|       postgresql-client redis-tools \ |       postgresql-client redis-tools \ | ||||||
| @@ -779,8 +783,14 @@ function upgrade_node() { | |||||||
|   fi |   fi | ||||||
|  |  | ||||||
|   echo "Upgrading Node.js version to v20.x" |   echo "Upgrading Node.js version to v20.x" | ||||||
|   curl -sL https://deb.nodesource.com/setup_20.x | sudo bash - |   mkdir -p /etc/apt/keyrings | ||||||
|   apt install -y nodejs |   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 | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| ############################################################################## | ############################################################################## | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Vishnu Narayanan
					Vishnu Narayanan