mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Merge pull request #182 from safing/feature/quick-settings
Add quick setting support
This commit is contained in:
commit
a26b72c114
3 changed files with 64 additions and 8 deletions
|
@ -55,6 +55,10 @@ func registerConfig() error {
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayOrderAnnotation: cfgOptionAskWithSystemNotificationsOrder,
|
||||
config.CategoryAnnotation: "General",
|
||||
config.RequiresAnnotation: config.ValueRequirement{
|
||||
Key: core.CfgUseSystemNotificationsKey,
|
||||
Value: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -139,7 +139,7 @@ func registerConfiguration() error {
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayOrderAnnotation: cfgOptionDisableAutoPermitOrder,
|
||||
config.DisplayHintAnnotation: status.DisplayHintSecurityLevel,
|
||||
config.CategoryAnnotation: "Advanced",
|
||||
config.CategoryAnnotation: "Advanced",
|
||||
},
|
||||
PossibleValues: status.SecurityLevelValues,
|
||||
})
|
||||
|
@ -208,6 +208,23 @@ Examples:
|
|||
config.DisplayHintAnnotation: endpoints.DisplayHintEndpointList,
|
||||
config.DisplayOrderAnnotation: cfgOptionServiceEndpointsOrder,
|
||||
config.CategoryAnnotation: "Rules",
|
||||
config.QuickSettingsAnnotation: []config.QuickSetting{
|
||||
{
|
||||
Name: "SSH",
|
||||
Action: config.QuickMergeTop,
|
||||
Value: []string{"+ * tcp/22"},
|
||||
},
|
||||
{
|
||||
Name: "HTTP/s",
|
||||
Action: config.QuickMergeTop,
|
||||
Value: []string{"+ * tcp/80", "+ * tcp/443"},
|
||||
},
|
||||
{
|
||||
Name: "RDP",
|
||||
Action: config.QuickMergeTop,
|
||||
Value: []string{"+ * */3389"},
|
||||
},
|
||||
},
|
||||
},
|
||||
ValidationRegex: `^(\+|\-) [A-z0-9\.:\-*/]+( [A-z0-9/]+)?$`,
|
||||
})
|
||||
|
@ -248,7 +265,7 @@ Examples:
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayHintAnnotation: status.DisplayHintSecurityLevel,
|
||||
config.DisplayOrderAnnotation: cfgOptionFilterCNAMEOrder,
|
||||
config.CategoryAnnotation: "DNS",
|
||||
config.CategoryAnnotation: "DNS",
|
||||
},
|
||||
PossibleValues: status.SecurityLevelValues,
|
||||
})
|
||||
|
@ -269,7 +286,7 @@ Examples:
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayHintAnnotation: status.DisplayHintSecurityLevel,
|
||||
config.DisplayOrderAnnotation: cfgOptionFilterSubDomainsOrder,
|
||||
config.CategoryAnnotation: "DNS",
|
||||
config.CategoryAnnotation: "DNS",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -391,7 +408,7 @@ Examples:
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayHintAnnotation: status.DisplayHintSecurityLevel,
|
||||
config.DisplayOrderAnnotation: cfgOptionEnforceSPNOrder,
|
||||
config.CategoryAnnotation: "Advanced",
|
||||
config.CategoryAnnotation: "Advanced",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -413,7 +430,7 @@ Examples:
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayHintAnnotation: status.DisplayHintSecurityLevel,
|
||||
config.DisplayOrderAnnotation: cfgOptionRemoveOutOfScopeDNSOrder,
|
||||
config.CategoryAnnotation: "DNS",
|
||||
config.CategoryAnnotation: "DNS",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -435,7 +452,7 @@ Examples:
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayHintAnnotation: status.DisplayHintSecurityLevel,
|
||||
config.DisplayOrderAnnotation: cfgOptionRemoveBlockedDNSOrder,
|
||||
config.CategoryAnnotation: "DNS",
|
||||
config.CategoryAnnotation: "DNS",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -456,7 +473,7 @@ Examples:
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayHintAnnotation: status.DisplayHintSecurityLevel,
|
||||
config.DisplayOrderAnnotation: cfgOptionDomainHeuristicsOrder,
|
||||
config.CategoryAnnotation: "DNS",
|
||||
config.CategoryAnnotation: "DNS",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -477,7 +494,7 @@ Examples:
|
|||
Annotations: config.Annotations{
|
||||
config.DisplayHintAnnotation: status.DisplayHintSecurityLevel,
|
||||
config.DisplayOrderAnnotation: cfgOptionPreventBypassingOrder,
|
||||
config.CategoryAnnotation: "Advanced",
|
||||
config.CategoryAnnotation: "Advanced",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -112,8 +112,43 @@ Parameters:
|
|||
DefaultValue: defaultNameServers,
|
||||
ValidationRegex: fmt.Sprintf("^(%s|%s|%s)://.*", ServerTypeDoT, ServerTypeDNS, ServerTypeTCP),
|
||||
Annotations: config.Annotations{
|
||||
config.DisplayHintAnnotation: config.DisplayHintOrdered,
|
||||
config.DisplayOrderAnnotation: cfgOptionNameServersOrder,
|
||||
config.CategoryAnnotation: "Servers",
|
||||
config.QuickSettingsAnnotation: []config.QuickSetting{
|
||||
{
|
||||
Name: "Quad9",
|
||||
Action: config.QuickReplace,
|
||||
Value: []string{
|
||||
"dot://9.9.9.9:853?verify=dns.quad9.net&name=Quad9&blockedif=empty",
|
||||
"dot://149.112.112.112:853?verify=dns.quad9.net&name=Quad9&blockedif=empty",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "AdGuard",
|
||||
Action: config.QuickReplace,
|
||||
Value: []string{
|
||||
"dot://94.140.14.14:853?verify=dns.adguard.com&name=AdGuard&blockedif=zeroip",
|
||||
"dot://94.140.15.15:853?verify=dns.adguard.com&name=AdGuard&blockedif=zeroip",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Foundation for Applied Privacy",
|
||||
Action: config.QuickReplace,
|
||||
Value: []string{
|
||||
"dot://94.130.106.88:853?verify=dot1.applied-privacy.net&name=AppliedPrivacy",
|
||||
"dot://94.130.106.88:443?verify=dot1.applied-privacy.net&name=AppliedPrivacy",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Cloudflare",
|
||||
Action: config.QuickReplace,
|
||||
Value: []string{
|
||||
"dot://1.1.1.2:853?verify=cloudflare-dns.com&name=Cloudflare&blockedif=zeroip",
|
||||
"dot://1.0.0.2:853?verify=cloudflare-dns.com&name=Cloudflare&blockedif=zeroip",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue