mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-06 16:07:22 +01:00
docker: disable the ufw firewall because it is not supported in a docker container and produces a lot of error output (by reverting a510e08f9e and setting an environment variable)
This commit is contained in:
@@ -20,7 +20,9 @@ function apt_install {
|
||||
}
|
||||
|
||||
function ufw_allow {
|
||||
# ufw has completely unhelpful output
|
||||
ufw allow $1 > /dev/null;
|
||||
if [ -z "$DISABLE_FIREWALL" ]; then
|
||||
# ufw has completely unhelpful output
|
||||
ufw allow $1 > /dev/null;
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,14 @@ apt_install python3
|
||||
|
||||
apt_install ntp fail2ban
|
||||
|
||||
# Turn on the firewall. First allow incoming SSH, then turn on the firewall.
|
||||
# Other ports will be opened at the point where we set up those services.
|
||||
apt_install ufw
|
||||
ufw_allow ssh;
|
||||
ufw --force enable;
|
||||
|
||||
if [ -z "$DISABLE_FIREWALL" ]; then
|
||||
# Turn on the firewall. First allow incoming SSH, then turn on the firewall.
|
||||
# Other ports will be opened at the point where we set up those services.
|
||||
#
|
||||
# Various virtualized environments like Docker and some VPSs don't provide
|
||||
# a kernel that supports iptables. To avoid error-like output in these cases,
|
||||
# let us disable the firewall.
|
||||
apt_install ufw
|
||||
ufw_allow ssh;
|
||||
ufw --force enable;
|
||||
fi
|
||||
Reference in New Issue
Block a user