Set tunneling options for (not) using community nodes

This commit is contained in:
Daniel
2022-08-30 13:27:18 +02:00
parent c459b0f4af
commit 770ce61b84
4 changed files with 34 additions and 14 deletions

View File

@@ -13,9 +13,12 @@ import (
"github.com/tevino/abool"
"golang.org/x/sync/singleflight"
"github.com/safing/portbase/api"
"github.com/safing/portbase/config"
"github.com/safing/portbase/log"
"github.com/safing/portbase/modules"
"github.com/safing/portmaster/compat"
"github.com/safing/portmaster/core"
_ "github.com/safing/portmaster/core/base"
"github.com/safing/portmaster/firewall/inspection"
"github.com/safing/portmaster/firewall/interception"
@@ -43,7 +46,14 @@ var (
ownPID = os.Getpid()
)
// Config variables for interception module.
var (
devMode config.BoolOption
apiListenAddress config.StringOption
)
func init() {
// TODO: Move interception module to own package (dir).
interceptionModule = modules.Register("interception", interceptionPrep, interceptionStart, interceptionStop, "base", "updates", "network", "notifications")
network.SetDefaultFirewallHandler(defaultHandler)
@@ -54,6 +64,9 @@ func interceptionPrep() error {
}
func interceptionStart() error {
devMode = config.Concurrent.GetAsBool(core.CfgDevModeKey, false)
apiListenAddress = config.GetAsString(api.CfgDefaultListenAddressKey, "")
if err := registerMetrics(); err != nil {
return err
}