* refactor: move blocked-services functions to dnsfilter

This commit is contained in:
Simon Zolin
2020-02-18 20:17:35 +03:00
parent e8129f15c7
commit 0789e4b20d
8 changed files with 51 additions and 51 deletions

View File

@@ -95,10 +95,6 @@ type dnsConfig struct {
FilteringEnabled bool `yaml:"filtering_enabled"` // whether or not use filter lists
FiltersUpdateIntervalHours uint32 `yaml:"filters_update_interval"` // time period to update filters (in hours)
DnsfilterConf dnsfilter.Config `yaml:",inline"`
// Names of services to block (globally).
// Per-client settings can override this configuration.
BlockedServices []string `yaml:"blocked_services"`
}
type tlsConfigSettings struct {
@@ -234,16 +230,6 @@ func parseConfig() error {
return err
}
bsvcs := []string{}
for _, s := range config.DNS.BlockedServices {
if !blockedSvcKnown(s) {
log.Debug("skipping unknown blocked-service '%s'", s)
continue
}
bsvcs = append(bsvcs, s)
}
config.DNS.BlockedServices = bsvcs
if !checkFiltersUpdateIntervalHours(config.DNS.FiltersUpdateIntervalHours) {
config.DNS.FiltersUpdateIntervalHours = 24
}