Skip to content

Commit 0387031

Browse files
author
Kristan Kenney
committed
Merge branch 'staging/fixes' into main
2 parents 0727ef9 + b084e2f commit 0387031

32 files changed

+462
-131
lines changed

bin/v-add-firewall-ipset

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
8989
# Advanced: execute script with the same basename for aditional pre-processing
9090
# ex:
9191
if [ -x "${IPSET_PATH}/${IPSET_FILE}.sh" ]; then
92-
setpriv --clear-groups --reuid nobody --regid nogroup -- ${IPSET_PATH}/${IPSET_FILE}.sh "$ip_name" "$iplist_tempfile"
92+
preprocess_output="$(cat "$iplist_tempfile" | setpriv --clear-groups --reuid nobody --regid nogroup -- ${IPSET_PATH}/${IPSET_FILE}.sh "$ip_name" "$iplist_tempfile")"
93+
check_result $? "Preprocessing script failed (${IPSET_FILE}.sh)"
94+
[[ "$preprocess_output" ]] && echo "$preprocess_output" > "$iplist_tempfile"
9395
fi
9496

9597
elif [[ "$data_source" =~ ^script:/ ]]; then
@@ -113,6 +115,14 @@ if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
113115

114116
fi
115117

118+
# Cleanup ip list
119+
sed -r -i -e 's/[;#].*$//' -e 's/[ \t]*$//' -e '/^$/d' "$iplist_tempfile"
120+
if [[ $ip_version == 'v4' ]]; then
121+
sed -i -r -n -e '/^((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])/p' "$iplist_tempfile"
122+
elif [[ $ip_version == 'v6' ]]; then
123+
sed -i -r -n -e '/^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}/p' "$iplist_tempfile"
124+
fi
125+
116126
# Validate iplist file size
117127
iplist_size=$(sed -r -e '/^#|^$/d' "$iplist_tempfile" | wc -l)
118128
[[ "$iplist_size" -le $IPSET_MIN_SIZE ]] && check_result $E_INVALID "iplist file too small (<${IPSET_MIN_SIZE}), ignoring"

bin/v-add-letsencrypt-host

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
#----------------------------------------------------------#
1212

1313
# Argument definition
14-
user="admin"
1514
domain=$HOSTNAME
15+
user="$($HESTIA/bin/v-search-domain-owner "$domain" web)"
16+
[[ -z "$user" ]] && user="admin"
1617

1718
# Includes
1819
source $HESTIA/func/main.sh

bin/v-add-web-domain-ssl-hsts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ else
5454
fi
5555

5656
echo 'add_header Strict-Transport-Security "max-age=15768000;" always;' > $hstsconf
57-
echo "HTTP Strict Transport Security (HSTS) turned on for $domain."
5857

5958

6059
#----------------------------------------------------------#

bin/v-delete-web-domain-ssl-hsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ else
4949
fi
5050

5151
rm -f $hstsconf
52-
echo "HTTP Strict Transport Security (HSTS) turned off for $domain."
52+
5353

5454
#----------------------------------------------------------#
5555
# Hestia #

func/rebuild.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,9 @@ rebuild_mail_domain_conf() {
527527
# Setting HELO for mail domain
528528
if [ ! -z "$local_ip" ]; then
529529
IP_RDNS=$(is_ip_rdns_valid "$local_ip")
530+
sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf >/dev/null 2>&1
530531
if [ ! -z "$IP_RDNS" ]; then
531-
if [ -f /etc/exim4/mailhelo.conf ] && [ $(grep -s "^${domain}:" /etc/exim4/mailhelo.conf) ]; then
532-
sed -i "/^${domain}:/c\\${domain}:${IP_RDNS}" /etc/exim4/mailhelo.conf
533-
else
534-
echo ${domain}:${IP_RDNS} >> /etc/exim4/mailhelo.conf
535-
fi
536-
else
537-
sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf >/dev/null 2>&1
532+
echo ${domain}:${IP_RDNS} >> /etc/exim4/mailhelo.conf
538533
fi
539534
fi
540535

install/deb/templates/web/nginx/php-fpm/sendy.stpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ server {
8787

8888
include /etc/nginx/conf.d/phpmyadmin.inc*;
8989
include /etc/nginx/conf.d/phppgadmin.inc*;
90-
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
90+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
9191
}

install/deb/templates/web/nginx/php-fpm/wordpress.stpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ server {
7373
include /etc/nginx/conf.d/phppgadmin.inc*;
7474
include /etc/nginx/conf.d/webmail.inc*;
7575

76-
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
76+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
7777
}

install/hst-install-debian.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ if [ "$release" -eq 9 ]; then
4242
mariadb-client mariadb-common mariadb-server postgresql
4343
postgresql-contrib phppgadmin phpmyadmin mc flex whois rssh git idn zip
4444
sudo bc ftp lsof rrdtool quota e2fslibs bsdutils e2fsprogs curl
45-
imagemagick fail2ban dnsutils bsdmainutils cron hestia hestia-nginx
45+
imagemagick fail2ban dnsutils bsdmainutils cron hestia=${HESTIA_INSTALL_VER} hestia-nginx
4646
hestia-php expect libmail-dkim-perl unrar-free vim-common acl sysstat
47-
rsyslog ssh setpriv ipset libapache2-mod-ruid2"
47+
rsyslog openssh-server ssh setpriv ipset libapache2-mod-ruid2"
4848
elif [ "$release" -eq 10 ]; then
4949
software="nginx apache2 apache2-utils apache2-suexec-custom
5050
apache2-suexec-pristine libapache2-mod-fcgid libapache2-mod-php$fpm_v
@@ -60,8 +60,8 @@ elif [ "$release" -eq 10 ]; then
6060
phppgadmin mc flex whois git idn zip sudo bc ftp lsof rrdtool
6161
quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
6262
bsdmainutils cron hestia hestia-nginx hestia-php expect
63-
libmail-dkim-perl unrar-free vim-common acl sysstat rsyslog ssh util-linux
64-
ipset libapache2-mpm-itk"
63+
libmail-dkim-perl unrar-free vim-common acl sysstat rsyslog openssh-server
64+
ssh util-linux ipset libapache2-mpm-itk"
6565
fi
6666

6767
installer_dependencies="apt-transport-https curl dirmngr gnupg wget"

install/hst-install-ubuntu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ software="apache2 apache2.2-common apache2-suexec-custom apache2-utils
4242
php$fpm_v-imagick php$fpm_v-intl php$fpm_v-json php$fpm_v-mbstring
4343
php$fpm_v-opcache php$fpm_v-pspell php$fpm_v-readline php$fpm_v-xml
4444
postgresql postgresql-contrib proftpd-basic quota roundcube-core
45-
roundcube-mysql roundcube-plugins rrdtool rssh spamassassin sudo hestia
45+
roundcube-mysql roundcube-plugins rrdtool rssh spamassassin sudo hestia=${HESTIA_INSTALL_VER}
4646
hestia-nginx hestia-php vim-common vsftpd whois zip acl sysstat setpriv
47-
ipset libonig5 libzip5"
47+
ipset libonig5 libzip5 openssh-server ssh"
4848

4949
installer_dependencies="apt-transport-https curl dirmngr gnupg wget"
5050

web/add/db/index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242

4343
// Check password length
4444
if (empty($_SESSION['error_msg'])) {
45-
$pw_len = strlen($_POST['v_password']);
46-
if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg);
45+
if (!preg_match('/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$/', $_POST['v_password'])) { $_SESSION['error_msg'] = __('Password does not match the minimum requirements'); }
4746
}
4847

4948
// Protect input

0 commit comments

Comments
 (0)