feat: update cwctl to work with Ubuntu 24.04 LTS (#9586)

The `add user` utility was updated, and the `--disabled-login` behavior changed in Ubuntu 24.04. This set the login shell to `/sbin/nologin,` which broke the `cwctl` installation flow. 

ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625758

Co-authored-by: Vishnu Narayanan <iamwishnu@gmail.com>
This commit is contained in:
André J
2024-06-05 11:50:57 +02:00
committed by GitHub
parent 88e4d9f06f
commit c23e235cea
3 changed files with 8 additions and 8 deletions

View File

@@ -1 +1 @@
3.3.1 3.9.0

View File

@@ -1 +1 @@
2.7.0 2.8.0

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Description: Install and manage a Chatwoot installation. # Description: Install and manage a Chatwoot installation.
# OS: Ubuntu 20.04 LTS # OS: Ubuntu 20.04 LTS, 22.04 LTS, 24.04 LTS
# Script Version: 2.7.0 # Script Version: 2.8.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.7.0" CWCTL_VERSION="2.8.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"
@@ -231,7 +231,7 @@ function install_webserver() {
############################################################################## ##############################################################################
function create_cw_user() { function create_cw_user() {
if ! id -u "chatwoot"; then if ! id -u "chatwoot"; then
adduser --disabled-login --gecos "" chatwoot adduser --disabled-password --gecos "" chatwoot
fi fi
} }
@@ -505,7 +505,7 @@ EOF
fi fi
echo -en "\n" echo -en "\n"
read -rp 'Would you like to install Postgres and Redis? (Answer no if you plan to use external services): ' install_pg_redis read -rp 'Would you like to install Postgres and Redis? (Answer no if you plan to use external services)(yes or no): ' install_pg_redis
echo -en "\n➥ 1/9 Installing dependencies. This takes a while.\n" echo -en "\n➥ 1/9 Installing dependencies. This takes a while.\n"
install_dependencies &>> "${LOG_FILE}" install_dependencies &>> "${LOG_FILE}"
@@ -943,7 +943,7 @@ EOF
# None # None
############################################################################## ##############################################################################
function version() { function version() {
echo "cwctl v$CWCTL_VERSION beta build" echo "cwctl v$CWCTL_VERSION"
} }
############################################################################## ##############################################################################