From 8307a5a4945b9313149f37b0b51c5a7a8d135f43 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Wed, 17 Jul 2019 19:17:35 +0300 Subject: [PATCH] + config: store/load "blocked_services" per-client setting --- home/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/home/config.go b/home/config.go index 9fa4cbad..f606ae03 100644 --- a/home/config.go +++ b/home/config.go @@ -37,6 +37,9 @@ type clientObject struct { ParentalEnabled bool `yaml:"parental_enabled"` SafeSearchEnabled bool `yaml:"safebrowsing_enabled"` SafeBrowsingEnabled bool `yaml:"safesearch_enabled"` + + UseGlobalBlockedServices bool `yaml:"use_global_blocked_services"` + BlockedServices []string `yaml:"blocked_services"` } type HTTPSServer struct { @@ -266,6 +269,9 @@ func parseConfig() error { ParentalEnabled: cy.ParentalEnabled, SafeSearchEnabled: cy.SafeSearchEnabled, SafeBrowsingEnabled: cy.SafeBrowsingEnabled, + + UseOwnBlockedServices: !cy.UseGlobalBlockedServices, + BlockedServices: cy.BlockedServices, } _, err = config.clients.Add(cli) if err != nil { @@ -317,6 +323,9 @@ func (c *configuration) write() error { ParentalEnabled: cli.ParentalEnabled, SafeSearchEnabled: cli.SafeSearchEnabled, SafeBrowsingEnabled: cli.SafeBrowsingEnabled, + + UseGlobalBlockedServices: !cli.UseOwnBlockedServices, + BlockedServices: cli.BlockedServices, } config.Clients = append(config.Clients, cy) }