Skip to content

Commit 6ba3f77

Browse files
committed
Merge branch 'main' into release
2 parents b6c6dbd + 871dab5 commit 6ba3f77

File tree

132 files changed

+1612
-1541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+1612
-1541
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file.
33

44
## [1.4.2] - Service release
55

6+
### Features
7+
8+
- Include DMARC record in DNS record list #1836
9+
- Enabled phpMyAdmin Single Sign On support #1460
10+
- Add command to add / delete from API_ALLOWED_IP list (#1904)
11+
12+
### Bugfixes
13+
14+
- Improve the calculated disk size of a new backup estimated by excluding the exclude folders, mail accounts and database in backups (#1616) @Myself5
15+
- Improve v-update-firewall / v-stop-firewall to make it self healing (#1892) @myrevery
16+
- Update phpMyAdmin version to 1.5.1 (See https://www.phpmyadmin.net/news/2021/6/4/phpmyadmin-511-released/)
17+
- Fixed a bug after rebuilding mail with Exim4 and suspended domains (#1886)
18+
- Fixed "Allowed IP addresses for API" field with strange behaviour #1866
19+
- Fixed an issue where the "Saved confirmation" was not set due to a redirect #1879
20+
- Increased minimal memory requirements for ClamD / ClamAV. #1840
21+
- Restore of backup did not rebuild the "Forced SSL" and "HSTS" config on new account #1862
22+
- Keep changes made by /install/upgrade/manual/install_awstats_geopip.sh on update HestiaCP (via Discord)
23+
- Refactor/improve PHP and HTML code @s0t (#1860)
24+
- Fixed XSS vulnerability in login page and a few other locations @briansemrau / @numanturle
25+
- Delete old session after session_regenerate_id() @briansemrau
26+
- Improve error message when domain all ready exists on different account.
27+
- Fixed an issue where phpmyadmin did not update when Postgresql was available.
28+
- Webmail clients set to rainloop where not able to create a SSL certificate via LE #1913
29+
- Fixed an issue where plugin-hestia-change-pasword did not change the port on v-change-sys-port (Rainloop) #1895
30+
- Fixed an issue where HELO message was not set / error was created on NAT IP
31+
32+
## [1.4.2] - Service release
33+
634
- **NOTE:** During the 1.4.1 / 1.4.0 release we have introduced a bug for Ubuntu 20.04 and 18.04 users with multiple network ports on the server. This release will solve the problems caused by this bug! If you are unable to download the Hestia packages via apt. Run the following command via CLI or SSH as root
735

836
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[Hestia Control Panel](https://www.hestiacp.com/)
44
==================================================
5-
**Latest stable release:** Version 1.4.2 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
5+
**Latest stable release:** Version 1.4.3 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
66

77
**Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
88
**Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>

bin/v-add-fastcgi-cache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ source $HESTIA/conf/hestia.conf
3131
# Verifications #
3232
#----------------------------------------------------------#
3333

34-
check_args '2' "$#" 'USER DOMAIN DEBUG'
34+
check_args '2' "$#" 'USER DOMAIN [DURATION] [DEBUG] [RESTART]'
3535
is_format_valid 'user' 'domain'
3636
is_object_valid 'user' 'USER' "$user"
3737
is_object_unsuspended 'user' 'USER' "$user"
@@ -85,7 +85,7 @@ cat << EOF > $fastcgi
8585
set $no_cache 0;
8686
EOF
8787

88-
if [ ! -z "$debug" ]; then
88+
if [ "$debug" = 'yes' ]; then
8989
echo " add_header \"X-STATUS\" \"$status\";" >> $fastcgi
9090
fi
9191

bin/v-add-letsencrypt-domain

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,31 @@ for auth in $authz; do
315315
chown -R $user:$user $well_known
316316
fi
317317
else
318-
well_known="/var/lib/roundcube/.well-known"
319-
acme_challenge="$well_known/acme-challenge"
320-
mkdir -p $acme_challenge
321-
echo "$token.$THUMB" > $acme_challenge/$token
322-
chown -R $user:$user $well_known
318+
if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then
319+
conf="$HOMEDIR/$user/conf/mail/$root_domain/nginx.conf_letsencrypt"
320+
sconf="$HOMEDIR/$user/conf/mail/$root_domain/nginx.ssl.conf_letsencrypt"
321+
echo 'location ~ "^/\.well-known/acme-challenge/([-_A-Za-z0-9]+)$" {' \
322+
> $conf
323+
echo ' default_type text/plain;' >> $conf
324+
echo ' return 200 "$1.'$THUMB'";' >> $conf
325+
echo '}' >> $conf
326+
if [ ! -e "$sconf" ]; then
327+
ln -s "$conf" "$sconf"
328+
fi
329+
if [ ! -z "$PROXY_SYSTEM" ]; then
330+
$BIN/v-restart-proxy
331+
check_result $? "Proxy restart failed" > /dev/null
332+
fi
333+
else
334+
get_object_value 'mail' 'DOMAIN' "$domain" "WEBMAIL"
335+
if [ ! -z "$WEBMAIL" ]; then
336+
well_known="/var/lib/$WEBMAIL/.well-known"
337+
acme_challenge="$well_known/acme-challenge"
338+
mkdir -p $acme_challenge
339+
echo "$token.$THUMB" > $acme_challenge/$token
340+
chown -R $user:$user $well_known
341+
fi
342+
fi
323343
fi
324344
if [ "$WEB_SYSTEM" = 'nginx' ]; then
325345
$BIN/v-restart-web

bin/v-add-mail-domain-smtp-relay

100644100755
File mode changed.

bin/v-add-sys-api-ip

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# info: add ip adresss to allowed ip list api
3+
# options: IP
4+
# labels: hestia
5+
#
6+
# example: v-add-sys-api-ip 1.1.1.1
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
ip46=${1// /}
13+
14+
# Includes
15+
16+
# shellcheck source=/usr/local/hestia/func/main.sh
17+
source $HESTIA/func/main.sh
18+
# shellcheck source=/usr/local/hestia/func/ip.sh
19+
source $HESTIA/func/ip.sh
20+
# shellcheck source=/usr/local/hestia/conf/hestia.conf
21+
source $HESTIA/conf/hestia.conf
22+
23+
#----------------------------------------------------------#
24+
# Verifications #
25+
#----------------------------------------------------------#
26+
27+
check_args '1' "$#" 'IP'
28+
is_format_valid 'ip46'
29+
30+
# Perform verification if read-only mode is enabled
31+
check_hestia_demo_mode
32+
33+
34+
#----------------------------------------------------------#
35+
# Action #
36+
#----------------------------------------------------------#
37+
38+
if [ "$API_ALLOWED_IP" != "" ]; then
39+
$BIN/v-change-sys-config-value 'API_ALLOWED_IP' "$API_ALLOWED_IP,$ip46"
40+
else
41+
$BIN/v-change-sys-config-value 'API_ALLOWED_IP' "$ip46"
42+
fi
43+
44+
# Logging
45+
$BIN/v-log-action "system" "Warning" "System" "Added new IP address added to Allowed IP API (IP: $ip46)"
46+
log_event "$OK" "$ARGUMENTS"

bin/v-add-sys-smtp-relay

100644100755
File mode changed.

bin/v-add-user-composer

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# options: USER
44
# labels: hestia
55
#
6-
# example: v-add-user-composer user
6+
# example: v-add-user-composer user [version]
77
#
88
# The function adds support for composer (php dependency manager)
99
# Homepage: https://getcomposer.org/
@@ -15,6 +15,7 @@
1515

1616
# Argument definition
1717
user=$1
18+
version=${2-2}
1819

1920
if [ -z "$HESTIA" ]; then
2021
HESTIA="/usr/local/hestia"
@@ -31,8 +32,9 @@ source $HESTIA/conf/hestia.conf
3132
# Verifications #
3233
#----------------------------------------------------------#
3334

34-
check_args '1' "$#" 'USER'
35+
check_args '1' "$#" 'USER [VERSION]'
3536
is_format_valid 'user'
37+
is_number_format_valid "$version" "version"
3638
is_object_valid 'user' 'USER' "$user"
3739
is_object_unsuspended 'user' 'USER' "$user"
3840

@@ -78,7 +80,7 @@ if [[ "$signature" != $(sha384sum $COMPOSER_SETUP_FILE | cut -f 1 -d " ") ]]; th
7880
check_result $E_INVALID "Composer signature does not match"
7981
fi
8082

81-
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php "$COMPOSER_SETUP_FILE" --1 --quiet --install-dir="$COMPOSER_DIR" --filename=composer
83+
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php "$COMPOSER_SETUP_FILE" --quiet "--$version" --install-dir="$COMPOSER_DIR" --filename=composer
8284
check_result $? "Composer install failed"
8385

8486
[ -f "$COMPOSER_SETUP_FILE" ] && rm -f "$COMPOSER_SETUP_FILE"

bin/v-add-user-wp-cli

100644100755
File mode changed.

bin/v-backup-user

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,111 @@ source $HESTIA/func/backup.sh
3131
# shellcheck source=/usr/local/hestia/conf/hestia.conf
3232
source $HESTIA/conf/hestia.conf
3333

34+
# Return Disk Usage
35+
get_user_disk_usage() {
36+
u_usage=0
37+
web_exclusions=''
38+
mail_exclusions=''
39+
db_exclusions=''
40+
user_exclusions=''
41+
42+
# Parsing excludes
43+
if [ -e "$USER_DATA/backup-excludes.conf" ]; then
44+
web_exclusions=$(grep 'WEB=' $USER_DATA/backup-excludes.conf |\
45+
awk -F "WEB='" '{print $2}' | cut -f 1 -d \')
46+
mail_exclusions=$(grep 'MAIL=' $USER_DATA/backup-excludes.conf |\
47+
awk -F "MAIL='" '{print $2}' | cut -f 1 -d \')
48+
db_exclusions=$(grep 'DB=' $USER_DATA/backup-excludes.conf |\
49+
awk -F "DB='" '{print $2}' | cut -f 1 -d \')
50+
user_exclusions=$(grep 'USER=' $USER_DATA/backup-excludes.conf |\
51+
awk -F "USER='" '{print $2}' | cut -f 1 -d \')
52+
fi
53+
54+
if [ -f "$USER_DATA/web.conf" ] && [ "$web_exclusions" != '*' ]; then
55+
usage=0
56+
domains=$(grep 'DOMAIN=' $USER_DATA/web.conf |\
57+
awk -F "DOMAIN='" '{print $2}' | cut -f 1 -d \')
58+
59+
for domain in $domains; do
60+
exclusion=$(echo -e "$web_exclusions" |tr ',' '\n' |grep "^$domain$")
61+
if [ -z "$exclusion" ]; then
62+
# Defining home directory
63+
home_dir="$HOMEDIR/$user/web/$domain/"
64+
exlusion=$(echo -e "$web_exclusions" |tr ',' '\n' |grep "^$domain:")
65+
fargs=()
66+
67+
if [ ! -z "$exlusion" ]; then
68+
xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
69+
for xpath in $xdirs; do
70+
fargs+=(--exclude=$xpath)
71+
done
72+
fi
73+
74+
# Checking home directory exist
75+
if [ -e "$home_dir" ]; then
76+
disk_usage=$(nice -n 19 du -shm $home_dir ${fargs[@]} | cut -f 1 )
77+
u_usage=$((u_usage + disk_usage))
78+
fi
79+
fi
80+
done
81+
fi
82+
83+
if [ -f "$USER_DATA/mail.conf" ] && [ "$mail_exclusions" != '*' ]; then
84+
usage=0
85+
domains=$(grep 'DOMAIN=' $USER_DATA/mail.conf |\
86+
awk -F "DOMAIN='" '{print $2}' | cut -f 1 -d \')
87+
88+
for domain in $domains; do
89+
check_exl=$(echo "$mail_exclusions" |tr ',' '\n' |grep "^$domain$")
90+
if [ -f "$USER_DATA/mail/$domain.conf" ] && [ -z "$check_exl" ]; then
91+
accounts=$(grep 'ACCOUNT=' $USER_DATA/mail/$domain.conf |\
92+
awk -F "ACCOUNT='" '{print $2}' | cut -f 1 -d \')
93+
94+
for account in $accounts; do
95+
home_dir=$HOMEDIR/$user/mail/$domain/$account
96+
exclusion=$(echo "$mail_exclusions" |tr ',' '\n' |grep "$domain:")
97+
exclusion=$(echo "$exclusion" |tr ':' '\n' |grep -E "^$account|\*")
98+
99+
if [ -z "$exclusion" ] && [ -e "$home_dir" ]; then
100+
disk_usage=$(nice -n 19 du -shm $home_dir | cut -f 1 )
101+
u_usage=$((u_usage + disk_usage))
102+
fi
103+
done
104+
fi
105+
done
106+
fi
107+
108+
if [ -f "$USER_DATA/db.conf" ] && [ "$db_exclusions" != '*' ]; then
109+
usage=0
110+
databases=$(grep 'DB=' $USER_DATA/db.conf |\
111+
awk -F "DB='" '{print $2}' | cut -f 1 -d \')
112+
for database in $databases; do
113+
exclusion=$(echo "$db_exclusions" |tr ',' '\n' |grep "^$database$")
114+
if [ -z "$exclusion" ]; then
115+
# Get database values
116+
get_database_values
117+
118+
# Switching on db type
119+
case $DB_SYSTEM in
120+
mysql) get_mysql_disk_usage ;;
121+
pgsql) get_pgsql_disk_usage ;;
122+
esac
123+
u_usage=$((u_usage + usage))
124+
fi
125+
done
126+
fi
127+
128+
if [ "$user_exclusions" != '*' ]; then
129+
fargs=()
130+
for xpath in $(echo "$user_exclusions" |tr ',' '\n'); do
131+
fargs+=(--exclude=$xpath)
132+
done
133+
usage=$(du -shm $HOMEDIR/$user --exclude $HOMEDIR/$user/web --exclude $HOMEDIR/$user/mail --exclude $HOMEDIR/$user/conf ${fargs[@]} |cut -f 1 )
134+
u_usage=$((u_usage + usage))
135+
fi
136+
137+
echo ${u_usage}
138+
}
34139

35140
#----------------------------------------------------------#
36141
# Verifications #
@@ -73,7 +178,7 @@ subj="$user → backup failed"
73178
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
74179

75180
# Validate available disk space (take usage * 2, due to the backup handling)
76-
let u_disk=$(grep "U_DISK=" $HESTIA/data/users/$user/user.conf |cut -f 2 -d \')*2
181+
let u_disk=$(($(get_user_disk_usage) * 2))
77182
let v_disk=$(($(stat -f --format="%a*%S" $BACKUP)))/1024/1024
78183

79184
if [ "$u_disk" -gt "$v_disk" ]; then

0 commit comments

Comments
 (0)