diff --git a/client/src/components/ui/Icons.js b/client/src/components/ui/Icons.js index 24d05e65..8ef53ff2 100644 Binary files a/client/src/components/ui/Icons.js and b/client/src/components/ui/Icons.js differ diff --git a/client/src/helpers/constants.js b/client/src/helpers/constants.js index fb7e54db..9d5c2cf9 100644 --- a/client/src/helpers/constants.js +++ b/client/src/helpers/constants.js @@ -187,10 +187,6 @@ export const SERVICES = [ id: 'snapchat', name: 'Snapchat', }, - { - id: 'messenger', - name: 'Messenger', - }, { id: 'twitch', name: 'Twitch', diff --git a/home/blocked_services.go b/home/blocked_services.go index 41293b64..5c14499d 100644 --- a/home/blocked_services.go +++ b/home/blocked_services.go @@ -21,10 +21,9 @@ type svc struct { // client/src/components/ui/Icons.js var serviceRulesArray = []svc{ {"whatsapp", []string{"||whatsapp.net^", "||whatsapp.com^"}}, - {"facebook", []string{"||facebook.com^", "||facebook.net^", "||fbcdn.net^", "||fb.me^", "||fb.com^", "||fbsbx.com^"}}, + {"facebook", []string{"||facebook.com^", "||facebook.net^", "||fbcdn.net^", "||fb.me^", "||fb.com^", "||fbsbx.com^", "||messenger.com^"}}, {"twitter", []string{"||twitter.com^", "||t.co^", "||twimg.com^"}}, {"youtube", []string{"||youtube.com^", "||ytimg.com^", "||youtu.be^", "||googlevideo.com^", "||youtubei.googleapis.com^"}}, - {"messenger", []string{"||fb.com^", "||facebook.com^", "||messenger.com^"}}, {"twitch", []string{"||twitch.tv^", "||ttvnw.net^"}}, {"netflix", []string{"||nflxext.com^", "||netflix.com^"}}, {"instagram", []string{"||instagram.com^", "||cdninstagram.com^"}}, @@ -136,6 +135,12 @@ func initServices() { } } +// Return TRUE if a blocked service name is known +func blockedSvcKnown(s string) bool { + _, ok := serviceRules[s] + return ok +} + // ApplyBlockedServices - set blocked services settings for this DNS request func ApplyBlockedServices(setts *dnsfilter.RequestFilteringSettings, list []string) { setts.ServicesRules = []dnsfilter.ServiceEntry{} diff --git a/home/clients.go b/home/clients.go index 0de73af7..1c2b795b 100644 --- a/home/clients.go +++ b/home/clients.go @@ -140,11 +140,18 @@ func (clients *clientsContainer) addFromConfig(objects []clientObject) { SafeBrowsingEnabled: cy.SafeBrowsingEnabled, UseOwnBlockedServices: !cy.UseGlobalBlockedServices, - BlockedServices: cy.BlockedServices, Upstreams: cy.Upstreams, } + for _, s := range cy.BlockedServices { + if !blockedSvcKnown(s) { + log.Debug("Clients: skipping unknown blocked-service '%s'", s) + continue + } + cli.BlockedServices = append(cli.BlockedServices, s) + } + for _, t := range cy.Tags { if !clients.tagKnown(t) { log.Debug("Clients: skipping unknown tag '%s'", t) diff --git a/home/config.go b/home/config.go index 5590715e..09bdbd9e 100644 --- a/home/config.go +++ b/home/config.go @@ -234,6 +234,16 @@ 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 }