This commit is contained in:
Christoph 2021-04-22 20:57:52 +02:00
commit 0b13fcb54d
5 changed files with 72 additions and 11 deletions

View File

@ -49,6 +49,13 @@ hostname=""
ipv4=""
ipv6=""
# - Webserver User
# -
# - defaults to:
# - http_user=www-data
# -
#http_user="www-data"
# ---
# - Listener configuration

View File

@ -2319,12 +2319,17 @@ echononl "\tAdd Apache User (${HTTP_USER}) to group 'dovecot'.."
if getent group dovecot 2> /dev/null | grep -q "\b${HTTP_USER}\b" > /dev/null 2>&1 ; then
echo_skipped
else
usermod -a -G dovecot $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]] ; then
echo_ok
if ! $(grep dovecot /etc/group > /dev/null) ; then
echo_skipped
warn "Group 'dovecot' not present.!"
else
echo_failed
error "$(cat $log_file)"
usermod -a -G dovecot $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]] ; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
fi
fi

View File

@ -108,6 +108,13 @@ is_number() {
#return $([[ ! -z "${1##*[!0-9]*}" ]])
}
trim() {
local var="$*"
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
echo -n "$var"
}
trap clean_up SIGHUP SIGINT SIGTERM
@ -164,6 +171,7 @@ fi
# - Sort array
# -
IFS=$'\n' website_arr=($(sort <<<"${unsorted_website_arr[*]}"))
IFS=' '
WEBSITE_NAME=
@ -552,13 +560,20 @@ _log_dir=${_src_base_dir}/log-roundcube-$_version
# - * Composer installed either locally or globally (https://getcomposer.org)
needed_php_pear_modules="
needed_php_pear_modules=""
_needed_php_pear_modules="
MDB2
Mail_Mime
Mail_mimeDecode
Net_SMTP
Net_IDNA2
Auth_SASL"
Auth_SASL
"
for _module in $_needed_php_pear_modules ; do
_module="$(trim $_module)"
needed_php_pear_modules="$needed_php_pear_modules $_module"
done
if [[ "$DB_TYPE" = "pgsql" ]]; then
needed_php_pear_modules="$needed_php_pear_modules MDB2_Driver_pgsql"
@ -583,6 +598,7 @@ if $PHP_DEBIAN_INSTALLATION ; then
fi
for _module in $needed_php_pear_modules ; do
_module="$(trim $_module)"
echononl "\tInstall Module '$_module'.."
if ! pear list | grep -q "$_module" 2> /dev/null ; then
pear install $_module > $log_file 2>&1
@ -621,6 +637,7 @@ else
for _module in $needed_php_pear_modules ; do
_module="$(trim $_module)"
echononl "\tInstall Module '$_module'.."
if ! /usr/local/php-${_version}/bin/pear list | grep -q "$_module" 2> /dev/null ; then
/usr/local/php-${_version}/bin/pear install $_module > $log_file 2>&1
@ -1938,6 +1955,7 @@ _needed_packages_spell="
aspell-fr
aspell-it"
for _pkg in $_needed_packages_spell ; do
_pkg="$(trim $_pkg)"
if aptitude search "$_pkg" | grep " $_pkg " | grep -e "^i" > /dev/null 2>&1 ; then
continue
else
@ -2901,7 +2919,7 @@ if [[ "$POSTFIX_DB_TYPE" = 'pgsql' ]] ; then
su - postgres -c "psql -t -c \"CREATE LANGUAGE plpgsql;\"" > $log_file 2>&1
if [[ $? -ne 0 ]] ; then
echo_failed
erro $(cat $log_file)
error $(cat $log_file)
else
echo_ok
fi
@ -2994,6 +3012,11 @@ EOF
_failed=true
fi
chmod 600 ~/.pgpass
if [[ $? -ne 0 ]]; then
_failed=true
fi
echo "" >> $log_file
echo "psql -w -U $POSTFIX_DB_USER $POSTFIX_DB_NAME < $_psql_trigger_file" >> $log_file
psql -w -U $POSTFIX_DB_USER $POSTFIX_DB_NAME < $_psql_trigger_file >> $log_file 2>&1
@ -3019,7 +3042,7 @@ EOF
if $_failed ; then
echo_failed
erro $(cat $log_file)
error $(cat $log_file)
else
echo_ok
fi
@ -3088,6 +3111,11 @@ EOF
_failed=true
fi
chmod 600 ~/.pgpass
if [[ $? -ne 0 ]]; then
_failed=true
fi
echo "" >> $log_file
echo "psql -w -U $POSTFIX_DB_USER $POSTFIX_DB_NAME < $_psql_trigger_file" >> $log_file
psql -w -U $POSTFIX_DB_USER $POSTFIX_DB_NAME < $_psql_trigger_file >> $log_file 2>&1
@ -3113,7 +3141,7 @@ EOF
if $_failed ; then
echo_failed
erro $(cat $log_file)
error $(cat $log_file)
else
echo_ok
fi
@ -3182,6 +3210,11 @@ EOF
_failed=true
fi
chmod 600 ~/.pgpass
if [[ $? -ne 0 ]]; then
_failed=true
fi
echo "" >> $log_file
echo "psql -w -U $POSTFIX_DB_USER $POSTFIX_DB_NAME < $_psql_trigger_file" >> $log_file
psql -w -U $POSTFIX_DB_USER $POSTFIX_DB_NAME < $_psql_trigger_file >> $log_file 2>&1
@ -3207,7 +3240,7 @@ EOF
if $_failed ; then
echo_failed
erro $(cat $log_file)
error $(cat $log_file)
else
echo_ok
fi

View File

@ -177,6 +177,8 @@ if $xmpp_listener ; then
[[ -n "$xmpp_listener_port" ]] || xmpp_listener_port="44444"
fi
[[ -n "$http_user" ]] || http_user="www-data"
[[ -n "$dbname" ]] || dbname="postfix"
[[ -n "$dbuser" ]] || dbuser="postfix"
if [[ -z "$dbhost" ]] ; then
@ -694,6 +696,19 @@ else
echo -e "$rc_skipped"
fi
echononl "\tAdd Apache User (${http_user}) to group 'dovecot'.."
if getent group dovecot 2> /dev/null | grep -q "\b${http_user}\b" > /dev/null 2>&1 ; then
echo -e "$rc_skipped"
else
usermod -a -G dovecot $http_user > ${_log_dir}/system.log 2>&1
if [[ $? -eq 0 ]] ; then
echo -e "$rc_done"
else
echo -e "$rc_failed"
error "Failed to add Apache User (${http_user}) to group 'dovecot'!"
fi
fi
echononl "\tCreate group dovenull.."
if ! grep dovenull /etc/group > /dev/null ; then

View File

@ -173,6 +173,7 @@ fi
# - Sort array
# -
IFS=$'\n' website_arr=($(sort <<<"${unsorted_website_arr[*]}"))
IFS=' '
WEBSITE_NAME=