docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep add keep keep keep keep keep keep
<mask> }, <mask> } <mask> dns := dnsforward.NewCustomServer(&proxy.Proxy{ <mask> Config: proxy.Config{ <mask> UpstreamConfig: &proxy.UpstreamConfig{ <mask> Upstreams: []upstream.Upstream{extUpstream}, <mask> }, <mask> }, </s> Pull request: 2704 local addresses vol.2 Merge in DNS/adguard-home from 2704-local-addresses-vol.2 to master Updates #2704. Updates #2829. Squashed commit of the following: commit 507d038c2709de59246fc0b65c3c4ab8e38d1990 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:33:05 2021 +0300 aghtest: fix file name commit 8e19f99337bee1d88ad6595adb96f9bb23fa3c41 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:06:43 2021 +0300 aghnet: rm redundant mutexes commit 361fa418b33ed160ca20862be1c455ab9378c03f Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:45:30 2021 +0300 all: fix names, docs commit 14034f4f0230d7aaa3645054946ae5c278089a99 Merge: 35e265cc a72ce1cf Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:38:15 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit 35e265cc8cd308ef1fda414b58c0217cb5f258e4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:33:35 2021 +0300 aghnet: imp naming commit 7a7edac7208a40697d7bc50682b923a144e28e2b Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:59:54 2021 +0300 changelog: oops, nope yet commit d26a5d2513daf662ac92053b5e235189a64cc022 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:55:53 2021 +0300 all: some renaming for the glory of semantics commit 9937fa619452b0742616217b975e3ff048d58acb Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 29 15:34:42 2021 +0300 all: log changes commit d8d9e6dfeea8474466ee25f27021efdd3ddb1592 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 18:32:23 2021 +0300 all: imp localresolver, imp cutting off own addresses commit 344140df449b85925f19b460fd7dc7c08e29c35a Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 14:53:33 2021 +0300 all: imp code quality commit 1c5c0babec73b125044e23dd3aa75d8eefc19b28 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:44:08 2021 +0300 all: fix go.mod commit 0b9fb3c2369a752e893af8ddc45a86bb9fb27ce5 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:38:51 2021 +0300 all: add error handling commit a7a2e51f57fc6f8f74b95a264ad345cd2a9e026e Merge: c13be634 27f4f052 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 19:48:36 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit c13be634f47bcaed9320a732a51c0e4752d0dad0 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 18:52:28 2021 +0300 all: cover rdns with tests, imp aghnet functionality commit 48bed9025944530c613ee53e7961d6d5fbabf8be Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 20:18:07 2021 +0300 home: make rdns great again commit 1dbacfc8d5b6895807797998317fe3cc814617c1 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 16:07:52 2021 +0300 all: imp external client restriction commit 1208a319a7f4ffe7b7fa8956f245d7a19437c0a4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 22 15:26:45 2021 +0300 all: finish local ptr processor commit c8827fc3db289e1a5d7a11d057743bab39957b02 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 2 13:41:22 2021 +0300 all: imp ipdetector, add local ptr processor </s> remove Upstreams: []upstream.Upstream{ups}, </s> add Upstreams: []upstream.Upstream{extUpstream}, </s> remove func TestDNSReverseAddr(t *testing.T) { testCases := []struct { name string have string want net.IP }{{ name: "good_ipv4", have: "1.0.0.127.in-addr.arpa", want: net.IP{127, 0, 0, 1}, }, { name: "good_ipv6", have: "4.3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", want: net.ParseIP("::abcd:1234"), }, { name: "good_ipv6_case", have: "4.3.2.1.d.c.B.A.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", want: net.ParseIP("::abcd:1234"), }, { name: "bad_ipv4_dot", have: "1.0.0.127.in-addr.arpa.", }, { name: "wrong_ipv4", have: ".0.0.127.in-addr.arpa", }, { name: "wrong_ipv6", have: ".3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", }, { name: "bad_ipv6_dot", have: "4.3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0..ip6.arpa", }, { name: "bad_ipv6_space", have: "4.3.2.1.d.c.b. .0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { ip := DNSUnreverseAddr(tc.have) assert.True(t, tc.want.Equal(ip)) }) } } </s> add </s> remove func TestResolveRDNS(t *testing.T) { ups := &aghtest.TestUpstream{ </s> add func TestRDNS_Begin(t *testing.T) { aghtest.ReplaceLogLevel(t, log.DEBUG) w := &bytes.Buffer{} aghtest.ReplaceLogWriter(t, w) ip1234, ip1235 := net.IP{1, 2, 3, 4}, net.IP{1, 2, 3, 5} testCases := []struct { cliIDIndex map[string]*Client customChan chan net.IP name string wantLog string req net.IP wantCacheHit int wantCacheMiss int }{{ cliIDIndex: map[string]*Client{}, customChan: nil, name: "cached", wantLog: "", req: ip1234, wantCacheHit: 1, wantCacheMiss: 0, }, { cliIDIndex: map[string]*Client{}, customChan: nil, name: "not_cached", wantLog: "rdns: queue is full", req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }, { cliIDIndex: map[string]*Client{"1.2.3.5": {}}, customChan: nil, name: "already_in_clients", wantLog: "", req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }, { cliIDIndex: map[string]*Client{}, customChan: make(chan net.IP, 1), name: "add_to_queue", wantLog: `rdns: "1.2.3.5" added to queue`, req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }} for _, tc := range testCases { w.Reset() ipCache := cache.New(cache.Config{ EnableLRU: true, MaxCount: defaultRDNSCacheSize, }) ttl := make([]byte, binary.Size(uint64(0))) binary.BigEndian.PutUint64(ttl, uint64(time.Now().Add(100*time.Hour).Unix())) rdns := &RDNS{ ipCache: ipCache, clients: &clientsContainer{ list: map[string]*Client{}, idIndex: tc.cliIDIndex, ipHost: map[string]*ClientHost{}, allTags: map[string]bool{}, }, } ipCache.Clear() ipCache.Set(net.IP{1, 2, 3, 4}, ttl) if tc.customChan != nil { rdns.ipCh = tc.customChan defer close(tc.customChan) } t.Run(tc.name, func(t *testing.T) { rdns.Begin(tc.req) assert.Equal(t, tc.wantCacheHit, ipCache.Stats().Hit) assert.Equal(t, tc.wantCacheMiss, ipCache.Stats().Miss) assert.Contains(t, w.String(), tc.wantLog) }) } } func TestRDNS_Resolve(t *testing.T) { extUpstream := &aghtest.TestUpstream{ </s> remove clients := &clientsContainer{} rdns := InitRDNS(dns, clients) r := rdns.resolve(net.IP{1, 1, 1, 1}) assert.Equal(t, "one.one.one.one", r, r) </s> add cc := &clientsContainer{} snd, err := aghnet.NewSubnetDetector() require.NoError(t, err) localIP := net.IP{192, 168, 1, 1} testCases := []struct { name string want string wantErr error locUpstream upstream.Upstream req net.IP }{{ name: "external_good", want: "one.one.one.one", wantErr: nil, locUpstream: nil, req: net.IP{1, 1, 1, 1}, }, { name: "local_good", want: "local.domain", wantErr: nil, locUpstream: locUpstream, req: localIP, }, { name: "upstream_error", want: "", wantErr: upstreamErr, locUpstream: errUpstream, req: localIP, }, { name: "empty_answer_error", want: "", wantErr: rDNSEmptyAnswerErr, locUpstream: locUpstream, req: net.IP{192, 168, 1, 2}, }, { name: "not_ptr_error", want: "", wantErr: rDNSNotPTRErr, locUpstream: nonPtrUpstream, req: localIP, }} for _, tc := range testCases { rdns := NewRDNS(dns, cc, snd, &aghtest.Exchanger{ Ups: tc.locUpstream, }) t.Run(tc.name, func(t *testing.T) { r, rerr := rdns.resolve(tc.req) require.ErrorIs(t, rerr, tc.wantErr) assert.Equal(t, tc.want, r) }) } } func TestRDNS_WorkerLoop(t *testing.T) { aghtest.ReplaceLogLevel(t, log.DEBUG) w := &bytes.Buffer{} aghtest.ReplaceLogWriter(t, w) locUpstream := &aghtest.TestUpstream{ Reverse: map[string][]string{ "1.1.168.192.in-addr.arpa.": {"local.domain"}, }, } snd, err := aghnet.NewSubnetDetector() require.NoError(t, err) testCases := []struct { wantLog string name string cliIP net.IP }{{ wantLog: "", name: "all_good", cliIP: net.IP{192, 168, 1, 1}, }, { wantLog: `rdns: resolving "192.168.1.2": lookup for "2.1.168.192.in-addr.arpa.": ` + string(rDNSEmptyAnswerErr), name: "resolve_error", cliIP: net.IP{192, 168, 1, 2}, }} for _, tc := range testCases { w.Reset() lr := &aghtest.Exchanger{ Ups: locUpstream, } cc := &clientsContainer{ list: map[string]*Client{}, idIndex: map[string]*Client{}, ipHost: map[string]*ClientHost{}, allTags: map[string]bool{}, } ch := make(chan net.IP) rdns := &RDNS{ dnsServer: nil, clients: cc, subnetDetector: snd, localResolvers: lr, ipCh: ch, } t.Run(tc.name, func(t *testing.T) { var wg sync.WaitGroup wg.Add(1) go func() { rdns.workerLoop() wg.Done() }() ch <- tc.cliIP close(ch) wg.Wait() if tc.wantLog != "" { assert.Contains(t, w.String(), tc.wantLog) return } assert.True(t, cc.Exists(tc.cliIP.String(), ClientSourceRDNS)) }) } </s> remove Name: name, </s> add Name: n, </s> remove resp, err := r.dnsServer.Exchange(&dns.Msg{ </s> add arpa := dns.Fqdn(aghnet.ReverseAddr(ip)) msg := &dns.Msg{
https://github.com/AdguardTeam/AdGuardHome/commit/86444eacc2d38666b949b37163e9e53b499119eb
internal/home/rdns_test.go
keep replace keep keep keep keep replace replace replace replace
<mask> UpstreamConfig: &proxy.UpstreamConfig{ <mask> Upstreams: []upstream.Upstream{ups}, <mask> }, <mask> }, <mask> }) <mask> <mask> clients := &clientsContainer{} <mask> rdns := InitRDNS(dns, clients) <mask> r := rdns.resolve(net.IP{1, 1, 1, 1}) <mask> assert.Equal(t, "one.one.one.one", r, r) </s> Pull request: 2704 local addresses vol.2 Merge in DNS/adguard-home from 2704-local-addresses-vol.2 to master Updates #2704. Updates #2829. Squashed commit of the following: commit 507d038c2709de59246fc0b65c3c4ab8e38d1990 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:33:05 2021 +0300 aghtest: fix file name commit 8e19f99337bee1d88ad6595adb96f9bb23fa3c41 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:06:43 2021 +0300 aghnet: rm redundant mutexes commit 361fa418b33ed160ca20862be1c455ab9378c03f Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:45:30 2021 +0300 all: fix names, docs commit 14034f4f0230d7aaa3645054946ae5c278089a99 Merge: 35e265cc a72ce1cf Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:38:15 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit 35e265cc8cd308ef1fda414b58c0217cb5f258e4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:33:35 2021 +0300 aghnet: imp naming commit 7a7edac7208a40697d7bc50682b923a144e28e2b Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:59:54 2021 +0300 changelog: oops, nope yet commit d26a5d2513daf662ac92053b5e235189a64cc022 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:55:53 2021 +0300 all: some renaming for the glory of semantics commit 9937fa619452b0742616217b975e3ff048d58acb Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 29 15:34:42 2021 +0300 all: log changes commit d8d9e6dfeea8474466ee25f27021efdd3ddb1592 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 18:32:23 2021 +0300 all: imp localresolver, imp cutting off own addresses commit 344140df449b85925f19b460fd7dc7c08e29c35a Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 14:53:33 2021 +0300 all: imp code quality commit 1c5c0babec73b125044e23dd3aa75d8eefc19b28 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:44:08 2021 +0300 all: fix go.mod commit 0b9fb3c2369a752e893af8ddc45a86bb9fb27ce5 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:38:51 2021 +0300 all: add error handling commit a7a2e51f57fc6f8f74b95a264ad345cd2a9e026e Merge: c13be634 27f4f052 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 19:48:36 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit c13be634f47bcaed9320a732a51c0e4752d0dad0 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 18:52:28 2021 +0300 all: cover rdns with tests, imp aghnet functionality commit 48bed9025944530c613ee53e7961d6d5fbabf8be Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 20:18:07 2021 +0300 home: make rdns great again commit 1dbacfc8d5b6895807797998317fe3cc814617c1 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 16:07:52 2021 +0300 all: imp external client restriction commit 1208a319a7f4ffe7b7fa8956f245d7a19437c0a4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 22 15:26:45 2021 +0300 all: finish local ptr processor commit c8827fc3db289e1a5d7a11d057743bab39957b02 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 2 13:41:22 2021 +0300 all: imp ipdetector, add local ptr processor </s> add locUpstream := &aghtest.TestUpstream{ Reverse: map[string][]string{ "1.1.168.192.in-addr.arpa.": {"local.domain"}, "2.1.168.192.in-addr.arpa.": {}, }, } upstreamErr := errors.New("upstream error") errUpstream := &aghtest.TestErrUpstream{ Err: upstreamErr, } nonPtrUpstream := &aghtest.TestBlockUpstream{ Hostname: "some-host", Block: true, } </s> remove func TestResolveRDNS(t *testing.T) { ups := &aghtest.TestUpstream{ </s> add func TestRDNS_Begin(t *testing.T) { aghtest.ReplaceLogLevel(t, log.DEBUG) w := &bytes.Buffer{} aghtest.ReplaceLogWriter(t, w) ip1234, ip1235 := net.IP{1, 2, 3, 4}, net.IP{1, 2, 3, 5} testCases := []struct { cliIDIndex map[string]*Client customChan chan net.IP name string wantLog string req net.IP wantCacheHit int wantCacheMiss int }{{ cliIDIndex: map[string]*Client{}, customChan: nil, name: "cached", wantLog: "", req: ip1234, wantCacheHit: 1, wantCacheMiss: 0, }, { cliIDIndex: map[string]*Client{}, customChan: nil, name: "not_cached", wantLog: "rdns: queue is full", req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }, { cliIDIndex: map[string]*Client{"1.2.3.5": {}}, customChan: nil, name: "already_in_clients", wantLog: "", req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }, { cliIDIndex: map[string]*Client{}, customChan: make(chan net.IP, 1), name: "add_to_queue", wantLog: `rdns: "1.2.3.5" added to queue`, req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }} for _, tc := range testCases { w.Reset() ipCache := cache.New(cache.Config{ EnableLRU: true, MaxCount: defaultRDNSCacheSize, }) ttl := make([]byte, binary.Size(uint64(0))) binary.BigEndian.PutUint64(ttl, uint64(time.Now().Add(100*time.Hour).Unix())) rdns := &RDNS{ ipCache: ipCache, clients: &clientsContainer{ list: map[string]*Client{}, idIndex: tc.cliIDIndex, ipHost: map[string]*ClientHost{}, allTags: map[string]bool{}, }, } ipCache.Clear() ipCache.Set(net.IP{1, 2, 3, 4}, ttl) if tc.customChan != nil { rdns.ipCh = tc.customChan defer close(tc.customChan) } t.Run(tc.name, func(t *testing.T) { rdns.Begin(tc.req) assert.Equal(t, tc.wantCacheHit, ipCache.Stats().Hit) assert.Equal(t, tc.wantCacheMiss, ipCache.Stats().Miss) assert.Contains(t, w.String(), tc.wantLog) }) } } func TestRDNS_Resolve(t *testing.T) { extUpstream := &aghtest.TestUpstream{ </s> remove func TestDNSReverseAddr(t *testing.T) { testCases := []struct { name string have string want net.IP }{{ name: "good_ipv4", have: "1.0.0.127.in-addr.arpa", want: net.IP{127, 0, 0, 1}, }, { name: "good_ipv6", have: "4.3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", want: net.ParseIP("::abcd:1234"), }, { name: "good_ipv6_case", have: "4.3.2.1.d.c.B.A.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", want: net.ParseIP("::abcd:1234"), }, { name: "bad_ipv4_dot", have: "1.0.0.127.in-addr.arpa.", }, { name: "wrong_ipv4", have: ".0.0.127.in-addr.arpa", }, { name: "wrong_ipv6", have: ".3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", }, { name: "bad_ipv6_dot", have: "4.3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0..ip6.arpa", }, { name: "bad_ipv6_space", have: "4.3.2.1.d.c.b. .0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { ip := DNSUnreverseAddr(tc.have) assert.True(t, tc.want.Equal(ip)) }) } } </s> add </s> remove Name: name, </s> add Name: n, </s> remove resp, err := r.dnsServer.Exchange(&dns.Msg{ </s> add arpa := dns.Fqdn(aghnet.ReverseAddr(ip)) msg := &dns.Msg{
https://github.com/AdguardTeam/AdGuardHome/commit/86444eacc2d38666b949b37163e9e53b499119eb
internal/home/rdns_test.go
keep keep keep add keep keep keep keep
<mask> "runtime" <mask> "strings" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/fsnotify/fsnotify" <mask> "github.com/miekg/dns" <mask> ) </s> Pull request: 2704 local addresses vol.2 Merge in DNS/adguard-home from 2704-local-addresses-vol.2 to master Updates #2704. Updates #2829. Squashed commit of the following: commit 507d038c2709de59246fc0b65c3c4ab8e38d1990 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:33:05 2021 +0300 aghtest: fix file name commit 8e19f99337bee1d88ad6595adb96f9bb23fa3c41 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:06:43 2021 +0300 aghnet: rm redundant mutexes commit 361fa418b33ed160ca20862be1c455ab9378c03f Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:45:30 2021 +0300 all: fix names, docs commit 14034f4f0230d7aaa3645054946ae5c278089a99 Merge: 35e265cc a72ce1cf Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:38:15 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit 35e265cc8cd308ef1fda414b58c0217cb5f258e4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:33:35 2021 +0300 aghnet: imp naming commit 7a7edac7208a40697d7bc50682b923a144e28e2b Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:59:54 2021 +0300 changelog: oops, nope yet commit d26a5d2513daf662ac92053b5e235189a64cc022 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:55:53 2021 +0300 all: some renaming for the glory of semantics commit 9937fa619452b0742616217b975e3ff048d58acb Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 29 15:34:42 2021 +0300 all: log changes commit d8d9e6dfeea8474466ee25f27021efdd3ddb1592 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 18:32:23 2021 +0300 all: imp localresolver, imp cutting off own addresses commit 344140df449b85925f19b460fd7dc7c08e29c35a Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 14:53:33 2021 +0300 all: imp code quality commit 1c5c0babec73b125044e23dd3aa75d8eefc19b28 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:44:08 2021 +0300 all: fix go.mod commit 0b9fb3c2369a752e893af8ddc45a86bb9fb27ce5 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:38:51 2021 +0300 all: add error handling commit a7a2e51f57fc6f8f74b95a264ad345cd2a9e026e Merge: c13be634 27f4f052 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 19:48:36 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit c13be634f47bcaed9320a732a51c0e4752d0dad0 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 18:52:28 2021 +0300 all: cover rdns with tests, imp aghnet functionality commit 48bed9025944530c613ee53e7961d6d5fbabf8be Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 20:18:07 2021 +0300 home: make rdns great again commit 1dbacfc8d5b6895807797998317fe3cc814617c1 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 16:07:52 2021 +0300 all: imp external client restriction commit 1208a319a7f4ffe7b7fa8956f245d7a19437c0a4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 22 15:26:45 2021 +0300 all: finish local ptr processor commit c8827fc3db289e1a5d7a11d057743bab39957b02 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 2 13:41:22 2021 +0300 all: imp ipdetector, add local ptr processor </s> add "github.com/AdguardTeam/AdGuardHome/internal/agherr" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghnet" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghnet" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util" </s> add </s> remove "errors" </s> add </s> remove // RDNS - module context </s> add // RDNS resolves clients' addresses to enrich their metadata.
https://github.com/AdguardTeam/AdGuardHome/commit/86444eacc2d38666b949b37163e9e53b499119eb
internal/util/autohosts.go
keep keep keep keep replace keep keep keep keep keep
<mask> if qtype != dns.TypePTR { <mask> return nil <mask> } <mask> <mask> ipReal := DNSUnreverseAddr(addr) <mask> if ipReal == nil { <mask> return nil <mask> } <mask> <mask> ipStr := ipReal.String() </s> Pull request: 2704 local addresses vol.2 Merge in DNS/adguard-home from 2704-local-addresses-vol.2 to master Updates #2704. Updates #2829. Squashed commit of the following: commit 507d038c2709de59246fc0b65c3c4ab8e38d1990 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:33:05 2021 +0300 aghtest: fix file name commit 8e19f99337bee1d88ad6595adb96f9bb23fa3c41 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:06:43 2021 +0300 aghnet: rm redundant mutexes commit 361fa418b33ed160ca20862be1c455ab9378c03f Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:45:30 2021 +0300 all: fix names, docs commit 14034f4f0230d7aaa3645054946ae5c278089a99 Merge: 35e265cc a72ce1cf Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:38:15 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit 35e265cc8cd308ef1fda414b58c0217cb5f258e4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:33:35 2021 +0300 aghnet: imp naming commit 7a7edac7208a40697d7bc50682b923a144e28e2b Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:59:54 2021 +0300 changelog: oops, nope yet commit d26a5d2513daf662ac92053b5e235189a64cc022 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:55:53 2021 +0300 all: some renaming for the glory of semantics commit 9937fa619452b0742616217b975e3ff048d58acb Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 29 15:34:42 2021 +0300 all: log changes commit d8d9e6dfeea8474466ee25f27021efdd3ddb1592 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 18:32:23 2021 +0300 all: imp localresolver, imp cutting off own addresses commit 344140df449b85925f19b460fd7dc7c08e29c35a Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 14:53:33 2021 +0300 all: imp code quality commit 1c5c0babec73b125044e23dd3aa75d8eefc19b28 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:44:08 2021 +0300 all: fix go.mod commit 0b9fb3c2369a752e893af8ddc45a86bb9fb27ce5 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:38:51 2021 +0300 all: add error handling commit a7a2e51f57fc6f8f74b95a264ad345cd2a9e026e Merge: c13be634 27f4f052 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 19:48:36 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit c13be634f47bcaed9320a732a51c0e4752d0dad0 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 18:52:28 2021 +0300 all: cover rdns with tests, imp aghnet functionality commit 48bed9025944530c613ee53e7961d6d5fbabf8be Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 20:18:07 2021 +0300 home: make rdns great again commit 1dbacfc8d5b6895807797998317fe3cc814617c1 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 16:07:52 2021 +0300 all: imp external client restriction commit 1208a319a7f4ffe7b7fa8956f245d7a19437c0a4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 22 15:26:45 2021 +0300 all: finish local ptr processor commit c8827fc3db289e1a5d7a11d057743bab39957b02 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 2 13:41:22 2021 +0300 all: imp ipdetector, add local ptr processor </s> remove arpa := req.Question[0].Name arpa = strings.TrimSuffix(arpa, ".") arpa = strings.ToLower(arpa) ip := util.DNSUnreverseAddr(arpa) </s> add ip := aghnet.UnreverseAddr(q.Name) </s> remove host, ok := s.tablePTR[ip.String()] s.tablePTRLock.Unlock() </s> add ip := ctx.unreversedReqIP if ip == nil { return resultCodeSuccess } host, ok := s.ipToHost(ip) </s> remove ctx.proxyCtx.Res = resp </s> add d.Res = resp return resultCodeSuccess } // processLocalPTR responds to PTR requests if the target IP is detected to be // inside the local network and the query was not answered from DHCP. func (s *Server) processLocalPTR(ctx *dnsContext) (rc resultCode) { d := ctx.proxyCtx if d.Res != nil { return resultCodeSuccess } ip := ctx.unreversedReqIP if ip == nil { return resultCodeSuccess } if !s.subnetDetector.IsLocallyServedNetwork(ip) { return resultCodeSuccess } req := d.Req resp, err := s.localResolvers.Exchange(req) if err != nil { if errors.Is(err, aghnet.NoUpstreamsErr) { d.Res = s.genNXDomain(req) return resultCodeFinish } ctx.err = err return resultCodeError } d.Res = resp </s> remove s.tableHostToIPLock.Lock() if s.tableHostToIP == nil { s.tableHostToIPLock.Unlock() return resultCodeSuccess } ip, ok := s.tableHostToIP[host] s.tableHostToIPLock.Unlock() </s> add // TODO(e.burkov): Restrict the access for external clients. ip, ok := s.hostToIP(host) </s> remove s.tablePTRLock.Unlock() </s> add return "", false } host, ok = s.tablePTR[ip.String()] return host, ok } // Respond to PTR requests if the target IP is leased by our DHCP server and the // requestor is inside the local network. func (s *Server) processInternalIPAddrs(ctx *dnsContext) (rc resultCode) { d := ctx.proxyCtx if d.Res != nil { </s> remove if !Context.ipDetector.DetectSpecialNetwork(ip) { </s> add if !Context.subnetDetector.IsSpecialNetwork(ip) {
https://github.com/AdguardTeam/AdGuardHome/commit/86444eacc2d38666b949b37163e9e53b499119eb
internal/util/autohosts.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 replace replace replace replace replace replace replace replace replace replace replace replace replace
<mask> require.Len(t, ips, 1) <mask> assert.True(t, net.IP{127, 0, 0, 2}.Equal(ips[0])) <mask> }) <mask> } <mask> <mask> func TestDNSReverseAddr(t *testing.T) { <mask> testCases := []struct { <mask> name string <mask> have string <mask> want net.IP <mask> }{{ <mask> name: "good_ipv4", <mask> have: "1.0.0.127.in-addr.arpa", <mask> want: net.IP{127, 0, 0, 1}, <mask> }, { <mask> name: "good_ipv6", <mask> have: "4.3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", <mask> want: net.ParseIP("::abcd:1234"), <mask> }, { <mask> name: "good_ipv6_case", <mask> have: "4.3.2.1.d.c.B.A.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", <mask> want: net.ParseIP("::abcd:1234"), <mask> }, { <mask> name: "bad_ipv4_dot", <mask> have: "1.0.0.127.in-addr.arpa.", <mask> }, { <mask> name: "wrong_ipv4", <mask> have: ".0.0.127.in-addr.arpa", <mask> }, { <mask> name: "wrong_ipv6", <mask> have: ".3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", <mask> }, { <mask> name: "bad_ipv6_dot", <mask> have: "4.3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0..ip6.arpa", <mask> }, { <mask> name: "bad_ipv6_space", <mask> have: "4.3.2.1.d.c.b. .0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa", <mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { <mask> ip := DNSUnreverseAddr(tc.have) <mask> assert.True(t, tc.want.Equal(ip)) <mask> }) <mask> } <mask> } </s> Pull request: 2704 local addresses vol.2 Merge in DNS/adguard-home from 2704-local-addresses-vol.2 to master Updates #2704. Updates #2829. Squashed commit of the following: commit 507d038c2709de59246fc0b65c3c4ab8e38d1990 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:33:05 2021 +0300 aghtest: fix file name commit 8e19f99337bee1d88ad6595adb96f9bb23fa3c41 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 14:06:43 2021 +0300 aghnet: rm redundant mutexes commit 361fa418b33ed160ca20862be1c455ab9378c03f Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:45:30 2021 +0300 all: fix names, docs commit 14034f4f0230d7aaa3645054946ae5c278089a99 Merge: 35e265cc a72ce1cf Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:38:15 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit 35e265cc8cd308ef1fda414b58c0217cb5f258e4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 31 13:33:35 2021 +0300 aghnet: imp naming commit 7a7edac7208a40697d7bc50682b923a144e28e2b Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:59:54 2021 +0300 changelog: oops, nope yet commit d26a5d2513daf662ac92053b5e235189a64cc022 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 30 20:55:53 2021 +0300 all: some renaming for the glory of semantics commit 9937fa619452b0742616217b975e3ff048d58acb Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 29 15:34:42 2021 +0300 all: log changes commit d8d9e6dfeea8474466ee25f27021efdd3ddb1592 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 18:32:23 2021 +0300 all: imp localresolver, imp cutting off own addresses commit 344140df449b85925f19b460fd7dc7c08e29c35a Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Mar 26 14:53:33 2021 +0300 all: imp code quality commit 1c5c0babec73b125044e23dd3aa75d8eefc19b28 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:44:08 2021 +0300 all: fix go.mod commit 0b9fb3c2369a752e893af8ddc45a86bb9fb27ce5 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 20:38:51 2021 +0300 all: add error handling commit a7a2e51f57fc6f8f74b95a264ad345cd2a9e026e Merge: c13be634 27f4f052 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 19:48:36 2021 +0300 Merge branch 'master' into 2704-local-addresses-vol.2 commit c13be634f47bcaed9320a732a51c0e4752d0dad0 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Mar 25 18:52:28 2021 +0300 all: cover rdns with tests, imp aghnet functionality commit 48bed9025944530c613ee53e7961d6d5fbabf8be Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 20:18:07 2021 +0300 home: make rdns great again commit 1dbacfc8d5b6895807797998317fe3cc814617c1 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Mar 24 16:07:52 2021 +0300 all: imp external client restriction commit 1208a319a7f4ffe7b7fa8956f245d7a19437c0a4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 22 15:26:45 2021 +0300 all: finish local ptr processor commit c8827fc3db289e1a5d7a11d057743bab39957b02 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Mar 2 13:41:22 2021 +0300 all: imp ipdetector, add local ptr processor </s> remove clients := &clientsContainer{} rdns := InitRDNS(dns, clients) r := rdns.resolve(net.IP{1, 1, 1, 1}) assert.Equal(t, "one.one.one.one", r, r) </s> add cc := &clientsContainer{} snd, err := aghnet.NewSubnetDetector() require.NoError(t, err) localIP := net.IP{192, 168, 1, 1} testCases := []struct { name string want string wantErr error locUpstream upstream.Upstream req net.IP }{{ name: "external_good", want: "one.one.one.one", wantErr: nil, locUpstream: nil, req: net.IP{1, 1, 1, 1}, }, { name: "local_good", want: "local.domain", wantErr: nil, locUpstream: locUpstream, req: localIP, }, { name: "upstream_error", want: "", wantErr: upstreamErr, locUpstream: errUpstream, req: localIP, }, { name: "empty_answer_error", want: "", wantErr: rDNSEmptyAnswerErr, locUpstream: locUpstream, req: net.IP{192, 168, 1, 2}, }, { name: "not_ptr_error", want: "", wantErr: rDNSNotPTRErr, locUpstream: nonPtrUpstream, req: localIP, }} for _, tc := range testCases { rdns := NewRDNS(dns, cc, snd, &aghtest.Exchanger{ Ups: tc.locUpstream, }) t.Run(tc.name, func(t *testing.T) { r, rerr := rdns.resolve(tc.req) require.ErrorIs(t, rerr, tc.wantErr) assert.Equal(t, tc.want, r) }) } } func TestRDNS_WorkerLoop(t *testing.T) { aghtest.ReplaceLogLevel(t, log.DEBUG) w := &bytes.Buffer{} aghtest.ReplaceLogWriter(t, w) locUpstream := &aghtest.TestUpstream{ Reverse: map[string][]string{ "1.1.168.192.in-addr.arpa.": {"local.domain"}, }, } snd, err := aghnet.NewSubnetDetector() require.NoError(t, err) testCases := []struct { wantLog string name string cliIP net.IP }{{ wantLog: "", name: "all_good", cliIP: net.IP{192, 168, 1, 1}, }, { wantLog: `rdns: resolving "192.168.1.2": lookup for "2.1.168.192.in-addr.arpa.": ` + string(rDNSEmptyAnswerErr), name: "resolve_error", cliIP: net.IP{192, 168, 1, 2}, }} for _, tc := range testCases { w.Reset() lr := &aghtest.Exchanger{ Ups: locUpstream, } cc := &clientsContainer{ list: map[string]*Client{}, idIndex: map[string]*Client{}, ipHost: map[string]*ClientHost{}, allTags: map[string]bool{}, } ch := make(chan net.IP) rdns := &RDNS{ dnsServer: nil, clients: cc, subnetDetector: snd, localResolvers: lr, ipCh: ch, } t.Run(tc.name, func(t *testing.T) { var wg sync.WaitGroup wg.Add(1) go func() { rdns.workerLoop() wg.Done() }() ch <- tc.cliIP close(ch) wg.Wait() if tc.wantLog != "" { assert.Contains(t, w.String(), tc.wantLog) return } assert.True(t, cc.Exists(tc.cliIP.String(), ClientSourceRDNS)) }) } </s> remove func TestResolveRDNS(t *testing.T) { ups := &aghtest.TestUpstream{ </s> add func TestRDNS_Begin(t *testing.T) { aghtest.ReplaceLogLevel(t, log.DEBUG) w := &bytes.Buffer{} aghtest.ReplaceLogWriter(t, w) ip1234, ip1235 := net.IP{1, 2, 3, 4}, net.IP{1, 2, 3, 5} testCases := []struct { cliIDIndex map[string]*Client customChan chan net.IP name string wantLog string req net.IP wantCacheHit int wantCacheMiss int }{{ cliIDIndex: map[string]*Client{}, customChan: nil, name: "cached", wantLog: "", req: ip1234, wantCacheHit: 1, wantCacheMiss: 0, }, { cliIDIndex: map[string]*Client{}, customChan: nil, name: "not_cached", wantLog: "rdns: queue is full", req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }, { cliIDIndex: map[string]*Client{"1.2.3.5": {}}, customChan: nil, name: "already_in_clients", wantLog: "", req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }, { cliIDIndex: map[string]*Client{}, customChan: make(chan net.IP, 1), name: "add_to_queue", wantLog: `rdns: "1.2.3.5" added to queue`, req: ip1235, wantCacheHit: 0, wantCacheMiss: 1, }} for _, tc := range testCases { w.Reset() ipCache := cache.New(cache.Config{ EnableLRU: true, MaxCount: defaultRDNSCacheSize, }) ttl := make([]byte, binary.Size(uint64(0))) binary.BigEndian.PutUint64(ttl, uint64(time.Now().Add(100*time.Hour).Unix())) rdns := &RDNS{ ipCache: ipCache, clients: &clientsContainer{ list: map[string]*Client{}, idIndex: tc.cliIDIndex, ipHost: map[string]*ClientHost{}, allTags: map[string]bool{}, }, } ipCache.Clear() ipCache.Set(net.IP{1, 2, 3, 4}, ttl) if tc.customChan != nil { rdns.ipCh = tc.customChan defer close(tc.customChan) } t.Run(tc.name, func(t *testing.T) { rdns.Begin(tc.req) assert.Equal(t, tc.wantCacheHit, ipCache.Stats().Hit) assert.Equal(t, tc.wantCacheMiss, ipCache.Stats().Miss) assert.Contains(t, w.String(), tc.wantLog) }) } } func TestRDNS_Resolve(t *testing.T) { extUpstream := &aghtest.TestUpstream{ </s> remove assert.NoError(t, sr.Refresh()) </s> add assert.NoError(t, sr.refresh()) </s> remove Name: name, </s> add Name: n, </s> remove Upstreams: []upstream.Upstream{ups}, </s> add Upstreams: []upstream.Upstream{extUpstream}, </s> remove if !Context.ipDetector.DetectSpecialNetwork(ip) { </s> add if !Context.subnetDetector.IsSpecialNetwork(ip) {
https://github.com/AdguardTeam/AdGuardHome/commit/86444eacc2d38666b949b37163e9e53b499119eb
internal/util/autohosts_test.go
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> if host == "" { <mask> return Result{Reason: NotFilteredNotFound}, nil <mask> } <mask> host = strings.ToLower(host) <mask> // prevent recursion <mask> if host == d.parentalServer || host == d.safeBrowsingServer { <mask> return Result{}, nil <mask> } <mask> <mask> var result Result <mask> var err error <mask> <mask> result = d.processRewrites(host, qtype) </s> Merge: - DNS: fix security checks via PC/SB services Squashed commit of the following: commit e73bc282d77a11c923a86166035f1b44427d7066 Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 17:17:36 2019 +0300 fix commit f8b5c174816c6fd57fb3930cc465318f468fc8ff Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 17:03:13 2019 +0300 fix commit 9d5483a2fb89a172218547b5ee356e7122dca609 Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 16:54:30 2019 +0300 - fix security checks via PC/SB services </s> remove d.parentalUpstream, err = upstream.AddressToUpstream(d.parentalServer, upstream.Options{Timeout: dnsTimeout}) </s> add d.parentalUpstream, err = upstream.AddressToUpstream(d.parentalServer, opts) </s> remove d.safeBrowsingUpstream, err = upstream.AddressToUpstream(d.safeBrowsingServer, upstream.Options{Timeout: dnsTimeout}) </s> add d.safeBrowsingUpstream, err = upstream.AddressToUpstream(d.safeBrowsingServer, opts) </s> add opts := upstream.Options{Timeout: dnsTimeout, Bootstrap: bootstrapServers} </s> add // Servers to use for resolution of SB/PC server name var bootstrapServers = []string{"176.103.130.130", "176.103.130.131"}
https://github.com/AdguardTeam/AdGuardHome/commit/864c91e52412c8dc7d47d6d550fa4e96f08e49b4
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep
<mask> ) <mask> <mask> const dnsTimeout = 3 * time.Second <mask> const defaultSafebrowsingServer = "https://dns-family.adguard.com/dns-query" <mask> const defaultParentalServer = "https://dns-family.adguard.com/dns-query" <mask> const sbTXTSuffix = "sb.dns.adguard.com." <mask> const pcTXTSuffix = "pc.dns.adguard.com." </s> Merge: - DNS: fix security checks via PC/SB services Squashed commit of the following: commit e73bc282d77a11c923a86166035f1b44427d7066 Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 17:17:36 2019 +0300 fix commit f8b5c174816c6fd57fb3930cc465318f468fc8ff Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 17:03:13 2019 +0300 fix commit 9d5483a2fb89a172218547b5ee356e7122dca609 Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 16:54:30 2019 +0300 - fix security checks via PC/SB services </s> remove d.parentalUpstream, err = upstream.AddressToUpstream(d.parentalServer, upstream.Options{Timeout: dnsTimeout}) </s> add d.parentalUpstream, err = upstream.AddressToUpstream(d.parentalServer, opts) </s> add opts := upstream.Options{Timeout: dnsTimeout, Bootstrap: bootstrapServers} </s> remove d.safeBrowsingUpstream, err = upstream.AddressToUpstream(d.safeBrowsingServer, upstream.Options{Timeout: dnsTimeout}) </s> add d.safeBrowsingUpstream, err = upstream.AddressToUpstream(d.safeBrowsingServer, opts) </s> remove // prevent recursion if host == d.parentalServer || host == d.safeBrowsingServer { return Result{}, nil } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/864c91e52412c8dc7d47d6d550fa4e96f08e49b4
dnsfilter/security.go
keep add keep keep keep keep
<mask> d.safeBrowsingServer = defaultSafebrowsingServer <mask> d.parentalServer = defaultParentalServer <mask> <mask> d.parentalUpstream, err = upstream.AddressToUpstream(d.parentalServer, opts) <mask> if err != nil { <mask> return err </s> Merge: - DNS: fix security checks via PC/SB services Squashed commit of the following: commit e73bc282d77a11c923a86166035f1b44427d7066 Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 17:17:36 2019 +0300 fix commit f8b5c174816c6fd57fb3930cc465318f468fc8ff Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 17:03:13 2019 +0300 fix commit 9d5483a2fb89a172218547b5ee356e7122dca609 Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 16:54:30 2019 +0300 - fix security checks via PC/SB services </s> remove d.parentalUpstream, err = upstream.AddressToUpstream(d.parentalServer, upstream.Options{Timeout: dnsTimeout}) </s> add d.parentalUpstream, err = upstream.AddressToUpstream(d.parentalServer, opts) </s> remove d.safeBrowsingUpstream, err = upstream.AddressToUpstream(d.safeBrowsingServer, upstream.Options{Timeout: dnsTimeout}) </s> add d.safeBrowsingUpstream, err = upstream.AddressToUpstream(d.safeBrowsingServer, opts) </s> remove // prevent recursion if host == d.parentalServer || host == d.safeBrowsingServer { return Result{}, nil } </s> add </s> add // Servers to use for resolution of SB/PC server name var bootstrapServers = []string{"176.103.130.130", "176.103.130.131"}
https://github.com/AdguardTeam/AdGuardHome/commit/864c91e52412c8dc7d47d6d550fa4e96f08e49b4
dnsfilter/security.go
keep keep keep keep replace keep keep keep keep replace keep
<mask> var err error <mask> d.safeBrowsingServer = defaultSafebrowsingServer <mask> d.parentalServer = defaultParentalServer <mask> <mask> d.parentalUpstream, err = upstream.AddressToUpstream(d.parentalServer, upstream.Options{Timeout: dnsTimeout}) <mask> if err != nil { <mask> return err <mask> } <mask> <mask> d.safeBrowsingUpstream, err = upstream.AddressToUpstream(d.safeBrowsingServer, upstream.Options{Timeout: dnsTimeout}) <mask> if err != nil { </s> Merge: - DNS: fix security checks via PC/SB services Squashed commit of the following: commit e73bc282d77a11c923a86166035f1b44427d7066 Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 17:17:36 2019 +0300 fix commit f8b5c174816c6fd57fb3930cc465318f468fc8ff Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 17:03:13 2019 +0300 fix commit 9d5483a2fb89a172218547b5ee356e7122dca609 Author: Simon Zolin <s.zolin@adguard.com> Date: Fri Dec 13 16:54:30 2019 +0300 - fix security checks via PC/SB services </s> add opts := upstream.Options{Timeout: dnsTimeout, Bootstrap: bootstrapServers} </s> remove // prevent recursion if host == d.parentalServer || host == d.safeBrowsingServer { return Result{}, nil } </s> add </s> add // Servers to use for resolution of SB/PC server name var bootstrapServers = []string{"176.103.130.130", "176.103.130.131"}
https://github.com/AdguardTeam/AdGuardHome/commit/864c91e52412c8dc7d47d6d550fa4e96f08e49b4
dnsfilter/security.go
keep add keep keep keep keep
<mask> } <mask> <mask> // Process rewrites table <mask> // . Find CNAME for a domain name <mask> // . if found, set domain name to canonical name <mask> // . Find A or AAAA record for a domain name </s> + DNS Rewrites: support wildcard domain name </s> remove continue </s> add if !matchDomainWildcard(host, r.Domain) { continue } </s> remove continue </s> add if !matchDomainWildcard(host, r.Domain) { continue }
https://github.com/AdguardTeam/AdGuardHome/commit/8685584bf52450f255099617eb641ab636e97ff5
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> defer d.confLock.RUnlock() <mask> <mask> for _, r := range d.Rewrites { <mask> if r.Domain != host { <mask> continue <mask> } <mask> <mask> ip := net.ParseIP(r.Answer) <mask> if ip == nil { <mask> log.Debug("Rewrite: CNAME for %s is %s", host, r.Answer) </s> + DNS Rewrites: support wildcard domain name </s> remove continue </s> add if !matchDomainWildcard(host, r.Domain) { continue } </s> add // Return TRUE of host name matches a wildcard pattern func matchDomainWildcard(host, wildcard string) bool { return len(wildcard) >= 2 && wildcard[0] == '*' && wildcard[1] == '.' && strings.HasSuffix(host, wildcard[1:]) }
https://github.com/AdguardTeam/AdGuardHome/commit/8685584bf52450f255099617eb641ab636e97ff5
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> for _, r := range d.Rewrites { <mask> if r.Domain != host { <mask> continue <mask> } <mask> <mask> ip := net.ParseIP(r.Answer) <mask> if ip == nil { <mask> continue </s> + DNS Rewrites: support wildcard domain name </s> remove continue </s> add if !matchDomainWildcard(host, r.Domain) { continue } </s> add // Return TRUE of host name matches a wildcard pattern func matchDomainWildcard(host, wildcard string) bool { return len(wildcard) >= 2 && wildcard[0] == '*' && wildcard[1] == '.' && strings.HasSuffix(host, wildcard[1:]) }
https://github.com/AdguardTeam/AdGuardHome/commit/8685584bf52450f255099617eb641ab636e97ff5
dnsfilter/dnsfilter.go
keep keep add keep keep keep keep keep
<mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/hmage/golibs/log" <mask> "github.com/miekg/dns" <mask> govalidator "gopkg.in/asaskevich/govalidator.v4" <mask> ) <mask> <mask> const updatePeriod = time.Minute * 30 </s> /tls/configure -- introduce unmarshalTLS() that transparently base64-decodes the certificate </s> remove keyPEM, err := base64.StdEncoding.DecodeString(data.PrivateKey) if err != nil { httpError(w, http.StatusBadRequest, "Failed to base64-decode private key: %s", err) return } data.PrivateKey = string(keyPEM) _, err = tls.X509KeyPair(certPEM, keyPEM) </s> add _, err = tls.X509KeyPair([]byte(data.CertificateChain), []byte(data.PrivateKey)) </s> remove pemblock := []byte(certPEM) </s> add pemblock := []byte(data.CertificateChain) </s> remove certPEM, err := base64.StdEncoding.DecodeString(data.CertificateChain) if err != nil { httpError(w, http.StatusBadRequest, "Failed to base64-decode certificate chain: %s", err) return } data.CertificateChain = string(certPEM) log.Printf("got certificate: %s", certPEM) </s> add log.Printf("got certificate: %s", data.CertificateChain) </s> remove httpError(w, http.StatusBadRequest, "Failed to parse new TLS config json: %s", err) </s> add httpError(w, http.StatusBadRequest, "Failed to unmarshal TLS config: %s", err) </s> remove data := tlsConfig{} err := json.NewDecoder(r.Body).Decode(&data) </s> add data, err := unmarshalTLS(r)
https://github.com/AdguardTeam/AdGuardHome/commit/876bec5a65acfd8eae3aa4c4fcb4692d19efc166
control.go
keep keep keep keep replace replace keep replace
<mask> } <mask> } <mask> <mask> func handleTLSConfigure(w http.ResponseWriter, r *http.Request) { <mask> data := tlsConfig{} <mask> err := json.NewDecoder(r.Body).Decode(&data) <mask> if err != nil { <mask> httpError(w, http.StatusBadRequest, "Failed to parse new TLS config json: %s", err) </s> /tls/configure -- introduce unmarshalTLS() that transparently base64-decodes the certificate </s> remove certPEM, err := base64.StdEncoding.DecodeString(data.CertificateChain) if err != nil { httpError(w, http.StatusBadRequest, "Failed to base64-decode certificate chain: %s", err) return } data.CertificateChain = string(certPEM) log.Printf("got certificate: %s", certPEM) </s> add log.Printf("got certificate: %s", data.CertificateChain) </s> remove keyPEM, err := base64.StdEncoding.DecodeString(data.PrivateKey) if err != nil { httpError(w, http.StatusBadRequest, "Failed to base64-decode private key: %s", err) return } data.PrivateKey = string(keyPEM) _, err = tls.X509KeyPair(certPEM, keyPEM) </s> add _, err = tls.X509KeyPair([]byte(data.CertificateChain), []byte(data.PrivateKey)) </s> remove pemblock := []byte(certPEM) </s> add pemblock := []byte(data.CertificateChain) </s> add "github.com/joomcode/errorx"
https://github.com/AdguardTeam/AdGuardHome/commit/876bec5a65acfd8eae3aa4c4fcb4692d19efc166
control.go
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> return <mask> } <mask> <mask> if data.CertificateChain != "" { <mask> certPEM, err := base64.StdEncoding.DecodeString(data.CertificateChain) <mask> if err != nil { <mask> httpError(w, http.StatusBadRequest, "Failed to base64-decode certificate chain: %s", err) <mask> return <mask> } <mask> data.CertificateChain = string(certPEM) <mask> <mask> log.Printf("got certificate: %s", certPEM) <mask> <mask> if data.PrivateKey != "" { <mask> keyPEM, err := base64.StdEncoding.DecodeString(data.PrivateKey) <mask> if err != nil { <mask> httpError(w, http.StatusBadRequest, "Failed to base64-decode private key: %s", err) </s> /tls/configure -- introduce unmarshalTLS() that transparently base64-decodes the certificate </s> remove keyPEM, err := base64.StdEncoding.DecodeString(data.PrivateKey) if err != nil { httpError(w, http.StatusBadRequest, "Failed to base64-decode private key: %s", err) return } data.PrivateKey = string(keyPEM) _, err = tls.X509KeyPair(certPEM, keyPEM) </s> add _, err = tls.X509KeyPair([]byte(data.CertificateChain), []byte(data.PrivateKey)) </s> remove httpError(w, http.StatusBadRequest, "Failed to parse new TLS config json: %s", err) </s> add httpError(w, http.StatusBadRequest, "Failed to unmarshal TLS config: %s", err) </s> remove data := tlsConfig{} err := json.NewDecoder(r.Body).Decode(&data) </s> add data, err := unmarshalTLS(r) </s> remove pemblock := []byte(certPEM) </s> add pemblock := []byte(data.CertificateChain) </s> add "github.com/joomcode/errorx"
https://github.com/AdguardTeam/AdGuardHome/commit/876bec5a65acfd8eae3aa4c4fcb4692d19efc166
control.go
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> <mask> log.Printf("got certificate: %s", certPEM) <mask> <mask> if data.PrivateKey != "" { <mask> keyPEM, err := base64.StdEncoding.DecodeString(data.PrivateKey) <mask> if err != nil { <mask> httpError(w, http.StatusBadRequest, "Failed to base64-decode private key: %s", err) <mask> return <mask> } <mask> <mask> data.PrivateKey = string(keyPEM) <mask> <mask> _, err = tls.X509KeyPair(certPEM, keyPEM) <mask> if err != nil { <mask> httpError(w, http.StatusBadRequest, "Invalid certificate or key: %s", err) <mask> return <mask> } <mask> } </s> /tls/configure -- introduce unmarshalTLS() that transparently base64-decodes the certificate </s> remove certPEM, err := base64.StdEncoding.DecodeString(data.CertificateChain) if err != nil { httpError(w, http.StatusBadRequest, "Failed to base64-decode certificate chain: %s", err) return } data.CertificateChain = string(certPEM) log.Printf("got certificate: %s", certPEM) </s> add log.Printf("got certificate: %s", data.CertificateChain) </s> remove httpError(w, http.StatusBadRequest, "Failed to parse new TLS config json: %s", err) </s> add httpError(w, http.StatusBadRequest, "Failed to unmarshal TLS config: %s", err) </s> remove data := tlsConfig{} err := json.NewDecoder(r.Body).Decode(&data) </s> add data, err := unmarshalTLS(r) </s> remove pemblock := []byte(certPEM) </s> add pemblock := []byte(data.CertificateChain) </s> add "github.com/joomcode/errorx"
https://github.com/AdguardTeam/AdGuardHome/commit/876bec5a65acfd8eae3aa4c4fcb4692d19efc166
control.go
keep keep keep keep replace keep keep keep keep keep
<mask> // now do a more extended validation <mask> var certs []*pem.Block // PEM-encoded certificates <mask> var skippedBytes []string // skipped bytes <mask> <mask> pemblock := []byte(certPEM) <mask> for { <mask> var decoded *pem.Block <mask> decoded, pemblock = pem.Decode(pemblock) <mask> if decoded == nil { <mask> break </s> /tls/configure -- introduce unmarshalTLS() that transparently base64-decodes the certificate </s> remove certPEM, err := base64.StdEncoding.DecodeString(data.CertificateChain) if err != nil { httpError(w, http.StatusBadRequest, "Failed to base64-decode certificate chain: %s", err) return } data.CertificateChain = string(certPEM) log.Printf("got certificate: %s", certPEM) </s> add log.Printf("got certificate: %s", data.CertificateChain) </s> remove keyPEM, err := base64.StdEncoding.DecodeString(data.PrivateKey) if err != nil { httpError(w, http.StatusBadRequest, "Failed to base64-decode private key: %s", err) return } data.PrivateKey = string(keyPEM) _, err = tls.X509KeyPair(certPEM, keyPEM) </s> add _, err = tls.X509KeyPair([]byte(data.CertificateChain), []byte(data.PrivateKey)) </s> remove httpError(w, http.StatusBadRequest, "Failed to parse new TLS config json: %s", err) </s> add httpError(w, http.StatusBadRequest, "Failed to unmarshal TLS config: %s", err) </s> remove data := tlsConfig{} err := json.NewDecoder(r.Body).Decode(&data) </s> add data, err := unmarshalTLS(r) </s> add "github.com/joomcode/errorx"
https://github.com/AdguardTeam/AdGuardHome/commit/876bec5a65acfd8eae3aa4c4fcb4692d19efc166
control.go
keep keep keep replace keep replace replace replace replace replace replace replace replace replace replace
<mask> <mask> func TestDoUpdate(t *testing.T) { <mask> config.DNS.Port = 0 <mask> config.ourWorkingDir = "." <mask> u := updateInfo{ <mask> pkgURL: "https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.95/AdGuardHome_v0.95_linux_amd64.tar.gz", <mask> pkgName: "./AdGuardHome_v0.95_linux_amd64.tar.gz", <mask> newVer: "v0.95", <mask> updateDir: "./agh-update-v0.95", <mask> backupDir: "./agh-backup-v0.94", <mask> configName: "./AdGuardHome.yaml", <mask> updateConfigName: "./agh-update-v0.95/AdGuardHome/AdGuardHome.yaml", <mask> curBinName: "./AdGuardHome", <mask> bkpBinName: "./agh-backup-v0.94/AdGuardHome", <mask> newBinName: "./agh-update-v0.95/AdGuardHome/AdGuardHome", </s> * auto-update: refactor test; test getUpdateInfo() </s> add if uu.pkgURL != u.pkgURL || uu.pkgName != u.pkgName || uu.newVer != u.newVer || uu.updateDir != u.updateDir || uu.backupDir != u.backupDir || uu.configName != u.configName || uu.updateConfigName != u.updateConfigName || uu.curBinName != u.curBinName || uu.bkpBinName != u.bkpBinName || uu.newBinName != u.newBinName { t.Fatalf("getUpdateInfo: %v != %v", uu, u) }
https://github.com/AdguardTeam/AdGuardHome/commit/885b660808a848277f080c78dc7e6107afdbabb7
home/control_update_test.go
keep keep keep add keep keep keep keep
<mask> curBinName: config.ourWorkingDir + "/AdGuardHome", <mask> bkpBinName: config.ourWorkingDir + "/agh-backup/AdGuardHome", <mask> newBinName: config.ourWorkingDir + "/agh-update-" + newver + "/AdGuardHome/AdGuardHome", <mask> } <mask> e := doUpdate(&u) <mask> if e != nil { <mask> t.Fatalf("FAILED: %s", e) <mask> } </s> * auto-update: refactor test; test getUpdateInfo() </s> remove pkgURL: "https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.95/AdGuardHome_v0.95_linux_amd64.tar.gz", pkgName: "./AdGuardHome_v0.95_linux_amd64.tar.gz", newVer: "v0.95", updateDir: "./agh-update-v0.95", backupDir: "./agh-backup-v0.94", configName: "./AdGuardHome.yaml", updateConfigName: "./agh-update-v0.95/AdGuardHome/AdGuardHome.yaml", curBinName: "./AdGuardHome", bkpBinName: "./agh-backup-v0.94/AdGuardHome", newBinName: "./agh-update-v0.95/AdGuardHome/AdGuardHome", </s> add pkgURL: "https://github.com/AdguardTeam/AdGuardHome/releases/download/" + newver + "/AdGuardHome_linux_amd64.tar.gz", pkgName: config.ourWorkingDir + "/agh-update-" + newver + "/AdGuardHome_linux_amd64.tar.gz", newVer: newver, updateDir: config.ourWorkingDir + "/agh-update-" + newver, backupDir: config.ourWorkingDir + "/agh-backup", configName: config.ourWorkingDir + "/AdGuardHome.yaml", updateConfigName: config.ourWorkingDir + "/agh-update-" + newver + "/AdGuardHome/AdGuardHome.yaml", curBinName: config.ourWorkingDir + "/AdGuardHome", bkpBinName: config.ourWorkingDir + "/agh-backup/AdGuardHome", newBinName: config.ourWorkingDir + "/agh-update-" + newver + "/AdGuardHome/AdGuardHome", </s> remove config.ourWorkingDir = "." </s> add config.ourWorkingDir = "..." // set absolute path newver := "v0.96" data := `{ "version": "v0.96", "announcement": "AdGuard Home v0.96 is now available!", "announcement_url": "", "download_windows_amd64": "", "download_windows_386": "", "download_darwin_amd64": "", "download_linux_amd64": "https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.96/AdGuardHome_linux_amd64.tar.gz", "download_linux_386": "", "download_linux_arm": "", "download_linux_arm64": "", "download_linux_mips": "", "download_linux_mipsle": "", "selfupdate_min_version": "v0.0" }` uu, err := getUpdateInfo([]byte(data)) if err != nil { t.Fatalf("getUpdateInfo: %s", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/885b660808a848277f080c78dc7e6107afdbabb7
home/control_update_test.go
keep keep keep add keep keep keep keep keep keep
<mask> of common code. <mask> grade: stable <mask> confinement: strict <mask> <mask> parts: <mask> web-launcher: <mask> plugin: dump <mask> source: snap/local <mask> adguard-home: <mask> plugin: make </s> Add web launcher for desktop users </s> remove restart-condition: always </s> add </s> add web-launcher: plugin: dump source: snap/local </s> add restart-condition: always adguard-home-web: command: adguard-home-web.sh plugs: [desktop]
https://github.com/AdguardTeam/AdGuardHome/commit/8863e61e8e1394c0f590b179953989953bf620b5
packaging/snap/snapcraft.yaml
keep keep add keep keep keep keep
<mask> - build-on: arm64 <mask> <mask> parts: <mask> adguard-home: <mask> plugin: make <mask> source: . <mask> build-snaps: [ node/13/stable, go ] </s> Add web launcher for desktop users </s> remove restart-condition: always </s> add </s> add restart-condition: always adguard-home-web: command: adguard-home-web.sh plugs: [desktop] </s> add architectures: - build-on: amd64 - build-on: armhf - build-on: i386 - build-on: arm64
https://github.com/AdguardTeam/AdGuardHome/commit/8863e61e8e1394c0f590b179953989953bf620b5
packaging/snap/snapcraft.yaml
keep keep keep keep replace
<mask> adguard-home: <mask> command: AdGuardHome -w ${SNAP_DATA} --no-check-update <mask> plugs: [ network-bind ] <mask> daemon: simple <mask> restart-condition: always </s> Add web launcher for desktop users </s> add web-launcher: plugin: dump source: snap/local </s> add restart-condition: always adguard-home-web: command: adguard-home-web.sh plugs: [desktop] </s> add architectures: - build-on: amd64 - build-on: armhf - build-on: i386 - build-on: arm64
https://github.com/AdguardTeam/AdGuardHome/commit/8863e61e8e1394c0f590b179953989953bf620b5
packaging/snap/snapcraft.yaml
keep keep keep add
<mask> command: AdGuardHome -w ${SNAP_DATA} --no-check-update <mask> plugs: [ network-bind ] <mask> daemon: simple <mask> restart-condition: always </s> Add web launcher for desktop users </s> remove restart-condition: always </s> add </s> add web-launcher: plugin: dump source: snap/local </s> add architectures: - build-on: amd64 - build-on: armhf - build-on: i386 - build-on: arm64
https://github.com/AdguardTeam/AdGuardHome/commit/8863e61e8e1394c0f590b179953989953bf620b5
packaging/snap/snapcraft.yaml
keep keep keep keep replace keep keep keep keep keep
<mask> go 1.12 <mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.19.5 <mask> github.com/AdguardTeam/golibs v0.2.1 <mask> github.com/AdguardTeam/urlfilter v0.6.1 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 <mask> github.com/etcd-io/bbolt v1.3.3 <mask> github.com/go-test/deep v1.0.4 </s> * golibs v0.2.3 fix travis build </s> add github.com/AdguardTeam/urlfilter v0.6.1 h1:JX3gNYmgD9TCWE+G0C4MOn8WHYLAoVt0agltSvfldkY= </s> add github.com/AdguardTeam/golibs v0.2.3 h1:BYiXjZJdthxB+f1dq55yWLwYjCz161VPtfI6cEzFivw= github.com/AdguardTeam/golibs v0.2.3/go.mod h1:R3M+mAg3nWG4X4Hsag5eef/TckHFH12ZYhK7AzJc8+U=
https://github.com/AdguardTeam/AdGuardHome/commit/887c8a905f311bf74bdcc53753937c39fa7efa77
go.mod
keep add keep keep keep keep keep keep
<mask> github.com/AdguardTeam/golibs v0.2.1 h1:jGCnbM5UOUq/GrG+8eLN7Y+OTfEo5F/8L0wq3ur2h4E= <mask> github.com/AdguardTeam/golibs v0.2.1/go.mod h1:caAJ5knSHbR6vV6qfRDgAfXVia4hHgLqeztAY4UX0fw= <mask> github.com/AdguardTeam/urlfilter v0.6.0 h1:HVPfAsGcHW47HasmqcLNA/VJ41GaR/SzUufuIj70ouA= <mask> github.com/AdguardTeam/urlfilter v0.6.0/go.mod h1:y+XdxBdbRG9v7pfjznlvv4Ufi2HTG8D0YMqR22OVy0Y= <mask> github.com/AdguardTeam/urlfilter v0.6.1 h1:JX3gNYmgD9TCWE+G0C4MOn8WHYLAoVt0agltSvfldkY= <mask> github.com/AdguardTeam/urlfilter v0.6.1/go.mod h1:y+XdxBdbRG9v7pfjznlvv4Ufi2HTG8D0YMqR22OVy0Y= <mask> github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= <mask> github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= </s> * golibs v0.2.3 fix travis build </s> remove github.com/AdguardTeam/golibs v0.2.1 </s> add github.com/AdguardTeam/golibs v0.2.3 </s> add github.com/AdguardTeam/urlfilter v0.6.1 h1:JX3gNYmgD9TCWE+G0C4MOn8WHYLAoVt0agltSvfldkY=
https://github.com/AdguardTeam/AdGuardHome/commit/887c8a905f311bf74bdcc53753937c39fa7efa77
go.sum
keep keep add keep keep keep keep
<mask> github.com/AdguardTeam/golibs v0.2.3/go.mod h1:R3M+mAg3nWG4X4Hsag5eef/TckHFH12ZYhK7AzJc8+U= <mask> github.com/AdguardTeam/urlfilter v0.6.0 h1:HVPfAsGcHW47HasmqcLNA/VJ41GaR/SzUufuIj70ouA= <mask> github.com/AdguardTeam/urlfilter v0.6.0/go.mod h1:y+XdxBdbRG9v7pfjznlvv4Ufi2HTG8D0YMqR22OVy0Y= <mask> github.com/AdguardTeam/urlfilter v0.6.1/go.mod h1:y+XdxBdbRG9v7pfjznlvv4Ufi2HTG8D0YMqR22OVy0Y= <mask> github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= <mask> github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= <mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 h1:UUppSQnhf4Yc6xGxSkoQpPhb7RVzuv5Nb1mwJ5VId9s= </s> * golibs v0.2.3 fix travis build </s> remove github.com/AdguardTeam/golibs v0.2.1 </s> add github.com/AdguardTeam/golibs v0.2.3 </s> add github.com/AdguardTeam/golibs v0.2.3 h1:BYiXjZJdthxB+f1dq55yWLwYjCz161VPtfI6cEzFivw= github.com/AdguardTeam/golibs v0.2.3/go.mod h1:R3M+mAg3nWG4X4Hsag5eef/TckHFH12ZYhK7AzJc8+U=
https://github.com/AdguardTeam/AdGuardHome/commit/887c8a905f311bf74bdcc53753937c39fa7efa77
go.sum
keep keep keep keep replace replace keep keep keep keep keep
<mask> FilteringEnabled bool <mask> SafeSearchEnabled bool <mask> SafeBrowsingEnabled bool <mask> ParentalEnabled bool <mask> ClientTags []string <mask> ServicesRules []ServiceEntry <mask> } <mask> <mask> // Config allows you to configure DNS filtering with New() or just change variables directly. <mask> type Config struct { <mask> ParentalEnabled bool `yaml:"parental_enabled"` </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove _, ok := a.blockedHostsEngine.Match(host, nil) </s> add _, ok := a.blockedHostsEngine.Match(host) </s> remove return d.matchHost(host, qtype, setts.ClientTags) </s> add return d.matchHost(host, qtype, *setts) </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, setts RequestFilteringSettings) (Result, error) { </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> add setts.ClientName = c.Name </s> add setts.ClientIP = clientAddr
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> if !setts.FilteringEnabled { <mask> return Result{}, nil <mask> } <mask> <mask> return d.matchHost(host, qtype, setts.ClientTags) <mask> } <mask> <mask> // CheckHost tries to match the host against filtering rules, <mask> // then safebrowsing and parental if they are enabled <mask> func (d *Dnsfilter) CheckHost(host string, qtype uint16, setts *RequestFilteringSettings) (Result, error) { </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, setts RequestFilteringSettings) (Result, error) { </s> remove result, err = d.matchHost(host, qtype, setts.ClientTags) </s> add result, err = d.matchHost(host, qtype, *setts) </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> add setts.ClientIP = clientAddr </s> add setts.ClientName = c.Name </s> remove _, ok := a.blockedHostsEngine.Match(host, nil) </s> add _, ok := a.blockedHostsEngine.Match(host)
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> // try filter lists first <mask> if setts.FilteringEnabled { <mask> result, err = d.matchHost(host, qtype, setts.ClientTags) <mask> if err != nil { <mask> return result, err <mask> } <mask> if result.Reason.Matched() { <mask> return result, nil </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove return d.matchHost(host, qtype, setts.ClientTags) </s> add return d.matchHost(host, qtype, *setts) </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> add setts.ClientIP = clientAddr </s> add setts.ClientName = c.Name </s> remove rr, ok := d.filteringEngineWhite.Match(host, ctags) </s> add rr, ok := d.filteringEngineWhite.MatchRequest(ureq) </s> add ureq := urlfilter.DNSRequest{} ureq.Hostname = host ureq.ClientIP = setts.ClientIP ureq.ClientName = setts.ClientName ureq.SortedClientTags = setts.ClientTags
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> return nil <mask> } <mask> <mask> // matchHost is a low-level way to check only if hostname is filtered by rules, skipping expensive safebrowsing and parental lookups <mask> func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { <mask> d.engineLock.RLock() <mask> // Keep in mind that this lock must be held no just when calling Match() <mask> // but also while using the rules returned by it. <mask> defer d.engineLock.RUnlock() <mask> </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove return d.matchHost(host, qtype, setts.ClientTags) </s> add return d.matchHost(host, qtype, *setts) </s> remove rr, ok := d.filteringEngineWhite.Match(host, ctags) </s> add rr, ok := d.filteringEngineWhite.MatchRequest(ureq) </s> remove _, ok := a.blockedHostsEngine.Match(host, nil) </s> add _, ok := a.blockedHostsEngine.Match(host) </s> add ureq := urlfilter.DNSRequest{} ureq.Hostname = host ureq.ClientIP = setts.ClientIP ureq.ClientName = setts.ClientName ureq.SortedClientTags = setts.ClientTags </s> remove ClientTags []string ServicesRules []ServiceEntry </s> add ClientName string ClientIP string ClientTags []string ServicesRules []ServiceEntry </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq)
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep
<mask> defer d.engineLock.RUnlock() <mask> <mask> if d.filteringEngineWhite != nil { <mask> rr, ok := d.filteringEngineWhite.MatchRequest(ureq) <mask> if ok { <mask> var rule rules.Rule <mask> if rr.NetworkRule != nil { </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove rr, ok := d.filteringEngineWhite.Match(host, ctags) </s> add rr, ok := d.filteringEngineWhite.MatchRequest(ureq) </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> remove result, err = d.matchHost(host, qtype, setts.ClientTags) </s> add result, err = d.matchHost(host, qtype, *setts) </s> add setts.ClientIP = clientAddr </s> remove _, ok := a.blockedHostsEngine.Match(host, nil) </s> add _, ok := a.blockedHostsEngine.Match(host) </s> add setts.ClientName = c.Name
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> // but also while using the rules returned by it. <mask> defer d.engineLock.RUnlock() <mask> <mask> if d.filteringEngineWhite != nil { <mask> rr, ok := d.filteringEngineWhite.Match(host, ctags) <mask> if ok { <mask> var rule rules.Rule <mask> if rr.NetworkRule != nil { <mask> rule = rr.NetworkRule <mask> } else if rr.HostRulesV4 != nil { </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> add ureq := urlfilter.DNSRequest{} ureq.Hostname = host ureq.ClientIP = setts.ClientIP ureq.ClientName = setts.ClientName ureq.SortedClientTags = setts.ClientTags </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, setts RequestFilteringSettings) (Result, error) { </s> remove result, err = d.matchHost(host, qtype, setts.ClientTags) </s> add result, err = d.matchHost(host, qtype, *setts) </s> add setts.ClientIP = clientAddr </s> add setts.ClientName = c.Name
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> if d.filteringEngine == nil { <mask> return Result{}, nil <mask> } <mask> <mask> rr, ok := d.filteringEngine.Match(host, ctags) <mask> if !ok { <mask> return Result{}, nil <mask> } <mask> <mask> if rr.NetworkRule != nil { </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove rr, ok := d.filteringEngineWhite.Match(host, ctags) </s> add rr, ok := d.filteringEngineWhite.MatchRequest(ureq) </s> add setts.ClientIP = clientAddr </s> remove return d.matchHost(host, qtype, setts.ClientTags) </s> add return d.matchHost(host, qtype, *setts) </s> add ureq := urlfilter.DNSRequest{} ureq.Hostname = host ureq.ClientIP = setts.ClientIP ureq.ClientName = setts.ClientName ureq.SortedClientTags = setts.ClientTags </s> remove result, err = d.matchHost(host, qtype, setts.ClientTags) </s> add result, err = d.matchHost(host, qtype, *setts) </s> add setts.ClientName = c.Name
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // IsBlockedDomain - return TRUE if this domain should be blocked <mask> func (a *accessCtx) IsBlockedDomain(host string) bool { <mask> a.lock.Lock() <mask> _, ok := a.blockedHostsEngine.Match(host, nil) <mask> a.lock.Unlock() <mask> return ok <mask> } <mask> <mask> type accessListJSON struct { </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove ClientTags []string ServicesRules []ServiceEntry </s> add ClientName string ClientIP string ClientTags []string ServicesRules []ServiceEntry </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> add setts.ClientIP = clientAddr </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, setts RequestFilteringSettings) (Result, error) { </s> remove return d.matchHost(host, qtype, setts.ClientTags) </s> add return d.matchHost(host, qtype, *setts) </s> remove result, err = d.matchHost(host, qtype, setts.ClientTags) </s> add result, err = d.matchHost(host, qtype, *setts)
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
dnsforward/access.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.29.0 <mask> github.com/AdguardTeam/golibs v0.4.2 <mask> github.com/AdguardTeam/urlfilter v0.10.1 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/fsnotify/fsnotify v1.4.7 <mask> github.com/gobuffalo/packr v1.30.1 <mask> github.com/joomcode/errorx v1.0.1 <mask> github.com/kardianos/service v1.0.0 </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove github.com/AdguardTeam/urlfilter v0.10.1 h1:ECago6OvZjOTKlOqxU39C+V/ecAslaCDYcf5s+/hwaY= github.com/AdguardTeam/urlfilter v0.10.1/go.mod h1:aMuejlNxpWppOVjiEV87X6z0eMf7wsXHTAIWQuylfZY= </s> add github.com/AdguardTeam/urlfilter v0.11.0 h1:tgZss6uZs1UZAaxpovD/QuX+VVIQLDOlKc7rdF8dwNw= github.com/AdguardTeam/urlfilter v0.11.0/go.mod h1:aMuejlNxpWppOVjiEV87X6z0eMf7wsXHTAIWQuylfZY= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= </s> add setts.ClientName = c.Name </s> add setts.ClientIP = clientAddr </s> remove _, ok := a.blockedHostsEngine.Match(host, nil) </s> add _, ok := a.blockedHostsEngine.Match(host) </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> remove rr, ok := d.filteringEngineWhite.Match(host, ctags) </s> add rr, ok := d.filteringEngineWhite.MatchRequest(ureq)
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
go.mod
keep keep keep keep replace replace keep keep keep keep keep
<mask> github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.2 h1:7M28oTZFoFwNmp8eGPb3ImmYbxGaJLyQXeIFVHjME0o= <mask> github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU= <mask> github.com/AdguardTeam/urlfilter v0.10.1 h1:ECago6OvZjOTKlOqxU39C+V/ecAslaCDYcf5s+/hwaY= <mask> github.com/AdguardTeam/urlfilter v0.10.1/go.mod h1:aMuejlNxpWppOVjiEV87X6z0eMf7wsXHTAIWQuylfZY= <mask> github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= <mask> github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= <mask> github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= <mask> github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= <mask> github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove github.com/AdguardTeam/urlfilter v0.10.1 </s> add github.com/AdguardTeam/urlfilter v0.11.0 </s> add setts.ClientName = c.Name </s> add setts.ClientIP = clientAddr </s> remove _, ok := a.blockedHostsEngine.Match(host, nil) </s> add _, ok := a.blockedHostsEngine.Match(host) </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> remove rr, ok := d.filteringEngineWhite.Match(host, ctags) </s> add rr, ok := d.filteringEngineWhite.MatchRequest(ureq)
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
go.sum
keep add keep keep keep keep keep
<mask> return <mask> } <mask> <mask> c, ok := Context.clients.Find(clientAddr) <mask> if !ok { <mask> return <mask> } </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> remove _, ok := a.blockedHostsEngine.Match(host, nil) </s> add _, ok := a.blockedHostsEngine.Match(host) </s> add setts.ClientName = c.Name </s> remove result, err = d.matchHost(host, qtype, setts.ClientTags) </s> add result, err = d.matchHost(host, qtype, *setts) </s> remove return d.matchHost(host, qtype, setts.ClientTags) </s> add return d.matchHost(host, qtype, *setts) </s> remove rr, ok := d.filteringEngineWhite.Match(host, ctags) </s> add rr, ok := d.filteringEngineWhite.MatchRequest(ureq)
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
home/dns.go
keep add keep keep keep keep keep keep
<mask> } <mask> <mask> setts.ClientTags = c.Tags <mask> <mask> if !c.UseOwnSettings { <mask> return <mask> } <mask> </s> + pass client Name and IP to dnsfilter * use urlfilter v0.11.0 </s> add setts.ClientIP = clientAddr </s> remove result, err = d.matchHost(host, qtype, setts.ClientTags) </s> add result, err = d.matchHost(host, qtype, *setts) </s> remove rr, ok := d.filteringEngine.Match(host, ctags) </s> add rr, ok := d.filteringEngine.MatchRequest(ureq) </s> add ureq := urlfilter.DNSRequest{} ureq.Hostname = host ureq.ClientIP = setts.ClientIP ureq.ClientName = setts.ClientName ureq.SortedClientTags = setts.ClientTags </s> remove return d.matchHost(host, qtype, setts.ClientTags) </s> add return d.matchHost(host, qtype, *setts) </s> remove _, ok := a.blockedHostsEngine.Match(host, nil) </s> add _, ok := a.blockedHostsEngine.Match(host)
https://github.com/AdguardTeam/AdGuardHome/commit/890876cb0539d4916a21c0e0771a9d4e8322b9be
home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> go 1.16 <mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.37.5 <mask> github.com/AdguardTeam/golibs v0.8.0 <mask> github.com/AdguardTeam/urlfilter v0.14.5 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/ameshkov/dnscrypt/v2 v2.1.3 <mask> github.com/digineo/go-ipset/v2 v2.2.1 </s> Pull request: all: upd dnsproxy, fix test, minor imp Merge in DNS/adguard-home from upd-dnsproxy to master Squashed commit of the following: commit 52365328a4c653b0d3bf6d11d8f66a3bf8e0f402 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:49:50 2021 +0300 all: rm debug mod replace commit b29e3cffc5dfa58951a9d819a196e588d26dd887 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:46:22 2021 +0300 all: upd dnsproxy, fix test, minor imp </s> remove github.com/AdguardTeam/dnsproxy v0.37.5 h1:BvMm6LKyuWCQB0ELVRSAwXQ0TdYTqEWe4Ib40SibWbs= github.com/AdguardTeam/dnsproxy v0.37.5/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= </s> add github.com/AdguardTeam/dnsproxy v0.37.6 h1:qN9KX/fxLIR5TZKtpPHmMx/AUJLAdeXbQ5sjdqHXWW0= github.com/AdguardTeam/dnsproxy v0.37.6/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= </s> remove return uint8(code), data, nil </s> add return code, data, nil </s> remove func TestNullBool_UnmarshalText(t *testing.T) { </s> add func TestNullBool_UnmarshalJSON(t *testing.T) { </s> add m.SetReply(r)
https://github.com/AdguardTeam/AdGuardHome/commit/89694763f57d3cfa0a5f6cdaa47abdd485bcd558
go.mod
keep keep keep keep replace replace keep keep keep keep keep
<mask> dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= <mask> git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= <mask> github.com/AdguardTeam/dhcp v0.0.0-20210519141215-51808c73c0bf h1:gc042VRSIRSUzZ+Px6xQCRWNJZTaPkomisDfUZmoFNk= <mask> github.com/AdguardTeam/dhcp v0.0.0-20210519141215-51808c73c0bf/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI= <mask> github.com/AdguardTeam/dnsproxy v0.37.5 h1:BvMm6LKyuWCQB0ELVRSAwXQ0TdYTqEWe4Ib40SibWbs= <mask> github.com/AdguardTeam/dnsproxy v0.37.5/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= <mask> github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.8.0 h1:rHo+yIgT2fivFG0yW2Cwk/DPc2+t/Aw6QvzPpiIFre0= <mask> github.com/AdguardTeam/golibs v0.8.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= </s> Pull request: all: upd dnsproxy, fix test, minor imp Merge in DNS/adguard-home from upd-dnsproxy to master Squashed commit of the following: commit 52365328a4c653b0d3bf6d11d8f66a3bf8e0f402 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:49:50 2021 +0300 all: rm debug mod replace commit b29e3cffc5dfa58951a9d819a196e588d26dd887 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:46:22 2021 +0300 all: upd dnsproxy, fix test, minor imp </s> remove github.com/AdguardTeam/dnsproxy v0.37.5 </s> add github.com/AdguardTeam/dnsproxy v0.37.6 </s> remove return uint8(code), data, nil </s> add return code, data, nil </s> remove func TestNullBool_UnmarshalText(t *testing.T) { </s> add func TestNullBool_UnmarshalJSON(t *testing.T) { </s> add m.SetReply(r)
https://github.com/AdguardTeam/AdGuardHome/commit/89694763f57d3cfa0a5f6cdaa47abdd485bcd558
go.sum
keep keep add keep keep keep keep
<mask> } <mask> <mask> m := &dns.Msg{} <mask> m.Answer = []dns.RR{ <mask> &dns.TXT{ <mask> Hdr: dns.RR_Header{ <mask> Name: r.Question[0].Name, </s> Pull request: all: upd dnsproxy, fix test, minor imp Merge in DNS/adguard-home from upd-dnsproxy to master Squashed commit of the following: commit 52365328a4c653b0d3bf6d11d8f66a3bf8e0f402 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:49:50 2021 +0300 all: rm debug mod replace commit b29e3cffc5dfa58951a9d819a196e588d26dd887 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:46:22 2021 +0300 all: upd dnsproxy, fix test, minor imp </s> remove return uint8(code), data, nil </s> add return code, data, nil </s> remove func TestNullBool_UnmarshalText(t *testing.T) { </s> add func TestNullBool_UnmarshalJSON(t *testing.T) { </s> remove github.com/AdguardTeam/dnsproxy v0.37.5 h1:BvMm6LKyuWCQB0ELVRSAwXQ0TdYTqEWe4Ib40SibWbs= github.com/AdguardTeam/dnsproxy v0.37.5/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= </s> add github.com/AdguardTeam/dnsproxy v0.37.6 h1:qN9KX/fxLIR5TZKtpPHmMx/AUJLAdeXbQ5sjdqHXWW0= github.com/AdguardTeam/dnsproxy v0.37.6/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= </s> remove github.com/AdguardTeam/dnsproxy v0.37.5 </s> add github.com/AdguardTeam/dnsproxy v0.37.6
https://github.com/AdguardTeam/AdGuardHome/commit/89694763f57d3cfa0a5f6cdaa47abdd485bcd558
internal/aghtest/upstream.go
keep keep keep keep replace keep keep keep keep keep
<mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestNullBool_UnmarshalText(t *testing.T) { <mask> testCases := []struct { <mask> name string <mask> data []byte <mask> wantErrMsg string <mask> want nullBool </s> Pull request: all: upd dnsproxy, fix test, minor imp Merge in DNS/adguard-home from upd-dnsproxy to master Squashed commit of the following: commit 52365328a4c653b0d3bf6d11d8f66a3bf8e0f402 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:49:50 2021 +0300 all: rm debug mod replace commit b29e3cffc5dfa58951a9d819a196e588d26dd887 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:46:22 2021 +0300 all: upd dnsproxy, fix test, minor imp </s> remove return uint8(code), data, nil </s> add return code, data, nil </s> add m.SetReply(r) </s> remove github.com/AdguardTeam/dnsproxy v0.37.5 h1:BvMm6LKyuWCQB0ELVRSAwXQ0TdYTqEWe4Ib40SibWbs= github.com/AdguardTeam/dnsproxy v0.37.5/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= </s> add github.com/AdguardTeam/dnsproxy v0.37.6 h1:qN9KX/fxLIR5TZKtpPHmMx/AUJLAdeXbQ5sjdqHXWW0= github.com/AdguardTeam/dnsproxy v0.37.6/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= </s> remove github.com/AdguardTeam/dnsproxy v0.37.5 </s> add github.com/AdguardTeam/dnsproxy v0.37.6
https://github.com/AdguardTeam/AdGuardHome/commit/89694763f57d3cfa0a5f6cdaa47abdd485bcd558
internal/dhcpd/nullbool_test.go
keep keep keep keep replace keep
<mask> if err != nil { <mask> return 0, nil, err <mask> } <mask> <mask> return uint8(code), data, nil <mask> } </s> Pull request: all: upd dnsproxy, fix test, minor imp Merge in DNS/adguard-home from upd-dnsproxy to master Squashed commit of the following: commit 52365328a4c653b0d3bf6d11d8f66a3bf8e0f402 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:49:50 2021 +0300 all: rm debug mod replace commit b29e3cffc5dfa58951a9d819a196e588d26dd887 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jun 10 18:46:22 2021 +0300 all: upd dnsproxy, fix test, minor imp </s> add m.SetReply(r) </s> remove func TestNullBool_UnmarshalText(t *testing.T) { </s> add func TestNullBool_UnmarshalJSON(t *testing.T) { </s> remove github.com/AdguardTeam/dnsproxy v0.37.5 h1:BvMm6LKyuWCQB0ELVRSAwXQ0TdYTqEWe4Ib40SibWbs= github.com/AdguardTeam/dnsproxy v0.37.5/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= </s> add github.com/AdguardTeam/dnsproxy v0.37.6 h1:qN9KX/fxLIR5TZKtpPHmMx/AUJLAdeXbQ5sjdqHXWW0= github.com/AdguardTeam/dnsproxy v0.37.6/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= </s> remove github.com/AdguardTeam/dnsproxy v0.37.5 </s> add github.com/AdguardTeam/dnsproxy v0.37.6
https://github.com/AdguardTeam/AdGuardHome/commit/89694763f57d3cfa0a5f6cdaa47abdd485bcd558
internal/dhcpd/options.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> // bootstrap servers are plain DNS only. We should return http error if there are tls:// https:// or sdns:// hosts in slice <mask> for _, host := range newconfig.BootstrapDNS { <mask> err := checkBootstrapDNS(host) <mask> if err != nil { <mask> httpError(w, http.StatusBadRequest, "%s can not be used as bootstrap dns cause: %s", host, err) <mask> return <mask> } <mask> } </s> [change] control: update bootstrap DNS check </s> remove _, _, err := net.SplitHostPort(host) return err </s> add ip, port, err := net.SplitHostPort(host) if err != nil { return err } if net.ParseIP(ip) == nil { return fmt.Errorf("%s is not valid IP", ip) } _, err = strconv.ParseInt(port, 0, 64) if err != nil { return fmt.Errorf("%s is not valid port: %s", port, err) } return nil </s> remove // checkBootstrapDNS checks if host is plain DNS func checkBootstrapDNS(host string) error { </s> add // checkPlainDNS checks if host is plain DNS func checkPlainDNS(host string) error {
https://github.com/AdguardTeam/AdGuardHome/commit/89b6323f03a476f0c1d3ffecbb8bb372a4951e18
control.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> config.DNS.AllServers = newconfig.AllServers <mask> httpUpdateConfigReloadDNSReturnOK(w, r) <mask> } <mask> <mask> // checkBootstrapDNS checks if host is plain DNS <mask> func checkBootstrapDNS(host string) error { <mask> // Check if host is ip without port <mask> if net.ParseIP(host) != nil { <mask> return nil <mask> } <mask> </s> [change] control: update bootstrap DNS check </s> remove _, _, err := net.SplitHostPort(host) return err </s> add ip, port, err := net.SplitHostPort(host) if err != nil { return err } if net.ParseIP(ip) == nil { return fmt.Errorf("%s is not valid IP", ip) } _, err = strconv.ParseInt(port, 0, 64) if err != nil { return fmt.Errorf("%s is not valid port: %s", port, err) } return nil </s> remove err := checkBootstrapDNS(host) </s> add err := checkPlainDNS(host)
https://github.com/AdguardTeam/AdGuardHome/commit/89b6323f03a476f0c1d3ffecbb8bb372a4951e18
control.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> return nil <mask> } <mask> <mask> // Check if host is ip with port <mask> _, _, err := net.SplitHostPort(host) <mask> return err <mask> } <mask> <mask> func handleTestUpstreamDNS(w http.ResponseWriter, r *http.Request) { <mask> log.Tracef("%s %v", r.Method, r.URL) <mask> upstreamConfig := upstreamConfig{} </s> [change] control: update bootstrap DNS check </s> remove err := checkBootstrapDNS(host) </s> add err := checkPlainDNS(host) </s> remove // checkBootstrapDNS checks if host is plain DNS func checkBootstrapDNS(host string) error { </s> add // checkPlainDNS checks if host is plain DNS func checkPlainDNS(host string) error {
https://github.com/AdguardTeam/AdGuardHome/commit/89b6323f03a476f0c1d3ffecbb8bb372a4951e18
control.go
keep keep keep keep replace keep keep keep keep keep
<mask> 'name': 'AdGuard Home - Build and publish release' <mask> # Make sure to sync any changes with the branch overrides below. <mask> 'variables': <mask> 'channel': 'edge' <mask> 'dockerGo': 'adguard/golang-ubuntu:4.1' <mask> <mask> 'stages': <mask> - 'Make release': <mask> 'manual': false <mask> 'final': false </s> Pull request: all: upd go Merge in DNS/adguard-home from upd-go to master Squashed commit of the following: commit 3b6c960afe073223dd73eaf650561509f0d13019 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 4 15:45:15 2022 +0300 all: upd go </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2' </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2' </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2'
https://github.com/AdguardTeam/AdGuardHome/commit/89d9b03dfec8a5f1406507d45e582e852e748859
bamboo-specs/release.yaml
keep keep keep keep replace keep keep keep keep keep
<mask> # Set the default release channel on the release branch to beta, as we may <mask> # need to build a few of these. <mask> 'variables': <mask> 'channel': 'beta' <mask> 'dockerGo': 'adguard/golang-ubuntu:4.1' <mask> # release-vX.Y.Z branches are the branches from which the actual final release <mask> # is built. <mask> - '^release-v[0-9]+\.[0-9]+\.[0-9]+': <mask> # Disable integration branches for release branches. <mask> 'branch-config': </s> Pull request: all: upd go Merge in DNS/adguard-home from upd-go to master Squashed commit of the following: commit 3b6c960afe073223dd73eaf650561509f0d13019 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 4 15:45:15 2022 +0300 all: upd go </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2' </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2' </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2'
https://github.com/AdguardTeam/AdGuardHome/commit/89d9b03dfec8a5f1406507d45e582e852e748859
bamboo-specs/release.yaml
keep keep keep keep replace
<mask> # Set the default release channel on the final branch to release, as these <mask> # are the ones that actually get released. <mask> 'variables': <mask> 'channel': 'release' <mask> 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> Pull request: all: upd go Merge in DNS/adguard-home from upd-go to master Squashed commit of the following: commit 3b6c960afe073223dd73eaf650561509f0d13019 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 4 15:45:15 2022 +0300 all: upd go </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2' </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2' </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2'
https://github.com/AdguardTeam/AdGuardHome/commit/89d9b03dfec8a5f1406507d45e582e852e748859
bamboo-specs/release.yaml
keep keep keep keep replace keep keep keep keep keep
<mask> 'project-key': 'AGH' <mask> 'key': 'AHBRTSPECS' <mask> 'name': 'AdGuard Home - Build and run tests' <mask> 'variables': <mask> 'dockerGo': 'adguard/golang-ubuntu:4.1' <mask> <mask> 'stages': <mask> - 'Tests': <mask> 'manual': false <mask> 'final': false </s> Pull request: all: upd go Merge in DNS/adguard-home from upd-go to master Squashed commit of the following: commit 3b6c960afe073223dd73eaf650561509f0d13019 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Mar 4 15:45:15 2022 +0300 all: upd go </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2' </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2' </s> remove 'dockerGo': 'adguard/golang-ubuntu:4.1' </s> add 'dockerGo': 'adguard/golang-ubuntu:4.2'
https://github.com/AdguardTeam/AdGuardHome/commit/89d9b03dfec8a5f1406507d45e582e852e748859
bamboo-specs/test.yaml
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> // <mask> // TODO(a.garipov): Make better use of newtypes. Perhaps a custom map. <mask> tableReverse map[string][]string <mask> <mask> hostsFn string // path to the main hosts-file <mask> hostsDirs []string // paths to OS-specific directories with hosts-files <mask> watcher *fsnotify.Watcher // file and directory watcher object <mask> updateChan chan bool // signal for 'updateLoop' goroutine <mask> <mask> onChanged onChangedT // notification to other modules <mask> } <mask> <mask> // SetOnChanged - set callback function that will be called when the data is changed </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> remove select { case a.updateChan <- true: // sent a signal to 'updateLoop' goroutine default: // queue is full } </s> add a.updateHosts() </s> add close(a.onlyWritesChan) </s> add // Assume that we sometimes have the same event occurred // several times. </s> remove a.updateChan = make(chan bool, 2) </s> add a.onlyWritesChan = make(chan fsnotify.Event, 2) </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Init - initialize <mask> // hostsFn: Override default name for the hosts-file (optional) <mask> func (a *AutoHosts) Init(hostsFn string) { <mask> a.table = make(map[string][]net.IP) <mask> a.updateChan = make(chan bool, 2) <mask> <mask> a.hostsFn = "/etc/hosts" <mask> if runtime.GOOS == "windows" { <mask> a.hostsFn = os.ExpandEnv("$SystemRoot\\system32\\drivers\\etc\\hosts") <mask> } </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> add close(a.onlyWritesChan) </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> remove a.updateChan <- false close(a.updateChan) </s> add </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> add // Assume that we sometimes have the same event occurred // several times. </s> remove case <-a.watcher.Events: // Skip this duplicating event </s> add case _, ok = <-a.onlyWritesChan: repeat = ok
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> // Start - start module <mask> func (a *AutoHosts) Start() { <mask> log.Debug("Start AutoHosts module") <mask> <mask> go a.updateLoop() <mask> a.updateChan <- true <mask> <mask> if a.watcher != nil { <mask> go a.watcherLoop() <mask> <mask> err := a.watcher.Add(a.hostsFn) </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> remove a.updateChan <- false close(a.updateChan) </s> add </s> add close(a.onlyWritesChan) </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> add go a.onlyWrites() </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> remove case event, ok := <-a.watcher.Events: </s> add case event, ok := <-a.onlyWritesChan:
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> } <mask> <mask> // Close - close module <mask> func (a *AutoHosts) Close() { <mask> a.updateChan <- false <mask> close(a.updateChan) <mask> if a.watcher != nil { <mask> _ = a.watcher.Close() <mask> } <mask> } <mask> </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> add close(a.onlyWritesChan) </s> remove go a.updateLoop() a.updateChan <- true </s> add a.updateHosts() </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> remove case <-a.watcher.Events: // Skip this duplicating event </s> add case _, ok = <-a.onlyWritesChan: repeat = ok </s> remove a.updateChan = make(chan bool, 2) </s> add a.onlyWritesChan = make(chan fsnotify.Event, 2)
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep add keep keep keep keep
<mask> func (a *AutoHosts) Close() { <mask> if a.watcher != nil { <mask> _ = a.watcher.Close() <mask> } <mask> } <mask> <mask> // Process returns the list of IP addresses for the hostname or nil if nothing <mask> // found. </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> remove a.updateChan <- false close(a.updateChan) </s> add </s> remove go a.updateLoop() a.updateChan <- true </s> add a.updateHosts() </s> remove a.updateChan = make(chan bool, 2) </s> add a.onlyWritesChan = make(chan fsnotify.Event, 2) </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> add go a.onlyWrites()
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep add keep keep keep keep keep keep
<mask> } <mask> } <mask> } <mask> <mask> // Receive notifications from fsnotify package <mask> func (a *AutoHosts) watcherLoop() { <mask> go a.onlyWrites() <mask> for { <mask> select { <mask> case event, ok := <-a.onlyWritesChan: </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> add go a.onlyWrites() </s> remove case event, ok := <-a.watcher.Events: </s> add case event, ok := <-a.onlyWritesChan: </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> remove case <-a.watcher.Events: // Skip this duplicating event </s> add case _, ok = <-a.onlyWritesChan: repeat = ok </s> remove a.updateChan <- false close(a.updateChan) </s> add </s> add close(a.onlyWritesChan)
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep add keep keep keep keep keep keep
<mask> // Receive notifications from fsnotify package <mask> func (a *AutoHosts) watcherLoop() { <mask> for { <mask> select { <mask> case event, ok := <-a.onlyWritesChan: <mask> if !ok { <mask> return <mask> } </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> remove case event, ok := <-a.watcher.Events: </s> add case event, ok := <-a.onlyWritesChan: </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> remove select { case a.updateChan <- true: // sent a signal to 'updateLoop' goroutine default: // queue is full } </s> add a.updateHosts() </s> add close(a.onlyWritesChan) </s> remove a.updateChan <- false close(a.updateChan) </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Receive notifications from fsnotify package <mask> func (a *AutoHosts) watcherLoop() { <mask> for { <mask> select { <mask> case event, ok := <-a.watcher.Events: <mask> if !ok { <mask> return <mask> } <mask> <mask> repeat := true </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> add go a.onlyWrites() </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove case <-a.watcher.Events: // Skip this duplicating event </s> add case _, ok = <-a.onlyWritesChan: repeat = ok </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> add // Assume that we sometimes have the same event occurred // several times. </s> remove select { case a.updateChan <- true: // sent a signal to 'updateLoop' goroutine default: // queue is full } </s> add a.updateHosts()
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep add keep keep keep keep keep
<mask> return <mask> } <mask> <mask> repeat := true <mask> for repeat { <mask> select { <mask> case _, ok = <-a.onlyWritesChan: <mask> repeat = ok </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> remove case <-a.watcher.Events: // Skip this duplicating event </s> add case _, ok = <-a.onlyWritesChan: repeat = ok </s> remove case event, ok := <-a.watcher.Events: </s> add case event, ok := <-a.onlyWritesChan: </s> add go a.onlyWrites() </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> remove select { case a.updateChan <- true: // sent a signal to 'updateLoop' goroutine default: // queue is full } </s> add a.updateHosts()
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> repeat := true <mask> for repeat { <mask> select { <mask> case <-a.watcher.Events: <mask> // Skip this duplicating event <mask> default: <mask> repeat = false <mask> } <mask> } <mask> </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> add // Assume that we sometimes have the same event occurred // several times. </s> remove case event, ok := <-a.watcher.Events: </s> add case event, ok := <-a.onlyWritesChan: </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove a.updateChan <- false close(a.updateChan) </s> add </s> remove select { case a.updateChan <- true: // sent a signal to 'updateLoop' goroutine default: // queue is full } </s> add a.updateHosts() </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> } <mask> <mask> if event.Op&fsnotify.Write == fsnotify.Write { <mask> log.Debug("AutoHosts: modified: %s", event.Name) <mask> select { <mask> case a.updateChan <- true: <mask> // sent a signal to 'updateLoop' goroutine <mask> default: <mask> // queue is full <mask> } <mask> } <mask> <mask> case err, ok := <-a.watcher.Errors: <mask> if !ok { <mask> return </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove // updateLoop reads static hosts from system files. func (a *AutoHosts) updateLoop() { for ok := range a.updateChan { if !ok { log.Debug("Finished AutoHosts update loop") return } a.updateHosts() } } </s> add </s> remove hostsFn string // path to the main hosts-file hostsDirs []string // paths to OS-specific directories with hosts-files watcher *fsnotify.Watcher // file and directory watcher object updateChan chan bool // signal for 'updateLoop' goroutine </s> add hostsFn string // path to the main hosts-file hostsDirs []string // paths to OS-specific directories with hosts-files watcher *fsnotify.Watcher // file and directory watcher object // onlyWritesChan used to contain only writing events from watcher. onlyWritesChan chan fsnotify.Event </s> add go a.onlyWrites() </s> remove case event, ok := <-a.watcher.Events: </s> add case event, ok := <-a.onlyWritesChan: </s> remove case <-a.watcher.Events: // Skip this duplicating event </s> add case _, ok = <-a.onlyWritesChan: repeat = ok
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> } <mask> } <mask> } <mask> <mask> // updateLoop reads static hosts from system files. <mask> func (a *AutoHosts) updateLoop() { <mask> for ok := range a.updateChan { <mask> if !ok { <mask> log.Debug("Finished AutoHosts update loop") <mask> return <mask> } <mask> <mask> a.updateHosts() <mask> } <mask> } <mask> <mask> // updateHosts - loads system hosts <mask> func (a *AutoHosts) updateHosts() { <mask> table := make(map[string][]net.IP) <mask> tableRev := make(map[string][]string) <mask> </s> Pull request: data race Merge in DNS/adguard-home from 2489-data-race to master Closes #2489. Squashed commit of the following: commit 7745b79f0489970f3ba1bb11bb757b998fa6369c Merge: d070cfd53 93ffed780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Dec 28 19:00:07 2020 +0300 Merge branch 'master' into 2489-data-race commit d070cfd53e72b609f305cd8d79d747fbf47dc5f4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 20:31:21 2020 +0300 util: fix ignoring write events bug commit 725850bdbd96eaf65fb3228fcaeba51a3ec95905 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 25 17:38:29 2020 +0300 util: simpl hosts upd algo </s> add // onlyWrites is a filter for (*fsnotify.Watcher).Events. func (a *AutoHosts) onlyWrites() { for event := range a.watcher.Events { if event.Op&fsnotify.Write == fsnotify.Write { a.onlyWritesChan <- event } } } </s> remove case event, ok := <-a.watcher.Events: </s> add case event, ok := <-a.onlyWritesChan: </s> add go a.onlyWrites() </s> remove select { case a.updateChan <- true: // sent a signal to 'updateLoop' goroutine default: // queue is full } </s> add a.updateHosts() </s> remove a.updateChan <- false close(a.updateChan) </s> add </s> remove go a.updateLoop() a.updateChan <- true </s> add a.updateHosts()
https://github.com/AdguardTeam/AdGuardHome/commit/8a1d86aa7d8e9dd73f5d3f04c010adbd537ae817
internal/util/autohosts.go
keep keep add keep keep keep keep keep
<mask> "whois": "Whois", <mask> "filtering_rules_learn_more": "<0>Learn more</0> about creating your own hosts lists.", <mask> "blocked_by_response": "Blocked by CNAME or IP in response", <mask> "try_again": "Try again", <mask> "domain_desc": "Enter the domain name or wildcard you want to be rewritten.", <mask> "example_rewrite_domain": "rewrite responses for this domain name only.", <mask> "example_rewrite_wildcard": "rewrite responses for all <0>example.org</0> subdomains.", <mask> "rewrite_ip_address": "IP address: use this IP in an A or AAAA response", </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove "filter_category_other_desc": "Other blocklists" </s> add "filter_category_other_desc": "Other blocklists", "original_response": "Original response" </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> remove {processedData && getHintElement({ </s> add {getHintElement({ </s> remove const dnssecHint = getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', }); </s> add </s> remove {dnssec_enabled && dnssecHint} </s> add {dnssec_enabled && getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', })} </s> add import { processContent } from '../../../helpers/helpers';
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/__locales/en.json
keep keep keep keep replace keep
<mask> "filter_category_other": "Other", <mask> "filter_category_general_desc": "Lists that block tracking and advertising on most of the devices", <mask> "filter_category_security_desc": "Lists that specialize on blocking malware, phishing or scam domains", <mask> "filter_category_regional_desc": "Lists that focus on regional ads and tracking servers", <mask> "filter_category_other_desc": "Other blocklists" <mask> } </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add "blocked_by_cname_or_ip": "Blocked by CNAME or IP", </s> remove <div className="logs__text" title={value}> </s> add <div className="logs__text mw-100" title={value}> </s> add import { processContent } from '../../../helpers/helpers'; </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> add rule, originalResponse, </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse,
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/__locales/en.json
keep keep keep keep replace keep keep keep keep keep
<mask> }; <mask> <mask> return ( <mask> <div className="logs__row o-hidden h-100"> <mask> {processedData && getHintElement({ <mask> className: hintClass, <mask> columnClass: 'grid grid--limited', <mask> tooltipClass: 'px-5 pb-5 pt-4 mw-75', <mask> xlinkHref: 'question', <mask> contentItemClass: 'text-truncate key-colon', </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove {fields && getHintElement({ </s> add {getHintElement({ </s> remove {dnssec_enabled && dnssecHint} </s> add {dnssec_enabled && getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', })} </s> remove </TooltipTrigger>; </s> add </TooltipTrigger>; </s> remove const dnssecHint = getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', }); </s> add </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> remove <div className="logs__text" title={value}> </s> add <div className="logs__text mw-100" title={value}>
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getClientCell.js
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> 'icon--disabled': !hasTracker, <mask> 'my-3': isDetailed, <mask> }); <mask> <mask> const dnssecHint = getHintElement({ <mask> className: lockIconClass, <mask> tooltipClass: 'py-4 px-5 pb-45', <mask> canShowTooltip: answer_dnssec, <mask> xlinkHref: 'lock', <mask> columnClass: 'w-100', <mask> content: 'validated_with_dnssec', <mask> placement: 'bottom', <mask> }); <mask> <mask> const protocol = t(SCHEME_TO_PROTOCOL_MAP[client_proto]) || ''; <mask> const ip = type ? `${t('type_table_header')}: ${type}` : ''; <mask> <mask> const requestDetailsObj = { <mask> time_table_header: formatTime(time, LONG_TIME_FORMAT), </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove {dnssec_enabled && dnssecHint} </s> add {dnssec_enabled && getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', })} </s> remove const status = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const status = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason);
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getDomainCell.js
keep keep keep keep replace keep keep keep keep keep
<mask> .join(', '); <mask> <mask> return ( <mask> <div className="logs__row o-hidden"> <mask> {dnssec_enabled && dnssecHint} <mask> {trackerHint} <mask> <div className={valueClass}> <mask> <div className="text-truncate" title={domain}>{domain}</div> <mask> {details && isDetailed <mask> && <div className="detailed-info d-none d-sm-block text-truncate" </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove className="detailed-info d-none d-sm-block pt-1 text-truncate" title={detailedInfo}>{detailedInfo}</div>} </s> add className="detailed-info d-none d-sm-block pt-1 text-truncate" title={detailedInfo}>{detailedInfo}</div>} </s> remove {processedData && getHintElement({ </s> add {getHintElement({ </s> remove {fields && getHintElement({ </s> add {getHintElement({ </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> remove <div className="logs__text" title={value}> </s> add <div className="logs__text mw-100" title={value}> </s> remove const status = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const status = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason);
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getDomainCell.js
keep keep add keep keep keep keep keep keep
<mask> import './Tooltip.css'; <mask> import 'react-popper-tooltip/dist/styles.css'; <mask> import { HIDE_TOOLTIP_DELAY } from '../../../helpers/constants'; <mask> <mask> const getHintElement = ({ <mask> className, <mask> contentItemClass, <mask> columnClass, <mask> canShowTooltip = true, </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove CUSTOM_FILTERING_RULES_ID, </s> add CUSTOM_FILTERING_RULES_ID, FILTERED_STATUS, </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add if (!value) { return null; }
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getHintElement.js
keep keep keep keep replace keep keep keep keep keep
<mask> {xlinkHref && <svg className={className}> <mask> <use xlinkHref={`#${xlinkHref}`} /> <mask> </svg>} <mask> </span>} <mask> </TooltipTrigger>; <mask> <mask> getHintElement.propTypes = { <mask> className: PropTypes.string, <mask> contentItemClass: PropTypes.string, <mask> columnClass: PropTypes.string, </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove {processedData && getHintElement({ </s> add {getHintElement({ </s> remove {fields && getHintElement({ </s> add {getHintElement({ </s> remove const dnssecHint = getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', }); </s> add </s> remove {dnssec_enabled && dnssecHint} </s> add {dnssec_enabled && getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', })} </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> add if (!value) { return null; }
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getHintElement.js
keep keep keep keep replace keep keep keep keep keep
<mask> import getHintElement from './getHintElement'; <mask> <mask> const getResponseCell = (row, filtering, t, isDetailed, getFilterName) => { <mask> const { <mask> reason, filterId, rule, status, upstream, elapsedMs, domain, response, <mask> } = row.original; <mask> <mask> const { filters, whitelistFilters } = filtering; <mask> const formattedElapsedMs = formatElapsedMs(elapsedMs, t); <mask> </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add import { processContent } from '../../../helpers/helpers'; </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> remove }) : []; const tracker = getTrackerData(domain); </s> add }) : []);
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getResponseCell.js
keep keep keep keep replace keep keep keep keep replace keep
<mask> <mask> const { filters, whitelistFilters } = filtering; <mask> const formattedElapsedMs = formatElapsedMs(elapsedMs, t); <mask> <mask> const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); <mask> const boldStatusLabel = <span className="font-weight-bold">{statusLabel}</span>; <mask> const filter = getFilterName(filters, whitelistFilters, filterId, t); <mask> <mask> const renderResponses = (responseArr) => { <mask> if (responseArr.length === 0) { <mask> return ''; </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; </s> remove const status = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const status = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add if (!value) { return null; } </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => {
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getResponseCell.js
keep add keep keep keep keep
<mask> rule_label: rule, <mask> response_code: status, <mask> }, <mask> [FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: { <mask> domain, <mask> encryption_status: boldStatusLabel, </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add rule_label: rule, </s> add original_response: renderResponses(originalResponse), </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> remove response, </s> add response: processResponse(answer), </s> add rule_label: rule, </s> add original_response: originalResponse?.join('\n'),
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getResponseCell.js
keep keep add keep keep keep keep
<mask> domain, <mask> encryption_status: boldStatusLabel, <mask> filter, <mask> install_settings_dns: upstream, <mask> elapsed: formattedElapsedMs, <mask> response_code: status, <mask> original_response: renderResponses(originalResponse), </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add original_response: renderResponses(originalResponse), </s> add original_response: renderResponses(originalResponse), </s> add rule_label: rule, </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> remove tracker, </s> add originalResponse: processResponse(original_answer), tracker: getTrackerData(domain), </s> add rule, originalResponse,
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getResponseCell.js
keep keep add keep keep keep keep keep
<mask> install_settings_dns: upstream, <mask> elapsed: formattedElapsedMs, <mask> response_code: status, <mask> }, <mask> }; <mask> <mask> const fields = FILTERED_STATUS_TO_FIELDS_MAP[reason] <mask> ? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason]) </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add rule_label: rule, </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> add original_response: renderResponses(originalResponse), </s> add rule_label: rule, </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> remove tracker, </s> add originalResponse: processResponse(original_answer), tracker: getTrackerData(domain),
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getResponseCell.js
keep keep keep replace replace replace keep keep keep replace keep keep
<mask> ? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason]) <mask> : Object.entries(FILTERED_STATUS_TO_FIELDS_MAP.NotFilteredNotFound); <mask> <mask> const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE <mask> || reason === FILTERED_STATUS.FILTERED_BLACK_LIST <mask> ? filter : formattedElapsedMs; <mask> <mask> return ( <mask> <div className="logs__row"> <mask> {fields && getHintElement({ <mask> className: classNames('icons mr-4 icon--small cursor--pointer icon--light-gray', { 'my-3': isDetailed }), <mask> columnClass: 'grid grid--limited', </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> remove {processedData && getHintElement({ </s> add {getHintElement({ </s> remove const dnssecHint = getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', }); </s> add </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) {
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getResponseCell.js
keep keep keep keep replace keep keep keep keep keep
<mask> })} <mask> <div className="text-truncate"> <mask> <div className="text-truncate" title={statusLabel}>{statusLabel}</div> <mask> {isDetailed && <div <mask> className="detailed-info d-none d-sm-block pt-1 text-truncate" title={detailedInfo}>{detailedInfo}</div>} <mask> </div> <mask> </div> <mask> ); <mask> }; <mask> </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove {dnssec_enabled && dnssecHint} </s> add {dnssec_enabled && getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', })} </s> remove <div className="logs__text" title={value}> </s> add <div className="logs__text mw-100" title={value}> </s> remove {processedData && getHintElement({ </s> add {getHintElement({ </s> add rule_label: rule, </s> add original_response: originalResponse?.join('\n'), </s> remove const detailedDataCurrent = isFiltered ? detailedDataBlocked : detailedData; </s> add const detailedDataCurrent = isBlocked ? detailedDataBlocked : detailedData;
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Cells/getResponseCell.js
keep keep keep keep replace keep keep keep keep keep
<mask> LONG_TIME_FORMAT, <mask> FILTERED_STATUS_TO_META_MAP, <mask> TABLE_DEFAULT_PAGE_SIZE, <mask> SCHEME_TO_PROTOCOL_MAP, <mask> CUSTOM_FILTERING_RULES_ID, <mask> } from '../../helpers/constants'; <mask> import getDateCell from './Cells/getDateCell'; <mask> import getDomainCell from './Cells/getDomainCell'; <mask> import getClientCell from './Cells/getClientCell'; <mask> import getResponseCell from './Cells/getResponseCell'; </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add import { processContent } from '../../../helpers/helpers'; </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> remove <div className="logs__text" title={value}> </s> add <div className="logs__text mw-100" title={value}> </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> add rule, originalResponse, </s> remove const detailedDataCurrent = isFiltered ? detailedDataBlocked : detailedData; </s> add const detailedDataCurrent = isBlocked ? detailedDataBlocked : detailedData;
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Table.js
keep keep keep add keep keep keep keep
<mask> upstream, <mask> type, <mask> client_proto, <mask> filterId, <mask> } = rowInfo.original; <mask> <mask> const hasTracker = !!tracker; <mask> </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove response, </s> add response: processResponse(answer), </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> remove }) : []; const tracker = getTrackerData(domain); </s> add }) : []); </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason);
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Table.js
keep keep add keep keep keep keep
<mask> const formattedElapsedMs = formatElapsedMs(elapsedMs, t); <mask> const isFiltered = checkFiltered(reason); <mask> <mask> const buttonType = isFiltered ? BLOCK_ACTIONS.UNBLOCK : BLOCK_ACTIONS.BLOCK; <mask> const onToggleBlock = () => { <mask> toggleBlocking(buttonType, domain); <mask> }; </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove const status = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const status = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> remove const detailedDataCurrent = isFiltered ? detailedDataBlocked : detailedData; </s> add const detailedDataCurrent = isBlocked ? detailedDataBlocked : detailedData; </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => {
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Table.js
keep keep keep keep replace keep keep keep keep keep
<mask> const onToggleBlock = () => { <mask> toggleBlocking(buttonType, domain); <mask> }; <mask> <mask> const status = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); <mask> const statusBlocked = <div className="bg--danger">{status}</div>; <mask> <mask> const protocol = t(SCHEME_TO_PROTOCOL_MAP[client_proto]) || ''; <mask> <mask> const sourceData = getSourceData(tracker); </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> remove const dnssecHint = getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', }); </s> add </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> add if (!value) { return null; }
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Table.js
keep add keep keep keep keep keep keep
<mask> elapsed: formattedElapsedMs, <mask> filter, <mask> response_table_header: response?.join('\n'), <mask> original_response: originalResponse?.join('\n'), <mask> [buttonType]: <div onClick={onToggleBlock} <mask> className="title--border text-center">{t(buttonType)}</div>, <mask> }; <mask> </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add original_response: originalResponse?.join('\n'), </s> add rule_label: rule, </s> remove const detailedDataCurrent = isFiltered ? detailedDataBlocked : detailedData; </s> add const detailedDataCurrent = isBlocked ? detailedDataBlocked : detailedData; </s> add original_response: renderResponses(originalResponse), </s> add original_response: renderResponses(originalResponse), </s> remove className="detailed-info d-none d-sm-block pt-1 text-truncate" title={detailedInfo}>{detailedInfo}</div>} </s> add className="detailed-info d-none d-sm-block pt-1 text-truncate" title={detailedInfo}>{detailedInfo}</div>}
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Table.js
keep add keep keep keep keep keep
<mask> rule_label: rule, <mask> response_table_header: response?.join('\n'), <mask> [buttonType]: <div onClick={onToggleBlock} <mask> className="title--border text-center">{t(buttonType)}</div>, <mask> }; <mask> <mask> const detailedDataCurrent = isBlocked ? detailedDataBlocked : detailedData; </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove const detailedDataCurrent = isFiltered ? detailedDataBlocked : detailedData; </s> add const detailedDataCurrent = isBlocked ? detailedDataBlocked : detailedData; </s> add rule_label: rule, </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> remove const status = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const status = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason);
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Table.js
keep keep keep keep replace keep keep keep keep keep
<mask> [buttonType]: <div onClick={onToggleBlock} <mask> className="title--border text-center">{t(buttonType)}</div>, <mask> }; <mask> <mask> const detailedDataCurrent = isFiltered ? detailedDataBlocked : detailedData; <mask> <mask> setDetailedDataCurrent(detailedDataCurrent); <mask> setButtonType(buttonType); <mask> setModalOpened(true); <mask> } </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add original_response: originalResponse?.join('\n'), </s> add rule_label: rule, </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; </s> remove const status = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const status = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => {
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/Table.js
keep keep add keep keep keep keep
<mask> <mask> export const processContent = (data, buttonType) => Object.entries(data) <mask> .map(([key, value]) => { <mask> const isTitle = value === 'title'; <mask> const isButton = key === buttonType; <mask> const isBoolean = typeof value === 'boolean'; <mask> const isHidden = isBoolean && value === false; </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> remove const status = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const status = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason);
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/components/Logs/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> return ( <mask> <div className="logs__text" title={value}> <mask> <> <mask> {nameContainer} <mask> {whoisContainer} <mask> </> <mask> </div> </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove className="detailed-info d-none d-sm-block pt-1 text-truncate" title={detailedInfo}>{detailedInfo}</div>} </s> add className="detailed-info d-none d-sm-block pt-1 text-truncate" title={detailedInfo}>{detailedInfo}</div>} </s> remove {processedData && getHintElement({ </s> add {getHintElement({ </s> remove {dnssec_enabled && dnssecHint} </s> add {dnssec_enabled && getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', })} </s> remove {fields && getHintElement({ </s> add {getHintElement({ </s> remove const detailedInfo = reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE || reason === FILTERED_STATUS.FILTERED_BLACK_LIST ? filter : formattedElapsedMs; </s> add const detailedInfo = isBlocked ? filter : formattedElapsedMs; </s> remove }) : []; const tracker = getTrackerData(domain); </s> add }) : []);
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/helpers/formatClientCell.js
keep keep keep keep replace keep keep keep keep keep
<mask> } = log; <mask> <mask> const { host: domain, type } = question; <mask> <mask> const response = answer ? answer.map((response) => { <mask> const { value, type, ttl } = response; <mask> return `${type}: ${value} (ttl=${ttl})`; <mask> }) : []; <mask> <mask> const tracker = getTrackerData(domain); </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove }) : []; const tracker = getTrackerData(domain); </s> add }) : []); </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add if (!value) { return null; } </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE;
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/helpers/helpers.js
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> <mask> const response = answer ? answer.map((response) => { <mask> const { value, type, ttl } = response; <mask> return `${type}: ${value} (ttl=${ttl})`; <mask> }) : []; <mask> <mask> const tracker = getTrackerData(domain); <mask> <mask> return { <mask> time, <mask> domain, <mask> type, </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> remove response, </s> add response: processResponse(answer), </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) { </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> add if (!value) { return null; } </s> remove const statusLabel = t(FILTERED_STATUS_TO_META_MAP[reason]?.label || reason); </s> add const isBlocked = reason === FILTERED_STATUS.FILTERED_BLACK_LIST || reason === FILTERED_STATUS.FILTERED_BLOCKED_SERVICE; const isBlockedByResponse = originalResponse.length > 0 && isBlocked; const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.label || reason);
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/helpers/helpers.js
keep keep keep keep replace keep keep keep keep keep
<mask> return { <mask> time, <mask> domain, <mask> type, <mask> response, <mask> reason, <mask> client, <mask> client_proto, <mask> filterId, <mask> rule, </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> add rule, originalResponse, </s> remove }) : []; const tracker = getTrackerData(domain); </s> add }) : []); </s> remove const response = answer ? answer.map((response) => { </s> add const processResponse = (data) => (data ? data.map((response) => { </s> add original_response: renderResponses(originalResponse), </s> remove if (responseArr.length === 0) { </s> add if (responseArr?.length === 0) {
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/helpers/helpers.js
keep keep keep keep replace keep keep keep keep keep
<mask> rule, <mask> status, <mask> serviceName: service_name, <mask> originalAnswer: original_answer, <mask> tracker, <mask> answer_dnssec, <mask> elapsedMs, <mask> upstream, <mask> }; <mask> }); </s> - client: Fix query logs UI issues Close #1828 Squashed commit of the following: commit a3955c989a939866c6772b147547344b3f8769c4 Merge: c91c41cb 2759d81a Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 15:14:47 2020 +0300 Merge branch 'master' into fix/1828 commit c91c41cbc5f616e0af1092424e42b909d2f43f7c Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 13:48:54 2020 +0300 Fix cell overflow commit 19e1d31a40f2e1bb1189a85b72507bcc364d4e0c Merge: af31f48c a33164bf Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 12:36:44 2020 +0300 Merge branch 'master' into fix/1828 commit af31f48c4d2699ebfbd2034711c51499b42e40f5 Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Jul 13 10:45:57 2020 +0300 minor commit d9507c5f3f5758e587766ae0fa45f1b9ad703ccf Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 10 18:34:22 2020 +0300 - client: Fix query logs UI issues </s> remove reason, filterId, rule, status, upstream, elapsedMs, domain, response, </s> add reason, filterId, rule, status, upstream, elapsedMs, domain, response, originalResponse, </s> add rule_label: rule, </s> add original_response: renderResponses(originalResponse), </s> remove const dnssecHint = getHintElement({ className: lockIconClass, tooltipClass: 'py-4 px-5 pb-45', canShowTooltip: answer_dnssec, xlinkHref: 'lock', columnClass: 'w-100', content: 'validated_with_dnssec', placement: 'bottom', }); </s> add </s> add original_response: renderResponses(originalResponse), </s> add rule, originalResponse,
https://github.com/AdguardTeam/AdGuardHome/commit/8a417604a94d90ada57141d5601490531fc2e009
client/src/helpers/helpers.js
keep replace keep replace
<mask> "client_updated": "Client \"{{key}}\" successfully updated", <mask> "table_statistics": "Statistics (last 24 hours)", <mask> "clients_not_found": "No clients found", <mask> "client_confirm_delete": "Are you sure you want to delete client \"{{key}}\"?" </s> + client: add runtime clients table </s> remove const clients = await apiClient.getClients(); const sortedClients = sortClients(clients); dispatch(getClientsSuccess(sortedClients)); </s> add const data = await apiClient.getClients(); const sortedClients = data.clients && sortClients(data.clients); const sortedAutoClients = data.auto_clients && sortClients(data.auto_clients); dispatch(getClientsSuccess({ clients: sortedClients || [], autoClients: sortedAutoClients || [], })); </s> remove const clientName = getClientName(this.props.clients, value); </s> add const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value); </s> add autoClients: [], </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients,
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/__locales/en.json
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> <mask> export const getClients = () => async (dispatch) => { <mask> dispatch(getClientsRequest()); <mask> try { <mask> const clients = await apiClient.getClients(); <mask> const sortedClients = sortClients(clients); <mask> dispatch(getClientsSuccess(sortedClients)); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(getClientsFailure()); <mask> } <mask> }; </s> + client: add runtime clients table </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients, </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value); </s> remove const clientName = getClientName(this.props.clients, value); </s> add const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); </s> add autoClients: PropTypes.array.isRequired, </s> add autoClients: [], </s> remove "client_confirm_delete": "Are you sure you want to delete client \"{{key}}\"?" </s> add "client_confirm_delete": "Are you sure you want to delete client \"{{key}}\"?", "auto_clients_title": "Clients (runtime)", "auto_clients_desc": "Data on the clients that use AdGuard Home, but not stored in the configuration"
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/actions/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> Cell: ({ value }) => { <mask> const clientName = getClientName(this.props.clients, value); <mask> let client; <mask> <mask> if (clientName) { <mask> client = <span>{clientName} <small>({value})</small></span>; <mask> } else { </s> + client: add runtime clients table </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value); </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients, </s> remove const clients = await apiClient.getClients(); const sortedClients = sortClients(clients); dispatch(getClientsSuccess(sortedClients)); </s> add const data = await apiClient.getClients(); const sortedClients = data.clients && sortClients(data.clients); const sortedAutoClients = data.auto_clients && sortClients(data.auto_clients); dispatch(getClientsSuccess({ clients: sortedClients || [], autoClients: sortedAutoClients || [], })); </s> add autoClients: [], </s> remove "client_confirm_delete": "Are you sure you want to delete client \"{{key}}\"?" </s> add "client_confirm_delete": "Are you sure you want to delete client \"{{key}}\"?", "auto_clients_title": "Clients (runtime)", "auto_clients_desc": "Data on the clients that use AdGuard Home, but not stored in the configuration" </s> remove "table_statistics": "Statistics (last 24 hours)", </s> add "table_statistics": "Requests count (last 24 hours)",
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/components/Dashboard/Clients.js
keep keep keep add keep keep keep keep
<mask> topClients: PropTypes.object.isRequired, <mask> dnsQueries: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> clients: PropTypes.array.isRequired, <mask> t: PropTypes.func, <mask> }; <mask> <mask> export default withNamespaces()(Clients); </s> + client: add runtime clients table </s> remove const clients = await apiClient.getClients(); const sortedClients = sortClients(clients); dispatch(getClientsSuccess(sortedClients)); </s> add const data = await apiClient.getClients(); const sortedClients = data.clients && sortClients(data.clients); const sortedAutoClients = data.auto_clients && sortClients(data.auto_clients); dispatch(getClientsSuccess({ clients: sortedClients || [], autoClients: sortedAutoClients || [], })); </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients, </s> add autoClients: [], </s> remove <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> </s> add <Fragment> <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> <AutoClients autoClients={dashboard.autoClients} topStats={dashboard.topStats} /> </Fragment> </s> add import AutoClients from './Clients/AutoClients'; </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value);
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/components/Dashboard/Clients.js
keep keep keep add keep keep keep keep keep keep
<mask> dnsQueries={dashboard.stats.dns_queries} <mask> refreshButton={refreshButton} <mask> topClients={dashboard.topStats.top_clients} <mask> clients={dashboard.clients} <mask> /> <mask> </div> <mask> <div className="col-lg-6"> <mask> <QueriedDomains <mask> dnsQueries={dashboard.stats.dns_queries} <mask> refreshButton={refreshButton} </s> + client: add runtime clients table </s> remove <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> </s> add <Fragment> <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> <AutoClients autoClients={dashboard.autoClients} topStats={dashboard.topStats} /> </Fragment> </s> add autoClients: [], </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients, </s> add import AutoClients from './Clients/AutoClients'; </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value); </s> add autoClients: PropTypes.array.isRequired,
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/components/Dashboard/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> maxWidth: 250, <mask> Cell: (row) => { <mask> const { reason } = row.original; <mask> const isFiltered = row ? reason.indexOf('Filtered') === 0 : false; <mask> const clientName = getClientName(dashboard.clients, row.value); <mask> let client; <mask> <mask> if (clientName) { <mask> client = <span>{clientName} <small>({row.value})</small></span>; <mask> } else { </s> + client: add runtime clients table </s> remove const clientName = getClientName(this.props.clients, value); </s> add const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); </s> remove const clients = await apiClient.getClients(); const sortedClients = sortClients(clients); dispatch(getClientsSuccess(sortedClients)); </s> add const data = await apiClient.getClients(); const sortedClients = data.clients && sortClients(data.clients); const sortedAutoClients = data.auto_clients && sortClients(data.auto_clients); dispatch(getClientsSuccess({ clients: sortedClients || [], autoClients: sortedAutoClients || [], })); </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients, </s> add autoClients: [], </s> remove "client_confirm_delete": "Are you sure you want to delete client \"{{key}}\"?" </s> add "client_confirm_delete": "Are you sure you want to delete client \"{{key}}\"?", "auto_clients_title": "Clients (runtime)", "auto_clients_desc": "Data on the clients that use AdGuard Home, but not stored in the configuration" </s> remove "table_statistics": "Statistics (last 24 hours)", </s> add "table_statistics": "Requests count (last 24 hours)",
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/components/Logs/index.js
keep keep add keep keep keep keep
<mask> import Dhcp from './Dhcp'; <mask> import Encryption from './Encryption'; <mask> import Clients from './Clients'; <mask> import Checkbox from '../ui/Checkbox'; <mask> import Loading from '../ui/Loading'; <mask> import PageTitle from '../ui/PageTitle'; <mask> import Card from '../ui/Card'; </s> + client: add runtime clients table </s> add autoClients: [], </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients, </s> remove <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> </s> add <Fragment> <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> <AutoClients autoClients={dashboard.autoClients} topStats={dashboard.topStats} /> </Fragment> </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value); </s> add autoClients={dashboard.autoClients} </s> add autoClients: PropTypes.array.isRequired,
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/components/Settings/index.js
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> processingTestUpstream={settings.processingTestUpstream} <mask> processingSetUpstream={settings.processingSetUpstream} <mask> /> <mask> {!dashboard.processingTopStats && !dashboard.processingClients && ( <mask> <Clients <mask> clients={dashboard.clients} <mask> topStats={dashboard.topStats} <mask> isModalOpen={clients.isModalOpen} <mask> modalClientName={clients.modalClientName} <mask> modalType={clients.modalType} <mask> addClient={this.props.addClient} <mask> updateClient={this.props.updateClient} <mask> deleteClient={this.props.deleteClient} <mask> toggleClientModal={this.props.toggleClientModal} <mask> processingAdding={clients.processingAdding} <mask> processingDeleting={clients.processingDeleting} <mask> processingUpdating={clients.processingUpdating} <mask> /> <mask> )} <mask> <Encryption <mask> encryption={this.props.encryption} <mask> setTlsConfig={this.props.setTlsConfig} <mask> validateTlsConfig={this.props.validateTlsConfig} </s> + client: add runtime clients table </s> add autoClients={dashboard.autoClients} </s> remove const clients = await apiClient.getClients(); const sortedClients = sortClients(clients); dispatch(getClientsSuccess(sortedClients)); </s> add const data = await apiClient.getClients(); const sortedClients = data.clients && sortClients(data.clients); const sortedAutoClients = data.auto_clients && sortClients(data.auto_clients); dispatch(getClientsSuccess({ clients: sortedClients || [], autoClients: sortedAutoClients || [], })); </s> add autoClients: [], </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients, </s> add import AutoClients from './Clients/AutoClients'; </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value);
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/components/Settings/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), <mask> [actions.getClientsSuccess]: (state, { payload }) => { <mask> const newState = { <mask> ...state, <mask> clients: payload, <mask> processingClients: false, <mask> }; <mask> return newState; <mask> }, <mask> }, { </s> + client: add runtime clients table </s> remove const clientName = getClientName(this.props.clients, value); </s> add const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); </s> remove const clients = await apiClient.getClients(); const sortedClients = sortClients(clients); dispatch(getClientsSuccess(sortedClients)); </s> add const data = await apiClient.getClients(); const sortedClients = data.clients && sortClients(data.clients); const sortedAutoClients = data.auto_clients && sortClients(data.auto_clients); dispatch(getClientsSuccess({ clients: sortedClients || [], autoClients: sortedAutoClients || [], })); </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value); </s> add autoClients: PropTypes.array.isRequired, </s> add autoClients: [], </s> remove <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> </s> add <Fragment> <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> <AutoClients autoClients={dashboard.autoClients} topStats={dashboard.topStats} /> </Fragment>
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/reducers/index.js
keep keep add keep keep keep keep
<mask> dnsAddresses: [], <mask> dnsVersion: '', <mask> clients: [], <mask> topStats: [], <mask> }); <mask> <mask> const queryLogs = handleActions({ </s> + client: add runtime clients table </s> remove const clients = await apiClient.getClients(); const sortedClients = sortClients(clients); dispatch(getClientsSuccess(sortedClients)); </s> add const data = await apiClient.getClients(); const sortedClients = data.clients && sortClients(data.clients); const sortedAutoClients = data.auto_clients && sortClients(data.auto_clients); dispatch(getClientsSuccess({ clients: sortedClients || [], autoClients: sortedAutoClients || [], })); </s> remove clients: payload, </s> add clients: payload.clients, autoClients: payload.autoClients, </s> add autoClients: PropTypes.array.isRequired, </s> remove const clientName = getClientName(dashboard.clients, row.value); </s> add const clientName = getClientName(dashboard.clients, row.value) || getClientName(dashboard.autoClients, row.value); </s> remove const clientName = getClientName(this.props.clients, value); </s> add const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); </s> remove <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> </s> add <Fragment> <Clients clients={dashboard.clients} topStats={dashboard.topStats} isModalOpen={clients.isModalOpen} modalClientName={clients.modalClientName} modalType={clients.modalType} addClient={this.props.addClient} updateClient={this.props.updateClient} deleteClient={this.props.deleteClient} toggleClientModal={this.props.toggleClientModal} processingAdding={clients.processingAdding} processingDeleting={clients.processingDeleting} processingUpdating={clients.processingUpdating} /> <AutoClients autoClients={dashboard.autoClients} topStats={dashboard.topStats} /> </Fragment>
https://github.com/AdguardTeam/AdGuardHome/commit/8a8c7329f7d437031760e1f5719cc9f7ed3cc73a
client/src/reducers/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> go 1.18 <mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.46.2 <mask> github.com/AdguardTeam/golibs v0.11.0 <mask> github.com/AdguardTeam/urlfilter v0.16.0 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/ameshkov/dnscrypt/v2 v2.2.5 <mask> github.com/digineo/go-ipset/v2 v2.2.1 <mask> github.com/dimfeld/httptreemux/v5 v5.4.0 </s> Pull request: 5035-dhcp-hosts-netip-addr Updates #5035. Squashed commit of the following: commit 3a272842f738da322abb2bc5306aed94da79304b Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Oct 26 20:34:49 2022 +0300 dnsforward: imp docs, tests commit b442ca9b57d730be3af14c68759c706f1742e4c4 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Oct 26 19:51:21 2022 +0300 dnsforward: imp code, tests commit 8fca6de93edb8cfdb0ff5a940d08f8700e12a423 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Oct 26 16:38:27 2022 +0300 dnsforward: mv dhcp hosts to netip.Addr </s> remove github.com/AdguardTeam/golibs v0.11.0 h1:fWp5bRLL7N806HWeNiRM7vHJH+wwWQ3Z6kpGPeu2onM= github.com/AdguardTeam/golibs v0.11.0/go.mod h1:87bN2x4VsTritptE3XZg9l8T6gznWsIxHBcQ1DeRIXA= </s> add github.com/AdguardTeam/golibs v0.11.2 h1:JbQB1Dg2JWStXgHh1QqBbOLWnP4t9oDjppoBH6TVXSE= github.com/AdguardTeam/golibs v0.11.2/go.mod h1:87bN2x4VsTritptE3XZg9l8T6gznWsIxHBcQ1DeRIXA= </s> add "net/netip" </s> add "net/netip" </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove aghtest.DiscardLogOutput(m) </s> add testutil.DiscardLogOutput(m) </s> remove log.Debug("dns: no dhcp record for %q", reqHost) </s> add log.Debug("dnsforward: no dhcp record for %q", reqHost)
https://github.com/AdguardTeam/AdGuardHome/commit/8a935d4ffbd20c48b9f03d3eeb1c2b527e85ca32
go.mod