docstring_tokens stringlengths 18 16.9k | code_tokens stringlengths 75 1.81M | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> //
<mask> // TODO(e.burkov): Think about passing filename or any additional data.
<mask> type FileWalker func(r io.Reader) (patterns []string, cont bool, err error)
<mask>
<mask> // MaxWalkedFileSize is the maximum length of the file that FileWalker can
<mask> // check.
<mask> const MaxWalkedFileSize = 1024 * 1024
<mask>
<mask> // checkFile tries to open and process a single file located on sourcePath in
<mask> // the specified fsys. The path is skipped if it's a directory.
<mask> func checkFile(
<mask> fsys fs.FS,
<mask> c FileWalker,
</s> Pull request: 3906 filewalker read limit
Merge in DNS/adguard-home from 3906-filewalker-constraint to master
Updates #3906.
Squashed commit of the following:
commit e1b654420a5031dbfe69d86c3fcf16a95a9ca935
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Dec 1 15:45:26 2021 +0300
aghos: rm filewalker limit </s> remove // TODO(e.burkov, a.garipov): Move into another package like aghfs.
</s> add // TODO(e.burkov, a.garipov): Move into another package like aghfs. </s> remove // should be valid for fs.Glob. If cont is false, the walking terminates. Each
// opened file is also limited for reading to MaxWalkedFileSize.
</s> add // should be valid for fs.Glob. If FileWalker returns false for cont then
// walking terminates. Prefer using bufio.Scanner to read the r since the input
// is not limited. </s> remove var r io.Reader
// Ignore the error since LimitReader function returns error only if passed
// limit value is less than zero, but the constant used.
//
// TODO(e.burkov): Make variable.
r, _ = aghio.LimitReader(f, MaxWalkedFileSize)
return c(r)
</s> add return c(f) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghio"
</s> add </s> remove }
if fi.IsDir() {
</s> add } else if fi.IsDir() { | https://github.com/AdguardTeam/AdGuardHome/commit/9c6d13991306d9a74e6a59954f507d37b15af6c3 | internal/aghos/filewalker.go |
keep keep replace replace keep keep keep keep replace replace replace replace replace replace replace replace keep keep | <mask> if fi, err = f.Stat(); err != nil {
<mask> return nil, true, err
<mask> }
<mask> if fi.IsDir() {
<mask> // Skip the directories.
<mask> return nil, true, nil
<mask> }
<mask>
<mask> var r io.Reader
<mask> // Ignore the error since LimitReader function returns error only if passed
<mask> // limit value is less than zero, but the constant used.
<mask> //
<mask> // TODO(e.burkov): Make variable.
<mask> r, _ = aghio.LimitReader(f, MaxWalkedFileSize)
<mask>
<mask> return c(r)
<mask> }
<mask>
</s> Pull request: 3906 filewalker read limit
Merge in DNS/adguard-home from 3906-filewalker-constraint to master
Updates #3906.
Squashed commit of the following:
commit e1b654420a5031dbfe69d86c3fcf16a95a9ca935
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Dec 1 15:45:26 2021 +0300
aghos: rm filewalker limit </s> remove // should be valid for fs.Glob. If cont is false, the walking terminates. Each
// opened file is also limited for reading to MaxWalkedFileSize.
</s> add // should be valid for fs.Glob. If FileWalker returns false for cont then
// walking terminates. Prefer using bufio.Scanner to read the r since the input
// is not limited. </s> remove // TODO(e.burkov, a.garipov): Move into another package like aghfs.
</s> add // TODO(e.burkov, a.garipov): Move into another package like aghfs. </s> remove // MaxWalkedFileSize is the maximum length of the file that FileWalker can
// check.
const MaxWalkedFileSize = 1024 * 1024
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghio"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c6d13991306d9a74e6a59954f507d37b15af6c3 | internal/aghos/filewalker.go |
keep keep keep keep replace replace replace keep keep keep keep keep | <mask> )
<mask>
<mask> // To transfer information between modules
<mask> type dnsContext struct {
<mask> // TODO(a.garipov): Remove this and rewrite processors to be methods of
<mask> // *Server instead.
<mask> srv *Server
<mask> proxyCtx *proxy.DNSContext
<mask> // setts are the filtering settings for the client.
<mask> setts *filtering.Settings
<mask> startTime time.Time
<mask> result *filtering.Result
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove // assume that all the DHCP leases we give are locally-served or at
// least don't need to be inaccessible externally.
if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
</s> add // assume that all the DHCP leases we give are locally-served or at least
// don't need to be inaccessible externally.
if !s.subnetDetector.IsLocallyServedNetwork(ip) {
log.Debug("dns: addr %s is not from locally-served network", ip)
return resultCodeSuccess
}
if !ctx.isLocalClient {
log.Debug("dns: %q requests an internal ip", d.Addr) </s> remove // was successfully parsed.
</s> add // parsed successfully and belongs to one of locally-served IP ranges as per
// RFC 6303. </s> remove // Disable redundant filtering.
filterSetts := s.getClientRequestFilteringSettings(ctx)
filterSetts.ParentalEnabled = false
filterSetts.SafeBrowsingEnabled = false
filterSetts.SafeSearchEnabled = false
filterSetts.ServicesRules = nil
ctx.setts = filterSetts
</s> add // There is no need to filter request from external addresses since this
// code is only executed when the request is for locally-served ARPA
// hostname so disable redundant filters.
ctx.setts.ParentalEnabled = false
ctx.setts.SafeBrowsingEnabled = false
ctx.setts.SafeSearchEnabled = false
ctx.setts.ServicesRules = nil </s> remove srv: s,
</s> add </s> remove func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) { </s> remove processInitial,
</s> add s.processInitial, | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace keep keep keep keep keep | <mask> // origResp is the response received from upstream. It is set when the
<mask> // response is modified by filters.
<mask> origResp *dns.Msg
<mask> // unreversedReqIP stores an IP address obtained from PTR request if it
<mask> // was successfully parsed.
<mask> unreversedReqIP net.IP
<mask> // err is the error returned from a processing function.
<mask> err error
<mask> // clientID is the clientID from DoH, DoQ, or DoT, if provided.
<mask> clientID string
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove // Disable redundant filtering.
filterSetts := s.getClientRequestFilteringSettings(ctx)
filterSetts.ParentalEnabled = false
filterSetts.SafeBrowsingEnabled = false
filterSetts.SafeSearchEnabled = false
filterSetts.ServicesRules = nil
ctx.setts = filterSetts
</s> add // There is no need to filter request from external addresses since this
// code is only executed when the request is for locally-served ARPA
// hostname so disable redundant filters.
ctx.setts.ParentalEnabled = false
ctx.setts.SafeBrowsingEnabled = false
ctx.setts.SafeSearchEnabled = false
ctx.setts.ServicesRules = nil </s> remove // assume that all the DHCP leases we give are locally-served or at
// least don't need to be inaccessible externally.
if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
</s> add // assume that all the DHCP leases we give are locally-served or at least
// don't need to be inaccessible externally.
if !s.subnetDetector.IsLocallyServedNetwork(ip) {
log.Debug("dns: addr %s is not from locally-served network", ip)
return resultCodeSuccess
}
if !ctx.isLocalClient {
log.Debug("dns: %q requests an internal ip", d.Addr) </s> remove if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
!ctx.srv.conf.EnableDNSSEC {
</s> add // Don't process response if it's not from upstream servers.
if !ctx.responseFromUpstream || !s.conf.EnableDNSSEC { </s> remove func processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove if ctx.setts == nil {
ctx.setts = s.getClientRequestFilteringSettings(ctx)
}
</s> add </s> remove processInitial,
</s> add s.processInitial, | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // handleDNSRequest filters the incoming DNS requests and writes them to the query log
<mask> func (s *Server) handleDNSRequest(_ *proxy.Proxy, d *proxy.DNSContext) error {
<mask> ctx := &dnsContext{
<mask> srv: s,
<mask> proxyCtx: d,
<mask> result: &filtering.Result{},
<mask> startTime: time.Now(),
<mask> }
<mask>
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove srv: &Server{
queryLog: ql,
stats: st,
},
</s> add </s> remove // assume that all the DHCP leases we give are locally-served or at
// least don't need to be inaccessible externally.
if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
</s> add // assume that all the DHCP leases we give are locally-served or at least
// don't need to be inaccessible externally.
if !s.subnetDetector.IsLocallyServedNetwork(ip) {
log.Debug("dns: addr %s is not from locally-served network", ip)
return resultCodeSuccess
}
if !ctx.isLocalClient {
log.Debug("dns: %q requests an internal ip", d.Addr) </s> remove // was successfully parsed.
</s> add // parsed successfully and belongs to one of locally-served IP ranges as per
// RFC 6303. </s> remove func processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) { | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace keep keep keep keep keep | <mask> // (*proxy.Proxy).handleDNSRequest method performs it before calling the
<mask> // appropriate handler.
<mask> mods := []modProcessFunc{
<mask> s.processRecursion,
<mask> processInitial,
<mask> s.processDetermineLocal,
<mask> s.processInternalHosts,
<mask> s.processRestrictLocal,
<mask> s.processInternalIPAddrs,
<mask> s.processClientID,
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove processDNSSECAfterResponse,
processFilteringAfterResponse,
</s> add s.processDNSSECAfterResponse,
s.processFilteringAfterResponse, </s> remove // was successfully parsed.
</s> add // parsed successfully and belongs to one of locally-served IP ranges as per
// RFC 6303. </s> remove // TODO(a.garipov): Remove this and rewrite processors to be methods of
// *Server instead.
srv *Server
</s> add </s> remove srv: s,
</s> add </s> remove processQueryLogsAndStats,
</s> add s.processQueryLogsAndStats, </s> remove // Disable redundant filtering.
filterSetts := s.getClientRequestFilteringSettings(ctx)
filterSetts.ParentalEnabled = false
filterSetts.SafeBrowsingEnabled = false
filterSetts.SafeSearchEnabled = false
filterSetts.ServicesRules = nil
ctx.setts = filterSetts
</s> add // There is no need to filter request from external addresses since this
// code is only executed when the request is for locally-served ARPA
// hostname so disable redundant filters.
ctx.setts.ParentalEnabled = false
ctx.setts.SafeBrowsingEnabled = false
ctx.setts.SafeSearchEnabled = false
ctx.setts.ServicesRules = nil | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep replace replace keep replace | <mask> s.processLocalPTR,
<mask> s.processUpstream,
<mask> processDNSSECAfterResponse,
<mask> processFilteringAfterResponse,
<mask> s.ipset.process,
<mask> processQueryLogsAndStats,
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove code := processQueryLogsAndStats(dctx)
</s> add code := srv.processQueryLogsAndStats(dctx) </s> remove // Disable redundant filtering.
filterSetts := s.getClientRequestFilteringSettings(ctx)
filterSetts.ParentalEnabled = false
filterSetts.SafeBrowsingEnabled = false
filterSetts.SafeSearchEnabled = false
filterSetts.ServicesRules = nil
ctx.setts = filterSetts
</s> add // There is no need to filter request from external addresses since this
// code is only executed when the request is for locally-served ARPA
// hostname so disable redundant filters.
ctx.setts.ParentalEnabled = false
ctx.setts.SafeBrowsingEnabled = false
ctx.setts.SafeSearchEnabled = false
ctx.setts.ServicesRules = nil </s> remove // was successfully parsed.
</s> add // parsed successfully and belongs to one of locally-served IP ranges as per
// RFC 6303. </s> remove srv: s,
</s> add </s> remove processInitial,
</s> add s.processInitial, | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> return resultCodeSuccess
<mask> }
<mask>
<mask> // Perform initial checks; process WHOIS & rDNS
<mask> func processInitial(ctx *dnsContext) (rc resultCode) {
<mask> s := ctx.srv
<mask> d := ctx.proxyCtx
<mask> if s.conf.AAAADisabled && d.Req.Question[0].Qtype == dns.TypeAAAA {
<mask> _ = proxy.CheckDisabledAAAARequest(d, true)
<mask> return resultCodeFinish
<mask> }
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove func processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove func processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) { </s> remove if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
!ctx.srv.conf.EnableDNSSEC {
</s> add // Don't process response if it's not from upstream servers.
if !ctx.responseFromUpstream || !s.conf.EnableDNSSEC { </s> remove s := ctx.srv
</s> add </s> remove if ctx.setts == nil {
ctx.setts = s.getClientRequestFilteringSettings(ctx)
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep add keep keep keep keep keep | <mask> return resultCodeFinish
<mask> }
<mask>
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> func (s *Server) setTableHostToIP(t hostToIPTable) {
<mask> s.tableHostToIPLock.Lock()
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove func processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove func processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove srv: s,
</s> add </s> remove if ctx.setts == nil {
ctx.setts = s.getClientRequestFilteringSettings(ctx)
}
</s> add </s> remove // assume that all the DHCP leases we give are locally-served or at
// least don't need to be inaccessible externally.
if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
</s> add // assume that all the DHCP leases we give are locally-served or at least
// don't need to be inaccessible externally.
if !s.subnetDetector.IsLocallyServedNetwork(ip) {
log.Debug("dns: addr %s is not from locally-served network", ip)
return resultCodeSuccess
}
if !ctx.isLocalClient {
log.Debug("dns: %q requests an internal ip", d.Addr) | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> return resultCodeError
<mask> }
<mask>
<mask> // Restrict an access to local addresses for external clients. We also
<mask> // assume that all the DHCP leases we give are locally-served or at
<mask> // least don't need to be inaccessible externally.
<mask> if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
<mask> log.Debug("dns: %q requests for internal ip", d.Addr)
<mask> d.Res = s.genNXDomain(req)
<mask>
<mask> // Do not even put into query log.
<mask> return resultCodeFinish
<mask> }
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove // Disable redundant filtering.
filterSetts := s.getClientRequestFilteringSettings(ctx)
filterSetts.ParentalEnabled = false
filterSetts.SafeBrowsingEnabled = false
filterSetts.SafeSearchEnabled = false
filterSetts.ServicesRules = nil
ctx.setts = filterSetts
</s> add // There is no need to filter request from external addresses since this
// code is only executed when the request is for locally-served ARPA
// hostname so disable redundant filters.
ctx.setts.ParentalEnabled = false
ctx.setts.SafeBrowsingEnabled = false
ctx.setts.SafeSearchEnabled = false
ctx.setts.ServicesRules = nil </s> remove // TODO(a.garipov): Remove this and rewrite processors to be methods of
// *Server instead.
srv *Server
</s> add </s> remove srv: s,
</s> add </s> remove // was successfully parsed.
</s> add // parsed successfully and belongs to one of locally-served IP ranges as per
// RFC 6303. </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
!ctx.srv.conf.EnableDNSSEC {
</s> add // Don't process response if it's not from upstream servers.
if !ctx.responseFromUpstream || !s.conf.EnableDNSSEC { | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep | <mask>
<mask> // Do not perform unreversing ever again.
<mask> ctx.unreversedReqIP = ip
<mask>
<mask> // Disable redundant filtering.
<mask> filterSetts := s.getClientRequestFilteringSettings(ctx)
<mask> filterSetts.ParentalEnabled = false
<mask> filterSetts.SafeBrowsingEnabled = false
<mask> filterSetts.SafeSearchEnabled = false
<mask> filterSetts.ServicesRules = nil
<mask> ctx.setts = filterSetts
<mask>
<mask> // Nothing to restrict.
<mask> return resultCodeSuccess
<mask> }
<mask>
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove if ctx.setts == nil {
ctx.setts = s.getClientRequestFilteringSettings(ctx)
}
</s> add </s> add ctx.protectionEnabled = s.conf.ProtectionEnabled
ctx.setts = s.getClientRequestFilteringSettings(ctx)
</s> remove ctx.protectionEnabled = s.conf.ProtectionEnabled
</s> add </s> remove // assume that all the DHCP leases we give are locally-served or at
// least don't need to be inaccessible externally.
if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
</s> add // assume that all the DHCP leases we give are locally-served or at least
// don't need to be inaccessible externally.
if !s.subnetDetector.IsLocallyServedNetwork(ip) {
log.Debug("dns: addr %s is not from locally-served network", ip)
return resultCodeSuccess
}
if !ctx.isLocalClient {
log.Debug("dns: %q requests an internal ip", d.Addr) </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
!ctx.srv.conf.EnableDNSSEC {
</s> add // Don't process response if it's not from upstream servers.
if !ctx.responseFromUpstream || !s.conf.EnableDNSSEC { | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace replace keep keep keep keep replace replace replace replace keep | <mask>
<mask> s.serverLock.RLock()
<mask> defer s.serverLock.RUnlock()
<mask>
<mask> ctx.protectionEnabled = s.conf.ProtectionEnabled
<mask>
<mask> if s.dnsFilter == nil {
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> if ctx.setts == nil {
<mask> ctx.setts = s.getClientRequestFilteringSettings(ctx)
<mask> }
<mask>
<mask> var err error
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> add ctx.protectionEnabled = s.conf.ProtectionEnabled
ctx.setts = s.getClientRequestFilteringSettings(ctx)
</s> remove // Disable redundant filtering.
filterSetts := s.getClientRequestFilteringSettings(ctx)
filterSetts.ParentalEnabled = false
filterSetts.SafeBrowsingEnabled = false
filterSetts.SafeSearchEnabled = false
filterSetts.ServicesRules = nil
ctx.setts = filterSetts
</s> add // There is no need to filter request from external addresses since this
// code is only executed when the request is for locally-served ARPA
// hostname so disable redundant filters.
ctx.setts.ParentalEnabled = false
ctx.setts.SafeBrowsingEnabled = false
ctx.setts.SafeSearchEnabled = false
ctx.setts.ServicesRules = nil </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
!ctx.srv.conf.EnableDNSSEC {
</s> add // Don't process response if it's not from upstream servers.
if !ctx.responseFromUpstream || !s.conf.EnableDNSSEC { </s> remove // assume that all the DHCP leases we give are locally-served or at
// least don't need to be inaccessible externally.
if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
</s> add // assume that all the DHCP leases we give are locally-served or at least
// don't need to be inaccessible externally.
if !s.subnetDetector.IsLocallyServedNetwork(ip) {
log.Debug("dns: addr %s is not from locally-served network", ip)
return resultCodeSuccess
}
if !ctx.isLocalClient {
log.Debug("dns: %q requests an internal ip", d.Addr) | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep replace keep keep replace replace keep | <mask> // Process DNSSEC after response from upstream server
<mask> func processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) {
<mask> d := ctx.proxyCtx
<mask>
<mask> if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
<mask> !ctx.srv.conf.EnableDNSSEC {
<mask> return resultCodeSuccess
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove func processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) { </s> remove // was successfully parsed.
</s> add // parsed successfully and belongs to one of locally-served IP ranges as per
// RFC 6303. </s> remove // assume that all the DHCP leases we give are locally-served or at
// least don't need to be inaccessible externally.
if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
</s> add // assume that all the DHCP leases we give are locally-served or at least
// don't need to be inaccessible externally.
if !s.subnetDetector.IsLocallyServedNetwork(ip) {
log.Debug("dns: addr %s is not from locally-served network", ip)
return resultCodeSuccess
}
if !ctx.isLocalClient {
log.Debug("dns: %q requests an internal ip", d.Addr) | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> return resultCodeSuccess
<mask> }
<mask>
<mask> // Apply filtering logic after we have received response from upstream servers
<mask> func processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) {
<mask> s := ctx.srv
<mask> d := ctx.proxyCtx
<mask>
<mask> switch res := ctx.result; res.Reason {
<mask> case filtering.NotFilteredAllowList:
<mask> // Go on.
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove func processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
!ctx.srv.conf.EnableDNSSEC {
</s> add // Don't process response if it's not from upstream servers.
if !ctx.responseFromUpstream || !s.conf.EnableDNSSEC { </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) { </s> remove s := ctx.srv
</s> add </s> remove processQueryLogsAndStats,
</s> add s.processQueryLogsAndStats, | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/dns.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "github.com/miekg/dns"
<mask> )
<mask>
<mask> // Write Stats data and logs
<mask> func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
<mask> elapsed := time.Since(ctx.startTime)
<mask> s := ctx.srv
<mask> pctx := ctx.proxyCtx
<mask>
<mask> shouldLog := true
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove s := ctx.srv
</s> add </s> remove func processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove func processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
!ctx.srv.conf.EnableDNSSEC {
</s> add // Don't process response if it's not from upstream servers.
if !ctx.responseFromUpstream || !s.conf.EnableDNSSEC { </s> add ql := &testQueryLog{}
st := &testStats{}
srv := &Server{
queryLog: ql,
stats: st,
} | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/stats.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // Write Stats data and logs
<mask> func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
<mask> elapsed := time.Since(ctx.startTime)
<mask> s := ctx.srv
<mask> pctx := ctx.proxyCtx
<mask>
<mask> shouldLog := true
<mask> msg := pctx.Req
<mask>
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) { </s> remove func processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { </s> remove func processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processDNSSECAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove if !ctx.responseFromUpstream || // don't process response if it's not from upstream servers
!ctx.srv.conf.EnableDNSSEC {
</s> add // Don't process response if it's not from upstream servers.
if !ctx.responseFromUpstream || !s.conf.EnableDNSSEC { </s> add ql := &testQueryLog{}
st := &testStats{}
srv := &Server{
queryLog: ql,
stats: st,
} | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/stats.go |
keep add keep keep keep keep | <mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> req := &dns.Msg{
<mask> Question: []dns.Question{{
<mask> Name: "example.com.",
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove processQueryLogsAndStats,
</s> add s.processQueryLogsAndStats, </s> remove processDNSSECAfterResponse,
processFilteringAfterResponse,
</s> add s.processDNSSECAfterResponse,
s.processFilteringAfterResponse, </s> remove func processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) {
</s> add func (s *Server) processQueryLogsAndStats(ctx *dnsContext) (rc resultCode) { </s> remove func processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processFilteringAfterResponse(ctx *dnsContext) (rc resultCode) { </s> remove s := ctx.srv
</s> add </s> remove func processInitial(ctx *dnsContext) (rc resultCode) {
s := ctx.srv
</s> add func (s *Server) processInitial(ctx *dnsContext) (rc resultCode) { | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/stats_test.go |
keep keep keep keep replace replace replace keep replace replace replace replace keep keep | <mask> Res: &dns.Msg{},
<mask> Addr: tc.addr,
<mask> Upstream: ups,
<mask> }
<mask>
<mask> ql := &testQueryLog{}
<mask> st := &testStats{}
<mask> dctx := &dnsContext{
<mask> srv: &Server{
<mask> queryLog: ql,
<mask> stats: st,
<mask> },
<mask> proxyCtx: pctx,
<mask> startTime: time.Now(),
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> add ql := &testQueryLog{}
st := &testStats{}
srv := &Server{
queryLog: ql,
stats: st,
} </s> remove srv: s,
</s> add </s> remove code := processQueryLogsAndStats(dctx)
</s> add code := srv.processQueryLogsAndStats(dctx) </s> remove processDNSSECAfterResponse,
processFilteringAfterResponse,
</s> add s.processDNSSECAfterResponse,
s.processFilteringAfterResponse, </s> remove processQueryLogsAndStats,
</s> add s.processQueryLogsAndStats, | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/stats_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> },
<mask> clientID: tc.clientID,
<mask> }
<mask>
<mask> code := processQueryLogsAndStats(dctx)
<mask> assert.Equal(t, tc.wantCode, code)
<mask> assert.Equal(t, tc.wantLogProto, ql.lastParams.ClientProto)
<mask> assert.Equal(t, tc.wantStatClient, st.lastEntry.Client)
<mask> assert.Equal(t, tc.wantStatResult, st.lastEntry.Result)
<mask> })
</s> Pull request: 3842 ptr filtering
Merge in DNS/adguard-home from 3842-fix-ptr-restrict to master
Updates #3842.
Squashed commit of the following:
commit 77bbec41c5238f8fcb0d2bb8d11910d1ac521fcd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 17:34:14 2021 +0300
dnsforward: imp docs
commit c637276b5a53f5301387b7dc3035e265d0bc9418
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Mon Nov 15 15:41:39 2021 +0300
dnsforward: fix local ptr blocking </s> remove
ql := &testQueryLog{}
st := &testStats{}
</s> add </s> remove srv: &Server{
queryLog: ql,
stats: st,
},
</s> add </s> remove // Disable redundant filtering.
filterSetts := s.getClientRequestFilteringSettings(ctx)
filterSetts.ParentalEnabled = false
filterSetts.SafeBrowsingEnabled = false
filterSetts.SafeSearchEnabled = false
filterSetts.ServicesRules = nil
ctx.setts = filterSetts
</s> add // There is no need to filter request from external addresses since this
// code is only executed when the request is for locally-served ARPA
// hostname so disable redundant filters.
ctx.setts.ParentalEnabled = false
ctx.setts.SafeBrowsingEnabled = false
ctx.setts.SafeSearchEnabled = false
ctx.setts.ServicesRules = nil </s> add ql := &testQueryLog{}
st := &testStats{}
srv := &Server{
queryLog: ql,
stats: st,
} </s> remove processDNSSECAfterResponse,
processFilteringAfterResponse,
</s> add s.processDNSSECAfterResponse,
s.processFilteringAfterResponse, </s> remove processQueryLogsAndStats,
</s> add s.processQueryLogsAndStats, | https://github.com/AdguardTeam/AdGuardHome/commit/9c8e087544d0497f1f4ec05d7fcabcb67c00ceff | internal/dnsforward/stats_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "os"
<mask> "strings"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/netutil"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghalg" </s> remove "os"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghnet/net_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> // testdata is the filesystem containing data for testing the package.
<mask> var testdata fs.FS = os.DirFS("./testdata")
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove // DiscardLogOutput runs tests with discarded logger output.
//
// TODO(a.garipov): Replace with testutil.
func DiscardLogOutput(m *testing.M) {
// TODO(e.burkov): Refactor code and tests to not use the global mutable
// logger.
log.SetOutput(io.Discard)
os.Exit(m.Run())
}
</s> add </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghnet/net_test.go |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> l, err := net.Listen("tcp", laddr.String())
<mask> require.NoError(t, err)
<mask> testutil.CleanupAndRequireSuccess(t, l.Close)
<mask>
<mask> addr := l.Addr()
<mask> require.IsType(t, new(net.TCPAddr), addr)
<mask>
<mask> ipp := addr.(*net.TCPAddr).AddrPort()
<mask> require.Equal(t, laddr.Addr(), ipp.Addr())
<mask> require.NotZero(t, ipp.Port())
<mask>
<mask> err = CheckPort("tcp", ipp)
<mask> target := &net.OpError{}
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove addr := conn.LocalAddr()
require.IsType(t, new(net.UDPAddr), addr)
ipp := addr.(*net.UDPAddr).AddrPort()
</s> add ipp := testutil.RequireTypeAssert[*net.UDPAddr](t, conn.LocalAddr()).AddrPort() </s> remove return sr.(*systemResolvers)
</s> add return testutil.RequireTypeAssert[*systemResolvers](t, sr) </s> remove ups := &aghtest.Upstream{
Reverse: map[string][]string{
"251.252.253.254.in-addr.arpa.": {"host1.example.net."},
"1.1.168.192.in-addr.arpa.": {"some.local-client."},
</s> add const (
extPTRQuestion = "251.252.253.254.in-addr.arpa."
extPTRAnswer = "host1.example.net."
intPTRQuestion = "1.1.168.192.in-addr.arpa."
intPTRAnswer = "some.local-client."
)
ups := &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, extPTRQuestion, extPTRAnswer),
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, intPTRQuestion, intPTRAnswer),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil </s> remove require.IsType(t, (*systemResolvers)(nil), sr)
</s> add </s> remove s := createTestServer(t, &filtering.Config{}, ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}},
}, &aghtest.Upstream{
Reverse: map[string][]string{
reqAddr: {locDomain},
</s> add s := createTestServer(
t,
&filtering.Config{},
ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}}, </s> remove })
</s> add &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, reqAddr, locDomain),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil
},
OnClose: func() (err error) { return nil },
},
) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghnet/net_test.go |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> conn, err := net.ListenPacket("udp", laddr.String())
<mask> require.NoError(t, err)
<mask> testutil.CleanupAndRequireSuccess(t, conn.Close)
<mask>
<mask> addr := conn.LocalAddr()
<mask> require.IsType(t, new(net.UDPAddr), addr)
<mask>
<mask> ipp := addr.(*net.UDPAddr).AddrPort()
<mask> require.Equal(t, laddr.Addr(), ipp.Addr())
<mask> require.NotZero(t, ipp.Port())
<mask>
<mask> err = CheckPort("udp", ipp)
<mask> target := &net.OpError{}
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove addr := l.Addr()
require.IsType(t, new(net.TCPAddr), addr)
ipp := addr.(*net.TCPAddr).AddrPort()
</s> add ipp := testutil.RequireTypeAssert[*net.TCPAddr](t, l.Addr()).AddrPort() </s> remove return sr.(*systemResolvers)
</s> add return testutil.RequireTypeAssert[*systemResolvers](t, sr) </s> remove ups := &aghtest.Upstream{
Reverse: map[string][]string{
"251.252.253.254.in-addr.arpa.": {"host1.example.net."},
"1.1.168.192.in-addr.arpa.": {"some.local-client."},
</s> add const (
extPTRQuestion = "251.252.253.254.in-addr.arpa."
extPTRAnswer = "host1.example.net."
intPTRQuestion = "1.1.168.192.in-addr.arpa."
intPTRAnswer = "some.local-client."
)
ups := &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, extPTRQuestion, extPTRAnswer),
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, intPTRQuestion, intPTRAnswer),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil </s> remove require.IsType(t, (*systemResolvers)(nil), sr)
</s> add </s> remove s := createTestServer(t, &filtering.Config{}, ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}},
}, &aghtest.Upstream{
Reverse: map[string][]string{
reqAddr: {locDomain},
</s> add s := createTestServer(
t,
&filtering.Config{},
ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}}, </s> remove })
</s> add &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, reqAddr, locDomain),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil
},
OnClose: func() (err error) { return nil },
},
) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghnet/net_test.go |
keep keep keep add keep keep keep keep keep | <mask> import (
<mask> "context"
<mask> "testing"
<mask>
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func createTestSystemResolversImpl(
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "os"
</s> add </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghnet/systemresolvers_others_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> ) (imp *systemResolvers) {
<mask> t.Helper()
<mask>
<mask> sr := createTestSystemResolvers(t, hostGenFunc)
<mask> require.IsType(t, (*systemResolvers)(nil), sr)
<mask>
<mask> return sr.(*systemResolvers)
<mask> }
<mask>
<mask> func TestSystemResolvers_Refresh(t *testing.T) {
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove return sr.(*systemResolvers)
</s> add return testutil.RequireTypeAssert[*systemResolvers](t, sr) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove ups := &aghtest.Upstream{
Reverse: map[string][]string{
"251.252.253.254.in-addr.arpa.": {"host1.example.net."},
"1.1.168.192.in-addr.arpa.": {"some.local-client."},
</s> add const (
extPTRQuestion = "251.252.253.254.in-addr.arpa."
extPTRAnswer = "host1.example.net."
intPTRQuestion = "1.1.168.192.in-addr.arpa."
intPTRAnswer = "some.local-client."
)
ups := &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, extPTRQuestion, extPTRAnswer),
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, intPTRQuestion, intPTRAnswer),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> add OnClose: func() (err error) { return nil }, | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghnet/systemresolvers_others_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> sr := createTestSystemResolvers(t, hostGenFunc)
<mask> require.IsType(t, (*systemResolvers)(nil), sr)
<mask>
<mask> return sr.(*systemResolvers)
<mask> }
<mask>
<mask> func TestSystemResolvers_Refresh(t *testing.T) {
<mask> t.Run("expected_error", func(t *testing.T) {
<mask> sr := createTestSystemResolvers(t, nil)
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove require.IsType(t, (*systemResolvers)(nil), sr)
</s> add </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove ups := &aghtest.Upstream{
Reverse: map[string][]string{
"251.252.253.254.in-addr.arpa.": {"host1.example.net."},
"1.1.168.192.in-addr.arpa.": {"some.local-client."},
</s> add const (
extPTRQuestion = "251.252.253.254.in-addr.arpa."
extPTRAnswer = "host1.example.net."
intPTRQuestion = "1.1.168.192.in-addr.arpa."
intPTRAnswer = "some.local-client."
)
ups := &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, extPTRQuestion, extPTRAnswer),
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, intPTRQuestion, intPTRAnswer),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil </s> add OnClose: func() (err error) { return nil }, </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove s := createTestServer(t, &filtering.Config{}, ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}},
}, &aghtest.Upstream{
Reverse: map[string][]string{
reqAddr: {locDomain},
</s> add s := createTestServer(
t,
&filtering.Config{},
ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}}, | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghnet/systemresolvers_others_test.go |
keep keep keep replace keep keep keep replace | <mask> import (
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "os"
</s> add </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghos/aghos_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> package aghtest
<mask>
<mask> import (
<mask> "io"
<mask> "os"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghtest/aghtest.go |
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep | <mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> // DiscardLogOutput runs tests with discarded logger output.
<mask> //
<mask> // TODO(a.garipov): Replace with testutil.
<mask> func DiscardLogOutput(m *testing.M) {
<mask> // TODO(e.burkov): Refactor code and tests to not use the global mutable
<mask> // logger.
<mask> log.SetOutput(io.Discard)
<mask>
<mask> os.Exit(m.Run())
<mask> }
<mask>
<mask> // ReplaceLogWriter moves logger output to w and uses Cleanup method of t to
<mask> // revert changes.
<mask> func ReplaceLogWriter(t testing.TB, w io.Writer) {
<mask> t.Helper()
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghtest/aghtest.go |
keep keep keep keep replace keep keep keep keep keep | <mask> import (
<mask> "crypto/tls"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtls"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
<mask> )
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "os"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghtls/aghtls_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "github.com/stretchr/testify/assert"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> func TestParseCiphers(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove require.IsType(t, (*systemResolvers)(nil), sr)
</s> add </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove return sr.(*systemResolvers)
</s> add return testutil.RequireTypeAssert[*systemResolvers](t, sr) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/aghtls/aghtls_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "os"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> "golang.org/x/exp/slices"
<mask> )
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "os"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/dhcpd/dhcpd_unix_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "golang.org/x/exp/slices"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> func testNotify(flags uint32) {
<mask> }
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/dhcpd/dhcpd_unix_test.go |
keep keep keep add keep keep keep keep keep keep | <mask> "net"
<mask> "net/netip"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/netutil"
<mask> "github.com/AdguardTeam/golibs/testutil"
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/dnsforward/dns_test.go |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> }
<mask> }
<mask>
<mask> func TestServer_ProcessRestrictLocal(t *testing.T) {
<mask> ups := &aghtest.Upstream{
<mask> Reverse: map[string][]string{
<mask> "251.252.253.254.in-addr.arpa.": {"host1.example.net."},
<mask> "1.1.168.192.in-addr.arpa.": {"some.local-client."},
<mask> },
<mask> }
<mask> s := createTestServer(t, &filtering.Config{}, ServerConfig{
<mask> UDPListenAddrs: []*net.UDPAddr{{}},
<mask> TCPListenAddrs: []*net.TCPAddr{{}},
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove s := createTestServer(t, &filtering.Config{}, ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}},
}, &aghtest.Upstream{
Reverse: map[string][]string{
reqAddr: {locDomain},
</s> add s := createTestServer(
t,
&filtering.Config{},
ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}}, </s> add OnClose: func() (err error) { return nil }, </s> remove })
</s> add &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, reqAddr, locDomain),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil
},
OnClose: func() (err error) { return nil },
},
) </s> remove return sr.(*systemResolvers)
</s> add return testutil.RequireTypeAssert[*systemResolvers](t, sr) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove require.IsType(t, (*systemResolvers)(nil), sr)
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/dnsforward/dns_test.go |
keep add keep keep keep keep | <mask> return resp, nil
<mask> },
<mask> }
<mask>
<mask> s := createTestServer(t, &filtering.Config{}, ServerConfig{
<mask> UDPListenAddrs: []*net.UDPAddr{{}},
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove s := createTestServer(t, &filtering.Config{}, ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}},
}, &aghtest.Upstream{
Reverse: map[string][]string{
reqAddr: {locDomain},
</s> add s := createTestServer(
t,
&filtering.Config{},
ServerConfig{
UDPListenAddrs: []*net.UDPAddr{{}},
TCPListenAddrs: []*net.TCPAddr{{}}, </s> remove ups := &aghtest.Upstream{
Reverse: map[string][]string{
"251.252.253.254.in-addr.arpa.": {"host1.example.net."},
"1.1.168.192.in-addr.arpa.": {"some.local-client."},
</s> add const (
extPTRQuestion = "251.252.253.254.in-addr.arpa."
extPTRAnswer = "host1.example.net."
intPTRQuestion = "1.1.168.192.in-addr.arpa."
intPTRAnswer = "some.local-client."
)
ups := &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, extPTRQuestion, extPTRAnswer),
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, intPTRQuestion, intPTRAnswer),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil </s> remove })
</s> add &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, reqAddr, locDomain),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil
},
OnClose: func() (err error) { return nil },
},
) </s> remove return sr.(*systemResolvers)
</s> add return testutil.RequireTypeAssert[*systemResolvers](t, sr) </s> remove require.IsType(t, (*systemResolvers)(nil), sr)
</s> add </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/dnsforward/dns_test.go |
keep replace replace replace replace replace replace keep replace keep keep keep | <mask>
<mask> s := createTestServer(t, &filtering.Config{}, ServerConfig{
<mask> UDPListenAddrs: []*net.UDPAddr{{}},
<mask> TCPListenAddrs: []*net.TCPAddr{{}},
<mask> }, &aghtest.Upstream{
<mask> Reverse: map[string][]string{
<mask> reqAddr: {locDomain},
<mask> },
<mask> })
<mask>
<mask> var proxyCtx *proxy.DNSContext
<mask> var dnsCtx *dnsContext
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> add OnClose: func() (err error) { return nil }, </s> remove ups := &aghtest.Upstream{
Reverse: map[string][]string{
"251.252.253.254.in-addr.arpa.": {"host1.example.net."},
"1.1.168.192.in-addr.arpa.": {"some.local-client."},
</s> add const (
extPTRQuestion = "251.252.253.254.in-addr.arpa."
extPTRAnswer = "host1.example.net."
intPTRQuestion = "1.1.168.192.in-addr.arpa."
intPTRAnswer = "some.local-client."
)
ups := &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, extPTRQuestion, extPTRAnswer),
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, intPTRQuestion, intPTRAnswer),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove addr := l.Addr()
require.IsType(t, new(net.TCPAddr), addr)
ipp := addr.(*net.TCPAddr).AddrPort()
</s> add ipp := testutil.RequireTypeAssert[*net.TCPAddr](t, l.Addr()).AddrPort() </s> remove addr := conn.LocalAddr()
require.IsType(t, new(net.UDPAddr), addr)
ipp := addr.(*net.UDPAddr).AddrPort()
</s> add ipp := testutil.RequireTypeAssert[*net.UDPAddr](t, conn.LocalAddr()).AddrPort() | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/dnsforward/dns_test.go |
keep add keep keep keep keep keep | <mask> "github.com/AdguardTeam/golibs/cache"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/urlfilter/rules"
<mask> "github.com/miekg/dns"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> add "github.com/AdguardTeam/golibs/testutil" </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "os"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/filtering/filtering_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> const (
<mask> sbBlocked = "wmconvirus.narod.ru"
<mask> pcBlocked = "pornhub.com"
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove ups := &aghtest.Upstream{
Reverse: map[string][]string{
"251.252.253.254.in-addr.arpa.": {"host1.example.net."},
"1.1.168.192.in-addr.arpa.": {"some.local-client."},
</s> add const (
extPTRQuestion = "251.252.253.254.in-addr.arpa."
extPTRAnswer = "host1.example.net."
intPTRQuestion = "1.1.168.192.in-addr.arpa."
intPTRAnswer = "some.local-client."
)
ups := &aghtest.UpstreamMock{
OnAddress: func() (addr string) { return "upstream.example" },
OnExchange: func(req *dns.Msg) (resp *dns.Msg, err error) {
resp = aghalg.Coalesce(
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, extPTRQuestion, extPTRAnswer),
aghtest.RespondTo(t, req, dns.ClassINET, dns.TypePTR, intPTRQuestion, intPTRAnswer),
new(dns.Msg).SetRcode(req, dns.RcodeNameError),
)
return resp, nil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/filtering/filtering_test.go |
keep replace keep keep keep replace keep | <mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> initCmdLineOpts()
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add "github.com/AdguardTeam/golibs/testutil" </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/home/home_test.go |
keep add keep keep keep keep | <mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/miekg/dns"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> add "github.com/AdguardTeam/golibs/testutil" </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghalg" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/next/dnssvc/dnssvc_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> // testTimeout is the common timeout for tests.
<mask> const testTimeout = 100 * time.Millisecond
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/next/dnssvc/dnssvc_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "net/url"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/agh"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/dnssvc"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/next/websvc"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/next/websvc/websvc_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> // testTimeout is the common timeout for tests.
<mask> const testTimeout = 1 * time.Second
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/next/websvc/websvc_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "sort"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxyutil"
<mask> "github.com/AdguardTeam/golibs/timeutil"
<mask> "github.com/miekg/dns"
<mask> "github.com/stretchr/testify/assert"
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghalg" </s> add "github.com/AdguardTeam/golibs/testutil" </s> add "github.com/AdguardTeam/golibs/testutil" | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/querylog/qlog_test.go |
keep keep keep add keep keep keep keep keep keep | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxyutil"
<mask> "github.com/AdguardTeam/golibs/timeutil"
<mask> "github.com/miekg/dns"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghalg" | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/querylog/qlog_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> // TestQueryLog tests adding and loading (with filtering) entries from disk and
<mask> // memory.
<mask> func TestQueryLog(t *testing.T) {
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove // DiscardLogOutput runs tests with discarded logger output.
//
// TODO(a.garipov): Replace with testutil.
func DiscardLogOutput(m *testing.M) {
// TODO(e.burkov): Refactor code and tests to not use the global mutable
// logger.
log.SetOutput(io.Discard)
os.Exit(m.Run())
}
</s> add </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/querylog/qlog_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "path/filepath"
<mask> "sync/atomic"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/stats"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/stats/stats_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> // constUnitID is the UnitIDGenFunc which always return 0.
<mask> func constUnitID() (id uint32) { return 0 }
<mask>
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove require.IsType(t, (*systemResolvers)(nil), sr)
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/stats/stats_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "strconv"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghalg"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/version"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghalg" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> add "github.com/AdguardTeam/golibs/testutil" | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/updater/updater_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // TODO(a.garipov): Rewrite these tests.
<mask>
<mask> func TestMain(m *testing.M) {
<mask> aghtest.DiscardLogOutput(m)
<mask> }
<mask>
<mask> func startHTTPServer(data string) (l net.Listener, portStr string) {
<mask> mux := http.NewServeMux()
<mask> mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) {
</s> Pull request: imp-tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit ea5b4e7a93359ae4800f75e77d02944a4f5d2df8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Oct 27 15:12:45 2022 +0300
all: imp tests, use testutil </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) </s> remove aghtest.DiscardLogOutput(m)
</s> add testutil.DiscardLogOutput(m) | https://github.com/AdguardTeam/AdGuardHome/commit/9c9d6b48e36976c5a226e337d459d3529d49c549 | internal/updater/updater_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> };
<mask> }
<mask>
<mask> return {
<mask> identifier: 'ip',
<mask> use_global_settings: true,
<mask> };
<mask> };
<mask>
<mask> getStats = (ip, stats) => {
</s> * client: show MAC address as default </s> remove if (row.value) {
</s> add if (row.original && row.original.mac) { </s> remove <span className="logs__text" title={row.original.mac}>
{row.original.mac} <em>(MAC)</em>
</s> add <span className="logs__text" title={row.value}>
{row.value} <em>(IP)</em> </s> remove } else if (row.original && row.original.mac) {
</s> add } else if (row.value) { </s> remove <span className="logs__text" title={row.value}>
{row.value} <em>(IP)</em>
</s> add <span className="logs__text" title={row.original.mac}>
{row.original.mac} <em>(MAC)</em> | https://github.com/AdguardTeam/AdGuardHome/commit/9cc824d8526bfc6e7b1c5fe2c81fc75a04678d92 | client/src/components/Settings/Clients/index.js |
keep keep keep keep replace keep keep replace replace keep | <mask> {
<mask> Header: this.props.t('table_client'),
<mask> accessor: 'ip',
<mask> Cell: (row) => {
<mask> if (row.value) {
<mask> return (
<mask> <div className="logs__row logs__row--overflow">
<mask> <span className="logs__text" title={row.value}>
<mask> {row.value} <em>(IP)</em>
<mask> </span>
</s> * client: show MAC address as default </s> remove identifier: 'ip',
</s> add identifier: CLIENT_ID.IP, </s> remove <span className="logs__text" title={row.original.mac}>
{row.original.mac} <em>(MAC)</em>
</s> add <span className="logs__text" title={row.value}>
{row.value} <em>(IP)</em> </s> remove } else if (row.original && row.original.mac) {
</s> add } else if (row.value) { | https://github.com/AdguardTeam/AdGuardHome/commit/9cc824d8526bfc6e7b1c5fe2c81fc75a04678d92 | client/src/components/Settings/Clients/index.js |
keep keep keep keep replace keep keep replace replace | <mask> {row.value} <em>(IP)</em>
<mask> </span>
<mask> </div>
<mask> );
<mask> } else if (row.original && row.original.mac) {
<mask> return (
<mask> <div className="logs__row logs__row--overflow">
<mask> <span className="logs__text" title={row.original.mac}>
<mask> {row.original.mac} <em>(MAC)</em>
</s> * client: show MAC address as default </s> remove identifier: 'ip',
</s> add identifier: CLIENT_ID.IP, </s> remove if (row.value) {
</s> add if (row.original && row.original.mac) { </s> remove <span className="logs__text" title={row.value}>
{row.value} <em>(IP)</em>
</s> add <span className="logs__text" title={row.original.mac}>
{row.original.mac} <em>(MAC)</em> | https://github.com/AdguardTeam/AdGuardHome/commit/9cc824d8526bfc6e7b1c5fe2c81fc75a04678d92 | client/src/components/Settings/Clients/index.js |
keep keep add keep keep keep keep | <mask> package main
<mask>
<mask> import (
<mask> "fmt"
<mask> "log"
<mask> "net"
<mask> "net/http"
</s> If running from terminal, ask for username/password if config file does not exists </s> remove err := parseConfig()
</s> add err = parseConfig() </s> add err := askUsernamePasswordIfPossible()
if err != nil {
log.Fatal(err)
}
</s> add "golang.org/x/crypto/ssh/terminal" | https://github.com/AdguardTeam/AdGuardHome/commit/9d030f38b7cd77d2e293ef667cbc927f5b79d2f2 | app.go |
keep keep add keep keep keep keep keep keep | <mask> "strconv"
<mask>
<mask> "github.com/gobuffalo/packr"
<mask> )
<mask>
<mask> // VersionString will be set through ldflags, contains current version
<mask> var VersionString = "undefined"
<mask>
<mask> func main() {
</s> If running from terminal, ask for username/password if config file does not exists </s> remove err := parseConfig()
</s> add err = parseConfig() </s> add err := askUsernamePasswordIfPossible()
if err != nil {
log.Fatal(err)
}
</s> add "bufio" | https://github.com/AdguardTeam/AdGuardHome/commit/9d030f38b7cd77d2e293ef667cbc927f5b79d2f2 | app.go |
keep add keep keep keep keep keep keep | <mask> config.ourConfigFilename = *configFilename
<mask> }
<mask> // parse from config file
<mask> err = parseConfig()
<mask> if err != nil {
<mask> log.Fatal(err)
<mask> }
<mask> if bindHost != nil {
</s> If running from terminal, ask for username/password if config file does not exists </s> remove err := parseConfig()
</s> add err = parseConfig() </s> add "golang.org/x/crypto/ssh/terminal" </s> add "bufio" | https://github.com/AdguardTeam/AdGuardHome/commit/9d030f38b7cd77d2e293ef667cbc927f5b79d2f2 | app.go |
keep keep keep keep replace keep keep keep keep keep | <mask> if configFilename != nil {
<mask> config.ourConfigFilename = *configFilename
<mask> }
<mask> // parse from config file
<mask> err := parseConfig()
<mask> if err != nil {
<mask> log.Fatal(err)
<mask> }
<mask> if bindHost != nil {
<mask> config.BindHost = *bindHost
</s> If running from terminal, ask for username/password if config file does not exists </s> add err := askUsernamePasswordIfPossible()
if err != nil {
log.Fatal(err)
}
</s> add "golang.org/x/crypto/ssh/terminal" </s> add "bufio" | https://github.com/AdguardTeam/AdGuardHome/commit/9d030f38b7cd77d2e293ef667cbc927f5b79d2f2 | app.go |
keep add keep keep keep keep keep | <mask> "log"
<mask> "math/rand"
<mask> "net/http"
<mask> "net/url"
<mask> "strings"
<mask> "sync"
<mask> "time"
</s> dnsforward -- if given addresses without ports, assign default ports </s> add _, _, err := net.SplitHostPort(address)
if err != nil {
// doesn't have port, default to 53
address = net.JoinHostPort(address, "53")
} </s> remove return &plainDNS{Address: address}, nil
</s> add // assume it's plain DNS
if url.Port() == "" {
url.Host += ":53"
}
return &plainDNS{Address: url.String()}, nil </s> remove return &dnsOverHTTPS{Address: address}, nil
</s> add return &dnsOverHTTPS{Address: url.String()}, nil </s> remove return &dnsOverTLS{Address: address}, nil
</s> add if url.Port() == "" {
url.Host += ":853"
}
return &dnsOverTLS{Address: url.String()}, nil </s> remove return &plainDNS{Address: address}, nil
</s> add if url.Port() == "" {
url.Host += ":53"
}
return &plainDNS{Address: url.String()}, nil | https://github.com/AdguardTeam/AdGuardHome/commit/9d87ae95e60756588b66172052125a5b63c8c292 | dnsforward/upstream.go |
keep keep keep keep replace keep replace keep | <mask> return nil, errorx.Decorate(err, "Failed to parse %s", address)
<mask> }
<mask> switch url.Scheme {
<mask> case "dns":
<mask> return &plainDNS{Address: address}, nil
<mask> case "tls":
<mask> return &dnsOverTLS{Address: address}, nil
<mask> case "https":
</s> dnsforward -- if given addresses without ports, assign default ports </s> remove return &dnsOverHTTPS{Address: address}, nil
</s> add return &dnsOverHTTPS{Address: url.String()}, nil </s> remove return &plainDNS{Address: address}, nil
</s> add // assume it's plain DNS
if url.Port() == "" {
url.Host += ":53"
}
return &plainDNS{Address: url.String()}, nil </s> add _, _, err := net.SplitHostPort(address)
if err != nil {
// doesn't have port, default to 53
address = net.JoinHostPort(address, "53")
} </s> add "net" | https://github.com/AdguardTeam/AdGuardHome/commit/9d87ae95e60756588b66172052125a5b63c8c292 | dnsforward/upstream.go |
keep replace keep replace | <mask> case "https":
<mask> return &dnsOverHTTPS{Address: address}, nil
<mask> default:
<mask> return &plainDNS{Address: address}, nil
</s> dnsforward -- if given addresses without ports, assign default ports </s> remove return &dnsOverTLS{Address: address}, nil
</s> add if url.Port() == "" {
url.Host += ":853"
}
return &dnsOverTLS{Address: url.String()}, nil </s> remove return &plainDNS{Address: address}, nil
</s> add if url.Port() == "" {
url.Host += ":53"
}
return &plainDNS{Address: url.String()}, nil </s> add _, _, err := net.SplitHostPort(address)
if err != nil {
// doesn't have port, default to 53
address = net.JoinHostPort(address, "53")
} </s> add "net" | https://github.com/AdguardTeam/AdGuardHome/commit/9d87ae95e60756588b66172052125a5b63c8c292 | dnsforward/upstream.go |
keep add keep keep | <mask>
<mask> // we don't have scheme in the url, so it's just a plain DNS host:port
<mask> return &plainDNS{Address: address}, nil
<mask> }
</s> dnsforward -- if given addresses without ports, assign default ports </s> remove return &plainDNS{Address: address}, nil
</s> add // assume it's plain DNS
if url.Port() == "" {
url.Host += ":53"
}
return &plainDNS{Address: url.String()}, nil </s> remove return &dnsOverHTTPS{Address: address}, nil
</s> add return &dnsOverHTTPS{Address: url.String()}, nil </s> remove return &dnsOverTLS{Address: address}, nil
</s> add if url.Port() == "" {
url.Host += ":853"
}
return &dnsOverTLS{Address: url.String()}, nil </s> remove return &plainDNS{Address: address}, nil
</s> add if url.Port() == "" {
url.Host += ":53"
}
return &plainDNS{Address: url.String()}, nil </s> add "net" | https://github.com/AdguardTeam/AdGuardHome/commit/9d87ae95e60756588b66172052125a5b63c8c292 | dnsforward/upstream.go |
keep keep keep keep replace keep keep keep keep keep | <mask> DEFAULT_SHORT_DATE_FORMAT_OPTIONS,
<mask> LONG_TIME_FORMAT,
<mask> SCHEME_TO_PROTOCOL_MAP,
<mask> } from '../../../helpers/constants';
<mask> import { formatDateTime, formatTime } from '../../../helpers/helpers';
<mask>
<mask> const getDomainCell = (props) => {
<mask> const {
<mask> row, t, isDetailed, dnssec_enabled,
<mask> } = props;
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> add import { getSourceData } from '../../helpers/trackers/trackers'; </s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> add captitalizeWords, </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> add const sourceData = getSourceData(tracker);
| https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Cells/getDomainCell.js |
keep keep keep keep replace replace keep keep keep keep keep | <mask> } = row.original;
<mask>
<mask> const hasTracker = !!tracker;
<mask>
<mask> const source = tracker && tracker.sourceData && tracker.sourceData.name;
<mask>
<mask> const lockIconClass = classNames('icons', 'icon--small', 'd-none', 'd-sm-block', 'cursor--pointer', {
<mask> 'icon--active': answer_dnssec,
<mask> 'icon--disabled': !answer_dnssec,
<mask> 'my-3': isDetailed,
<mask> });
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> remove import { formatDateTime, formatTime } from '../../../helpers/helpers';
</s> add import { captitalizeWords, formatDateTime, formatTime } from '../../../helpers/helpers';
import { getSourceData } from '../../../helpers/trackers/trackers'; </s> add const sourceData = getSourceData(tracker);
</s> add import { getSourceData } from '../../helpers/trackers/trackers'; </s> add const sourceData = getSourceData(tracker);
| https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Cells/getDomainCell.js |
keep add keep keep keep keep keep keep | <mask> };
<mask>
<mask> const knownTrackerDataObj = {
<mask> name_table_header: tracker && tracker.name,
<mask> category_label: tracker && captitalizeWords(tracker.category),
<mask> source_label: sourceData
<mask> && <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
<mask> className="link--green">{sourceData.name}</a>,
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> remove category_label: hasTracker && tracker.category,
source_label: hasTracker && source
&& <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: hasTracker && captitalizeWords(tracker.category),
source_label: hasTracker && sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> remove category_label: hasTracker && tracker.category,
tracker_source: hasTracker && tracker_source && <a href={`//${source}`}
className="link--green">{tracker_source}</a>,
</s> add category_label: hasTracker && captitalizeWords(tracker.category),
tracker_source: hasTracker && sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> add const sourceData = getSourceData(tracker);
| https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Cells/getDomainCell.js |
keep keep keep keep replace replace keep keep keep keep keep | <mask> };
<mask>
<mask> const knownTrackerDataObj = {
<mask> name_table_header: tracker && tracker.name,
<mask> category_label: tracker && tracker.category,
<mask> source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
<mask> };
<mask>
<mask> const renderGrid = (content, idx) => {
<mask> const preparedContent = typeof content === 'string' ? t(content) : content;
<mask> const className = classNames('text-truncate key-colon o-hidden', {
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> add const sourceData = getSourceData(tracker);
</s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> remove <div key={`${title}-1`} className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>,
</s> add <div key={`${title}-1`}
className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>, </s> remove category_label: hasTracker && tracker.category,
source_label: hasTracker && source
&& <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: hasTracker && captitalizeWords(tracker.category),
source_label: hasTracker && sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> add const sourceData = getSourceData(tracker);
| https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Cells/getDomainCell.js |
keep keep keep keep replace keep keep keep keep keep | <mask> };
<mask>
<mask> const getGrid = (contentObj, title, className) => [
<mask> <div key={title} className={classNames('pb-2 grid--title', className)}>{t(title)}</div>,
<mask> <div key={`${title}-1`} className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>,
<mask> ];
<mask>
<mask> const requestDetails = getGrid(requestDetailsObj, 'request_details');
<mask>
<mask> const renderContent = hasTracker ? requestDetails.concat(getGrid(knownTrackerDataObj, 'known_tracker', 'pt-4')) : requestDetails;
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> add const sourceData = getSourceData(tracker);
</s> add const sourceData = getSourceData(tracker);
</s> add import { getSourceData } from '../../helpers/trackers/trackers'; | https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Cells/getDomainCell.js |
keep keep add keep keep keep keep | <mask> import getResponseCell from './Cells/getResponseCell';
<mask>
<mask> import {
<mask> checkFiltered,
<mask> formatDateTime,
<mask> formatElapsedMs,
<mask> formatTime,
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> remove import { formatDateTime, formatTime } from '../../../helpers/helpers';
</s> add import { captitalizeWords, formatDateTime, formatTime } from '../../../helpers/helpers';
import { getSourceData } from '../../../helpers/trackers/trackers'; </s> add import { getSourceData } from '../../helpers/trackers/trackers'; </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> add const sourceData = getSourceData(tracker);
</s> add const sourceData = getSourceData(tracker);
</s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Table.js |
keep add keep keep keep keep keep | <mask> } from '../../helpers/helpers';
<mask> import Loading from '../ui/Loading';
<mask>
<mask> const Table = (props) => {
<mask> const {
<mask> setDetailedDataCurrent,
<mask> setButtonType,
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> remove import { formatDateTime, formatTime } from '../../../helpers/helpers';
</s> add import { captitalizeWords, formatDateTime, formatTime } from '../../../helpers/helpers';
import { getSourceData } from '../../../helpers/trackers/trackers'; </s> add captitalizeWords, </s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> add const sourceData = getSourceData(tracker);
| https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Table.js |
keep keep keep keep replace replace replace keep keep keep keep keep | <mask> const onToggleBlock = () => {
<mask> toggleBlocking(buttonType, domain);
<mask> };
<mask>
<mask> const tracker_source = tracker && tracker.sourceData
<mask> && tracker.sourceData.name;
<mask>
<mask> const status = t((FILTERED_STATUS_TO_META_MAP[reason]
<mask> && FILTERED_STATUS_TO_META_MAP[reason].label) || reason);
<mask> const statusBlocked = <div className="bg--danger">{status}</div>;
<mask>
<mask> const protocol = t(SCHEME_TO_PROTOCOL_MAP[client_proto]) || '';
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> add const sourceData = getSourceData(tracker);
</s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> add const sourceData = getSourceData(tracker);
</s> remove <div key={`${title}-1`} className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>,
</s> add <div key={`${title}-1`}
className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>, </s> add import { getSourceData } from '../../helpers/trackers/trackers'; | https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Table.js |
keep keep add keep keep keep keep | <mask>
<mask> const protocol = t(SCHEME_TO_PROTOCOL_MAP[client_proto]) || '';
<mask>
<mask> const detailedData = {
<mask> time_table_header: formatTime(time, LONG_TIME_FORMAT),
<mask> date: formatDateTime(time, DEFAULT_SHORT_DATE_FORMAT_OPTIONS),
<mask> encryption_status: status,
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> add import { getSourceData } from '../../helpers/trackers/trackers'; </s> add const sourceData = getSourceData(tracker);
</s> remove import { formatDateTime, formatTime } from '../../../helpers/helpers';
</s> add import { captitalizeWords, formatDateTime, formatTime } from '../../../helpers/helpers';
import { getSourceData } from '../../../helpers/trackers/trackers'; | https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Table.js |
keep keep keep keep replace replace replace keep keep keep keep keep | <mask> type_table_header: type,
<mask> protocol,
<mask> known_tracker: hasTracker && 'title',
<mask> table_name: hasTracker && tracker.name,
<mask> category_label: hasTracker && tracker.category,
<mask> tracker_source: hasTracker && tracker_source && <a href={`//${source}`}
<mask> className="link--green">{tracker_source}</a>,
<mask> response_details: 'title',
<mask> install_settings_dns: upstream,
<mask> elapsed: formattedElapsedMs,
<mask> response_table_header: response && response.join('\n'),
<mask> client_details: 'title',
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> remove category_label: hasTracker && tracker.category,
source_label: hasTracker && source
&& <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: hasTracker && captitalizeWords(tracker.category),
source_label: hasTracker && sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> add const sourceData = getSourceData(tracker);
</s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> remove <div key={`${title}-1`} className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>,
</s> add <div key={`${title}-1`}
className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>, | https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Table.js |
keep keep keep keep replace replace replace keep keep keep keep keep | <mask> type_table_header: type,
<mask> protocol,
<mask> known_tracker: 'title',
<mask> table_name: hasTracker && tracker.name,
<mask> category_label: hasTracker && tracker.category,
<mask> source_label: hasTracker && source
<mask> && <a href={`//${source}`} className="link--green">{source}</a>,
<mask> response_details: 'title',
<mask> install_settings_dns: upstream,
<mask> elapsed: formattedElapsedMs,
<mask> response_table_header: response && response.join('\n'),
<mask> [buttonType]: <div onClick={onToggleBlock}
</s> - client: Fix client tracker source links
Close #1813
Squashed commit of the following:
commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3
Merge: e9f2e08b 9640752d
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:55:46 2020 +0300
Merge branch 'master' into fix/1813
commit e9f2e08b608ad14e5b327ab86d8faa66784bae44
Merge: ecee0977 f5a1f311
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:49:52 2020 +0300
Merge branch 'master' into fix/1813
commit ecee0977ab5439d3be2a99447a771871f0340a2e
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Fri Jul 3 11:35:10 2020 +0300
Capitalize category names
commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Thu Jul 2 18:11:40 2020 +0300
- client: Fix client tracker source links </s> remove category_label: hasTracker && tracker.category,
tracker_source: hasTracker && tracker_source && <a href={`//${source}`}
className="link--green">{tracker_source}</a>,
</s> add category_label: hasTracker && captitalizeWords(tracker.category),
tracker_source: hasTracker && sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> remove category_label: tracker && tracker.category,
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
</s> add category_label: tracker && captitalizeWords(tracker.category),
source_label: sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, </s> add const sourceData = getSourceData(tracker);
</s> remove const source = tracker && tracker.sourceData && tracker.sourceData.name;
</s> add </s> remove const tracker_source = tracker && tracker.sourceData
&& tracker.sourceData.name;
</s> add </s> remove <div key={`${title}-1`} className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>,
</s> add <div key={`${title}-1`}
className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>, | https://github.com/AdguardTeam/AdGuardHome/commit/9df7aba9e187ff272445cfd248aa3bf70e580c63 | client/src/components/Logs/Table.js |
keep keep add keep keep keep keep keep | <mask> AAAADisabled bool `yaml:"aaaa_disabled"` // Respond with an empty answer to all AAAA requests
<mask> EnableDNSSEC bool `yaml:"enable_dnssec"` // Set DNSSEC flag in outcoming DNS request
<mask> EnableEDNSClientSubnet bool `yaml:"edns_client_subnet"` // Enable EDNS Client Subnet option
<mask> }
<mask>
<mask> // TLSConfig is the TLS configuration for HTTPS, DNS-over-HTTPS, and DNS-over-TLS
<mask> type TLSConfig struct {
<mask> TLSListenAddr *net.TCPAddr `yaml:"-" json:"-"`
</s> - dns: limit the number of active goroutines for incoming requests processing
Close #2015
Squashed commit of the following:
commit 90ba06f1fce22a452b4d61db62bd950b976debd1
Merge: 9494b29b 473d8818
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 19:14:26 2020 +0300
Merge remote-tracking branch 'origin/master' into max-go
commit 9494b29b65ae8fe593a487984bed051aa78e4ff9
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 17:03:00 2020 +0300
+ max_goroutines setting
commit 87071a5e0ed43be192a7755fb25764cd4519da5a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 15:29:00 2020 +0300
- dns: limit the number of active goroutines for incoming requests processing </s> add if s.conf.MaxGoroutines == 0 {
s.conf.MaxGoroutines = 50
} </s> add MaxGoroutines: int(s.conf.MaxGoroutines), | https://github.com/AdguardTeam/AdGuardHome/commit/9e09dffbc3509a3abcbb88f738f7a5264ea99675 | dnsforward/config.go |
keep add keep keep keep keep keep | <mask> RequestHandler: s.handleDNSRequest,
<mask> EnableEDNSClientSubnet: s.conf.EnableEDNSClientSubnet,
<mask> }
<mask>
<mask> if s.conf.CacheSize != 0 {
<mask> proxyConfig.CacheEnabled = true
<mask> proxyConfig.CacheSizeBytes = int(s.conf.CacheSize)
</s> - dns: limit the number of active goroutines for incoming requests processing
Close #2015
Squashed commit of the following:
commit 90ba06f1fce22a452b4d61db62bd950b976debd1
Merge: 9494b29b 473d8818
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 19:14:26 2020 +0300
Merge remote-tracking branch 'origin/master' into max-go
commit 9494b29b65ae8fe593a487984bed051aa78e4ff9
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 17:03:00 2020 +0300
+ max_goroutines setting
commit 87071a5e0ed43be192a7755fb25764cd4519da5a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 15:29:00 2020 +0300
- dns: limit the number of active goroutines for incoming requests processing </s> add if s.conf.MaxGoroutines == 0 {
s.conf.MaxGoroutines = 50
} </s> add MaxGoroutines uint32 `yaml:"max_goroutines"` // Max. number of parallel goroutines for processing incoming requests | https://github.com/AdguardTeam/AdGuardHome/commit/9e09dffbc3509a3abcbb88f738f7a5264ea99675 | dnsforward/config.go |
keep keep keep add keep keep keep keep | <mask> if s.conf.BlockingIPAddrv4 == nil || s.conf.BlockingIPAddrv6 == nil {
<mask> return fmt.Errorf("DNS: invalid custom blocking IP address specified")
<mask> }
<mask> }
<mask> }
<mask>
<mask> // 2. Set default values in the case if nothing is configured
<mask> // --
</s> - dns: limit the number of active goroutines for incoming requests processing
Close #2015
Squashed commit of the following:
commit 90ba06f1fce22a452b4d61db62bd950b976debd1
Merge: 9494b29b 473d8818
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 19:14:26 2020 +0300
Merge remote-tracking branch 'origin/master' into max-go
commit 9494b29b65ae8fe593a487984bed051aa78e4ff9
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 17:03:00 2020 +0300
+ max_goroutines setting
commit 87071a5e0ed43be192a7755fb25764cd4519da5a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Aug 14 15:29:00 2020 +0300
- dns: limit the number of active goroutines for incoming requests processing </s> add MaxGoroutines uint32 `yaml:"max_goroutines"` // Max. number of parallel goroutines for processing incoming requests </s> add MaxGoroutines: int(s.conf.MaxGoroutines), | https://github.com/AdguardTeam/AdGuardHome/commit/9e09dffbc3509a3abcbb88f738f7a5264ea99675 | dnsforward/dnsforward.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> return;
<mask> }
<mask>
<mask> const colorSchemeMedia = window.matchMedia('(prefers-color-scheme: dark)');
<mask> const prefersDark = colorSchemeMedia.matches;
<mask> setUITheme(prefersDark ? THEMES.dark : THEMES.light);
<mask>
<mask> if (colorSchemeMedia.addEventListener !== undefined) {
<mask> colorSchemeMedia.addEventListener('change', (e) => {
<mask> handleAutoTheme(e, theme);
<mask> });
</s> Pull request: fix missing icons on login page
Updates #5620
Squashed commit of the following:
commit 61969c83c3dd6bd6688f0aabc9d6160b53701866
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:50:47 2023 +0300
AG-20691 fix theme select on login page
commit c87b6c37284021f33f440dcd31be5b653e8e689d
Merge: aa744756 89bf3721
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:21:01 2023 +0300
Merge branch 'master' into AG-20691
commit aa744756d18d9ed3bc7f60108235d8403e7cb5e0
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Apr 7 15:53:38 2023 +0300
AG-20691 fix missing icons on login page </s> remove document.body.dataset.theme = theme;
</s> add let currentTheme = theme;
if (currentTheme === THEMES.auto) {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
currentTheme = prefersDark ? THEMES.dark : THEMES.light;
}
document.body.dataset.theme = currentTheme; </s> remove const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
</s> add const [currentThemeLocal, setCurrentThemeLocal] = useState(THEMES.auto); </s> remove const currentTheme = useSelector((state) => (state.dashboard ? state.dashboard.theme : 'auto'));
const profileName = useSelector((state) => (state.dashboard ? state.dashboard.name : ''));
</s> add const currentTheme = useSelector((state) => (
state.dashboard ? state.dashboard.theme : THEMES.auto
));
const profileName = useSelector((state) => (
state.dashboard ? state.dashboard.name : ''
)); </s> remove setUITheme(window.matchMedia('(prefers-color-scheme: dark)').matches ? THEMES.dark : THEMES.light);
</s> add setUITheme(currentThemeLocal); </s> add <Icons /> </s> add THEMES, | https://github.com/AdguardTeam/AdGuardHome/commit/9e14d5f99f453b8c376aba966f648012da258c72 | client/src/components/App/index.js |
keep keep keep keep replace replace keep keep keep keep keep | <mask> const Footer = () => {
<mask> const { t } = useTranslation();
<mask> const dispatch = useDispatch();
<mask>
<mask> const currentTheme = useSelector((state) => (state.dashboard ? state.dashboard.theme : 'auto'));
<mask> const profileName = useSelector((state) => (state.dashboard ? state.dashboard.name : ''));
<mask> const isLoggedIn = profileName !== '';
<mask> const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
<mask>
<mask> useEffect(() => {
<mask> if (!isLoggedIn) {
</s> Pull request: fix missing icons on login page
Updates #5620
Squashed commit of the following:
commit 61969c83c3dd6bd6688f0aabc9d6160b53701866
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:50:47 2023 +0300
AG-20691 fix theme select on login page
commit c87b6c37284021f33f440dcd31be5b653e8e689d
Merge: aa744756 89bf3721
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:21:01 2023 +0300
Merge branch 'master' into AG-20691
commit aa744756d18d9ed3bc7f60108235d8403e7cb5e0
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Apr 7 15:53:38 2023 +0300
AG-20691 fix missing icons on login page </s> remove const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
</s> add const [currentThemeLocal, setCurrentThemeLocal] = useState(THEMES.auto); </s> remove setUITheme(window.matchMedia('(prefers-color-scheme: dark)').matches ? THEMES.dark : THEMES.light);
</s> add setUITheme(currentThemeLocal); </s> remove const prefersDark = colorSchemeMedia.matches;
setUITheme(prefersDark ? THEMES.dark : THEMES.light);
</s> add setUITheme(theme); </s> remove document.body.dataset.theme = theme;
</s> add let currentTheme = theme;
if (currentTheme === THEMES.auto) {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
currentTheme = prefersDark ? THEMES.dark : THEMES.light;
}
document.body.dataset.theme = currentTheme; </s> add <Icons /> </s> add import Icons from '../../components/ui/Icons'; | https://github.com/AdguardTeam/AdGuardHome/commit/9e14d5f99f453b8c376aba966f648012da258c72 | client/src/components/ui/Footer.js |
keep keep keep keep replace keep keep keep replace | <mask>
<mask> const currentTheme = useSelector((state) => (state.dashboard ? state.dashboard.theme : 'auto'));
<mask> const profileName = useSelector((state) => (state.dashboard ? state.dashboard.name : ''));
<mask> const isLoggedIn = profileName !== '';
<mask> const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
<mask>
<mask> useEffect(() => {
<mask> if (!isLoggedIn) {
<mask> setUITheme(window.matchMedia('(prefers-color-scheme: dark)').matches ? THEMES.dark : THEMES.light);
</s> Pull request: fix missing icons on login page
Updates #5620
Squashed commit of the following:
commit 61969c83c3dd6bd6688f0aabc9d6160b53701866
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:50:47 2023 +0300
AG-20691 fix theme select on login page
commit c87b6c37284021f33f440dcd31be5b653e8e689d
Merge: aa744756 89bf3721
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:21:01 2023 +0300
Merge branch 'master' into AG-20691
commit aa744756d18d9ed3bc7f60108235d8403e7cb5e0
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Apr 7 15:53:38 2023 +0300
AG-20691 fix missing icons on login page </s> remove const currentTheme = useSelector((state) => (state.dashboard ? state.dashboard.theme : 'auto'));
const profileName = useSelector((state) => (state.dashboard ? state.dashboard.name : ''));
</s> add const currentTheme = useSelector((state) => (
state.dashboard ? state.dashboard.theme : THEMES.auto
));
const profileName = useSelector((state) => (
state.dashboard ? state.dashboard.name : ''
)); </s> remove const prefersDark = colorSchemeMedia.matches;
setUITheme(prefersDark ? THEMES.dark : THEMES.light);
</s> add setUITheme(theme); </s> remove document.body.dataset.theme = theme;
</s> add let currentTheme = theme;
if (currentTheme === THEMES.auto) {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
currentTheme = prefersDark ? THEMES.dark : THEMES.light;
}
document.body.dataset.theme = currentTheme; </s> add <Icons /> </s> add import Icons from '../../components/ui/Icons'; | https://github.com/AdguardTeam/AdGuardHome/commit/9e14d5f99f453b8c376aba966f648012da258c72 | client/src/components/ui/Footer.js |
keep add keep keep keep keep | <mask> STANDARD_WEB_PORT,
<mask> SPECIAL_FILTER_ID,
<mask> } from './constants';
<mask>
<mask> /**
<mask> * @param time {string} The time to format
</s> Pull request: fix missing icons on login page
Updates #5620
Squashed commit of the following:
commit 61969c83c3dd6bd6688f0aabc9d6160b53701866
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:50:47 2023 +0300
AG-20691 fix theme select on login page
commit c87b6c37284021f33f440dcd31be5b653e8e689d
Merge: aa744756 89bf3721
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:21:01 2023 +0300
Merge branch 'master' into AG-20691
commit aa744756d18d9ed3bc7f60108235d8403e7cb5e0
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Apr 7 15:53:38 2023 +0300
AG-20691 fix missing icons on login page </s> remove document.body.dataset.theme = theme;
</s> add let currentTheme = theme;
if (currentTheme === THEMES.auto) {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
currentTheme = prefersDark ? THEMES.dark : THEMES.light;
}
document.body.dataset.theme = currentTheme; </s> add import Icons from '../../components/ui/Icons'; </s> add <Icons /> </s> remove const prefersDark = colorSchemeMedia.matches;
setUITheme(prefersDark ? THEMES.dark : THEMES.light);
</s> add setUITheme(theme); </s> remove setUITheme(window.matchMedia('(prefers-color-scheme: dark)').matches ? THEMES.dark : THEMES.light);
</s> add setUITheme(currentThemeLocal); </s> remove const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
</s> add const [currentThemeLocal, setCurrentThemeLocal] = useState(THEMES.auto); | https://github.com/AdguardTeam/AdGuardHome/commit/9e14d5f99f453b8c376aba966f648012da258c72 | client/src/helpers/helpers.js |
keep keep keep keep replace keep keep keep keep keep | <mask> *
<mask> * @param theme
<mask> */
<mask> export const setUITheme = (theme) => {
<mask> document.body.dataset.theme = theme;
<mask> };
<mask>
<mask> /**
<mask> * @param values {object}
<mask> * @returns {object}
</s> Pull request: fix missing icons on login page
Updates #5620
Squashed commit of the following:
commit 61969c83c3dd6bd6688f0aabc9d6160b53701866
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:50:47 2023 +0300
AG-20691 fix theme select on login page
commit c87b6c37284021f33f440dcd31be5b653e8e689d
Merge: aa744756 89bf3721
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:21:01 2023 +0300
Merge branch 'master' into AG-20691
commit aa744756d18d9ed3bc7f60108235d8403e7cb5e0
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Apr 7 15:53:38 2023 +0300
AG-20691 fix missing icons on login page </s> add THEMES, </s> remove const currentTheme = useSelector((state) => (state.dashboard ? state.dashboard.theme : 'auto'));
const profileName = useSelector((state) => (state.dashboard ? state.dashboard.name : ''));
</s> add const currentTheme = useSelector((state) => (
state.dashboard ? state.dashboard.theme : THEMES.auto
));
const profileName = useSelector((state) => (
state.dashboard ? state.dashboard.name : ''
)); </s> remove setUITheme(window.matchMedia('(prefers-color-scheme: dark)').matches ? THEMES.dark : THEMES.light);
</s> add setUITheme(currentThemeLocal); </s> remove const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
</s> add const [currentThemeLocal, setCurrentThemeLocal] = useState(THEMES.auto); </s> remove const prefersDark = colorSchemeMedia.matches;
setUITheme(prefersDark ? THEMES.dark : THEMES.light);
</s> add setUITheme(theme); </s> add <Icons /> | https://github.com/AdguardTeam/AdGuardHome/commit/9e14d5f99f453b8c376aba966f648012da258c72 | client/src/helpers/helpers.js |
keep keep add keep keep keep keep | <mask> import logo from '../../components/ui/svg/logo.svg';
<mask> import Toasts from '../../components/Toasts';
<mask> import Footer from '../../components/ui/Footer';
<mask> import Form from './Form';
<mask>
<mask> import './Login.css';
<mask> import '../../components/ui/Tabler.css';
</s> Pull request: fix missing icons on login page
Updates #5620
Squashed commit of the following:
commit 61969c83c3dd6bd6688f0aabc9d6160b53701866
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:50:47 2023 +0300
AG-20691 fix theme select on login page
commit c87b6c37284021f33f440dcd31be5b653e8e689d
Merge: aa744756 89bf3721
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:21:01 2023 +0300
Merge branch 'master' into AG-20691
commit aa744756d18d9ed3bc7f60108235d8403e7cb5e0
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Apr 7 15:53:38 2023 +0300
AG-20691 fix missing icons on login page </s> add THEMES, </s> remove const currentTheme = useSelector((state) => (state.dashboard ? state.dashboard.theme : 'auto'));
const profileName = useSelector((state) => (state.dashboard ? state.dashboard.name : ''));
</s> add const currentTheme = useSelector((state) => (
state.dashboard ? state.dashboard.theme : THEMES.auto
));
const profileName = useSelector((state) => (
state.dashboard ? state.dashboard.name : ''
)); </s> add <Icons /> </s> remove document.body.dataset.theme = theme;
</s> add let currentTheme = theme;
if (currentTheme === THEMES.auto) {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
currentTheme = prefersDark ? THEMES.dark : THEMES.light;
}
document.body.dataset.theme = currentTheme; </s> remove setUITheme(window.matchMedia('(prefers-color-scheme: dark)').matches ? THEMES.dark : THEMES.light);
</s> add setUITheme(currentThemeLocal); </s> remove const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
</s> add const [currentThemeLocal, setCurrentThemeLocal] = useState(THEMES.auto); | https://github.com/AdguardTeam/AdGuardHome/commit/9e14d5f99f453b8c376aba966f648012da258c72 | client/src/login/Login/index.js |
keep keep add keep keep keep keep keep keep | <mask> </div>
<mask> <Footer />
<mask> <Toasts />
<mask> </div>
<mask> );
<mask> }
<mask> }
<mask>
<mask> Login.propTypes = {
</s> Pull request: fix missing icons on login page
Updates #5620
Squashed commit of the following:
commit 61969c83c3dd6bd6688f0aabc9d6160b53701866
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:50:47 2023 +0300
AG-20691 fix theme select on login page
commit c87b6c37284021f33f440dcd31be5b653e8e689d
Merge: aa744756 89bf3721
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:21:01 2023 +0300
Merge branch 'master' into AG-20691
commit aa744756d18d9ed3bc7f60108235d8403e7cb5e0
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Apr 7 15:53:38 2023 +0300
AG-20691 fix missing icons on login page </s> remove setUITheme(window.matchMedia('(prefers-color-scheme: dark)').matches ? THEMES.dark : THEMES.light);
</s> add setUITheme(currentThemeLocal); </s> remove const prefersDark = colorSchemeMedia.matches;
setUITheme(prefersDark ? THEMES.dark : THEMES.light);
</s> add setUITheme(theme); </s> remove document.body.dataset.theme = theme;
</s> add let currentTheme = theme;
if (currentTheme === THEMES.auto) {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
currentTheme = prefersDark ? THEMES.dark : THEMES.light;
}
document.body.dataset.theme = currentTheme; </s> remove const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
</s> add const [currentThemeLocal, setCurrentThemeLocal] = useState(THEMES.auto); </s> remove const currentTheme = useSelector((state) => (state.dashboard ? state.dashboard.theme : 'auto'));
const profileName = useSelector((state) => (state.dashboard ? state.dashboard.name : ''));
</s> add const currentTheme = useSelector((state) => (
state.dashboard ? state.dashboard.theme : THEMES.auto
));
const profileName = useSelector((state) => (
state.dashboard ? state.dashboard.name : ''
)); </s> add THEMES, | https://github.com/AdguardTeam/AdGuardHome/commit/9e14d5f99f453b8c376aba966f648012da258c72 | client/src/login/Login/index.js |
keep keep add keep keep keep keep keep keep | <mask>
<mask> const DomainCell = ({
<mask> answer_dnssec,
<mask> client_proto,
<mask> domain,
<mask> time,
<mask> tracker,
<mask> type,
<mask> }) => {
</s> - client: Display service name for blocked services </s> add if (service_name) {
requestDetailsObj.check_service = service_name;
}
</s> remove serviceName: service_name,
</s> add service_name, </s> add service_name: propTypes.string, </s> remove <div className="text-truncate" title={domain}>{domain}</div>
</s> add <div className="text-truncate" title={domain}>{service_name || domain}</div> | https://github.com/AdguardTeam/AdGuardHome/commit/9e33bd52599c2039603d99f93db461cc6a6a23f4 | client/src/components/Logs/Cells/DomainCell.js |
keep keep add keep keep keep keep keep keep | <mask> protocol,
<mask> };
<mask>
<mask> const sourceData = getSourceData(tracker);
<mask>
<mask> const knownTrackerDataObj = {
<mask> name_table_header: tracker?.name,
<mask> category_label: hasTracker && captitalizeWords(tracker.category),
<mask> source_label: sourceData
</s> - client: Display service name for blocked services </s> add service_name, </s> add service_name: propTypes.string, </s> remove <div className="text-truncate" title={domain}>{domain}</div>
</s> add <div className="text-truncate" title={domain}>{service_name || domain}</div> </s> remove serviceName: service_name,
</s> add service_name, | https://github.com/AdguardTeam/AdGuardHome/commit/9e33bd52599c2039603d99f93db461cc6a6a23f4 | client/src/components/Logs/Cells/DomainCell.js |
keep keep keep keep replace keep keep keep keep keep | <mask> <IconTooltip className={privacyIconClass} tooltipClass='pt-4 pb-5 px-5 mw-75'
<mask> xlinkHref='privacy' contentItemClass='key-colon' renderContent={renderContent}
<mask> place='bottom' />
<mask> <div className={valueClass}>
<mask> <div className="text-truncate" title={domain}>{domain}</div>
<mask> {details && isDetailed
<mask> && <div className="detailed-info d-none d-sm-block text-truncate"
<mask> title={details}>{details}</div>}
<mask> </div>
<mask> </div>;
</s> - client: Display service name for blocked services </s> add if (service_name) {
requestDetailsObj.check_service = service_name;
}
</s> remove serviceName: service_name,
</s> add service_name, </s> add service_name: propTypes.string, </s> add service_name, | https://github.com/AdguardTeam/AdGuardHome/commit/9e33bd52599c2039603d99f93db461cc6a6a23f4 | client/src/components/Logs/Cells/DomainCell.js |
keep add keep keep keep keep | <mask> time: propTypes.string.isRequired,
<mask> type: propTypes.string.isRequired,
<mask> tracker: propTypes.object,
<mask> };
<mask>
<mask> export default DomainCell;
</s> - client: Display service name for blocked services </s> remove serviceName: service_name,
</s> add service_name, </s> add if (service_name) {
requestDetailsObj.check_service = service_name;
}
</s> remove <div className="text-truncate" title={domain}>{domain}</div>
</s> add <div className="text-truncate" title={domain}>{service_name || domain}</div> </s> add service_name, | https://github.com/AdguardTeam/AdGuardHome/commit/9e33bd52599c2039603d99f93db461cc6a6a23f4 | client/src/components/Logs/Cells/DomainCell.js |
keep keep keep keep replace keep keep keep keep keep | <mask> client_proto,
<mask> filterId,
<mask> rule,
<mask> status,
<mask> serviceName: service_name,
<mask> originalAnswer: original_answer,
<mask> originalResponse: processResponse(original_answer),
<mask> tracker: getTrackerData(domain),
<mask> answer_dnssec,
<mask> elapsedMs,
</s> - client: Display service name for blocked services </s> add service_name, </s> add service_name: propTypes.string, </s> remove <div className="text-truncate" title={domain}>{domain}</div>
</s> add <div className="text-truncate" title={domain}>{service_name || domain}</div> </s> add if (service_name) {
requestDetailsObj.check_service = service_name;
}
| https://github.com/AdguardTeam/AdGuardHome/commit/9e33bd52599c2039603d99f93db461cc6a6a23f4 | client/src/helpers/helpers.js |
keep keep keep keep replace keep | <mask> "password_placeholder": "Enter password",
<mask> "sign_in": "Sign in",
<mask> "sign_out": "Sign out",
<mask> "forgot_password": "Forgot password?",
<mask> "forgot_password_desc": "Please follow <0>these steps</0> to create a new password for your user account."
<mask> }
</s> + client: add whois info to clients and auto clients table </s> add .logs__text--wrap {
white-space: normal;
}
</s> add minWidth: 210, </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> add import WrapCell from './WrapCell';
import WhoisCell from './WhoisCell'; </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> add {
Header: this.props.t('whois'),
accessor: 'whois_info',
minWidth: 200,
Cell: WhoisCell,
}, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/__locales/en.json |
keep keep add keep keep keep keep keep | <mask> width: 100%;
<mask> }
<mask>
<mask> .logs__row .tooltip-custom {
<mask> top: 0;
<mask> margin-left: 0;
<mask> margin-right: 5px;
<mask> }
</s> + client: add whois info to clients and auto clients table </s> add minWidth: 210, </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> add import WrapCell from './WrapCell';
import WhoisCell from './WhoisCell'; </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell,
},
{
Header: this.props.t('whois'),
accessor: 'whois_info',
Cell: WhoisCell, </s> add {
Header: this.props.t('whois'),
accessor: 'whois_info',
minWidth: 200,
Cell: WhoisCell,
}, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Logs/Logs.css |
keep keep add keep keep keep keep | <mask> import ReactTable from 'react-table';
<mask>
<mask> import Card from '../../ui/Card';
<mask>
<mask> class AutoClients extends Component {
<mask> getStats = (ip, stats) => {
<mask> if (stats) {
</s> + client: add whois info to clients and auto clients table </s> add import WrapCell from './WrapCell';
import WhoisCell from './WhoisCell'; </s> add minWidth: 210, </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> add minWidth: 150, </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell,
},
{
Header: this.props.t('whois'),
accessor: 'whois_info',
Cell: WhoisCell, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/AutoClients.js |
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep replace keep keep keep keep | <mask>
<mask> return '';
<mask> };
<mask>
<mask> cellWrap = ({ value }) => (
<mask> <div className="logs__row logs__row--overflow">
<mask> <span className="logs__text" title={value}>
<mask> {value}
<mask> </span>
<mask> </div>
<mask> );
<mask>
<mask> columns = [
<mask> {
<mask> Header: this.props.t('table_client'),
<mask> accessor: 'ip',
<mask> Cell: this.cellWrap,
<mask> },
<mask> {
<mask> Header: this.props.t('table_name'),
<mask> accessor: 'name',
</s> + client: add whois info to clients and auto clients table </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> add minWidth: 150, </s> remove Cell: this.cellWrap,
</s> add minWidth: 120,
Cell: WrapCell, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell, </s> add minWidth: 120, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/AutoClients.js |
keep keep keep keep replace keep keep keep keep replace | <mask> },
<mask> {
<mask> Header: this.props.t('table_name'),
<mask> accessor: 'name',
<mask> Cell: this.cellWrap,
<mask> },
<mask> {
<mask> Header: this.props.t('source_label'),
<mask> accessor: 'source',
<mask> Cell: this.cellWrap,
</s> + client: add whois info to clients and auto clients table </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell, </s> remove Cell: this.cellWrap,
</s> add minWidth: 120,
Cell: WrapCell, </s> add {
Header: this.props.t('whois'),
accessor: 'whois_info',
minWidth: 200,
Cell: WhoisCell,
}, </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/AutoClients.js |
keep keep add keep keep keep keep | <mask> import { MODAL_TYPE, CLIENT_ID } from '../../../helpers/constants';
<mask> import Card from '../../ui/Card';
<mask> import Modal from './Modal';
<mask>
<mask> class ClientsTable extends Component {
<mask> handleFormAdd = (values) => {
<mask> this.props.addClient(values);
</s> + client: add whois info to clients and auto clients table </s> add import WhoisCell from './WhoisCell';
import WrapCell from './WrapCell'; </s> add minWidth: 210, </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell,
},
{
Header: this.props.t('whois'),
accessor: 'whois_info',
Cell: WhoisCell, </s> add {
Header: this.props.t('whois'),
accessor: 'whois_info',
minWidth: 200,
Cell: WhoisCell,
}, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/ClientsTable.js |
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep | <mask> this.handleFormAdd(config);
<mask> }
<mask> };
<mask>
<mask> cellWrap = ({ value }) => (
<mask> <div className="logs__row logs__row--overflow">
<mask> <span className="logs__text" title={value}>
<mask> {value}
<mask> </span>
<mask> </div>
<mask> );
<mask>
<mask> getClient = (name, clients) => {
<mask> const client = clients.find(item => name === item.name);
<mask>
<mask> if (client) {
<mask> const identifier = client.mac ? CLIENT_ID.MAC : CLIENT_ID.IP;
</s> + client: add whois info to clients and auto clients table </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> add minWidth: 120, </s> add minWidth: 150, </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> add minWidth: 210, </s> remove Cell: this.cellWrap,
</s> add minWidth: 120,
Cell: WrapCell, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/ClientsTable.js |
keep add keep keep keep keep keep | <mask> Header: this.props.t('table_client'),
<mask> accessor: 'ip',
<mask> Cell: (row) => {
<mask> if (row.original && row.original.mac) {
<mask> return (
<mask> <div className="logs__row logs__row--overflow">
<mask> <span className="logs__text" title={row.original.mac}>
</s> + client: add whois info to clients and auto clients table </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> add minWidth: 210, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell,
},
{
Header: this.props.t('whois'),
accessor: 'whois_info',
Cell: WhoisCell, </s> add {
Header: this.props.t('whois'),
accessor: 'whois_info',
minWidth: 200,
Cell: WhoisCell,
}, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/ClientsTable.js |
keep keep keep keep replace keep keep keep keep keep | <mask> },
<mask> {
<mask> Header: this.props.t('table_name'),
<mask> accessor: 'name',
<mask> Cell: this.cellWrap,
<mask> },
<mask> {
<mask> Header: this.props.t('settings'),
<mask> accessor: 'use_global_settings',
<mask> Cell: ({ value }) => {
</s> + client: add whois info to clients and auto clients table </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell, </s> add minWidth: 120, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell,
},
{
Header: this.props.t('whois'),
accessor: 'whois_info',
Cell: WhoisCell, </s> add {
Header: this.props.t('whois'),
accessor: 'whois_info',
minWidth: 200,
Cell: WhoisCell,
}, </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/ClientsTable.js |
keep add keep keep keep keep keep | <mask> Header: this.props.t('settings'),
<mask> accessor: 'use_global_settings',
<mask> Cell: ({ value }) => {
<mask> const title = value ? (
<mask> <Trans>settings_global</Trans>
<mask> ) : (
<mask> <Trans>settings_custom</Trans>
</s> + client: add whois info to clients and auto clients table </s> remove Cell: this.cellWrap,
</s> add minWidth: 120,
Cell: WrapCell, </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add </s> add minWidth: 150, </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> add minWidth: 210, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/ClientsTable.js |
keep keep add keep keep keep keep keep | <mask> {
<mask> Header: this.props.t('blocked_services'),
<mask> accessor: 'blocked_services',
<mask> Cell: (row) => {
<mask> const { value, original } = row;
<mask>
<mask> if (original.use_global_blocked_services) {
<mask> return <Trans>settings_global</Trans>;
</s> + client: add whois info to clients and auto clients table </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> add minWidth: 150, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell,
},
{
Header: this.props.t('whois'),
accessor: 'whois_info',
Cell: WhoisCell, </s> add {
Header: this.props.t('whois'),
accessor: 'whois_info',
minWidth: 200,
Cell: WhoisCell,
}, </s> remove Cell: this.cellWrap,
</s> add minWidth: 120,
Cell: WrapCell, </s> remove cellWrap = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value}
</span>
</div>
);
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/ClientsTable.js |
keep keep add keep keep keep keep | <mask> );
<mask> },
<mask> },
<mask> {
<mask> Header: this.props.t('requests_count'),
<mask> accessor: 'statistics',
<mask> Cell: (row) => {
</s> + client: add whois info to clients and auto clients table </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell,
},
{
Header: this.props.t('whois'),
accessor: 'whois_info',
Cell: WhoisCell, </s> remove Cell: this.cellWrap,
</s> add minWidth: 120,
Cell: WrapCell, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell, </s> remove maxWidth: 150,
</s> add maxWidth: 100, </s> remove Cell: this.cellWrap,
</s> add Cell: WrapCell, </s> add minWidth: 210, | https://github.com/AdguardTeam/AdGuardHome/commit/9e4f80f3c1d82bff658cf63e4b3791284966bd1c | client/src/components/Settings/Clients/ClientsTable.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.