docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 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() e... | [
"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 {
... | [
"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/ad... | [
"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) Recon... | [
"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")
<... | [
"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 {
... | [
"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 aga... | [
"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 ... | [
"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
... | [
"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 th... | [
"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 disa... | [
"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
Me... | [
"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 di... | [
"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)
... | [
"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/... | [
"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> }... | [
"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 31... | [
"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... | <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.... | [
"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.ProtectionEnable... | [
"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)
<... | [
"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: 31... | [
"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: 31... | [
"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.RUn... | [
"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
<mas... | [
"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_... | [
"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.getDNS... | [
"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 priv... | [
"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-h... | [
"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 serve... | [
"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 priva... | [
"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 ... | [
"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-... | [
"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 b78ac2eeb1b408586808ddbd1c87... | [
"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... | [
"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
Update... | [
"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-p... | [
"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 privat... | [
"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... | [
"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-di... | [
"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 ma... | [
"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 t... | [
"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 ... | [
"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.
Squas... | [
"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/ad... | [
"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-pt... | [
"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.
Squa... | [
"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 i... | [
"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 ... | [
"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... | [
"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 maste... | [
"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:"... | [
"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 priva... | [
"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 !=... | [
"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: 31... | [
"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/... | [
"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 3... | [
"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 t... | [
"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> P... | [
"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 followi... | [
"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 impr... | <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.Big... | [
"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... | [
"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 3... | [
"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 DN... | [
"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.cliIDInde... | [
"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... | [
"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 mast... | [
"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... | [
"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/ad... | [
"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 ... | [
"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> ... | [
"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 =... | [
"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.... | [
"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> ret... | [
"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> queryLogTi... | [
"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 "githu... | [
"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 log... | [
"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 ... | [
"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 "git... | [
"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 friendl... | [
"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> ... | [
"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/cache@v2.1.3' | <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-... | [
"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/cache@v2.1.3' | <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 }}... | [
"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/cache@v2.1.3' | <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-... | [
"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/cache@v2.1.3' | <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> 'wi... | [
"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> ... | [
"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 := t... | [
"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> Vali... | [
"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. </... | [
"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)... | [
"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("", ... | [
"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"`
Warning... | <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> }
... | [
"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_ce... | [
"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 certificat... | [
"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:
com... | [
"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> OnClo... | [
"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
M... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/573cbafe3f2f222d7c6413d8fe30c90ae295882d | internal/aghnet/hostscontainer_test.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.