Skip to content

Commit 377f968

Browse files
authored
Merge pull request hestiacp#1384 from hestiacp/staging/fixes
Staging/fixes
2 parents cc42865 + 9a0f661 commit 377f968

File tree

11 files changed

+53
-3
lines changed

11 files changed

+53
-3
lines changed

bin/v-add-firewall-ban

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ iptables="/sbin/iptables"
2424

2525
# Includes
2626
source $HESTIA/func/main.sh
27+
source $HESTIA/func/firewall.sh
2728
source $HESTIA/conf/hestia.conf
2829

2930

@@ -43,6 +44,9 @@ check_hestia_demo_mode
4344
# Action #
4445
#----------------------------------------------------------#
4546

47+
# Self heal iptables links
48+
heal_iptables_links
49+
4650
# Checking server ip
4751
if [ -e "$HESTIA/data/ips/$ip" ] || [ "$ip" = '127.0.0.1' ]; then
4852
exit

bin/v-add-firewall-chain

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ fi
3232

3333
# Includes
3434
source $HESTIA/func/main.sh
35+
source $HESTIA/func/firewall.sh
3536
source $HESTIA/conf/hestia.conf
3637

3738

@@ -50,6 +51,9 @@ check_hestia_demo_mode
5051
# Action #
5152
#----------------------------------------------------------#
5253

54+
# Self heal iptables links
55+
heal_iptables_links
56+
5357
# Checking known chains
5458
case $chain in
5559
SSH) # Get ssh port by reading ssh config file.

bin/v-delete-firewall-ban

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ iptables="/sbin/iptables"
2424

2525
# Includes
2626
source $HESTIA/func/main.sh
27+
source $HESTIA/func/firewall.sh
2728
source $HESTIA/conf/hestia.conf
2829

2930

@@ -43,6 +44,9 @@ check_hestia_demo_mode
4344
# Action #
4445
#----------------------------------------------------------#
4546

47+
# Self heal iptables links
48+
heal_iptables_links
49+
4650
# Checking ip in banlist
4751
conf="$HESTIA/data/firewall/banlist.conf"
4852
check_ip=$(grep "IP='$ip' CHAIN='$chain'" $conf 2>/dev/null)

bin/v-delete-firewall-chain

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ iptables="/sbin/iptables"
2323

2424
# Includes
2525
source $HESTIA/func/main.sh
26+
source $HESTIA/func/firewall.sh
2627
source $HESTIA/conf/hestia.conf
2728

2829

@@ -42,6 +43,9 @@ check_hestia_demo_mode
4243
# Action #
4344
#----------------------------------------------------------#
4445

46+
# Self heal iptables links
47+
heal_iptables_links
48+
4549
# Deleting chain
4650
chains=$HESTIA/data/firewall/chains.conf
4751
banlist=$HESTIA/data/firewall/banlist.conf

bin/v-stop-firewall

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ modprobe="/sbin/modprobe"
1919
# Includes
2020
source /etc/profile.d/hestia.sh
2121
source $HESTIA/func/main.sh
22+
source $HESTIA/func/firewall.sh
2223
source $HESTIA/conf/hestia.conf
2324

2425

@@ -36,6 +37,9 @@ check_hestia_demo_mode
3637
# Action #
3738
#----------------------------------------------------------#
3839

40+
# Self heal iptables links
41+
heal_iptables_links
42+
3943
# Creating temporary file
4044
tmp=$(mktemp)
4145

bin/v-unsuspend-cron-job

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ is_object_valid 'user' 'USER' "$user"
3232
is_object_valid 'cron' 'JOB' "$job"
3333
is_object_suspended 'cron' 'JOB' "$job"
3434

35+
# Perform verification if read-only mode is enabled
36+
check_hestia_demo_mode
37+
3538

3639
#----------------------------------------------------------#
3740
# Action #

bin/v-unsuspend-cron-jobs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ check_args '1' "$#" 'USER [RESTART]'
2929
is_format_valid 'user'
3030
is_object_valid 'user' 'USER' "$user"
3131

32+
# Perform verification if read-only mode is enabled
33+
check_hestia_demo_mode
34+
3235

3336
#----------------------------------------------------------#
3437
# Action #

bin/v-update-firewall

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ sysctl="/sbin/sysctl"
2020
# Includes
2121
source /etc/profile.d/hestia.sh
2222
source $HESTIA/func/main.sh
23+
source $HESTIA/func/firewall.sh
2324
source $HESTIA/conf/hestia.conf
2425

2526

@@ -34,6 +35,9 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
3435
# Action #
3536
#----------------------------------------------------------#
3637

38+
# Self heal iptables links
39+
heal_iptables_links
40+
3741
# Checking local IPv4 rules
3842
rules="$HESTIA/data/firewall/rules.conf"
3943

func/firewall.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
heal_iptables_links() {
3+
packages="iptables iptables-save iptables-restore"
4+
for package in $packages; do
5+
if [ ! -e "/sbin/${package}" ]; then
6+
if which ${package}; then
7+
ln -s "$(which ${package})" /sbin/${package}
8+
elif [ -e "/usr/sbin/${package}" ]; then
9+
ln -s /usr/sbin/${package} /sbin/${package}
10+
elif whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package}; then
11+
autoiptables=$(whereis -B /bin /sbin /usr/bin /usr/sbin -f -b ${package} | cut -d '' -f 2)
12+
if [ -x "$autoiptables" ]; then
13+
ln -s "$autoiptables" /sbin/${package}
14+
fi
15+
fi
16+
fi
17+
done
18+
}

src/deb/php/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: hestia-php
22
Package: hestia-php
33
Priority: optional
4-
Version: 7.4.12-1
4+
Version: 7.4.12
55
Section: admin
66
Maintainer: HestaCP <info@hestiacp.com>
77
Homepage: https://www.hestiacp.com

0 commit comments

Comments
 (0)