docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
sequencelengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
s.serverLock.Lock() defer s.serverLock.Unlock()
<mask> } <mask> <mask> // Start starts the DNS server. <mask> func (s *Server) Start() error { <mask> s.Lock() <mask> defer s.Unlock() <mask> return s.startLocked() <mask> } <mask> <mask> // startLocked starts the DNS server without locking. For internal use only. <mask> func (s *Server) startLocked() error { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove // Reconfigure applies the new configuration to the DNS server </s> add // Reconfigure applies the new configuration to the DNS server. </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock()
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
s.serverLock.Lock() defer s.serverLock.Unlock()
<mask> } <mask> <mask> // Stop stops the DNS server. <mask> func (s *Server) Stop() error { <mask> s.Lock() <mask> defer s.Unlock() <mask> return s.stopLocked() <mask> } <mask> <mask> // stopLocked stops the DNS server without locking. For internal use only. <mask> func (s *Server) stopLocked() error { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove // Reconfigure applies the new configuration to the DNS server </s> add // Reconfigure applies the new configuration to the DNS server. </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
// IsRunning returns true if the DNS server is running.
<mask> s.isRunning = false <mask> return nil <mask> } <mask> <mask> // IsRunning returns true if the DNS server is running <mask> func (s *Server) IsRunning() bool { <mask> s.RLock() <mask> defer s.RUnlock() <mask> return s.isRunning <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove // Reconfigure applies the new configuration to the DNS server </s> add // Reconfigure applies the new configuration to the DNS server. </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) { s.RLock() defer s.RUnlock() </s> add func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients, resolvePTR bool) { s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> } <mask> <mask> // IsRunning returns true if the DNS server is running <mask> func (s *Server) IsRunning() bool { <mask> s.RLock() <mask> defer s.RUnlock() <mask> return s.isRunning <mask> } <mask> <mask> // Reconfigure applies the new configuration to the DNS server <mask> func (s *Server) Reconfigure(config *ServerConfig) error { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove // IsRunning returns true if the DNS server is running </s> add // IsRunning returns true if the DNS server is running. </s> remove // Reconfigure applies the new configuration to the DNS server </s> add // Reconfigure applies the new configuration to the DNS server. </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock()
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
// Reconfigure applies the new configuration to the DNS server.
<mask> defer s.RUnlock() <mask> return s.isRunning <mask> } <mask> <mask> // Reconfigure applies the new configuration to the DNS server <mask> func (s *Server) Reconfigure(config *ServerConfig) error { <mask> s.Lock() <mask> defer s.Unlock() <mask> <mask> log.Print("Start reconfiguring the server") </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove // IsRunning returns true if the DNS server is running </s> add // IsRunning returns true if the DNS server is running.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
s.serverLock.Lock() defer s.serverLock.Unlock()
<mask> } <mask> <mask> // Reconfigure applies the new configuration to the DNS server <mask> func (s *Server) Reconfigure(config *ServerConfig) error { <mask> s.Lock() <mask> defer s.Unlock() <mask> <mask> log.Print("Start reconfiguring the server") <mask> err := s.stopLocked() <mask> if err != nil { <mask> return fmt.Errorf("could not reconfigure the server: %w", err) </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove // Reconfigure applies the new configuration to the DNS server </s> add // Reconfigure applies the new configuration to the DNS server. </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Unlock() </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
// ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS.
<mask> <mask> return nil <mask> } <mask> <mask> // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS <mask> func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { <mask> s.RLock() <mask> p := s.dnsProxy <mask> s.RUnlock() <mask> if p != nil { // an attempt to protect against race in case we're here after Close() was called </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.RLock() p := s.dnsProxy s.RUnlock() if p != nil { // an attempt to protect against race in case we're here after Close() was called </s> add var p *proxy.Proxy func() { s.serverLock.RLock() defer s.serverLock.RUnlock() p = s.dnsProxy }() if p != nil { </s> remove // If response contains CNAME, A or AAAA records, we apply filtering to each canonical host name or IP address. // If this is a match, we set a new response in d.Res and return. </s> add // checkHostRules checks the host against filters. It is safe for concurrent // use. func (s *Server) checkHostRules(host string, qtype uint16, setts *filtering.Settings) ( r *filtering.Result, err error, ) { s.serverLock.RLock() defer s.serverLock.RUnlock() if s.dnsFilter == nil { return nil, nil } var res filtering.Result res, err = s.dnsFilter.CheckHostRules(host, qtype, setts) if err != nil { return nil, err } return &res, err } // If response contains CNAME, A or AAAA records, we apply filtering to each // canonical host name or IP address. If this is a match, we set a new response // in d.Res and return. </s> remove s.RUnlock() </s> add } func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { j := s.accessListJSON() </s> remove s.RLock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
var p *proxy.Proxy func() { s.serverLock.RLock() defer s.serverLock.RUnlock() p = s.dnsProxy }() if p != nil {
<mask> } <mask> <mask> // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS <mask> func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { <mask> s.RLock() <mask> p := s.dnsProxy <mask> s.RUnlock() <mask> if p != nil { // an attempt to protect against race in case we're here after Close() was called <mask> p.ServeHTTP(w, r) <mask> } <mask> } <mask> <mask> // IsBlockedIP - return TRUE if this client should be blocked </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS </s> add // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS. </s> remove // If response contains CNAME, A or AAAA records, we apply filtering to each canonical host name or IP address. // If this is a match, we set a new response in d.Res and return. </s> add // checkHostRules checks the host against filters. It is safe for concurrent // use. func (s *Server) checkHostRules(host string, qtype uint16, setts *filtering.Settings) ( r *filtering.Result, err error, ) { s.serverLock.RLock() defer s.serverLock.RUnlock() if s.dnsFilter == nil { return nil, nil } var res filtering.Result res, err = s.dnsFilter.CheckHostRules(host, qtype, setts) if err != nil { return nil, err } return &res, err } // If response contains CNAME, A or AAAA records, we apply filtering to each // canonical host name or IP address. If this is a match, we set a new response // in d.Res and return. </s> remove s.RUnlock() </s> add } func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { j := s.accessListJSON() </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.RLock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
s.serverLock.Lock() defer s.serverLock.Unlock()
<mask> <mask> err = s.Prepare(nil) <mask> require.NoError(t, err) <mask> <mask> s.Lock() <mask> defer s.Unlock() <mask> <mask> if localUps != nil { <mask> s.localResolvers.Config.UpstreamConfig.Upstreams = []upstream.Upstream{localUps} <mask> } <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove err := s.ipset.Close() if err != nil { </s> add if err := s.ipset.Close(); err != nil { </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Unlock() </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
s.conf.UsePrivateRDNS = true
<mask> <mask> if localUps != nil { <mask> s.localResolvers.Config.UpstreamConfig.Upstreams = []upstream.Upstream{localUps} <mask> } <mask> <mask> return s <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove config.DNS.FilteringConfig = c config.DNS.LocalPTRResolvers, config.DNS.ResolveClients = s.RDNSSettings() </s> add dns := &config.DNS dns.FilteringConfig = c dns.LocalPTRResolvers, dns.ResolveClients, dns.UsePrivateRDNS = s.RDNSSettings() </s> remove err := s.localResolvers.Resolve(d) if err != nil { ctx.err = err </s> add if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err </s> remove return resultCodeError </s> add return resultCodeError }
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
srv := NewCustomServer(&proxy.Proxy{
<mask> Hostname: "some-host", <mask> Block: true, <mask> } <mask> <mask> dns := NewCustomServer(&proxy.Proxy{ <mask> Config: proxy.Config{ <mask> UpstreamConfig: &proxy.UpstreamConfig{ <mask> Upstreams: []upstream.Upstream{extUpstream}, <mask> }, <mask> }, </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove dns.localResolvers = &proxy.Proxy{ </s> add srv.localResolvers = &proxy.Proxy{ </s> remove dns.conf.ResolveClients = true </s> add srv.conf.ResolveClients = true srv.conf.UsePrivateRDNS = true </s> remove host, eerr := dns.Exchange(tc.req) </s> add host, eerr := srv.Exchange(tc.req) </s> remove Exchanger: aghtest.Exchanger{ </s> add ex: aghtest.Exchanger{
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
srv.conf.ResolveClients = true srv.conf.UsePrivateRDNS = true
<mask> Upstreams: []upstream.Upstream{extUpstream}, <mask> }, <mask> }, <mask> }) <mask> dns.conf.ResolveClients = true <mask> <mask> var err error <mask> dns.subnetDetector, err = aghnet.NewSubnetDetector() <mask> require.NoError(t, err) <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove dns.subnetDetector, err = aghnet.NewSubnetDetector() </s> add srv.subnetDetector, err = aghnet.NewSubnetDetector() </s> remove dns := NewCustomServer(&proxy.Proxy{ </s> add srv := NewCustomServer(&proxy.Proxy{ </s> remove dns.conf.ResolveClients = false for _, tc := range testCases { host, eerr := dns.Exchange(tc.req) </s> add srv.conf.UsePrivateRDNS = false </s> remove require.NoError(t, eerr) assert.Empty(t, host) } </s> add host, eerr := srv.Exchange(localIP) require.NoError(t, eerr) assert.Empty(t, host) </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
srv.subnetDetector, err = aghnet.NewSubnetDetector()
<mask> }) <mask> dns.conf.ResolveClients = true <mask> <mask> var err error <mask> dns.subnetDetector, err = aghnet.NewSubnetDetector() <mask> require.NoError(t, err) <mask> <mask> localIP := net.IP{192, 168, 1, 1} <mask> testCases := []struct { <mask> name string </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove dns.conf.ResolveClients = true </s> add srv.conf.ResolveClients = true srv.conf.UsePrivateRDNS = true </s> remove dns.conf.ResolveClients = false for _, tc := range testCases { host, eerr := dns.Exchange(tc.req) </s> add srv.conf.UsePrivateRDNS = false </s> remove require.NoError(t, eerr) assert.Empty(t, host) } </s> add host, eerr := srv.Exchange(localIP) require.NoError(t, eerr) assert.Empty(t, host) </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove err := s.ipset.Close() if err != nil { </s> add if err := s.ipset.Close(); err != nil {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
srv.localResolvers = &proxy.Proxy{
<mask> UpstreamConfig: &proxy.UpstreamConfig{ <mask> Upstreams: []upstream.Upstream{tc.locUpstream}, <mask> }, <mask> } <mask> dns.localResolvers = &proxy.Proxy{ <mask> Config: pcfg, <mask> } <mask> <mask> t.Run(tc.name, func(t *testing.T) { <mask> host, eerr := dns.Exchange(tc.req) </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove host, eerr := dns.Exchange(tc.req) </s> add host, eerr := srv.Exchange(tc.req) </s> remove dns := NewCustomServer(&proxy.Proxy{ </s> add srv := NewCustomServer(&proxy.Proxy{ </s> remove dns.conf.ResolveClients = false for _, tc := range testCases { host, eerr := dns.Exchange(tc.req) </s> add srv.conf.UsePrivateRDNS = false </s> remove require.NoError(t, eerr) assert.Empty(t, host) } </s> add host, eerr := srv.Exchange(localIP) require.NoError(t, eerr) assert.Empty(t, host) </s> remove func TestLocalRestriction(t *testing.T) { </s> add func TestServer_ProcessRestrictLocal(t *testing.T) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
host, eerr := srv.Exchange(tc.req)
<mask> Config: pcfg, <mask> } <mask> <mask> t.Run(tc.name, func(t *testing.T) { <mask> host, eerr := dns.Exchange(tc.req) <mask> <mask> require.ErrorIs(t, eerr, tc.wantErr) <mask> assert.Equal(t, tc.want, host) <mask> }) <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove dns.localResolvers = &proxy.Proxy{ </s> add srv.localResolvers = &proxy.Proxy{ </s> remove dns.conf.ResolveClients = false for _, tc := range testCases { host, eerr := dns.Exchange(tc.req) </s> add srv.conf.UsePrivateRDNS = false </s> remove require.NoError(t, eerr) assert.Empty(t, host) } </s> add host, eerr := srv.Exchange(localIP) require.NoError(t, eerr) assert.Empty(t, host) </s> remove func TestLocalRestriction(t *testing.T) { </s> add func TestServer_ProcessRestrictLocal(t *testing.T) { </s> remove dns := NewCustomServer(&proxy.Proxy{ </s> add srv := NewCustomServer(&proxy.Proxy{
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
srv.conf.UsePrivateRDNS = false
<mask> }) <mask> } <mask> <mask> t.Run("resolving_disabled", func(t *testing.T) { <mask> dns.conf.ResolveClients = false <mask> for _, tc := range testCases { <mask> host, eerr := dns.Exchange(tc.req) <mask> <mask> require.NoError(t, eerr) <mask> assert.Empty(t, host) <mask> } <mask> }) </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove require.NoError(t, eerr) assert.Empty(t, host) } </s> add host, eerr := srv.Exchange(localIP) require.NoError(t, eerr) assert.Empty(t, host) </s> remove host, eerr := dns.Exchange(tc.req) </s> add host, eerr := srv.Exchange(tc.req) </s> remove dns.localResolvers = &proxy.Proxy{ </s> add srv.localResolvers = &proxy.Proxy{ </s> remove dns.subnetDetector, err = aghnet.NewSubnetDetector() </s> add srv.subnetDetector, err = aghnet.NewSubnetDetector() </s> remove func TestLocalRestriction(t *testing.T) { </s> add func TestServer_ProcessRestrictLocal(t *testing.T) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
host, eerr := srv.Exchange(localIP) require.NoError(t, eerr) assert.Empty(t, host)
<mask> dns.conf.ResolveClients = false <mask> for _, tc := range testCases { <mask> host, eerr := dns.Exchange(tc.req) <mask> <mask> require.NoError(t, eerr) <mask> assert.Empty(t, host) <mask> } <mask> }) <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove dns.conf.ResolveClients = false for _, tc := range testCases { host, eerr := dns.Exchange(tc.req) </s> add srv.conf.UsePrivateRDNS = false </s> remove host, eerr := dns.Exchange(tc.req) </s> add host, eerr := srv.Exchange(tc.req) </s> remove dns.localResolvers = &proxy.Proxy{ </s> add srv.localResolvers = &proxy.Proxy{ </s> remove dns.subnetDetector, err = aghnet.NewSubnetDetector() </s> add srv.subnetDetector, err = aghnet.NewSubnetDetector() </s> remove dns.conf.ResolveClients = true </s> add srv.conf.ResolveClients = true srv.conf.UsePrivateRDNS = true
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward_test.go
// checkHostRules checks the host against filters. It is safe for concurrent // use. func (s *Server) checkHostRules(host string, qtype uint16, setts *filtering.Settings) ( r *filtering.Result, err error, ) { s.serverLock.RLock() defer s.serverLock.RUnlock() if s.dnsFilter == nil { return nil, nil } var res filtering.Result res, err = s.dnsFilter.CheckHostRules(host, qtype, setts) if err != nil { return nil, err } return &res, err } // If response contains CNAME, A or AAAA records, we apply filtering to each // canonical host name or IP address. If this is a match, we set a new response // in d.Res and return.
<mask> <mask> return &res, err <mask> } <mask> <mask> // If response contains CNAME, A or AAAA records, we apply filtering to each canonical host name or IP address. <mask> // If this is a match, we set a new response in d.Res and return. <mask> func (s *Server) filterDNSResponse(ctx *dnsContext) (*filtering.Result, error) { <mask> d := ctx.proxyCtx <mask> for _, a := range d.Res.Answer { <mask> host := "" <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS </s> add // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS. </s> remove return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients </s> add return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients, s.conf.UsePrivateRDNS </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.RLock() p := s.dnsProxy s.RUnlock() if p != nil { // an attempt to protect against race in case we're here after Close() was called </s> add var p *proxy.Proxy func() { s.serverLock.RLock() defer s.serverLock.RUnlock() p = s.dnsProxy }() if p != nil { </s> remove aghtest.Exchanger </s> add ex aghtest.Exchanger usePrivate bool
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/filter.go
res, err := s.checkHostRules(host, d.Req.Question[0].Qtype, ctx.setts)
<mask> default: <mask> continue <mask> } <mask> <mask> s.RLock() <mask> // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. <mask> // This could happen after proxy server has been stopped, but its workers are not yet exited. <mask> if !s.conf.ProtectionEnabled || s.dnsFilter == nil { <mask> s.RUnlock() <mask> continue <mask> } <mask> res, err := s.dnsFilter.CheckHostRules(host, d.Req.Question[0].Qtype, ctx.setts) <mask> s.RUnlock() <mask> <mask> if err != nil { <mask> return nil, err <mask> } else if res.IsFiltered { <mask> d.Res = s.genDNSFilterMessage(d, &res) <mask> log.Debug("DNSFwd: Matched %s by response: %s", d.Req.Question[0].Name, host) </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.RLock() // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. // This could happen after proxy server has been stopped, but its workers are not yet exited. // // A better approach is for proxy.Stop() to wait until all its workers exit, // but this would require the Upstream interface to have Close() function // (to prevent from hanging while waiting for unresponsive DNS server to respond). </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.RLock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove d.Res = s.genDNSFilterMessage(d, &res) </s> add d.Res = s.genDNSFilterMessage(d, res) </s> remove return &res, nil </s> add return res, nil
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/filter.go
} else if res == nil { continue
<mask> <mask> res, err := s.checkHostRules(host, d.Req.Question[0].Qtype, ctx.setts) <mask> if err != nil { <mask> return nil, err <mask> } else if res.IsFiltered { <mask> d.Res = s.genDNSFilterMessage(d, res) <mask> log.Debug("DNSFwd: Matched %s by response: %s", d.Req.Question[0].Name, host) <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove d.Res = s.genDNSFilterMessage(d, &res) </s> add d.Res = s.genDNSFilterMessage(d, res) </s> remove return &res, nil </s> add return res, nil </s> remove s.RLock() // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. // This could happen after proxy server has been stopped, but its workers are not yet exited. if !s.conf.ProtectionEnabled || s.dnsFilter == nil { s.RUnlock() continue } res, err := s.dnsFilter.CheckHostRules(host, d.Req.Question[0].Qtype, ctx.setts) s.RUnlock() </s> add res, err := s.checkHostRules(host, d.Req.Question[0].Qtype, ctx.setts) </s> remove err := s.localResolvers.Resolve(d) if err != nil { ctx.err = err </s> add if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err </s> remove return resultCodeError </s> add return resultCodeError }
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/filter.go
d.Res = s.genDNSFilterMessage(d, res)
<mask> <mask> if err != nil { <mask> return nil, err <mask> } else if res.IsFiltered { <mask> d.Res = s.genDNSFilterMessage(d, &res) <mask> log.Debug("DNSFwd: Matched %s by response: %s", d.Req.Question[0].Name, host) <mask> return &res, nil <mask> } <mask> } <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove return &res, nil </s> add return res, nil </s> remove s.RLock() // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. // This could happen after proxy server has been stopped, but its workers are not yet exited. if !s.conf.ProtectionEnabled || s.dnsFilter == nil { s.RUnlock() continue } res, err := s.dnsFilter.CheckHostRules(host, d.Req.Question[0].Qtype, ctx.setts) s.RUnlock() </s> add res, err := s.checkHostRules(host, d.Req.Question[0].Qtype, ctx.setts) </s> remove return resultCodeError </s> add return resultCodeError } </s> remove err := s.localResolvers.Resolve(d) if err != nil { ctx.err = err </s> add if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/filter.go
return res, nil
<mask> return nil, err <mask> } else if res.IsFiltered { <mask> d.Res = s.genDNSFilterMessage(d, &res) <mask> log.Debug("DNSFwd: Matched %s by response: %s", d.Req.Question[0].Name, host) <mask> return &res, nil <mask> } <mask> } <mask> <mask> return nil, nil <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove d.Res = s.genDNSFilterMessage(d, &res) </s> add d.Res = s.genDNSFilterMessage(d, res) </s> remove s.RLock() // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. // This could happen after proxy server has been stopped, but its workers are not yet exited. if !s.conf.ProtectionEnabled || s.dnsFilter == nil { s.RUnlock() continue } res, err := s.dnsFilter.CheckHostRules(host, d.Req.Question[0].Qtype, ctx.setts) s.RUnlock() </s> add res, err := s.checkHostRules(host, d.Req.Question[0].Qtype, ctx.setts) </s> remove return resultCodeError </s> add return resultCodeError } </s> remove if s.subnetDetector.IsLocallyServedNetwork(ip) { err = s.localResolvers.Resolve(ctx) } else { err = s.internalProxy.Resolve(ctx) } </s> add err = resolver.Resolve(ctx)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/filter.go
UsePrivateRDNS *bool `json:"use_private_ptr_resolvers"`
<mask> CacheMaxTTL *uint32 `json:"cache_ttl_max"` <mask> ResolveClients *bool `json:"resolve_clients"` <mask> LocalPTRUpstreams *[]string `json:"local_ptr_upstreams"` <mask> } <mask> <mask> func (s *Server) getDNSConfig() dnsConfig { <mask> s.serverLock.RLock() <mask> defer s.serverLock.RUnlock() </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) { s.RLock() defer s.RUnlock() </s> add func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients, resolvePTR bool) { s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/http.go
s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> LocalPTRUpstreams *[]string `json:"local_ptr_upstreams"` <mask> } <mask> <mask> func (s *Server) getDNSConfig() dnsConfig { <mask> s.RLock() <mask> defer s.RUnlock() <mask> <mask> upstreams := aghstrings.CloneSliceOrEmpty(s.conf.UpstreamDNS) <mask> upstreamFile := s.conf.UpstreamDNSFileName <mask> bootstraps := aghstrings.CloneSliceOrEmpty(s.conf.BootstrapDNS) <mask> protectionEnabled := s.conf.ProtectionEnabled </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { s.RLock() j := accessListJSON{ AllowedClients: s.conf.AllowedClients, DisallowedClients: s.conf.DisallowedClients, BlockedHosts: s.conf.BlockedHosts, </s> add func (s *Server) accessListJSON() (j accessListJSON) { s.serverLock.RLock() defer s.serverLock.RUnlock() return accessListJSON{ AllowedClients: aghstrings.CloneSlice(s.conf.AllowedClients), DisallowedClients: aghstrings.CloneSlice(s.conf.DisallowedClients), BlockedHosts: aghstrings.CloneSlice(s.conf.BlockedHosts), </s> remove s.RUnlock() </s> add } func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { j := s.accessListJSON() </s> remove s.Unlock() </s> add </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock()
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/http.go
usePrivateRDNS := s.conf.UsePrivateRDNS
<mask> cacheMinTTL := s.conf.CacheMinTTL <mask> cacheMaxTTL := s.conf.CacheMaxTTL <mask> resolveClients := s.conf.ResolveClients <mask> localPTRUpstreams := aghstrings.CloneSliceOrEmpty(s.conf.LocalPTRResolvers) <mask> var upstreamMode string <mask> if s.conf.FastestAddr { <mask> upstreamMode = "fastest_addr" <mask> } else if s.conf.AllServers { <mask> upstreamMode = "parallel" </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove dns.subnetDetector, err = aghnet.NewSubnetDetector() </s> add srv.subnetDetector, err = aghnet.NewSubnetDetector() </s> remove if s.subnetDetector.IsLocallyServedNetwork(ip) { err = s.localResolvers.Resolve(ctx) } else { err = s.internalProxy.Resolve(ctx) } </s> add err = resolver.Resolve(ctx) </s> remove err := s.localResolvers.Resolve(d) if err != nil { ctx.err = err </s> add if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/http.go
UsePrivateRDNS: &usePrivateRDNS,
<mask> CacheMaxTTL: &cacheMaxTTL, <mask> UpstreamMode: &upstreamMode, <mask> ResolveClients: &resolveClients, <mask> LocalPTRUpstreams: &localPTRUpstreams, <mask> } <mask> } <mask> <mask> func (s *Server) handleGetConfig(w http.ResponseWriter, r *http.Request) { <mask> resp := s.getDNSConfig() </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.RUnlock() </s> add } func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { j := s.accessListJSON() </s> remove func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { s.RLock() j := accessListJSON{ AllowedClients: s.conf.AllowedClients, DisallowedClients: s.conf.DisallowedClients, BlockedHosts: s.conf.BlockedHosts, </s> add func (s *Server) accessListJSON() (j accessListJSON) { s.serverLock.RLock() defer s.serverLock.RUnlock() return accessListJSON{ AllowedClients: aghstrings.CloneSlice(s.conf.AllowedClients), DisallowedClients: aghstrings.CloneSlice(s.conf.DisallowedClients), BlockedHosts: aghstrings.CloneSlice(s.conf.BlockedHosts), </s> remove // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS </s> add // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS. </s> remove s.RLock() p := s.dnsProxy s.RUnlock() if p != nil { // an attempt to protect against race in case we're here after Close() was called </s> add var p *proxy.Proxy func() { s.serverLock.RLock() defer s.serverLock.RUnlock() p = s.dnsProxy }() if p != nil { </s> remove if s.subnetDetector.IsLocallyServedNetwork(ip) { err = s.localResolvers.Resolve(ctx) } else { err = s.internalProxy.Resolve(ctx) } </s> add err = resolver.Resolve(ctx)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/http.go
s.serverLock.Lock() defer s.serverLock.Unlock()
<mask> return restart <mask> } <mask> <mask> func (s *Server) setConfig(dc dnsConfig) (restart bool) { <mask> s.Lock() <mask> defer s.Unlock() <mask> <mask> if dc.ProtectionEnabled != nil { <mask> s.conf.ProtectionEnabled = *dc.ProtectionEnabled <mask> } <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock()
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/http.go
if dc.UsePrivateRDNS != nil { s.conf.UsePrivateRDNS = *dc.UsePrivateRDNS }
<mask> if dc.ResolveClients != nil { <mask> s.conf.ResolveClients = *dc.ResolveClients <mask> } <mask> <mask> return s.setConfigRestartable(dc) <mask> } <mask> <mask> // upstreamJSON is a request body for handleTestUpstreamDNS endpoint. </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove // If response contains CNAME, A or AAAA records, we apply filtering to each canonical host name or IP address. // If this is a match, we set a new response in d.Res and return. </s> add // checkHostRules checks the host against filters. It is safe for concurrent // use. func (s *Server) checkHostRules(host string, qtype uint16, setts *filtering.Settings) ( r *filtering.Result, err error, ) { s.serverLock.RLock() defer s.serverLock.RUnlock() if s.dnsFilter == nil { return nil, nil } var res filtering.Result res, err = s.dnsFilter.CheckHostRules(host, qtype, setts) if err != nil { return nil, err } return &res, err } // If response contains CNAME, A or AAAA records, we apply filtering to each // canonical host name or IP address. If this is a match, we set a new response // in d.Res and return. </s> remove aghtest.Exchanger </s> add ex aghtest.Exchanger usePrivate bool </s> remove if ctx.protectionEnabled { if ctx.setts == nil { ctx.setts = s.getClientRequestFilteringSettings(ctx) } ctx.result, err = s.filterDNSRequest(ctx) </s> add if !ctx.protectionEnabled { return resultCodeSuccess </s> remove s.RLock() p := s.dnsProxy s.RUnlock() if p != nil { // an attempt to protect against race in case we're here after Close() was called </s> add var p *proxy.Proxy func() { s.serverLock.RLock() defer s.serverLock.RUnlock() p = s.dnsProxy }() if p != nil { </s> remove // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS </s> add // ServeHTTP is a HTTP handler method we use to provide DNS-over-HTTPS.
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/http.go
s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> if len(msg.Question) >= 1 && msg.Question[0].Qtype == dns.TypeANY && s.conf.RefuseAny { <mask> shouldLog = false <mask> } <mask> <mask> s.RLock() <mask> // Synchronize access to s.queryLog and s.stats so they won't be suddenly uninitialized while in use. <mask> // This can happen after proxy server has been stopped, but its workers haven't yet exited. <mask> if shouldLog && s.queryLog != nil { <mask> p := querylog.AddParams{ <mask> Question: msg, </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.RLock() // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. // This could happen after proxy server has been stopped, but its workers are not yet exited. // // A better approach is for proxy.Stop() to wait until all its workers exit, // but this would require the Upstream interface to have Close() function // (to prevent from hanging while waiting for unresponsive DNS server to respond). </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.RLock() // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. // This could happen after proxy server has been stopped, but its workers are not yet exited. if !s.conf.ProtectionEnabled || s.dnsFilter == nil { s.RUnlock() continue } res, err := s.dnsFilter.CheckHostRules(host, d.Req.Question[0].Qtype, ctx.setts) s.RUnlock() </s> add res, err := s.checkHostRules(host, d.Req.Question[0].Qtype, ctx.setts) </s> remove var err error </s> add </s> remove if ctx.protectionEnabled { if ctx.setts == nil { ctx.setts = s.getClientRequestFilteringSettings(ctx) } ctx.result, err = s.filterDNSRequest(ctx) </s> add if !ctx.protectionEnabled { return resultCodeSuccess </s> remove // Close - close object </s> add // Close gracefully closes the server. It is safe for concurrent use. // // TODO(e.burkov): A better approach would be making Stop method waiting for all // its workers finished. But it would require the upstream.Upstream to have the // Close method to prevent from hanging while waiting for unresponsive server to // respond.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/stats.go
<mask> s.queryLog.Add(p) <mask> } <mask> <mask> s.updateStats(ctx, elapsed, *ctx.result) <mask> s.RUnlock() <mask> <mask> return resultCodeSuccess <mask> } <mask> <mask> func (s *Server) updateStats(ctx *dnsContext, elapsed time.Duration, res filtering.Result) { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) { s.RLock() defer s.RUnlock() </s> add func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients, resolvePTR bool) { s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { s.RLock() j := accessListJSON{ AllowedClients: s.conf.AllowedClients, DisallowedClients: s.conf.DisallowedClients, BlockedHosts: s.conf.BlockedHosts, </s> add func (s *Server) accessListJSON() (j accessListJSON) { s.serverLock.RLock() defer s.serverLock.RUnlock() return accessListJSON{ AllowedClients: aghstrings.CloneSlice(s.conf.AllowedClients), DisallowedClients: aghstrings.CloneSlice(s.conf.DisallowedClients), BlockedHosts: aghstrings.CloneSlice(s.conf.BlockedHosts), </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/stats.go
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> }, <mask> "fastest_addr": { <mask> "upstream_dns": [ <mask> "8.8.8.8:53", </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleGetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> }, <mask> "parallel": { <mask> "upstream_dns": [ <mask> "8.8.8.8:53", <mask> "8.8.4.4:53" </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleGetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleGetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "bootstraps": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "blocking_mode_good": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "blocking_mode_bad": { <mask> "req": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_size": 0, <mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "ratelimit": { <mask> "req": { <mask> "ratelimit": 6 </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_size": 0, <mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "edns_cs_enabled": { <mask> "req": { <mask> "edns_cs_enabled": true </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_size": 0, <mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "dnssec_enabled": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "cache_size": { <mask> "req": { <mask> "cache_size": 1024 </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "upstream_mode_parallel": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_size": 0, <mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "upstream_mode_fastest_addr": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "upstream_dns_bad": { <mask> "req": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "bootstraps_bad": { <mask> "req": { <mask> "bootstrap_dns": [ </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "cache_bad_ttl": { <mask> "req": { <mask> "cache_ttl_min": 1024, </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "upstream_mode_bad": { <mask> "req": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_size": 0, <mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> }, <mask> "local_ptr_upstreams_good": { <mask> "req": { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [ <mask> "123.123.123.123" <mask> ] <mask> } <mask> }, </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
"use_private_ptr_resolvers": false,
<mask> "cache_ttl_min": 0, <mask> "cache_ttl_max": 0, <mask> "resolve_clients": false, <mask> "local_ptr_upstreams": [] <mask> } <mask> } <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/testdata/TestDNSForwardHTTTP_handleSetConfig.json
// // TODO(e.burkov): Is ARP a higher priority source than DHCP?
<mask> type clientSource uint <mask> <mask> // Client sources. The order determines the priority. <mask> const ( <mask> ClientSourceWHOIS clientSource = iota <mask> ClientSourceRDNS <mask> ClientSourceDHCP </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/clients.go
// UsePrivateRDNS defines if the PTR requests for unknown addresses from // locally-served networks should be resolved via private PTR resolvers. UsePrivateRDNS bool `yaml:"use_private_ptr_resolvers"`
<mask> // ResolveClients enables and disables resolving clients with RDNS. <mask> ResolveClients bool `yaml:"resolve_clients"` <mask> <mask> // LocalPTRResolvers is the slice of addresses to be used as upstreams <mask> // for PTR queries for locally-served networks. <mask> LocalPTRResolvers []string `yaml:"local_ptr_upstreams"` <mask> } <mask> <mask> type tlsConfigSettings struct { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove "local_ptr_title": "Private DNS servers", </s> add "local_ptr_title": "Private reverse DNS servers",
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/config.go
UsePrivateRDNS: true,
<mask> FiltersUpdateIntervalHours: 24, <mask> LocalDomainName: "lan", <mask> ResolveClients: true, <mask> }, <mask> TLS: tlsConfigSettings{ <mask> PortHTTPS: 443, <mask> PortDNSOverTLS: 853, // needs to be passed through to dnsproxy </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove dns := NewCustomServer(&proxy.Proxy{ </s> add srv := NewCustomServer(&proxy.Proxy{ </s> remove // Close - close object </s> add // Close gracefully closes the server. It is safe for concurrent use. // // TODO(e.burkov): A better approach would be making Stop method waiting for all // its workers finished. But it would require the upstream.Upstream to have the // Close method to prevent from hanging while waiting for unresponsive server to // respond. </s> remove s.RLock() // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. // This could happen after proxy server has been stopped, but its workers are not yet exited. // // A better approach is for proxy.Stop() to wait until all its workers exit, // but this would require the Upstream interface to have Close() function // (to prevent from hanging while waiting for unresponsive DNS server to respond). </s> add s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/config.go
dns := &config.DNS dns.FilteringConfig = c dns.LocalPTRResolvers, dns.ResolveClients, dns.UsePrivateRDNS = s.RDNSSettings()
<mask> <mask> if s := Context.dnsServer; s != nil { <mask> c := dnsforward.FilteringConfig{} <mask> s.WriteDiskConfig(&c) <mask> config.DNS.FilteringConfig = c <mask> <mask> config.DNS.LocalPTRResolvers, config.DNS.ResolveClients = s.RDNSSettings() <mask> } <mask> <mask> if Context.dhcpServer != nil { <mask> c := dhcpd.ServerConfig{} <mask> Context.dhcpServer.WriteDiskConfig(&c) </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove err := s.localResolvers.Resolve(d) if err != nil { ctx.err = err </s> add if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err </s> remove err := s.ipset.Close() if err != nil { </s> add if err := s.ipset.Close(); err != nil { </s> remove return resultCodeError </s> add return resultCodeError } </s> remove resp, err := e.Exchanger.Exchange(req) </s> add resp, err := e.ex.Exchange(req)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/config.go
Context.rdns = NewRDNS(Context.dnsServer, &Context.clients, config.DNS.UsePrivateRDNS)
<mask> closeDNSServer() <mask> return fmt.Errorf("dnsServer.Prepare: %w", err) <mask> } <mask> <mask> Context.rdns = NewRDNS(Context.dnsServer, &Context.clients) <mask> Context.whois = initWhois(&Context.clients) <mask> <mask> Context.filters.Init() <mask> return nil <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove err := s.ipset.Close() if err != nil { </s> add if err := s.ipset.Close(); err != nil { </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove return &res, nil </s> add return res, nil
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/dns.go
newConf.UsePrivateRDNS = dnsConf.UsePrivateRDNS
<mask> newConf.GetCustomUpstreamByClient = Context.clients.FindUpstreams <mask> <mask> newConf.ResolveClients = dnsConf.ResolveClients <mask> newConf.LocalPTRResolvers = dnsConf.LocalPTRResolvers <mask> <mask> return newConf, nil <mask> } <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove Context.rdns = NewRDNS(Context.dnsServer, &Context.clients) </s> add Context.rdns = NewRDNS(Context.dnsServer, &Context.clients, config.DNS.UsePrivateRDNS) </s> remove s.RUnlock() </s> add </s> remove return resultCodeError </s> add return resultCodeError }
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/dns.go
"sync/atomic"
<mask> import ( <mask> "encoding/binary" <mask> "net" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" <mask> "github.com/AdguardTeam/golibs/cache" <mask> "github.com/AdguardTeam/golibs/log" </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove // If response contains CNAME, A or AAAA records, we apply filtering to each canonical host name or IP address. // If this is a match, we set a new response in d.Res and return. </s> add // checkHostRules checks the host against filters. It is safe for concurrent // use. func (s *Server) checkHostRules(host string, qtype uint16, setts *filtering.Settings) ( r *filtering.Result, err error, ) { s.serverLock.RLock() defer s.serverLock.RUnlock() if s.dnsFilter == nil { return nil, nil } var res filtering.Result res, err = s.dnsFilter.CheckHostRules(host, qtype, setts) if err != nil { return nil, err } return &res, err } // If response contains CNAME, A or AAAA records, we apply filtering to each // canonical host name or IP address. If this is a match, we set a new response // in d.Res and return.
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns.go
// usePrivate is used to store the state of current private RDNS // resolving settings and to react to it's changes. usePrivate uint32
<mask> clients *clientsContainer <mask> <mask> // ipCh used to pass client's IP to rDNS workerLoop. <mask> ipCh chan net.IP <mask> <mask> // ipCache caches the IP addresses to be resolved by rDNS. The resolved </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove "local_ptr_title": "Private DNS servers", </s> add "local_ptr_title": "Private reverse DNS servers", </s> remove func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) { s.RLock() defer s.RUnlock() </s> add func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients, resolvePTR bool) { s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns.go
usePrivate bool,
<mask> // NewRDNS creates and returns initialized RDNS. <mask> func NewRDNS( <mask> exchanger dnsforward.RDNSExchanger, <mask> clients *clientsContainer, <mask> ) (rDNS *RDNS) { <mask> rDNS = &RDNS{ <mask> exchanger: exchanger, <mask> clients: clients, <mask> ipCache: cache.New(cache.Config{ </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove ipCache: ipCache, </s> add ipCache: ipCache, exchanger: &rDNSExchanger{}, </s> remove Exchanger: aghtest.Exchanger{ </s> add ex: aghtest.Exchanger{ </s> remove // Begin adds the ip to the resolving queue if it is not cached or already // resolved. func (r *RDNS) Begin(ip net.IP) { </s> add // ensurePrivateCache ensures that the state of the RDNS cache is consistent // with the current private client RDNS resolving settings. // // TODO(e.burkov): Clearing cache each time this value changed is not a perfect // approach since only unresolved locally-served addresses should be removed. // Implement when improving the cache. func (r *RDNS) ensurePrivateCache() { var usePrivate uint32 if r.exchanger.ResolvesPrivatePTR() { usePrivate = 1 } if atomic.CompareAndSwapUint32(&r.usePrivate, 1-usePrivate, usePrivate) { r.ipCache.Clear() } } // isCached returns true if ip is already cached and not expired yet. It also // caches it otherwise. func (r *RDNS) isCached(ip net.IP) (ok bool) {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns.go
if usePrivate { rDNS.usePrivate = 1 }
<mask> }), <mask> ipCh: make(chan net.IP, defaultRDNSIPChSize), <mask> } <mask> <mask> go rDNS.workerLoop() <mask> <mask> return rDNS <mask> } <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove Exchanger: aghtest.Exchanger{ </s> add ex: aghtest.Exchanger{ </s> remove return &res, nil </s> add return res, nil </s> remove if s.subnetDetector.IsLocallyServedNetwork(ip) { err = s.localResolvers.Resolve(ctx) } else { err = s.internalProxy.Resolve(ctx) } </s> add err = resolver.Resolve(ctx)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns.go
// ensurePrivateCache ensures that the state of the RDNS cache is consistent // with the current private client RDNS resolving settings. // // TODO(e.burkov): Clearing cache each time this value changed is not a perfect // approach since only unresolved locally-served addresses should be removed. // Implement when improving the cache. func (r *RDNS) ensurePrivateCache() { var usePrivate uint32 if r.exchanger.ResolvesPrivatePTR() { usePrivate = 1 } if atomic.CompareAndSwapUint32(&r.usePrivate, 1-usePrivate, usePrivate) { r.ipCache.Clear() } } // isCached returns true if ip is already cached and not expired yet. It also // caches it otherwise. func (r *RDNS) isCached(ip net.IP) (ok bool) {
<mask> <mask> return rDNS <mask> } <mask> <mask> // Begin adds the ip to the resolving queue if it is not cached or already <mask> // resolved. <mask> func (r *RDNS) Begin(ip net.IP) { <mask> now := uint64(time.Now().Unix()) <mask> if expire := r.ipCache.Get(ip); len(expire) != 0 { <mask> if binary.BigEndian.Uint64(expire) > now { <mask> return <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove return </s> add return true </s> remove s.Lock() defer s.Unlock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove resp, err := e.Exchanger.Exchange(req) </s> add resp, err := e.ex.Exchange(req)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns.go
return true
<mask> func (r *RDNS) Begin(ip net.IP) { <mask> now := uint64(time.Now().Unix()) <mask> if expire := r.ipCache.Get(ip); len(expire) != 0 { <mask> if binary.BigEndian.Uint64(expire) > now { <mask> return <mask> } <mask> } <mask> <mask> // The cache entry either expired or doesn't exist. <mask> ttl := make([]byte, 8) </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove // Begin adds the ip to the resolving queue if it is not cached or already // resolved. func (r *RDNS) Begin(ip net.IP) { </s> add // ensurePrivateCache ensures that the state of the RDNS cache is consistent // with the current private client RDNS resolving settings. // // TODO(e.burkov): Clearing cache each time this value changed is not a perfect // approach since only unresolved locally-served addresses should be removed. // Implement when improving the cache. func (r *RDNS) ensurePrivateCache() { var usePrivate uint32 if r.exchanger.ResolvesPrivatePTR() { usePrivate = 1 } if atomic.CompareAndSwapUint32(&r.usePrivate, 1-usePrivate, usePrivate) { r.ipCache.Clear() } } // isCached returns true if ip is already cached and not expired yet. It also // caches it otherwise. func (r *RDNS) isCached(ip net.IP) (ok bool) { </s> remove resp, err := e.Exchanger.Exchange(req) </s> add resp, err := e.ex.Exchange(req) </s> remove err := s.localResolvers.Resolve(d) if err != nil { ctx.err = err </s> add if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err </s> remove s.Unlock() </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns.go
return false } // Begin adds the ip to the resolving queue if it is not cached or already // resolved. func (r *RDNS) Begin(ip net.IP) { r.ensurePrivateCache() if r.isCached(ip) { return }
<mask> binary.BigEndian.PutUint64(ttl, now+defaultRDNSCacheTTL) <mask> r.ipCache.Set(ip, ttl) <mask> <mask> id := ip.String() <mask> if r.clients.Exists(id, ClientSourceRDNS) { <mask> return <mask> } <mask> <mask> select { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove err := s.localResolvers.Resolve(d) if err != nil { ctx.err = err </s> add if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err </s> remove resp, err := e.Exchanger.Exchange(req) </s> add resp, err := e.ex.Exchange(req) </s> remove return </s> add return true </s> remove return resultCodeError </s> add return resultCodeError }
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns.go
"github.com/stretchr/testify/require"
<mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func TestRDNS_Begin(t *testing.T) { <mask> aghtest.ReplaceLogLevel(t, log.DEBUG) <mask> w := &bytes.Buffer{} </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove func TestLocalRestriction(t *testing.T) { </s> add func TestServer_ProcessRestrictLocal(t *testing.T) { </s> remove host, eerr := dns.Exchange(tc.req) </s> add host, eerr := srv.Exchange(tc.req) </s> remove dns.conf.ResolveClients = false for _, tc := range testCases { host, eerr := dns.Exchange(tc.req) </s> add srv.conf.UsePrivateRDNS = false </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns_test.go
ipCache: ipCache, exchanger: &rDNSExchanger{},
<mask> ttl := make([]byte, binary.Size(uint64(0))) <mask> binary.BigEndian.PutUint64(ttl, uint64(time.Now().Add(100*time.Hour).Unix())) <mask> <mask> rdns := &RDNS{ <mask> ipCache: ipCache, <mask> clients: &clientsContainer{ <mask> list: map[string]*Client{}, <mask> idIndex: tc.cliIDIndex, <mask> ipToRC: map[string]*RuntimeClient{}, <mask> allTags: aghstrings.NewSet(), </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove Exchanger: aghtest.Exchanger{ </s> add ex: aghtest.Exchanger{ </s> remove return </s> add return true
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns_test.go
ex aghtest.Exchanger usePrivate bool
<mask> } <mask> <mask> // rDNSExchanger is a mock dnsforward.RDNSExchanger implementation for tests. <mask> type rDNSExchanger struct { <mask> aghtest.Exchanger <mask> } <mask> <mask> // Exchange implements dnsforward.RDNSExchanger interface for *RDNSExchanger. <mask> func (e *rDNSExchanger) Exchange(ip net.IP) (host string, err error) { <mask> req := &dns.Msg{ </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove s.RLock() defer s.RUnlock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove // If response contains CNAME, A or AAAA records, we apply filtering to each canonical host name or IP address. // If this is a match, we set a new response in d.Res and return. </s> add // checkHostRules checks the host against filters. It is safe for concurrent // use. func (s *Server) checkHostRules(host string, qtype uint16, setts *filtering.Settings) ( r *filtering.Result, err error, ) { s.serverLock.RLock() defer s.serverLock.RUnlock() if s.dnsFilter == nil { return nil, nil } var res filtering.Result res, err = s.dnsFilter.CheckHostRules(host, qtype, setts) if err != nil { return nil, err } return &res, err } // If response contains CNAME, A or AAAA records, we apply filtering to each // canonical host name or IP address. If this is a match, we set a new response // in d.Res and return.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns_test.go
resp, err := e.ex.Exchange(req)
<mask> Qtype: dns.TypePTR, <mask> }}, <mask> } <mask> <mask> resp, err := e.Exchanger.Exchange(req) <mask> if err != nil { <mask> return "", err <mask> } <mask> <mask> if len(resp.Answer) == 0 { </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove err := s.localResolvers.Resolve(d) if err != nil { ctx.err = err </s> add if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err </s> remove if s.subnetDetector.IsLocallyServedNetwork(ip) { err = s.localResolvers.Resolve(ctx) } else { err = s.internalProxy.Resolve(ctx) } </s> add err = resolver.Resolve(ctx) </s> remove return resultCodeError </s> add return resultCodeError }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns_test.go
ex: aghtest.Exchanger{
<mask> } <mask> ch := make(chan net.IP) <mask> rdns := &RDNS{ <mask> exchanger: &rDNSExchanger{ <mask> Exchanger: aghtest.Exchanger{ <mask> Ups: tc.ups, <mask> }, <mask> }, <mask> clients: cc, <mask> ipCh: ch, </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove ipCache: ipCache, </s> add ipCache: ipCache, exchanger: &rDNSExchanger{}, </s> remove dns := NewCustomServer(&proxy.Proxy{ </s> add srv := NewCustomServer(&proxy.Proxy{ </s> remove func TestLocalRestriction(t *testing.T) { </s> add func TestServer_ProcessRestrictLocal(t *testing.T) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/home/rdns_test.go
'use_private_ptr_resolvers': 'type': 'boolean'
<mask> 'enum': <mask> - '' <mask> - 'parallel' <mask> - 'fastest_addr' <mask> 'resolve_clients': <mask> 'type': 'boolean' <mask> 'local_ptr_upstreams': <mask> 'type': 'array' </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddbd1c87107f373b11b0 Author: Eugene Burkov <[email protected]> Date: Wed May 26 17:20:34 2021 +0300 all: rename dns config field commit 36512134822a5f6b8b296ccbd7e7d5a9b8e87f26 Author: Ildar Kamalov <[email protected]> Date: Wed May 26 15:55:44 2021 +0300 client: handle local ips rdns commit 9a691830d45db93e078332d85bc0efa7dc7b6ac6 Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:43:13 2021 +0300 all: imp naming commit 771b7a3d5d25f91408dd97ba3287efb641028ccf Author: Eugene Burkov <[email protected]> Date: Wed May 26 14:24:38 2021 +0300 all: imp docs, code commit be960893e8bbb7375a944ca0345b50c857a2d7cf Author: Eugene Burkov <[email protected]> Date: Wed May 26 13:23:56 2021 +0300 all: imp docs & log changes commit 4e645a520f6bb584ef951435ee833ad30769af98 Author: Eugene Burkov <[email protected]> Date: Wed May 26 12:49:44 2021 +0300 all: add the field into structs commit 22b5b6163f086560a3189234532ba877be7ba940 Author: Eugene Burkov <[email protected]> Date: Tue May 25 15:10:31 2021 +0300 dnsforward: entitle lock, imp code </s> remove s.Lock() </s> add s.serverLock.Lock() defer s.serverLock.Unlock() </s> remove s.Unlock() </s> add </s> remove s.RLock() </s> add s.serverLock.RLock() defer s.serverLock.RUnlock() </s> remove return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients </s> add return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients, s.conf.UsePrivateRDNS </s> remove func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) { s.RLock() defer s.RUnlock() </s> add func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients, resolvePTR bool) { s.serverLock.RLock() defer s.serverLock.RUnlock()
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
openapi/openapi.yaml
"log"
<mask> import ( <mask> "bufio" <mask> "fmt" <mask> "net" <mask> "net/http" <mask> "os" <mask> "os/signal" </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs.
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
app.go
<mask> "syscall" <mask> "time" <mask> <mask> "github.com/gobuffalo/packr" <mask> log "github.com/sirupsen/logrus" <mask> "golang.org/x/crypto/ssh/terminal" <mask> ) <mask> <mask> // VersionString will be set through ldflags, contains current version <mask> var VersionString = "undefined" </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
app.go
// {"verbose", "v", "enable verbose output", nil, func() { log.SetLevel(log.TraceLevel) }},
<mask> panic("Got port that is not a number") <mask> } <mask> bindPort = &v <mask> }, nil}, <mask> {"verbose", "v", "enable verbose output", nil, func() { log.SetLevel(log.TraceLevel) }}, <mask> {"help", "h", "print this help", nil, func() { printHelp(); os.Exit(64) }}, <mask> } <mask> printHelp = func() { <mask> fmt.Printf("Usage:\n\n") <mask> fmt.Printf("%s [options]\n\n", os.Args[0]) </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log.Debugf("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> add // trace("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> remove log.Warnf("Couldn't generate A record for up replacement host '%s': %s", ip.String(), err) </s> add log.Printf("Couldn't generate A record for replacement host '%s': %s", ip.String(), err) </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
app.go
"log"
<mask> <mask> import ( <mask> "errors" <mask> "fmt" <mask> "net" <mask> "strings" <mask> "sync" <mask> "time" </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/dnsforward.go
<mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/joomcode/errorx" <mask> "github.com/miekg/dns" <mask> log "github.com/sirupsen/logrus" <mask> ) <mask> <mask> // DefaultTimeout is the default upstream timeout <mask> const DefaultTimeout = 10 * time.Second <mask> </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log.Debugf("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> add // trace("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/dnsforward.go
// trace("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule)
<mask> if err != nil { <mask> // Return immediately if there's an error <mask> return nil, errorx.Decorate(err, "dnsfilter failed to check host '%s'", host) <mask> } else if res.IsFiltered { <mask> log.Debugf("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) <mask> d.Res = s.genDNSFilterMessage(d, &res) <mask> } <mask> <mask> return &res, err <mask> } </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log.Warnf("Couldn't generate A record for up replacement host '%s': %s", ip.String(), err) </s> add log.Printf("Couldn't generate A record for replacement host '%s': %s", ip.String(), err) </s> remove {"verbose", "v", "enable verbose output", nil, func() { log.SetLevel(log.TraceLevel) }}, </s> add // {"verbose", "v", "enable verbose output", nil, func() { log.SetLevel(log.TraceLevel) }}, </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/dnsforward.go
log.Printf("Couldn't generate A record for replacement host '%s': %s", ip.String(), err)
<mask> resp := dns.Msg{} <mask> resp.SetReply(request) <mask> answer, err := dns.NewRR(fmt.Sprintf("%s %d A %s", request.Question[0].Name, s.BlockedResponseTTL, ip.String())) <mask> if err != nil { <mask> log.Warnf("Couldn't generate A record for up replacement host '%s': %s", ip.String(), err) <mask> return s.genServerFailure(request) <mask> } <mask> resp.Answer = append(resp.Answer, answer) <mask> return &resp <mask> } </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log.Debugf("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> add // trace("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> remove {"verbose", "v", "enable verbose output", nil, func() { log.SetLevel(log.TraceLevel) }}, </s> add // {"verbose", "v", "enable verbose output", nil, func() { log.SetLevel(log.TraceLevel) }}, </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/dnsforward.go
"log"
<mask> <mask> import ( <mask> "encoding/json" <mask> "fmt" <mask> "net" <mask> "net/http" <mask> "strconv" <mask> "strings" </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs.
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/querylog.go
<mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/miekg/dns" <mask> log "github.com/sirupsen/logrus" <mask> ) <mask> <mask> const ( <mask> logBufferCap = 5000 // maximum capacity of logBuffer before it's flushed to disk <mask> queryLogTimeLimit = time.Hour * 24 // how far in the past we care about querylogs </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log.Debugf("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> add // trace("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/querylog.go
"log"
<mask> "bytes" <mask> "compress/gzip" <mask> "encoding/json" <mask> "fmt" <mask> "os" <mask> "sync" <mask> "time" <mask> <mask> "github.com/go-test/deep" <mask> ) </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/querylog_file.go
<mask> "os" <mask> "sync" <mask> "time" <mask> <mask> log "github.com/sirupsen/logrus" <mask> <mask> "github.com/go-test/deep" <mask> ) <mask> <mask> var ( <mask> fileWriteLock sync.Mutex </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/querylog_file.go
"log"
<mask> <mask> import ( <mask> "bytes" <mask> "fmt" <mask> "net/http" <mask> "os" <mask> "path" <mask> "runtime" <mask> "sort" </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs.
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/querylog_top.go
<mask> "strings" <mask> "sync" <mask> "time" <mask> <mask> log "github.com/sirupsen/logrus" <mask> <mask> "github.com/bluele/gcache" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> type hourTop struct { </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/querylog_top.go
"log"
<mask> import ( <mask> "encoding/json" <mask> "fmt" <mask> "net/http" <mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> ) </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/stats.go
<mask> "net/http" <mask> "sync" <mask> "time" <mask> <mask> log "github.com/sirupsen/logrus" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> ) <mask> <mask> var ( <mask> requests = newDNSCounter("requests_total") </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
dnsforward/stats.go
<mask> github.com/patrickmn/go-cache v2.1.0+incompatible <mask> github.com/pkg/errors v0.8.0 <mask> github.com/shirou/gopsutil v2.18.10+incompatible <mask> github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect <mask> github.com/sirupsen/logrus v1.2.0 <mask> go.uber.org/goleak v0.10.0 <mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 <mask> golang.org/x/net v0.0.0-20181220203305-927f97764cc3 <mask> gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477 <mask> gopkg.in/yaml.v2 v2.2.1 </s> Get rid of logrus, it's TTY output is not friendly or human parseable if we will want users to send us logs. </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log "github.com/sirupsen/logrus" </s> add </s> remove log.Debugf("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> add // trace("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) </s> remove {"verbose", "v", "enable verbose output", nil, func() { log.SetLevel(log.TraceLevel) }}, </s> add // {"verbose", "v", "enable verbose output", nil, func() { log.SetLevel(log.TraceLevel) }},
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55a7ff7447e328bd75b816c90c902c36bf723fa0
go.mod
# TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]'
<mask> 'uses': 'actions/setup-node@v1' <mask> 'with': <mask> 'node-version': '${{ env.NODE_VERSION }}' <mask> - 'name': 'Set up Go modules cache' <mask> 'uses': 'actions/cache@v2' <mask> 'with': <mask> 'path': '~/go/pkg/mod' <mask> 'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}" <mask> 'restore-keys': '${{ runner.os }}-go-' <mask> - 'name': 'Get npm cache directory' </s> Pull request: all: fix gh cache action version Merge in DNS/adguard-home from fix-cache-action to master Squashed commit of the following: commit d0bd209566e8385813a2a233b453f25495752398 Merge: 38761671 00700c13 Author: Ainar Garipov <[email protected]> Date: Mon Feb 8 12:47:59 2021 +0300 Merge branch 'master' into fix-cache-action commit 3876167155d6100342b9bf020663ebb5fd90b7de Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:36:33 2021 +0300 all: don't build frontend twice commit f3a628dbafb5e8c0375e5c7b19e72a7c4d136f44 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:23:14 2021 +0300 all: more fix commit 89ff42a271dc49d2c4de88db9ba39105558e1468 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:17:55 2021 +0300 all: fix gh cache action version </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove 'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' </s> add 'run': 'make SIGN=0 VERBOSE=1 build-release build-docker' </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove - 'name': 'Set up node_modules cache' 'uses': 'actions/cache@v2' </s> add - 'name': 'Set up npm cache' # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]'
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55bde69691ec3d63abac1f41828d58f90ccbf583
.github/workflows/build.yml
# TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]'
<mask> - 'name': 'Get npm cache directory' <mask> 'id': 'npm-cache' <mask> 'run': 'echo "::set-output name=dir::$(npm config get cache)"' <mask> - 'name': 'Set up npm cache' <mask> 'uses': 'actions/cache@v2' <mask> 'with': <mask> 'path': '${{ steps.npm-cache.outputs.dir }}' <mask> 'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}" <mask> 'restore-keys': '${{ runner.os }}-node-' <mask> - 'name': 'Run make ci' </s> Pull request: all: fix gh cache action version Merge in DNS/adguard-home from fix-cache-action to master Squashed commit of the following: commit d0bd209566e8385813a2a233b453f25495752398 Merge: 38761671 00700c13 Author: Ainar Garipov <[email protected]> Date: Mon Feb 8 12:47:59 2021 +0300 Merge branch 'master' into fix-cache-action commit 3876167155d6100342b9bf020663ebb5fd90b7de Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:36:33 2021 +0300 all: don't build frontend twice commit f3a628dbafb5e8c0375e5c7b19e72a7c4d136f44 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:23:14 2021 +0300 all: more fix commit 89ff42a271dc49d2c4de88db9ba39105558e1468 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:17:55 2021 +0300 all: fix gh cache action version </s> remove - 'name': 'Set up node_modules cache' 'uses': 'actions/cache@v2' </s> add - 'name': 'Set up npm cache' # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove 'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' </s> add 'run': 'make SIGN=0 VERBOSE=1 build-release build-docker' </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]'
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55bde69691ec3d63abac1f41828d58f90ccbf583
.github/workflows/build.yml
# TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]'
<mask> 'uses': 'actions/setup-node@v1' <mask> 'with': <mask> 'node-version': '${{ env.NODE_VERSION }}' <mask> - 'name': 'Set up Go modules cache' <mask> 'uses': 'actions/cache@v2' <mask> 'with': <mask> 'path': '~/go/pkg/mod' <mask> 'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}" <mask> 'restore-keys': '${{ runner.os }}-go-' <mask> - 'name': 'Get npm cache directory' </s> Pull request: all: fix gh cache action version Merge in DNS/adguard-home from fix-cache-action to master Squashed commit of the following: commit d0bd209566e8385813a2a233b453f25495752398 Merge: 38761671 00700c13 Author: Ainar Garipov <[email protected]> Date: Mon Feb 8 12:47:59 2021 +0300 Merge branch 'master' into fix-cache-action commit 3876167155d6100342b9bf020663ebb5fd90b7de Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:36:33 2021 +0300 all: don't build frontend twice commit f3a628dbafb5e8c0375e5c7b19e72a7c4d136f44 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:23:14 2021 +0300 all: more fix commit 89ff42a271dc49d2c4de88db9ba39105558e1468 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:17:55 2021 +0300 all: fix gh cache action version
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55bde69691ec3d63abac1f41828d58f90ccbf583
.github/workflows/build.yml
- 'name': 'Set up npm cache' # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]'
<mask> 'restore-keys': '${{ runner.os }}-go-' <mask> - 'name': 'Get npm cache directory' <mask> 'id': 'npm-cache' <mask> 'run': 'echo "::set-output name=dir::$(npm config get cache)"' <mask> - 'name': 'Set up node_modules cache' <mask> 'uses': 'actions/cache@v2' <mask> 'with': <mask> 'path': '${{ steps.npm-cache.outputs.dir }}' <mask> 'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}" <mask> 'restore-keys': '${{ runner.os }}-node-' <mask> - 'name': 'Set up Snapcraft' </s> Pull request: all: fix gh cache action version Merge in DNS/adguard-home from fix-cache-action to master Squashed commit of the following: commit d0bd209566e8385813a2a233b453f25495752398 Merge: 38761671 00700c13 Author: Ainar Garipov <[email protected]> Date: Mon Feb 8 12:47:59 2021 +0300 Merge branch 'master' into fix-cache-action commit 3876167155d6100342b9bf020663ebb5fd90b7de Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:36:33 2021 +0300 all: don't build frontend twice commit f3a628dbafb5e8c0375e5c7b19e72a7c4d136f44 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:23:14 2021 +0300 all: more fix commit 89ff42a271dc49d2c4de88db9ba39105558e1468 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:17:55 2021 +0300 all: fix gh cache action version </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove 'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' </s> add 'run': 'make SIGN=0 VERBOSE=1 build-release build-docker' </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]'
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55bde69691ec3d63abac1f41828d58f90ccbf583
.github/workflows/build.yml
'run': 'make SIGN=0 VERBOSE=1 build-release build-docker'
<mask> 'uses': 'docker/setup-qemu-action@v1' <mask> - 'name': 'Set up Docker Buildx' <mask> 'uses': 'docker/setup-buildx-action@v1' <mask> - 'name': 'Run snapshot build' <mask> 'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' <mask> <mask> 'notify': <mask> 'needs': <mask> - 'build-release' <mask> # Secrets are not passed to workflows that are triggered by a pull request </s> Pull request: all: fix gh cache action version Merge in DNS/adguard-home from fix-cache-action to master Squashed commit of the following: commit d0bd209566e8385813a2a233b453f25495752398 Merge: 38761671 00700c13 Author: Ainar Garipov <[email protected]> Date: Mon Feb 8 12:47:59 2021 +0300 Merge branch 'master' into fix-cache-action commit 3876167155d6100342b9bf020663ebb5fd90b7de Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:36:33 2021 +0300 all: don't build frontend twice commit f3a628dbafb5e8c0375e5c7b19e72a7c4d136f44 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:23:14 2021 +0300 all: more fix commit 89ff42a271dc49d2c4de88db9ba39105558e1468 Author: Ainar Garipov <[email protected]> Date: Fri Feb 5 20:17:55 2021 +0300 all: fix gh cache action version </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove 'uses': 'actions/cache@v2' </s> add # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]' </s> remove - 'name': 'Set up node_modules cache' 'uses': 'actions/cache@v2' </s> add - 'name': 'Set up npm cache' # TODO(a.garipov): Update when they fix the macOS issue. The issue is # most probably https://github.com/actions/cache/issues/527. 'uses': 'actions/[email protected]'
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/55bde69691ec3d63abac1f41828d58f90ccbf583
.github/workflows/build.yml
// validate current TLS config and update warnings (it could have been loaded from file) data, err := validateCertificates(config.TLS)
<mask> for config.TLS.PortHTTPS == 0 || config.TLS.PrivateKey == "" || config.TLS.CertificateChain == "" { // sleep until neccessary data is supplied <mask> httpsServer.cond.Wait() <mask> } <mask> address := net.JoinHostPort(config.BindHost, strconv.Itoa(config.TLS.PortHTTPS)) <mask> cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) <mask> if err != nil { <mask> log.Fatal(err) <mask> os.Exit(1) <mask> } <mask> config := &tls.Config{ </s> Validate certificates and update certificate statuses on launch as well. </s> remove config := &tls.Config{ Certificates: []tls.Certificate{cert}, </s> add confing.TLS = data // update warnings // prepare cert for HTTPS server cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) if err != nil { log.Fatal(err) os.Exit(1) </s> remove httpsServer.cond.L.Unlock() </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/571be687336ad874eef025061112b3dfed0fab5d
app.go
confing.TLS = data // update warnings // prepare cert for HTTPS server cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) if err != nil { log.Fatal(err) os.Exit(1)
<mask> if err != nil { <mask> log.Fatal(err) <mask> os.Exit(1) <mask> } <mask> config := &tls.Config{ <mask> Certificates: []tls.Certificate{cert}, <mask> } <mask> httpsServer.server = &http.Server{ <mask> Addr: address, <mask> TLSConfig: config, <mask> } </s> Validate certificates and update certificate statuses on launch as well. </s> remove Addr: address, TLSConfig: config, </s> add Addr: address, TLSConfig: &tls.Config{ Certificates: []tls.Certificate{cert}, }, </s> remove cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) </s> add // validate current TLS config and update warnings (it could have been loaded from file) data, err := validateCertificates(config.TLS) </s> remove httpsServer.cond.L.Unlock() </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/571be687336ad874eef025061112b3dfed0fab5d
app.go
httpsServer.cond.L.Unlock() // prepare HTTPS server
<mask> log.Fatal(err) <mask> os.Exit(1) <mask> } <mask> httpsServer.server = &http.Server{ <mask> Addr: address, <mask> TLSConfig: &tls.Config{ <mask> Certificates: []tls.Certificate{cert}, <mask> }, </s> Validate certificates and update certificate statuses on launch as well. </s> remove Addr: address, TLSConfig: config, </s> add Addr: address, TLSConfig: &tls.Config{ Certificates: []tls.Certificate{cert}, }, </s> remove config := &tls.Config{ Certificates: []tls.Certificate{cert}, </s> add confing.TLS = data // update warnings // prepare cert for HTTPS server cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) if err != nil { log.Fatal(err) os.Exit(1) </s> remove cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) </s> add // validate current TLS config and update warnings (it could have been loaded from file) data, err := validateCertificates(config.TLS) </s> remove httpsServer.cond.L.Unlock() </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/571be687336ad874eef025061112b3dfed0fab5d
app.go
Addr: address, TLSConfig: &tls.Config{ Certificates: []tls.Certificate{cert}, },
<mask> config := &tls.Config{ <mask> Certificates: []tls.Certificate{cert}, <mask> } <mask> httpsServer.server = &http.Server{ <mask> Addr: address, <mask> TLSConfig: config, <mask> } <mask> httpsServer.cond.L.Unlock() <mask> <mask> URL := fmt.Sprintf("https://%s", address) <mask> log.Println("Go to " + URL) </s> Validate certificates and update certificate statuses on launch as well. </s> remove httpsServer.cond.L.Unlock() </s> add </s> remove config := &tls.Config{ Certificates: []tls.Certificate{cert}, </s> add confing.TLS = data // update warnings // prepare cert for HTTPS server cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) if err != nil { log.Fatal(err) os.Exit(1) </s> remove cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) </s> add // validate current TLS config and update warnings (it could have been loaded from file) data, err := validateCertificates(config.TLS)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/571be687336ad874eef025061112b3dfed0fab5d
app.go
<mask> httpsServer.server = &http.Server{ <mask> Addr: address, <mask> TLSConfig: config, <mask> } <mask> httpsServer.cond.L.Unlock() <mask> <mask> URL := fmt.Sprintf("https://%s", address) <mask> log.Println("Go to " + URL) <mask> err = httpsServer.server.ListenAndServeTLS("", "") <mask> if err != http.ErrServerClosed { </s> Validate certificates and update certificate statuses on launch as well. </s> remove Addr: address, TLSConfig: config, </s> add Addr: address, TLSConfig: &tls.Config{ Certificates: []tls.Certificate{cert}, }, </s> remove config := &tls.Config{ Certificates: []tls.Certificate{cert}, </s> add confing.TLS = data // update warnings // prepare cert for HTTPS server cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) if err != nil { log.Fatal(err) os.Exit(1) </s> remove // only for API, no need to be stored in config StatusCertificate string `yaml:"status_cert" json:"status_cert,omitempty"` StatusKey string `yaml:"status_key" json:"status_key,omitempty"` Warning string `yaml:"warning" json:"warning,omitempty"` WarningValidation string `yaml:"warning_validation" json:"warning_validation,omitempty"` </s> add tlsConfigStatus `yaml:"-" json:",inline"`
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/571be687336ad874eef025061112b3dfed0fab5d
app.go
// field ordering is not important -- these are for API and are recalculated on each run type tlsConfigStatus struct { StatusCertificate string `yaml:"-" json:"status_cert,omitempty"` StatusKey string `yaml:"-" json:"status_key,omitempty"` Warning string `yaml:"-" json:"warning,omitempty"` WarningValidation string `yaml:"-" json:"warning_validation,omitempty"` }
<mask> dnsforward.TLSConfig `yaml:",inline" json:",inline"` <mask> } <mask> <mask> // field ordering is important -- yaml fields will mirror ordering from here <mask> type tlsConfig struct { <mask> tlsConfigSettings `yaml:",inline" json:",inline"` <mask> tlsConfigStatus `yaml:"-" json:",inline"` <mask> } <mask> </s> Validate certificates and update certificate statuses on launch as well. </s> remove // only for API, no need to be stored in config StatusCertificate string `yaml:"status_cert" json:"status_cert,omitempty"` StatusKey string `yaml:"status_key" json:"status_key,omitempty"` Warning string `yaml:"warning" json:"warning,omitempty"` WarningValidation string `yaml:"warning_validation" json:"warning_validation,omitempty"` </s> add tlsConfigStatus `yaml:"-" json:",inline"` </s> remove cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) </s> add // validate current TLS config and update warnings (it could have been loaded from file) data, err := validateCertificates(config.TLS) </s> remove config := &tls.Config{ Certificates: []tls.Certificate{cert}, </s> add confing.TLS = data // update warnings // prepare cert for HTTPS server cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) if err != nil { log.Fatal(err) os.Exit(1)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/571be687336ad874eef025061112b3dfed0fab5d
config.go
tlsConfigStatus `yaml:"-" json:",inline"`
<mask> <mask> // field ordering is important -- yaml fields will mirror ordering from here <mask> type tlsConfig struct { <mask> tlsConfigSettings `yaml:",inline" json:",inline"` <mask> <mask> // only for API, no need to be stored in config <mask> StatusCertificate string `yaml:"status_cert" json:"status_cert,omitempty"` <mask> StatusKey string `yaml:"status_key" json:"status_key,omitempty"` <mask> Warning string `yaml:"warning" json:"warning,omitempty"` <mask> WarningValidation string `yaml:"warning_validation" json:"warning_validation,omitempty"` <mask> } <mask> <mask> // initialize to default values, will be changed later when reading config or parsing command line <mask> var config = configuration{ <mask> ourConfigFilename: "AdGuardHome.yaml", </s> Validate certificates and update certificate statuses on launch as well. </s> remove cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) </s> add // validate current TLS config and update warnings (it could have been loaded from file) data, err := validateCertificates(config.TLS) </s> remove config := &tls.Config{ Certificates: []tls.Certificate{cert}, </s> add confing.TLS = data // update warnings // prepare cert for HTTPS server cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) if err != nil { log.Fatal(err) os.Exit(1) </s> remove httpsServer.cond.L.Unlock() </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/571be687336ad874eef025061112b3dfed0fab5d
config.go
// clear out all warnings and statuses data.tlsConfigStatus = tlsConfigStatus{}
<mask> } <mask> opts.Intermediates = pool <mask> } <mask> <mask> // TODO: save it as a warning rather than error it out -- shouldn't be a big problem <mask> mainCert := parsedCerts[0] <mask> _, err := mainCert.Verify(opts) <mask> if err != nil { </s> Validate certificates and update certificate statuses on launch as well. </s> remove config := &tls.Config{ Certificates: []tls.Certificate{cert}, </s> add confing.TLS = data // update warnings // prepare cert for HTTPS server cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) if err != nil { log.Fatal(err) os.Exit(1) </s> remove cert, err := tls.X509KeyPair([]byte(config.TLS.CertificateChain), []byte(config.TLS.PrivateKey)) </s> add // validate current TLS config and update warnings (it could have been loaded from file) data, err := validateCertificates(config.TLS) </s> remove // only for API, no need to be stored in config StatusCertificate string `yaml:"status_cert" json:"status_cert,omitempty"` StatusKey string `yaml:"status_key" json:"status_key,omitempty"` Warning string `yaml:"warning" json:"warning,omitempty"` WarningValidation string `yaml:"warning_validation" json:"warning_validation,omitempty"` </s> add tlsConfigStatus `yaml:"-" json:",inline"` </s> remove httpsServer.cond.L.Unlock() </s> add </s> remove Addr: address, TLSConfig: config, </s> add Addr: address, TLSConfig: &tls.Config{ Certificates: []tls.Certificate{cert}, },
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/571be687336ad874eef025061112b3dfed0fab5d
control.go
<mask> <mask> import ( <mask> "io/fs" <mask> "net" <mask> "os" <mask> "path" <mask> "strings" <mask> "sync/atomic" <mask> "testing" <mask> "testing/fstest" </s> Pull request: 3597 arpdb Merge in DNS/adguard-home from 3597-wrt-netlink to master Updates #3597. Squashed commit of the following: commit 1709582cd204bb80c84775feabae8723ed3340f6 Merge: 0507b6ed e7b3c996 Author: Eugene Burkov <[email protected]> Date: Tue Mar 15 20:25:18 2022 +0300 Merge branch 'master' into 3597-wrt-netlink commit 0507b6ede1162554ca8ac7399d827264aca64f98 Author: Eugene Burkov <[email protected]> Date: Tue Mar 15 20:21:29 2022 +0300 all: imp code commit 71f9758d854b3e2cf90cbd3655ae4818cfbcf528 Author: Eugene Burkov <[email protected]> Date: Wed Mar 9 18:03:48 2022 +0500 aghnet: imp naming commit c949e765104f130aa3e5ba465bdebc3286bebe44 Author: Eugene Burkov <[email protected]> Date: Wed Mar 9 17:26:30 2022 +0500 all: imp code, docs commit cf605ddb401b6e7b0a7a4bb1b175a4dc588d253a Author: Eugene Burkov <[email protected]> Date: Tue Mar 8 15:33:52 2022 +0500 all: imp code, docs commit 2960c6549a7e4944cc0072ca47a0cd4e82ec850e Author: Eugene Burkov <[email protected]> Date: Sun Mar 6 21:34:58 2022 +0500 all: imp code & docs, fix tests commit 29c049f3aee91a826c3416961686396d562a7066 Author: Eugene Burkov <[email protected]> Date: Wed Mar 2 20:45:34 2022 +0300 all: add arpdb </s> remove "os/exec" "runtime" </s> add </s> remove "strings" </s> add </s> remove testdata := os.DirFS("./testdata") </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/573cbafe3f2f222d7c6413d8fe30c90ae295882d
internal/aghnet/hostscontainer_test.go
<mask> }) <mask> } <mask> <mask> func TestHostsContainer_Translate(t *testing.T) { <mask> testdata := os.DirFS("./testdata") <mask> stubWatcher := aghtest.FSWatcher{ <mask> OnEvents: func() (e <-chan struct{}) { return nil }, <mask> OnAdd: func(name string) (err error) { return nil }, <mask> OnClose: func() (err error) { panic("not implemented") }, <mask> } </s> Pull request: 3597 arpdb Merge in DNS/adguard-home from 3597-wrt-netlink to master Updates #3597. Squashed commit of the following: commit 1709582cd204bb80c84775feabae8723ed3340f6 Merge: 0507b6ed e7b3c996 Author: Eugene Burkov <[email protected]> Date: Tue Mar 15 20:25:18 2022 +0300 Merge branch 'master' into 3597-wrt-netlink commit 0507b6ede1162554ca8ac7399d827264aca64f98 Author: Eugene Burkov <[email protected]> Date: Tue Mar 15 20:21:29 2022 +0300 all: imp code commit 71f9758d854b3e2cf90cbd3655ae4818cfbcf528 Author: Eugene Burkov <[email protected]> Date: Wed Mar 9 18:03:48 2022 +0500 aghnet: imp naming commit c949e765104f130aa3e5ba465bdebc3286bebe44 Author: Eugene Burkov <[email protected]> Date: Wed Mar 9 17:26:30 2022 +0500 all: imp code, docs commit cf605ddb401b6e7b0a7a4bb1b175a4dc588d253a Author: Eugene Burkov <[email protected]> Date: Tue Mar 8 15:33:52 2022 +0500 all: imp code, docs commit 2960c6549a7e4944cc0072ca47a0cd4e82ec850e Author: Eugene Burkov <[email protected]> Date: Sun Mar 6 21:34:58 2022 +0500 all: imp code & docs, fix tests commit 29c049f3aee91a826c3416961686396d562a7066 Author: Eugene Burkov <[email protected]> Date: Wed Mar 2 20:45:34 2022 +0300 all: add arpdb </s> remove testdata := os.DirFS("./testdata") </s> add </s> remove return 1, "", fmt.Errorf("exec.Command(%s) failed: %w: %s", command, err, string(out)) </s> add return 1, "", fmt.Errorf("command %q failed: %w: %s", command, err, out) </s> remove // MaxCmdOutputSize is the maximum length of performed shell command output. const MaxCmdOutputSize = 2 * 1024 </s> add // MaxCmdOutputSize is the maximum length of performed shell command output in // bytes. const MaxCmdOutputSize = 64 * 1024 </s> remove func RunCommand(command string, arguments ...string) (int, string, error) { </s> add func RunCommand(command string, arguments ...string) (code int, output string, err error) { </s> remove cmd := exec.Command("arp", "-a") log.Tracef("executing %q %q", cmd.Path, cmd.Args) data, err := cmd.Output() if err != nil || cmd.ProcessState.ExitCode() != 0 { log.Debug("command %q has failed: %q code:%d", cmd.Path, err, cmd.ProcessState.ExitCode()) </s> add ns := clients.arpdb.Neighbors() if len(ns) == 0 { log.Debug("refreshing arp container: the update is empty")
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/573cbafe3f2f222d7c6413d8fe30c90ae295882d
internal/aghnet/hostscontainer_test.go
<mask> <mask> func TestHostsContainer(t *testing.T) { <mask> const listID = 1234 <mask> <mask> testdata := os.DirFS("./testdata") <mask> <mask> testCases := []struct { <mask> want []*rules.DNSRewrite <mask> name string <mask> req urlfilter.DNSRequest <mask> }{{ </s> Pull request: 3597 arpdb Merge in DNS/adguard-home from 3597-wrt-netlink to master Updates #3597. Squashed commit of the following: commit 1709582cd204bb80c84775feabae8723ed3340f6 Merge: 0507b6ed e7b3c996 Author: Eugene Burkov <[email protected]> Date: Tue Mar 15 20:25:18 2022 +0300 Merge branch 'master' into 3597-wrt-netlink commit 0507b6ede1162554ca8ac7399d827264aca64f98 Author: Eugene Burkov <[email protected]> Date: Tue Mar 15 20:21:29 2022 +0300 all: imp code commit 71f9758d854b3e2cf90cbd3655ae4818cfbcf528 Author: Eugene Burkov <[email protected]> Date: Wed Mar 9 18:03:48 2022 +0500 aghnet: imp naming commit c949e765104f130aa3e5ba465bdebc3286bebe44 Author: Eugene Burkov <[email protected]> Date: Wed Mar 9 17:26:30 2022 +0500 all: imp code, docs commit cf605ddb401b6e7b0a7a4bb1b175a4dc588d253a Author: Eugene Burkov <[email protected]> Date: Tue Mar 8 15:33:52 2022 +0500 all: imp code, docs commit 2960c6549a7e4944cc0072ca47a0cd4e82ec850e Author: Eugene Burkov <[email protected]> Date: Sun Mar 6 21:34:58 2022 +0500 all: imp code & docs, fix tests commit 29c049f3aee91a826c3416961686396d562a7066 Author: Eugene Burkov <[email protected]> Date: Wed Mar 2 20:45:34 2022 +0300 all: add arpdb </s> remove testdata := os.DirFS("./testdata") </s> add </s> remove clients.Init(nil, nil, nil) </s> add clients.Init(nil, nil, nil, nil) </s> remove // MaxCmdOutputSize is the maximum length of performed shell command output. const MaxCmdOutputSize = 2 * 1024 </s> add // MaxCmdOutputSize is the maximum length of performed shell command output in // bytes. const MaxCmdOutputSize = 64 * 1024 </s> remove func RunCommand(command string, arguments ...string) (int, string, error) { </s> add func RunCommand(command string, arguments ...string) (code int, output string, err error) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/573cbafe3f2f222d7c6413d8fe30c90ae295882d
internal/aghnet/hostscontainer_test.go