Add FIREWALL variable, refers to #171

This commit is contained in:
Quentin McGaw
2020-06-12 17:11:21 +00:00
parent a3d75f3d8b
commit 8cae369186
8 changed files with 52 additions and 0 deletions

View File

@@ -4,8 +4,15 @@ import (
"fmt"
"net"
"strings"
libparams "github.com/qdm12/golibs/params"
)
// GetFirewall obtains if the firewall should be enabled from the environment variable FIREWALL
func (r *reader) GetFirewall() (enabled bool, err error) {
return r.envParams.GetOnOff("FIREWALL", libparams.Default("on"))
}
// GetExtraSubnets obtains the CIDR subnets from the comma separated list of the
// environment variable EXTRA_SUBNETS
func (r *reader) GetExtraSubnets() (extraSubnets []net.IPNet, err error) {