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 keep keep keep keep keep
|
<mask> v, ok := t.(string)
<mask> if !ok {
<mask> return nil
<mask> }
<mask> if len(ent.IP) == 0 {
<mask> ent.IP = v
<mask> }
<mask> return nil
<mask> },
<mask> "T": func(t json.Token, ent *logEntry) error {
<mask> v, ok := t.(string)
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove c, ok := clients.findByIP(ip)
</s> add c, ok := clients.findByIP(net.ParseIP(ip)) </s> remove c, ok := clients.idIndex[ip]
</s> add c, ok := clients.idIndex[ip.String()] </s> remove ch, ok := clients.ipHost[ip]
</s> add ch, ok := clients.ipHost[ip.String()] </s> remove _, ok := a.disallowedClients[ip]
</s> add _, ok := a.disallowedClients[ipStr] </s> remove func (clients *clientsContainer) findByIP(ip string) (Client, bool) {
ipAddr := net.ParseIP(ip)
if ipAddr == nil {
</s> add func (clients *clientsContainer) findByIP(ip net.IP) (Client, bool) {
if ip == nil { </s> remove return true, ip
</s> add return true, ipStr
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/decode.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> ans, err := base64.StdEncoding.DecodeString(ansStr)
<mask> assert.Nil(t, err)
<mask>
<mask> want := &logEntry{
<mask> IP: "127.0.0.1",
<mask> Time: time.Date(2020, 11, 25, 15, 55, 56, 519796000, time.UTC),
<mask> QHost: "an.yandex.ru",
<mask> QType: "A",
<mask> QClass: "IN",
<mask> ClientProto: "",
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove IP: l.getClientIP(params.ClientIP.String()),
</s> add IP: l.getClientIP(params.ClientIP), </s> remove RangeStart: "2001::1",
</s> add RangeStart: net.ParseIP("2001::1"), </s> remove RangeStart: "2001::1",
</s> add RangeStart: net.ParseIP("2001::1"), </s> remove RangeStart: "2001::2",
</s> add RangeStart: net.ParseIP("2001::2"), </s> remove c, b := clients.Find("1.1.1.2")
</s> add c, b := clients.Find(net.IPv4(1, 1, 1, 2)) </s> remove RangeStart: "2001::1",
</s> add RangeStart: net.ParseIP("2001::1"),
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/decode_test.go
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask>
<mask> // TODO(a.garipov): Use a proper structured approach here.
<mask>
<mask> // Get Client IP address
<mask> func (l *queryLog) getClientIP(clientIP string) string {
<mask> if l.conf.AnonymizeClientIP {
<mask> ip := net.ParseIP(clientIP)
<mask> if ip != nil {
<mask> ip4 := ip.To4()
<mask> const AnonymizeClientIP4Mask = 16
<mask> const AnonymizeClientIP6Mask = 112
<mask> if ip4 != nil {
<mask> clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
<mask> } else {
<mask> clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
<mask> }
<mask> }
<mask> }
<mask>
<mask> return clientIP
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func (s *statsCtx) getClientIP(clientIP string) string {
if s.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (s *statsCtx) getClientIP(ip net.IP) (clientIP net.IP) {
if s.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)) </s> add return ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)) </s> remove if ip.To4() != nil {
val = ip.To4()
}
</s> add </s> remove func IPStringFromAddr(addr net.Addr) (ipstr string) {
if ip := ipFromAddr(addr); ip != nil {
</s> add func IPStringFromAddr(addr net.Addr) (ipStr string) {
if ip := IPFromAddr(addr); ip != nil { </s> remove return clientIP
</s> add return ip </s> remove ip := util.GetSubnet(ifaceName)
if len(ip) == 0 {
</s> add ipNet := util.GetSubnet(ifaceName)
if ipNet.IP == nil {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/json.go
|
keep add keep keep keep keep
|
<mask> return ip.Mask(net.CIDRMask(AnonymizeClientIPv4Mask, 32))
<mask> }
<mask> }
<mask>
<mask> return ip
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> add return ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)) </s> remove func (l *queryLog) getClientIP(clientIP string) string {
if l.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (l *queryLog) getClientIP(ip net.IP) (clientIP net.IP) {
if l.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIPv4Mask = 16
const AnonymizeClientIPv6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIPv4Mask, 32)) </s> remove func (s *statsCtx) getClientIP(clientIP string) string {
if s.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (s *statsCtx) getClientIP(ip net.IP) (clientIP net.IP) {
if s.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)) </s> remove return clientIP
</s> add return ip </s> remove if ip.To4() != nil {
val = ip.To4()
}
</s> add </s> remove return clientIP
</s> add return ip
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/json.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask> }
<mask> }
<mask>
<mask> return clientIP
<mask> }
<mask>
<mask> // jobject is a JSON object alias.
<mask> type jobject = map[string]interface{}
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove return clientIP
</s> add return ip </s> remove func (l *queryLog) getClientIP(clientIP string) string {
if l.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (l *queryLog) getClientIP(ip net.IP) (clientIP net.IP) {
if l.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIPv4Mask = 16
const AnonymizeClientIPv6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIPv4Mask, 32)) </s> remove func (s *statsCtx) getClientIP(clientIP string) string {
if s.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (s *statsCtx) getClientIP(ip net.IP) (clientIP net.IP) {
if s.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)) </s> remove d := []string{}
</s> add d := []net.IP{} </s> remove d = append(d, it.Name)
</s> add d = append(d, net.ParseIP(it.Name)) </s> remove RangeStart string `json:"range_start"`
</s> add RangeStart net.IP `json:"range_start"`
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/json.go
|
keep keep keep replace keep replace
|
<mask> // try most common record types
<mask> switch v := k.(type) {
<mask> case *dns.A:
<mask> answer["value"] = v.A.String()
<mask> case *dns.AAAA:
<mask> answer["value"] = v.AAAA.String()
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove // ipFromAddr gets IP address from addr.
func ipFromAddr(addr net.Addr) (ip net.IP) {
</s> add // IPFromAddr gets IP address from addr.
func IPFromAddr(addr net.Addr) (ip net.IP) { </s> remove ClientIP: ipFromAddr(d.Addr),
</s> add ClientIP: IPFromAddr(d.Addr), </s> remove if len(ent.IP) == 0 {
ent.IP = v
</s> add if ent.IP == nil {
ent.IP = net.ParseIP(v) </s> remove func(o options, v string) (options, error) { o.bindHost = v; return o, nil }, nil, nil,
func(o options) []string { return stringSliceOrNil(o.bindHost) },
</s> add func(o options, v string) (options, error) { o.bindHost = net.ParseIP(v); return o, nil }, nil, nil,
func(o options) []string { return ipSliceOrNil(o.bindHost) }, </s> remove assert.Equal(t, "192.168.10.150", ls[0].IP.String())
</s> add assert.True(t, net.IP{192, 168, 10, 150}.Equal(ls[0].IP))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/json.go
|
keep add keep keep keep keep keep keep
|
<mask> import (
<mask> "fmt"
<mask> "os"
<mask> "path/filepath"
<mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> add "net" </s> add "net" </s> add "net" </s> add "net" </s> add "net" </s> add "net"
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> // logEntry - represents a single log entry
<mask> type logEntry struct {
<mask> IP string `json:"IP"` // Client IP
<mask> Time time.Time `json:"T"`
<mask>
<mask> QHost string `json:"QH"`
<mask> QType string `json:"QT"`
<mask> QClass string `json:"QC"`
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove IP string `json:"ip"`
</s> add IP net.IP `json:"ip"` </s> remove IP string `json:"ip"`
</s> add IP net.IP `json:"ip"` </s> remove Addresses []string `json:"ip_addresses"`
</s> add Addresses []net.IP `json:"ip_addresses"` </s> remove RangeStart string `json:"range_start"`
</s> add RangeStart net.IP `json:"range_start"` </s> remove // GetInterfaceByIP - Get interface name by its IP address.
func GetInterfaceByIP(ip string) string {
</s> add // GetInterfaceByIP returns the name of interface containing provided ip.
func GetInterfaceByIP(ip net.IP) string { </s> remove Name string // Network interface name
MTU int // MTU
HardwareAddr string // Hardware address
Addresses []string // Array with the network interface addresses
Subnets []string // Array with CIDR addresses of this network interface
Flags string // Network interface flags (up, broadcast, etc)
</s> add Name string // Network interface name
MTU int // MTU
HardwareAddr string // Hardware address
Addresses []net.IP // Array with the network interface addresses
Subnets []*net.IPNet // Array with CIDR addresses of this network interface
Flags string // Network interface flags (up, broadcast, etc)
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> now := time.Now()
<mask> entry := logEntry{
<mask> IP: l.getClientIP(params.ClientIP.String()),
<mask> Time: now,
<mask>
<mask> Result: *params.Result,
<mask> Elapsed: params.Elapsed,
<mask> Upstream: params.Upstream,
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove IP: "127.0.0.1",
</s> add IP: net.IPv4(127, 0, 0, 1), </s> remove ClientIP: net.ParseIP(client),
</s> add ClientIP: client, </s> remove ClientIP: ipFromAddr(d.Addr),
</s> add ClientIP: IPFromAddr(d.Addr), </s> remove expire := r.ipAddrs.Get([]byte(ip))
</s> add expire := r.ipAddrs.Get(ip) </s> remove func (w *Whois) Begin(ip string) {
</s> add func (w *Whois) Begin(ip net.IP) { </s> remove func (r *RDNS) Begin(ip string) {
</s> add func (r *RDNS) Begin(ip net.IP) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> defer func() { _ = os.RemoveAll(conf.BaseDir) }()
<mask> l := newQueryLog(conf)
<mask>
<mask> // add disk entries
<mask> addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
<mask> // write to disk (first file)
<mask> _ = l.flushLogBuffer(true)
<mask> // start writing to the second file
<mask> _ = l.rotate()
<mask> // add disk entries
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2)) </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "second.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "second.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "first.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "first.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove addEntry(l, "example1.org", "1.1.1.1", "2.2.2.1")
addEntry(l, "example2.org", "1.1.1.1", "2.2.2.1")
addEntry(l, "example3.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example1.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
addEntry(l, "example2.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
addEntry(l, "example3.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep replace keep keep keep replace replace keep keep
|
<mask> // start writing to the second file
<mask> _ = l.rotate()
<mask> // add disk entries
<mask> addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
<mask> // write to disk
<mask> _ = l.flushLogBuffer(true)
<mask> // add memory entries
<mask> addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
<mask> addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
<mask>
<mask> // get all entries
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "second.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "second.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "first.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "first.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace replace replace replace keep keep keep keep keep
|
<mask> // get all entries
<mask> params := newSearchParams()
<mask> entries, _ := l.search(params)
<mask> assert.Len(t, entries, 4)
<mask> assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
<mask> assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
<mask> assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
<mask> assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
<mask>
<mask> // search by domain (strict)
<mask> params = newSearchParams()
<mask> params.searchCriteria = append(params.searchCriteria, searchCriteria{
<mask> criteriaType: ctDomainOrClient,
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[1], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[2], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[1], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
</s> add assertLogEntry(t, entries[0], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "example.org", "1.1.1.2", "2.2.2.2")
</s> add assertLogEntry(t, entries[0], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> value: "TEST.example.org",
<mask> })
<mask> entries, _ = l.search(params)
<mask> assert.Len(t, entries, 1)
<mask> assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
<mask>
<mask> // search by domain (not strict)
<mask> params = newSearchParams()
<mask> params.searchCriteria = append(params.searchCriteria, searchCriteria{
<mask> criteriaType: ctDomainOrClient,
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove assertLogEntry(t, entries[0], "example.org", "1.1.1.2", "2.2.2.2")
</s> add assertLogEntry(t, entries[0], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2)) </s> remove assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[1], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[2], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[1], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask> value: "example.ORG",
<mask> })
<mask> entries, _ = l.search(params)
<mask> assert.Len(t, entries, 3)
<mask> assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
<mask> assertLogEntry(t, entries[1], "example.org", "1.1.1.2", "2.2.2.2")
<mask> assertLogEntry(t, entries[2], "example.org", "1.1.1.1", "2.2.2.1")
<mask>
<mask> // search by client IP (strict)
<mask> params = newSearchParams()
<mask> params.searchCriteria = append(params.searchCriteria, searchCriteria{
<mask> criteriaType: ctDomainOrClient,
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove assertLogEntry(t, entries[0], "example.org", "1.1.1.2", "2.2.2.2")
</s> add assertLogEntry(t, entries[0], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
</s> add assertLogEntry(t, entries[0], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> value: "2.2.2.2",
<mask> })
<mask> entries, _ = l.search(params)
<mask> assert.Len(t, entries, 1)
<mask> assertLogEntry(t, entries[0], "example.org", "1.1.1.2", "2.2.2.2")
<mask>
<mask> // search by client IP (part of)
<mask> params = newSearchParams()
<mask> params.searchCriteria = append(params.searchCriteria, searchCriteria{
<mask> criteriaType: ctDomainOrClient,
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
</s> add assertLogEntry(t, entries[0], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3)) </s> remove assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[1], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[2], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[1], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace replace replace replace keep keep keep keep keep
|
<mask> value: "2.2.2",
<mask> })
<mask> entries, _ = l.search(params)
<mask> assert.Len(t, entries, 4)
<mask> assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
<mask> assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
<mask> assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
<mask> assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
<mask> }
<mask>
<mask> func TestQueryLogOffsetLimit(t *testing.T) {
<mask> conf := Config{
<mask> Enabled: true,
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[1], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[2], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[1], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove assertLogEntry(t, entries[0], "example.org", "1.1.1.2", "2.2.2.2")
</s> add assertLogEntry(t, entries[0], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2)) </s> remove assertLogEntry(t, entries[0], "test.example.org", "1.1.1.3", "2.2.2.3")
</s> add assertLogEntry(t, entries[0], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> l := newQueryLog(conf)
<mask>
<mask> // add 10 entries to the log
<mask> for i := 0; i < 10; i++ {
<mask> addEntry(l, "second.example.org", "1.1.1.1", "2.2.2.1")
<mask> }
<mask> // write them to disk (first file)
<mask> _ = l.flushLogBuffer(true)
<mask> // add 10 more entries to the log (memory)
<mask> for i := 0; i < 10; i++ {
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "first.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "first.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2)) </s> remove ip := q.Get(fmt.Sprintf("ip%d", i))
if len(ip) == 0 {
</s> add ipStr := q.Get(fmt.Sprintf("ip%d", i))
ip := net.ParseIP(ipStr)
if ip == nil { </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> // write them to disk (first file)
<mask> _ = l.flushLogBuffer(true)
<mask> // add 10 more entries to the log (memory)
<mask> for i := 0; i < 10; i++ {
<mask> addEntry(l, "first.example.org", "1.1.1.1", "2.2.2.1")
<mask> }
<mask>
<mask> // First page
<mask> params := newSearchParams()
<mask> params.offset = 0
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove addEntry(l, "second.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "second.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove addEntry(l, "example1.org", "1.1.1.1", "2.2.2.1")
addEntry(l, "example2.org", "1.1.1.1", "2.2.2.1")
addEntry(l, "example3.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example1.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
addEntry(l, "example2.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
addEntry(l, "example3.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> l := newQueryLog(conf)
<mask>
<mask> // add 10 entries to the log
<mask> for i := 0; i < 10; i++ {
<mask> addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
<mask> }
<mask> // write them to disk (first file)
<mask> _ = l.flushLogBuffer(true)
<mask>
<mask> params := newSearchParams()
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove addEntry(l, "second.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "second.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "first.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "first.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.2", "2.2.2.2")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove addEntry(l, "example1.org", "1.1.1.1", "2.2.2.1")
addEntry(l, "example2.org", "1.1.1.1", "2.2.2.1")
addEntry(l, "example3.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example1.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
addEntry(l, "example2.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
addEntry(l, "example3.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask> conf.BaseDir = prepareTestDir()
<mask> defer func() { _ = os.RemoveAll(conf.BaseDir) }()
<mask> l := newQueryLog(conf)
<mask>
<mask> addEntry(l, "example1.org", "1.1.1.1", "2.2.2.1")
<mask> addEntry(l, "example2.org", "1.1.1.1", "2.2.2.1")
<mask> addEntry(l, "example3.org", "1.1.1.1", "2.2.2.1")
<mask> // the oldest entry is now removed from mem buffer
<mask>
<mask> params := newSearchParams()
<mask> ll, _ := l.search(params)
<mask> assert.Len(t, ll, 2)
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "first.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "first.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "second.example.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "second.example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove addEntry(l, "test.example.org", "1.1.1.3", "2.2.2.3")
addEntry(l, "example.com", "1.1.1.4", "2.2.2.4")
</s> add addEntry(l, "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
addEntry(l, "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4)) </s> remove assertLogEntry(t, entries[0], "example.com", "1.1.1.4", "2.2.2.4")
assertLogEntry(t, entries[1], "test.example.org", "1.1.1.3", "2.2.2.3")
assertLogEntry(t, entries[2], "example.org", "1.1.1.2", "2.2.2.2")
assertLogEntry(t, entries[3], "example.org", "1.1.1.1", "2.2.2.1")
</s> add assertLogEntry(t, entries[0], "example.com", net.IPv4(1, 1, 1, 4), net.IPv4(2, 2, 2, 4))
assertLogEntry(t, entries[1], "test.example.org", net.IPv4(1, 1, 1, 3), net.IPv4(2, 2, 2, 3))
assertLogEntry(t, entries[2], "example.org", net.IPv4(1, 1, 1, 2), net.IPv4(2, 2, 2, 2))
assertLogEntry(t, entries[3], "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> assert.Equal(t, "example3.org", ll[0].QHost)
<mask> assert.Equal(t, "example2.org", ll[1].QHost)
<mask> }
<mask>
<mask> func addEntry(l *queryLog, host, answerStr, client string) {
<mask> q := dns.Msg{}
<mask> q.Question = append(q.Question, dns.Question{
<mask> Name: host + ".",
<mask> Qtype: dns.TypeA,
<mask> Qclass: dns.ClassINET,
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func assertLogEntry(t *testing.T, entry *logEntry, host, answer, client string) bool {
</s> add func assertLogEntry(t *testing.T, entry *logEntry, host string, answer, client net.IP) bool { </s> remove answer.A = net.ParseIP(answerStr)
</s> add answer.A = answerStr </s> remove func (r *RDNS) resolve(ip string) string {
</s> add func (r *RDNS) resolve(ip net.IP) string { </s> remove req.Question[0].Name, err = dns.ReverseAddr(ip)
</s> add req.Question[0].Name, err = dns.ReverseAddr(ip.String()) </s> remove addEntry(l, "example1.org", "1.1.1.1", "2.2.2.1")
addEntry(l, "example2.org", "1.1.1.1", "2.2.2.1")
addEntry(l, "example3.org", "1.1.1.1", "2.2.2.1")
</s> add addEntry(l, "example1.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
addEntry(l, "example2.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
addEntry(l, "example3.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> remove func (s *Server) IsBlockedIP(ip string) (bool, string) {
</s> add func (s *Server) IsBlockedIP(ip net.IP) (bool, string) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> Name: q.Question[0].Name,
<mask> Rrtype: dns.TypeA,
<mask> Class: dns.ClassINET,
<mask> }
<mask> answer.A = net.ParseIP(answerStr)
<mask> a.Answer = append(a.Answer, answer)
<mask> res := dnsfilter.Result{
<mask> IsFiltered: true,
<mask> Reason: dnsfilter.Rewritten,
<mask> ServiceName: "SomeService",
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func addEntry(l *queryLog, host, answerStr, client string) {
</s> add func addEntry(l *queryLog, host string, answerStr, client net.IP) { </s> remove assert.False(t, clients.Exists("1.1.1.1", ClientSourceHostsFile))
assert.True(t, clients.Exists("1.1.1.2", ClientSourceHostsFile))
</s> add assert.False(t, clients.Exists(net.IPv4(1, 1, 1, 1), ClientSourceHostsFile))
assert.True(t, clients.Exists(net.IPv4(1, 1, 1, 2), ClientSourceHostsFile)) </s> remove ipAddr := net.ParseIP(ip)
</s> add </s> remove _, ok := a.disallowedClients[ip]
</s> add _, ok := a.disallowedClients[ipStr] </s> remove return true, ip
</s> add return true, ipStr </s> remove if ipnet.Contains(ipAddr) {
</s> add if ipnet.Contains(ip) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> Question: &q,
<mask> Answer: &a,
<mask> OrigAnswer: &a,
<mask> Result: &res,
<mask> ClientIP: net.ParseIP(client),
<mask> Upstream: "upstream",
<mask> }
<mask> l.Add(params)
<mask> }
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove ClientIP: ipFromAddr(d.Addr),
</s> add ClientIP: IPFromAddr(d.Addr), </s> remove IP: l.getClientIP(params.ClientIP.String()),
</s> add IP: l.getClientIP(params.ClientIP), </s> remove ClientIP: setts.ClientIP,
ClientName: setts.ClientName,
DNSType: qtype,
</s> add // TODO(e.burkov): Wait for urlfilter update to pass net.IP.
ClientIP: setts.ClientIP.String(),
ClientName: setts.ClientName,
DNSType: qtype, </s> remove func assertLogEntry(t *testing.T, entry *logEntry, host, answer, client string) bool {
</s> add func assertLogEntry(t *testing.T, entry *logEntry, host string, answer, client net.IP) bool { </s> remove log.Printf("Go to %s://%s", proto, net.JoinHostPort(config.BindHost, port))
</s> add hostStr = config.BindHost.String()
log.Printf("Go to %s://%s", proto, net.JoinHostPort(hostStr, port)) </s> add return ip.Mask(net.CIDRMask(AnonymizeClientIPv6Mask, 128))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask> l.Add(params)
<mask> }
<mask>
<mask> func assertLogEntry(t *testing.T, entry *logEntry, host, answer, client string) bool {
<mask> assert.Equal(t, host, entry.QHost)
<mask> assert.Equal(t, client, entry.IP)
<mask> assert.Equal(t, "A", entry.QType)
<mask> assert.Equal(t, "IN", entry.QClass)
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func addEntry(l *queryLog, host, answerStr, client string) {
</s> add func addEntry(l *queryLog, host string, answerStr, client net.IP) { </s> remove assert.Equal(t, answer, ip.String())
</s> add assert.Equal(t, answer, ip) </s> remove _, _ = r.clients.AddHost(ip, host, ClientSourceRDNS)
</s> add _, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS) </s> remove ClientIP: net.ParseIP(client),
</s> add ClientIP: client, </s> remove assert.Equal(t, "127.0.0.1", DNSUnreverseAddr("1.0.0.127.in-addr.arpa").String())
</s> add assert.True(t, net.IP{127, 0, 0, 1}.Equal(DNSUnreverseAddr("1.0.0.127.in-addr.arpa"))) </s> remove assert.Equal(t, "192.168.10.152", ls[1].IP.String())
</s> add assert.True(t, net.IP{192, 168, 10, 152}.Equal(ls[1].IP))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep replace keep replace keep
|
<mask> assert.Len(t, msg.Answer, 1)
<mask> ip := proxyutil.GetIPFromDNSRecord(msg.Answer[0])
<mask> assert.NotNil(t, ip)
<mask> assert.Equal(t, answer, ip.String())
<mask> return true
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove assert.Equal(t, "192.168.10.1", dnsAddrs[0].String())
</s> add assert.True(t, net.IP{192, 168, 10, 1}.Equal(dnsAddrs[0])) </s> remove assert.Equal(t, "192.168.10.1", dnsAddrs[0].String())
</s> add assert.True(t, net.IP{192, 168, 10, 1}.Equal(dnsAddrs[0])) </s> remove assert.Equal(t, "127.0.0.2", ips[0].String())
</s> add assert.True(t, net.IP{127, 0, 0, 2}.Equal(ips[0])) </s> remove assert.Equal(t, "1.1.1.1", r.IPList[0].String())
</s> add assert.True(t, net.IP{1, 1, 1, 1}.Equal(r.IPList[0])) </s> remove assert.Equal(t, "0.0.0.1", a.A.String())
</s> add assert.True(t, net.IP{0, 0, 0, 1}.Equal(a.A))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/qlog_test.go
|
keep keep keep keep replace keep keep replace keep keep keep keep
|
<mask> if !c.strict && strings.Contains(qhost, searchVal) {
<mask> return true
<mask> }
<mask>
<mask> if c.strict && entry.IP == c.value {
<mask> return true
<mask> }
<mask> if !c.strict && strings.Contains(entry.IP, c.value) {
<mask> return true
<mask> }
<mask> return false
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove if config.BindHost == newSettings.Web.IP && config.BindPort == newSettings.Web.Port {
</s> add if config.BindHost.Equal(newSettings.Web.IP) && config.BindPort == newSettings.Web.Port { </s> remove c, ok := clients.idIndex[ip]
</s> add c, ok := clients.idIndex[ip.String()] </s> remove ch, ok := clients.ipHost[ip]
</s> add ch, ok := clients.ipHost[ip.String()] </s> remove ch, ok := clients.ipHost[ip]
</s> add ch, ok := clients.ipHost[ip.String()] </s> remove if ipnet.Contains(ipAddr) {
</s> add if ipnet.Contains(ip) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/querylog/searchcriteria.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> // Update counters
<mask> Update(e Entry)
<mask>
<mask> // Get IP addresses of the clients with the most number of requests
<mask> GetTopClientsIP(limit uint) []string
<mask>
<mask> // WriteDiskConfig - write configuration
<mask> WriteDiskConfig(dc *DiskConfig)
<mask> }
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove if config.DNS.BindHost == "0.0.0.0" {
</s> add if config.DNS.BindHost.IsUnspecified() { </s> remove Name string // Network interface name
MTU int // MTU
HardwareAddr string // Hardware address
Addresses []string // Array with the network interface addresses
Subnets []string // Array with CIDR addresses of this network interface
Flags string // Network interface flags (up, broadcast, etc)
</s> add Name string // Network interface name
MTU int // MTU
HardwareAddr string // Hardware address
Addresses []net.IP // Array with the network interface addresses
Subnets []*net.IPNet // Array with CIDR addresses of this network interface
Flags string // Network interface flags (up, broadcast, etc) </s> remove ipChan chan string
</s> add ipChan chan net.IP </s> remove topClients := Context.stats.GetTopClientsIP(topClientsNumber)
for _, ip := range topClients {
ipAddr := net.ParseIP(ip)
if !ipAddr.IsLoopback() {
</s> add for _, ip := range Context.stats.GetTopClientsIP(topClientsNumber) {
if !ip.IsLoopback() { </s> remove // GetInterfaceByIP - Get interface name by its IP address.
func GetInterfaceByIP(ip string) string {
</s> add // GetInterfaceByIP returns the name of interface containing provided ip.
func GetInterfaceByIP(ip net.IP) string { </s> remove IP []string `json:"ip"`
</s> add IP []net.IP `json:"ip"`
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/stats.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> assert.EqualValues(t, 0, d["num_replaced_parental"].(uint64))
<mask> assert.EqualValues(t, 0.123456, d["avg_processing_time"].(float64))
<mask>
<mask> topClients := s.GetTopClientsIP(2)
<mask> assert.Equal(t, "127.0.0.1", topClients[0])
<mask>
<mask> s.clear()
<mask> s.Close()
<mask> os.Remove(conf.Filename)
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove assert.Equal(t, "1.2.3.4", net.IP(string(val)).String())
</s> add assert.True(t, net.IP{1, 2, 3, 4}.Equal(net.IP(val))) </s> remove assert.Equal(t, "192.168.10.152", ls[1].IP.String())
</s> add assert.True(t, net.IP{192, 168, 10, 152}.Equal(ls[1].IP)) </s> remove assert.Equal(t, "127.0.0.1", DNSUnreverseAddr("1.0.0.127.in-addr.arpa").String())
</s> add assert.True(t, net.IP{127, 0, 0, 1}.Equal(DNSUnreverseAddr("1.0.0.127.in-addr.arpa"))) </s> remove assert.Equal(t, "192.168.10.100", ll[1].IP.String())
</s> add assert.True(t, net.IP{192, 168, 10, 100}.Equal(ll[1].IP)) </s> remove assert.Equal(t, "192.168.10.101", ll[0].IP.String())
</s> add assert.True(t, net.IP{192, 168, 10, 101}.Equal(ll[0].IP)) </s> remove assert.Equal(t, "127.0.0.2", ips[0].String())
</s> add assert.True(t, net.IP{127, 0, 0, 2}.Equal(ips[0]))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/stats_test.go
|
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
|
<mask> log.Debug("Stats: cleared")
<mask> }
<mask>
<mask> // Get Client IP address
<mask> func (s *statsCtx) getClientIP(clientIP string) string {
<mask> if s.conf.AnonymizeClientIP {
<mask> ip := net.ParseIP(clientIP)
<mask> if ip != nil {
<mask> ip4 := ip.To4()
<mask> const AnonymizeClientIP4Mask = 16
<mask> const AnonymizeClientIP6Mask = 112
<mask> if ip4 != nil {
<mask> clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
<mask> } else {
<mask> clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
<mask> }
<mask> }
<mask> }
<mask>
<mask> return clientIP
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func (l *queryLog) getClientIP(clientIP string) string {
if l.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (l *queryLog) getClientIP(ip net.IP) (clientIP net.IP) {
if l.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIPv4Mask = 16
const AnonymizeClientIPv6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIPv4Mask, 32)) </s> remove return clientIP
</s> add return ip </s> add return ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)) </s> remove if ip.To4() != nil {
val = ip.To4()
}
</s> add </s> remove func IPStringFromAddr(addr net.Addr) (ipstr string) {
if ip := ipFromAddr(addr); ip != nil {
</s> add func IPStringFromAddr(addr net.Addr) (ipStr string) {
if ip := IPFromAddr(addr); ip != nil { </s> remove func (s *statsCtx) GetTopClientsIP(maxCount uint) []string {
</s> add func (s *statsCtx) GetTopClientsIP(maxCount uint) []net.IP {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/unit.go
|
keep keep keep add keep keep keep keep
|
<mask>
<mask> if ip.To4() != nil {
<mask> return ip.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32))
<mask> }
<mask> }
<mask>
<mask> return ip
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func (s *statsCtx) getClientIP(clientIP string) string {
if s.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (s *statsCtx) getClientIP(ip net.IP) (clientIP net.IP) {
if s.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)) </s> remove if ip.To4() != nil {
val = ip.To4()
}
</s> add </s> remove func (l *queryLog) getClientIP(clientIP string) string {
if l.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (l *queryLog) getClientIP(ip net.IP) (clientIP net.IP) {
if l.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIPv4Mask = 16
const AnonymizeClientIPv6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIPv4Mask, 32)) </s> add return ip.Mask(net.CIDRMask(AnonymizeClientIPv6Mask, 128)) </s> remove ip := dnsforward.IPStringFromAddr(d.Addr)
if ip == "" {
</s> add ip := dnsforward.IPFromAddr(d.Addr)
if ip == nil { </s> remove func IPStringFromAddr(addr net.Addr) (ipstr string) {
if ip := ipFromAddr(addr); ip != nil {
</s> add func IPStringFromAddr(addr net.Addr) (ipStr string) {
if ip := IPFromAddr(addr); ip != nil {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/unit.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask> }
<mask> }
<mask>
<mask> return clientIP
<mask> }
<mask>
<mask> func (s *statsCtx) Update(e Entry) {
<mask> if e.Result == 0 ||
<mask> e.Result >= rLast ||
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func (s *statsCtx) GetTopClientsIP(maxCount uint) []string {
</s> add func (s *statsCtx) GetTopClientsIP(maxCount uint) []net.IP { </s> remove client := s.getClientIP(e.Client.String())
</s> add client := s.getClientIP(e.Client) </s> remove func (s *statsCtx) getClientIP(clientIP string) string {
if s.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (s *statsCtx) getClientIP(ip net.IP) (clientIP net.IP) {
if s.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)) </s> remove s.conf.ipStart = net.ParseIP(conf.RangeStart)
</s> add s.conf.ipStart = conf.RangeStart </s> remove _, ok := a.allowedClients[ip]
</s> add _, ok := a.allowedClients[ipStr] </s> remove func (s *Server) IsBlockedIP(ip string) (bool, string) {
</s> add func (s *Server) IsBlockedIP(ip net.IP) (bool, string) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/unit.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> len(e.Domain) == 0 ||
<mask> !(len(e.Client) == 4 || len(e.Client) == 16) {
<mask> return
<mask> }
<mask> client := s.getClientIP(e.Client.String())
<mask>
<mask> s.unitLock.Lock()
<mask> u := s.unit
<mask>
<mask> u.nResult[e.Result]++
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove return clientIP
</s> add return ip </s> remove s.conf.ipStart = net.ParseIP(conf.RangeStart)
</s> add s.conf.ipStart = conf.RangeStart </s> remove if len(clientAddr) == 0 {
</s> add if clientAddr == nil { </s> remove _, ok := a.allowedClients[ip]
</s> add _, ok := a.allowedClients[ipStr] </s> remove ip := util.GetSubnet(ifaceName)
if len(ip) == 0 {
</s> add ipNet := util.GetSubnet(ifaceName)
if ipNet.IP == nil { </s> remove if len(ent.IP) == 0 {
ent.IP = v
</s> add if ent.IP == nil {
ent.IP = net.ParseIP(v)
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/unit.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> } else {
<mask> u.blockedDomains[e.Domain]++
<mask> }
<mask>
<mask> u.clients[client]++
<mask> u.timeSum += uint64(e.Time)
<mask> u.nTotal++
<mask> s.unitLock.Unlock()
<mask> }
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove } else if reqData.DNS.IP != "0.0.0.0" {
</s> add } else if !reqData.DNS.IP.IsUnspecified() { </s> remove d := []string{}
</s> add d := []net.IP{} </s> remove result.V4.StaticIP.IP = util.GetSubnet(interfaceName)
</s> add result.V4.StaticIP.IP = util.GetSubnet(interfaceName).String() </s> remove } else if config.BindHost == "0.0.0.0" {
</s> add } else if config.BindHost.IsUnspecified() { </s> remove resp.IP = util.GetSubnet(interfaceName)
</s> add resp.IP = util.GetSubnet(interfaceName).String() </s> remove log.Printf("Go to %s://%s", proto, net.JoinHostPort(config.BindHost, port))
</s> add hostStr = config.BindHost.String()
log.Printf("Go to %s://%s", proto, net.JoinHostPort(hostStr, port))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/unit.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> return d
<mask> }
<mask>
<mask> func (s *statsCtx) GetTopClientsIP(maxCount uint) []string {
<mask> units, _ := s.loadUnits(s.conf.limit)
<mask> if units == nil {
<mask> return nil
<mask> }
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func (s *statsCtx) getClientIP(clientIP string) string {
if s.conf.AnonymizeClientIP {
ip := net.ParseIP(clientIP)
if ip != nil {
ip4 := ip.To4()
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip4 != nil {
clientIP = ip4.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)).String()
} else {
clientIP = ip.Mask(net.CIDRMask(AnonymizeClientIP6Mask, 128)).String()
}
</s> add func (s *statsCtx) getClientIP(ip net.IP) (clientIP net.IP) {
if s.conf.AnonymizeClientIP && ip != nil {
const AnonymizeClientIP4Mask = 16
const AnonymizeClientIP6Mask = 112
if ip.To4() != nil {
return ip.Mask(net.CIDRMask(AnonymizeClientIP4Mask, 32)) </s> remove return clientIP
</s> add return ip </s> add func ipSliceOrNil(ip net.IP) []string {
if ip == nil {
return nil
}
return []string{ip.String()}
}
</s> remove ip := IPStringFromAddr(d.Addr)
</s> add ip := IPFromAddr(d.Addr) </s> remove ip := util.GetSubnet(ifaceName)
if len(ip) == 0 {
</s> add ipNet := util.GetSubnet(ifaceName)
if ipNet.IP == nil { </s> remove macFound := clients.dhcpServer.FindMACbyIP(ipAddr)
</s> add macFound := clients.dhcpServer.FindMACbyIP(ip)
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/unit.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> m[it.Name] += it.Count
<mask> }
<mask> }
<mask> a := convertMapToArray(m, int(maxCount))
<mask> d := []string{}
<mask> for _, it := range a {
<mask> d = append(d, it.Name)
<mask> }
<mask> return d
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove d = append(d, it.Name)
</s> add d = append(d, net.ParseIP(it.Name)) </s> remove assert.Equal(t, "3.3.3.3", r.IPList[0].String())
</s> add assert.True(t, net.IP{3, 3, 3, 3}.Equal(r.IPList[0])) </s> remove if ip == addr {
</s> add if ip.Equal(addr) { </s> remove func (s *statsCtx) GetTopClientsIP(maxCount uint) []string {
</s> add func (s *statsCtx) GetTopClientsIP(maxCount uint) []net.IP { </s> remove macFound := clients.dhcpServer.FindMACbyIP(ipAddr)
</s> add macFound := clients.dhcpServer.FindMACbyIP(ip) </s> remove ip := IPStringFromAddr(d.Addr)
</s> add ip := IPFromAddr(d.Addr)
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/unit.go
|
keep keep keep keep replace keep keep keep
|
<mask> }
<mask> a := convertMapToArray(m, int(maxCount))
<mask> d := []string{}
<mask> for _, it := range a {
<mask> d = append(d, it.Name)
<mask> }
<mask> return d
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove d := []string{}
</s> add d := []net.IP{} </s> remove assert.Equal(t, "3.3.3.3", r.IPList[0].String())
</s> add assert.True(t, net.IP{3, 3, 3, 3}.Equal(r.IPList[0])) </s> remove func (s *statsCtx) GetTopClientsIP(maxCount uint) []string {
</s> add func (s *statsCtx) GetTopClientsIP(maxCount uint) []net.IP { </s> remove if ip == addr {
</s> add if ip.Equal(addr) { </s> remove ip := IPStringFromAddr(d.Addr)
</s> add ip := IPFromAddr(d.Addr) </s> remove macFound := clients.dhcpServer.FindMACbyIP(ipAddr)
</s> add macFound := clients.dhcpServer.FindMACbyIP(ip)
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/stats/unit.go
|
keep keep keep keep replace replace keep keep keep replace replace replace replace
|
<mask> return false, s.Err()
<mask> }
<mask>
<mask> func ifaceSetStaticIP(ifaceName string) (err error) {
<mask> ip := util.GetSubnet(ifaceName)
<mask> if len(ip) == 0 {
<mask> return errors.New("can't get IP address")
<mask> }
<mask>
<mask> ip4, _, err := net.ParseCIDR(ip)
<mask> if err != nil {
<mask> return err
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove return ""
</s> add return nil </s> remove if ipnet.Contains(ipAddr) {
</s> add if ipnet.Contains(ip) { </s> remove ipAddr := net.ParseIP(ip)
</s> add </s> remove add := updateStaticIPdhcpcdConf(ifaceName, ip, gatewayIP, ip4)
</s> add add := updateStaticIPdhcpcdConf(ifaceName, ipNet.String(), gatewayIP, ipNet.IP) </s> remove ip := dnsforward.IPStringFromAddr(d.Addr)
if ip == "" {
</s> add ip := dnsforward.IPFromAddr(d.Addr)
if ip == nil {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/sysutil/net_linux.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> if err != nil {
<mask> return err
<mask> }
<mask> gatewayIP := GatewayIP(ifaceName)
<mask> add := updateStaticIPdhcpcdConf(ifaceName, ip, gatewayIP, ip4)
<mask>
<mask> body, err := ioutil.ReadFile("/etc/dhcpcd.conf")
<mask> if err != nil {
<mask> return err
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove ip4, _, err := net.ParseCIDR(ip)
if err != nil {
return err
}
</s> add </s> remove if ipnet.Contains(ipAddr) {
</s> add if ipnet.Contains(ip) { </s> remove req.Question[0].Name, err = dns.ReverseAddr(ip)
</s> add req.Question[0].Name, err = dns.ReverseAddr(ip.String()) </s> remove func CheckPacketPortAvailable(host string, port int) error {
ln, err := net.ListenPacket("udp", net.JoinHostPort(host, strconv.Itoa(port)))
</s> add func CheckPacketPortAvailable(host net.IP, port int) error {
ln, err := net.ListenPacket("udp", net.JoinHostPort(host.String(), strconv.Itoa(port))) </s> remove ip := util.GetSubnet(ifaceName)
if len(ip) == 0 {
</s> add ipNet := util.GetSubnet(ifaceName)
if ipNet.IP == nil { </s> remove resp, err := w.queryAll(ip)
</s> add resp, err := w.queryAll(ip.String())
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/sysutil/net_linux.go
|
keep keep keep replace keep keep keep replace keep keep
|
<mask> ips = ah.Process("newhost", dns.TypeA)
<mask> assert.NotNil(t, ips)
<mask> assert.Len(t, ips, 1)
<mask> assert.Equal(t, "127.0.0.2", ips[0].String())
<mask> }
<mask>
<mask> func TestIP(t *testing.T) {
<mask> assert.Equal(t, "127.0.0.1", DNSUnreverseAddr("1.0.0.127.in-addr.arpa").String())
<mask> assert.Equal(t, "::abcd:1234", DNSUnreverseAddr("4.3.2.1.d.c.b.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa").String())
<mask> assert.Equal(t, "::abcd:1234", DNSUnreverseAddr("4.3.2.1.d.c.B.A.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa").String())
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove assert.Equal(t, answer, ip.String())
</s> add assert.Equal(t, answer, ip) </s> remove assert.Equal(t, "3.3.3.3", r.IPList[0].String())
</s> add assert.True(t, net.IP{3, 3, 3, 3}.Equal(r.IPList[0])) </s> remove assert.Equal(t, "2.2.2.2", r.IPList[0].String())
</s> add assert.True(t, net.IP{2, 2, 2, 2}.Equal(r.IPList[0])) </s> remove assert.Equal(t, "1.1.1.1", r.IPList[0].String())
</s> add assert.True(t, net.IP{1, 1, 1, 1}.Equal(r.IPList[0])) </s> remove assert.Equal(t, "2.2.2.2", r.IPList[0].String())
</s> add assert.True(t, net.IP{2, 2, 2, 2}.Equal(r.IPList[0]))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/util/autohosts_test.go
|
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
|
<mask> )
<mask>
<mask> // NetInterface represents a list of network interfaces
<mask> type NetInterface struct {
<mask> Name string // Network interface name
<mask> MTU int // MTU
<mask> HardwareAddr string // Hardware address
<mask> Addresses []string // Array with the network interface addresses
<mask> Subnets []string // Array with CIDR addresses of this network interface
<mask> Flags string // Network interface flags (up, broadcast, etc)
<mask> }
<mask>
<mask> // GetValidNetInterfaces returns interfaces that are eligible for DNS and/or DHCP
<mask> // invalid interface is a ppp interface or the one that doesn't allow broadcasts
<mask> func GetValidNetInterfaces() ([]net.Interface, error) {
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove // GetSubnet - Get IP address with netmask for the specified interface
// Returns an empty string if it fails to find it
func GetSubnet(ifaceName string) string {
</s> add // GetSubnet returns pointer to net.IPNet for the specified interface or nil if
// the search fails.
func GetSubnet(ifaceName string) *net.IPNet { </s> remove // GetInterfaceByIP - Get interface name by its IP address.
func GetInterfaceByIP(ip string) string {
</s> add // GetInterfaceByIP returns the name of interface containing provided ip.
func GetInterfaceByIP(ip net.IP) string { </s> remove Addresses []string `json:"ip_addresses"`
</s> add Addresses []net.IP `json:"ip_addresses"` </s> remove if config.DNS.BindHost == "0.0.0.0" {
</s> add if config.DNS.BindHost.IsUnspecified() { </s> remove // TODO(e.burkov): this should removed with the API v1 when the appropriate
</s> add // TODO(e.burkov): This should removed with the API v1 when the appropriate </s> remove // TODO(e.burkov): this should removed with the API v1 when the appropriate
</s> add // TODO(e.burkov): This should removed with the API v1 when the appropriate
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/util/network.go
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> // ignore link-local
<mask> if ipNet.IP.IsLinkLocalUnicast() {
<mask> continue
<mask> }
<mask> netIface.Addresses = append(netIface.Addresses, ipNet.IP.String())
<mask> netIface.Subnets = append(netIface.Subnets, ipNet.String())
<mask> }
<mask>
<mask> // Discard interfaces with no addresses
<mask> if len(netIface.Addresses) != 0 {
<mask> netInterfaces = append(netInterfaces, netIface)
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove _, _ = r.clients.AddHost(ip, host, ClientSourceRDNS)
</s> add _, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS) </s> remove if ipnet.Contains(ipAddr) {
</s> add if ipnet.Contains(ip) { </s> remove if testParseOk(t).bindHost != "" {
</s> add if testParseOk(t).bindHost != nil { </s> remove IP: bindHost,
</s> add IP: config.DNS.BindHost, </s> remove log.Printf("Go to %s://%s (BETA)", proto, net.JoinHostPort(config.BindHost, strconv.Itoa(config.BetaBindPort)))
</s> add log.Printf("Go to %s://%s (BETA)", proto, net.JoinHostPort(hostStr, strconv.Itoa(config.BetaBindPort))) </s> remove IP: bindHost,
</s> add IP: config.DNS.BindHost,
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/util/network.go
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> return netInterfaces, nil
<mask> }
<mask>
<mask> // GetInterfaceByIP - Get interface name by its IP address.
<mask> func GetInterfaceByIP(ip string) string {
<mask> ifaces, err := GetValidNetInterfacesForWeb()
<mask> if err != nil {
<mask> return ""
<mask> }
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove // GetSubnet - Get IP address with netmask for the specified interface
// Returns an empty string if it fails to find it
func GetSubnet(ifaceName string) string {
</s> add // GetSubnet returns pointer to net.IPNet for the specified interface or nil if
// the search fails.
func GetSubnet(ifaceName string) *net.IPNet { </s> remove return ""
</s> add return nil </s> remove ip := util.GetSubnet(ifaceName)
if len(ip) == 0 {
</s> add ipNet := util.GetSubnet(ifaceName)
if ipNet.IP == nil { </s> remove func CheckPortAvailable(host string, port int) error {
ln, err := net.Listen("tcp", net.JoinHostPort(host, strconv.Itoa(port)))
</s> add func CheckPortAvailable(host net.IP, port int) error {
ln, err := net.Listen("tcp", net.JoinHostPort(host.String(), strconv.Itoa(port))) </s> remove ip4, _, err := net.ParseCIDR(ip)
if err != nil {
return err
}
</s> add </s> remove func CheckPacketPortAvailable(host string, port int) error {
ln, err := net.ListenPacket("udp", net.JoinHostPort(host, strconv.Itoa(port)))
</s> add func CheckPacketPortAvailable(host net.IP, port int) error {
ln, err := net.ListenPacket("udp", net.JoinHostPort(host.String(), strconv.Itoa(port)))
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/util/network.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> for _, iface := range ifaces {
<mask> for _, addr := range iface.Addresses {
<mask> if ip == addr {
<mask> return iface.Name
<mask> }
<mask> }
<mask> }
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove log.Printf("Go to %s://%s", proto, net.JoinHostPort(addr, strconv.Itoa(config.BindPort)))
</s> add hostStr = addr.String()
log.Printf("Go to %s://%s", proto, net.JoinHostPort(hostStr, strconv.Itoa(config.BindPort))) </s> remove log.Printf("Go to %s://%s (BETA)", proto, net.JoinHostPort(addr, strconv.Itoa(config.BetaBindPort)))
</s> add log.Printf("Go to %s://%s (BETA)", proto, net.JoinHostPort(hostStr, strconv.Itoa(config.BetaBindPort))) </s> remove macFound := clients.dhcpServer.FindMACbyIP(ipAddr)
</s> add macFound := clients.dhcpServer.FindMACbyIP(ip) </s> remove topClients := Context.stats.GetTopClientsIP(topClientsNumber)
for _, ip := range topClients {
ipAddr := net.ParseIP(ip)
if !ipAddr.IsLoopback() {
</s> add for _, ip := range Context.stats.GetTopClientsIP(topClientsNumber) {
if !ip.IsLoopback() { </s> remove return true, ip
</s> add return true, ipStr </s> remove ipAddr := net.ParseIP(ip)
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/util/network.go
|
keep keep keep replace replace replace keep keep keep replace keep keep keep
|
<mask> return ""
<mask> }
<mask>
<mask> // GetSubnet - Get IP address with netmask for the specified interface
<mask> // Returns an empty string if it fails to find it
<mask> func GetSubnet(ifaceName string) string {
<mask> netIfaces, err := GetValidNetInterfacesForWeb()
<mask> if err != nil {
<mask> log.Error("Could not get network interfaces info: %v", err)
<mask> return ""
<mask> }
<mask>
<mask> for _, netIface := range netIfaces {
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove // GetInterfaceByIP - Get interface name by its IP address.
func GetInterfaceByIP(ip string) string {
</s> add // GetInterfaceByIP returns the name of interface containing provided ip.
func GetInterfaceByIP(ip net.IP) string { </s> remove func (a *accessCtx) IsBlockedIP(ip string) (bool, string) {
</s> add func (a *accessCtx) IsBlockedIP(ip net.IP) (bool, string) {
ipStr := ip.String()
</s> remove ipAddr := net.ParseIP(ip)
</s> add </s> remove Name string // Network interface name
MTU int // MTU
HardwareAddr string // Hardware address
Addresses []string // Array with the network interface addresses
Subnets []string // Array with CIDR addresses of this network interface
Flags string // Network interface flags (up, broadcast, etc)
</s> add Name string // Network interface name
MTU int // MTU
HardwareAddr string // Hardware address
Addresses []net.IP // Array with the network interface addresses
Subnets []*net.IPNet // Array with CIDR addresses of this network interface
Flags string // Network interface flags (up, broadcast, etc) </s> remove if ipnet.Contains(ipAddr) {
</s> add if ipnet.Contains(ip) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/util/network.go
|
keep keep replace keep keep keep replace replace keep keep keep
|
<mask> }
<mask>
<mask> return ""
<mask> }
<mask>
<mask> // CheckPortAvailable - check if TCP port is available
<mask> func CheckPortAvailable(host string, port int) error {
<mask> ln, err := net.Listen("tcp", net.JoinHostPort(host, strconv.Itoa(port)))
<mask> if err != nil {
<mask> return err
<mask> }
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func CheckPacketPortAvailable(host string, port int) error {
ln, err := net.ListenPacket("udp", net.JoinHostPort(host, strconv.Itoa(port)))
</s> add func CheckPacketPortAvailable(host net.IP, port int) error {
ln, err := net.ListenPacket("udp", net.JoinHostPort(host.String(), strconv.Itoa(port))) </s> remove req.Question[0].Name, err = dns.ReverseAddr(ip)
</s> add req.Question[0].Name, err = dns.ReverseAddr(ip.String()) </s> remove add := updateStaticIPdhcpcdConf(ifaceName, ip, gatewayIP, ip4)
</s> add add := updateStaticIPdhcpcdConf(ifaceName, ipNet.String(), gatewayIP, ipNet.IP) </s> remove // GetInterfaceByIP - Get interface name by its IP address.
func GetInterfaceByIP(ip string) string {
</s> add // GetInterfaceByIP returns the name of interface containing provided ip.
func GetInterfaceByIP(ip net.IP) string { </s> remove ip4, _, err := net.ParseCIDR(ip)
if err != nil {
return err
}
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/util/network.go
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> return nil
<mask> }
<mask>
<mask> // CheckPacketPortAvailable - check if UDP port is available
<mask> func CheckPacketPortAvailable(host string, port int) error {
<mask> ln, err := net.ListenPacket("udp", net.JoinHostPort(host, strconv.Itoa(port)))
<mask> if err != nil {
<mask> return err
<mask> }
<mask> _ = ln.Close()
<mask>
</s> Pull request: 2508 ip conversion vol.2
Merge in DNS/adguard-home from 2508-ip-conversion-vol2 to master
Closes #2508.
Squashed commit of the following:
commit 5b9d33f9cd352756831f63e34c4aea48674628c1
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:15:17 2021 +0300
util: replace net.IPNet with pointer
commit 680126de7d59464077f9edf1bbaa925dd3fcee19
Merge: d3ba6a6c 5a50efad
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 20 17:02:41 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit d3ba6a6cdd01c0aa736418fdb86ed40120169fe9
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 18:29:54 2021 +0300
all: remove last conversion
commit 88b63f11a6c3f8705d7fa0c448c50dd646cc9214
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 19 14:12:45 2021 +0300
all: improve code quality
commit 71af60c70a0dbaf55e2221023d6d2e4993c9e9a7
Merge: 98af3784 9f75725d
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 17:13:27 2021 +0300
Merge branch 'master' into 2508-ip-conversion-vol2
commit 98af3784ce44d0993d171653c13d6e83bb8d1e6a
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:32:53 2021 +0300
all: log changes
commit e99595a172bae1e844019d344544be84ddd65e4e
Author: Eugene Burkov <[email protected]>
Date: Mon Jan 18 16:06:49 2021 +0300
all: fix or remove remaining net.IP <-> string conversions
commit 7fd0634ce945f7e4c9b856684c5199f8a84a543e
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 15 15:36:17 2021 +0300
all: remove redundant net.IP <-> string converions
commit 5df8af030421237d41b67ed659f83526cc258199
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:35:25 2021 +0300
stats: remove redundant net.IP <-> string conversion
commit fbe4e3fc015e6898063543a90c04401d76dbb18f
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 14 16:20:35 2021 +0300
querylog: remove redundant net.IP <-> string conversion </s> remove func CheckPortAvailable(host string, port int) error {
ln, err := net.Listen("tcp", net.JoinHostPort(host, strconv.Itoa(port)))
</s> add func CheckPortAvailable(host net.IP, port int) error {
ln, err := net.Listen("tcp", net.JoinHostPort(host.String(), strconv.Itoa(port))) </s> remove return ""
</s> add return nil </s> remove add := updateStaticIPdhcpcdConf(ifaceName, ip, gatewayIP, ip4)
</s> add add := updateStaticIPdhcpcdConf(ifaceName, ipNet.String(), gatewayIP, ipNet.IP) </s> remove ip4, _, err := net.ParseCIDR(ip)
if err != nil {
return err
}
</s> add </s> remove req.Question[0].Name, err = dns.ReverseAddr(ip)
</s> add req.Question[0].Name, err = dns.ReverseAddr(ip.String()) </s> remove if ipnet.Contains(ipAddr) {
</s> add if ipnet.Contains(ip) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fab31beaeb8c7d1c9892746bbf37e99d4f9dc01
|
internal/util/network.go
|
keep keep add keep keep keep keep keep keep
|
<mask> export const dnsStatusRequest = createAction('DNS_STATUS_REQUEST');
<mask> export const dnsStatusFailure = createAction('DNS_STATUS_FAILURE');
<mask> export const dnsStatusSuccess = createAction('DNS_STATUS_SUCCESS');
<mask>
<mask> export const getDnsStatus = () => async (dispatch) => {
<mask> dispatch(dnsStatusRequest());
<mask>
<mask> const handleRequestError = () => {
<mask> dispatch(addErrorToast({ error: 'dns_status_error' }));
</s> - client: add setDnsRunningStatus action </s> remove if (dnsStatus) {
</s> add const { running } = dnsStatus;
const runningStatus = dnsStatus && running;
if (runningStatus === true) { </s> add [actions.setDnsRunningStatus]: (state, { payload }) =>
({ ...state, isCoreRunning: payload }), </s> remove isCoreRunning: running,
</s> add isCoreRunning: true, </s> remove running,
</s> add </s> add } else {
dispatch(setDnsRunningStatus(running));
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fade498b910a2492b2e214f0b2a706b51548b34
|
client/src/actions/index.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> };
<mask>
<mask> const handleRequestSuccess = (response) => {
<mask> const dnsStatus = response.data;
<mask> if (dnsStatus) {
<mask> dispatch(dnsStatusSuccess(dnsStatus));
<mask> dispatch(getVersion());
<mask> dispatch(getTlsStatus());
<mask> dispatch(getProfile());
<mask> }
</s> - client: add setDnsRunningStatus action </s> add } else {
dispatch(setDnsRunningStatus(running)); </s> add export const setDnsRunningStatus = createAction('SET_DNS_RUNNING_STATUS'); </s> add [actions.setDnsRunningStatus]: (state, { payload }) =>
({ ...state, isCoreRunning: payload }), </s> remove isCoreRunning: running,
</s> add isCoreRunning: true, </s> remove running,
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fade498b910a2492b2e214f0b2a706b51548b34
|
client/src/actions/index.js
|
keep add keep keep keep keep
|
<mask> dispatch(getTlsStatus());
<mask> dispatch(getProfile());
<mask> }
<mask> };
<mask>
<mask> try {
</s> - client: add setDnsRunningStatus action </s> remove if (dnsStatus) {
</s> add const { running } = dnsStatus;
const runningStatus = dnsStatus && running;
if (runningStatus === true) { </s> add [actions.setDnsRunningStatus]: (state, { payload }) =>
({ ...state, isCoreRunning: payload }), </s> remove running,
</s> add </s> add export const setDnsRunningStatus = createAction('SET_DNS_RUNNING_STATUS'); </s> remove isCoreRunning: running,
</s> add isCoreRunning: true,
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fade498b910a2492b2e214f0b2a706b51548b34
|
client/src/actions/index.js
|
keep add keep keep keep keep keep
|
<mask> const dashboard = handleActions(
<mask> {
<mask> [actions.dnsStatusRequest]: state => ({ ...state, processing: true }),
<mask> [actions.dnsStatusFailure]: state => ({ ...state, processing: false }),
<mask> [actions.dnsStatusSuccess]: (state, { payload }) => {
<mask> const {
<mask> version,
</s> - client: add setDnsRunningStatus action </s> remove running,
</s> add </s> add export const setDnsRunningStatus = createAction('SET_DNS_RUNNING_STATUS'); </s> remove if (dnsStatus) {
</s> add const { running } = dnsStatus;
const runningStatus = dnsStatus && running;
if (runningStatus === true) { </s> remove isCoreRunning: running,
</s> add isCoreRunning: true, </s> add } else {
dispatch(setDnsRunningStatus(running));
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fade498b910a2492b2e214f0b2a706b51548b34
|
client/src/reducers/index.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> [actions.dnsStatusFailure]: state => ({ ...state, processing: false }),
<mask> [actions.dnsStatusSuccess]: (state, { payload }) => {
<mask> const {
<mask> version,
<mask> running,
<mask> dns_port: dnsPort,
<mask> dns_addresses: dnsAddresses,
<mask> upstream_dns: upstreamDns,
<mask> bootstrap_dns: bootstrapDns,
<mask> all_servers: allServers,
</s> - client: add setDnsRunningStatus action </s> add [actions.setDnsRunningStatus]: (state, { payload }) =>
({ ...state, isCoreRunning: payload }), </s> remove isCoreRunning: running,
</s> add isCoreRunning: true, </s> remove if (dnsStatus) {
</s> add const { running } = dnsStatus;
const runningStatus = dnsStatus && running;
if (runningStatus === true) { </s> add export const setDnsRunningStatus = createAction('SET_DNS_RUNNING_STATUS'); </s> add } else {
dispatch(setDnsRunningStatus(running));
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fade498b910a2492b2e214f0b2a706b51548b34
|
client/src/reducers/index.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> http_port: httpPort,
<mask> } = payload;
<mask> const newState = {
<mask> ...state,
<mask> isCoreRunning: running,
<mask> processing: false,
<mask> dnsVersion: version,
<mask> dnsPort,
<mask> dnsAddresses,
<mask> upstreamDns: (upstreamDns && upstreamDns.join('\n')) || '',
</s> - client: add setDnsRunningStatus action </s> remove running,
</s> add </s> remove if (dnsStatus) {
</s> add const { running } = dnsStatus;
const runningStatus = dnsStatus && running;
if (runningStatus === true) { </s> add export const setDnsRunningStatus = createAction('SET_DNS_RUNNING_STATUS'); </s> add [actions.setDnsRunningStatus]: (state, { payload }) =>
({ ...state, isCoreRunning: payload }), </s> add } else {
dispatch(setDnsRunningStatus(running));
|
https://github.com/AdguardTeam/AdGuardHome/commit/7fade498b910a2492b2e214f0b2a706b51548b34
|
client/src/reducers/index.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> go 1.16
<mask>
<mask> require (
<mask> github.com/AdguardTeam/dnsproxy v0.39.4
<mask> github.com/AdguardTeam/golibs v0.9.2
<mask> github.com/AdguardTeam/urlfilter v0.14.6
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/ameshkov/dnscrypt/v2 v2.2.2
<mask> github.com/digineo/go-ipset/v2 v2.2.1
</s> Pull request: 3551 fix index panic
Merge in DNS/adguard-home from 3551-dont-panic to master
Updates #3551.
Squashed commit of the following:
commit 45560e154b9256c5facc7cff282b50d8e09e8c15
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 8 20:00:27 2021 +0300
all: upd dnsproxy </s> remove github.com/AdguardTeam/dnsproxy v0.39.4 h1:vjcogr0qpSTvRYzbXabBXblfzYpx+LOn91kjtnYgcrU=
github.com/AdguardTeam/dnsproxy v0.39.4/go.mod h1:JZUxXM70BUlAmMaJEPa6Wh+Tz7eBAQx6DM1GMt+Ff5E=
</s> add github.com/AdguardTeam/dnsproxy v0.39.5 h1:SQorhRLR1241t6hy9CiAGZUjRULhsDJlPJTl0UGX8uw=
github.com/AdguardTeam/dnsproxy v0.39.5/go.mod h1:eDpJKAdkHORRwAedjuERv+7SWlcz4cn+5uwrbUAWHRY= </s> remove github.com/ameshkov/dnscrypt/v2 v2.1.3/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo=
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/80548233ba0df565074b156ea6cb62e8818dde04
|
go.mod
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
<mask> git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
<mask> github.com/AdguardTeam/dhcp v0.0.0-20210519141215-51808c73c0bf h1:gc042VRSIRSUzZ+Px6xQCRWNJZTaPkomisDfUZmoFNk=
<mask> github.com/AdguardTeam/dhcp v0.0.0-20210519141215-51808c73c0bf/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI=
<mask> github.com/AdguardTeam/dnsproxy v0.39.4 h1:vjcogr0qpSTvRYzbXabBXblfzYpx+LOn91kjtnYgcrU=
<mask> github.com/AdguardTeam/dnsproxy v0.39.4/go.mod h1:JZUxXM70BUlAmMaJEPa6Wh+Tz7eBAQx6DM1GMt+Ff5E=
<mask> github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/golibs v0.9.2 h1:H3BDFkaosxvb+UgFlNVyN66GZ+JglcZULnJ7z7PukyQ=
<mask> github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY=
<mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
</s> Pull request: 3551 fix index panic
Merge in DNS/adguard-home from 3551-dont-panic to master
Updates #3551.
Squashed commit of the following:
commit 45560e154b9256c5facc7cff282b50d8e09e8c15
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 8 20:00:27 2021 +0300
all: upd dnsproxy </s> remove github.com/AdguardTeam/dnsproxy v0.39.4
</s> add github.com/AdguardTeam/dnsproxy v0.39.5 </s> remove github.com/ameshkov/dnscrypt/v2 v2.1.3/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo=
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/80548233ba0df565074b156ea6cb62e8818dde04
|
go.sum
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us=
<mask> github.com/ameshkov/dnscrypt/v2 v2.1.3/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo=
<mask> github.com/ameshkov/dnscrypt/v2 v2.2.2 h1:lxtS1iSA2EjTOMToSi+2+rwspNA+b/wG5/JpccvE9CU=
<mask> github.com/ameshkov/dnscrypt/v2 v2.2.2/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo=
<mask> github.com/ameshkov/dnsstamps v1.0.1/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A=
<mask> github.com/ameshkov/dnsstamps v1.0.3 h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1OYVo=
<mask> github.com/ameshkov/dnsstamps v1.0.3/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A=
</s> Pull request: 3551 fix index panic
Merge in DNS/adguard-home from 3551-dont-panic to master
Updates #3551.
Squashed commit of the following:
commit 45560e154b9256c5facc7cff282b50d8e09e8c15
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 8 20:00:27 2021 +0300
all: upd dnsproxy </s> remove github.com/AdguardTeam/dnsproxy v0.39.4
</s> add github.com/AdguardTeam/dnsproxy v0.39.5 </s> remove github.com/AdguardTeam/dnsproxy v0.39.4 h1:vjcogr0qpSTvRYzbXabBXblfzYpx+LOn91kjtnYgcrU=
github.com/AdguardTeam/dnsproxy v0.39.4/go.mod h1:JZUxXM70BUlAmMaJEPa6Wh+Tz7eBAQx6DM1GMt+Ff5E=
</s> add github.com/AdguardTeam/dnsproxy v0.39.5 h1:SQorhRLR1241t6hy9CiAGZUjRULhsDJlPJTl0UGX8uw=
github.com/AdguardTeam/dnsproxy v0.39.5/go.mod h1:eDpJKAdkHORRwAedjuERv+7SWlcz4cn+5uwrbUAWHRY=
|
https://github.com/AdguardTeam/AdGuardHome/commit/80548233ba0df565074b156ea6cb62e8818dde04
|
go.sum
|
keep keep add keep keep keep keep keep keep
|
<mask> "load_balancing_desc": "Query one upstream server at a time. AdGuard Home will use the weighted random algorithm to pick the server so that the fastest server is used more often.",
<mask> "bootstrap_dns": "Bootstrap DNS servers",
<mask> "bootstrap_dns_desc": "Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams.",
<mask> "check_dhcp_servers": "Check for DHCP servers",
<mask> "save_config": "Save configuration",
<mask> "enabled_dhcp": "DHCP server enabled",
<mask> "disabled_dhcp": "DHCP server disabled",
<mask> "unavailable_dhcp": "DHCP is unavailable",
<mask> "unavailable_dhcp_desc": "AdGuard Home cannot run a DHCP server on your OS",
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove req: "{\"bootstrap_dns\":[\"a\"]}",
</s> add </s> remove wantGet: defaultConfJSON,
</s> add </s> remove req: "{\"cache_ttl_min\":1024,\"cache_ttl_max\":512}",
</s> add </s> remove wantGet: defaultConfJSON,
</s> add </s> remove // Exchange - send DNS request to an upstream server and receive response
// No request/response filtering is performed.
// Query log and Stats are not updated.
// This method may be called before Start().
func (s *Server) Exchange(req *dns.Msg) (*dns.Msg, error) {
</s> add // RDNSExchanger is a resolver for clients' addresses.
type RDNSExchanger interface {
// Exchange tries to resolve the ip in a suitable way, e.g. either as
// local or as external.
Exchange(ip net.IP) (host string, err error)
}
const (
// rDNSEmptyAnswerErr is returned by Exchange method when the answer
// section of respond is empty.
rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
// rDNSNotPTRErr is returned by Exchange method when the response is not
// of PTR type.
rDNSNotPTRErr agherr.Error = "the response is not a ptr"
)
// Exchange implements the RDNSExchanger interface for *Server.
func (s *Server) Exchange(ip net.IP) (host string, err error) { </s> add // ResolveClients signals if the RDNS should resolve clients' addresses.
ResolveClients bool
// LocalPTRResolvers is a slice of addresses to be used as upstreams for
// resolving PTR queries for local addresses.
LocalPTRResolvers []string
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/__locales/en.json
|
keep keep add keep keep keep keep
|
<mask> data.bootstrap_dns = splitByNewLine(config.bootstrap_dns);
<mask> hasDnsSettings = true;
<mask> }
<mask> if (Object.prototype.hasOwnProperty.call(data, 'upstream_dns')) {
<mask> data.upstream_dns = splitByNewLine(config.upstream_dns);
<mask> hasDnsSettings = true;
<mask> }
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add if dc.LocalPTRUpstreams != nil {
s.conf.LocalPTRResolvers = *dc.LocalPTRUpstreams
restart = true
}
</s> remove for _, host := range req.Upstreams {
err = checkDNS(host, req.BootstrapDNS)
if err != nil {
log.Info("%v", err)
result[host] = err.Error()
} else {
result[host] = "OK"
</s> add if t, ok := reply.Answer[0].(*dns.A); ok {
if !net.IPv4(8, 8, 8, 8).Equal(t.A) {
return fmt.Errorf("wrong response") </s> remove setupResolvers()
</s> add </s> remove } else if res.Reason == dnsfilter.Rewritten || res.Reason == dnsfilter.RewrittenAutoHosts {
</s> add } else if res.Reason.In(dnsfilter.Rewritten, dnsfilter.RewrittenAutoHosts) { </s> remove ctx.setts = s.getClientRequestFilteringSettings(ctx)
</s> add if ctx.setts == nil {
ctx.setts = s.getClientRequestFilteringSettings(ctx)
} </s> remove if Context.dnsServer != nil {
</s> add if s := Context.dnsServer; s != nil {
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/actions/dnsConfig.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> export const testUpstreamFailure = createAction('TEST_UPSTREAM_FAILURE');
<mask> export const testUpstreamSuccess = createAction('TEST_UPSTREAM_SUCCESS');
<mask>
<mask> export const testUpstream = (
<mask> { bootstrap_dns, upstream_dns }, upstream_dns_file,
<mask> ) => async (dispatch) => {
<mask> dispatch(testUpstreamRequest());
<mask> try {
<mask> const removeComments = compose(filterOutComments, splitByNewLine);
<mask>
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file)); </s> add resolve_clients,
local_ptr_upstreams, </s> remove return <div
</s> add return (
<div </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/actions/index.js
|
keep add keep keep keep keep
|
<mask> const config = {
<mask> bootstrap_dns: splitByNewLine(bootstrap_dns),
<mask> ...(upstream_dns_file ? null : {
<mask> upstream_dns: removeComments(upstream_dns),
<mask> }),
<mask> };
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add resolve_clients,
local_ptr_upstreams, </s> add local_ptr_upstreams: (local_ptr_upstreams && local_ptr_upstreams.join('\n')) || '', </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file)); </s> remove { bootstrap_dns, upstream_dns }, upstream_dns_file,
</s> add { bootstrap_dns, upstream_dns, local_ptr_upstreams }, upstream_dns_file, </s> add resolve_clients,
local_ptr_upstreams, </s> remove />
</div>;
</s> add />
</div>
);
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/actions/index.js
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> };
<mask>
<mask> export const testUpstreamWithFormValues = () => async (dispatch, getState) => {
<mask> const { upstream_dns_file } = getState().dnsConfig;
<mask> const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
<mask> return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
<mask> };
<mask>
<mask> export const changeLanguageRequest = createAction('CHANGE_LANGUAGE_REQUEST');
<mask> export const changeLanguageFailure = createAction('CHANGE_LANGUAGE_FAILURE');
<mask> export const changeLanguageSuccess = createAction('CHANGE_LANGUAGE_SUCCESS');
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove { bootstrap_dns, upstream_dns }, upstream_dns_file,
</s> add { bootstrap_dns, upstream_dns, local_ptr_upstreams }, upstream_dns_file, </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> remove return <div
</s> add return (
<div </s> add resolve_clients,
local_ptr_upstreams, </s> add private_upstream: splitByNewLine(local_ptr_upstreams),
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/actions/index.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> import { Field, reduxForm } from 'redux-form';
<mask> import { Trans, useTranslation } from 'react-i18next';
<mask> import classnames from 'classnames';
<mask> import Examples from './Examples';
<mask> import { renderRadioField, renderTextareaField } from '../../../../helpers/form';
<mask> import {
<mask> DNS_REQUEST_OPTIONS,
<mask> FORM_NAME,
<mask> isFirefox,
<mask> UPSTREAM_CONFIGURATION_WIKI_LINK,
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove "strings"
</s> add </s> remove "fmt"
</s> add </s> add "bytes"
"encoding/json" </s> remove func checkDNS(input string, bootstrap []string) error {
</s> add func checkDNS(input string, bootstrap []string, ef excFunc) (err error) { </s> remove // separate upstream from domains list
input, useDefault, err := separateUpstream(input)
if err != nil {
</s> add // Separate upstream from domains list.
var useDefault bool
if input, useDefault, err = separateUpstream(input); err != nil { </s> remove s := util.SplitNext(&d, '\n')
</s> add s := aghstrings.SplitNext(&d, '\n')
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/components/Settings/Dns/Upstream/Form.js
|
keep keep keep replace keep keep replace replace keep keep keep keep
|
<mask> const processingTestUpstream = useSelector((state) => state.settings.processingTestUpstream);
<mask> const processingSetConfig = useSelector((state) => state.dnsConfig.processingSetConfig);
<mask>
<mask> return <div
<mask> key={placeholder}
<mask> className={classnames('col-12 mb-4', containerClass)}
<mask> >
<mask> <Field
<mask> id={name}
<mask> value={value}
<mask> name={name}
<mask> component={component}
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add resolve_clients,
local_ptr_upstreams, </s> remove { bootstrap_dns, upstream_dns }, upstream_dns_file,
</s> add { bootstrap_dns, upstream_dns, local_ptr_upstreams }, upstream_dns_file, </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file)); </s> add resolve_clients,
local_ptr_upstreams, </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/components/Settings/Dns/Upstream/Form.js
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> subtitle={t(subtitle)}
<mask> disabled={processingSetConfig || processingTestUpstream}
<mask> normalizeOnBlur={normalizeOnBlur}
<mask> onScroll={onScroll}
<mask> />
<mask> </div>;
<mask> };
<mask>
<mask> renderField.propTypes = {
<mask> name: PropTypes.string.isRequired,
<mask> component: PropTypes.element.isRequired,
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add local_ptr_upstreams: (local_ptr_upstreams && local_ptr_upstreams.join('\n')) || '', </s> add private_upstream: splitByNewLine(local_ptr_upstreams), </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> remove ln := util.SplitNext(&data, '\n')
</s> add ln := aghstrings.SplitNext(&data, '\n') </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file));
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/components/Settings/Dns/Upstream/Form.js
|
keep keep keep keep replace replace replace replace keep keep keep keep keep
|
<mask> <Trans components={components}>upstream_dns_help</Trans>
<mask> {' '}
<mask> <Trans components={[
<mask> <a
<mask> href="https://kb.adguard.com/general/dns-providers"
<mask> target="_blank"
<mask> rel="noopener noreferrer"
<mask> key="0"
<mask> >
<mask> DNS providers
<mask> </a>,
<mask> ]}>
<mask> dns_providers
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove >
<Field
</s> add >
<Field </s> remove return <div
</s> add return (
<div </s> remove // No need to check this DNS server
</s> add // No need to check this DNS server. </s> add err = s.setupResolvers(s.conf.LocalPTRResolvers)
if err != nil {
return fmt.Errorf("setting up resolvers: %w", err)
}
</s> add 'private_upstream':
'type': 'array'
'description': >
Local PTR resolvers, port is optional after colon. Empty value will
reset it to default values.
'items':
'type': 'string'
'example':
- 'tls://1.1.1.1'
- 'tls://1.0.0.1' </s> add "local_ptr_title": "Private DNS servers",
"local_ptr_desc": "The DNS server or servers that AdGuard Home will use for queries for locally served resources. For instance, this server will be used for resolving clients' hostnames for the clients with private IP addresses. If not set, AdGuard Home will automatically use your default DNS resolver.",
"local_ptr_placeholder": "Enter one server address per line",
"resolve_clients_title": "Enable clients' hostnames resolution",
"resolve_clients_desc": "If enabled, AdGuard Home will attempt to automatically resolve clients' hostnames from their IP addresses by sending a PTR query to a corresponding resolver (private DNS server for local clients, upstream server for clients with public IP).",
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/components/Settings/Dns/Upstream/Form.js
|
keep keep add keep keep keep keep keep keep
|
<mask> upstream_dns,
<mask> bootstrap_dns,
<mask> upstream_mode,
<mask> } = useSelector((state) => state.dnsConfig, shallowEqual);
<mask>
<mask> const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file);
<mask>
<mask> const handleSubmit = (values) => {
<mask> const {
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove return <div
</s> add return (
<div </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file)); </s> remove { bootstrap_dns, upstream_dns }, upstream_dns_file,
</s> add { bootstrap_dns, upstream_dns, local_ptr_upstreams }, upstream_dns_file, </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> add local_ptr_upstreams,
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/components/Settings/Dns/Upstream/index.js
|
keep add keep keep keep keep keep keep
|
<mask> upstream_dns,
<mask> upstream_mode,
<mask> } = values;
<mask>
<mask> const dnsConfig = {
<mask> bootstrap_dns,
<mask> upstream_mode,
<mask> resolve_clients,
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file)); </s> remove { bootstrap_dns, upstream_dns }, upstream_dns_file,
</s> add { bootstrap_dns, upstream_dns, local_ptr_upstreams }, upstream_dns_file, </s> add local_ptr_upstreams,
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/components/Settings/Dns/Upstream/index.js
|
keep keep keep add keep keep keep keep
|
<mask>
<mask> const dnsConfig = {
<mask> bootstrap_dns,
<mask> upstream_mode,
<mask> ...(upstream_dns_file ? null : { upstream_dns }),
<mask> };
<mask>
<mask> dispatch(setDnsConfig(dnsConfig));
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add private_upstream: splitByNewLine(local_ptr_upstreams), </s> add resolve_clients,
local_ptr_upstreams, </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file)); </s> remove { bootstrap_dns, upstream_dns }, upstream_dns_file,
</s> add { bootstrap_dns, upstream_dns, local_ptr_upstreams }, upstream_dns_file, </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams,
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/components/Settings/Dns/Upstream/index.js
|
keep add keep keep keep keep
|
<mask> bootstrap_dns,
<mask> upstream_mode,
<mask> }}
<mask> onSubmit={handleSubmit}
<mask> />
<mask> </div>
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove />
</div>;
</s> add />
</div>
); </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file)); </s> add local_ptr_upstreams,
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/components/Settings/Dns/Upstream/index.js
|
keep keep keep add keep keep keep keep
|
<mask> blocking_ipv4,
<mask> blocking_ipv6,
<mask> upstream_dns,
<mask> bootstrap_dns,
<mask> ...values
<mask> } = payload;
<mask>
<mask> return {
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove const { bootstrap_dns, upstream_dns } = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({ bootstrap_dns, upstream_dns }, upstream_dns_file));
</s> add const {
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
} = getState().form[FORM_NAME.UPSTREAM].values;
return dispatch(testUpstream({
bootstrap_dns,
upstream_dns,
local_ptr_upstreams,
}, upstream_dns_file)); </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams, </s> remove { bootstrap_dns, upstream_dns }, upstream_dns_file,
</s> add { bootstrap_dns, upstream_dns, local_ptr_upstreams }, upstream_dns_file, </s> add resolve_clients,
local_ptr_upstreams, </s> add resolve_clients,
local_ptr_upstreams,
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/reducers/dnsConfig.js
|
keep keep keep add keep keep keep keep
|
<mask> blocking_ipv4: blocking_ipv4 || DEFAULT_BLOCKING_IPV4,
<mask> blocking_ipv6: blocking_ipv6 || DEFAULT_BLOCKING_IPV6,
<mask> upstream_dns: (upstream_dns && upstream_dns.join('\n')) || '',
<mask> bootstrap_dns: (bootstrap_dns && bootstrap_dns.join('\n')) || '',
<mask> processingGetConfig: false,
<mask> };
<mask> },
<mask>
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove />
</div>;
</s> add />
</div>
); </s> remove ln := util.SplitNext(&data, '\n')
</s> add ln := aghstrings.SplitNext(&data, '\n') </s> add private_upstream: splitByNewLine(local_ptr_upstreams), </s> remove if ct == ctFilteringStatus && !inStr(filteringStatusValues, c.value) {
</s> add if ct == ctFilteringStatus && !aghstrings.InSlice(filteringStatusValues, c.value) { </s> remove } else if res.Reason == dnsfilter.Rewritten || res.Reason == dnsfilter.RewrittenAutoHosts {
</s> add } else if res.Reason.In(dnsfilter.Rewritten, dnsfilter.RewrittenAutoHosts) { </s> remove func stringArrayDup(a []string) []string {
a2 := make([]string, len(a))
copy(a2, a)
return a2
}
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
client/src/reducers/dnsConfig.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> default:
<mask> b := &strings.Builder{}
<mask>
<mask> // Ignore errors, since strings.(*Buffer).Write never returns
<mask> // errors.
<mask> _, _ = fmt.Fprintf(b, "%s: %s (hidden: %s", e.message, e.underlying[0], e.underlying[1])
<mask> for _, u := range e.underlying[2:] {
<mask> // See comment above.
<mask> _, _ = fmt.Fprintf(b, ", %s", u)
<mask> }
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // Ignore errors, since strings.(*Buffer).Write never returns
// errors.
//
</s> add </s> remove encoder := hex.NewEncoder(b)
</s> add </s> remove // See comment above.
_, _ = b.WriteString(sbTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, sbTXTSuffix)
</s> remove _, _ = encoder.Write(hash[0:2])
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(b, hex.EncodeToString(hash[0:2]), ".") </s> remove // See comment above.
_, _ = b.WriteString(pcTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, pcTXTSuffix)
</s> remove // Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
</s> add if host != "" {
// Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
}
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/agherr/agherr.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> // NewMultiAddrExchanger creates an Exchanger instance from passed addresses.
<mask> // It returns an error if any of addrs failed to become an upstream.
<mask> func NewMultiAddrExchanger(addrs []string, timeout time.Duration) (e Exchanger, err error) {
<mask> defer agherr.Annotate("exchanger: %w", &err)
<mask>
<mask> if len(addrs) == 0 {
<mask> return &multiAddrExchanger{}, nil
<mask> }
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add // RDNSSettings returns the copy of actual RDNS configuration.
func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) {
s.RLock()
defer s.RUnlock()
return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients
}
</s> remove // ValidateUpstreams validates each upstream and returns an error if any upstream is invalid or if there are no default upstreams specified
</s> add // ValidateUpstreams validates each upstream and returns an error if any
// upstream is invalid or if there are no default upstreams specified.
//
// TODO(e.burkov): Move into aghnet or even into dnsproxy. </s> remove Upstreams []string `json:"upstream_dns"` // Upstreams
BootstrapDNS []string `json:"bootstrap_dns"` // Bootstrap DNS
</s> add Upstreams []string `json:"upstream_dns"`
BootstrapDNS []string `json:"bootstrap_dns"`
PrivateUpstreams []string `json:"private_upstream"` </s> remove const defaultLocalTimeout = 5 * time.Second
// stringsSetSubtract subtracts b from a interpreted as sets.
//
// TODO(e.burkov): Move into our internal package for working with strings.
func stringsSetSubtract(a, b []string) (c []string) {
// unit is an object to be used as value in set.
type unit = struct{}
cSet := make(map[string]unit)
for _, k := range a {
cSet[k] = unit{}
}
for _, k := range b {
delete(cSet, k)
}
c = make([]string, len(cSet))
i := 0
for k := range cSet {
c[i] = k
i++
}
return c
}
// collectAllIfacesAddrs returns the slice of all network interfaces IP
// addresses without port number.
func collectAllIfacesAddrs() (addrs []string, err error) {
var ifaces []net.Interface
ifaces, err = net.Interfaces()
if err != nil {
return nil, fmt.Errorf("getting network interfaces: %w", err)
}
for _, iface := range ifaces {
var ifaceAddrs []net.Addr
ifaceAddrs, err = iface.Addrs()
if err != nil {
return nil, fmt.Errorf("getting addresses for %q: %w", iface.Name, err)
}
for _, addr := range ifaceAddrs {
cidr := addr.String()
var ip net.IP
ip, _, err = net.ParseCIDR(cidr)
if err != nil {
return nil, fmt.Errorf("parsing %q as cidr: %w", cidr, err)
}
addrs = append(addrs, ip.String())
}
}
return addrs, nil
}
// collectDNSIPAddrs returns the slice of IP addresses without port number which
// we are listening on.
func collectDNSIPaddrs() (addrs []string, err error) {
addrs = make([]string, len(config.DNS.BindHosts))
for i, bh := range config.DNS.BindHosts {
if bh.IsUnspecified() {
return collectAllIfacesAddrs()
}
addrs[i] = bh.String()
}
return addrs, nil
}
func setupResolvers() {
// TODO(e.burkov): Enhance when the config will contain local resolvers
// addresses.
sysRes, err := aghnet.NewSystemResolvers(0, nil)
if err != nil {
log.Fatal(err)
}
Context.systemResolvers = sysRes
var ourAddrs []string
ourAddrs, err = collectDNSIPaddrs()
if err != nil {
log.Fatal(err)
}
// TODO(e.burkov): The approach of subtracting sets of strings is not
// really applicable here since in case of listening on all network
// interfaces we should check the whole interface's network to cut off
// all the loopback addresses as well.
addrs := stringsSetSubtract(sysRes.Get(), ourAddrs)
Context.localResolvers, err = aghnet.NewMultiAddrExchanger(addrs, defaultLocalTimeout)
if err != nil {
log.Fatal(err)
}
}
</s> add </s> remove func checkDNS(input string, bootstrap []string) error {
</s> add func checkDNS(input string, bootstrap []string, ef excFunc) (err error) { </s> remove res, err := s.dnsFilter.CheckHost(host, d.Req.Question[0].Qtype, ctx.setts)
</s> add res, err := s.dnsFilter.CheckHost(host, req.Question[0].Qtype, ctx.setts)
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/exchanger.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> var ups []upstream.Upstream = make([]upstream.Upstream, 0, len(addrs))
<mask> for _, addr := range addrs {
<mask> var u upstream.Upstream
<mask> u, err = upstream.AddressToUpstream(addr, upstream.Options{Timeout: timeout})
<mask> if err != nil {
<mask> return nil, err
<mask> }
<mask>
<mask> ups = append(ups, u)
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove log.Debug("checking if dns %s works...", input)
u, err := upstream.AddressToUpstream(input, upstream.Options{Bootstrap: bootstrap, Timeout: DefaultTimeout})
</s> add log.Debug("checking if dns server %q works...", input)
var u upstream.Upstream
u, err = upstream.AddressToUpstream(input, upstream.Options{
Bootstrap: bootstrap,
Timeout: DefaultTimeout,
}) </s> remove const defaultLocalTimeout = 5 * time.Second
// stringsSetSubtract subtracts b from a interpreted as sets.
//
// TODO(e.burkov): Move into our internal package for working with strings.
func stringsSetSubtract(a, b []string) (c []string) {
// unit is an object to be used as value in set.
type unit = struct{}
cSet := make(map[string]unit)
for _, k := range a {
cSet[k] = unit{}
}
for _, k := range b {
delete(cSet, k)
}
c = make([]string, len(cSet))
i := 0
for k := range cSet {
c[i] = k
i++
}
return c
}
// collectAllIfacesAddrs returns the slice of all network interfaces IP
// addresses without port number.
func collectAllIfacesAddrs() (addrs []string, err error) {
var ifaces []net.Interface
ifaces, err = net.Interfaces()
if err != nil {
return nil, fmt.Errorf("getting network interfaces: %w", err)
}
for _, iface := range ifaces {
var ifaceAddrs []net.Addr
ifaceAddrs, err = iface.Addrs()
if err != nil {
return nil, fmt.Errorf("getting addresses for %q: %w", iface.Name, err)
}
for _, addr := range ifaceAddrs {
cidr := addr.String()
var ip net.IP
ip, _, err = net.ParseCIDR(cidr)
if err != nil {
return nil, fmt.Errorf("parsing %q as cidr: %w", cidr, err)
}
addrs = append(addrs, ip.String())
}
}
return addrs, nil
}
// collectDNSIPAddrs returns the slice of IP addresses without port number which
// we are listening on.
func collectDNSIPaddrs() (addrs []string, err error) {
addrs = make([]string, len(config.DNS.BindHosts))
for i, bh := range config.DNS.BindHosts {
if bh.IsUnspecified() {
return collectAllIfacesAddrs()
}
addrs[i] = bh.String()
}
return addrs, nil
}
func setupResolvers() {
// TODO(e.burkov): Enhance when the config will contain local resolvers
// addresses.
sysRes, err := aghnet.NewSystemResolvers(0, nil)
if err != nil {
log.Fatal(err)
}
Context.systemResolvers = sysRes
var ourAddrs []string
ourAddrs, err = collectDNSIPaddrs()
if err != nil {
log.Fatal(err)
}
// TODO(e.burkov): The approach of subtracting sets of strings is not
// really applicable here since in case of listening on all network
// interfaces we should check the whole interface's network to cut off
// all the loopback addresses as well.
addrs := stringsSetSubtract(sysRes.Get(), ourAddrs)
Context.localResolvers, err = aghnet.NewMultiAddrExchanger(addrs, defaultLocalTimeout)
if err != nil {
log.Fatal(err)
}
}
</s> add </s> add ups upstream.Upstream </s> remove ctx.setts = s.getClientRequestFilteringSettings(ctx)
</s> add if ctx.setts == nil {
ctx.setts = s.getClientRequestFilteringSettings(ctx)
} </s> remove buf := strings.Builder{}
</s> add b := &strings.Builder{} </s> remove for _, host := range req.Upstreams {
err = checkDNS(host, req.BootstrapDNS)
if err != nil {
log.Info("%v", err)
result[host] = err.Error()
} else {
result[host] = "OK"
</s> add if t, ok := reply.Answer[0].(*dns.A); ok {
if !net.IPv4(8, 8, 8, 8).Equal(t.A) {
return fmt.Errorf("wrong response")
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/exchanger.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> var e Exchanger
<mask> var err error
<mask>
<mask> t.Run("empty", func(t *testing.T) {
<mask> e, err = NewMultiAddrExchanger([]string{}, 0)
<mask> require.NoError(t, err)
<mask> assert.NotNil(t, e)
<mask> })
<mask>
<mask> t.Run("successful", func(t *testing.T) {
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove e, err = NewMultiAddrExchanger([]string{"www.example.com"}, 0)
</s> add e, err = NewMultiAddrExchanger([]string{"www.example.com"}, nil, 0) </s> remove e, err = NewMultiAddrExchanger([]string{"invalid-proto://www.example.com"}, 0)
</s> add e, err = NewMultiAddrExchanger([]string{"invalid-proto://www.example.com"}, nil, 0) </s> add func loadTestData(t *testing.T, casesFileName string, cases interface{}) {
t.Helper()
var f *os.File
f, err := os.Open(filepath.Join("testdata", casesFileName))
require.NoError(t, err)
t.Cleanup(func() {
require.NoError(t, f.Close())
})
err = json.NewDecoder(f).Decode(cases)
require.NoError(t, err)
}
const jsonExt = ".json"
</s> add var data map[string]json.RawMessage
loadTestData(t, t.Name()+jsonExt, &data)
</s> add caseWant, ok := data[tc.name]
require.True(t, ok)
</s> add var data map[string]struct {
Req json.RawMessage `json:"req"`
Want json.RawMessage `json:"want"`
}
loadTestData(t, t.Name()+jsonExt, &data)
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/exchanger_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> assert.NotNil(t, e)
<mask> })
<mask>
<mask> t.Run("successful", func(t *testing.T) {
<mask> e, err = NewMultiAddrExchanger([]string{"www.example.com"}, 0)
<mask> require.NoError(t, err)
<mask> assert.NotNil(t, e)
<mask> })
<mask>
<mask> t.Run("unsuccessful", func(t *testing.T) {
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove e, err = NewMultiAddrExchanger([]string{"invalid-proto://www.example.com"}, 0)
</s> add e, err = NewMultiAddrExchanger([]string{"invalid-proto://www.example.com"}, nil, 0) </s> remove e, err = NewMultiAddrExchanger([]string{}, 0)
</s> add e, err = NewMultiAddrExchanger([]string{}, nil, 0) </s> remove t.Run(tc.name, func(t *testing.T) {
r, rerr := rdns.resolve(tc.req)
require.ErrorIs(t, rerr, tc.wantErr)
assert.Equal(t, tc.want, r)
})
</s> add if len(resp.Answer) == 0 {
return "", nil </s> add caseData, ok := data[tc.name]
require.True(t, ok)
</s> add func loadTestData(t *testing.T, casesFileName string, cases interface{}) {
t.Helper()
var f *os.File
f, err := os.Open(filepath.Join("testdata", casesFileName))
require.NoError(t, err)
t.Cleanup(func() {
require.NoError(t, f.Close())
})
err = json.NewDecoder(f).Decode(cases)
require.NoError(t, err)
}
const jsonExt = ".json"
</s> remove for _, tc := range testCases {
rdns := NewRDNS(dns, cc, snd, &aghtest.Exchanger{
Ups: tc.locUpstream,
})
</s> add resp, err := e.Exchanger.Exchange(req)
if err != nil {
return "", err
}
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/exchanger_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> assert.NotNil(t, e)
<mask> })
<mask>
<mask> t.Run("unsuccessful", func(t *testing.T) {
<mask> e, err = NewMultiAddrExchanger([]string{"invalid-proto://www.example.com"}, 0)
<mask> require.Error(t, err)
<mask> assert.Nil(t, e)
<mask> })
<mask> }
<mask>
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove e, err = NewMultiAddrExchanger([]string{"www.example.com"}, 0)
</s> add e, err = NewMultiAddrExchanger([]string{"www.example.com"}, nil, 0) </s> remove e, err = NewMultiAddrExchanger([]string{}, 0)
</s> add e, err = NewMultiAddrExchanger([]string{}, nil, 0) </s> remove }()
</s> add }) </s> remove t.Run(tc.name, func(t *testing.T) {
r, rerr := rdns.resolve(tc.req)
require.ErrorIs(t, rerr, tc.wantErr)
assert.Equal(t, tc.want, r)
})
</s> add if len(resp.Answer) == 0 {
return "", nil </s> add caseData, ok := data[tc.name]
require.True(t, ok)
</s> remove for _, tc := range testCases {
rdns := NewRDNS(dns, cc, snd, &aghtest.Exchanger{
Ups: tc.locUpstream,
})
</s> add resp, err := e.Exchanger.Exchange(req)
if err != nil {
return "", err
}
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/exchanger_test.go
|
keep keep keep add keep keep keep keep
|
<mask> "syscall"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> // ErrNoStaticIPInfo is returned by IfaceHasStaticIP when no information about
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> add </s> remove // Exchange - send DNS request to an upstream server and receive response
// No request/response filtering is performed.
// Query log and Stats are not updated.
// This method may be called before Start().
func (s *Server) Exchange(req *dns.Msg) (*dns.Msg, error) {
</s> add // RDNSExchanger is a resolver for clients' addresses.
type RDNSExchanger interface {
// Exchange tries to resolve the ip in a suitable way, e.g. either as
// local or as external.
Exchange(ip net.IP) (host string, err error)
}
const (
// rDNSEmptyAnswerErr is returned by Exchange method when the answer
// section of respond is empty.
rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
// rDNSNotPTRErr is returned by Exchange method when the response is not
// of PTR type.
rDNSNotPTRErr agherr.Error = "the response is not a ptr"
)
// Exchange implements the RDNSExchanger interface for *Server.
func (s *Server) Exchange(ip net.IP) (host string, err error) { </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> remove const (
// rDNSEmptyAnswerErr is returned by RDNS resolve method when the answer
// section of respond is empty.
rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
// rDNSNotPTRErr is returned by RDNS resolve method when the response is
// not of PTR type.
rDNSNotPTRErr agherr.Error = "the response is not a ptr"
)
// resolve tries to resolve the ip in a suitable way.
func (r *RDNS) resolve(ip net.IP) (host string, err error) {
log.Tracef("rdns: resolving host for %q", ip)
arpa := dns.Fqdn(aghnet.ReverseAddr(ip))
msg := &dns.Msg{
MsgHdr: dns.MsgHdr{
Id: dns.Id(),
RecursionDesired: true,
},
Compress: true,
Question: []dns.Question{{
Name: arpa,
Qtype: dns.TypePTR,
Qclass: dns.ClassINET,
}},
}
var resp *dns.Msg
if r.subnetDetector.IsLocallyServedNetwork(ip) {
resp, err = r.localResolvers.Exchange(msg)
} else {
resp, err = r.dnsServer.Exchange(msg)
}
if err != nil {
return "", fmt.Errorf("performing lookup for %q: %w", arpa, err)
}
if len(resp.Answer) == 0 {
return "", fmt.Errorf("lookup for %q: %w", arpa, rDNSEmptyAnswerErr)
}
ptr, ok := resp.Answer[0].(*dns.PTR)
if !ok {
return "", fmt.Errorf("type checking: %w", rDNSNotPTRErr)
}
log.Tracef("rdns: ptr response for %q: %s", ip, ptr.String())
return strings.TrimSuffix(ptr.Ptr, "."), nil
}
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/net.go
|
keep add keep keep keep keep
|
<mask> // github.com/miekg/dns package with no error among returned values.
<mask> func ReverseAddr(ip net.IP) (arpa string) {
<mask> var strLen int
<mask> var suffix string
<mask> var writeByte func(val byte)
<mask> b := &strings.Builder{}
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // Don't handle errors in implementations since strings.WriteString
// never returns non-nil errors.
</s> add </s> remove _, _ = b.WriteString(strconv.Itoa(int(val)))
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(b, strconv.Itoa(int(val)), dot) </s> remove writeStrings(
</s> add aghstrings.WriteToBuilder( </s> remove encoder := hex.NewEncoder(b)
</s> add </s> remove e, err = NewMultiAddrExchanger([]string{}, 0)
</s> add e, err = NewMultiAddrExchanger([]string{}, nil, 0) </s> remove lByte, rByte := val&0xF, val>>4
_, _ = b.WriteString(strconv.FormatUint(uint64(lByte), 16))
_, _ = b.WriteRune('.')
_, _ = b.WriteString(strconv.FormatUint(uint64(rByte), 16))
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(
b,
strconv.FormatUint(uint64(val&0xF), 16),
dot,
strconv.FormatUint(uint64(val>>4), 16),
dot,
)
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/net.go
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> // github.com/miekg/dns package with no error among returned values.
<mask> func ReverseAddr(ip net.IP) (arpa string) {
<mask> var strLen int
<mask> var suffix string
<mask> // Don't handle errors in implementations since strings.WriteString
<mask> // never returns non-nil errors.
<mask> var writeByte func(val byte)
<mask> b := &strings.Builder{}
<mask> if ip4 := ip.To4(); ip4 != nil {
<mask> strLen, suffix = arpaV4MaxLen, arpaV4Suffix[1:]
<mask> ip = ip4
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add const dot = "."
</s> remove _, _ = b.WriteString(strconv.Itoa(int(val)))
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(b, strconv.Itoa(int(val)), dot) </s> remove // Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
</s> add if host != "" {
// Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
} </s> remove encoder := hex.NewEncoder(b)
</s> add </s> remove // errors.
</s> add // errors. We don't use aghstrings.WriteToBuilder here since
// this package should be importable for any other. </s> remove // Ignore errors, since strings.(*Buffer).Write never returns
// errors.
//
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/net.go
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> if ip4 := ip.To4(); ip4 != nil {
<mask> strLen, suffix = arpaV4MaxLen, arpaV4Suffix[1:]
<mask> ip = ip4
<mask> writeByte = func(val byte) {
<mask> _, _ = b.WriteString(strconv.Itoa(int(val)))
<mask> _, _ = b.WriteRune('.')
<mask> }
<mask>
<mask> } else if ip6 := ip.To16(); ip6 != nil {
<mask> strLen, suffix = arpaV6MaxLen, arpaV6Suffix[1:]
<mask> ip = ip6
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove lByte, rByte := val&0xF, val>>4
_, _ = b.WriteString(strconv.FormatUint(uint64(lByte), 16))
_, _ = b.WriteRune('.')
_, _ = b.WriteString(strconv.FormatUint(uint64(rByte), 16))
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(
b,
strconv.FormatUint(uint64(val&0xF), 16),
dot,
strconv.FormatUint(uint64(val>>4), 16),
dot,
) </s> remove // Don't handle errors in implementations since strings.WriteString
// never returns non-nil errors.
</s> add </s> remove // See comment above.
_, _ = b.WriteString(sbTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, sbTXTSuffix)
</s> remove _, _ = encoder.Write(hash[0:2])
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(b, hex.EncodeToString(hash[0:2]), ".") </s> add const dot = "."
</s> remove for _, host := range req.Upstreams {
err = checkDNS(host, req.BootstrapDNS)
if err != nil {
log.Info("%v", err)
result[host] = err.Error()
} else {
result[host] = "OK"
</s> add if t, ok := reply.Answer[0].(*dns.A); ok {
if !net.IPv4(8, 8, 8, 8).Equal(t.A) {
return fmt.Errorf("wrong response")
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/net.go
|
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
|
<mask> } else if ip6 := ip.To16(); ip6 != nil {
<mask> strLen, suffix = arpaV6MaxLen, arpaV6Suffix[1:]
<mask> ip = ip6
<mask> writeByte = func(val byte) {
<mask> lByte, rByte := val&0xF, val>>4
<mask>
<mask> _, _ = b.WriteString(strconv.FormatUint(uint64(lByte), 16))
<mask> _, _ = b.WriteRune('.')
<mask> _, _ = b.WriteString(strconv.FormatUint(uint64(rByte), 16))
<mask> _, _ = b.WriteRune('.')
<mask> }
<mask>
<mask> } else {
<mask> return ""
<mask> }
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove _, _ = b.WriteString(strconv.Itoa(int(val)))
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(b, strconv.Itoa(int(val)), dot) </s> remove // See comment above.
_, _ = b.WriteString(sbTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, sbTXTSuffix)
</s> remove _, _ = encoder.Write(hash[0:2])
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(b, hex.EncodeToString(hash[0:2]), ".") </s> remove // Ignore errors, since strings.(*Buffer).Write never returns
// errors.
//
</s> add </s> remove // Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
</s> add if host != "" {
// Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
} </s> remove // See comment above.
_, _ = b.WriteString(pcTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, pcTXTSuffix)
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/net.go
|
keep keep keep keep replace keep keep keep
|
<mask> b.Grow(strLen)
<mask> for i := len(ip) - 1; i >= 0; i-- {
<mask> writeByte(ip[i])
<mask> }
<mask> _, _ = b.WriteString(suffix)
<mask>
<mask> return b.String()
<mask> }
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // See comment above.
_, _ = b.WriteString(sbTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, sbTXTSuffix)
</s> remove // See comment above.
_, _ = b.WriteString(pcTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, pcTXTSuffix)
</s> remove func stringArrayDup(a []string) []string {
a2 := make([]string, len(a))
copy(a2, a)
return a2
}
</s> add </s> remove // SplitNext - split string by a byte and return the first chunk
// Skip empty chunks
// Whitespace is trimmed
func SplitNext(str *string, splitBy byte) string {
i := strings.IndexByte(*str, splitBy)
s := ""
if i != -1 {
s = (*str)[0:i]
*str = (*str)[i+1:]
k := 0
ch := rune(0)
for k, ch = range *str {
if byte(ch) != splitBy {
break
}
}
*str = (*str)[k:]
} else {
s = *str
*str = ""
}
return strings.TrimSpace(s)
}
</s> add </s> remove lByte, rByte := val&0xF, val>>4
_, _ = b.WriteString(strconv.FormatUint(uint64(lByte), 16))
_, _ = b.WriteRune('.')
_, _ = b.WriteString(strconv.FormatUint(uint64(rByte), 16))
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(
b,
strconv.FormatUint(uint64(val&0xF), 16),
dot,
strconv.FormatUint(uint64(val>>4), 16),
dot,
) </s> remove writeStrings(b, nltb, depStr)
</s> add aghstrings.WriteToBuilder(b, nltb, depStr)
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghnet/net.go
|
keep keep keep replace replace replace keep keep replace
|
<mask> }
<mask>
<mask> // Exchange implements aghnet.Exchanger interface for *Exchanger.
<mask> func (lr *Exchanger) Exchange(req *dns.Msg) (resp *dns.Msg, err error) {
<mask> if lr.Ups == nil {
<mask> lr.Ups = &TestErrUpstream{}
<mask> }
<mask>
<mask> return lr.Ups.Exchange(req)
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // Exchange - send DNS request to an upstream server and receive response
// No request/response filtering is performed.
// Query log and Stats are not updated.
// This method may be called before Start().
func (s *Server) Exchange(req *dns.Msg) (*dns.Msg, error) {
</s> add // RDNSExchanger is a resolver for clients' addresses.
type RDNSExchanger interface {
// Exchange tries to resolve the ip in a suitable way, e.g. either as
// local or as external.
Exchange(ip net.IP) (host string, err error)
}
const (
// rDNSEmptyAnswerErr is returned by Exchange method when the answer
// section of respond is empty.
rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
// rDNSNotPTRErr is returned by Exchange method when the response is not
// of PTR type.
rDNSNotPTRErr agherr.Error = "the response is not a ptr"
)
// Exchange implements the RDNSExchanger interface for *Server.
func (s *Server) Exchange(ip net.IP) (host string, err error) { </s> remove ctx := &proxy.DNSContext{
Proto: "udp",
Req: req,
StartTime: time.Now(),
</s> add if !s.conf.ResolveClients {
return "", nil
}
arpa := dns.Fqdn(aghnet.ReverseAddr(ip))
req := &dns.Msg{
MsgHdr: dns.MsgHdr{
Id: dns.Id(),
RecursionDesired: true,
},
Compress: true,
Question: []dns.Question{{
Name: arpa,
Qtype: dns.TypePTR,
Qclass: dns.ClassINET,
}},
}
var resp *dns.Msg
if s.subnetDetector.IsLocallyServedNetwork(ip) {
resp, err = s.localResolvers.Exchange(req)
} else {
ctx := &proxy.DNSContext{
Proto: "udp",
Req: req,
StartTime: time.Now(),
}
err = s.internalProxy.Resolve(ctx)
resp = ctx.Res </s> remove // inStr checks if string is in the slice of strings.
func inStr(strs []string, str string) (ok bool) {
for _, s := range strs {
if s == str {
return true
}
}
return false
}
</s> add </s> remove return ctx.Res, nil
</s> add if len(resp.Answer) == 0 {
return "", fmt.Errorf("lookup for %q: %w", arpa, rDNSEmptyAnswerErr)
}
ptr, ok := resp.Answer[0].(*dns.PTR)
if !ok {
return "", fmt.Errorf("type checking: %w", rDNSNotPTRErr)
}
return strings.TrimSuffix(ptr.Ptr, "."), nil </s> remove func NewMultiAddrExchanger(addrs []string, timeout time.Duration) (e Exchanger, err error) {
</s> add func NewMultiAddrExchanger(
addrs []string,
bootstraps []string,
timeout time.Duration,
) (e Exchanger, err error) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/aghtest/exchanger.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> // Register an HTTP handler
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
<mask>
<mask> // CustomResolver is the resolver used by DNSFilter.
<mask> CustomResolver Resolver
<mask> }
<mask>
<mask> // LookupStats store stats collected during safebrowsing or parental checks
<mask> type LookupStats struct {
<mask> Requests uint64 // number of HTTP requests that were sent
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add // ResolveClients signals if the RDNS should resolve clients' addresses.
ResolveClients bool
// LocalPTRResolvers is a slice of addresses to be used as upstreams for
// resolving PTR queries for local addresses.
LocalPTRResolvers []string </s> remove // Exchange - send DNS request to an upstream server and receive response
// No request/response filtering is performed.
// Query log and Stats are not updated.
// This method may be called before Start().
func (s *Server) Exchange(req *dns.Msg) (*dns.Msg, error) {
</s> add // RDNSExchanger is a resolver for clients' addresses.
type RDNSExchanger interface {
// Exchange tries to resolve the ip in a suitable way, e.g. either as
// local or as external.
Exchange(ip net.IP) (host string, err error)
}
const (
// rDNSEmptyAnswerErr is returned by Exchange method when the answer
// section of respond is empty.
rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
// rDNSNotPTRErr is returned by Exchange method when the response is not
// of PTR type.
rDNSNotPTRErr agherr.Error = "the response is not a ptr"
)
// Exchange implements the RDNSExchanger interface for *Server.
func (s *Server) Exchange(ip net.IP) (host string, err error) { </s> add // ResolveClients enables and disables resolving clients with RDNS.
ResolveClients bool `yaml:"resolve_clients"`
// LocalPTRResolvers is the slice of addresses to be used as upstreams
// for PTR queries for locally-served networks.
LocalPTRResolvers []string `yaml:"local_ptr_upstreams"` </s> remove Upstreams []string `json:"upstream_dns"` // Upstreams
BootstrapDNS []string `json:"bootstrap_dns"` // Bootstrap DNS
</s> add Upstreams []string `json:"upstream_dns"`
BootstrapDNS []string `json:"bootstrap_dns"`
PrivateUpstreams []string `json:"private_upstream"` </s> remove dnsServer *dnsforward.Server
clients *clientsContainer
subnetDetector *aghnet.SubnetDetector
localResolvers aghnet.Exchanger
</s> add exchanger dnsforward.RDNSExchanger
clients *clientsContainer </s> remove // ValidateUpstreams validates each upstream and returns an error if any upstream is invalid or if there are no default upstreams specified
</s> add // ValidateUpstreams validates each upstream and returns an error if any
// upstream is invalid or if there are no default upstreams specified.
//
// TODO(e.burkov): Move into aghnet or even into dnsproxy.
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsfilter/dnsfilter.go
|
keep add keep keep keep keep keep
|
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/cache"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/miekg/dns"
<mask> "golang.org/x/net/publicsuffix"
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> add </s> add "github.com/miekg/dns" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dnsforward"
"github.com/AdguardTeam/dnsproxy/proxy"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsfilter/safebrowsing.go
|
keep replace keep keep replace replace replace keep keep
|
<mask> b := &strings.Builder{}
<mask> encoder := hex.NewEncoder(b)
<mask>
<mask> for hash := range c.hashToHost {
<mask> // Ignore errors, since strings.(*Buffer).Write never returns
<mask> // errors.
<mask> //
<mask> // TODO(e.burkov, a.garipov): Find out and document why exactly
<mask> // this slice.
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove _, _ = encoder.Write(hash[0:2])
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(b, hex.EncodeToString(hash[0:2]), ".") </s> remove // errors.
</s> add // errors. We don't use aghstrings.WriteToBuilder here since
// this package should be importable for any other. </s> remove // Don't handle errors in implementations since strings.WriteString
// never returns non-nil errors.
</s> add </s> remove // ValidateUpstreams validates each upstream and returns an error if any upstream is invalid or if there are no default upstreams specified
</s> add // ValidateUpstreams validates each upstream and returns an error if any
// upstream is invalid or if there are no default upstreams specified.
//
// TODO(e.burkov): Move into aghnet or even into dnsproxy. </s> remove // filterDNSRequest applies the dnsFilter and sets d.Res if the request
// was filtered.
</s> add // filterDNSRequest applies the dnsFilter and sets d.Res if the request was
// filtered.
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsfilter/safebrowsing.go
|
keep keep replace replace keep keep keep replace replace keep keep
|
<mask> // TODO(e.burkov, a.garipov): Find out and document why exactly
<mask> // this slice.
<mask> _, _ = encoder.Write(hash[0:2])
<mask> _, _ = b.WriteRune('.')
<mask> }
<mask>
<mask> if c.svc == "SafeBrowsing" {
<mask> // See comment above.
<mask> _, _ = b.WriteString(sbTXTSuffix)
<mask> return b.String()
<mask> }
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // Ignore errors, since strings.(*Buffer).Write never returns
// errors.
//
</s> add </s> remove // See comment above.
_, _ = b.WriteString(pcTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, pcTXTSuffix)
</s> remove // errors.
</s> add // errors. We don't use aghstrings.WriteToBuilder here since
// this package should be importable for any other. </s> remove lByte, rByte := val&0xF, val>>4
_, _ = b.WriteString(strconv.FormatUint(uint64(lByte), 16))
_, _ = b.WriteRune('.')
_, _ = b.WriteString(strconv.FormatUint(uint64(rByte), 16))
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(
b,
strconv.FormatUint(uint64(val&0xF), 16),
dot,
strconv.FormatUint(uint64(val>>4), 16),
dot,
) </s> remove // Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
</s> add if host != "" {
// Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
}
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsfilter/safebrowsing.go
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> _, _ = b.WriteString(sbTXTSuffix)
<mask> return b.String()
<mask> }
<mask>
<mask> // See comment above.
<mask> _, _ = b.WriteString(pcTXTSuffix)
<mask> return b.String()
<mask> }
<mask>
<mask> // Find the target hash in TXT response
<mask> func (c *sbCtx) processTXT(resp *dns.Msg) (bool, [][]byte) {
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // See comment above.
_, _ = b.WriteString(sbTXTSuffix)
</s> add aghstrings.WriteToBuilder(b, sbTXTSuffix)
</s> remove _, _ = encoder.Write(hash[0:2])
_, _ = b.WriteRune('.')
</s> add aghstrings.WriteToBuilder(b, hex.EncodeToString(hash[0:2]), ".") </s> remove // errors.
</s> add // errors. We don't use aghstrings.WriteToBuilder here since
// this package should be importable for any other. </s> remove // Ignore errors, since strings.(*Buffer).Write never returns
// errors.
//
</s> add </s> remove _, _ = b.WriteString(suffix)
</s> add aghstrings.WriteToBuilder(b, suffix) </s> remove // Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
</s> add if host != "" {
// Don't handle any errors since AddHost doesn't return non-nil
// errors for now.
_, _ = r.clients.AddHost(ip.String(), host, ClientSourceRDNS)
}
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsfilter/safebrowsing.go
|
keep keep keep add keep keep keep keep keep keep
|
<mask> "net/http"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/urlfilter"
<mask> "github.com/AdguardTeam/urlfilter/filterlist"
<mask> )
<mask>
<mask> type accessCtx struct {
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "strings" </s> remove "github.com/miekg/dns"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/access.go
|
keep replace keep keep keep keep keep keep keep replace replace keep keep keep
|
<mask>
<mask> buf := strings.Builder{}
<mask> for _, s := range blockedHosts {
<mask> buf.WriteString(s)
<mask> buf.WriteString("\n")
<mask> }
<mask>
<mask> buf := strings.Builder{}
<mask> for _, s := range blockedHosts {
<mask> buf.WriteString(s)
<mask> buf.WriteString("\n")
<mask> }
<mask>
<mask> listArray := []filterlist.RuleList{}
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // inStr checks if string is in the slice of strings.
func inStr(strs []string, str string) (ok bool) {
for _, s := range strs {
if s == str {
return true
}
}
return false
}
</s> add </s> remove writeStrings(b, nltb, depStr)
</s> add aghstrings.WriteToBuilder(b, nltb, depStr) </s> remove RulesText: buf.String(),
</s> add RulesText: b.String(), </s> remove s := util.SplitNext(&d, '\n')
</s> add s := aghstrings.SplitNext(&d, '\n') </s> remove writeStrings(b, nl, vFmtDepsHdr)
</s> add aghstrings.WriteToBuilder(b, nl, vFmtDepsHdr)
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/access.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> listArray := []filterlist.RuleList{}
<mask> list := &filterlist.StringRuleList{
<mask> ID: int(0),
<mask> RulesText: buf.String(),
<mask> IgnoreCosmetic: true,
<mask> }
<mask> listArray = append(listArray, list)
<mask> rulesStorage, err := filterlist.NewRuleStorage(listArray)
<mask> if err != nil {
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove buf.WriteString(s)
buf.WriteString("\n")
</s> add aghstrings.WriteToBuilder(b, s, "\n") </s> remove // separate upstream from domains list
input, useDefault, err := separateUpstream(input)
if err != nil {
</s> add // Separate upstream from domains list.
var useDefault bool
if input, useDefault, err = separateUpstream(input); err != nil { </s> remove ctx := &proxy.DNSContext{
Proto: "udp",
Req: req,
StartTime: time.Now(),
</s> add if !s.conf.ResolveClients {
return "", nil
}
arpa := dns.Fqdn(aghnet.ReverseAddr(ip))
req := &dns.Msg{
MsgHdr: dns.MsgHdr{
Id: dns.Id(),
RecursionDesired: true,
},
Compress: true,
Question: []dns.Question{{
Name: arpa,
Qtype: dns.TypePTR,
Qclass: dns.ClassINET,
}},
}
var resp *dns.Msg
if s.subnetDetector.IsLocallyServedNetwork(ip) {
resp, err = s.localResolvers.Exchange(req)
} else {
ctx := &proxy.DNSContext{
Proto: "udp",
Req: req,
StartTime: time.Now(),
}
err = s.internalProxy.Resolve(ctx)
resp = ctx.Res </s> remove setupResolvers()
</s> add </s> remove jsonVal, err := json.Marshal(result)
if err != nil {
httpError(r, w, http.StatusInternalServerError, "Unable to marshal status json: %s", err)
return
</s> add return nil
}
// checkPrivateUpstreamExc checks if the upstream for resolving private
// addresses exchanges correctly.
func checkPrivateUpstreamExc(u upstream.Upstream) (err error) {
req := &dns.Msg{
MsgHdr: dns.MsgHdr{
Id: dns.Id(),
RecursionDesired: true,
},
Question: []dns.Question{{
Name: "1.0.0.127.in-addr.arpa.",
Qtype: dns.TypePTR,
Qclass: dns.ClassINET,
}}, </s> remove for _, host := range req.Upstreams {
err = checkDNS(host, req.BootstrapDNS)
if err != nil {
log.Info("%v", err)
result[host] = err.Error()
} else {
result[host] = "OK"
</s> add if t, ok := reply.Answer[0].(*dns.A); ok {
if !net.IPv4(8, 8, 8, 8).Equal(t.A) {
return fmt.Errorf("wrong response")
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/access.go
|
keep add keep keep keep keep keep keep
|
<mask> "sort"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/ameshkov/dnscrypt/v2"
<mask> )
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dnsforward"
"github.com/AdguardTeam/dnsproxy/proxy"
</s> add </s> add "github.com/miekg/dns" </s> remove "github.com/stretchr/testify/require"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/config.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "net/http"
<mask> "sort"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/util"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/ameshkov/dnscrypt/v2"
<mask> )
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/agherr" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/dnsforward"
"github.com/AdguardTeam/dnsproxy/proxy"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/config.go
|
keep add keep keep keep keep
|
<mask> // Register an HTTP handler
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
<mask> }
<mask>
<mask> // if any of ServerConfig values are zero, then default values from below are used
<mask> var defaultValues = ServerConfig{
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove CustomResolver Resolver
</s> add CustomResolver Resolver `yaml:"-"` </s> remove // ValidateUpstreams validates each upstream and returns an error if any upstream is invalid or if there are no default upstreams specified
</s> add // ValidateUpstreams validates each upstream and returns an error if any
// upstream is invalid or if there are no default upstreams specified.
//
// TODO(e.burkov): Move into aghnet or even into dnsproxy. </s> remove Upstreams []string `json:"upstream_dns"` // Upstreams
BootstrapDNS []string `json:"bootstrap_dns"` // Bootstrap DNS
</s> add Upstreams []string `json:"upstream_dns"`
BootstrapDNS []string `json:"bootstrap_dns"`
PrivateUpstreams []string `json:"private_upstream"` </s> remove func NewMultiAddrExchanger(addrs []string, timeout time.Duration) (e Exchanger, err error) {
</s> add func NewMultiAddrExchanger(
addrs []string,
bootstraps []string,
timeout time.Duration,
) (e Exchanger, err error) { </s> add // RDNSSettings returns the copy of actual RDNS configuration.
func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) {
s.RLock()
defer s.RUnlock()
return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients
}
</s> remove func checkDNS(input string, bootstrap []string) error {
</s> add func checkDNS(input string, bootstrap []string, ef excFunc) (err error) {
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/config.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> return err
<mask> }
<mask> d := string(data)
<mask> for len(d) != 0 {
<mask> s := util.SplitNext(&d, '\n')
<mask> upstreams = append(upstreams, s)
<mask> }
<mask> log.Debug("dns: using %d upstream servers from file %s", len(upstreams), s.conf.UpstreamDNSFileName)
<mask> } else {
<mask> upstreams = s.conf.UpstreamDNS
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // separate upstream from domains list
input, useDefault, err := separateUpstream(input)
if err != nil {
</s> add // Separate upstream from domains list.
var useDefault bool
if input, useDefault, err = separateUpstream(input); err != nil { </s> remove ln := util.SplitNext(&data, '\n')
</s> add ln := aghstrings.SplitNext(&data, '\n') </s> remove // SplitNext - split string by a byte and return the first chunk
// Skip empty chunks
// Whitespace is trimmed
func SplitNext(str *string, splitBy byte) string {
i := strings.IndexByte(*str, splitBy)
s := ""
if i != -1 {
s = (*str)[0:i]
*str = (*str)[i+1:]
k := 0
ch := rune(0)
for k, ch = range *str {
if byte(ch) != splitBy {
break
}
}
*str = (*str)[k:]
} else {
s = *str
*str = ""
}
return strings.TrimSpace(s)
}
</s> add </s> remove buf := strings.Builder{}
</s> add b := &strings.Builder{} </s> remove // inStr checks if string is in the slice of strings.
func inStr(strs []string, str string) (ok bool) {
for _, s := range strs {
if s == str {
return true
}
}
return false
}
</s> add </s> remove for _, host := range req.Upstreams {
err = checkDNS(host, req.BootstrapDNS)
if err != nil {
log.Info("%v", err)
result[host] = err.Error()
} else {
result[host] = "OK"
</s> add if t, ok := reply.Answer[0].(*dns.A); ok {
if !net.IPv4(8, 8, 8, 8).Equal(t.A) {
return fmt.Errorf("wrong response")
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/config.go
|
keep keep keep add keep keep keep keep keep
|
<mask>
<mask> // Do not perform unreversing ever again.
<mask> ctx.unreversedReqIP = ip
<mask>
<mask> // Nothing to restrict.
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> // ipToHost tries to get a hostname leased by DHCP. It's safe for concurrent
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove // Exchange - send DNS request to an upstream server and receive response
// No request/response filtering is performed.
// Query log and Stats are not updated.
// This method may be called before Start().
func (s *Server) Exchange(req *dns.Msg) (*dns.Msg, error) {
</s> add // RDNSExchanger is a resolver for clients' addresses.
type RDNSExchanger interface {
// Exchange tries to resolve the ip in a suitable way, e.g. either as
// local or as external.
Exchange(ip net.IP) (host string, err error)
}
const (
// rDNSEmptyAnswerErr is returned by Exchange method when the answer
// section of respond is empty.
rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
// rDNSNotPTRErr is returned by Exchange method when the response is not
// of PTR type.
rDNSNotPTRErr agherr.Error = "the response is not a ptr"
)
// Exchange implements the RDNSExchanger interface for *Server.
func (s *Server) Exchange(ip net.IP) (host string, err error) { </s> remove if !Context.subnetDetector.IsLocallyServedNetwork(ip) {
</s> add if config.DNS.ResolveClients && !ip.IsLoopback() { </s> remove const (
// rDNSEmptyAnswerErr is returned by RDNS resolve method when the answer
// section of respond is empty.
rDNSEmptyAnswerErr agherr.Error = "the answer section is empty"
// rDNSNotPTRErr is returned by RDNS resolve method when the response is
// not of PTR type.
rDNSNotPTRErr agherr.Error = "the response is not a ptr"
)
// resolve tries to resolve the ip in a suitable way.
func (r *RDNS) resolve(ip net.IP) (host string, err error) {
log.Tracef("rdns: resolving host for %q", ip)
arpa := dns.Fqdn(aghnet.ReverseAddr(ip))
msg := &dns.Msg{
MsgHdr: dns.MsgHdr{
Id: dns.Id(),
RecursionDesired: true,
},
Compress: true,
Question: []dns.Question{{
Name: arpa,
Qtype: dns.TypePTR,
Qclass: dns.ClassINET,
}},
}
var resp *dns.Msg
if r.subnetDetector.IsLocallyServedNetwork(ip) {
resp, err = r.localResolvers.Exchange(msg)
} else {
resp, err = r.dnsServer.Exchange(msg)
}
if err != nil {
return "", fmt.Errorf("performing lookup for %q: %w", arpa, err)
}
if len(resp.Answer) == 0 {
return "", fmt.Errorf("lookup for %q: %w", arpa, rDNSEmptyAnswerErr)
}
ptr, ok := resp.Answer[0].(*dns.PTR)
if !ok {
return "", fmt.Errorf("type checking: %w", rDNSNotPTRErr)
}
log.Tracef("rdns: ptr response for %q: %s", ip, ptr.String())
return strings.TrimSuffix(ptr.Ptr, "."), nil
}
</s> add </s> add // RDNSSettings returns the copy of actual RDNS configuration.
func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) {
s.RLock()
defer s.RUnlock()
return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients
}
</s> remove dnsServer *dnsforward.Server
clients *clientsContainer
subnetDetector *aghnet.SubnetDetector
localResolvers aghnet.Exchanger
</s> add exchanger dnsforward.RDNSExchanger
clients *clientsContainer </s> add ResolveClients: true,
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/dns.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> var err error
<mask> ctx.protectionEnabled = s.conf.ProtectionEnabled && s.dnsFilter != nil
<mask> if ctx.protectionEnabled {
<mask> ctx.setts = s.getClientRequestFilteringSettings(ctx)
<mask> ctx.result, err = s.filterDNSRequest(ctx)
<mask> }
<mask> s.RUnlock()
<mask>
<mask> if err != nil {
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> remove setupResolvers()
</s> add </s> remove w.Header().Set("Content-Type", "application/json")
_, err = w.Write(jsonVal)
if err != nil {
httpError(r, w, http.StatusInternalServerError, "Couldn't write body: %s", err)
return
</s> add if _, err = u.Exchange(req); err != nil {
return fmt.Errorf("couldn't communicate with upstream: %w", err) </s> remove // separate upstream from domains list
input, useDefault, err := separateUpstream(input)
if err != nil {
</s> add // Separate upstream from domains list.
var useDefault bool
if input, useDefault, err = separateUpstream(input); err != nil { </s> remove for _, host := range req.Upstreams {
err = checkDNS(host, req.BootstrapDNS)
if err != nil {
log.Info("%v", err)
result[host] = err.Error()
} else {
result[host] = "OK"
</s> add if t, ok := reply.Answer[0].(*dns.A); ok {
if !net.IPv4(8, 8, 8, 8).Equal(t.A) {
return fmt.Errorf("wrong response") </s> remove // No need to check this DNS server
</s> add // No need to check this DNS server. </s> remove ctx := &proxy.DNSContext{
Proto: "udp",
Req: req,
StartTime: time.Now(),
</s> add if !s.conf.ResolveClients {
return "", nil
}
arpa := dns.Fqdn(aghnet.ReverseAddr(ip))
req := &dns.Msg{
MsgHdr: dns.MsgHdr{
Id: dns.Id(),
RecursionDesired: true,
},
Compress: true,
Question: []dns.Question{{
Name: arpa,
Qtype: dns.TypePTR,
Qclass: dns.ClassINET,
}},
}
var resp *dns.Msg
if s.subnetDetector.IsLocallyServedNetwork(ip) {
resp, err = s.localResolvers.Exchange(req)
} else {
ctx := &proxy.DNSContext{
Proto: "udp",
Req: req,
StartTime: time.Now(),
}
err = s.internalProxy.Resolve(ctx)
resp = ctx.Res
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/dns.go
|
keep keep add keep keep keep keep keep keep
|
<mask> "net/http"
<mask> "os"
<mask> "runtime"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/agherr" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/dnsforward.go
|
keep add keep keep keep keep keep keep
|
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/querylog"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/stats"
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/agherr" </s> add "strings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings"
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/dnsforward.go
|
keep add keep keep keep keep keep
|
<mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/querylog"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/stats"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
</s> Pull request: 2704 local addresses vol.3
Merge in DNS/adguard-home from 2704-local-addresses-vol.3 to master
Updates #2704.
Updates #2829.
Updates #2928.
Squashed commit of the following:
commit 8c42355c0093a3ac6951f79a5211e7891800f93a
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:07:41 2021 +0300
dnsforward: rm errors pkg
commit 7594a21a620239951039454dd5686a872e6f41a8
Merge: 830b0834 908452f8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 18:00:03 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 830b0834090510096061fed20b600195ab3773b8
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 7 17:47:51 2021 +0300
dnsforward: reduce local upstream timeout
commit 493e81d9e8bacdc690f88af29a38d211b9733c7e
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 19:11:00 2021 +0300
client: private_upstream test
commit a0194ac28f15114578359b8c2460cd9af621e912
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:36:23 2021 +0300
all: expand api, fix conflicts
commit 0f4e06836fed958391aa597c8b02453564980ca3
Merge: 89cf93ad 8746005d
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 18:35:04 2021 +0300
Merge branch 'master' into 2704-local-addresses-vol.3
commit 89cf93ad4f26c2bf4f1b18ecaa4d3a1e169f9b06
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 18:02:40 2021 +0300
client: add local ptr upstreams to upstream test
commit e6dd869dddd4888474d625cbb005bad6390e4760
Author: Ildar Kamalov <[email protected]>
Date: Tue Apr 6 15:24:22 2021 +0300
client: add private DNS form
commit b858057b9a957a416117f22b8bd0025f90e8c758
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 13:05:28 2021 +0300
aghstrings: mk cloning correct
commit 8009ba60a6a7d6ceb7b6483a29f4e68d533af243
Author: Eugene Burkov <[email protected]>
Date: Tue Apr 6 12:37:46 2021 +0300
aghstrings: fix lil bug
commit 0dd19f2e7cc7c0de21517c37abd8336a907e1c0d
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:45:01 2021 +0300
all: log changes
commit eb5558d96fffa6e7bca7e14d3740d26e47382e23
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:18:53 2021 +0300
dnsforward: keep the style
commit d6d5fcbde40a633129c0e04887b81cf0b1ce6875
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 20:02:52 2021 +0300
dnsforward: disable redundant filtering for local ptr
commit 4f864c32027d10db9bcb4a264d2338df8c20afac
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 17:53:17 2021 +0300
dnsforward: imp tests
commit 7848e6f2341868f8ba0bb839956a0b7444cf02ca
Author: Eugene Burkov <[email protected]>
Date: Mon Apr 5 14:52:12 2021 +0300
all: imp code
commit 19ac30653800eebf8aaee499f65560ae2d458a5a
Author: Eugene Burkov <[email protected]>
Date: Sun Apr 4 16:28:05 2021 +0300
all: mv more logic to aghstrings
commit fac892ec5f0d2e30d6d64def0609267bbae4a202
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:23:23 2021 +0300
dnsforward: use filepath
commit 05a3aeef1181b914788d14c7519287d467ab301f
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:17:54 2021 +0300
aghstrings: introduce the pkg
commit f24e1b63d6e1bf266a4ed063f46f86d7abf65663
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 20:01:23 2021 +0300
all: imp code
commit 0217a0ebb341f99a90c9b68013bebf6ff73d08ae
Author: Eugene Burkov <[email protected]>
Date: Fri Apr 2 18:04:13 2021 +0300
openapi: log changes
... and 3 more commits </s> add "github.com/AdguardTeam/AdGuardHome/internal/agherr" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/agherr" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghstrings" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/80ed8be14538418a1faa3fd52e84e391b2f53f55
|
internal/dnsforward/dnsforward.go
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.