docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> }) <mask> } <mask> <mask> func TestClientsCustomUpstream(t *testing.T) { <mask> clients := clientsContainer{ <mask> testing: true, <mask> } <mask> clients.Init(nil, nil, nil, nil, nil) <mask> <mask> // Add client with upstreams. <mask> ok, err := clients.Add(&Client{ <mask> IDs: []string{"1.1.1.1", "1:2:3::4", "aa:aa:aa:aa:aa:aa"}, <mask> Name: "client1", </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove clients := clientsContainer{ testing: true, } clients.Init(nil, nil, nil, nil, nil) </s> add clients := newClientsContainer() </s> remove clients := clientsContainer{ testing: true, } clients.Init(nil, nil, nil, nil, nil) </s> add clients := newClientsContainer() </s> remove func TestClients(t *testing.T) { clients := clientsContainer{} clients.testing = true </s> add // newClientsContainer is a helper that creates a new clients container for // tests. func newClientsContainer() (c *clientsContainer) { c = &clientsContainer{ testing: true, } c.Init(nil, nil, nil, nil, &filtering.Config{}) </s> remove clients.Init(nil, nil, nil, nil, nil) </s> add return c } func TestClients(t *testing.T) { clients := newClientsContainer() </s> remove func TestSafeSearchCacheYandex(t *testing.T) { const domain = "yandex.ru" ss := newForTest(t, filtering.SafeSearchConfig{Enabled: false}) // Check host with disabled safesearch. res, err := ss.CheckHost(domain, dns.TypeA) </s> add func TestDefault_Update(t *testing.T) { conf := testConf ss, err := safesearch.NewDefault(conf, "", testCacheSize, testCacheTTL) </s> remove ips, err := ss.resolver.LookupIP(context.Background(), "ip", rewrite.NewCNAME) </s> add ss.log(log.DEBUG, "resolving %q", host) ips, err := ss.resolver.LookupIP(context.Background(), qtypeToProto(qtype), host)
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clients_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> type runtimeClientJSON struct { <mask> WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info"` <mask> <mask> Name string `json:"name"` <mask> IP netip.Addr `json:"ip"` <mask> Source clientSource `json:"source"` <mask> } <mask> <mask> type clientListJSON struct { </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> add Name string `json:"name"` </s> add "github.com/AdguardTeam/AdGuardHome/internal/filtering/safesearch" </s> remove // DefaultSafeSearch is the default safesearch struct. type DefaultSafeSearch struct { engine *urlfilter.DNSEngine safeSearchCache cache.Cache resolver filtering.Resolver cacheTime time.Duration </s> add // Default is the default safe search filter that uses filtering rules with the // dnsrewrite modifier. type Default struct { // mu protects engine. mu *sync.RWMutex // engine is the filtering engine that contains the DNS rewrite rules. // engine may be nil, which means that this safe search filter is disabled. engine *urlfilter.DNSEngine cache cache.Cache resolver filtering.Resolver logPrefix string cacheTTL time.Duration </s> remove // SearchHost returns a replacement address for the search engine host. SearchHost(host string, qtype uint16) (res *rules.DNSRewrite) // CheckHost checks host with safe search engine. </s> add // CheckHost checks host with safe search filter. CheckHost must be safe // for concurrent use. qtype must be either [dns.TypeA] or [dns.TypeAAAA]. </s> add // Update updates the configuration of the safe search filter. Update must // be safe for concurrent use. An implementation of Update may ignore some // fields, but it must document which. Update(conf SafeSearchConfig) (err error) </s> remove // setCacheResult stores data in cache for host. func (ss *DefaultSafeSearch) setCacheResult(host string, res filtering.Result) { expire := uint32(time.Now().Add(ss.cacheTime).Unix()) </s> add // qtypeToProto returns "ip4" for [dns.TypeA] and "ip6" for [dns.TypeAAAA]. // It panics for other types. func qtypeToProto(qtype rules.RRType) (proto string) { switch qtype { case dns.TypeA: return "ip4" case dns.TypeAAAA: return "ip6" default: panic(fmt.Errorf("safesearch: unsupported question type %s", dns.Type(qtype))) } } // fitToProto returns a non-nil IP address if ip is the correct protocol version // for qtype. qtype is expected to be either [dns.TypeA] or [dns.TypeAAAA]. func fitToProto(ip net.IP, qtype rules.RRType) (res net.IP) { ip4 := ip.To4() if qtype == dns.TypeA { return ip4 } if ip4 == nil { return ip } return nil } // setCacheResult stores data in cache for host. qtype is expected to be either // [dns.TypeA] or [dns.TypeAAAA]. func (ss *Default) setCacheResult(host string, qtype rules.RRType, res filtering.Result) { expire := uint32(time.Now().Add(ss.cacheTTL).Unix())
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep keep keep add keep keep keep keep
<mask> type runtimeClientJSON struct { <mask> WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info"` <mask> <mask> IP netip.Addr `json:"ip"` <mask> Source clientSource `json:"source"` <mask> } <mask> <mask> type clientListJSON struct { </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove Name string `json:"name"` </s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/filtering/safesearch" </s> remove // SearchHost returns a replacement address for the search engine host. SearchHost(host string, qtype uint16) (res *rules.DNSRewrite) // CheckHost checks host with safe search engine. </s> add // CheckHost checks host with safe search filter. CheckHost must be safe // for concurrent use. qtype must be either [dns.TypeA] or [dns.TypeAAAA]. </s> remove // DefaultSafeSearch is the default safesearch struct. type DefaultSafeSearch struct { engine *urlfilter.DNSEngine safeSearchCache cache.Cache resolver filtering.Resolver cacheTime time.Duration </s> add // Default is the default safe search filter that uses filtering rules with the // dnsrewrite modifier. type Default struct { // mu protects engine. mu *sync.RWMutex // engine is the filtering engine that contains the DNS rewrite rules. // engine may be nil, which means that this safe search filter is disabled. engine *urlfilter.DNSEngine cache cache.Cache resolver filtering.Resolver logPrefix string cacheTTL time.Duration </s> add // Update updates the configuration of the safe search filter. Update must // be safe for concurrent use. An implementation of Update may ignore some // fields, but it must document which. Update(conf SafeSearchConfig) (err error) </s> remove // setCacheResult stores data in cache for host. func (ss *DefaultSafeSearch) setCacheResult(host string, res filtering.Result) { expire := uint32(time.Now().Add(ss.cacheTime).Unix()) </s> add // qtypeToProto returns "ip4" for [dns.TypeA] and "ip6" for [dns.TypeAAAA]. // It panics for other types. func qtypeToProto(qtype rules.RRType) (proto string) { switch qtype { case dns.TypeA: return "ip4" case dns.TypeAAAA: return "ip6" default: panic(fmt.Errorf("safesearch: unsupported question type %s", dns.Type(qtype))) } } // fitToProto returns a non-nil IP address if ip is the correct protocol version // for qtype. qtype is expected to be either [dns.TypeA] or [dns.TypeAAAA]. func fitToProto(ip net.IP, qtype rules.RRType) (res net.IP) { ip4 := ip.To4() if qtype == dns.TypeA { return ip4 } if ip4 == nil { return ip } return nil } // setCacheResult stores data in cache for host. qtype is expected to be either // [dns.TypeA] or [dns.TypeAAAA]. func (ss *Default) setCacheResult(host string, qtype rules.RRType, res filtering.Result) { expire := uint32(time.Now().Add(ss.cacheTTL).Unix())
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> _ = aghhttp.WriteJSONResponse(w, r, data) <mask> } <mask> <mask> // jsonToClient converts JSON object to Client object. <mask> func jsonToClient(cj clientJSON) (c *Client) { <mask> var safeSearchConf filtering.SafeSearchConfig <mask> if cj.SafeSearchConf != nil { <mask> safeSearchConf = *cj.SafeSearchConf <mask> } else { <mask> // TODO(d.kolyshev): Remove after cleaning the deprecated </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove safeSearchConf = filtering.SafeSearchConfig{Enabled: cj.SafeSearchEnabled} </s> add safeSearchConf = filtering.SafeSearchConfig{ Enabled: cj.SafeSearchEnabled, } </s> add return c, nil </s> remove Upstreams: cj.Upstreams, </s> add if safeSearchConf.Enabled { err = c.setSafeSearch( safeSearchConf, clients.safeSearchCacheSize, clients.safeSearchCacheTTL, ) if err != nil { return nil, fmt.Errorf("creating safesearch for client %q: %w", c.Name, err) } </s> remove engine = urlfilter.NewDNSEngine(rs) log.Info("safesearch: filter %d: reset %d rules", listID, engine.RulesCount) return engine, nil } // type check var _ filtering.SafeSearch = (*DefaultSafeSearch)(nil) </s> add ss.engine = urlfilter.NewDNSEngine(rs) </s> remove // SearchHost implements the [filtering.SafeSearch] interface for *DefaultSafeSearch. func (ss *DefaultSafeSearch) SearchHost(host string, qtype uint16) (res *rules.DNSRewrite) { r, _ := ss.engine.MatchRequest(&urlfilter.DNSRequest{ Hostname: strings.ToLower(host), DNSType: qtype, }) rewritesRules := r.DNSRewrites() if len(rewritesRules) > 0 { return rewritesRules[0].DNSRewrite } </s> add ss.log(log.INFO, "reset %d rules", ss.engine.RulesCount) </s> remove // newResult creates Result object from rewrite rule. func (ss *DefaultSafeSearch) newResult( </s> add // searchHost looks up DNS rewrites in the internal DNS filtering engine. func (ss *Default) searchHost(host string, qtype rules.RRType) (res *rules.DNSRewrite) { ss.mu.RLock() defer ss.mu.RUnlock() if ss.engine == nil { return nil } r, _ := ss.engine.MatchRequest(&urlfilter.DNSRequest{ Hostname: strings.ToLower(host), DNSType: qtype, }) rewritesRules := r.DNSRewrites() if len(rewritesRules) > 0 { return rewritesRules[0].DNSRewrite } return nil } // newResult creates Result object from rewrite rule. qtype must be either // [dns.TypeA] or [dns.TypeAAAA]. func (ss *Default) newResult(
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> safeSearchConf = *cj.SafeSearchConf <mask> } else { <mask> // TODO(d.kolyshev): Remove after cleaning the deprecated <mask> // [clientJSON.SafeSearchEnabled] field. <mask> safeSearchConf = filtering.SafeSearchConfig{Enabled: cj.SafeSearchEnabled} <mask> <mask> // Set default service flags for enabled safesearch. <mask> if safeSearchConf.Enabled { <mask> safeSearchConf.Bing = true <mask> safeSearchConf.DuckDuckGo = true </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove func jsonToClient(cj clientJSON) (c *Client) { </s> add func (clients *clientsContainer) jsonToClient(cj clientJSON) (c *Client, err error) { </s> add return c, nil </s> remove clients.Init(nil, nil, nil, nil, nil) </s> add return c } func TestClients(t *testing.T) { clients := newClientsContainer() </s> remove func TestSafeSearchCacheYandex(t *testing.T) { const domain = "yandex.ru" ss := newForTest(t, filtering.SafeSearchConfig{Enabled: false}) // Check host with disabled safesearch. res, err := ss.CheckHost(domain, dns.TypeA) </s> add func TestDefault_Update(t *testing.T) { conf := testConf ss, err := safesearch.NewDefault(conf, "", testCacheSize, testCacheTTL) </s> remove log.Debug("safesearch: cache decoding: %s", err) </s> add ss.log(log.ERROR, "cache decoding: %s", err) </s> remove func TestClients(t *testing.T) { clients := clientsContainer{} clients.testing = true </s> add // newClientsContainer is a helper that creates a new clients container for // tests. func newClientsContainer() (c *clientsContainer) { c = &clientsContainer{ testing: true, } c.Init(nil, nil, nil, nil, &filtering.Config{})
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep keep keep keep replace replace replace replace keep keep keep keep replace keep
<mask> safeSearchConf.YouTube = true <mask> } <mask> } <mask> <mask> return &Client{ <mask> Name: cj.Name, <mask> IDs: cj.IDs, <mask> Tags: cj.Tags, <mask> UseOwnSettings: !cj.UseGlobalSettings, <mask> FilteringEnabled: cj.FilteringEnabled, <mask> ParentalEnabled: cj.ParentalEnabled, <mask> SafeBrowsingEnabled: cj.SafeBrowsingEnabled, <mask> safeSearchConf: safeSearchConf, <mask> UseOwnBlockedServices: !cj.UseGlobalBlockedServices, </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove BlockedServices: cj.BlockedServices, </s> add } </s> remove Upstreams: cj.Upstreams, </s> add if safeSearchConf.Enabled { err = c.setSafeSearch( safeSearchConf, clients.safeSearchCacheSize, clients.safeSearchCacheTTL, ) if err != nil { return nil, fmt.Errorf("creating safesearch for client %q: %w", c.Name, err) } </s> remove clients := clientsContainer{ testing: true, } clients.Init(nil, nil, nil, nil, nil) </s> add clients := newClientsContainer() </s> remove safeSearch, err := safesearch.NewDefaultSafeSearch( </s> add safeSearch, err := safesearch.NewDefault( </s> remove safeSearchConf = filtering.SafeSearchConfig{Enabled: cj.SafeSearchEnabled} </s> add safeSearchConf = filtering.SafeSearchConfig{ Enabled: cj.SafeSearchEnabled, }
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep replace keep replace
<mask> UseOwnBlockedServices: !cj.UseGlobalBlockedServices, <mask> BlockedServices: cj.BlockedServices, <mask> <mask> Upstreams: cj.Upstreams, </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove safeSearchConf: safeSearchConf, </s> add </s> remove return &Client{ Name: cj.Name, IDs: cj.IDs, Tags: cj.Tags, </s> add c = &Client{ safeSearchConf: safeSearchConf, Name: cj.Name, IDs: cj.IDs, Tags: cj.Tags, BlockedServices: cj.BlockedServices, Upstreams: cj.Upstreams, </s> remove log.Tracef("network:%v addr:%v", network, addr) </s> add log.Debug("home: customdial: dialing addr %q for network %s", addr, network) </s> remove qtype uint16, </s> add qtype rules.RRType, </s> remove qtype uint16, </s> add qtype rules.RRType,
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep keep keep add keep keep keep keep keep keep
<mask> if err != nil { <mask> return nil, fmt.Errorf("creating safesearch for client %q: %w", c.Name, err) <mask> } <mask> } <mask> } <mask> <mask> // clientToJSON converts Client object to JSON. <mask> func clientToJSON(c *Client) (cj *clientJSON) { <mask> // TODO(d.kolyshev): Remove after cleaning the deprecated <mask> // [clientJSON.SafeSearchEnabled] field. </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove Upstreams: cj.Upstreams, </s> add if safeSearchConf.Enabled { err = c.setSafeSearch( safeSearchConf, clients.safeSearchCacheSize, clients.safeSearchCacheTTL, ) if err != nil { return nil, fmt.Errorf("creating safesearch for client %q: %w", c.Name, err) } </s> remove func jsonToClient(cj clientJSON) (c *Client) { </s> add func (clients *clientsContainer) jsonToClient(cj clientJSON) (c *Client, err error) { </s> remove safeSearchConf = filtering.SafeSearchConfig{Enabled: cj.SafeSearchEnabled} </s> add safeSearchConf = filtering.SafeSearchConfig{ Enabled: cj.SafeSearchEnabled, } </s> remove return nil, fmt.Errorf("creating rule storage: %w", err) </s> add return fmt.Errorf("creating rule storage: %w", err) </s> remove log.Error("clients: init client safesearch %s: %s", cli.Name, err) </s> add log.Error("clients: init client safesearch %q: %s", cli.Name, err) </s> remove log.Debug("safesearch: failed to lookup addresses for %s: %s", host, err) </s> add ss.log(log.DEBUG, "looking up addresses for %q: %s", host, err)
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return <mask> } <mask> <mask> c := jsonToClient(cj) <mask> ok, err := clients.Add(c) <mask> if err != nil { <mask> aghhttp.Error(r, w, http.StatusBadRequest, "%s", err) <mask> <mask> return </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove c := jsonToClient(dj.Data) </s> add c, err := clients.jsonToClient(dj.Data) if err != nil { aghhttp.Error(r, w, http.StatusBadRequest, "%s", err) return } </s> add conf := *req err = d.safeSearch.Update(conf) if err != nil { aghhttp.Error(r, w, http.StatusBadRequest, "updating: %s", err) return } </s> remove log.Error("safesearch: cache encoding: %s", err) </s> add ss.log(log.ERROR, "cache encoding: %s", err) </s> remove dRes, err := ss.newResult(rewrite, qtype) </s> add fltRes, err := ss.newResult(rewrite, qtype) </s> remove log.Debug("safesearch: cache decoding: %s", err) </s> add ss.log(log.ERROR, "cache decoding: %s", err) </s> remove clients := clientsContainer{ testing: true, } clients.Init(nil, nil, nil, nil, nil) </s> add clients := newClientsContainer()
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return <mask> } <mask> <mask> c := jsonToClient(dj.Data) <mask> err = clients.Update(dj.Name, c) <mask> if err != nil { <mask> aghhttp.Error(r, w, http.StatusBadRequest, "%s", err) <mask> <mask> return </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove c := jsonToClient(cj) </s> add c, err := clients.jsonToClient(cj) if err != nil { aghhttp.Error(r, w, http.StatusBadRequest, "%s", err) return } </s> add conf := *req err = d.safeSearch.Update(conf) if err != nil { aghhttp.Error(r, w, http.StatusBadRequest, "updating: %s", err) return } </s> remove dRes, err := ss.newResult(rewrite, qtype) </s> add fltRes, err := ss.newResult(rewrite, qtype) </s> remove log.Error("safesearch: cache encoding: %s", err) </s> add ss.log(log.ERROR, "cache encoding: %s", err) </s> remove log.Debug("safesearch: failed to lookup addresses for %s: %s", host, err) </s> add ss.log(log.DEBUG, "looking up addresses for %q: %s", host, err) </s> remove log.Debug("safesearch: cache decoding: %s", err) </s> add ss.log(log.ERROR, "cache decoding: %s", err)
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/clientshttp.go
keep keep add keep keep keep keep keep keep
<mask> <mask> // LookupIP implements [filtering.Resolver] interface for safeSearchResolver. <mask> // It returns the slice of net.IP with IPv4 and IPv6 instances. <mask> func (r safeSearchResolver) LookupIP(_ context.Context, _, host string) (ips []net.IP, err error) { <mask> addrs, err := Context.dnsServer.Resolve(host) <mask> if err != nil { <mask> return nil, err <mask> } <mask> </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove log.Tracef("network:%v addr:%v", network, addr) </s> add log.Debug("home: customdial: dialing addr %q for network %s", addr, network) </s> remove func (ss *DefaultSafeSearch) CheckHost( </s> add func (ss *Default) CheckHost( </s> remove qtype uint16, </s> add qtype rules.RRType, </s> remove ips, err := ss.resolver.LookupIP(context.Background(), "ip", rewrite.NewCNAME) </s> add ss.log(log.DEBUG, "resolving %q", host) ips, err := ss.resolver.LookupIP(context.Background(), qtypeToProto(qtype), host) </s> remove if rewrite.NewCNAME == "" { </s> add host := rewrite.NewCNAME if host == "" { </s> remove var foundIP net.IP for _, ip := range ips { if ip.To4() != nil { foundIP = ip break } } res, err = ss.CheckHost(domain, dns.TypeA) </s> add res, err = ss.CheckHost("www.yandex.com", testQType)
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> config.DNS.DnsfilterConf.UserRules = slices.Clone(config.UserRules) <mask> config.DNS.DnsfilterConf.HTTPClient = Context.client <mask> <mask> config.DNS.DnsfilterConf.SafeSearchConf.CustomResolver = safeSearchResolver{} <mask> config.DNS.DnsfilterConf.SafeSearch, err = safesearch.NewDefaultSafeSearch( <mask> config.DNS.DnsfilterConf.SafeSearchConf, <mask> config.DNS.DnsfilterConf.SafeSearchCacheSize, <mask> time.Minute*time.Duration(config.DNS.DnsfilterConf.CacheTime), <mask> ) <mask> if err != nil { </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> add "default", </s> remove ss, err := safesearch.NewDefaultSafeSearch( </s> add err := cli.setSafeSearch( </s> remove safeSearch, err := safesearch.NewDefaultSafeSearch( </s> add safeSearch, err := safesearch.NewDefault( </s> remove cacheTime time.Duration, ) (ss *DefaultSafeSearch, err error) { engine, err := newEngine(filtering.SafeSearchListID, conf) if err != nil { return nil, err } </s> add cacheTTL time.Duration, ) (ss *Default, err error) { </s> remove c := jsonToClient(dj.Data) </s> add c, err := clients.jsonToClient(dj.Data) if err != nil { aghhttp.Error(r, w, http.StatusBadRequest, "%s", err) return } </s> remove c := jsonToClient(cj) </s> add c, err := clients.jsonToClient(cj) if err != nil { aghhttp.Error(r, w, http.StatusBadRequest, "%s", err) return }
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/home.go
keep keep add keep keep keep keep keep keep
<mask> config.DNS.DnsfilterConf.SafeSearchConf.CustomResolver = safeSearchResolver{} <mask> config.DNS.DnsfilterConf.SafeSearch, err = safesearch.NewDefault( <mask> config.DNS.DnsfilterConf.SafeSearchConf, <mask> config.DNS.DnsfilterConf.SafeSearchCacheSize, <mask> time.Minute*time.Duration(config.DNS.DnsfilterConf.CacheTime), <mask> ) <mask> if err != nil { <mask> return fmt.Errorf("initializing safesearch: %w", err) <mask> } </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove config.DNS.DnsfilterConf.SafeSearch, err = safesearch.NewDefaultSafeSearch( </s> add config.DNS.DnsfilterConf.SafeSearch, err = safesearch.NewDefault( </s> remove return nil, fmt.Errorf("creating rule storage: %w", err) </s> add return fmt.Errorf("creating rule storage: %w", err) </s> remove ss, err := safesearch.NewDefaultSafeSearch( </s> add err := cli.setSafeSearch( </s> remove Upstreams: cj.Upstreams, </s> add if safeSearchConf.Enabled { err = c.setSafeSearch( safeSearchConf, clients.safeSearchCacheSize, clients.safeSearchCacheTTL, ) if err != nil { return nil, fmt.Errorf("creating safesearch for client %q: %w", c.Name, err) } </s> remove safeSearch, err := safesearch.NewDefaultSafeSearch( </s> add safeSearch, err := safesearch.NewDefault( </s> add "",
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/home.go
keep keep keep add keep keep keep keep
<mask> <mask> // Connect to a remote server resolving hostname using our own DNS server. <mask> // <mask> // TODO(e.burkov): This messy logic should be decomposed and clarified. <mask> func customDialContext(ctx context.Context, network, addr string) (conn net.Conn, err error) { <mask> log.Debug("home: customdial: dialing addr %q for network %s", addr, network) <mask> <mask> host, port, err := net.SplitHostPort(addr) </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> remove log.Tracef("network:%v addr:%v", network, addr) </s> add log.Debug("home: customdial: dialing addr %q for network %s", addr, network) </s> add // // TODO(a.garipov): Support network. </s> remove log.Debug("safesearch: failed to lookup addresses for %s: %s", host, err) </s> add ss.log(log.DEBUG, "looking up addresses for %q: %s", host, err) </s> remove dRes, err := ss.newResult(rewrite, qtype) </s> add fltRes, err := ss.newResult(rewrite, qtype) </s> remove if log.GetLevel() >= log.DEBUG { timer := log.StartTimer() defer timer.LogElapsed("safesearch: lookup for %s", host) </s> add start := time.Now() defer func() { ss.log(log.DEBUG, "lookup for %q finished in %s", host, time.Since(start)) }() if qtype != dns.TypeA && qtype != dns.TypeAAAA { return filtering.Result{}, fmt.Errorf("unsupported question type %s", dns.Type(qtype)) </s> remove // setCacheResult stores data in cache for host. func (ss *DefaultSafeSearch) setCacheResult(host string, res filtering.Result) { expire := uint32(time.Now().Add(ss.cacheTime).Unix()) </s> add // qtypeToProto returns "ip4" for [dns.TypeA] and "ip6" for [dns.TypeAAAA]. // It panics for other types. func qtypeToProto(qtype rules.RRType) (proto string) { switch qtype { case dns.TypeA: return "ip4" case dns.TypeAAAA: return "ip6" default: panic(fmt.Errorf("safesearch: unsupported question type %s", dns.Type(qtype))) } } // fitToProto returns a non-nil IP address if ip is the correct protocol version // for qtype. qtype is expected to be either [dns.TypeA] or [dns.TypeAAAA]. func fitToProto(ip net.IP, qtype rules.RRType) (res net.IP) { ip4 := ip.To4() if qtype == dns.TypeA { return ip4 } if ip4 == nil { return ip } return nil } // setCacheResult stores data in cache for host. qtype is expected to be either // [dns.TypeA] or [dns.TypeAAAA]. func (ss *Default) setCacheResult(host string, qtype rules.RRType, res filtering.Result) { expire := uint32(time.Now().Add(ss.cacheTTL).Unix())
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/home.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Connect to a remote server resolving hostname using our own DNS server. <mask> // <mask> // TODO(e.burkov): This messy logic should be decomposed and clarified. <mask> func customDialContext(ctx context.Context, network, addr string) (conn net.Conn, err error) { <mask> log.Tracef("network:%v addr:%v", network, addr) <mask> <mask> host, port, err := net.SplitHostPort(addr) <mask> if err != nil { <mask> return nil, err <mask> } </s> Pull request 1803: 5685-fix-safe-search Updates #5685. Squashed commit of the following: commit 5312147abfa0914c896acbf1e88f8c8f1af90f2b Author: Ainar Garipov <[email protected]> Date: Thu Apr 6 14:09:44 2023 +0300 safesearch: imp tests, logs commit 298b5d24ce292c5f83ebe33d1e92329e4b3c1acc Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:36:16 2023 +0300 safesearch: fix filters, logging commit 63d6ca5d694d45705473f2f0410e9e0b49cf7346 Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:24:47 2023 +0300 all: dry; fix logs commit fdbf2f364fd0484b47b3161bf6f4581856fdf47b Author: Ainar Garipov <[email protected]> Date: Wed Apr 5 20:01:08 2023 +0300 all: fix safe search update </s> add // // TODO(a.garipov): Support network. </s> add // // TODO(a.garipov): Support network. </s> remove log.Debug("safesearch: failed to lookup addresses for %s: %s", host, err) </s> add ss.log(log.DEBUG, "looking up addresses for %q: %s", host, err) </s> remove dRes, err := ss.newResult(rewrite, qtype) </s> add fltRes, err := ss.newResult(rewrite, qtype) </s> remove cacheTime time.Duration, ) (ss *DefaultSafeSearch, err error) { engine, err := newEngine(filtering.SafeSearchListID, conf) if err != nil { return nil, err } </s> add cacheTTL time.Duration, ) (ss *Default, err error) { </s> remove ips, err := ss.resolver.LookupIP(context.Background(), "ip", rewrite.NewCNAME) </s> add ss.log(log.DEBUG, "resolving %q", host) ips, err := ss.resolver.LookupIP(context.Background(), qtypeToProto(qtype), host)
https://github.com/AdguardTeam/AdGuardHome/commit/61b4043775ecc3e06aebcdabc070b732c6dd0ff0
internal/home/home.go
keep keep keep keep replace keep keep keep keep keep
<mask> import React, { Fragment } from 'react'; <mask> import PropTypes from 'prop-types'; <mask> import { withNamespaces } from 'react-i18next'; <mask> <mask> import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList } from '../../../helpers/helpers'; <mask> <mask> const getFilterName = (id, filters, t) => { <mask> if (id === 0) { <mask> return t('filtered_custom_rules'); <mask> } </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> add checkFiltered, checkRewrite, checkWhiteList, checkBlackList, checkBlockedService, </s> remove import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE, CUSTOM_FILTERING_RULES_ID } from '../../helpers/constants'; </s> add import { SERVICES, TABLE_DEFAULT_PAGE_SIZE, CUSTOM_FILTERING_RULES_ID, FILTERED } from '../../helpers/constants'; </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => { </s> remove if (this.checkFiltered(reason)) { </s> add if (checkFiltered(reason)) { </s> remove } else if (this.checkRewrite(reason)) { </s> add } else if (checkRewrite(reason)) { </s> remove } else if (this.checkWhiteList(reason)) { </s> add } else if (checkWhiteList(reason)) {
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Filters/Check/Info.js
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> return ''; <mask> }; <mask> <mask> const getTitle = (reason, filterName, t) => { <mask> if (checkNotFilteredNotFound(reason)) { <mask> return t('check_not_found'); <mask> } <mask> <mask> if (checkRewrite(reason)) { </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove } else if (this.checkRewrite(reason)) { </s> add } else if (checkRewrite(reason)) { </s> remove if (this.checkFiltered(reason)) { </s> add if (checkFiltered(reason)) { </s> remove } else if (this.checkWhiteList(reason)) { </s> add } else if (checkWhiteList(reason)) { </s> remove import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList } from '../../../helpers/helpers'; </s> add import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList, checkSafeSearch, checkSafeBrowsing, checkParental, } from '../../../helpers/helpers'; import { FILTERED } from '../../../helpers/constants'; </s> add if (onlyFiltered) { return ( <div className={`card mb-0 p-3 ${color}`}> <div> <strong>{hostname}</strong> </div> <div>{title}</div> </div> ); } </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); }
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Filters/Check/Info.js
keep keep add keep keep keep keep
<mask> ); <mask> } <mask> <mask> return ( <mask> <Fragment> <mask> <div> <mask> {t('check_reason', { reason })} </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> add if (onlyFiltered) { return ( <div className={`card mb-0 p-3 ${color}`}> <div> <strong>{hostname}</strong> </div> <div>{title}</div> </div> ); } </s> remove checkFiltered = reason => reason.indexOf(FILTERED_REASON) === 0; checkRewrite = reason => reason === FILTERED_STATUS.REWRITE; checkWhiteList = reason => reason === FILTERED_STATUS.NOT_FILTERED_WHITE_LIST; checkBlackList = reason => reason === FILTERED_STATUS.FILTERED_BLACK_LIST; checkBlockedService = reason => reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; </s> add </s> remove const isFiltered = this.checkFiltered(reason); const isRewrite = this.checkRewrite(reason); </s> add const isFiltered = checkFiltered(reason); const isRewrite = checkRewrite(reason); </s> remove if (this.checkFiltered(reason)) { </s> add if (checkFiltered(reason)) { </s> remove const title = getTitle(reason, filterName, t); </s> add const onlyFiltered = checkSafeSearch(reason) || checkSafeBrowsing(reason) || checkParental(reason); const title = getTitle(reason, filterName, t, onlyFiltered); </s> remove } else if (this.checkWhiteList(reason)) { </s> add } else if (checkWhiteList(reason)) {
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Filters/Check/Info.js
keep keep keep keep replace keep keep keep keep keep
<mask> ip_addrs, <mask> t, <mask> }) => { <mask> const filterName = getFilterName(filter_id, filters, t); <mask> const title = getTitle(reason, filterName, t); <mask> const color = getColor(reason); <mask> <mask> return ( <mask> <div className={`card mb-0 p-3 ${color}`}> <mask> <div> </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> add if (onlyFiltered) { return ( <div className={`card mb-0 p-3 ${color}`}> <div> <strong>{hostname}</strong> </div> <div>{title}</div> </div> ); } </s> remove const filterKey = reason.replace(FILTERED_REASON, ''); </s> add const filterKey = reason.replace(FILTERED, ''); </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => { </s> remove const isFiltered = this.checkFiltered(reason); const isRewrite = this.checkRewrite(reason); </s> add const isFiltered = checkFiltered(reason); const isRewrite = checkRewrite(reason); </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); } </s> remove const isFiltered = this.checkFiltered(reason); const isBlackList = this.checkBlackList(reason); const isRewrite = this.checkRewrite(reason); const isWhiteList = this.checkWhiteList(reason); const isBlockedService = this.checkBlockedService(reason); </s> add const isFiltered = checkFiltered(reason); const isBlackList = checkBlackList(reason); const isRewrite = checkRewrite(reason); const isWhiteList = checkWhiteList(reason); const isBlockedService = checkBlockedService(reason);
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Filters/Check/Info.js
keep keep keep add keep keep keep keep
<mask> || checkParental(reason); <mask> const title = getTitle(reason, filterName, t, onlyFiltered); <mask> const color = getColor(reason); <mask> <mask> return ( <mask> <div className={`card mb-0 p-3 ${color}`}> <mask> <div> <mask> <strong>{hostname}</strong> </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove const title = getTitle(reason, filterName, t); </s> add const onlyFiltered = checkSafeSearch(reason) || checkSafeBrowsing(reason) || checkParental(reason); const title = getTitle(reason, filterName, t, onlyFiltered); </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => { </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); } </s> remove const isFiltered = this.checkFiltered(reason); const isRewrite = this.checkRewrite(reason); </s> add const isFiltered = checkFiltered(reason); const isRewrite = checkRewrite(reason); </s> remove const isFiltered = this.checkFiltered(reason); const isBlackList = this.checkBlackList(reason); const isRewrite = this.checkRewrite(reason); const isWhiteList = this.checkWhiteList(reason); const isBlockedService = this.checkBlockedService(reason); </s> add const isFiltered = checkFiltered(reason); const isBlackList = checkBlackList(reason); const isRewrite = checkRewrite(reason); const isWhiteList = checkWhiteList(reason); const isBlockedService = checkBlockedService(reason); </s> remove const filterKey = reason.replace(FILTERED_REASON, ''); </s> add const filterKey = reason.replace(FILTERED, '');
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Filters/Check/Info.js
keep keep keep add keep keep keep keep keep
<mask> import { <mask> formatTime, <mask> formatDateTime, <mask> isToday, <mask> } from '../../helpers/helpers'; <mask> import { SERVICES, TABLE_DEFAULT_PAGE_SIZE, CUSTOM_FILTERING_RULES_ID, FILTERED } from '../../helpers/constants'; <mask> import { getTrackerData } from '../../helpers/trackers/trackers'; <mask> import { formatClientCell } from '../../helpers/formatClientCell'; <mask> </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE, CUSTOM_FILTERING_RULES_ID } from '../../helpers/constants'; </s> add import { SERVICES, TABLE_DEFAULT_PAGE_SIZE, CUSTOM_FILTERING_RULES_ID, FILTERED } from '../../helpers/constants'; </s> remove import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList } from '../../../helpers/helpers'; </s> add import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList, checkSafeSearch, checkSafeBrowsing, checkParental, } from '../../../helpers/helpers'; import { FILTERED } from '../../../helpers/constants'; </s> remove } else if (this.checkRewrite(reason)) { </s> add } else if (checkRewrite(reason)) { </s> remove if (this.checkFiltered(reason)) { </s> add if (checkFiltered(reason)) { </s> remove } else if (this.checkWhiteList(reason)) { </s> add } else if (checkWhiteList(reason)) { </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); }
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> formatTime, <mask> formatDateTime, <mask> isToday, <mask> } from '../../helpers/helpers'; <mask> import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE, CUSTOM_FILTERING_RULES_ID } from '../../helpers/constants'; <mask> import { getTrackerData } from '../../helpers/trackers/trackers'; <mask> import { formatClientCell } from '../../helpers/formatClientCell'; <mask> <mask> import Filters from './Filters'; <mask> import PageTitle from '../ui/PageTitle'; </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> add checkFiltered, checkRewrite, checkWhiteList, checkBlackList, checkBlockedService, </s> remove import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList } from '../../../helpers/helpers'; </s> add import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList, checkSafeSearch, checkSafeBrowsing, checkParental, } from '../../../helpers/helpers'; import { FILTERED } from '../../../helpers/constants'; </s> remove } else if (this.checkRewrite(reason)) { </s> add } else if (checkRewrite(reason)) { </s> remove if (this.checkFiltered(reason)) { </s> add if (checkFiltered(reason)) { </s> remove } else if (this.checkWhiteList(reason)) { </s> add } else if (checkWhiteList(reason)) { </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); }
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> const TABLE_FIRST_PAGE = 0; <mask> const INITIAL_REQUEST = true; <mask> const INITIAL_REQUEST_DATA = ['', TABLE_FIRST_PAGE, INITIAL_REQUEST]; <mask> const FILTERED_REASON = 'Filtered'; <mask> <mask> class Logs extends Component { <mask> componentDidMount() { <mask> this.props.setLogsPage(TABLE_FIRST_PAGE); <mask> this.getLogs(...INITIAL_REQUEST_DATA); </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove const isFiltered = this.checkFiltered(reason); const isBlackList = this.checkBlackList(reason); const isRewrite = this.checkRewrite(reason); const isWhiteList = this.checkWhiteList(reason); const isBlockedService = this.checkBlockedService(reason); </s> add const isFiltered = checkFiltered(reason); const isBlackList = checkBlackList(reason); const isRewrite = checkRewrite(reason); const isWhiteList = checkWhiteList(reason); const isBlockedService = checkBlockedService(reason); </s> remove const isFiltered = this.checkFiltered(reason); const isRewrite = this.checkRewrite(reason); </s> add const isFiltered = checkFiltered(reason); const isRewrite = checkRewrite(reason); </s> remove const filterKey = reason.replace(FILTERED_REASON, ''); </s> add const filterKey = reason.replace(FILTERED, ''); </s> add FILTERED_SAFE_SEARCH: 'FilteredSafeSearch', FILTERED_SAFE_BROWSING: 'FilteredSafeBrowsing', FILTERED_PARENTAL: 'FilteredParental', </s> remove const title = getTitle(reason, filterName, t); </s> add const onlyFiltered = checkSafeSearch(reason) || checkSafeBrowsing(reason) || checkParental(reason); const title = getTitle(reason, filterName, t, onlyFiltered); </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => {
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Logs/index.js
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> </div> <mask> ); <mask> } <mask> <mask> checkFiltered = reason => reason.indexOf(FILTERED_REASON) === 0; <mask> <mask> checkRewrite = reason => reason === FILTERED_STATUS.REWRITE; <mask> <mask> checkWhiteList = reason => reason === FILTERED_STATUS.NOT_FILTERED_WHITE_LIST; <mask> <mask> checkBlackList = reason => reason === FILTERED_STATUS.FILTERED_BLACK_LIST; <mask> <mask> checkBlockedService = reason => reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; <mask> <mask> getDateCell = row => CellWrap( <mask> row, <mask> (isToday(row.value) ? formatTime : formatDateTime), <mask> formatDateTime, <mask> ); </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); } </s> remove if (this.checkFiltered(reason)) { </s> add if (checkFiltered(reason)) { </s> remove const filterKey = reason.replace(FILTERED_REASON, ''); </s> add const filterKey = reason.replace(FILTERED, ''); </s> remove const isFiltered = this.checkFiltered(reason); const isBlackList = this.checkBlackList(reason); const isRewrite = this.checkRewrite(reason); const isWhiteList = this.checkWhiteList(reason); const isBlockedService = this.checkBlockedService(reason); </s> add const isFiltered = checkFiltered(reason); const isBlackList = checkBlackList(reason); const isRewrite = checkRewrite(reason); const isWhiteList = checkWhiteList(reason); const isBlockedService = checkBlockedService(reason); </s> remove import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList } from '../../../helpers/helpers'; </s> add import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList, checkSafeSearch, checkSafeBrowsing, checkParental, } from '../../../helpers/helpers'; import { FILTERED } from '../../../helpers/constants'; </s> add if (onlyFiltered) { return ( <div className={`card mb-0 p-3 ${color}`}> <div> <strong>{hostname}</strong> </div> <div>{title}</div> </div> ); }
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Logs/index.js
keep keep keep replace replace replace replace replace keep keep replace keep keep
<mask> const { t, filtering } = this.props; <mask> const { filters } = filtering; <mask> <mask> const isFiltered = this.checkFiltered(reason); <mask> const isBlackList = this.checkBlackList(reason); <mask> const isRewrite = this.checkRewrite(reason); <mask> const isWhiteList = this.checkWhiteList(reason); <mask> const isBlockedService = this.checkBlockedService(reason); <mask> const isBlockedCnameIp = originalAnswer; <mask> <mask> const filterKey = reason.replace(FILTERED_REASON, ''); <mask> const parsedFilteredReason = t('query_log_filtered', { filter: filterKey }); <mask> const currentService = SERVICES.find(service => service.id === original.serviceName); </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove const isFiltered = this.checkFiltered(reason); const isRewrite = this.checkRewrite(reason); </s> add const isFiltered = checkFiltered(reason); const isRewrite = checkRewrite(reason); </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); } </s> remove const title = getTitle(reason, filterName, t); </s> add const onlyFiltered = checkSafeSearch(reason) || checkSafeBrowsing(reason) || checkParental(reason); const title = getTitle(reason, filterName, t, onlyFiltered); </s> remove const FILTERED_REASON = 'Filtered'; </s> add </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => {
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Logs/index.js
keep keep keep keep replace replace keep keep keep keep keep
<mask> getClientCell = (row) => { <mask> const { original } = row; <mask> const { t } = this.props; <mask> const { reason, domain } = original; <mask> const isFiltered = this.checkFiltered(reason); <mask> const isRewrite = this.checkRewrite(reason); <mask> <mask> return ( <mask> <Fragment> <mask> <div className="logs__row logs__row--overflow logs__row--column"> <mask> {formatClientCell(row, t)} </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove const isFiltered = this.checkFiltered(reason); const isBlackList = this.checkBlackList(reason); const isRewrite = this.checkRewrite(reason); const isWhiteList = this.checkWhiteList(reason); const isBlockedService = this.checkBlockedService(reason); </s> add const isFiltered = checkFiltered(reason); const isBlackList = checkBlackList(reason); const isRewrite = checkRewrite(reason); const isWhiteList = checkWhiteList(reason); const isBlockedService = checkBlockedService(reason); </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); } </s> add if (onlyFiltered) { return ( <div className={`card mb-0 p-3 ${color}`}> <div> <strong>{hostname}</strong> </div> <div>{title}</div> </div> ); } </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => { </s> remove const title = getTitle(reason, filterName, t); </s> add const onlyFiltered = checkSafeSearch(reason) || checkSafeBrowsing(reason) || checkParental(reason); const title = getTitle(reason, filterName, t, onlyFiltered); </s> remove if (this.checkFiltered(reason)) { </s> add if (checkFiltered(reason)) {
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep replace keep keep keep
<mask> } <mask> <mask> const { reason } = rowInfo.original; <mask> <mask> if (this.checkFiltered(reason)) { <mask> return { <mask> className: 'red', <mask> }; <mask> } else if (this.checkWhiteList(reason)) { <mask> return { <mask> className: 'green', <mask> }; </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove } else if (this.checkRewrite(reason)) { </s> add } else if (checkRewrite(reason)) { </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => { </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); } </s> remove const isFiltered = this.checkFiltered(reason); const isRewrite = this.checkRewrite(reason); </s> add const isFiltered = checkFiltered(reason); const isRewrite = checkRewrite(reason); </s> remove import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList } from '../../../helpers/helpers'; </s> add import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList, checkSafeSearch, checkSafeBrowsing, checkParental, } from '../../../helpers/helpers'; import { FILTERED } from '../../../helpers/constants';
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> } else if (this.checkWhiteList(reason)) { <mask> return { <mask> className: 'green', <mask> }; <mask> } else if (this.checkRewrite(reason)) { <mask> return { <mask> className: 'blue', <mask> }; <mask> } <mask> </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove } else if (this.checkWhiteList(reason)) { </s> add } else if (checkWhiteList(reason)) { </s> remove if (this.checkFiltered(reason)) { </s> add if (checkFiltered(reason)) { </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => { </s> add if (onlyFiltered) { const filterKey = reason.replace(FILTERED, ''); return ( <div> {t('query_log_filtered', { filter: filterKey })} </div> ); } </s> remove import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList } from '../../../helpers/helpers'; </s> add import { checkFiltered, checkRewrite, checkBlackList, checkNotFilteredNotFound, checkWhiteList, checkSafeSearch, checkSafeBrowsing, checkParental, } from '../../../helpers/helpers'; import { FILTERED } from '../../../helpers/constants'; </s> remove const isFiltered = this.checkFiltered(reason); const isRewrite = this.checkRewrite(reason); </s> add const isFiltered = checkFiltered(reason); const isRewrite = checkRewrite(reason);
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/components/Logs/index.js
keep add keep keep keep keep keep keep
<mask> FILTERED_BLOCKED_SERVICE: 'FilteredBlockedService', <mask> REWRITE: 'Rewrite', <mask> }; <mask> <mask> export const FILTERED = 'Filtered'; <mask> export const NOT_FILTERED = 'NotFiltered'; <mask> <mask> export const STATS_INTERVALS_DAYS = [1, 7, 30, 90]; </s> - client: fix wrong statuses for Safebrowsing, Parental control, Safe search </s> remove const FILTERED_REASON = 'Filtered'; </s> add </s> remove const isFiltered = this.checkFiltered(reason); const isBlackList = this.checkBlackList(reason); const isRewrite = this.checkRewrite(reason); const isWhiteList = this.checkWhiteList(reason); const isBlockedService = this.checkBlockedService(reason); </s> add const isFiltered = checkFiltered(reason); const isBlackList = checkBlackList(reason); const isRewrite = checkRewrite(reason); const isWhiteList = checkWhiteList(reason); const isBlockedService = checkBlockedService(reason); </s> remove const filterKey = reason.replace(FILTERED_REASON, ''); </s> add const filterKey = reason.replace(FILTERED, ''); </s> remove const isFiltered = this.checkFiltered(reason); const isRewrite = this.checkRewrite(reason); </s> add const isFiltered = checkFiltered(reason); const isRewrite = checkRewrite(reason); </s> remove const title = getTitle(reason, filterName, t); </s> add const onlyFiltered = checkSafeSearch(reason) || checkSafeBrowsing(reason) || checkParental(reason); const title = getTitle(reason, filterName, t, onlyFiltered); </s> remove const getTitle = (reason, filterName, t) => { </s> add const getTitle = (reason, filterName, t, onlyFiltered) => {
https://github.com/AdguardTeam/AdGuardHome/commit/61d8ec8dae8b05b7f123478fb21763c0fc3ba307
client/src/helpers/constants.js
keep keep keep keep replace keep keep keep keep keep
<mask> "disable_protection": "\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0430\u0449\u0438\u0442\u0443", <mask> "disabled_protection": "\u0417\u0430\u0449\u0438\u0442\u0430 \u0432\u044b\u043a\u043b.", <mask> "refresh_statics": "\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443", <mask> "dns_query": "DNS-\u0437\u0430\u043f\u0440\u043e\u0441\u044b", <mask> "blocked_by": "\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0424\u0438\u043b\u044c\u0442\u0440\u044b", <mask> "stats_malware_phishing": "\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u044b\u0435 \u0438 \u0444\u0438\u0448\u0438\u043d\u0433\u043e\u0432\u044b\u0435 \u0441\u0430\u0439\u0442\u044b", <mask> "stats_adult": "\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \"\u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0435\" \u0441\u0430\u0439\u0442\u044b", <mask> "stats_query_domain": "\u0427\u0430\u0441\u0442\u043e \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u043e\u043c\u0435\u043d\u044b", <mask> "for_last_24_hours": "\u0437\u0430 24 \u0447\u0430\u0441\u0430", <mask> "no_domains_found": "\u0414\u043e\u043c\u0435\u043d\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b", </s> Update ru translation Closes #536 </s> remove "filter_label": "\u0424\u0438\u043b\u044c\u0442\u0440" </s> add "filter_label": "\u0424\u0438\u043b\u044c\u0442\u0440", "unknown_filter": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 {{filterId}}" </s> add "example_upstream_sdns": "\u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href='https:\/\/dnscrypt.info\/stamps\/' target='_blank'>DNS Stamps<\/a> \u0434\u043b\u044f <a href='https:\/\/dnscrypt.info\/' target='_blank'>DNSCrypt<\/a> \u0438\u043b\u0438 <a href='https:\/\/en.wikipedia.org\/wiki\/DNS_over_HTTPS' target='_blank'>DNS-over-HTTPS<\/a> \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u043e\u0432",
https://github.com/AdguardTeam/AdGuardHome/commit/61f4b6f1aee8581e3c659569e0629f1e7280e73e
client/src/__locales/ru.json
keep keep add keep keep keep keep keep keep
<mask> "example_upstream_regular": "\u043e\u0431\u044b\u0447\u043d\u044b\u0439 DNS (\u043f\u043e\u0432\u0435\u0440\u0445 UDP)", <mask> "example_upstream_dot": "\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <a href='https:\/\/en.wikipedia.org\/wiki\/DNS_over_TLS' target='_blank'>DNS-\u043f\u043e\u0432\u0435\u0440\u0445-TLS<\/a>", <mask> "example_upstream_doh": "\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <a href='https:\/\/en.wikipedia.org\/wiki\/DNS_over_HTTPS' target='_blank'>DNS-\u043f\u043e\u0432\u0435\u0440\u0445-HTTPS<\/a>", <mask> "example_upstream_tcp": "\u043e\u0431\u044b\u0447\u043d\u044b\u0439 DNS (\u043f\u043e\u0432\u0435\u0440\u0445 TCP)", <mask> "all_filters_up_to_date_toast": "\u0412\u0441\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u044b", <mask> "updated_upstream_dns_toast": "Upstream DNS-\u0441\u0435\u0440\u0432\u0435\u0440\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u044b", <mask> "dns_test_ok_toast": "\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b DNS \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e", <mask> "dns_test_not_ok_toast": "\u0421\u0435\u0440\u0432\u0435\u0440 \"{{key}}\": \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f", <mask> "unblock_btn": "\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c", </s> Update ru translation Closes #536 </s> remove "filter_label": "\u0424\u0438\u043b\u044c\u0442\u0440" </s> add "filter_label": "\u0424\u0438\u043b\u044c\u0442\u0440", "unknown_filter": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 {{filterId}}" </s> remove "blocked_by": "\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0424\u0438\u043b\u044c\u0442\u0440\u044b", </s> add "blocked_by": "\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438",
https://github.com/AdguardTeam/AdGuardHome/commit/61f4b6f1aee8581e3c659569e0629f1e7280e73e
client/src/__locales/ru.json
keep keep keep keep replace keep
<mask> "source_label": "\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a", <mask> "found_in_known_domain_db": "\u041d\u0430\u0439\u0434\u0435\u043d \u0432 \u0431\u0430\u0437\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432.", <mask> "category_label": "\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f", <mask> "rule_label": "\u041f\u0440\u0430\u0432\u0438\u043b\u043e", <mask> "filter_label": "\u0424\u0438\u043b\u044c\u0442\u0440" <mask> } </s> Update ru translation Closes #536 </s> add "example_upstream_sdns": "\u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href='https:\/\/dnscrypt.info\/stamps\/' target='_blank'>DNS Stamps<\/a> \u0434\u043b\u044f <a href='https:\/\/dnscrypt.info\/' target='_blank'>DNSCrypt<\/a> \u0438\u043b\u0438 <a href='https:\/\/en.wikipedia.org\/wiki\/DNS_over_HTTPS' target='_blank'>DNS-over-HTTPS<\/a> \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u043e\u0432", </s> remove "blocked_by": "\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0424\u0438\u043b\u044c\u0442\u0440\u044b", </s> add "blocked_by": "\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438",
https://github.com/AdguardTeam/AdGuardHome/commit/61f4b6f1aee8581e3c659569e0629f1e7280e73e
client/src/__locales/ru.json
keep keep keep keep replace keep keep keep keep keep
<mask> if (FNR - prev_line == 1) { <mask> addrs[$2] = true <mask> prev_line = FNR <mask> <mask> if ($2 == "0.0.0.0" || $2 == "\"\"" || $2 == "'::'") { <mask> # Drop all the other addresses. <mask> delete addrs <mask> addrs[""] = true <mask> prev_line = -1 <mask> } </s> Pull request 1840: 5752-unspec-ipv6 Merge in DNS/adguard-home from 5752-unspec-ipv6 to master Closes #5752. Squashed commit of the following: commit 654b808d17c6d2374b6be919515113b361fc5ff7 Author: Eugene Burkov <[email protected]> Date: Fri Apr 21 18:11:34 2023 +0300 home: imp docs commit 28b4c36df790f1eaa05b11a1f0a7b986894d37dc Author: Eugene Burkov <[email protected]> Date: Fri Apr 21 16:50:16 2023 +0300 all: fix empty bind host </s> add // Don't wrap the error since it's informative enough as is. return err } err = validateBindHosts(config) if err != nil { // Don't wrap the error since it's informative enough as is. </s> add // validateBindHosts returns error if any of binding hosts from configuration is // not a valid IP address. func validateBindHosts(conf *configuration) (err error) { if !conf.BindHost.IsValid() { return errors.Error("bind_host is not a valid ip address") } for i, addr := range conf.DNS.BindHosts { if !addr.IsValid() { return fmt.Errorf("dns.bind_hosts at index %d is not a valid ip address", i) } } return nil } </s> remove log.Printf("Couldn't parse config file: %s", err) </s> add log.Printf("parsing config file for upgrade: %s", err)
https://github.com/AdguardTeam/AdGuardHome/commit/620b51e3ea1bfdd712f24873acf5cde57837b720
docker/dns-bind.awk
keep add keep keep keep keep
<mask> } <mask> <mask> // parseConfig loads configuration from the YAML file <mask> func parseConfig() (err error) { <mask> var fileData []byte <mask> fileData, err = readConfigFile() </s> Pull request 1840: 5752-unspec-ipv6 Merge in DNS/adguard-home from 5752-unspec-ipv6 to master Closes #5752. Squashed commit of the following: commit 654b808d17c6d2374b6be919515113b361fc5ff7 Author: Eugene Burkov <[email protected]> Date: Fri Apr 21 18:11:34 2023 +0300 home: imp docs commit 28b4c36df790f1eaa05b11a1f0a7b986894d37dc Author: Eugene Burkov <[email protected]> Date: Fri Apr 21 16:50:16 2023 +0300 all: fix empty bind host </s> add // Don't wrap the error since it's informative enough as is. return err } err = validateBindHosts(config) if err != nil { // Don't wrap the error since it's informative enough as is. </s> remove log.Printf("Couldn't parse config file: %s", err) </s> add log.Printf("parsing config file for upgrade: %s", err) </s> remove if ($2 == "0.0.0.0" || $2 == "\"\"" || $2 == "'::'") { </s> add if ($2 == "0.0.0.0" || $2 == "'::'") {
https://github.com/AdguardTeam/AdGuardHome/commit/620b51e3ea1bfdd712f24873acf5cde57837b720
internal/home/config.go
keep keep keep add keep keep keep keep keep keep
<mask> <mask> config.fileData = nil <mask> err = yaml.Unmarshal(fileData, &config) <mask> if err != nil { <mask> return err <mask> } <mask> <mask> tcpPorts := aghalg.UniqChecker[tcpPort]{} <mask> addPorts(tcpPorts, tcpPort(config.BindPort)) <mask> </s> Pull request 1840: 5752-unspec-ipv6 Merge in DNS/adguard-home from 5752-unspec-ipv6 to master Closes #5752. Squashed commit of the following: commit 654b808d17c6d2374b6be919515113b361fc5ff7 Author: Eugene Burkov <[email protected]> Date: Fri Apr 21 18:11:34 2023 +0300 home: imp docs commit 28b4c36df790f1eaa05b11a1f0a7b986894d37dc Author: Eugene Burkov <[email protected]> Date: Fri Apr 21 16:50:16 2023 +0300 all: fix empty bind host </s> remove log.Printf("Couldn't parse config file: %s", err) </s> add log.Printf("parsing config file for upgrade: %s", err) </s> add // validateBindHosts returns error if any of binding hosts from configuration is // not a valid IP address. func validateBindHosts(conf *configuration) (err error) { if !conf.BindHost.IsValid() { return errors.Error("bind_host is not a valid ip address") } for i, addr := range conf.DNS.BindHosts { if !addr.IsValid() { return fmt.Errorf("dns.bind_hosts at index %d is not a valid ip address", i) } } return nil } </s> remove if ($2 == "0.0.0.0" || $2 == "\"\"" || $2 == "'::'") { </s> add if ($2 == "0.0.0.0" || $2 == "'::'") {
https://github.com/AdguardTeam/AdGuardHome/commit/620b51e3ea1bfdd712f24873acf5cde57837b720
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> err = yaml.Unmarshal(body, &diskConf) <mask> if err != nil { <mask> log.Printf("Couldn't parse config file: %s", err) <mask> return err <mask> } <mask> <mask> schemaVersionInterface, ok := diskConf["schema_version"] <mask> log.Tracef("got schema version %v", schemaVersionInterface) </s> Pull request 1840: 5752-unspec-ipv6 Merge in DNS/adguard-home from 5752-unspec-ipv6 to master Closes #5752. Squashed commit of the following: commit 654b808d17c6d2374b6be919515113b361fc5ff7 Author: Eugene Burkov <[email protected]> Date: Fri Apr 21 18:11:34 2023 +0300 home: imp docs commit 28b4c36df790f1eaa05b11a1f0a7b986894d37dc Author: Eugene Burkov <[email protected]> Date: Fri Apr 21 16:50:16 2023 +0300 all: fix empty bind host </s> add // Don't wrap the error since it's informative enough as is. return err } err = validateBindHosts(config) if err != nil { // Don't wrap the error since it's informative enough as is. </s> add // validateBindHosts returns error if any of binding hosts from configuration is // not a valid IP address. func validateBindHosts(conf *configuration) (err error) { if !conf.BindHost.IsValid() { return errors.Error("bind_host is not a valid ip address") } for i, addr := range conf.DNS.BindHosts { if !addr.IsValid() { return fmt.Errorf("dns.bind_hosts at index %d is not a valid ip address", i) } } return nil } </s> remove if ($2 == "0.0.0.0" || $2 == "\"\"" || $2 == "'::'") { </s> add if ($2 == "0.0.0.0" || $2 == "'::'") {
https://github.com/AdguardTeam/AdGuardHome/commit/620b51e3ea1bfdd712f24873acf5cde57837b720
internal/home/upgrade.go
keep keep keep keep replace keep keep keep keep keep
<mask> Pending int64 // number of currently pending HTTP requests <mask> PendingMax int64 // maximum number of pending HTTP requests <mask> } <mask> <mask> // Stats store LookupStats for both safebrowsing and parental <mask> type Stats struct { <mask> Safebrowsing LookupStats <mask> Parental LookupStats <mask> } <mask> </s> Fix #576 - Fix safesearch </s> add Safesearch LookupStats </s> add safeSearchCache gcache.Cache </s> add // check safeSearch if no match if d.SafeSearchEnabled { result, err = d.checkSafeSearch(host) if err != nil { log.Printf("Failed to safesearch HTTP lookup, ignoring check: %v", err) return Result{}, nil } if result.Reason.Matched() { return result, nil } } </s> add "www.yandex.com": "213.180.193.56", "www.yandex.ru": "213.180.193.56", "www.yandex.ua": "213.180.193.56", "www.yandex.by": "213.180.193.56", "www.yandex.kz": "213.180.193.56", </s> add "net"
https://github.com/AdguardTeam/AdGuardHome/commit/623c3bba09a8600178eee1ae291ff6e0c287aa4e
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep keep
<mask> Safebrowsing LookupStats <mask> Parental LookupStats <mask> } <mask> <mask> // Dnsfilter holds added rules and performs hostname matches against the rules <mask> type Dnsfilter struct { <mask> storage map[string]bool // rule storage, not used for matching, just for filtering out duplicates <mask> storageMutex sync.RWMutex </s> Fix #576 - Fix safesearch </s> remove // Stats store LookupStats for both safebrowsing and parental </s> add // Stats store LookupStats for safebrowsing, parental and safesearch </s> add safeSearchCache gcache.Cache </s> add // check safeSearch if no match if d.SafeSearchEnabled { result, err = d.checkSafeSearch(host) if err != nil { log.Printf("Failed to safesearch HTTP lookup, ignoring check: %v", err) return Result{}, nil } if result.Reason.Matched() { return result, nil } } </s> add "www.yandex.com": "213.180.193.56", "www.yandex.ru": "213.180.193.56", "www.yandex.ua": "213.180.193.56", "www.yandex.by": "213.180.193.56", "www.yandex.kz": "213.180.193.56", </s> add "net"
https://github.com/AdguardTeam/AdGuardHome/commit/623c3bba09a8600178eee1ae291ff6e0c287aa4e
dnsfilter/dnsfilter.go
keep keep keep add keep keep keep keep
<mask> var ( <mask> stats Stats <mask> safebrowsingCache gcache.Cache <mask> parentalCache gcache.Cache <mask> ) <mask> <mask> // Result holds state of hostname check <mask> type Result struct { </s> Fix #576 - Fix safesearch </s> remove // Stats store LookupStats for both safebrowsing and parental </s> add // Stats store LookupStats for safebrowsing, parental and safesearch </s> add Safesearch LookupStats </s> add // check safeSearch if no match if d.SafeSearchEnabled { result, err = d.checkSafeSearch(host) if err != nil { log.Printf("Failed to safesearch HTTP lookup, ignoring check: %v", err) return Result{}, nil } if result.Reason.Matched() { return result, nil } } </s> add "net" </s> add "www.yandex.com": "213.180.193.56", "www.yandex.ru": "213.180.193.56", "www.yandex.ua": "213.180.193.56", "www.yandex.by": "213.180.193.56", "www.yandex.kz": "213.180.193.56",
https://github.com/AdguardTeam/AdGuardHome/commit/623c3bba09a8600178eee1ae291ff6e0c287aa4e
dnsfilter/dnsfilter.go
keep add keep keep keep keep
<mask> } <mask> <mask> // check safebrowsing if no match <mask> if d.SafeBrowsingEnabled { <mask> result, err = d.checkSafeBrowsing(host) <mask> if err != nil { </s> Fix #576 - Fix safesearch </s> add safeSearchCache gcache.Cache </s> remove // Stats store LookupStats for both safebrowsing and parental </s> add // Stats store LookupStats for safebrowsing, parental and safesearch </s> add Safesearch LookupStats </s> add "www.yandex.com": "213.180.193.56", "www.yandex.ru": "213.180.193.56", "www.yandex.ua": "213.180.193.56", "www.yandex.by": "213.180.193.56", "www.yandex.kz": "213.180.193.56", </s> add "net"
https://github.com/AdguardTeam/AdGuardHome/commit/623c3bba09a8600178eee1ae291ff6e0c287aa4e
dnsfilter/dnsfilter.go
keep keep keep add keep keep keep keep
<mask> import ( <mask> "archive/zip" <mask> "bytes" <mask> "io/ioutil" <mask> "net/http" <mask> "net/http/httptest" <mask> "path" <mask> "runtime/pprof" </s> Fix #576 - Fix safesearch </s> add safeSearchCache gcache.Cache </s> add "www.yandex.com": "213.180.193.56", "www.yandex.ru": "213.180.193.56", "www.yandex.ua": "213.180.193.56", "www.yandex.by": "213.180.193.56", "www.yandex.kz": "213.180.193.56", </s> add // check safeSearch if no match if d.SafeSearchEnabled { result, err = d.checkSafeSearch(host) if err != nil { log.Printf("Failed to safesearch HTTP lookup, ignoring check: %v", err) return Result{}, nil } if result.Reason.Matched() { return result, nil } } </s> add Safesearch LookupStats </s> remove // Stats store LookupStats for both safebrowsing and parental </s> add // Stats store LookupStats for safebrowsing, parental and safesearch
https://github.com/AdguardTeam/AdGuardHome/commit/623c3bba09a8600178eee1ae291ff6e0c287aa4e
dnsfilter/dnsfilter_test.go
keep add keep keep keep keep keep keep
<mask> "yandex.by": "213.180.193.56", <mask> "yandex.kz": "213.180.193.56", <mask> <mask> "www.bing.com": "strict.bing.com", <mask> <mask> "www.google.com": "forcesafesearch.google.com", <mask> "www.google.ad": "forcesafesearch.google.com", <mask> "www.google.ae": "forcesafesearch.google.com", </s> Fix #576 - Fix safesearch </s> add "net" </s> add // check safeSearch if no match if d.SafeSearchEnabled { result, err = d.checkSafeSearch(host) if err != nil { log.Printf("Failed to safesearch HTTP lookup, ignoring check: %v", err) return Result{}, nil } if result.Reason.Matched() { return result, nil } } </s> add safeSearchCache gcache.Cache </s> add Safesearch LookupStats </s> remove // Stats store LookupStats for both safebrowsing and parental </s> add // Stats store LookupStats for safebrowsing, parental and safesearch
https://github.com/AdguardTeam/AdGuardHome/commit/623c3bba09a8600178eee1ae291ff6e0c287aa4e
dnsfilter/safesearch.go
keep add keep keep keep keep keep
<mask> "net/http" <mask> "strconv" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/util" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/NYTimes/gziphandler" </s> Pull request: home: add a patch against the global pprof handlers Merge in DNS/adguard-home from 2336-pprof to master Closes #2336. Squashed commit of the following: commit 855e133b17da4274bef7dec5c3b7db73486d97db Author: Ainar Garipov <[email protected]> Date: Thu Nov 19 14:49:22 2020 +0300 home: add a patch against the global pprof handlers </s> add // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPPROF(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add Handler: filterPPROF(http.DefaultServeMux),
https://github.com/AdguardTeam/AdGuardHome/commit/62a8fe0b73d16b9f71234f6b4efbba560ba470e2
internal/home/web.go
keep keep add keep keep keep keep keep keep
<mask> web.httpServer = &http.Server{ <mask> ErrorLog: web.errLogger, <mask> Addr: address, <mask> } <mask> err := web.httpServer.ListenAndServe() <mask> if err != http.ErrServerClosed { <mask> cleanupAlways() <mask> log.Fatal(err) <mask> } </s> Pull request: home: add a patch against the global pprof handlers Merge in DNS/adguard-home from 2336-pprof to master Closes #2336. Squashed commit of the following: commit 855e133b17da4274bef7dec5c3b7db73486d97db Author: Ainar Garipov <[email protected]> Date: Thu Nov 19 14:49:22 2020 +0300 home: add a patch against the global pprof handlers </s> add // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPPROF(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add "strings"
https://github.com/AdguardTeam/AdGuardHome/commit/62a8fe0b73d16b9f71234f6b4efbba560ba470e2
internal/home/web.go
keep keep keep add keep keep keep keep
<mask> // We use ErrServerClosed as a sign that we need to rebind on new address, so go back to the start of the loop <mask> } <mask> } <mask> <mask> // Close - stop HTTP server, possibly waiting for all active connections to be closed <mask> func (web *Web) Close() { <mask> log.Info("Stopping HTTP server...") <mask> web.httpsServer.cond.L.Lock() </s> Pull request: home: add a patch against the global pprof handlers Merge in DNS/adguard-home from 2336-pprof to master Closes #2336. Squashed commit of the following: commit 855e133b17da4274bef7dec5c3b7db73486d97db Author: Ainar Garipov <[email protected]> Date: Thu Nov 19 14:49:22 2020 +0300 home: add a patch against the global pprof handlers </s> add Handler: filterPPROF(http.DefaultServeMux), </s> add "strings"
https://github.com/AdguardTeam/AdGuardHome/commit/62a8fe0b73d16b9f71234f6b4efbba560ba470e2
internal/home/web.go
keep keep keep keep replace
<mask> "netname": "Network name", <mask> "descr": "Description", <mask> "whois": "Whois", <mask> "filtering_rules_learn_more": "<0>Learn more</0> about creating your own hosts blocklists." <mask> } </s> + client: load additional search results </s> remove import { SERVICES, FILTERED_STATUS, DEFAULT_LOGS_FILTER, RESPONSE_FILTER, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> remove const { enabled, processingGetConfig } = queryLogs; </s> add const { enabled, processingGetConfig, processingAdditionalLogs, processingGetLogs, } = queryLogs; </s> remove <Form initialValues={filter} onChange={this.handleFormChange} /> </s> add <Card bodyType={cardBodyClass}> <Form initialValues={filter} onChange={this.handleFormChange} /> </Card> </s> remove this.getLogs(oldest, filter, page); } else { this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); </s> add this.getLogs(oldest, page); </s> add changePage = (page) => { this.props.setLogsPage(page); this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); }; </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants';
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/__locales/en.json
keep keep keep add keep keep keep keep
<mask> <mask> import apiClient from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { normalizeLogs } from '../helpers/helpers'; <mask> <mask> const getLogsWithParams = async (config) => { <mask> const { older_than, filter, ...values } = config; <mask> const rawLogs = await apiClient.getQueryLog({ ...filter, older_than }); </s> + client: load additional search results </s> remove import { SERVICES, FILTERED_STATUS, DEFAULT_LOGS_FILTER, RESPONSE_FILTER, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import classnames from 'classnames'; </s> add import Card from '../../ui/Card'; </s> remove const INITIAL_REQUEST_DATA = ['', DEFAULT_LOGS_FILTER, TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; </s> add const INITIAL_REQUEST_DATA = ['', TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; </s> remove const logs = await getLogsWithParams(config); dispatch(getLogsSuccess(logs)); </s> add const { isFiltered, filter, page } = getState().queryLogs; const data = await getLogsWithParams({ ...config, filter }); if (isFiltered) { const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(getLogsSuccess(updatedData)); dispatch(setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE })); } else { dispatch(getLogsSuccess(data)); } </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', });
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/actions/queryLogs.js
keep keep keep keep replace keep keep replace replace keep keep
<mask> export const getLogsRequest = createAction('GET_LOGS_REQUEST'); <mask> export const getLogsFailure = createAction('GET_LOGS_FAILURE'); <mask> export const getLogsSuccess = createAction('GET_LOGS_SUCCESS'); <mask> <mask> export const getLogs = config => async (dispatch) => { <mask> dispatch(getLogsRequest()); <mask> try { <mask> const logs = await getLogsWithParams(config); <mask> dispatch(getLogsSuccess(logs)); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); </s> + client: load additional search results </s> remove const logs = await getLogsWithParams({ older_than: '', filter }); dispatch(setLogsFilterSuccess(logs)); </s> add const data = await getLogsWithParams({ older_than: '', filter }); const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(setLogsFilterSuccess({ ...updatedData, filter })); </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants'; </s> remove const { filter, oldest, page, } = this.props.queryLogs; </s> add const { oldest, page } = this.props.queryLogs; </s> add processingGetLogs: PropTypes.bool.isRequired, processingAdditionalLogs: PropTypes.bool.isRequired, </s> add changePage = (page) => { this.props.setLogsPage(page); this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); };
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/actions/queryLogs.js
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> export const setLogsFilter = filter => async (dispatch) => { <mask> dispatch(setLogsFilterRequest()); <mask> try { <mask> const logs = await getLogsWithParams({ older_than: '', filter }); <mask> dispatch(setLogsFilterSuccess(logs)); <mask> dispatch(setLogsPage(0)); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(setLogsFilterFailure(error)); <mask> } </s> + client: load additional search results </s> remove const logs = await getLogsWithParams(config); dispatch(getLogsSuccess(logs)); </s> add const { isFiltered, filter, page } = getState().queryLogs; const data = await getLogsWithParams({ ...config, filter }); if (isFiltered) { const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(getLogsSuccess(updatedData)); dispatch(setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE })); } else { dispatch(getLogsSuccess(data)); } </s> remove export const getLogs = config => async (dispatch) => { </s> add export const getLogs = config => async (dispatch, getState) => { </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants'; </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', }); </s> remove const { filter } = this.props; </s> add const { filter, processingAdditionalLogs } = this.props; const cardBodyClass = classnames({ 'card-body': true, 'card-body--loading': processingAdditionalLogs, }); </s> remove <Form initialValues={filter} onChange={this.handleFormChange} /> </s> add <Card bodyType={cardBodyClass}> <Form initialValues={filter} onChange={this.handleFormChange} /> </Card>
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/actions/queryLogs.js
keep keep replace keep replace replace keep keep keep keep
<mask> <form onSubmit={handleChange}> <mask> <div className="row"> <mask> <div className="col-3"> <mask> <Field <mask> id="domain" <mask> name="domain" <mask> component={renderFilterField} <mask> type="text" <mask> className="form-control" <mask> placeholder={t('domain_name_table_header')} </s> + client: load additional search results </s> remove id="client" name="client" </s> add id="filter_client" name="filter_client" </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove id="type" name="type" </s> add id="filter_question_type" name="filter_question_type" </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2">
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/Form.js
keep replace keep replace replace keep keep
<mask> </div> <mask> <div className="col-3"> <mask> <Field <mask> id="type" <mask> name="type" <mask> component={renderField} <mask> type="text" </s> + client: load additional search results </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove id="client" name="client" </s> add id="filter_client" name="filter_client" </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove id="domain" name="domain" </s> add id="filter_domain" name="filter_domain" </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2">
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/Form.js
keep keep keep replace keep replace keep
<mask> onChange={handleChange} <mask> /> <mask> </div> <mask> <div className="col-3"> <mask> <Field <mask> name="response" <mask> component="select" </s> + client: load additional search results </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove id="type" name="type" </s> add id="filter_question_type" name="filter_question_type" </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove id="client" name="client" </s> add id="filter_client" name="filter_client" </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2">
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/Form.js
keep keep keep replace keep replace replace keep keep keep keep
<mask> </option> <mask> </Field> <mask> </div> <mask> <div className="col-3"> <mask> <Field <mask> id="client" <mask> name="client" <mask> component={renderFilterField} <mask> type="text" <mask> className="form-control" <mask> placeholder={t('client_table_header')} </s> + client: load additional search results </s> remove id="domain" name="domain" </s> add id="filter_domain" name="filter_domain" </s> remove id="type" name="type" </s> add id="filter_question_type" name="filter_question_type" </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2">
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/Form.js
keep keep add keep keep keep keep keep
<mask> import React, { Component } from 'react'; <mask> import PropTypes from 'prop-types'; <mask> import debounce from 'lodash/debounce'; <mask> <mask> import { DEBOUNCE_FILTER_TIMEOUT, RESPONSE_FILTER } from '../../../helpers/constants'; <mask> import { isValidQuestionType } from '../../../helpers/helpers'; <mask> import Form from './Form'; <mask> import Card from '../../ui/Card'; </s> + client: load additional search results </s> add import Card from '../../ui/Card'; </s> remove import { SERVICES, FILTERED_STATUS, DEFAULT_LOGS_FILTER, RESPONSE_FILTER, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants'; </s> remove const INITIAL_REQUEST_DATA = ['', DEFAULT_LOGS_FILTER, TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; </s> add const INITIAL_REQUEST_DATA = ['', TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', }); </s> remove const { filter, oldest, page, } = this.props.queryLogs; </s> add const { oldest, page } = this.props.queryLogs;
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/index.js
keep add keep keep keep keep keep keep
<mask> import { isValidQuestionType } from '../../../helpers/helpers'; <mask> import Form from './Form'; <mask> <mask> class Filters extends Component { <mask> getFilters = ({ <mask> filter_domain, filter_question_type, filter_response_status, filter_client, <mask> }) => ({ <mask> filter_domain: filter_domain || '', </s> + client: load additional search results </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', }); </s> add import classnames from 'classnames'; </s> remove import { SERVICES, FILTERED_STATUS, DEFAULT_LOGS_FILTER, RESPONSE_FILTER, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> remove const INITIAL_REQUEST_DATA = ['', DEFAULT_LOGS_FILTER, TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; </s> add const INITIAL_REQUEST_DATA = ['', TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants'; </s> remove filterMethod: (filter, row) => { if (filter.value === RESPONSE_FILTER.FILTERED) { // eslint-disable-next-line no-underscore-dangle const { reason } = row._original; return this.checkFiltered(reason) || this.checkWhiteList(reason); } return true; }, Filter: ({ filter, onChange }) => ( <select className="form-control custom-select" onChange={event => onChange(event.target.value)} value={filter ? filter.value : RESPONSE_FILTER.ALL} > <option value={RESPONSE_FILTER.ALL}> <Trans>show_all_filter_type</Trans> </option> <option value={RESPONSE_FILTER.FILTERED}> <Trans>show_filtered_type</Trans> </option> </select> ), </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/index.js
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> import { isValidQuestionType } from '../../../helpers/helpers'; <mask> import Form from './Form'; <mask> <mask> class Filters extends Component { <mask> getFilters = (filtered) => { <mask> const { <mask> domain, client, type, response, <mask> } = filtered; <mask> <mask> return { <mask> filter_domain: domain || '', <mask> filter_client: client || '', <mask> filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', <mask> filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', <mask> }; <mask> }; <mask> <mask> handleFormChange = debounce((values) => { <mask> const filter = this.getFilters(values); <mask> this.props.setLogsFilter(filter); <mask> }, DEBOUNCE_FILTER_TIMEOUT); </s> + client: load additional search results </s> add import Card from '../../ui/Card'; </s> add import classnames from 'classnames'; </s> remove const logs = await getLogsWithParams({ older_than: '', filter }); dispatch(setLogsFilterSuccess(logs)); </s> add const data = await getLogsWithParams({ older_than: '', filter }); const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(setLogsFilterSuccess({ ...updatedData, filter })); </s> remove import { SERVICES, FILTERED_STATUS, DEFAULT_LOGS_FILTER, RESPONSE_FILTER, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants'; </s> remove filterMethod: (filter, row) => { if (filter.value === RESPONSE_FILTER.FILTERED) { // eslint-disable-next-line no-underscore-dangle const { reason } = row._original; return this.checkFiltered(reason) || this.checkWhiteList(reason); } return true; }, Filter: ({ filter, onChange }) => ( <select className="form-control custom-select" onChange={event => onChange(event.target.value)} value={filter ? filter.value : RESPONSE_FILTER.ALL} > <option value={RESPONSE_FILTER.ALL}> <Trans>show_all_filter_type</Trans> </option> <option value={RESPONSE_FILTER.FILTERED}> <Trans>show_filtered_type</Trans> </option> </select> ), </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/index.js
keep keep keep keep replace keep keep replace replace replace replace keep keep keep keep
<mask> this.props.setLogsFilter(filter); <mask> }, DEBOUNCE_FILTER_TIMEOUT); <mask> <mask> render() { <mask> const { filter } = this.props; <mask> <mask> return ( <mask> <Form <mask> initialValues={filter} <mask> onChange={this.handleFormChange} <mask> /> <mask> ); <mask> } <mask> } <mask> </s> + client: load additional search results </s> remove const { enabled, processingGetConfig } = queryLogs; </s> add const { enabled, processingGetConfig, processingAdditionalLogs, processingGetLogs, } = queryLogs; </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', }); </s> add changePage = (page) => { this.props.setLogsPage(page); this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); }; </s> remove filterMethod: (filter, row) => { if (filter.value === RESPONSE_FILTER.FILTERED) { // eslint-disable-next-line no-underscore-dangle const { reason } = row._original; return this.checkFiltered(reason) || this.checkWhiteList(reason); } return true; }, Filter: ({ filter, onChange }) => ( <select className="form-control custom-select" onChange={event => onChange(event.target.value)} value={filter ? filter.value : RESPONSE_FILTER.ALL} > <option value={RESPONSE_FILTER.ALL}> <Trans>show_all_filter_type</Trans> </option> <option value={RESPONSE_FILTER.FILTERED}> <Trans>show_filtered_type</Trans> </option> </select> ), </s> add </s> remove const logs = await getLogsWithParams({ older_than: '', filter }); dispatch(setLogsFilterSuccess(logs)); </s> add const data = await getLogsWithParams({ older_than: '', filter }); const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(setLogsFilterSuccess({ ...updatedData, filter }));
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/index.js
keep add keep keep keep
<mask> filter: PropTypes.object.isRequired, <mask> setLogsFilter: PropTypes.func.isRequired, <mask> }; <mask> <mask> export default Filters; </s> + client: load additional search results </s> remove export const getLogs = config => async (dispatch) => { </s> add export const getLogs = config => async (dispatch, getState) => { </s> remove const logs = await getLogsWithParams(config); dispatch(getLogsSuccess(logs)); </s> add const { isFiltered, filter, page } = getState().queryLogs; const data = await getLogsWithParams({ ...config, filter }); if (isFiltered) { const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(getLogsSuccess(updatedData)); dispatch(setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE })); } else { dispatch(getLogsSuccess(data)); } </s> add changePage = (page) => { this.props.setLogsPage(page); this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); }; </s> remove older_than, filter, page, pageSize: TABLE_DEFAULT_PAGE_SIZE, </s> add older_than, page, pageSize: TABLE_DEFAULT_PAGE_SIZE, </s> remove const logs = await getLogsWithParams({ older_than: '', filter }); dispatch(setLogsFilterSuccess(logs)); </s> add const data = await getLogsWithParams({ older_than: '', filter }); const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(setLogsFilterSuccess({ ...updatedData, filter })); </s> remove this.getLogs(oldest, filter, page); } else { this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); </s> add this.getLogs(oldest, page);
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/Filters/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> import { <mask> formatTime, <mask> formatDateTime, <mask> } from '../../helpers/helpers'; <mask> import { SERVICES, FILTERED_STATUS, DEFAULT_LOGS_FILTER, RESPONSE_FILTER, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; <mask> import { getTrackerData } from '../../helpers/trackers/trackers'; <mask> import { formatClientCell } from '../../helpers/formatClientCell'; <mask> <mask> import Filters from './Filters'; <mask> import PageTitle from '../ui/PageTitle'; </s> + client: load additional search results </s> add import classnames from 'classnames'; </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants'; </s> add import Card from '../../ui/Card'; </s> remove const INITIAL_REQUEST_DATA = ['', DEFAULT_LOGS_FILTER, TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; </s> add const INITIAL_REQUEST_DATA = ['', TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', }); </s> add changePage = (page) => { this.props.setLogsPage(page); this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); };
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> import Popover from '../ui/Popover'; <mask> import './Logs.css'; <mask> <mask> const TABLE_FIRST_PAGE = 0; <mask> const INITIAL_REQUEST_DATA = ['', DEFAULT_LOGS_FILTER, TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE]; <mask> const FILTERED_REASON = 'Filtered'; <mask> <mask> class Logs extends Component { <mask> componentDidMount() { <mask> this.props.setLogsPage(TABLE_FIRST_PAGE); </s> + client: load additional search results </s> add import Card from '../../ui/Card'; </s> remove import { SERVICES, FILTERED_STATUS, DEFAULT_LOGS_FILTER, RESPONSE_FILTER, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import { SERVICES, FILTERED_STATUS, TABLE_DEFAULT_PAGE_SIZE } from '../../helpers/constants'; </s> add import classnames from 'classnames'; </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants'; </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', }); </s> remove const { filter, oldest, page, } = this.props.queryLogs; </s> add const { oldest, page } = this.props.queryLogs;
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep replace keep keep replace
<mask> this.props.getLogsConfig(); <mask> } <mask> <mask> getLogs = (older_than, filter, page) => { <mask> if (this.props.queryLogs.enabled) { <mask> this.props.getLogs({ <mask> older_than, filter, page, pageSize: TABLE_DEFAULT_PAGE_SIZE, </s> + client: load additional search results </s> remove const logs = await getLogsWithParams(config); dispatch(getLogsSuccess(logs)); </s> add const { isFiltered, filter, page } = getState().queryLogs; const data = await getLogsWithParams({ ...config, filter }); if (isFiltered) { const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(getLogsSuccess(updatedData)); dispatch(setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE })); } else { dispatch(getLogsSuccess(data)); } </s> remove this.getLogs(oldest, filter, page); } else { this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); </s> add this.getLogs(oldest, page); </s> remove const { filter, oldest, page, } = this.props.queryLogs; </s> add const { oldest, page } = this.props.queryLogs; </s> add changePage = (page) => { this.props.setLogsPage(page); this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); }; </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants';
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep replace replace replace keep keep keep replace replace replace keep
<mask> fetchData = (state) => { <mask> const { pages } = state; <mask> const { <mask> filter, oldest, page, <mask> } = this.props.queryLogs; <mask> const isLastPage = pages && (page + 1 === pages); <mask> <mask> if (isLastPage) { <mask> this.getLogs(oldest, filter, page); <mask> } else { <mask> this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); <mask> } </s> + client: load additional search results </s> add changePage = (page) => { this.props.setLogsPage(page); this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); }; </s> remove const logs = await getLogsWithParams(config); dispatch(getLogsSuccess(logs)); </s> add const { isFiltered, filter, page } = getState().queryLogs; const data = await getLogsWithParams({ ...config, filter }); if (isFiltered) { const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(getLogsSuccess(updatedData)); dispatch(setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE })); } else { dispatch(getLogsSuccess(data)); } </s> remove older_than, filter, page, pageSize: TABLE_DEFAULT_PAGE_SIZE, </s> add older_than, page, pageSize: TABLE_DEFAULT_PAGE_SIZE, </s> remove getLogs = (older_than, filter, page) => { </s> add getLogs = (older_than, page) => { </s> add import { TABLE_DEFAULT_PAGE_SIZE } from '../helpers/constants';
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep add keep keep keep keep keep keep
<mask> this.getLogs(oldest, page); <mask> } <mask> }; <mask> <mask> renderLogs() { <mask> const { queryLogs, dashboard, t } = this.props; <mask> const { processingClients } = dashboard; <mask> const { <mask> processingGetLogs, processingGetConfig, logs, pages, page, <mask> } = queryLogs; </s> + client: load additional search results </s> remove this.getLogs(oldest, filter, page); } else { this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); </s> add this.getLogs(oldest, page); </s> remove const { enabled, processingGetConfig } = queryLogs; </s> add const { enabled, processingGetConfig, processingAdditionalLogs, processingGetLogs, } = queryLogs; </s> remove const { filter, oldest, page, } = this.props.queryLogs; </s> add const { oldest, page } = this.props.queryLogs; </s> remove const logs = await getLogsWithParams(config); dispatch(getLogsSuccess(logs)); </s> add const { isFiltered, filter, page } = getState().queryLogs; const data = await getLogsWithParams({ ...config, filter }); if (isFiltered) { const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(getLogsSuccess(updatedData)); dispatch(setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE })); } else { dispatch(getLogsSuccess(data)); } </s> remove const { filter } = this.props; </s> add const { filter, processingAdditionalLogs } = this.props; const cardBodyClass = classnames({ 'card-body': true, 'card-body--loading': processingAdditionalLogs, }); </s> remove <Form initialValues={filter} onChange={this.handleFormChange} /> </s> add <Card bodyType={cardBodyClass}> <Form initialValues={filter} onChange={this.handleFormChange} /> </Card>
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> Header: t('domain_name_table_header'), <mask> accessor: 'domain', <mask> minWidth: 180, <mask> Cell: this.getDomainCell, <mask> Filter: this.getFilterInput, <mask> }, <mask> { <mask> Header: t('type_table_header'), <mask> accessor: 'type', <mask> maxWidth: 60, </s> + client: load additional search results </s> remove Filter: this.getFilterInput, </s> add </s> remove filterMethod: (filter, row) => { if (filter.value === RESPONSE_FILTER.FILTERED) { // eslint-disable-next-line no-underscore-dangle const { reason } = row._original; return this.checkFiltered(reason) || this.checkWhiteList(reason); } return true; }, Filter: ({ filter, onChange }) => ( <select className="form-control custom-select" onChange={event => onChange(event.target.value)} value={filter ? filter.value : RESPONSE_FILTER.ALL} > <option value={RESPONSE_FILTER.ALL}> <Trans>show_all_filter_type</Trans> </option> <option value={RESPONSE_FILTER.FILTERED}> <Trans>show_filtered_type</Trans> </option> </select> ), </s> add </s> remove const { filter } = this.props; </s> add const { filter, processingAdditionalLogs } = this.props; const cardBodyClass = classnames({ 'card-body': true, 'card-body--loading': processingAdditionalLogs, }); </s> add [actions.getAdditionalLogsRequest]: state => ({ ...state, processingAdditionalLogs: true, processingGetLogs: true, }), [actions.getAdditionalLogsFailure]: state => ({ ...state, processingAdditionalLogs: false, processingGetLogs: false, }), [actions.getAdditionalLogsSuccess]: state => ({ ...state, processingAdditionalLogs: false, processingGetLogs: false, }), </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', }); </s> remove const { filter, oldest, page, } = this.props.queryLogs; </s> add const { oldest, page } = this.props.queryLogs;
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> Header: t('response_table_header'), <mask> accessor: 'response', <mask> minWidth: 250, <mask> Cell: this.getResponseCell, <mask> filterMethod: (filter, row) => { <mask> if (filter.value === RESPONSE_FILTER.FILTERED) { <mask> // eslint-disable-next-line no-underscore-dangle <mask> const { reason } = row._original; <mask> return this.checkFiltered(reason) || this.checkWhiteList(reason); <mask> } <mask> return true; <mask> }, <mask> Filter: ({ filter, onChange }) => ( <mask> <select <mask> className="form-control custom-select" <mask> onChange={event => onChange(event.target.value)} <mask> value={filter ? filter.value : RESPONSE_FILTER.ALL} <mask> > <mask> <option value={RESPONSE_FILTER.ALL}> <mask> <Trans>show_all_filter_type</Trans> <mask> </option> <mask> <option value={RESPONSE_FILTER.FILTERED}> <mask> <Trans>show_filtered_type</Trans> <mask> </option> <mask> </select> <mask> ), <mask> }, <mask> { <mask> Header: t('client_table_header'), <mask> accessor: 'client', <mask> maxWidth: 240, </s> + client: load additional search results </s> remove Filter: this.getFilterInput, </s> add </s> remove Filter: this.getFilterInput, </s> add </s> remove name="response" </s> add name="filter_response_status" </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', }); </s> remove const { filter } = this.props; </s> add const { filter, processingAdditionalLogs } = this.props; const cardBodyClass = classnames({ 'card-body': true, 'card-body--loading': processingAdditionalLogs, }); </s> add import Card from '../../ui/Card';
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> accessor: 'client', <mask> maxWidth: 240, <mask> minWidth: 240, <mask> Cell: this.getClientCell, <mask> Filter: this.getFilterInput, <mask> }, <mask> ]; <mask> <mask> return ( <mask> <ReactTable </s> + client: load additional search results </s> remove Filter: this.getFilterInput, </s> add </s> remove filterMethod: (filter, row) => { if (filter.value === RESPONSE_FILTER.FILTERED) { // eslint-disable-next-line no-underscore-dangle const { reason } = row._original; return this.checkFiltered(reason) || this.checkWhiteList(reason); } return true; }, Filter: ({ filter, onChange }) => ( <select className="form-control custom-select" onChange={event => onChange(event.target.value)} value={filter ? filter.value : RESPONSE_FILTER.ALL} > <option value={RESPONSE_FILTER.ALL}> <Trans>show_all_filter_type</Trans> </option> <option value={RESPONSE_FILTER.FILTERED}> <Trans>show_filtered_type</Trans> </option> </select> ), </s> add </s> remove const { filter } = this.props; </s> add const { filter, processingAdditionalLogs } = this.props; const cardBodyClass = classnames({ 'card-body': true, 'card-body--loading': processingAdditionalLogs, }); </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2"> </s> remove <Form initialValues={filter} onChange={this.handleFormChange} /> </s> add <Card bodyType={cardBodyClass}> <Form initialValues={filter} onChange={this.handleFormChange} /> </Card> </s> remove <Card> <Filters filter={queryLogs.filter} setLogsFilter={this.props.setLogsFilter} /> </Card> </s> add <Filters filter={queryLogs.filter} processingGetLogs={processingGetLogs} processingAdditionalLogs={processingAdditionalLogs} setLogsFilter={this.props.setLogsFilter} />
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> showPaginationTop={true} <mask> showPageJump={false} <mask> showPageSizeOptions={false} <mask> onFetchData={this.fetchData} <mask> onPageChange={newPage => this.props.setLogsPage(newPage)} <mask> className="logs__table" <mask> defaultPageSize={TABLE_DEFAULT_PAGE_SIZE} <mask> previousText={t('previous_btn')} <mask> nextText={t('next_btn')} <mask> loadingText={t('loading_table_status')} </s> + client: load additional search results </s> remove export const getLogs = config => async (dispatch) => { </s> add export const getLogs = config => async (dispatch, getState) => { </s> add [actions.getAdditionalLogsRequest]: state => ({ ...state, processingAdditionalLogs: true, processingGetLogs: true, }), [actions.getAdditionalLogsFailure]: state => ({ ...state, processingAdditionalLogs: false, processingGetLogs: false, }), [actions.getAdditionalLogsSuccess]: state => ({ ...state, processingAdditionalLogs: false, processingGetLogs: false, }), </s> remove getLogs = (older_than, filter, page) => { </s> add getLogs = (older_than, page) => { </s> remove older_than, filter, page, pageSize: TABLE_DEFAULT_PAGE_SIZE, </s> add older_than, page, pageSize: TABLE_DEFAULT_PAGE_SIZE, </s> remove filterMethod: (filter, row) => { if (filter.value === RESPONSE_FILTER.FILTERED) { // eslint-disable-next-line no-underscore-dangle const { reason } = row._original; return this.checkFiltered(reason) || this.checkWhiteList(reason); } return true; }, Filter: ({ filter, onChange }) => ( <select className="form-control custom-select" onChange={event => onChange(event.target.value)} value={filter ? filter.value : RESPONSE_FILTER.ALL} > <option value={RESPONSE_FILTER.ALL}> <Trans>show_all_filter_type</Trans> </option> <option value={RESPONSE_FILTER.FILTERED}> <Trans>show_filtered_type</Trans> </option> </select> ), </s> add </s> remove getFilters = (filtered) => { const { domain, client, type, response, } = filtered; return { filter_domain: domain || '', filter_client: client || '', filter_question_type: isValidQuestionType(type) ? type.toUpperCase() : '', filter_response_status: response === RESPONSE_FILTER.FILTERED ? response : '', }; }; </s> add getFilters = ({ filter_domain, filter_question_type, filter_response_status, filter_client, }) => ({ filter_domain: filter_domain || '', filter_question_type: isValidQuestionType(filter_question_type) ? filter_question_type.toUpperCase() : '', filter_response_status: filter_response_status === RESPONSE_FILTER.FILTERED ? filter_response_status : '', filter_client: filter_client || '', });
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> render() { <mask> const { queryLogs, t } = this.props; <mask> const { enabled, processingGetConfig } = queryLogs; <mask> <mask> const refreshButton = enabled ? ( <mask> <button <mask> type="button" <mask> className="btn btn-icon btn-outline-primary btn-sm ml-3" </s> + client: load additional search results </s> add changePage = (page) => { this.props.setLogsPage(page); this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); }; </s> remove const { filter } = this.props; </s> add const { filter, processingAdditionalLogs } = this.props; const cardBodyClass = classnames({ 'card-body': true, 'card-body--loading': processingAdditionalLogs, }); </s> remove this.getLogs(oldest, filter, page); } else { this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); </s> add this.getLogs(oldest, page); </s> remove <Form initialValues={filter} onChange={this.handleFormChange} /> </s> add <Card bodyType={cardBodyClass}> <Form initialValues={filter} onChange={this.handleFormChange} /> </Card> </s> remove const logs = await getLogsWithParams(config); dispatch(getLogsSuccess(logs)); </s> add const { isFiltered, filter, page } = getState().queryLogs; const data = await getLogsWithParams({ ...config, filter }); if (isFiltered) { const additionalData = await checkFilteredLogs(data, filter, dispatch); const updatedData = additionalData.logs ? { ...data, ...additionalData } : data; dispatch(getLogsSuccess(updatedData)); dispatch(setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE })); } else { dispatch(getLogsSuccess(data)); } </s> remove const { filter, oldest, page, } = this.props.queryLogs; </s> add const { oldest, page } = this.props.queryLogs;
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> <PageTitle title={t('query_log')}>{refreshButton}</PageTitle> <mask> {enabled && processingGetConfig && <Loading />} <mask> {enabled && !processingGetConfig && ( <mask> <Fragment> <mask> <Card> <mask> <Filters <mask> filter={queryLogs.filter} <mask> setLogsFilter={this.props.setLogsFilter} <mask> /> <mask> </Card> <mask> <Card>{this.renderLogs()}</Card> <mask> </Fragment> <mask> )} <mask> {!enabled && !processingGetConfig && ( <mask> <Card> </s> + client: load additional search results </s> remove this.getLogs(oldest, filter, page); } else { this.props.setLogsPagination({ page, pageSize: TABLE_DEFAULT_PAGE_SIZE }); </s> add this.getLogs(oldest, page); </s> remove const { filter, oldest, page, } = this.props.queryLogs; </s> add const { oldest, page } = this.props.queryLogs; </s> remove <Form initialValues={filter} onChange={this.handleFormChange} /> </s> add <Card bodyType={cardBodyClass}> <Form initialValues={filter} onChange={this.handleFormChange} /> </Card> </s> remove const { enabled, processingGetConfig } = queryLogs; </s> add const { enabled, processingGetConfig, processingAdditionalLogs, processingGetLogs, } = queryLogs; </s> remove Filter: this.getFilterInput, </s> add </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2">
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/components/Logs/index.js
keep keep add keep keep keep keep
<mask> ...payload, <mask> processingSetConfig: false, <mask> }), <mask> }, <mask> { <mask> processingGetLogs: true, <mask> processingClear: false, </s> + client: load additional search results </s> add processingAdditionalLogs: false, </s> remove const { filter } = this.props; </s> add const { filter, processingAdditionalLogs } = this.props; const cardBodyClass = classnames({ 'card-body': true, 'card-body--loading': processingAdditionalLogs, }); </s> add processingGetLogs: PropTypes.bool.isRequired, processingAdditionalLogs: PropTypes.bool.isRequired, </s> remove Filter: this.getFilterInput, </s> add </s> remove filterMethod: (filter, row) => { if (filter.value === RESPONSE_FILTER.FILTERED) { // eslint-disable-next-line no-underscore-dangle const { reason } = row._original; return this.checkFiltered(reason) || this.checkWhiteList(reason); } return true; }, Filter: ({ filter, onChange }) => ( <select className="form-control custom-select" onChange={event => onChange(event.target.value)} value={filter ? filter.value : RESPONSE_FILTER.ALL} > <option value={RESPONSE_FILTER.ALL}> <Trans>show_all_filter_type</Trans> </option> <option value={RESPONSE_FILTER.FILTERED}> <Trans>show_filtered_type</Trans> </option> </select> ), </s> add </s> remove Filter: this.getFilterInput, </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/reducers/queryLogs.js
keep add keep keep keep keep keep
<mask> processingGetConfig: false, <mask> processingSetConfig: false, <mask> logs: [], <mask> interval: 1, <mask> allLogs: [], <mask> page: 0, <mask> pages: 0, </s> + client: load additional search results </s> add [actions.getAdditionalLogsRequest]: state => ({ ...state, processingAdditionalLogs: true, processingGetLogs: true, }), [actions.getAdditionalLogsFailure]: state => ({ ...state, processingAdditionalLogs: false, processingGetLogs: false, }), [actions.getAdditionalLogsSuccess]: state => ({ ...state, processingAdditionalLogs: false, processingGetLogs: false, }), </s> remove id="type" name="type" </s> add id="filter_question_type" name="filter_question_type" </s> add import Card from '../../ui/Card'; </s> add import classnames from 'classnames'; </s> remove id="client" name="client" </s> add id="filter_client" name="filter_client" </s> remove <div className="col-3"> </s> add <div className="col-6 col-sm-3 my-2">
https://github.com/AdguardTeam/AdGuardHome/commit/62c8664fd75439b7597d935992c380f9c0675660
client/src/reducers/queryLogs.js
keep keep keep keep replace keep keep keep keep
<mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414 <mask> github.com/miekg/dns v1.1.8 <mask> github.com/sparrc/go-ping v0.0.0-20181106165434-ef3ab45e41b0 <mask> github.com/stretchr/testify v1.4.0 <mask> go.etcd.io/bbolt v1.3.3 // indirect <mask> golang.org/x/net v0.0.0-20190620200207-3b0461eec859 <mask> golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 <mask> gopkg.in/yaml.v2 v2.2.2 <mask> ) </s> + Login page and web sessions + /control/login + /control/logout </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> remove </s> add config.auth.Close() </s> add sessFilename := filepath.Join(config.ourWorkingDir, "data/sessions.db") config.auth = InitAuth(sessFilename, config.Users) config.Users = nil </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password) </s> remove config.AuthName = newSettings.Username config.AuthPass = newSettings.Password </s> add </s> remove dst.AuthName = src.AuthName dst.AuthPass = src.AuthPass </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
go.mod
keep keep keep replace keep keep keep replace replace replace keep keep
<mask> runningAsService bool <mask> disableUpdate bool // If set, don't check for updates <mask> appSignalChannel chan os.Signal <mask> clients clientsContainer <mask> controlLock sync.Mutex <mask> transport *http.Transport <mask> client *http.Client <mask> stats stats.Stats <mask> queryLog querylog.QueryLog <mask> filteringStarted bool <mask> <mask> // cached version.json to avoid hammering github.io for each page reload </s> + Login page and web sessions + /control/login + /control/logout </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> remove AuthName string `yaml:"auth_name"` // AuthName is the basic auth username AuthPass string `yaml:"auth_pass"` // AuthPass is the basic auth password </s> add Users []User `yaml:"users"` // Users that can access HTTP server </s> remove </s> add config.auth.Close() </s> add sessFilename := filepath.Join(config.ourWorkingDir, "data/sessions.db") config.auth = InitAuth(sessFilename, config.Users) config.Users = nil </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password)
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/config.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> httpsServer HTTPSServer <mask> <mask> BindHost string `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to <mask> BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server <mask> AuthName string `yaml:"auth_name"` // AuthName is the basic auth username <mask> AuthPass string `yaml:"auth_pass"` // AuthPass is the basic auth password <mask> Language string `yaml:"language"` // two-letter ISO 639-1 language code <mask> RlimitNoFile uint `yaml:"rlimit_nofile"` // Maximum number of opened fd's per process (0: default) <mask> <mask> DNS dnsConfig `yaml:"dns"` <mask> TLS tlsConfig `yaml:"tls"` </s> + Login page and web sessions + /control/login + /control/logout </s> remove clients clientsContainer </s> add clients clientsContainer // per-client-settings module </s> remove stats stats.Stats queryLog querylog.QueryLog filteringStarted bool </s> add stats stats.Stats // statistics module queryLog querylog.QueryLog // query log module filteringStarted bool // TRUE if filtering module is started auth *Auth // HTTP authentication module </s> remove dst.AuthName = src.AuthName dst.AuthPass = src.AuthPass </s> add </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> remove </s> add config.auth.Close() </s> add sessFilename := filepath.Join(config.ourWorkingDir, "data/sessions.db") config.auth = InitAuth(sessFilename, config.Users) config.Users = nil
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/config.go
keep keep keep add keep keep keep keep keep
<mask> } <mask> config.Clients = append(config.Clients, cy) <mask> } <mask> <mask> configFile := config.getConfigFilename() <mask> log.Debug("Writing YAML file: %s", configFile) <mask> yamlText, err := yaml.Marshal(&config) <mask> config.Clients = nil <mask> if err != nil { </s> + Login page and web sessions + /control/login + /control/logout </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password) </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> remove </s> add config.auth.Close() </s> add sessFilename := filepath.Join(config.ourWorkingDir, "data/sessions.db") config.auth = InitAuth(sessFilename, config.Users) config.Users = nil </s> remove config.AuthName = newSettings.Username config.AuthPass = newSettings.Password </s> add </s> remove dst.AuthName = src.AuthName dst.AuthPass = src.AuthPass </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/config.go
keep keep add keep keep keep keep keep keep
<mask> RegisterBlockedServicesHandlers() <mask> RegisterQueryLogHandlers() <mask> RegisterStatsHandlers() <mask> <mask> http.HandleFunc("/dns-query", postInstall(handleDOH)) <mask> } <mask> <mask> type httpHandlerType func(http.ResponseWriter, *http.Request) <mask> </s> + Login page and web sessions + /control/login + /control/logout </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> remove dst.AuthName = src.AuthName dst.AuthPass = src.AuthPass </s> add </s> remove </s> add config.auth.Close() </s> add if config.auth != nil { config.Users = config.auth.GetUsers() } </s> add sessFilename := filepath.Join(config.ourWorkingDir, "data/sessions.db") config.auth = InitAuth(sessFilename, config.Users) config.Users = nil </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password)
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/control.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> dst.BindHost = src.BindHost <mask> dst.BindPort = src.BindPort <mask> dst.DNS.BindHost = src.DNS.BindHost <mask> dst.DNS.Port = src.DNS.Port <mask> dst.AuthName = src.AuthName <mask> dst.AuthPass = src.AuthPass <mask> } <mask> <mask> // Apply new configuration, start DNS server, restart Web server <mask> func handleInstallConfigure(w http.ResponseWriter, r *http.Request) { <mask> newSettings := applyConfigReq{} </s> + Login page and web sessions + /control/login + /control/logout </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> remove AuthName string `yaml:"auth_name"` // AuthName is the basic auth username AuthPass string `yaml:"auth_pass"` // AuthPass is the basic auth password </s> add Users []User `yaml:"users"` // Users that can access HTTP server </s> add RegisterAuthHandlers() </s> add if config.auth != nil { config.Users = config.auth.GetUsers() } </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password) </s> remove </s> add config.auth.Close()
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/control_install.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> config.BindHost = newSettings.Web.IP <mask> config.BindPort = newSettings.Web.Port <mask> config.DNS.BindHost = newSettings.DNS.IP <mask> config.DNS.Port = newSettings.DNS.Port <mask> config.AuthName = newSettings.Username <mask> config.AuthPass = newSettings.Password <mask> <mask> dnsBaseDir := filepath.Join(config.ourWorkingDir, dataDir) <mask> initDNSServer(dnsBaseDir) <mask> <mask> err = startDNSServer() </s> + Login page and web sessions + /control/login + /control/logout </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password) </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> add sessFilename := filepath.Join(config.ourWorkingDir, "data/sessions.db") config.auth = InitAuth(sessFilename, config.Users) config.Users = nil </s> add if config.auth != nil { config.Users = config.auth.GetUsers() } </s> remove </s> add config.auth.Close() </s> remove dst.AuthName = src.AuthName dst.AuthPass = src.AuthPass </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/control_install.go
keep keep add keep keep keep keep keep keep
<mask> return <mask> } <mask> <mask> err = config.write() <mask> if err != nil { <mask> config.firstRun = true <mask> copyInstallSettings(&config, &curConfig) <mask> httpError(w, http.StatusInternalServerError, "Couldn't write config: %s", err) <mask> return </s> + Login page and web sessions + /control/login + /control/logout </s> add if config.auth != nil { config.Users = config.auth.GetUsers() } </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> remove </s> add config.auth.Close() </s> remove config.AuthName = newSettings.Username config.AuthPass = newSettings.Password </s> add </s> add sessFilename := filepath.Join(config.ourWorkingDir, "data/sessions.db") config.auth = InitAuth(sessFilename, config.Users) config.Users = nil </s> remove clients clientsContainer </s> add clients clientsContainer // per-client-settings module
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/control_install.go
keep add keep keep keep keep
<mask> config.dnsServer = dnsforward.NewServer(config.stats, config.queryLog) <mask> <mask> initRDNS() <mask> initFiltering() <mask> } <mask> </s> + Login page and web sessions + /control/login + /control/logout </s> remove </s> add config.auth.Close() </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> add if config.auth != nil { config.Users = config.auth.GetUsers() } </s> add RegisterAuthHandlers() </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password) </s> remove dst.AuthName = src.AuthName dst.AuthPass = src.AuthPass </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/dns.go
keep keep keep keep replace keep keep
<mask> } <mask> <mask> config.stats.Close() <mask> config.queryLog.Close() <mask> <mask> return nil <mask> } </s> + Login page and web sessions + /control/login + /control/logout </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password) </s> remove func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if config.AuthName == "" || config.AuthPass == "" { handler(w, r) return } user, pass, ok := r.BasicAuth() if !ok || user != config.AuthName || pass != config.AuthPass { w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) w.WriteHeader(http.StatusUnauthorized) w.Write([]byte("Unauthorised.\n")) return } handler(w, r) } } type authHandler struct { handler http.Handler } func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { optionalAuth(a.handler.ServeHTTP)(w, r) } func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } </s> add </s> add if config.auth != nil { config.Users = config.auth.GetUsers() } </s> add sessFilename := filepath.Join(config.ourWorkingDir, "data/sessions.db") config.auth = InitAuth(sessFilename, config.Users) config.Users = nil </s> add RegisterAuthHandlers() </s> remove dst.AuthName = src.AuthName dst.AuthPass = src.AuthPass </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/dns.go
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> h.handler = ensure(method, handler) <mask> return &h <mask> } <mask> <mask> func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { <mask> return func(w http.ResponseWriter, r *http.Request) { <mask> if config.AuthName == "" || config.AuthPass == "" { <mask> handler(w, r) <mask> return <mask> } <mask> user, pass, ok := r.BasicAuth() <mask> if !ok || user != config.AuthName || pass != config.AuthPass { <mask> w.Header().Set("WWW-Authenticate", `Basic realm="dnsfilter"`) <mask> w.WriteHeader(http.StatusUnauthorized) <mask> w.Write([]byte("Unauthorised.\n")) <mask> return <mask> } <mask> handler(w, r) <mask> } <mask> } <mask> <mask> type authHandler struct { <mask> handler http.Handler <mask> } <mask> <mask> func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { <mask> optionalAuth(a.handler.ServeHTTP)(w, r) <mask> } <mask> <mask> func optionalAuthHandler(handler http.Handler) http.Handler { <mask> return &authHandler{handler} <mask> } <mask> <mask> // ------------------- <mask> // first run / install <mask> // ------------------- <mask> func detectFirstRun() bool { <mask> configfile := config.ourConfigFilename </s> + Login page and web sessions + /control/login + /control/logout </s> remove dst.AuthName = src.AuthName dst.AuthPass = src.AuthPass </s> add </s> add u := User{} u.Name = newSettings.Username config.auth.UserAdd(&u, newSettings.Password) </s> add if config.auth != nil { config.Users = config.auth.GetUsers() } </s> add RegisterAuthHandlers() </s> remove </s> add config.auth.Close() </s> remove config.AuthName = newSettings.Username config.AuthPass = newSettings.Password </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/6304a7b91bfbfeeaffae1d8fcec3584ada0cc0be
home/helpers.go
keep keep add keep keep keep keep keep
<mask> "fmt" <mask> "testing" <mask> <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func TestMain(m *testing.M) { <mask> testutil.DiscardLogOutput(m) </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/agherr/agherr_test.go
keep add keep keep keep keep keep
<mask> ) <mask> <mask> func TestError_Error(t *testing.T) { <mask> testCases := []struct { <mask> name string <mask> want string <mask> err error </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> remove t.Logf("IP addresses: %v", ips) </s> add </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) }
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/agherr/agherr_test.go
keep keep add keep keep keep keep
<mask> "testing" <mask> "time" <mask> <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func TestMain(m *testing.M) { </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dhcpd/dhcpd_test.go
keep keep add keep keep keep keep keep keep
<mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func testNotify(flags uint32) { <mask> } <mask> <mask> // Leases database store/load <mask> func TestDB(t *testing.T) { <mask> var err error </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dhcpd/dhcpd_test.go
keep add keep keep keep keep
<mask> "time" <mask> <mask> "github.com/hugelgupf/socketpair" <mask> "github.com/insomniacslk/dhcp/dhcpv4" <mask> "github.com/insomniacslk/dhcp/dhcpv4/server4" <mask> ) </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) }
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dhcpd/nclient4/client_test.go
keep keep add keep keep keep keep keep
<mask> "github.com/insomniacslk/dhcp/dhcpv4/server4" <mask> ) <mask> <mask> type handler struct { <mask> mu sync.Mutex <mask> received []*dhcpv4.DHCPv4 <mask> <mask> // Each received packet can have more than one response (in theory, </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add // TODO(e.burkov): remove this weird buildtag. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dhcpd/nclient4/client_test.go
keep add keep keep keep keep keep
<mask> "testing" <mask> <mask> "github.com/AdguardTeam/urlfilter/rules" <mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dnsfilter/dnsfilter_test.go
keep keep add keep keep keep keep keep keep
<mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> var setts RequestFilteringSettings <mask> <mask> // HELPERS <mask> // SAFE BROWSING <mask> // SAFE SEARCH <mask> // PARENTAL </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add // TODO(e.burkov): remove this weird buildtag. </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dnsfilter/dnsfilter_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> if err != nil { <mask> t.Fatalf("Failed to lookup for %s", safeDomain) <mask> } <mask> <mask> t.Logf("IP addresses: %v", ips) <mask> ip := ips[0] <mask> for _, i := range ips { <mask> if i.To4() != nil { <mask> ip = i <mask> break </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) }
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dnsfilter/dnsfilter_test.go
keep keep keep add keep keep keep keep keep keep
<mask> "sync" <mask> "testing" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/util" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" <mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/AdguardTeam/dnsproxy/upstream" </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dnsforward/dnsforward_test.go
keep keep add keep keep keep keep
<mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> const ( <mask> tlsServerName = "testdns.adguard.com" <mask> testMessagesCount = 10 <mask> ) </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add // TODO(e.burkov): remove this weird buildtag.
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/dnsforward/dnsforward_test.go
keep add keep keep keep keep keep
<mask> "time" <mask> <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func TestMain(m *testing.M) { <mask> testutil.DiscardLogOutput(m) </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/home/auth_test.go
keep add keep keep keep keep keep keep
<mask> ) <mask> <mask> func prepareTestDir() string { <mask> const dir = "./agh-test" <mask> _ = os.RemoveAll(dir) <mask> _ = os.MkdirAll(dir, 0755) <mask> return dir <mask> } </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) }
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/home/auth_test.go
keep add keep keep keep keep keep keep
<mask> // +build !race <mask> <mask> package home <mask> <mask> import ( <mask> "context" <mask> "encoding/base64" <mask> "io/ioutil" </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) }
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/home/home_test.go
keep add keep keep keep keep keep keep
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" <mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func TestMain(m *testing.M) { <mask> testutil.DiscardLogOutput(m) </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/querylog/qlog_test.go
keep keep keep add keep keep keep keep
<mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func prepareTestDir() string { <mask> const dir = "./agh-test" <mask> _ = os.RemoveAll(dir) <mask> _ = os.MkdirAll(dir, 0755) </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/querylog/qlog_test.go
keep keep add keep keep keep keep keep keep
<mask> "sync/atomic" <mask> "testing" <mask> <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func TestMain(m *testing.M) { <mask> testutil.DiscardLogOutput(m) <mask> } </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/stats/stats_test.go
keep add keep keep keep keep keep
<mask> ) <mask> <mask> func UIntArrayEquals(a, b []uint64) bool { <mask> if len(a) != len(b) { <mask> return false <mask> } <mask> </s> Pull request: 2273 clean tests output Merge in DNS/adguard-home from 2273-clean-tests-output to master Closes #2273. Squashed commit of the following: commit 7571a33fc1f76300bd256578b3afa95338e399c4 Merge: f17df0f9c a19523b25 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:45:30 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit f17df0f9ce2a3ed25db33fbc6a2e7cabd33f657b Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:35:42 2020 +0300 home: move build constraint on top line commit 3717c8ef5a51f9dcaa7e524bfa7b0f1d90bec93d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:24:50 2020 +0300 all: add improvements to changelog commit de6d5afe39d74a3c3d3e0bbe6d0e09aea0214d56 Merge: 43d4f7acf 394fc5a9d Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 15:04:38 2020 +0300 Merge branch 'master' into 2273-clean-tests-output commit 43d4f7acf188e810aa7277cb6479110c9842e8be Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 13:38:13 2020 +0300 dnsfilter: remove redundant test logging commit 7194c1413006b8f52fc454e89ab052bf52e4e517 Author: Eugene Burkov <[email protected]> Date: Mon Nov 16 12:19:14 2020 +0300 testutil: improve comments commit 9f17ab08e287fa69ce30d9e7eec8ea8880f87716 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:22:08 2020 +0300 nclient4: fix wrong function name commit f355749149b2a4485792ba2bdcbc0bb4b629d726 Author: Eugene Burkov <[email protected]> Date: Sat Nov 14 01:07:22 2020 +0300 testutil: fix comments and naming commit f8c50a260bfae08d594a7f37d603941d3680a45e Author: Eugene Burkov <[email protected]> Date: Fri Nov 13 14:09:50 2020 +0300 testutil: create a package and include it commit f169cdc4084b719de65aa0cdc65200b48785322e Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:15:58 2020 +0300 agherr: discard loggers output commit 360e736b5a2a30f2c5350448234f14b841e3ea27 Author: Eugene Burkov <[email protected]> Date: Thu Nov 12 20:09:55 2020 +0300 all: replace default log writer with ioutil.Discard Closes #2273. </s> remove t.Logf("IP addresses: %v", ips) </s> add </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } </s> add "github.com/AdguardTeam/AdGuardHome/internal/testutil"
https://github.com/AdguardTeam/AdGuardHome/commit/6358240e9b0f10acdc05b470a64535df8cfcf67e
internal/stats/stats_test.go