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,8 +1,8 @@
#!/usr/bin/env bash
# Description: Install and manage a Chatwoot installation.
# OS: Ubuntu 20.04 LTS
# Script Version: 2.7.0
# OS: Ubuntu 20.04 LTS, 22.04 LTS, 24.04 LTS
# Script Version: 2.8.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.7.0"
CWCTL_VERSION="2.8.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"
@@ -231,7 +231,7 @@ function install_webserver() {
##############################################################################
function create_cw_user() {
if ! id -u "chatwoot"; then
adduser --disabled-login --gecos "" chatwoot
adduser --disabled-password --gecos "" chatwoot
fi
}
@@ -505,7 +505,7 @@ EOF
fi
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"
install_dependencies &>> "${LOG_FILE}"
@@ -943,7 +943,7 @@ EOF
# None
##############################################################################
function version() {
echo "cwctl v$CWCTL_VERSION beta build"
echo "cwctl v$CWCTL_VERSION"
}
##############################################################################