Maint: firewall and routing use logger.Debug

- Remove SetVerbose and SetDebug from both
- Log routing teardown
- Default logging level set to info
This commit is contained in:
Quentin McGaw (desktop)
2021-07-23 18:20:18 +00:00
parent b23eb8f29d
commit 94b60d9f70
7 changed files with 57 additions and 76 deletions

View File

@@ -15,13 +15,11 @@ import (
// Configurator allows to change firewall rules and modify network routes.
type Configurator interface {
Version(ctx context.Context) (string, error)
SetEnabled(ctx context.Context, enabled bool) (err error)
SetVPNConnection(ctx context.Context, connection models.OpenVPNConnection) (err error)
SetAllowedPort(ctx context.Context, port uint16, intf string) (err error)
SetOutboundSubnets(ctx context.Context, subnets []net.IPNet) (err error)
RemoveAllowedPort(ctx context.Context, port uint16) (err error)
SetDebug()
// SetNetworkInformation is meant to be called only once
SetNetworkInformation(defaultInterface string, defaultGateway net.IP,
localNetworks []routing.LocalNetwork, localIP net.IP)
@@ -33,7 +31,6 @@ type configurator struct { //nolint:maligned
routing routing.Routing
iptablesMutex sync.Mutex
ip6tablesMutex sync.Mutex
debug bool
defaultInterface string
defaultGateway net.IP
localNetworks []routing.LocalNetwork
@@ -65,10 +62,6 @@ func NewConfigurator(logger logging.Logger, routing routing.Routing) Configurato
}
}
func (c *configurator) SetDebug() {
c.debug = true
}
func (c *configurator) SetNetworkInformation(
defaultInterface string, defaultGateway net.IP, localNetworks []routing.LocalNetwork, localIP net.IP) {
c.networkInfoMutex.Lock()