Skip to content

Commit f4d8b2b

Browse files
committed
Merge branch 'main' into release
2 parents ec9874e + bb4be1e commit f4d8b2b

File tree

189 files changed

+6564
-5717
lines changed

Some content is hidden

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

189 files changed

+6564
-5717
lines changed

CHANGELOG.md

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

4+
## [1.4.13] - Service release
5+
6+
### Features
7+
- Introduce UPGRADE_MESSAGE variable to support custom messages in e-mail upgrade notification.
8+
9+
### Bugfixes
10+
- Improve the hostname check to prevent invalid hostnames or the use of an ip address (RFC1178).
11+
- Prevent CSRF from other domains / websites
12+
- Fix #2096 Hostname SSL got overwritten by mail.hostname.com certificate
13+
- Add small wait for /usr/bin/iptables-restore [Forum](https://forum.hestiacp.com/t/clean-install-arm64-does-not-start-after-reboot-v-start-service-iptables/4395/7) + Fixed v-add-firewall / v-delete-firewall function (#2112) @myrevery
14+
- Fix bug in v-change-sys-api. When using v-change-sys-api remove and then v-change-sys-api enable + custom release branch the resetting of api failed + no "error" output was producted
15+
- Improve error reporting PMA Single sign on function function
16+
- Fixed an issue in v-change-web-domain-name where webserserver where not able to start because old config files where not propperly deleted #2104
17+
- Fixed potential XSS vulnerability in /list/keys/ @wtwwer [Disclosure](https://huntr.dev/bounties/0fefa2f6-7024-44c8-87c7-4d01fb93403e/)
18+
- Removed /edit/file as it has been replaced by Filegator and part of the old Vesta Filemanager
19+
- Fixed potential External control / path vulnerability in /add/package @wtwwer [Disclosure](https://huntr.dev/bounties/e0a2c6ff-b4fe-45a2-9d79-1f4dc1b381ab/)
20+
- Add extra checks to prevent type juggling @vikychoi [Disclosure](https://huntr.dev/bounties/c24fb15c-3c84-45c8-af04-a660f8da388f/)
21+
- Improved and updated some missing translation strings @myrevery
22+
- Sync translations with Github
23+
424
## [1.4.12] - Service release
525

626
### Bugfixes

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.11 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
5+
**Latest stable release:** Version 1.4.13 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <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-letsencrypt-domain

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,12 +505,12 @@ if [ -z "$mail" ]; then
505505
ssl_enabled="$(get_object_value 'web' 'DOMAIN' "$domain" '$SSL')"
506506
ssl_force="$(get_object_value 'web' 'DOMAIN' "$domain" '$SSL_FORCE')"
507507
[[ "$ssl_enabled" = "yes" ]] && $BIN/v-delete-web-domain-ssl $user $domain > /dev/null 2>&1
508-
$BIN/v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home
508+
$BIN/v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home updatessl
509509
[[ "$ssl_force" = "yes" ]] && $BIN/v-add-web-domain-ssl-force $user $domain > /dev/null 2>&1
510510
else
511511
ssl_enabled="$(get_object_value 'mail' 'DOMAIN' "$root_domain" '$SSL')"
512512
[[ "$ssl_enabled" = "yes" ]] && $BIN/v-delete-mail-domain-ssl $user $root_domain > /dev/null 2>&1
513-
$BIN/v-add-mail-domain-ssl $user $root_domain $ssl_dir
513+
$BIN/v-add-mail-domain-ssl $user $root_domain $ssl_dir updatessl
514514
fi
515515

516516
if [ "$?" -ne '0' ]; then

bin/v-add-mail-domain

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,19 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
122122
if [ ! -z "$local_ip" ]; then
123123
echo "$local_ip" > $HOMEDIR/$user/conf/mail/$domain/ip
124124
fi
125-
126-
# Adding antispam protection
127-
if [ "$antispam" = 'yes' ]; then
128-
touch $HOMEDIR/$user/conf/mail/$domain/antispam
125+
126+
if [ -n "ANTIVIRUS_SYSTEM" ]; then
127+
# Adding antispam protection
128+
if [ "$antispam" = 'yes' ]; then
129+
touch $HOMEDIR/$user/conf/mail/$domain/antispam
130+
fi
129131
fi
130-
131-
# Adding antivirus protection
132-
if [ "$antivirus" = 'yes' ]; then
133-
touch $HOMEDIR/$user/conf/mail/$domain/antivirus
132+
133+
if [ -n "ANTISPAM_SYSTEM" ]; then
134+
# Adding antivirus protection
135+
if [ "$antivirus" = 'yes' ]; then
136+
touch $HOMEDIR/$user/conf/mail/$domain/antivirus
137+
fi
134138
fi
135139

136140
# Adding dkim support

bin/v-add-mail-domain-ssl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
user=$1
1717
domain=$2
1818
ssl_dir=$3
19-
restart="$3"
19+
restart="$4"
2020

2121
# Additional argument formatting
2222
if [[ "$domain" =~ [[:upper:]] ]]; then

bin/v-add-sys-firewall

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# info: add system firewall
33
# options: NONE
4-
# labels:
4+
# labels: panel
55
#
66
# example: v-add-sys-firewall
77
#
@@ -30,25 +30,18 @@ fi
3030
# Perform verification if read-only mode is enabled
3131
check_hestia_demo_mode
3232

33+
3334
#----------------------------------------------------------#
3435
# Action #
3536
#----------------------------------------------------------#
3637

37-
# Adding firewall directory
38-
mkdir -p $HESTIA/data/firewall/
39-
4038
# Adding default ruleset
41-
if [ ! -e "$HESTIA/data/firewall/rules.conf" ]; then
42-
cp $HESTIA/install/rhel/7/* $HESTIA/data/firewall/
39+
if [ -z "$(ls -A $HESTIA/data/firewall 2>/dev/null)" ]; then
40+
cp -rf $HESTIA_INSTALL_DIR/firewall $HESTIA/data/
4341
fi
4442

4543
# Updating FIREWAL_SYSTEM value
46-
if [ -z "$(grep FIREWALL_SYSTEM $HESTIA/conf/hestia.conf)" ]; then
47-
echo "FIREWALL_SYSTEM='iptables'" >> $HESTIA/conf/hestia.conf
48-
else
49-
sed -i "s/FIREWALL_SYSTEM.*/FIREWALL_SYSTEM='iptables'/g" \
50-
$HESTIA/conf/hestia.conf
51-
fi
44+
$BIN/v-change-sys-config-value "FIREWALL_SYSTEM" "iptables"
5245

5346
# Updating firewall rules
5447
$BIN/v-update-firewall
@@ -59,6 +52,7 @@ $BIN/v-update-firewall
5952
#----------------------------------------------------------#
6053

6154
# Logging
55+
$BIN/v-log-action "system" "Info" "Firewall" "System firewall enabled."
6256
log_event "$OK" "$ARGUMENTS"
6357

6458
exit

bin/v-add-user-package

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: adding user package
3-
# options: PKG_DIR PACKAGE [REWRITE]
3+
# options: tmpfile PACKAGE [REWRITE]
44
# labels:
55
#
66
# The function adds new user package to the system.
@@ -11,7 +11,7 @@
1111
#----------------------------------------------------------#
1212

1313
# Argument definition
14-
pkg_dir=$1
14+
tmpfile=$1
1515
package=$2
1616
rewrite=$3
1717

@@ -31,7 +31,7 @@ is_package_new() {
3131
}
3232

3333
is_package_consistent() {
34-
source $pkg_dir/$package.pkg
34+
source $tmpfile
3535
if [ "$WEB_DOMAINS" != 'unlimited' ]; then
3636
is_int_format_valid $WEB_DOMAINS 'WEB_DOMAINS'
3737
fi
@@ -78,7 +78,12 @@ is_format_valid 'pkg_dir' 'package'
7878
if [ "$rewrite" != 'yes' ]; then
7979
is_package_new
8080
fi
81-
is_package_valid "$pkg_dir"
81+
82+
if [ ! -f "$tmpfile" ]; then
83+
echo "$tmpfile does not exists"
84+
exit $E_NOTEXIST;
85+
fi
86+
8287
is_package_consistent
8388

8489
# Perform verification if read-only mode is enabled
@@ -89,7 +94,7 @@ check_hestia_demo_mode
8994
# Action #
9095
#----------------------------------------------------------#
9196

92-
cp -f $pkg_dir/$package.pkg $HESTIA/data/packages/
97+
cp -f $tmpfile $HESTIA/data/packages/$package.pkg
9398
chmod 644 $HESTIA/data/packages/$package.pkg
9499

95100

bin/v-change-sys-api

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ check_hestia_demo_mode
3737
if [ "$status" = "enable" ]; then
3838
if [ ! -f "$HESTIA/web/api/index.php" ]; then
3939
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/$RELEASE_BRANCH/web/api/index.php -O $HESTIA/web/api/index.php
40-
check_api_download=$(cat $HESTIA/web/api/index.php)
41-
if [ -z "$HESTIA/web/api/index.php" ]; then
42-
# Throw error message to user
43-
echo "ERROR: API installation failed."
44-
# Remove empty file created by wget output
45-
rm -f "$HESTIA/web/api/index.php"
46-
exit 1
40+
if [ ! -s $HESTIA/web/api/index.php ]; then
41+
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/api/index.php -O $HESTIA/web/api/index.php
42+
if [ ! -s $HESTIA/web/api/index.php ]; then
43+
# Throw error message to user
44+
echo "ERROR: API installation failed."
45+
# Remove empty file created by wget output
46+
rm -f "$HESTIA/web/api/index.php"
47+
exit 1
48+
fi
4749
fi
4850
else
4951
sed -i 's|die("Error: Disabled");|//die("Error: Disabled");|g' $HESTIA/web/api/index.php

bin/v-change-web-domain-name

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,30 @@ rm -f $HOMEDIR/$user/web/$new_domain/logs/$domain.*
8585
# Updating domain certificates
8686
if [ -e "$USER_DATA/ssl/$domain.crt" ]; then
8787
cd $USER_DATA/ssl
88-
mv $domain.crt $new_domain.crt
89-
mv $domain.ca $new_domain.ca
90-
mv $domain.pem $new_domain.pem
91-
mv $domain.key $new_domain.key
88+
mv $USER_DATA/ssl/$domain.crt $USER_DATA/ssl/$new_domain.crt
89+
mv $USER_DATA/ssl/$domain.ca $USER_DATA/ssl/$new_domain.ca
90+
mv $USER_DATA/ssl/$domain.pem $USER_DATA/ssl/$new_domain.pem
91+
mv $USER_DATA/ssl/$domain.key $USER_DATA/ssl/$new_domain.key
9292
rm -f $HOMEDIR/$user/conf/web/$domain/ssl/$domain.*
9393
fi
9494

95+
# Deleting vhost configuration
96+
del_web_config "$WEB_SYSTEM" "$TPL.tpl"
97+
# Deleting SSL configuration and certificates
98+
if [ "$SSL" = 'yes' ]; then
99+
del_web_config "$WEB_SYSTEM" "$TPL.stpl"
100+
fi
101+
102+
# Deleting proxy
103+
if [ ! -z "$PROXY_SYSTEM" ]; then
104+
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
105+
if [ "$SSL" = 'yes' ]; then
106+
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
107+
fi
108+
if [ -e "/etc/$PROXY_SYSTEM/conf.d/01_caching_pool.conf" ]; then
109+
sed -i "/=$domain:/d" /etc/$PROXY_SYSTEM/conf.d/01_caching_pool.conf
110+
fi
111+
fi
95112

96113
#----------------------------------------------------------#
97114
# Hestia #

bin/v-delete-sys-firewall

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,19 @@ check_hestia_demo_mode
3535
# Action #
3636
#----------------------------------------------------------#
3737

38+
# Updating FIREWALL_SYSTEM value
39+
$BIN/v-change-sys-config-value "FIREWALL_SYSTEM" ""
40+
3841
# Stopping firewall
3942
$BIN/v-stop-firewall
4043

41-
# Updating FIREWALL_SYSTEM value
42-
if [ -z "$(grep FIREWALL_SYSTEM $HESTIA/conf/hestia.conf)" ]; then
43-
echo "FIREWALL_SYSTEM=''" >> $HESTIA/conf/hestia.conf
44-
else
45-
sed -i "s/FIREWALL_SYSTEM=.*/FIREWALL_SYSTEM=''/g" $HESTIA/conf/hestia.conf
46-
fi
47-
4844

4945
#----------------------------------------------------------#
5046
# Hestia #
5147
#----------------------------------------------------------#
5248

5349
# Logging
54-
$BIN/v-log-action "system" "Error" "Firewall" "System firewall has been disabled."
50+
$BIN/v-log-action "system" "Warning" "Firewall" "System firewall disabled."
5551
log_event "$OK" "$ARGUMENTS"
5652

5753
exit

0 commit comments

Comments
 (0)