Compare commits

..

2 commits
master ... mail

Author SHA1 Message Date
William Hirigoyen 9e791ec596 Fix PHP conf syntax 2023-11-08 10:51:29 +01:00
William Hirigoyen e552cac8ec Add sendmail command in pn pools conf 2023-11-08 10:45:35 +01:00
3 changed files with 18 additions and 46 deletions

View file

@ -21,27 +21,6 @@ The **patch** part changes is incremented if multiple releases happen the same m
### Security
## [24.04]
### Added
* Prevent op_del to fail and able to remove web account when part of it is already removed
### Changed
* Add sendmail_path and open_basedir in LXC PHP pool configs
### Fixed
* letsencrypt: Add required check when retrieving certificate. (Avoid TypeError.)
* web-add.sh: Fix ssh group membership (#94)
### Removed
### Security
## [23.02] 2023-02-20
### Added

View file

@ -157,9 +157,6 @@ class LetsEncrypt
{
$stream = stream_context_create(array("ssl" => array("capture_peer_cert" => true)));
$read = stream_socket_client("ssl://" . $domain . ":443", $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $stream);
if ($read === false) {
return false;
}
$cont = stream_context_get_params($read);
return $cont;

View file

@ -14,7 +14,7 @@
set -e
VERSION="24.04"
VERSION="23.02"
HOME="/root"
CONTACT_MAIL="jdoe@example.org"
WWWBOUNCE_MAIL="jdoe@example.org"
@ -23,7 +23,7 @@ LOCAL_SCRIPT="$SCRIPTS_PATH/web-add.local.sh"
PRE_LOCAL_SCRIPT="$SCRIPTS_PATH/web-add.pre-local.sh"
TPL_AWSTATS="$SCRIPTS_PATH/awstats.XXX.conf"
SSH_GROUP="evolinux-ssh"
HOST="$(hostname -f)"
HOST="$(hostname -s)"
# Set to nginx if you use nginx and not apache
WEB_SERVER="apache"
@ -363,12 +363,14 @@ create_www_account() {
lxc-attach -n php"${php_version}" -- /usr/sbin/adduser --disabled-password --home "$HOME_DIR_USER"/www --no-create-home --shell /bin/false --gecos "WWW $in_login" www-"$in_login" --uid "$www_uid" --ingroup "$in_login" --force-badname >/dev/null
done
if grep -qE '^AllowUsers' /etc/ssh/sshd_config; then
if grep -qE '^AllowGroups' /etc/ssh/sshd_config; then
if ! grep -qE "^AllowGroups(\\s+\\S+)*(\\s+$SSH_GROUP)" /etc/ssh/sshd_config; then
sed -i "s/^AllowGroups .*/& $SSH_GROUP/" /etc/ssh/sshd_config
groupadd --force $SSH_GROUP
fi
usermod -a -G $SSH_GROUP "$in_login"
elif grep -qE '^AllowUsers' /etc/ssh/sshd_config; then
sed -i "s/^AllowUsers .*/& $in_login/" /etc/ssh/sshd_config
else
if getent group "$SSH_GROUP" 1>/dev/null 2>&1; then
usermod --append --groups "$SSH_GROUP" "$in_login"
fi
fi
/etc/init.d/ssh reload
@ -764,10 +766,8 @@ op_del() {
# Deactivate web vhost (apache or nginx)
if [ "$WEB_SERVER" == "apache" ]; then
if a2query -s "${login}" >/dev/null 2&>1; then
a2dissite "${login}.conf"
fi
rm -f /etc/apache2/sites-available/"$login.conf"
a2dissite "${login}.conf"
rm /etc/apache2/sites-available/"$login.conf"
apache2ctl configtest
@ -794,17 +794,17 @@ op_del() {
phpfpm_dir="/etc/php5/fpm/pool.d/"
initscript_path="/etc/init.d/php5-fpm"
fi
rm -f /var/lib/lxc/php"${php_version}"/rootfs/${phpfpm_dir}/"${login}".conf
rm /var/lib/lxc/php"${php_version}"/rootfs/${phpfpm_dir}/"${login}".conf
lxc-attach -n php"${php_version}" -- $initscript_path restart >/dev/null
done
elif [ "$WEB_SERVER" == "nginx" ]; then
rm -f /etc/nginx/sites-{available,enabled}/"$login"
rm -f /etc/munin/plugins/phpfpm_"${in_login}"*
rm /etc/nginx/sites-{available,enabled}/"$login"
rm /etc/munin/plugins/phpfpm_"${in_login}"*
nginx -t
fi
rm -f /etc/awstats/awstats."$login.conf"
rm /etc/awstats/awstats."$login.conf"
sed -i.bak "/-config=$login /d" /etc/cron.d/awstats
if [ "$WEB_SERVER" == "apache" ]; then
@ -813,18 +813,14 @@ op_del() {
fi
for php_version in "${PHP_VERSIONS[@]}"; do
if lxc-attach -n php"${php_version}" -- getent passwd www-"$login" &> /dev/null; then
if lxc-attach -n php"${php_version}" -- id www-"$login" &> /dev/null; then
lxc-attach -n php"${php_version}" -- userdel -f www-"$login"
fi
if lxc-attach -n php"${php_version}" -- getent passwd "$login" &> /dev/null; then
lxc-attach -n php"${php_version}" -- userdel -f "$login"
fi
lxc-attach -n php"${php_version}" -- userdel -f "$login"
done
fi
if getent passwd "$login" &> /dev/null; then
userdel -f "$login"
fi
userdel -f "$login"
sed -i.bak "/^$login:/d" /etc/aliases
if [ "$WEB_SERVER" == "apache" ]; then