Skip to content

Commit bd3ee31

Browse files
committed
Merge branch 'staging/1.4.10' into release
2 parents b81dd0a + 1d1ec4e commit bd3ee31

36 files changed

+406
-162
lines changed

.drone.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ steps:
2626
- name: Build Hestia package and install
2727
commands:
2828
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
29-
- name: Run Bats
29+
- name: Run system / user tests
3030
commands:
3131
- bats ./test/test.bats
32+
- name: Run restore tests
33+
commands:
3234
- bats ./test/restore.bats
35+
- name: Run config tests
36+
commands:
37+
- bats ./test/config-tests.bats
3338
- name: Run Check PHP
3439
commands:
3540
- ./test/check_php.sh
@@ -65,10 +70,15 @@ steps:
6570
- name: Build Hestia package install
6671
commands:
6772
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
68-
- name: Run Bats
73+
- name: Run system / user tests
6974
commands:
7075
- bats ./test/test.bats
76+
- name: Run restore tests
77+
commands:
7178
- bats ./test/restore.bats
79+
- name: Run config tests
80+
commands:
81+
- bats ./test/config-tests.bats
7282
- name: Run Check PHP
7383
commands:
7484
- ./test/check_php.sh
@@ -78,4 +88,4 @@ trigger:
7888

7989
---
8090
kind: signature
81-
hmac: f3763c63fcebe50a2ad24dc3fb2ab3191cba15750e4dd80be82cea87466d96bc
91+
hmac: bca7f80ac6198662bc658235d7345485213847f1c00f027e1439775e02776bc7

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [1.4.10] - Service release
5+
6+
### Features
7+
8+
- Added v-delete-firewall-ban ip all #2031
9+
- Include config tests for nginx/apache2 templates
10+
11+
### Bugfixes
12+
13+
- Fixed UI issues after upgrade jQuery + jQuery UI to last version (#2021 and #2032) + [forum](https://forum.hestiacp.com/t/confusion-about-send-welcome-email-checkbox/4259/11)
14+
- Fixed security issues in caching templates of Nginx when used as Reverse Proxy
15+
- Fixed an issue with deleting multiple mail accounts (#2047)
16+
- Fixed an issue with phpmailer + non latin characters (#2050) thanks @Faymir
17+
- Remove caching template for CraftCMS (#2039) @anvme
18+
419
## [1.4.9] - Service release
520

621
### Bugfixes

bin/v-change-sys-ip-helo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ if [ -z "$MAIL_SYSTEM" ]; then
2626
check_result "$E_NOTEXIST" "Mail system not installed"
2727
fi
2828

29+
if [ ! -e "$HESTIA/data/ips/$ip" ]; then
30+
exit;
31+
fi
32+
2933
#----------------------------------------------------------#
3034
# Verifications #
3135
#----------------------------------------------------------#

bin/v-delete-firewall-ban

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,35 @@ check_hestia_demo_mode
5050
# Self heal iptables links
5151
heal_iptables_links
5252

53-
# Checking ip in banlist
5453
conf="$HESTIA/data/firewall/banlist.conf"
55-
check_ip=$(grep "IP='$ip' CHAIN='$chain'" $conf 2>/dev/null)
56-
if [ -z "$check_ip" ]; then
57-
exit
54+
if [ "$chain" == "ALL" ]; then
55+
check_ip=$(grep "IP='$ip' CHAIN='*'" $conf)
56+
if [ -z "$check_ip" ]; then
57+
exit;
58+
fi
59+
grep "IP='$ip' CHAIN='*'" $conf | while read -r line ; do
60+
parse_object_kv_list $line
61+
62+
# Deleting ip from banlist
63+
sip=$(echo "$IP"| sed "s|/|\\\/|g")
64+
sed -i "/IP='$sip' CHAIN='$CHAIN'/d" $conf
65+
b=$($iptables -L fail2ban-$CHAIN --line-number -n|grep -w $ip|awk '{print $1}')
66+
$iptables -D fail2ban-$CHAIN $b 2>/dev/null
67+
done
68+
else
69+
# Checking ip in banlist
70+
check_ip=$(grep "IP='$ip' CHAIN='$chain'" $conf 2>/dev/null)
71+
if [ -z "$check_ip" ]; then
72+
exit
73+
fi
74+
75+
# Deleting ip from banlist
76+
sip=$(echo "$ip"| sed "s|/|\\\/|g")
77+
sed -i "/IP='$sip' CHAIN='$chain'/d" $conf
78+
b=$($iptables -L fail2ban-$chain --line-number -n|grep -w $ip|awk '{print $1}')
79+
$iptables -D fail2ban-$chain $b 2>/dev/null
5880
fi
5981

60-
# Deleting ip from banlist
61-
sip=$(echo "$ip"| sed "s|/|\\\/|g")
62-
sed -i "/IP='$sip' CHAIN='$chain'/d" $conf
63-
b=$($iptables -L fail2ban-$chain --line-number -n|grep -w $ip|awk '{print $1}')
64-
$iptables -D fail2ban-$chain $b 2>/dev/null
65-
6682
# Changing permissions
6783
chmod 660 $conf
6884

bin/v-delete-sys-ip

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ if [ ! -z "$PROXY_SYSTEM" ]; then
126126
fi
127127
fi
128128

129+
if [ ! -z "$MAIL_SYSTEM" ]; then
130+
if [ -z "$NAT" ]; then
131+
delete_ip_helo_value $ip
132+
else
133+
delete_ip_helo_value $NAT
134+
fi
135+
fi
129136

130137
#----------------------------------------------------------#
131138
# Hestia #

bin/v-list-mail-domain-dkim-dns

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ json_list() {
3030
echo -e "\t},"
3131
echo -e "\n\t\"mail._domainkey\": {"
3232
echo " \"TTL\": \"3600\","
33-
echo " \"TXT\": \"\\\"$pub\\\"\""
33+
echo " \"TXT\": \"'v=DKIM1; k=rsa; p=$pub'\""
3434
echo -e "\t}\n}"
3535
}
3636

@@ -39,20 +39,20 @@ shell_list() {
3939
echo "RECORD TTL TYPE VALUE"
4040
echo "------ --- ---- -----"
4141
echo "_domainkey 3600 IN TXT \"t=y; o=~;\""
42-
echo "mail._domainkey 3600 IN TXT \"k=rsa; p=$pub\""
42+
echo "mail._domainkey 3600 IN TXT \"v=DKIM1; k=rsa; p=$pub\""
4343
}
4444

4545
# PLAIN list function
4646
plain_list() {
4747
echo -e "_domainkey\t3600\tIN\tTXT\t\"t=y; o=~;\""
48-
echo -e "mail._domainkey\t3600\tIN\tTXT\t\"k=rsa; p=$pub\""
48+
echo -e "mail._domainkey\t3600\tIN\tTXT\t\"v=DKIM1; k=rsa; p=$pub\""
4949
}
5050

5151
# CSV list function
5252
csv_list() {
5353
echo "RECORD,TTL,IN,TYPE,VALUE"
5454
echo "_domainkey,3600,IN,TXT,\"\"t=y; o=~;\"\""
55-
echo "mail._domainkey,3600,IN,TXT,\"\"k=rsa; p=$pub\"\""
55+
echo "mail._domainkey,3600,IN,TXT,\"\"v=DKIM1; k=rsa; p=$pub\"\""
5656
}
5757

5858

func/domain.sh

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,43 @@ is_web_domain_new() {
4949

5050
# Web alias existence check
5151
is_web_alias_new() {
52-
web_alias=$(grep -wH "$1" $HESTIA/data/users/*/web.conf)
53-
if [ ! -z "$web_alias" ]; then
54-
a1=$(echo "$web_alias" |grep -F "'$1'" |cut -f 7 -d /)
55-
if [ ! -z "$a1" ] && [ "$2" == "web" ]; then
56-
check_result $E_EXISTS "Web alias $1 exists"
57-
fi
58-
if [ ! -z "$a1" ] && [ "$a1" != "$user" ]; then
59-
check_result $E_EXISTS "Web alias $1 exists"
60-
fi
61-
a2=$(echo "$web_alias" |grep -F "'$1," |cut -f 7 -d /)
62-
if [ ! -z "$a2" ] && [ "$2" == "web" ]; then
63-
check_result $E_EXISTS "Web alias $1 exists"
64-
fi
65-
if [ ! -z "$a2" ] && [ "$a2" != "$user" ]; then
66-
check_result $E_EXISTS "Web alias $1 exists"
67-
fi
68-
a3=$(echo "$web_alias" |grep -F ",$1," |cut -f 7 -d /)
69-
if [ ! -z "$a3" ] && [ "$2" == "web" ]; then
70-
check_result $E_EXISTS "Web alias $1 exists"
71-
fi
72-
if [ ! -z "$a3" ] && [ "$a3" != "$user" ]; then
73-
check_result $E_EXISTS "Web alias $1 exists"
74-
fi
75-
a4=$(echo "$web_alias" |grep -F ",$1'" |cut -f 7 -d /)
76-
if [ ! -z "$a4" ] && [ "$2" == "web" ]; then
77-
check_result $E_EXISTS "Web alias $1 exists"
78-
fi
79-
if [ ! -z "$a4" ] && [ "$a4" != "$user" ]; then
80-
check_result $E_EXISTS "Web alias $1 exists"
52+
grep -wH "$1" $HESTIA/data/users/*/web.conf | while read -r line ; do
53+
user=$(echo $line |cut -f 7 -d /)
54+
string=$(echo $line |cut -f 2- -d ':')
55+
parse_object_kv_list $string
56+
if [ ! -z "$ALIAS" ]; then
57+
a1=$(echo "'$ALIAS'" |grep -F "'$1'");
58+
if [ ! -z "$a1" ] && [ "$2" == "web" ]; then
59+
return $E_EXISTS
60+
fi
61+
if [ ! -z "$a1" ] && [ "$user" != "$user" ]; then
62+
return $E_EXISTS
63+
fi
64+
a2=$(echo "'$ALIAS'" |grep -F "'$1,")
65+
if [ ! -z "$a2" ] && [ "$2" == "web" ]; then
66+
return $E_EXISTS
67+
fi
68+
if [ ! -z "$a2" ] && [ "$user" != "$user" ]; then
69+
return $E_EXISTS
70+
fi
71+
a3=$(echo "'$ALIAS'" |grep -F ",$1," )
72+
if [ ! -z "$a3" ] && [ "$2" == "web" ]; then
73+
return $E_EXISTS
74+
fi
75+
if [ ! -z "$a3" ] && [ "$user" != "$user" ]; then
76+
return $E_EXISTS
77+
fi
78+
a4=$(echo "'$ALIAS'" |grep -F ",$1'")
79+
if [ ! -z "$a4" ] && [ "$2" == "web" ]; then
80+
return $E_EXISTS
81+
fi
82+
if [ ! -z "$a4" ] && [ "$user" != "$user" ]; then
83+
return $E_EXISTS
84+
fi
8185
fi
86+
done
87+
if [ $? -ne 0 ]; then
88+
check_result $E_EXISTS "Web alias $1 exists"
8289
fi
8390
}
8491

func/ip.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ update_ip_helo_value() {
5050
natip="$1"
5151

5252
# In case the IP is an NAT use the real ip address
53-
if [ ! -f $HESTIA/data/ips/$ip ]; then
53+
if [ ! -e "$HESTIA/data/ips/$ip" ]; then
5454
ip=$(get_real_ip $ip);
5555
fi
5656

@@ -74,6 +74,11 @@ update_ip_helo_value() {
7474
fi
7575
}
7676

77+
delete_ip_helo_value (){
78+
ip=$1
79+
sed -i "/^$ip:/d" /etc/${MAIL_SYSTEM}/mailhelo.conf
80+
}
81+
7782
# Update ip address value
7883
update_ip_value() {
7984
key="$1"
@@ -195,7 +200,7 @@ get_real_ip() {
195200
if [ -e "$HESTIA/data/ips/$1" ]; then
196201
echo $1
197202
else
198-
nat=$(grep -H "^NAT='$1'" $HESTIA/data/ips/*)
203+
nat=$(grep -H "^NAT='$1'" $HESTIA/data/ips/* | head -n1 )
199204
if [ ! -z "$nat" ]; then
200205
echo "$nat" |cut -f 1 -d : |cut -f 7 -d /
201206
fi

install/deb/php-fpm/multiphp.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pm.status_path = /status
1717

1818
php_admin_value[upload_tmp_dir] = /home/%user%/tmp
1919
php_admin_value[session.save_path] = /home/%user%/tmp
20-
php_admin_value[open_basedir] = /home/%user%/web/%domain%/public_html:/home/%user%/web/%domain%/private:/home/%user%/web/%domain%/public_shtml:/home/%user%/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt
20+
php_admin_value[open_basedir] = /home/%user%/web/%domain%/public_html:/home/%user%/web/%domain%/private:/home/%user%/web/%domain%/public_shtml:/home/%user%/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt
2121
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f admin@%domain%
2222

2323
env[PATH] = /usr/local/bin:/usr/bin:/bin

install/deb/templates/web/nginx/caching.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ ip=$3
66
home=$4
77
docroot=$5
88

9-
str="proxy_cache_path /var/cache/nginx/$domain levels=2"
10-
str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
9+
str="proxy_cache_path /var/cache/nginx/$domain levels=1:2"
10+
str="$str keys_zone=$domain:10m max_size=256m inactive=30m;"
1111
conf='/etc/nginx/conf.d/01_caching_pool.conf'
1212
if [ -e "$conf" ]; then
13-
if [ -z "$(grep "=${domain}:" $conf)" ]; then
14-
echo "$str" >> $conf
13+
if [ -n "$(grep "=${domain}:" $conf)" ]; then
14+
sed -i "/=${domain}:/d" $conf
1515
fi
16-
else
17-
echo "$str" >> $conf
1816
fi
19-
17+
echo "$str" >> $conf

0 commit comments

Comments
 (0)