From 590ce788b99c7634936af07bf999c05abadb0416 Mon Sep 17 00:00:00 2001 From: Vishnu Narayanan Date: Thu, 18 May 2023 16:53:47 +0530 Subject: [PATCH] fix: update linux script(cwctl) to account for rails7 upgrade (#7106) * chore: modify cwctl to fetch latest redis version on new installations * fix: add libvips for activestorage imageprocessing support * chore: update cwctl version * feat: upgrade redis and install libvps for existing installations --- VERSION_CW | 2 +- VERSION_CWCTL | 2 +- deployment/setup_20.04.sh | 30 +++++++++++++++++++++++++++--- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/VERSION_CW b/VERSION_CW index ccbccc3dc..d76bd2ba3 100644 --- a/VERSION_CW +++ b/VERSION_CW @@ -1 +1 @@ -2.2.0 +2.17.0 diff --git a/VERSION_CWCTL b/VERSION_CWCTL index 7ec1d6db4..276cbf9e2 100644 --- a/VERSION_CWCTL +++ b/VERSION_CWCTL @@ -1 +1 @@ -2.1.0 +2.3.0 diff --git a/deployment/setup_20.04.sh b/deployment/setup_20.04.sh index 20cc672df..8cd0a4e1a 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.2.0 +# Script Version: 2.3.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.2.0" +CWCTL_VERSION="2.3.0" pg_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 15 ; echo '') # if user does not specify an option @@ -175,6 +175,8 @@ function install_dependencies() { curl -sL https://deb.nodesource.com/setup_16.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 apt update apt install -y \ @@ -183,7 +185,8 @@ function install_dependencies() { libssl-dev libyaml-dev libreadline-dev gnupg2 \ postgresql-client redis-tools \ nodejs yarn patch ruby-dev zlib1g-dev liblzma-dev \ - libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev sudo + libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev sudo \ + libvips } ############################################################################## @@ -708,6 +711,26 @@ function upgrade_prereq() { EOF } +############################################################################## +# Update redis to v7+ for Rails 7 support(-u/--upgrade) +# and install libvips for image processing support in Rails 7 +# Globals: +# None +# Arguments: +# None +# Outputs: +# None +############################################################################## +function upgrade_redis() { + echo "Upgrading Redis to v7+ for Rails 7 support(Chatwoot v2.17+)" + 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 + apt update -y + apt upgrade redis-server -y + apt install libvips -y +} + + ############################################################################## # Upgrade an existing installation to latest stable version(-u/--upgrade) # Globals: @@ -722,6 +745,7 @@ function upgrade() { echo "Upgrading Chatwoot to v$CW_VERSION" sleep 3 upgrade_prereq + upgrade_redis sudo -i -u chatwoot << "EOF" # Navigate to the Chatwoot directory