Fix updating the global profile and other bugs

This commit is contained in:
Daniel
2020-04-09 16:21:33 +02:00
parent ed2a67c127
commit a85fff6576
3 changed files with 8 additions and 8 deletions

View File

@@ -71,16 +71,16 @@ func updateGlobalConfigProfile(ctx context.Context, data interface{}) error {
// fill profile config options // fill profile config options
for key, value := range cfgStringOptions { for key, value := range cfgStringOptions {
profile.Config[key] = value profile.Config[key] = value()
} }
for key, value := range cfgStringArrayOptions { for key, value := range cfgStringArrayOptions {
profile.Config[key] = value profile.Config[key] = value()
} }
for key, value := range cfgIntOptions { for key, value := range cfgIntOptions {
profile.Config[key] = value profile.Config[key] = value()
} }
for key, value := range cfgBoolOptions { for key, value := range cfgBoolOptions {
profile.Config[key] = value profile.Config[key] = value()
} }
// save profile // save profile

View File

@@ -211,7 +211,7 @@ Examples:
if err != nil { if err != nil {
return err return err
} }
cfgOptionBlockInbound = config.Concurrent.GetAsInt(CfgOptionBlockInboundKey, 6) cfgOptionBlockInbound = config.Concurrent.GetAsInt(CfgOptionBlockInboundKey, 4)
cfgIntOptions[CfgOptionBlockInboundKey] = cfgOptionBlockInbound cfgIntOptions[CfgOptionBlockInboundKey] = cfgOptionBlockInbound
// Enforce SPN // Enforce SPN
@@ -247,7 +247,7 @@ Examples:
return err return err
} }
cfgOptionRemoveOutOfScopeDNS = config.Concurrent.GetAsInt(CfgOptionRemoveOutOfScopeDNSKey, 7) cfgOptionRemoveOutOfScopeDNS = config.Concurrent.GetAsInt(CfgOptionRemoveOutOfScopeDNSKey, 7)
cfgIntOptions[CfgOptionRemoveOutOfScopeDNSKey] = cfgOptionEnforceSPN cfgIntOptions[CfgOptionRemoveOutOfScopeDNSKey] = cfgOptionRemoveOutOfScopeDNS
// Filter DNS Records that would be blocked // Filter DNS Records that would be blocked
err = config.Register(&config.Option{ err = config.Register(&config.Option{
@@ -265,7 +265,7 @@ Examples:
return err return err
} }
cfgOptionRemoveBlockedDNS = config.Concurrent.GetAsInt(CfgOptionRemoveBlockedDNSKey, 7) cfgOptionRemoveBlockedDNS = config.Concurrent.GetAsInt(CfgOptionRemoveBlockedDNSKey, 7)
cfgIntOptions[CfgOptionRemoveBlockedDNSKey] = cfgOptionEnforceSPN cfgIntOptions[CfgOptionRemoveBlockedDNSKey] = cfgOptionRemoveBlockedDNS
return nil return nil
} }

View File

@@ -110,7 +110,7 @@ func (profile *Profile) parseConfig() error {
var err error var err error
var lastErr error var lastErr error
action, ok := profile.configPerspective.GetAsString(CfgOptionBlockInboundKey) action, ok := profile.configPerspective.GetAsString(CfgOptionDefaultActionKey)
if ok { if ok {
switch action { switch action {
case "permit": case "permit":