Skip to content

Commit 9031dd0

Browse files
committed
Merge branch 'main' into release
2 parents 2398faf + 1968aa5 commit 9031dd0

File tree

29 files changed

+267
-155
lines changed

29 files changed

+267
-155
lines changed

CHANGELOG.md

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

4+
## [1.4.2] - Service release
5+
6+
- **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 issue caused by this bug! If you are unable to download the backup please do the following:
7+
8+
```
9+
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
10+
```
11+
12+
Then run the update via
13+
14+
```
15+
apt update && apt upgrade
16+
```
17+
18+
### Bugfixes
19+
20+
- Fix issue wit startup script for iptables / network (#1849) (@myrevery)
21+
- Fix problem with accidentally replacing nginx.conf during upgrade nginx (#1878 / @myrevery)
22+
- Fix issue with installing Ubuntu 18.04
23+
- Fix issue with login into file manger as admin user
24+
- Added proxy_extentions back to support older custom templates
25+
- Added the possibility to skip the forced reboot when interactive is set to no
26+
- Fixed an issue with modx template
27+
- Updated translations (Croatian, Czech and Italian)
28+
- Fixed an issue where users where not able to save / update web domains when POLICY_USER_EDIT_WEB_TEMPLATES is enabled (#1872)
29+
- Fixed an issue where admin users where not able to add new ssh key for users (#1870)
30+
- Fixed an issue where domain.com was not affected as a valid domain (#1874)
31+
- Fixed an issue where "development" icon was not removed on update to release (#1835)
32+
433
## [1.4.1] - Bug fix
534

635
- Fixed bug with 2FA enabled logins

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.1 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
5+
**Latest stable release:** Version 1.4.2 | [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-sys-roundcube

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ if [ -z "$HOMEDIR" ] || [ -z "$HESTIA_INSTALL_DIR" ]; then
5151
fi
5252

5353
if [ -z "$(echo "$DB_SYSTEM" | grep -w 'mysql')" ]; then
54-
echo "ERROR: Mysql not available. Instalation aborted"
54+
echo "ERROR: Mysql not available. Installation aborted"
5555
exit 2
5656
fi
5757

5858
if [ -d "/usr/share/roundcube" ]; then
59-
echo "ERROR: Install done from atp source unable to continue"
59+
echo "ERROR: Install done from apt source, unable to continue"
6060
exit 2;
6161
fi
6262

6363
# Get current version
6464
if [ -f "/var/lib/roundcube/index.php" ]; then
6565
version=$(cat $RC_INSTALL_DIR/index.php | grep -o -E '[0-9].[0-9].[0-9]+' | head -1);
6666
if [ "$version" == "$rc_v" ]; then
67-
echo "Error: Installed version ($version) is equal as the availble version ($rc_v)"
67+
echo "Error: Installed version ($version) is equal to the available version ($rc_v)"
6868
exit 2;
6969
else
7070
UPDATE="yes"

bin/v-add-web-domain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: add web domain
3-
# options: USER DOMAIN [IP] [ALIASES] [PROXY_EXTENSIONS] [RESTART]
3+
# options: USER DOMAIN [IP] [RESTART] [ALIASES] [PROXY_EXTENSIONS]
44
# labels: web
55
#
66
# example: v-add-web-domain admin wonderland.com 192.18.22.43 yes www.wonderland.com

bin/v-stop-firewall

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,30 @@ if [ -d "/etc/sysconfig" ]; then
7676
fi
7777
else
7878
/sbin/iptables-save > /etc/iptables.rules
79-
if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed"; then
80-
preup="/usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks"
79+
if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed" && [ -d /etc/netplan ] && [ -n "$(ls -A /etc/netplan 2>/dev/null)" ]; then
80+
preup="/usr/lib/networkd-dispatcher/routable.d/10-hestia-iptables"
8181
if [ ! -e "$preup" ]; then
82-
for iface in $(ip token | awk -F 'dev ' '{print $2}'); do
83-
if [ -z "$interfaces" ]; then
84-
interfaces=" \"\$IFACE\"==\"$iface\""
85-
else
86-
interfaces="$interfaces || \"\$IFACE\"==\"$iface\" ";
87-
fi
88-
done
8982
IFS='%'
90-
echo '#!/bin/bash' > $preup
83+
echo '#!/bin/sh' > $preup
9184
echo '' >> $preup
92-
echo 'if [['$interfaces']]; then' >> $preup
85+
echo 'if [ "$IFACE" = "'$(ip route list | awk '/default .+/ {print $5}' | uniq)'" ]; then' >> $preup
86+
[ -x "$(which ipset)" ] && echo " ${HESTIA}/bin/v-update-firewall-ipset" >> $preup
9387
echo ' sleep 3' >> $preup
9488
echo ' /sbin/iptables-restore < /etc/iptables.rules' >> $preup
9589
echo 'fi' >> $preup
9690
echo "exit 0" >> $preup
9791
chmod +x $preup
9892
fi
9993
else
100-
preup="/etc/network/if-pre-up.d/iptables"
94+
preup="/etc/network/if-pre-up.d/hestia-iptables"
10195
if [ ! -e "$preup" ]; then
96+
IFS='%'
10297
echo '#!/bin/sh' > $preup
103-
echo "/sbin/iptables-restore < /etc/iptables.rules" >> $preup
98+
echo '' >> $preup
99+
echo 'if [ "$IFACE" = "'$(ip route list | awk '/default .+/ {print $5}' | uniq)'" ]; then' >> $preup
100+
[ -x "$(which ipset)" ] && echo " ${HESTIA}/bin/v-update-firewall-ipset" >> $preup
101+
echo ' /sbin/iptables-restore < /etc/iptables.rules' >> $preup
102+
echo 'fi' >> $preup
104103
echo "exit 0" >> $preup
105104
chmod +x $preup
106105
fi

bin/v-update-firewall

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,27 +183,30 @@ if [ -d "/etc/sysconfig" ]; then
183183
fi
184184
else
185185
/sbin/iptables-save > /etc/iptables.rules
186-
if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed"; then
187-
preup="/usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks"
186+
if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed" && [ -d /etc/netplan ] && [ -n "$(ls -A /etc/netplan 2>/dev/null)" ]; then
187+
preup="/usr/lib/networkd-dispatcher/routable.d/10-hestia-iptables"
188188
if [ ! -e "$preup" ]; then
189189
IFS='%'
190-
echo '#!/bin/bash' > $preup
191-
echo '' >> $preup
192-
echo "${HESTIA}/bin/v-update-firewall-ipset" >> $preup
190+
echo '#!/bin/sh' > $preup
193191
echo '' >> $preup
194-
echo 'if [ "$IFACE" == "'$(/bin/ip token | awk -F 'dev ' '{print $2}')'" ]; then' >> $preup
192+
echo 'if [ "$IFACE" = "'$(ip route list | awk '/default .+/ {print $5}' | uniq)'" ]; then' >> $preup
193+
[ -x "$(which ipset)" ] && echo " ${HESTIA}/bin/v-update-firewall-ipset" >> $preup
195194
echo ' sleep 3' >> $preup
196195
echo ' /sbin/iptables-restore < /etc/iptables.rules' >> $preup
197196
echo 'fi' >> $preup
198197
echo "exit 0" >> $preup
199198
chmod +x $preup
200199
fi
201200
else
202-
preup="/etc/network/if-pre-up.d/iptables"
201+
preup="/etc/network/if-pre-up.d/hestia-iptables"
203202
if [ ! -e "$preup" ]; then
203+
IFS='%'
204204
echo '#!/bin/sh' > $preup
205-
echo "${HESTIA}/bin/v-update-firewall-ipset" >> $preup
206-
echo "/sbin/iptables-restore < /etc/iptables.rules" >> $preup
205+
echo '' >> $preup
206+
echo 'if [ "$IFACE" = "'$(ip route list | awk '/default .+/ {print $5}' | uniq)'" ]; then' >> $preup
207+
[ -x "$(which ipset)" ] && echo " ${HESTIA}/bin/v-update-firewall-ipset" >> $preup
208+
echo ' /sbin/iptables-restore < /etc/iptables.rules' >> $preup
209+
echo 'fi' >> $preup
207210
echo "exit 0" >> $preup
208211
chmod +x $preup
209212
fi

func/domain.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ add_web_config() {
231231
WEBTPL_LOCATION="$WEBTPL/$1/$WEB_BACKEND"
232232
fi
233233
fi
234-
234+
235+
# Note: Removing or renaming template variables will lead to broken custom templates.
236+
# -If possible custom templates should be automatically upgraded to use the new format
237+
# -Alternatively a depreciation period with proper notifications should be considered
238+
235239
cat "${WEBTPL_LOCATION}/$2" | \
236240
sed -e "s|%ip%|$local_ip|g" \
237241
-e "s|%domain%|$domain|g" \
@@ -248,6 +252,7 @@ add_web_config() {
248252
-e "s|%proxy_system%|$PROXY_SYSTEM|g" \
249253
-e "s|%proxy_port%|$PROXY_PORT|g" \
250254
-e "s|%proxy_ssl_port%|$PROXY_SSL_PORT|g" \
255+
-e "s/%proxy_extentions%/${PROXY_EXT//,/|}/g" \
251256
-e "s/%proxy_extensions%/${PROXY_EXT//,/|}/g" \
252257
-e "s|%user%|$user|g" \
253258
-e "s|%group%|$user|g" \
@@ -562,7 +567,7 @@ is_dns_fqnd() {
562567
r=$2
563568
fqdn_type=$(echo $t | grep "NS\|CNAME\|MX\|PTR\|SRV")
564569
tree_length=3
565-
if [ $t = 'CNAME' ]; then
570+
if [[ $t = 'CNAME' || $t = 'MX' ]]; then
566571
tree_length=2
567572
fi
568573

@@ -739,6 +744,10 @@ add_webmail_config() {
739744

740745
fi
741746

747+
# Note: Removing or renaming template variables will lead to broken custom templates.
748+
# -If possible custom templates should be automatically upgraded to use the new format
749+
# -Alternatively a depreciation period with proper notifications should be considered
750+
742751
cat $MAILTPL/$1/$2 | \
743752
sed -e "s|%ip%|$local_ip|g" \
744753
-e "s|%domain%|$WEBMAIL_ALIAS.$domain|g" \

func/upgrade.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,16 @@ upgrade_get_version() {
151151

152152
upgrade_set_version() {
153153
# Set new version number in hestia.conf
154-
sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
155-
echo "VERSION='$@'" >> $HESTIA/conf/hestia.conf
154+
$BIN/v-change-sys-config-value "VERSION" "$@"
155+
}
156+
157+
upgrade_set_branch() {
158+
159+
# Set branch in hestia.conf
160+
DISPLAY_VER=$(echo $@ | sed "s|~alpha||g" | sed "s|~beta||g");
161+
if [ "$DISPLAY_VER" = "$@" ]; then
162+
$BIN/v-change-sys-config-value "RELEASE_BRANCH" "release"
163+
fi
156164
}
157165

158166
upgrade_send_notification_to_panel () {

install/deb/filemanager/filegator/configuration.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
if (isset($_SESSION['user'])) {
1616
$v_user = $_SESSION['user'];
1717
}
18-
if (isset($_SESSION['look']) && ($_SESSION['userContext'] === 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] === 'no')) {
18+
if (isset($_SESSION['look']) && ($_SESSION['userContext'] === 'admin')) {
1919
$v_user = $_SESSION['look'];
2020
}
21+
if ((isset($_SESSION['look']) && ($_SESSION['look'] == 'admin') && ($_SESSION['POLICY_SYSTEM_PROTECTED_ADMIN'] == 'yes') )) {
22+
header('Location: /');
23+
}
2124
# Create filemanager sftp key if missing and trash it after 30 min
2225
if (! file_exists('/home/'.basename($v_user).'/.ssh/hst-filemanager-key')) {
2326
exec ("sudo /usr/local/hestia/bin/v-add-user-sftp-key " . escapeshellarg(basename($v_user)) . " 30", $output, $return_var);

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ server {
5858
fastcgi_index index.php;
5959
include /etc/nginx/fastcgi_params;
6060
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
61-
if ($request_uri ~* "/manager/|index.php") {
62-
set $no_cache 1;
63-
}
64-
if ($http_cookie ~ SESS) {
65-
set $no_cache 1;
66-
}
61+
62+
if ($request_uri ~* "/manager/|index.php") {
63+
set $no_cache 1;
64+
}
65+
if ($http_cookie ~ SESS) {
66+
set $no_cache 1;
67+
}
68+
}
6769
}
6870

6971
location /error/ {

0 commit comments

Comments
 (0)