Skip to content

Commit 2ad9599

Browse files
authored
Keep ports of not installed services closed (hestiacp#3871)
* Keep non installed services ports closed
1 parent e060aa0 commit 2ad9599

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

install/hst-install-debian.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,25 @@ cp -rf $HESTIA_COMMON_DIR/templates/web/skel/document_errors/* /var/www/document
12821282
cp -rf $HESTIA_COMMON_DIR/firewall $HESTIA/data/
12831283
rm -f $HESTIA/data/firewall/ipset/blacklist.sh $HESTIA/data/firewall/ipset/blacklist.ipv6.sh
12841284

1285+
# Delete rules for services that are not installed
1286+
if [ "$vsftpd" = "no" ] && [ "$proftpd" = "no" ]; then
1287+
# Remove FTP
1288+
sed -i "/COMMENT='FTP'/d" $HESTIA/data/firewall/rules.conf
1289+
fi
1290+
if [ "$exim" = "no" ]; then
1291+
# Remove SMTP
1292+
sed -i "/COMMENT='SMTP'/d" $HESTIA/data/firewall/rules.conf
1293+
fi
1294+
if [ "$dovecot" = "no" ]; then
1295+
# Remove IMAP / Dovecot
1296+
sed -i "/COMMENT='IMAP'/d" $HESTIA/data/firewall/rules.conf
1297+
sed -i "/COMMENT='POP3'/d" $HESTIA/data/firewall/rules.conf
1298+
fi
1299+
if [ "$named" = "no" ]; then
1300+
# Remove IMAP / Dovecot
1301+
sed -i "/COMMENT='DNS'/d" $HESTIA/data/firewall/rules.conf
1302+
fi
1303+
12851304
# Installing apis
12861305
cp -rf $HESTIA_COMMON_DIR/api $HESTIA/data/
12871306

install/hst-install-ubuntu.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,25 @@ cp -rf $HESTIA_COMMON_DIR/templates/web/skel/document_errors/* /var/www/document
12941294
cp -rf $HESTIA_COMMON_DIR/firewall $HESTIA/data/
12951295
rm -f $HESTIA/data/firewall/ipset/blacklist.sh $HESTIA/data/firewall/ipset/blacklist.ipv6.sh
12961296

1297+
# Delete rules for services that are not installed
1298+
if [ "$vsftpd" = "no" ] && [ "$proftpd" = "no" ]; then
1299+
# Remove FTP
1300+
sed -i "/COMMENT='FTP'/d" $HESTIA/data/firewall/rules.conf
1301+
fi
1302+
if [ "$exim" = "no" ]; then
1303+
# Remove SMTP
1304+
sed -i "/COMMENT='SMTP'/d" $HESTIA/data/firewall/rules.conf
1305+
fi
1306+
if [ "$dovecot" = "no" ]; then
1307+
# Remove IMAP / Dovecot
1308+
sed -i "/COMMENT='IMAP'/d" $HESTIA/data/firewall/rules.conf
1309+
sed -i "/COMMENT='POP3'/d" $HESTIA/data/firewall/rules.conf
1310+
fi
1311+
if [ "$named" = "no" ]; then
1312+
# Remove IMAP / Dovecot
1313+
sed -i "/COMMENT='DNS'/d" $HESTIA/data/firewall/rules.conf
1314+
fi
1315+
12971316
# Installing apis
12981317
cp -rf $HESTIA_COMMON_DIR/api $HESTIA/data/
12991318

0 commit comments

Comments
 (0)