From 625f1dffe12e3f2f7671aa01a0bb5a30b152fbd2 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Fri, 11 Sep 2020 15:52:46 +0300 Subject: [PATCH 1/2] * (dnsfilter): minor refactoring, comments --- dnsfilter/dnsfilter.go | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/dnsfilter/dnsfilter.go b/dnsfilter/dnsfilter.go index 30cd2fee..b3881686 100644 --- a/dnsfilter/dnsfilter.go +++ b/dnsfilter/dnsfilter.go @@ -316,11 +316,14 @@ func (d *Dnsfilter) CheckHost(host string, qtype uint16, setts *RequestFiltering var result Result var err error + // first - check rewrites, they have the highest priority result = d.processRewrites(host, qtype) if result.Reason == ReasonRewrite { return result, nil } + // Now check the hosts file -- do we have any rules for it? + // just like DNS rewrites, it has higher priority than filtering rules. if d.Config.AutoHosts != nil { ips := d.Config.AutoHosts.Process(host, qtype) if ips != nil { @@ -337,7 +340,9 @@ func (d *Dnsfilter) CheckHost(host string, qtype uint16, setts *RequestFiltering } } - // try filter lists first + // Then check the filter lists. + // if request is blocked -- it should be blocked. + // if it is whitelisted -- we should do nothing with it anymore. if setts.FilteringEnabled { result, err = d.matchHost(host, qtype, *setts) if err != nil { @@ -348,6 +353,7 @@ func (d *Dnsfilter) CheckHost(host string, qtype uint16, setts *RequestFiltering } } + // are there any blocked services? if len(setts.ServicesRules) != 0 { result = matchBlockedServicesRules(host, setts.ServicesRules) if result.Reason.Matched() { @@ -355,18 +361,7 @@ func (d *Dnsfilter) CheckHost(host string, qtype uint16, setts *RequestFiltering } } - if setts.SafeSearchEnabled { - result, err = d.checkSafeSearch(host) - if err != nil { - log.Info("SafeSearch: failed: %v", err) - return Result{}, nil - } - - if result.Reason.Matched() { - return result, nil - } - } - + // browsing security web service if setts.SafeBrowsingEnabled { result, err = d.checkSafeBrowsing(host) if err != nil { @@ -378,6 +373,7 @@ func (d *Dnsfilter) CheckHost(host string, qtype uint16, setts *RequestFiltering } } + // parental control web service if setts.ParentalEnabled { result, err = d.checkParental(host) if err != nil { @@ -389,6 +385,19 @@ func (d *Dnsfilter) CheckHost(host string, qtype uint16, setts *RequestFiltering } } + // apply safe search if needed + if setts.SafeSearchEnabled { + result, err = d.checkSafeSearch(host) + if err != nil { + log.Info("SafeSearch: failed: %v", err) + return Result{}, nil + } + + if result.Reason.Matched() { + return result, nil + } + } + return Result{}, nil } From 96512433477a6b32ac4e51e73899f82dc1c2a6e1 Mon Sep 17 00:00:00 2001 From: Artem Baskal Date: Tue, 15 Sep 2020 10:30:34 +0300 Subject: [PATCH 2/2] - client: Make dashboard card height constant Close #2039 Squashed commit of the following: commit 1d6dd461558403ea0ba813d5f665ecbaab9cd8ed Merge: 6ca80c91 2a5b0b8d Author: ArtemBaskal Date: Tue Sep 15 10:18:19 2020 +0300 Merge branch 'master' into fix/2039 commit 6ca80c9171da61a4bc02cec409299d0cfb96da49 Author: ArtemBaskal Date: Mon Sep 14 19:58:43 2020 +0300 Fix mobile media query commit 239c9ab29aaaef200bd2289fa116507ea5c2bf4c Author: ArtemBaskal Date: Mon Sep 14 13:59:39 2020 +0300 - client: Make dashboard card height constant --- client/src/components/Dashboard/index.js | 3 +-- client/src/components/ui/Card.css | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/src/components/Dashboard/index.js b/client/src/components/Dashboard/index.js index 07d8f94f..4d229ffb 100644 --- a/client/src/components/Dashboard/index.js +++ b/client/src/components/Dashboard/index.js @@ -82,7 +82,7 @@ const Dashboard = ({ {statsProcessing && } - {!statsProcessing &&
+ {!statsProcessing &&
diff --git a/client/src/components/ui/Card.css b/client/src/components/ui/Card.css index 5930d881..eb8a7963 100644 --- a/client/src/components/ui/Card.css +++ b/client/src/components/ui/Card.css @@ -19,7 +19,7 @@ max-height: 17.5rem; } -.card-table-overflow--limited.clients__table { +.dashboard .card-table-overflow--limited { max-height: 18rem; } @@ -122,6 +122,12 @@ } } +@media (min-width: 992px) { + .dashboard .card:not(.card--full) { + height: 22rem; + } +} + .card .logs__cell--red { background-color: #fff4f2; }