Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix module dependencies, split filter into interception and filter mo…
…dules
- Loading branch information
Showing
8 changed files
with
89 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package firewall | ||
|
||
import ( | ||
"github.com/safing/portbase/config" | ||
"github.com/safing/portbase/modules/subsystems" | ||
|
||
"github.com/safing/portbase/modules" | ||
|
||
// module dependencies | ||
_ "github.com/safing/portmaster/core" | ||
_ "github.com/safing/portmaster/profile" | ||
) | ||
|
||
var ( | ||
filterModule *modules.Module | ||
filterEnabled config.BoolOption | ||
) | ||
|
||
func init() { | ||
filterModule = modules.Register("filter", filterPrep, nil, nil, "core", "intel") | ||
subsystems.Register( | ||
"filter", | ||
"Privacy Filter", | ||
"DNS and Network Filter", | ||
filterModule, | ||
"config:filter/", | ||
&config.Option{ | ||
Name: "Enable Privacy Filter", | ||
Key: CfgOptionEnableFilterKey, | ||
Description: "Enable the Privacy Filter Subsystem to filter DNS queries and network requests.", | ||
OptType: config.OptTypeBool, | ||
ExpertiseLevel: config.ExpertiseLevelUser, | ||
ReleaseLevel: config.ReleaseLevelBeta, | ||
DefaultValue: true, | ||
}, | ||
) | ||
} | ||
|
||
func filterPrep() (err error) { | ||
err = registerConfig() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
filterEnabled = config.GetAsBool(CfgOptionEnableFilterKey, true) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters