code_before
stringlengths 16
1.81M
| edits
stringlengths 4
328k
| next_edit
stringlengths 0
76.5k
| code_after
stringlengths 3
49.9M
| label_window
sequencelengths 4
1.81k
| instruction
stringlengths 20
51.9k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|---|---|---|
return isWildcard(wildcard) &&
strings.HasSuffix(host, wildcard[1:])
}
type rewritesArray []RewriteEntry
func (a rewritesArray) Len() int { return len(a) }
func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
| </s> remove func (a rewritesArray) Len() int { return len(a) }
</s> add // Len implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Len() int { return len(a) } </s> remove func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
</s> add // Swap implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Swap(i, j int) { a[i], a[j] = a[j], a[i] } </s> remove // Priority:
// . CNAME < A/AAAA;
// . exact < wildcard;
// . higher level wildcard < lower level wildcard
func (a rewritesArray) Less(i, j int) bool {
</s> add // Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool { </s> remove // Return TRUE of host name matches a wildcard pattern
func matchDomainWildcard(host, wildcard string) bool {
return isWildcard(wildcard) &&
strings.HasSuffix(host, wildcard[1:])
</s> add // matchDomainWildcard returns true if host matches the wildcard pattern.
func matchDomainWildcard(host, wildcard string) (ok bool) {
return isWildcard(wildcard) && strings.HasSuffix(host, wildcard[1:]) </s> remove return len(host) >= 2 &&
host[0] == '*' && host[1] == '.'
</s> add return len(host) > 1 && host[0] == '*' && host[1] == '.' | // rewritesSorted is a slice of legacy rewrites for sorting.
//
// The sorting priority:
//
// A and AAAA > CNAME
// wildcard > exact
// lower level wildcard > higher level wildcard
//
type rewritesSorted []RewriteEntry | return isWildcard(wildcard) &&
strings.HasSuffix(host, wildcard[1:])
}
// rewritesSorted is a slice of legacy rewrites for sorting.
//
// The sorting priority:
//
// A and AAAA > CNAME
// wildcard > exact
// lower level wildcard > higher level wildcard
//
type rewritesSorted []RewriteEntry
func (a rewritesArray) Len() int { return len(a) }
func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
}
type rewritesArray []RewriteEntry
func (a rewritesArray) Len() int { return len(a) }
func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
// Priority:
// . CNAME < A/AAAA;
| </s> remove func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
</s> add // Swap implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Swap(i, j int) { a[i], a[j] = a[j], a[i] } </s> remove // Priority:
// . CNAME < A/AAAA;
// . exact < wildcard;
// . higher level wildcard < lower level wildcard
func (a rewritesArray) Less(i, j int) bool {
</s> add // Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool { </s> remove type rewritesArray []RewriteEntry
</s> add // rewritesSorted is a slice of legacy rewrites for sorting.
//
// The sorting priority:
//
// A and AAAA > CNAME
// wildcard > exact
// lower level wildcard > higher level wildcard
//
type rewritesSorted []RewriteEntry </s> remove // Return TRUE of host name matches a wildcard pattern
func matchDomainWildcard(host, wildcard string) bool {
return isWildcard(wildcard) &&
strings.HasSuffix(host, wildcard[1:])
</s> add // matchDomainWildcard returns true if host matches the wildcard pattern.
func matchDomainWildcard(host, wildcard string) (ok bool) {
return isWildcard(wildcard) && strings.HasSuffix(host, wildcard[1:]) </s> remove // Get the list of matched rewrite entries.
// Priority: CNAME, A/AAAA; exact, wildcard.
// If matched exactly, don't return wildcard entries.
// If matched by several wildcards, select the more specific one
func findRewrites(a []RewriteEntry, host string) []RewriteEntry {
rr := rewritesArray{}
</s> add // findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{} | // Len implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Len() int { return len(a) } | }
type rewritesArray []RewriteEntry
// Len implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Len() int { return len(a) }
func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
// Priority:
// . CNAME < A/AAAA; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
type rewritesArray []RewriteEntry
func (a rewritesArray) Len() int { return len(a) }
func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
// Priority:
// . CNAME < A/AAAA;
// . exact < wildcard;
// . higher level wildcard < lower level wildcard
| </s> remove // Priority:
// . CNAME < A/AAAA;
// . exact < wildcard;
// . higher level wildcard < lower level wildcard
func (a rewritesArray) Less(i, j int) bool {
</s> add // Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool { </s> remove func (a rewritesArray) Len() int { return len(a) }
</s> add // Len implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Len() int { return len(a) } </s> remove type rewritesArray []RewriteEntry
</s> add // rewritesSorted is a slice of legacy rewrites for sorting.
//
// The sorting priority:
//
// A and AAAA > CNAME
// wildcard > exact
// lower level wildcard > higher level wildcard
//
type rewritesSorted []RewriteEntry </s> remove // Return TRUE of host name matches a wildcard pattern
func matchDomainWildcard(host, wildcard string) bool {
return isWildcard(wildcard) &&
strings.HasSuffix(host, wildcard[1:])
</s> add // matchDomainWildcard returns true if host matches the wildcard pattern.
func matchDomainWildcard(host, wildcard string) (ok bool) {
return isWildcard(wildcard) && strings.HasSuffix(host, wildcard[1:]) </s> remove // Get the list of matched rewrite entries.
// Priority: CNAME, A/AAAA; exact, wildcard.
// If matched exactly, don't return wildcard entries.
// If matched by several wildcards, select the more specific one
func findRewrites(a []RewriteEntry, host string) []RewriteEntry {
rr := rewritesArray{}
</s> add // findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{} | // Swap implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Swap(i, j int) { a[i], a[j] = a[j], a[i] } | type rewritesArray []RewriteEntry
func (a rewritesArray) Len() int { return len(a) }
// Swap implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
// Priority:
// . CNAME < A/AAAA;
// . exact < wildcard;
// . higher level wildcard < lower level wildcard | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
func (a rewritesArray) Len() int { return len(a) }
func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
// Priority:
// . CNAME < A/AAAA;
// . exact < wildcard;
// . higher level wildcard < lower level wildcard
func (a rewritesArray) Less(i, j int) bool {
if a[i].Type == dns.TypeCNAME && a[j].Type != dns.TypeCNAME {
return true
} else if a[i].Type != dns.TypeCNAME && a[j].Type == dns.TypeCNAME {
return false
}
| </s> remove func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
</s> add // Swap implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Swap(i, j int) { a[i], a[j] = a[j], a[i] } </s> remove func (a rewritesArray) Len() int { return len(a) }
</s> add // Len implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Len() int { return len(a) } </s> remove type rewritesArray []RewriteEntry
</s> add // rewritesSorted is a slice of legacy rewrites for sorting.
//
// The sorting priority:
//
// A and AAAA > CNAME
// wildcard > exact
// lower level wildcard > higher level wildcard
//
type rewritesSorted []RewriteEntry </s> remove // Return TRUE of host name matches a wildcard pattern
func matchDomainWildcard(host, wildcard string) bool {
return isWildcard(wildcard) &&
strings.HasSuffix(host, wildcard[1:])
</s> add // matchDomainWildcard returns true if host matches the wildcard pattern.
func matchDomainWildcard(host, wildcard string) (ok bool) {
return isWildcard(wildcard) && strings.HasSuffix(host, wildcard[1:]) </s> remove return len(host) >= 2 &&
host[0] == '*' && host[1] == '.'
</s> add return len(host) > 1 && host[0] == '*' && host[1] == '.' | // Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool { | func (a rewritesArray) Len() int { return len(a) }
func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
// Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool {
// Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool {
// Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool {
// Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool {
// Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool {
if a[i].Type == dns.TypeCNAME && a[j].Type != dns.TypeCNAME {
return true
} else if a[i].Type != dns.TypeCNAME && a[j].Type == dns.TypeCNAME {
return false
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
// both are wildcards
return len(a[i].Domain) > len(a[j].Domain)
}
// Prepare entry for use
func (r *RewriteEntry) prepare() {
if r.Answer == "AAAA" {
r.IP = nil
r.Type = dns.TypeAAAA
return
| </s> remove if r.Answer == "AAAA" {
</s> add switch r.Answer {
case "AAAA": </s> remove } else if r.Answer == "A" {
</s> add case "A": </s> remove r.IP = ip
r.Type = dns.TypeAAAA
</s> add </s> remove if (r.Type == dns.TypeA && qtype == dns.TypeA) ||
(r.Type == dns.TypeAAAA && qtype == dns.TypeAAAA) {
</s> add if r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA) { | // prepare prepares the a new or decoded entry. | // both are wildcards
return len(a[i].Domain) > len(a[j].Domain)
}
// prepare prepares the a new or decoded entry.
func (r *RewriteEntry) prepare() {
if r.Answer == "AAAA" {
r.IP = nil
r.Type = dns.TypeAAAA
return | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
}
// Prepare entry for use
func (r *RewriteEntry) prepare() {
if r.Answer == "AAAA" {
r.IP = nil
r.Type = dns.TypeAAAA
return
} else if r.Answer == "A" {
r.IP = nil
| </s> remove // Prepare entry for use
</s> add // prepare prepares the a new or decoded entry. </s> remove } else if r.Answer == "A" {
</s> add case "A": </s> remove r.IP = ip
r.Type = dns.TypeAAAA
</s> add </s> remove if (r.Type == dns.TypeA && qtype == dns.TypeA) ||
(r.Type == dns.TypeAAAA && qtype == dns.TypeAAAA) {
</s> add if r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA) { | switch r.Answer {
case "AAAA": | }
// Prepare entry for use
func (r *RewriteEntry) prepare() {
switch r.Answer {
case "AAAA":
r.IP = nil
r.Type = dns.TypeAAAA
return
} else if r.Answer == "A" {
r.IP = nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
if r.Answer == "AAAA" {
r.IP = nil
r.Type = dns.TypeAAAA
return
} else if r.Answer == "A" {
r.IP = nil
r.Type = dns.TypeA
return
}
| </s> remove if r.Answer == "AAAA" {
</s> add switch r.Answer {
case "AAAA": </s> remove r.IP = ip
r.Type = dns.TypeAAAA
</s> add </s> remove // Prepare entry for use
</s> add // prepare prepares the a new or decoded entry. </s> remove if (r.Type == dns.TypeA && qtype == dns.TypeA) ||
(r.Type == dns.TypeAAAA && qtype == dns.TypeAAAA) {
</s> add if r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA) { | case "A": | if r.Answer == "AAAA" {
r.IP = nil
r.Type = dns.TypeAAAA
return
case "A":
r.IP = nil
r.Type = dns.TypeA
return
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
r.IP = nil
r.Type = dns.TypeA
return
}
ip := net.ParseIP(r.Answer)
if ip == nil {
r.Type = dns.TypeCNAME
| </s> remove r.IP = ip
r.Type = dns.TypeAAAA
</s> add </s> remove } else if r.Answer == "A" {
</s> add case "A": </s> remove if r.Answer == "AAAA" {
</s> add switch r.Answer {
case "AAAA": </s> remove if (r.Type == dns.TypeA && qtype == dns.TypeA) ||
(r.Type == dns.TypeAAAA && qtype == dns.TypeAAAA) {
</s> add if r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA) { | default:
// Go on. | r.IP = nil
r.Type = dns.TypeA
return
default:
// Go on.
}
ip := net.ParseIP(r.Answer)
if ip == nil {
r.Type = dns.TypeCNAME
| [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
r.Type = dns.TypeCNAME
return
}
r.IP = ip
r.Type = dns.TypeAAAA
ip4 := ip.To4()
if ip4 != nil {
r.IP = ip4
r.Type = dns.TypeA
}
| </s> remove } else if r.Answer == "A" {
</s> add case "A": </s> remove if r.Answer == "AAAA" {
</s> add switch r.Answer {
case "AAAA": </s> remove if (r.Type == dns.TypeA && qtype == dns.TypeA) ||
(r.Type == dns.TypeAAAA && qtype == dns.TypeAAAA) {
</s> add if r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA) { | r.Type = dns.TypeCNAME
return
}
ip4 := ip.To4()
if ip4 != nil {
r.IP = ip4
r.Type = dns.TypeA
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
|
r.IP = ip4
r.Type = dns.TypeA
}
}
func (d *DNSFilter) prepareRewrites() {
for i := range d.Rewrites {
| </s> remove r.IP = ip
r.Type = dns.TypeAAAA
</s> add </s> remove } else if r.Answer == "A" {
</s> add case "A": </s> remove rr := findRewrites(d.Rewrites, host)
</s> add rr := findRewrites(d.Rewrites, host, qtype) </s> remove if (r.Type == dns.TypeA && qtype == dns.TypeA) ||
(r.Type == dns.TypeAAAA && qtype == dns.TypeAAAA) {
</s> add if r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA) { | } else {
r.IP = ip
r.Type = dns.TypeAAAA | r.IP = ip4
r.Type = dns.TypeA
} else {
r.IP = ip
r.Type = dns.TypeAAAA
}
}
func (d *DNSFilter) prepareRewrites() {
for i := range d.Rewrites { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
d.Rewrites[i].prepare()
}
}
// Get the list of matched rewrite entries.
// Priority: CNAME, A/AAAA; exact, wildcard.
// If matched exactly, don't return wildcard entries.
// If matched by several wildcards, select the more specific one
func findRewrites(a []RewriteEntry, host string) []RewriteEntry {
rr := rewritesArray{}
for _, r := range a {
if r.Domain != host {
if !matchDomainWildcard(host, r.Domain) {
continue
}
| </s> remove if r.Domain != host {
if !matchDomainWildcard(host, r.Domain) {
continue
}
</s> add if r.Domain != host && !matchDomainWildcard(host, r.Domain) {
continue
}
// Return CNAMEs for all types requests, but only the
// appropriate ones for A and AAAA.
if r.Type == dns.TypeCNAME ||
(r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA)) {
rr = append(rr, r) </s> remove // Return TRUE of host name matches a wildcard pattern
func matchDomainWildcard(host, wildcard string) bool {
return isWildcard(wildcard) &&
strings.HasSuffix(host, wildcard[1:])
</s> add // matchDomainWildcard returns true if host matches the wildcard pattern.
func matchDomainWildcard(host, wildcard string) (ok bool) {
return isWildcard(wildcard) && strings.HasSuffix(host, wildcard[1:]) </s> remove // Priority:
// . CNAME < A/AAAA;
// . exact < wildcard;
// . higher level wildcard < lower level wildcard
func (a rewritesArray) Less(i, j int) bool {
</s> add // Less implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Less(i, j int) bool { </s> remove rr = append(rr, r)
</s> add </s> remove func (a rewritesArray) Len() int { return len(a) }
</s> add // Len implements the sort.Interface interface for legacyRewritesSorted.
func (a rewritesSorted) Len() int { return len(a) } | // findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{} | d.Rewrites[i].prepare()
}
}
// findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{}
// findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{}
// findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{}
// findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{}
// findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{}
// findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{}
for _, r := range a {
if r.Domain != host {
if !matchDomainWildcard(host, r.Domain) {
continue
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
// If matched by several wildcards, select the more specific one
func findRewrites(a []RewriteEntry, host string) []RewriteEntry {
rr := rewritesArray{}
for _, r := range a {
if r.Domain != host {
if !matchDomainWildcard(host, r.Domain) {
continue
}
}
rr = append(rr, r)
}
if len(rr) == 0 {
| </s> remove // Get the list of matched rewrite entries.
// Priority: CNAME, A/AAAA; exact, wildcard.
// If matched exactly, don't return wildcard entries.
// If matched by several wildcards, select the more specific one
func findRewrites(a []RewriteEntry, host string) []RewriteEntry {
rr := rewritesArray{}
</s> add // findRewrites returns the list of matched rewrite entries. The priority is:
// CNAME, then A and AAAA; exact, then wildcard. If the host is matched
// exactly, wildcard entries aren't returned. If the host matched by wildcards,
// return the most specific for the question type.
func findRewrites(a []RewriteEntry, host string, qtype uint16) []RewriteEntry {
rr := rewritesSorted{} </s> remove rr = append(rr, r)
</s> add </s> remove if (r.Type == dns.TypeA && qtype == dns.TypeA) ||
(r.Type == dns.TypeAAAA && qtype == dns.TypeAAAA) {
</s> add if r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA) { </s> remove rr := findRewrites(d.Rewrites, host)
</s> add rr := findRewrites(d.Rewrites, host, qtype) </s> remove rr = findRewrites(d.Rewrites, host)
</s> add rr = findRewrites(d.Rewrites, host, qtype) | if r.Domain != host && !matchDomainWildcard(host, r.Domain) {
continue
}
// Return CNAMEs for all types requests, but only the
// appropriate ones for A and AAAA.
if r.Type == dns.TypeCNAME ||
(r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA)) {
rr = append(rr, r) | // If matched by several wildcards, select the more specific one
func findRewrites(a []RewriteEntry, host string) []RewriteEntry {
rr := rewritesArray{}
for _, r := range a {
if r.Domain != host && !matchDomainWildcard(host, r.Domain) {
continue
}
// Return CNAMEs for all types requests, but only the
// appropriate ones for A and AAAA.
if r.Type == dns.TypeCNAME ||
(r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA)) {
rr = append(rr, r)
if r.Domain != host && !matchDomainWildcard(host, r.Domain) {
continue
}
// Return CNAMEs for all types requests, but only the
// appropriate ones for A and AAAA.
if r.Type == dns.TypeCNAME ||
(r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA)) {
rr = append(rr, r)
if r.Domain != host && !matchDomainWildcard(host, r.Domain) {
continue
}
// Return CNAMEs for all types requests, but only the
// appropriate ones for A and AAAA.
if r.Type == dns.TypeCNAME ||
(r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA)) {
rr = append(rr, r)
if r.Domain != host && !matchDomainWildcard(host, r.Domain) {
continue
}
// Return CNAMEs for all types requests, but only the
// appropriate ones for A and AAAA.
if r.Type == dns.TypeCNAME ||
(r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA)) {
rr = append(rr, r)
}
rr = append(rr, r)
}
if len(rr) == 0 { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
if !matchDomainWildcard(host, r.Domain) {
continue
}
}
rr = append(rr, r)
}
if len(rr) == 0 {
return nil
}
| </s> remove if r.Domain != host {
if !matchDomainWildcard(host, r.Domain) {
continue
}
</s> add if r.Domain != host && !matchDomainWildcard(host, r.Domain) {
continue
}
// Return CNAMEs for all types requests, but only the
// appropriate ones for A and AAAA.
if r.Type == dns.TypeCNAME ||
(r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA)) {
rr = append(rr, r) </s> remove if (r.Type == dns.TypeA && qtype == dns.TypeA) ||
(r.Type == dns.TypeAAAA && qtype == dns.TypeAAAA) {
</s> add if r.Type == qtype && (qtype == dns.TypeA || qtype == dns.TypeAAAA) { </s> remove } else if r.Answer == "A" {
</s> add case "A": </s> remove rr := findRewrites(d.Rewrites, host)
</s> add rr := findRewrites(d.Rewrites, host, qtype) </s> remove if r.Answer == "AAAA" {
</s> add switch r.Answer {
case "AAAA": | if !matchDomainWildcard(host, r.Domain) {
continue
}
}
}
if len(rr) == 0 {
return nil
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites.go |
|
}, {
Domain: "a.host3.com",
Answer: "x.host.com",
}}
d.prepareRewrites()
testCases := []struct {
| </s> remove dtyp: dns.TypeA,
</s> add | }, {
Domain: "*.hostboth.com",
Answer: "1.2.3.6",
}, {
Domain: "*.hostboth.com",
Answer: "1234::5678", | }, {
Domain: "a.host3.com",
Answer: "x.host.com",
}, {
Domain: "*.hostboth.com",
Answer: "1.2.3.6",
}, {
Domain: "*.hostboth.com",
Answer: "1234::5678",
}}
d.prepareRewrites()
testCases := []struct { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
testCases := []struct {
name string
host string
dtyp uint16
wantCName string
wantVals []net.IP
}{{
name: "not_filtered_not_found",
host: "hoost.com",
| </s> remove dtyp uint16
</s> add </s> remove name: "not_filtered_not_found",
host: "hoost.com",
dtyp: dns.TypeA,
</s> add name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA, |
testCases := []struct {
name string
host string
wantCName string
wantVals []net.IP
}{{
name: "not_filtered_not_found",
host: "hoost.com", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
host string
wantCName string
wantVals []net.IP
}{{
name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA,
| </s> remove name: "not_filtered_not_found",
host: "hoost.com",
dtyp: dns.TypeA,
</s> add name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA, </s> remove dtyp uint16
</s> add </s> remove dtyp uint16
</s> add | dtyp uint16 | host string
wantCName string
wantVals []net.IP
dtyp uint16
}{{
name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA, | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
dtyp uint16
wantCName string
wantVals []net.IP
}{{
name: "not_filtered_not_found",
host: "hoost.com",
dtyp: dns.TypeA,
}, {
name: "rewritten_a",
host: "www.host.com",
dtyp: dns.TypeA,
wantCName: "host.com",
| </s> remove dtyp uint16
</s> add </s> remove dtyp uint16
</s> add | name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA, | dtyp uint16
wantCName string
wantVals []net.IP
}{{
name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA,
name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA,
name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA,
}, {
name: "rewritten_a",
host: "www.host.com",
dtyp: dns.TypeA,
wantCName: "host.com", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
dtyp: dns.TypeA,
}, {
name: "rewritten_a",
host: "www.host.com",
dtyp: dns.TypeA,
wantCName: "host.com",
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "rewritten_aaaa",
host: "www.host.com",
| </s> remove dtyp: dns.TypeAAAA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add | dtyp: dns.TypeA,
}, {
name: "rewritten_a",
host: "www.host.com",
wantCName: "host.com",
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "rewritten_aaaa",
host: "www.host.com", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
name: "rewritten_a",
host: "www.host.com",
wantCName: "host.com",
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "rewritten_aaaa",
host: "www.host.com",
wantCName: "host.com",
wantVals: []net.IP{net.ParseIP("1:2:3::4")},
| </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeAAAA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add </s> remove name: "wildcard_match",
host: "abc.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 5}},
</s> add name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA, | dtyp: dns.TypeA, | name: "rewritten_a",
host: "www.host.com",
wantCName: "host.com",
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
dtyp: dns.TypeA,
}, {
name: "rewritten_aaaa",
host: "www.host.com",
wantCName: "host.com",
wantVals: []net.IP{net.ParseIP("1:2:3::4")}, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "rewritten_aaaa",
host: "www.host.com",
dtyp: dns.TypeAAAA,
wantCName: "host.com",
wantVals: []net.IP{net.ParseIP("1:2:3::4")},
}, {
name: "wildcard_match",
host: "abc.host.com",
| </s> remove name: "wildcard_match",
host: "abc.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 5}},
</s> add name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA, </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add | wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "rewritten_aaaa",
host: "www.host.com",
wantCName: "host.com",
wantVals: []net.IP{net.ParseIP("1:2:3::4")},
}, {
name: "wildcard_match",
host: "abc.host.com", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
host: "www.host.com",
wantCName: "host.com",
wantVals: []net.IP{net.ParseIP("1:2:3::4")},
}, {
name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
| </s> remove dtyp: dns.TypeAAAA,
</s> add </s> remove name: "wildcard_match",
host: "abc.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 5}},
</s> add name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA, </s> remove name: "wildcard_override",
host: "a.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 4}},
</s> add name: "wildcard_override",
host: "a.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA, </s> remove name: "not_filtered_not_found",
host: "hoost.com",
dtyp: dns.TypeA,
</s> add name: "not_filtered_not_found",
host: "hoost.com",
wantCName: "",
wantVals: nil,
dtyp: dns.TypeA, | dtyp: dns.TypeAAAA, | host: "www.host.com",
wantCName: "host.com",
wantVals: []net.IP{net.ParseIP("1:2:3::4")},
dtyp: dns.TypeAAAA,
}, {
name: "wildcard_match",
host: "abc.host.com",
wantCName: "", | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
dtyp: dns.TypeAAAA,
wantCName: "host.com",
wantVals: []net.IP{net.ParseIP("1:2:3::4")},
}, {
name: "wildcard_match",
host: "abc.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 5}},
}, {
name: "wildcard_override",
host: "a.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 4}},
| </s> remove name: "wildcard_override",
host: "a.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 4}},
</s> add name: "wildcard_override",
host: "a.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA, </s> remove dtyp: dns.TypeAAAA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add | name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA, | dtyp: dns.TypeAAAA,
wantCName: "host.com",
wantVals: []net.IP{net.ParseIP("1:2:3::4")},
}, {
name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA,
name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA,
name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA,
name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA,
}, {
name: "wildcard_override",
host: "a.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 4}}, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
host: "abc.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 5}},
}, {
name: "wildcard_override",
host: "a.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 4}},
}, {
name: "wildcard_cname_interaction",
host: "www.host2.com",
dtyp: dns.TypeA,
wantCName: "host.com",
| </s> remove name: "wildcard_match",
host: "abc.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 5}},
</s> add name: "wildcard_match",
host: "abc.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA, </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeAAAA,
</s> add | name: "wildcard_override",
host: "a.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA, | host: "abc.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 5}},
}, {
name: "wildcard_override",
host: "a.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA,
name: "wildcard_override",
host: "a.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA,
name: "wildcard_override",
host: "a.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA,
name: "wildcard_override",
host: "a.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA,
}, {
name: "wildcard_cname_interaction",
host: "www.host2.com",
dtyp: dns.TypeA,
wantCName: "host.com", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
wantVals: []net.IP{{1, 2, 3, 4}},
}, {
name: "wildcard_cname_interaction",
host: "www.host2.com",
dtyp: dns.TypeA,
wantCName: "host.com",
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "two_cnames",
host: "b.host.com",
| </s> remove dtyp: dns.TypeA,
</s> add </s> remove name: "wildcard_override",
host: "a.host.com",
dtyp: dns.TypeA,
wantVals: []net.IP{{1, 2, 3, 4}},
</s> add name: "wildcard_override",
host: "a.host.com",
wantCName: "",
wantVals: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA, </s> remove dtyp: dns.TypeAAAA,
</s> add | wantVals: []net.IP{{1, 2, 3, 4}},
}, {
name: "wildcard_cname_interaction",
host: "www.host2.com",
wantCName: "host.com",
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "two_cnames",
host: "b.host.com", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
name: "wildcard_cname_interaction",
host: "www.host2.com",
wantCName: "host.com",
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "two_cnames",
host: "b.host.com",
wantCName: "somehost.com",
wantVals: []net.IP{{0, 0, 0, 0}},
dtyp: dns.TypeA,
| </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add | dtyp: dns.TypeA, | name: "wildcard_cname_interaction",
host: "www.host2.com",
wantCName: "host.com",
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
dtyp: dns.TypeA,
}, {
name: "two_cnames",
host: "b.host.com",
wantCName: "somehost.com",
wantVals: []net.IP{{0, 0, 0, 0}},
dtyp: dns.TypeA, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "two_cnames",
host: "b.host.com",
dtyp: dns.TypeA,
wantCName: "somehost.com",
wantVals: []net.IP{{0, 0, 0, 0}},
}, {
name: "two_cnames_and_wildcard",
host: "b.host3.com",
| </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeAAAA,
</s> add | wantVals: []net.IP{{1, 2, 3, 4}, {1, 2, 3, 5}},
}, {
name: "two_cnames",
host: "b.host.com",
wantCName: "somehost.com",
wantVals: []net.IP{{0, 0, 0, 0}},
}, {
name: "two_cnames_and_wildcard",
host: "b.host3.com", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
host: "b.host.com",
wantCName: "somehost.com",
wantVals: []net.IP{{0, 0, 0, 0}},
}, {
name: "two_cnames_and_wildcard",
host: "b.host3.com",
wantCName: "x.host.com",
wantVals: []net.IP{{1, 2, 3, 5}},
| </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add | dtyp: dns.TypeA, | host: "b.host.com",
wantCName: "somehost.com",
wantVals: []net.IP{{0, 0, 0, 0}},
dtyp: dns.TypeA,
}, {
name: "two_cnames_and_wildcard",
host: "b.host3.com",
wantCName: "x.host.com",
wantVals: []net.IP{{1, 2, 3, 5}}, | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
wantVals: []net.IP{{0, 0, 0, 0}},
}, {
name: "two_cnames_and_wildcard",
host: "b.host3.com",
dtyp: dns.TypeA,
wantCName: "x.host.com",
wantVals: []net.IP{{1, 2, 3, 5}},
}}
for _, tc := range testCases {
| </s> remove dtyp: dns.TypeA,
</s> add </s> remove want: []net.IP{},
</s> add | wantVals: []net.IP{{0, 0, 0, 0}},
}, {
name: "two_cnames_and_wildcard",
host: "b.host3.com",
wantCName: "x.host.com",
wantVals: []net.IP{{1, 2, 3, 5}},
}}
for _, tc := range testCases { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
name: "two_cnames_and_wildcard",
host: "b.host3.com",
wantCName: "x.host.com",
wantVals: []net.IP{{1, 2, 3, 5}},
}}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
| </s> remove dtyp: dns.TypeA,
</s> add </s> remove want: []net.IP{},
</s> add </s> remove dtyp: dns.TypeA,
</s> add | dtyp: dns.TypeA,
}, {
name: "issue3343",
host: "www.hostboth.com",
wantCName: "",
wantVals: []net.IP{net.ParseIP("1234::5678")},
dtyp: dns.TypeAAAA, | name: "two_cnames_and_wildcard",
host: "b.host3.com",
wantCName: "x.host.com",
wantVals: []net.IP{{1, 2, 3, 5}},
dtyp: dns.TypeA,
}, {
name: "issue3343",
host: "www.hostboth.com",
wantCName: "",
wantVals: []net.IP{net.ParseIP("1234::5678")},
dtyp: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) { | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
d.Rewrites = []RewriteEntry{{
Domain: "host.com",
Answer: "1.1.1.1",
}, {
Domain: "*.host.com",
Answer: "2.2.2.2",
Type: dns.TypeA,
}, {
| </s> | Type: dns.TypeA, | d.Rewrites = []RewriteEntry{{
Domain: "host.com",
Answer: "1.1.1.1",
Type: dns.TypeA,
}, {
Domain: "*.host.com",
Answer: "2.2.2.2",
Type: dns.TypeA,
}, { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
Domain: "*.host.com",
Answer: "2.2.2.2",
}, {
Domain: "*.sub.host.com",
Answer: "3.3.3.3",
Type: dns.TypeA,
| </s> | Type: dns.TypeA, | Domain: "*.host.com",
Answer: "2.2.2.2",
Type: dns.TypeA,
}, {
Domain: "*.sub.host.com",
Answer: "3.3.3.3",
Type: dns.TypeA, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
Type: dns.TypeA,
}, {
Domain: "*.sub.host.com",
Answer: "3.3.3.3",
}}
d.prepareRewrites()
testCases := []struct {
name string
host string
| </s> remove dtyp uint16
</s> add </s> remove dtyp uint16
</s> add | Type: dns.TypeA, | Type: dns.TypeA,
}, {
Domain: "*.sub.host.com",
Answer: "3.3.3.3",
Type: dns.TypeA,
}}
d.prepareRewrites()
testCases := []struct {
name string
host string | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
// Exception for AAAA record.
d.Rewrites = []RewriteEntry{{
Domain: "host.com",
Answer: "1.2.3.4",
}, {
Domain: "host.com",
Answer: "AAAA",
Type: dns.TypeAAAA,
}, {
Domain: "host2.com",
| </s> | Type: dns.TypeA, | // Exception for AAAA record.
d.Rewrites = []RewriteEntry{{
Domain: "host.com",
Answer: "1.2.3.4",
Type: dns.TypeA,
}, {
Domain: "host.com",
Answer: "AAAA",
Type: dns.TypeAAAA,
}, {
Domain: "host2.com", | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
Type: dns.TypeA,
}, {
Domain: "host.com",
Answer: "AAAA",
}, {
Domain: "host2.com",
Answer: "::1",
Type: dns.TypeAAAA,
}, {
Domain: "host2.com",
| </s> | Type: dns.TypeAAAA, | Type: dns.TypeA,
}, {
Domain: "host.com",
Answer: "AAAA",
Type: dns.TypeAAAA,
}, {
Domain: "host2.com",
Answer: "::1",
Type: dns.TypeAAAA,
}, {
Domain: "host2.com", | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
Domain: "host2.com",
Answer: "::1",
}, {
Domain: "host2.com",
Answer: "A",
Type: dns.TypeA,
| </s> | Type: dns.TypeAAAA, | Domain: "host2.com",
Answer: "::1",
Type: dns.TypeAAAA,
}, {
Domain: "host2.com",
Answer: "A",
Type: dns.TypeA, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
Domain: "host2.com",
Answer: "A",
}, {
Domain: "host3.com",
Answer: "A",
Type: dns.TypeA,
| </s> | Type: dns.TypeA, | Domain: "host2.com",
Answer: "A",
Type: dns.TypeA,
}, {
Domain: "host3.com",
Answer: "A",
Type: dns.TypeA, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
Domain: "host3.com",
Answer: "A",
}}
d.prepareRewrites()
testCases := []struct {
name string
| </s> remove dtyp uint16
</s> add </s> remove dtyp uint16
</s> add | Type: dns.TypeA, | Domain: "host3.com",
Answer: "A",
Type: dns.TypeA,
}}
d.prepareRewrites()
testCases := []struct {
name string | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
testCases := []struct {
name string
host string
dtyp uint16
want []net.IP
}{{
name: "match_A",
host: "host.com",
dtyp: dns.TypeA,
| </s> remove dtyp uint16
</s> add </s> remove dtyp: dns.TypeA,
</s> add |
testCases := []struct {
name string
host string
want []net.IP
}{{
name: "match_A",
host: "host.com",
dtyp: dns.TypeA, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
name string
host string
want []net.IP
}{{
name: "match_A",
host: "host.com",
want: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA,
}, {
| </s> remove dtyp uint16
</s> add </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp uint16
</s> add | dtyp uint16 | name string
host string
want []net.IP
dtyp uint16
}{{
name: "match_A",
host: "host.com",
want: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA,
}, { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
want []net.IP
}{{
name: "match_A",
host: "host.com",
dtyp: dns.TypeA,
want: []net.IP{{1, 2, 3, 4}},
}, {
name: "exception_AAAA_host.com",
host: "host.com",
dtyp: dns.TypeAAAA,
| </s> remove dtyp uint16
</s> add </s> remove dtyp: dns.TypeA,
</s> add | want []net.IP
}{{
name: "match_A",
host: "host.com",
want: []net.IP{{1, 2, 3, 4}},
}, {
name: "exception_AAAA_host.com",
host: "host.com",
dtyp: dns.TypeAAAA, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
host: "host.com",
want: []net.IP{{1, 2, 3, 4}},
}, {
name: "exception_AAAA_host.com",
host: "host.com",
want: nil,
dtyp: dns.TypeAAAA,
}, {
| </s> remove dtyp: dns.TypeA,
</s> add </s> remove dtyp: dns.TypeA,
</s> add | dtyp: dns.TypeA, | host: "host.com",
want: []net.IP{{1, 2, 3, 4}},
dtyp: dns.TypeA,
}, {
name: "exception_AAAA_host.com",
host: "host.com",
want: nil,
dtyp: dns.TypeAAAA,
}, { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
name: "exception_AAAA_host.com",
host: "host.com",
dtyp: dns.TypeAAAA,
}, {
name: "exception_A_host2.com",
host: "host2.com",
| </s> remove dtyp: dns.TypeA,
</s> add | want: nil, | name: "exception_AAAA_host.com",
host: "host.com",
want: nil,
dtyp: dns.TypeAAAA,
}, {
name: "exception_A_host2.com",
host: "host2.com", | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
name: "exception_A_host2.com",
host: "host2.com",
dtyp: dns.TypeA,
}, {
name: "match_AAAA_host2.com",
host: "host2.com",
want: []net.IP{net.ParseIP("::1")},
dtyp: dns.TypeAAAA,
| </s> remove dtyp: dns.TypeAAAA,
</s> add | want: nil, | name: "exception_A_host2.com",
host: "host2.com",
want: nil,
dtyp: dns.TypeA,
}, {
name: "match_AAAA_host2.com",
host: "host2.com",
want: []net.IP{net.ParseIP("::1")},
dtyp: dns.TypeAAAA, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
dtyp: dns.TypeA,
}, {
name: "match_AAAA_host2.com",
host: "host2.com",
dtyp: dns.TypeAAAA,
want: []net.IP{net.ParseIP("::1")},
}, {
name: "exception_A_host3.com",
host: "host3.com",
dtyp: dns.TypeA,
| </s> remove want: []net.IP{},
</s> add | dtyp: dns.TypeA,
}, {
name: "match_AAAA_host2.com",
host: "host2.com",
want: []net.IP{net.ParseIP("::1")},
}, {
name: "exception_A_host3.com",
host: "host3.com",
dtyp: dns.TypeA, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
host: "host2.com",
want: []net.IP{net.ParseIP("::1")},
}, {
name: "exception_A_host3.com",
host: "host3.com",
want: nil,
dtyp: dns.TypeA,
}, {
| </s> remove dtyp: dns.TypeAAAA,
</s> add | dtyp: dns.TypeAAAA, | host: "host2.com",
want: []net.IP{net.ParseIP("::1")},
dtyp: dns.TypeAAAA,
}, {
name: "exception_A_host3.com",
host: "host3.com",
want: nil,
dtyp: dns.TypeA,
}, { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
name: "exception_A_host3.com",
host: "host3.com",
dtyp: dns.TypeA,
}, {
name: "match_AAAA_host3.com",
host: "host3.com",
want: nil,
| </s> remove dtyp: dns.TypeAAAA,
</s> add </s> remove want: []net.IP{},
</s> add | want: nil, | name: "exception_A_host3.com",
host: "host3.com",
want: nil,
dtyp: dns.TypeA,
}, {
name: "match_AAAA_host3.com",
host: "host3.com",
want: nil, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
name: "match_AAAA_host3.com",
host: "host3.com",
dtyp: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(tc.name+"_"+tc.host, func(t *testing.T) {
r := d.processRewrites(tc.host, tc.dtyp)
| </s> remove want: []net.IP{},
</s> add </s> remove dtyp: dns.TypeA,
</s> add | want: nil, | name: "match_AAAA_host3.com",
host: "host3.com",
want: nil,
dtyp: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(tc.name+"_"+tc.host, func(t *testing.T) {
r := d.processRewrites(tc.host, tc.dtyp) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
}, {
name: "match_AAAA_host3.com",
host: "host3.com",
dtyp: dns.TypeAAAA,
want: []net.IP{},
}}
for _, tc := range testCases {
t.Run(tc.name+"_"+tc.host, func(t *testing.T) {
r := d.processRewrites(tc.host, tc.dtyp)
| </s> remove dtyp: dns.TypeA,
</s> add | }, {
name: "match_AAAA_host3.com",
host: "host3.com",
dtyp: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(tc.name+"_"+tc.host, func(t *testing.T) {
r := d.processRewrites(tc.host, tc.dtyp) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: filtering: fix legacy rewrite wildcards
Updates #3343.
Squashed commit of the following:
commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907
Author: Ainar Garipov <[email protected]>
Date: Mon Jul 12 20:58:57 2021 +0300
filtering: fix legacy rewrite wildcards | https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2 | internal/filtering/rewrites_test.go |
|
replacedSafebrowsing,
replacedParental,
}) => {
const totalBlocked = (
blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch
);
return (
| </s> remove const totalBlocked = blockedFiltering + replacedSafebrowsing + replacedParental;
</s> add const totalBlocked = (
blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch
); | replacedSafesearch, | replacedSafebrowsing,
replacedParental,
replacedSafesearch,
}) => {
const totalBlocked = (
blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch
);
return ( | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request 1777: client: include safesearch to count percent
Updates #5568.
Squashed commit of the following:
commit 3d3a8c187b27307b69b160283f3cd6f9c40cc68e
Merge: 7f4b6357 c3edab43
Author: Vladislav Abdulmyanov <[email protected]>
Date: Wed Mar 22 11:53:06 2023 +0200
Merge branch 'master' into 5568-save-search-percent
commit 7f4b6357c6f7941eb37175a83972a9821dd08974
Author: Vladislav Abdulmyanov <[email protected]>
Date: Tue Mar 21 13:36:14 2023 +0200
client: include safesearch to count percent | https://github.com/AdguardTeam/AdGuardHome/commit/194ead3479a43a74d6232754fc1547ec153010bf | client/src/components/Dashboard/BlockedDomains.js |
blockedFiltering,
replacedSafebrowsing,
replacedParental,
}) => {
const totalBlocked = blockedFiltering + replacedSafebrowsing + replacedParental;
return (
<Card
title={t('top_blocked_domains')}
subtitle={subtitle}
| </s> | const totalBlocked = (
blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch
); | blockedFiltering,
replacedSafebrowsing,
replacedParental,
}) => {
const totalBlocked = (
blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch
);
return (
<Card
title={t('top_blocked_domains')}
subtitle={subtitle} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request 1777: client: include safesearch to count percent
Updates #5568.
Squashed commit of the following:
commit 3d3a8c187b27307b69b160283f3cd6f9c40cc68e
Merge: 7f4b6357 c3edab43
Author: Vladislav Abdulmyanov <[email protected]>
Date: Wed Mar 22 11:53:06 2023 +0200
Merge branch 'master' into 5568-save-search-percent
commit 7f4b6357c6f7941eb37175a83972a9821dd08974
Author: Vladislav Abdulmyanov <[email protected]>
Date: Tue Mar 21 13:36:14 2023 +0200
client: include safesearch to count percent | https://github.com/AdguardTeam/AdGuardHome/commit/194ead3479a43a74d6232754fc1547ec153010bf | client/src/components/Dashboard/BlockedDomains.js |
blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired,
subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired,
};
| </s> remove const totalBlocked = blockedFiltering + replacedSafebrowsing + replacedParental;
</s> add const totalBlocked = (
blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch
); | replacedSafesearch: PropTypes.number.isRequired, | blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedSafesearch: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired,
subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired,
}; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request 1777: client: include safesearch to count percent
Updates #5568.
Squashed commit of the following:
commit 3d3a8c187b27307b69b160283f3cd6f9c40cc68e
Merge: 7f4b6357 c3edab43
Author: Vladislav Abdulmyanov <[email protected]>
Date: Wed Mar 22 11:53:06 2023 +0200
Merge branch 'master' into 5568-save-search-percent
commit 7f4b6357c6f7941eb37175a83972a9821dd08974
Author: Vladislav Abdulmyanov <[email protected]>
Date: Tue Mar 21 13:36:14 2023 +0200
client: include safesearch to count percent | https://github.com/AdguardTeam/AdGuardHome/commit/194ead3479a43a74d6232754fc1547ec153010bf | client/src/components/Dashboard/BlockedDomains.js |
topBlockedDomains={stats.topBlockedDomains}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
</div>}
| </s> remove const totalBlocked = blockedFiltering + replacedSafebrowsing + replacedParental;
</s> add const totalBlocked = (
blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch
); | replacedSafesearch={stats.numReplacedSafesearch} | topBlockedDomains={stats.topBlockedDomains}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedSafesearch={stats.numReplacedSafesearch}
replacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
</div>} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request 1777: client: include safesearch to count percent
Updates #5568.
Squashed commit of the following:
commit 3d3a8c187b27307b69b160283f3cd6f9c40cc68e
Merge: 7f4b6357 c3edab43
Author: Vladislav Abdulmyanov <[email protected]>
Date: Wed Mar 22 11:53:06 2023 +0200
Merge branch 'master' into 5568-save-search-percent
commit 7f4b6357c6f7941eb37175a83972a9821dd08974
Author: Vladislav Abdulmyanov <[email protected]>
Date: Tue Mar 21 13:36:14 2023 +0200
client: include safesearch to count percent | https://github.com/AdguardTeam/AdGuardHome/commit/194ead3479a43a74d6232754fc1547ec153010bf | client/src/components/Dashboard/index.js |
"query_log_disabled": "The query log is disabled and can be configured in the <0>settings</0>",
"query_log_strict_search": "Use double quotes for strict search",
"query_log_retention_confirm": "Are you sure you want to change query log retention? If you decrease the interval value, some data will be lost",
"source_label": "Source",
"found_in_known_domain_db": "Found in the known domains database.",
"category_label": "Category",
"rule_label": "Rule",
| </s> remove let successMessage = '';
</s> add </s> remove if (status) {
successMessage = 'disabled_protection';
await apiClient.disableGlobalProtection();
} else {
successMessage = 'enabled_protection';
await apiClient.enableGlobalProtection();
}
</s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status }); </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
</s> add </s> remove enableGlobalProtection() {
const { path, method } = this.GLOBAL_ENABLE_PROTECTION;
return this.makeRequest(path, method);
}
disableGlobalProtection() {
const { path, method } = this.GLOBAL_DISABLE_PROTECTION;
return this.makeRequest(path, method);
}
</s> add | "dns_config": "DNS configuration",
"blocking_mode": "Blocking mode",
"nxdomain": "NXDOMAIN",
"null_ip": "Null IP",
"custom_ip": "Custom IP",
"blocking_ipv4": "Blocking IPv4",
"blocking_ipv6": "Blocking IPv6",
"form_enter_rate_limit": "Enter rate limit",
"rate_limit": "Rate limit", | "query_log_disabled": "The query log is disabled and can be configured in the <0>settings</0>",
"query_log_strict_search": "Use double quotes for strict search",
"query_log_retention_confirm": "Are you sure you want to change query log retention? If you decrease the interval value, some data will be lost",
"dns_config": "DNS configuration",
"blocking_mode": "Blocking mode",
"nxdomain": "NXDOMAIN",
"null_ip": "Null IP",
"custom_ip": "Custom IP",
"blocking_ipv4": "Blocking IPv4",
"blocking_ipv6": "Blocking IPv6",
"form_enter_rate_limit": "Enter rate limit",
"rate_limit": "Rate limit",
"source_label": "Source",
"found_in_known_domain_db": "Found in the known domains database.",
"category_label": "Category",
"rule_label": "Rule", | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/__locales/en.json |
export const toggleProtectionSuccess = createAction('TOGGLE_PROTECTION_SUCCESS');
export const toggleProtection = status => async (dispatch) => {
dispatch(toggleProtectionRequest());
let successMessage = '';
try {
if (status) {
successMessage = 'disabled_protection';
await apiClient.disableGlobalProtection();
} else {
| </s> remove if (status) {
successMessage = 'disabled_protection';
await apiClient.disableGlobalProtection();
} else {
successMessage = 'enabled_protection';
await apiClient.enableGlobalProtection();
}
</s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status }); </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove enableGlobalProtection() {
const { path, method } = this.GLOBAL_ENABLE_PROTECTION;
return this.makeRequest(path, method);
}
disableGlobalProtection() {
const { path, method } = this.GLOBAL_DISABLE_PROTECTION;
return this.makeRequest(path, method);
}
</s> add | export const toggleProtectionSuccess = createAction('TOGGLE_PROTECTION_SUCCESS');
export const toggleProtection = status => async (dispatch) => {
dispatch(toggleProtectionRequest());
try {
if (status) {
successMessage = 'disabled_protection';
await apiClient.disableGlobalProtection();
} else { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/actions/index.js |
|
dispatch(toggleProtectionRequest());
let successMessage = '';
try {
if (status) {
successMessage = 'disabled_protection';
await apiClient.disableGlobalProtection();
} else {
successMessage = 'enabled_protection';
await apiClient.enableGlobalProtection();
}
dispatch(addSuccessToast(successMessage));
dispatch(toggleProtectionSuccess());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(toggleProtectionFailure());
| </s> remove let successMessage = '';
</s> add </s> remove enableGlobalProtection() {
const { path, method } = this.GLOBAL_ENABLE_PROTECTION;
return this.makeRequest(path, method);
}
disableGlobalProtection() {
const { path, method } = this.GLOBAL_DISABLE_PROTECTION;
return this.makeRequest(path, method);
}
</s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
</s> add </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, | const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status }); | dispatch(toggleProtectionRequest());
let successMessage = '';
try {
const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status });
const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status });
const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status });
const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status });
const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status });
const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status });
const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status });
const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status });
dispatch(addSuccessToast(successMessage));
dispatch(toggleProtectionSuccess());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(toggleProtectionFailure()); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/actions/index.js |
GLOBAL_STOP = { path: 'stop', method: 'POST' };
GLOBAL_SET_UPSTREAM_DNS = { path: 'set_upstreams_config', method: 'POST' };
GLOBAL_TEST_UPSTREAM_DNS = { path: 'test_upstream_dns', method: 'POST' };
GLOBAL_VERSION = { path: 'version.json', method: 'POST' };
GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
GLOBAL_UPDATE = { path: 'update', method: 'POST' };
startGlobalFiltering() {
const { path, method } = this.GLOBAL_START;
return this.makeRequest(path, method);
| </s> remove enableGlobalProtection() {
const { path, method } = this.GLOBAL_ENABLE_PROTECTION;
return this.makeRequest(path, method);
}
disableGlobalProtection() {
const { path, method } = this.GLOBAL_DISABLE_PROTECTION;
return this.makeRequest(path, method);
}
</s> add </s> remove let successMessage = '';
</s> add </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, | GLOBAL_STOP = { path: 'stop', method: 'POST' };
GLOBAL_SET_UPSTREAM_DNS = { path: 'set_upstreams_config', method: 'POST' };
GLOBAL_TEST_UPSTREAM_DNS = { path: 'test_upstream_dns', method: 'POST' };
GLOBAL_VERSION = { path: 'version.json', method: 'POST' };
GLOBAL_UPDATE = { path: 'update', method: 'POST' };
startGlobalFiltering() {
const { path, method } = this.GLOBAL_START;
return this.makeRequest(path, method); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/api/Api.js |
|
};
return this.makeRequest(path, method, config);
}
enableGlobalProtection() {
const { path, method } = this.GLOBAL_ENABLE_PROTECTION;
return this.makeRequest(path, method);
}
disableGlobalProtection() {
const { path, method } = this.GLOBAL_DISABLE_PROTECTION;
return this.makeRequest(path, method);
}
getUpdate() {
const { path, method } = this.GLOBAL_UPDATE;
return this.makeRequest(path, method);
}
| </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
</s> add </s> remove let successMessage = '';
</s> add </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, | };
return this.makeRequest(path, method, config);
}
getUpdate() {
const { path, method } = this.GLOBAL_UPDATE;
return this.makeRequest(path, method);
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/api/Api.js |
|
import StatsConfig from './StatsConfig';
import LogsConfig from './LogsConfig';
import FiltersConfig from './FiltersConfig';
import Checkbox from '../ui/Checkbox';
import Loading from '../ui/Loading';
import PageTitle from '../ui/PageTitle';
import Card from '../ui/Card';
import './Settings.css';
| </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, | import DnsConfig from './DnsConfig';
| import StatsConfig from './StatsConfig';
import LogsConfig from './LogsConfig';
import FiltersConfig from './FiltersConfig';
import DnsConfig from './DnsConfig';
import Checkbox from '../ui/Checkbox';
import Loading from '../ui/Loading';
import PageTitle from '../ui/PageTitle';
import Card from '../ui/Card';
import './Settings.css'; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/components/Settings/index.js |
this.props.getBlockedServices();
this.props.getStatsConfig();
this.props.getLogsConfig();
this.props.getFilteringStatus();
}
renderSettings = (settings) => {
const settingsKeys = Object.keys(settings);
| </s> remove let successMessage = '';
</s> add </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove enableGlobalProtection() {
const { path, method } = this.GLOBAL_ENABLE_PROTECTION;
return this.makeRequest(path, method);
}
disableGlobalProtection() {
const { path, method } = this.GLOBAL_DISABLE_PROTECTION;
return this.makeRequest(path, method);
}
</s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
</s> add | this.props.getDnsConfig(); | this.props.getBlockedServices();
this.props.getStatsConfig();
this.props.getLogsConfig();
this.props.getFilteringStatus();
this.props.getDnsConfig();
}
renderSettings = (settings) => {
const settingsKeys = Object.keys(settings); | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/components/Settings/index.js |
setStatsConfig,
resetStats,
stats,
queryLogs,
setLogsConfig,
clearLogs,
filtering,
setFiltersConfig,
setDnsConfig,
t,
| </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, | dnsConfig, | setStatsConfig,
resetStats,
stats,
queryLogs,
dnsConfig,
setLogsConfig,
clearLogs,
filtering,
setFiltersConfig,
setDnsConfig,
t, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/components/Settings/index.js |
clearLogs,
filtering,
setFiltersConfig,
t,
} = this.props;
const isDataReady =
!settings.processing &&
| </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove let successMessage = '';
</s> add | setDnsConfig, | clearLogs,
filtering,
setFiltersConfig,
setDnsConfig,
t,
} = this.props;
const isDataReady =
!settings.processing && | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/components/Settings/index.js |
</div>
</Card>
</div>
<div className="col-md-12">
<LogsConfig
enabled={queryLogs.enabled}
interval={queryLogs.interval}
| </s> remove let successMessage = '';
</s> add </s> remove if (status) {
successMessage = 'disabled_protection';
await apiClient.disableGlobalProtection();
} else {
successMessage = 'enabled_protection';
await apiClient.enableGlobalProtection();
}
</s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status }); </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
</s> add | <div className="col-md-12">
<DnsConfig
dnsConfig={dnsConfig}
setDnsConfig={setDnsConfig}
/>
</div> | </div>
</Card>
</div>
<div className="col-md-12">
<DnsConfig
dnsConfig={dnsConfig}
setDnsConfig={setDnsConfig}
/>
</div>
<div className="col-md-12">
<LogsConfig
enabled={queryLogs.enabled}
interval={queryLogs.interval} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/components/Settings/index.js |
setStatsConfig: PropTypes.func.isRequired,
resetStats: PropTypes.func.isRequired,
setFiltersConfig: PropTypes.func.isRequired,
getFilteringStatus: PropTypes.func.isRequired,
t: PropTypes.func.isRequired,
};
export default withNamespaces()(Settings);
| </s> remove let successMessage = '';
</s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
</s> add | getDnsConfig: PropTypes.func.isRequired, | setStatsConfig: PropTypes.func.isRequired,
resetStats: PropTypes.func.isRequired,
setFiltersConfig: PropTypes.func.isRequired,
getFilteringStatus: PropTypes.func.isRequired,
getDnsConfig: PropTypes.func.isRequired,
t: PropTypes.func.isRequired,
};
export default withNamespaces()(Settings); | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/components/Settings/index.js |
import { getBlockedServices, setBlockedServices } from '../actions/services';
import { getStatsConfig, setStatsConfig, resetStats } from '../actions/stats';
import { clearLogs, getLogsConfig, setLogsConfig } from '../actions/queryLogs';
import { getFilteringStatus, setFiltersConfig } from '../actions/filtering';
import Settings from '../components/Settings';
const mapStateToProps = (state) => {
const {
settings, services, stats, queryLogs, filtering, dnsConfig,
| </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove let successMessage = '';
</s> add | import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; | import { getBlockedServices, setBlockedServices } from '../actions/services';
import { getStatsConfig, setStatsConfig, resetStats } from '../actions/stats';
import { clearLogs, getLogsConfig, setLogsConfig } from '../actions/queryLogs';
import { getFilteringStatus, setFiltersConfig } from '../actions/filtering';
import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig';
import Settings from '../components/Settings';
const mapStateToProps = (state) => {
const {
settings, services, stats, queryLogs, filtering, dnsConfig, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/containers/Settings.js |
import Settings from '../components/Settings';
const mapStateToProps = (state) => {
const {
settings, services, stats, queryLogs, filtering,
} = state;
const props = {
settings,
services,
stats,
| </s> remove let successMessage = '';
</s> add | settings, services, stats, queryLogs, filtering, dnsConfig, | import Settings from '../components/Settings';
const mapStateToProps = (state) => {
const {
settings, services, stats, queryLogs, filtering, dnsConfig,
} = state;
const props = {
settings,
services,
stats, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/containers/Settings.js |
queryLogs,
filtering,
};
return props;
};
const mapDispatchToProps = {
initSettings,
| </s> remove enableGlobalProtection() {
const { path, method } = this.GLOBAL_ENABLE_PROTECTION;
return this.makeRequest(path, method);
}
disableGlobalProtection() {
const { path, method } = this.GLOBAL_DISABLE_PROTECTION;
return this.makeRequest(path, method);
}
</s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
</s> add </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, | dnsConfig, | queryLogs,
filtering,
dnsConfig,
};
return props;
};
const mapDispatchToProps = {
initSettings, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/containers/Settings.js |
getFilteringStatus,
setFiltersConfig,
};
export default connect(
mapStateToProps,
| </s> remove let successMessage = '';
</s> add | getDnsConfig,
setDnsConfig, | getFilteringStatus,
setFiltersConfig,
getDnsConfig,
setDnsConfig,
};
export default connect(
mapStateToProps, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/containers/Settings.js |
export const FILTERS_INTERVALS_HOURS = [0, 1, 12, 24, 72, 168];
export const WHOIS_ICONS = {
location: 'location',
orgname: 'network',
netname: 'network',
descr: '',
};
| </s> remove let successMessage = '';
</s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' };
GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' };
</s> add </s> remove enableGlobalProtection() {
const { path, method } = this.GLOBAL_ENABLE_PROTECTION;
return this.makeRequest(path, method);
}
disableGlobalProtection() {
const { path, method } = this.GLOBAL_DISABLE_PROTECTION;
return this.makeRequest(path, method);
}
</s> add </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, | export const BLOCKING_MODES = {
nxdomain: 'nxdomain',
null_ip: 'null_ip',
custom_ip: 'custom_ip',
};
|
export const FILTERS_INTERVALS_HOURS = [0, 1, 12, 24, 72, 168];
export const BLOCKING_MODES = {
nxdomain: 'nxdomain',
null_ip: 'null_ip',
custom_ip: 'custom_ip',
};
export const WHOIS_ICONS = {
location: 'location',
orgname: 'network',
netname: 'network',
descr: '',
}; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/helpers/constants.js |
import stats from './stats';
import queryLogs from './queryLogs';
import filtering from './filtering';
const settings = handleActions(
{
[actions.initSettingsRequest]: state => ({ ...state, processing: true }),
[actions.initSettingsFailure]: state => ({ ...state, processing: false }),
| </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove let successMessage = '';
</s> add | import dnsConfig from './dnsConfig'; | import stats from './stats';
import queryLogs from './queryLogs';
import dnsConfig from './dnsConfig';
import filtering from './filtering';
const settings = handleActions(
{
[actions.initSettingsRequest]: state => ({ ...state, processing: true }),
[actions.initSettingsFailure]: state => ({ ...state, processing: false }), | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/reducers/index.js |
rewrites,
services,
stats,
loadingBar: loadingBarReducer,
form: formReducer,
});
| </s> remove settings, services, stats, queryLogs, filtering,
</s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove if (status) {
successMessage = 'disabled_protection';
await apiClient.disableGlobalProtection();
} else {
successMessage = 'enabled_protection';
await apiClient.enableGlobalProtection();
}
</s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection';
await apiClient.setDnsConfig({ protection_enabled: !status }); </s> remove let successMessage = '';
</s> add | dnsConfig, | rewrites,
services,
stats,
dnsConfig,
loadingBar: loadingBarReducer,
form: formReducer,
}); | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep"
] | + client: handle DNS config | https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a | client/src/reducers/index.js |
dnsProxy *proxy.Proxy // DNS proxy instance
dnsFilter *dnsfilter.Dnsfilter // DNS filter instance
queryLog querylog.QueryLog // Query log instance
stats stats.Stats
AllowedClients map[string]bool // IP addresses of whitelist clients
DisallowedClients map[string]bool // IP addresses of clients that should be blocked
AllowedClientsIPNet []net.IPNet // CIDRs of whitelist clients
DisallowedClientsIPNet []net.IPNet // CIDRs of clients that should be blocked
BlockedHosts map[string]bool // hosts that should be blocked
webRegistered bool
sync.RWMutex
conf ServerConfig
| </s> remove // Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
</s> add </s> remove func convertArrayToMap(dst *map[string]bool, src []string) {
*dst = make(map[string]bool)
for _, s := range src {
(*dst)[s] = true
}
}
// Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error {
*dst = make(map[string]bool)
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
(*dst)[s] = true
continue
}
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
*dstIPNet = append(*dstIPNet, *ipnet)
}
return nil
}
</s> add </s> remove if s.isBlockedIP(ip) {
</s> add if s.access.IsBlockedIP(ip) { </s> remove if s.isBlockedDomain(host) {
</s> add if s.access.IsBlockedDomain(host) { </s> remove httpRegister(http.MethodGet, "/control/access/list", handleAccessList)
httpRegister(http.MethodPost, "/control/access/set", handleAccessSet)
</s> add | access *accessCtx | dnsProxy *proxy.Proxy // DNS proxy instance
dnsFilter *dnsfilter.Dnsfilter // DNS filter instance
queryLog querylog.QueryLog // Query log instance
stats stats.Stats
access *accessCtx
access *accessCtx
access *accessCtx
access *accessCtx
access *accessCtx
access *accessCtx
webRegistered bool
sync.RWMutex
conf ServerConfig | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | dnsforward/dnsforward.go |
defer s.Unlock()
return s.startInternal(config)
}
func convertArrayToMap(dst *map[string]bool, src []string) {
*dst = make(map[string]bool)
for _, s := range src {
(*dst)[s] = true
}
}
// Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error {
*dst = make(map[string]bool)
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
(*dst)[s] = true
continue
}
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
*dstIPNet = append(*dstIPNet, *ipnet)
}
return nil
}
// startInternal starts without locking
func (s *Server) startInternal(config *ServerConfig) error {
if s.dnsProxy != nil {
return errors.New("DNS server is already started")
}
| </s> remove // Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
</s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients)
if err != nil {
return err
}
err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients)
</s> add s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts)
</s> add </s> remove if s.isBlockedIP(ip) {
</s> add if s.access.IsBlockedIP(ip) { </s> remove if s.isBlockedDomain(host) {
</s> add if s.access.IsBlockedDomain(host) { | defer s.Unlock()
return s.startInternal(config)
}
// startInternal starts without locking
func (s *Server) startInternal(config *ServerConfig) error {
if s.dnsProxy != nil {
return errors.New("DNS server is already started")
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | dnsforward/dnsforward.go |
|
RequestHandler: s.handleDNSRequest,
AllServers: s.conf.AllServers,
}
err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients)
if err != nil {
return err
}
err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients)
if err != nil {
return err
}
convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts)
| </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts)
</s> add </s> remove func convertArrayToMap(dst *map[string]bool, src []string) {
*dst = make(map[string]bool)
for _, s := range src {
(*dst)[s] = true
}
}
// Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error {
*dst = make(map[string]bool)
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
(*dst)[s] = true
continue
}
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
*dstIPNet = append(*dstIPNet, *ipnet)
}
return nil
}
</s> add </s> remove // Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
</s> add </s> remove if s.isBlockedDomain(host) {
</s> add if s.access.IsBlockedDomain(host) { </s> remove if s.isBlockedIP(ip) {
</s> add if s.access.IsBlockedIP(ip) { | s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) | RequestHandler: s.handleDNSRequest,
AllServers: s.conf.AllServers,
}
s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
if err != nil {
return err
}
convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | dnsforward/dnsforward.go |
if err != nil {
return err
}
convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts)
if s.conf.TLSListenAddr != nil && len(s.conf.CertificateChainData) != 0 && len(s.conf.PrivateKeyData) != 0 {
proxyConfig.TLSListenAddr = s.conf.TLSListenAddr
keypair, err := tls.X509KeyPair(s.conf.CertificateChainData, s.conf.PrivateKeyData)
if err != nil {
return errorx.Decorate(err, "Failed to parse TLS keypair")
| </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients)
if err != nil {
return err
}
err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients)
</s> add s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove func convertArrayToMap(dst *map[string]bool, src []string) {
*dst = make(map[string]bool)
for _, s := range src {
(*dst)[s] = true
}
}
// Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error {
*dst = make(map[string]bool)
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
(*dst)[s] = true
continue
}
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
*dstIPNet = append(*dstIPNet, *ipnet)
}
return nil
}
</s> add </s> remove // Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
</s> add </s> remove if s.isBlockedDomain(host) {
</s> add if s.access.IsBlockedDomain(host) { </s> remove if s.isBlockedIP(ip) {
</s> add if s.access.IsBlockedIP(ip) { | if err != nil {
return err
}
if s.conf.TLSListenAddr != nil && len(s.conf.CertificateChainData) != 0 && len(s.conf.PrivateKeyData) != 0 {
proxyConfig.TLSListenAddr = s.conf.TLSListenAddr
keypair, err := tls.X509KeyPair(s.conf.CertificateChainData, s.conf.PrivateKeyData)
if err != nil {
return errorx.Decorate(err, "Failed to parse TLS keypair") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | dnsforward/dnsforward.go |
|
s.dnsProxy.ServeHTTP(w, r)
s.RUnlock()
}
// Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
func (s *Server) beforeRequestHandler(p *proxy.Proxy, d *proxy.DNSContext) (bool, error) {
ip, _, _ := net.SplitHostPort(d.Addr.String())
if s.isBlockedIP(ip) {
log.Tracef("Client IP %s is blocked by settings", ip)
return false, nil
| </s> remove if s.isBlockedIP(ip) {
</s> add if s.access.IsBlockedIP(ip) { </s> remove func convertArrayToMap(dst *map[string]bool, src []string) {
*dst = make(map[string]bool)
for _, s := range src {
(*dst)[s] = true
}
}
// Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error {
*dst = make(map[string]bool)
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
(*dst)[s] = true
continue
}
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
*dstIPNet = append(*dstIPNet, *ipnet)
}
return nil
}
</s> add </s> remove if s.isBlockedDomain(host) {
</s> add if s.access.IsBlockedDomain(host) { </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts)
</s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients)
if err != nil {
return err
}
err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients)
</s> add s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) | s.dnsProxy.ServeHTTP(w, r)
s.RUnlock()
}
func (s *Server) beforeRequestHandler(p *proxy.Proxy, d *proxy.DNSContext) (bool, error) {
ip, _, _ := net.SplitHostPort(d.Addr.String())
if s.isBlockedIP(ip) {
log.Tracef("Client IP %s is blocked by settings", ip)
return false, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | dnsforward/dnsforward.go |
|
}
func (s *Server) beforeRequestHandler(p *proxy.Proxy, d *proxy.DNSContext) (bool, error) {
ip, _, _ := net.SplitHostPort(d.Addr.String())
if s.isBlockedIP(ip) {
log.Tracef("Client IP %s is blocked by settings", ip)
return false, nil
}
if len(d.Req.Question) == 1 {
| </s> remove // Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
</s> add </s> remove if s.isBlockedDomain(host) {
</s> add if s.access.IsBlockedDomain(host) { </s> remove func convertArrayToMap(dst *map[string]bool, src []string) {
*dst = make(map[string]bool)
for _, s := range src {
(*dst)[s] = true
}
}
// Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error {
*dst = make(map[string]bool)
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
(*dst)[s] = true
continue
}
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
*dstIPNet = append(*dstIPNet, *ipnet)
}
return nil
}
</s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients)
if err != nil {
return err
}
err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients)
</s> add s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts)
</s> add | if s.access.IsBlockedIP(ip) { | }
func (s *Server) beforeRequestHandler(p *proxy.Proxy, d *proxy.DNSContext) (bool, error) {
ip, _, _ := net.SplitHostPort(d.Addr.String())
if s.access.IsBlockedIP(ip) {
log.Tracef("Client IP %s is blocked by settings", ip)
return false, nil
}
if len(d.Req.Question) == 1 { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | dnsforward/dnsforward.go |
}
if len(d.Req.Question) == 1 {
host := strings.TrimSuffix(d.Req.Question[0].Name, ".")
if s.isBlockedDomain(host) {
log.Tracef("Domain %s is blocked by settings", host)
return false, nil
}
}
| </s> remove if s.isBlockedIP(ip) {
</s> add if s.access.IsBlockedIP(ip) { </s> remove // Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
</s> add </s> remove func convertArrayToMap(dst *map[string]bool, src []string) {
*dst = make(map[string]bool)
for _, s := range src {
(*dst)[s] = true
}
}
// Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error {
*dst = make(map[string]bool)
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
(*dst)[s] = true
continue
}
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
*dstIPNet = append(*dstIPNet, *ipnet)
}
return nil
}
</s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients)
if err != nil {
return err
}
err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients)
</s> add s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts)
</s> add | if s.access.IsBlockedDomain(host) { | }
if len(d.Req.Question) == 1 {
host := strings.TrimSuffix(d.Req.Question[0].Name, ".")
if s.access.IsBlockedDomain(host) {
log.Tracef("Domain %s is blocked by settings", host)
return false, nil
}
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | dnsforward/dnsforward.go |
s.conf.HTTPRegister("POST", "/control/enable_protection", s.handleProtectionEnable)
s.conf.HTTPRegister("POST", "/control/disable_protection", s.handleProtectionDisable)
s.conf.HTTPRegister("POST", "/control/set_upstreams_config", s.handleSetUpstreamConfig)
s.conf.HTTPRegister("POST", "/control/test_upstream_dns", s.handleTestUpstreamDNS)
}
| </s> remove // Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
</s> add </s> remove if s.isBlockedDomain(host) {
</s> add if s.access.IsBlockedDomain(host) { </s> remove func convertArrayToMap(dst *map[string]bool, src []string) {
*dst = make(map[string]bool)
for _, s := range src {
(*dst)[s] = true
}
}
// Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error {
*dst = make(map[string]bool)
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
(*dst)[s] = true
continue
}
_, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
*dstIPNet = append(*dstIPNet, *ipnet)
}
return nil
}
</s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients)
if err != nil {
return err
}
err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients)
</s> add s.access = &accessCtx{}
err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove if s.isBlockedIP(ip) {
</s> add if s.access.IsBlockedIP(ip) { | s.conf.HTTPRegister("GET", "/control/access/list", s.handleAccessList)
s.conf.HTTPRegister("POST", "/control/access/set", s.handleAccessSet)
| s.conf.HTTPRegister("POST", "/control/enable_protection", s.handleProtectionEnable)
s.conf.HTTPRegister("POST", "/control/disable_protection", s.handleProtectionDisable)
s.conf.HTTPRegister("POST", "/control/set_upstreams_config", s.handleSetUpstreamConfig)
s.conf.HTTPRegister("POST", "/control/test_upstream_dns", s.handleTestUpstreamDNS)
s.conf.HTTPRegister("GET", "/control/access/list", s.handleAccessList)
s.conf.HTTPRegister("POST", "/control/access/set", s.handleAccessSet)
} | [
"keep",
"keep",
"keep",
"add",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | dnsforward/dnsforward_http.go |
httpRegister(http.MethodGet, "/control/i18n/current_language", handleI18nCurrentLanguage)
http.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON)))
httpRegister(http.MethodPost, "/control/update", handleUpdate)
httpRegister(http.MethodGet, "/control/access/list", handleAccessList)
httpRegister(http.MethodPost, "/control/access/set", handleAccessSet)
httpRegister("GET", "/control/profile", handleGetProfile)
RegisterFilteringHandlers()
RegisterTLSHandlers()
RegisterBlockedServicesHandlers()
| </s> remove if s.isBlockedDomain(host) {
</s> add if s.access.IsBlockedDomain(host) { </s> remove if s.isBlockedIP(ip) {
</s> add if s.access.IsBlockedIP(ip) { </s> remove // Return TRUE if this client should be blocked
func (s *Server) isBlockedIP(ip string) bool {
if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 {
_, ok := s.AllowedClients[ip]
if ok {
return false
}
if len(s.AllowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.AllowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return false
}
}
}
return true
}
_, ok := s.DisallowedClients[ip]
if ok {
return true
}
if len(s.DisallowedClientsIPNet) != 0 {
ipAddr := net.ParseIP(ip)
for _, ipnet := range s.DisallowedClientsIPNet {
if ipnet.Contains(ipAddr) {
return true
}
}
}
return false
}
// Return TRUE if this domain should be blocked
func (s *Server) isBlockedDomain(host string) bool {
_, ok := s.BlockedHosts[host]
return ok
}
</s> add </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts)
</s> add | httpRegister(http.MethodGet, "/control/i18n/current_language", handleI18nCurrentLanguage)
http.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON)))
httpRegister(http.MethodPost, "/control/update", handleUpdate)
httpRegister("GET", "/control/profile", handleGetProfile)
RegisterFilteringHandlers()
RegisterTLSHandlers()
RegisterBlockedServicesHandlers() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dnsforward: move access settings and web handlers | https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f | home/control.go |
|
AllServers bool `yaml:"all_servers"` // if true, parallel queries to all configured upstream servers are enabled
AllowedClients []string `yaml:"allowed_clients"` // IP addresses of whitelist clients
DisallowedClients []string `yaml:"disallowed_clients"` // IP addresses of clients that should be blocked
BlockedHosts []string `yaml:"blocked_hosts"` // hosts that should be blocked
| </s> | EnableEDNSClientSubnet bool `yaml:"edns_client_subnet"` // Enable EDNS Client Subnet option
| AllServers bool `yaml:"all_servers"` // if true, parallel queries to all configured upstream servers are enabled
EnableEDNSClientSubnet bool `yaml:"edns_client_subnet"` // Enable EDNS Client Subnet option
AllowedClients []string `yaml:"allowed_clients"` // IP addresses of whitelist clients
DisallowedClients []string `yaml:"disallowed_clients"` // IP addresses of clients that should be blocked
BlockedHosts []string `yaml:"blocked_hosts"` // hosts that should be blocked
| [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + dns: add "edns_client_subnet" setting | https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1 | dnsforward/dnsforward.go |
DomainsReservedUpstreams: s.conf.DomainsReservedUpstreams,
BeforeRequestHandler: s.beforeRequestHandler,
RequestHandler: s.handleDNSRequest,
AllServers: s.conf.AllServers,
}
s.access = &accessCtx{}
err = s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
if err != nil {
| </s> | EnableEDNSClientSubnet: s.conf.EnableEDNSClientSubnet, | DomainsReservedUpstreams: s.conf.DomainsReservedUpstreams,
BeforeRequestHandler: s.beforeRequestHandler,
RequestHandler: s.handleDNSRequest,
AllServers: s.conf.AllServers,
EnableEDNSClientSubnet: s.conf.EnableEDNSClientSubnet,
}
s.access = &accessCtx{}
err = s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
if err != nil { | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + dns: add "edns_client_subnet" setting | https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1 | dnsforward/dnsforward.go |
BlockingMode string `json:"blocking_mode"`
BlockingIPv4 string `json:"blocking_ipv4"`
BlockingIPv6 string `json:"blocking_ipv6"`
}
func (s *Server) handleGetConfig(w http.ResponseWriter, r *http.Request) {
resp := dnsConfigJSON{}
s.RLock()
resp.ProtectionEnabled = s.conf.ProtectionEnabled
| </s> | EDNSCSEnabled bool `json:"edns_cs_enabled"` | BlockingMode string `json:"blocking_mode"`
BlockingIPv4 string `json:"blocking_ipv4"`
BlockingIPv6 string `json:"blocking_ipv6"`
EDNSCSEnabled bool `json:"edns_cs_enabled"`
}
func (s *Server) handleGetConfig(w http.ResponseWriter, r *http.Request) {
resp := dnsConfigJSON{}
s.RLock()
resp.ProtectionEnabled = s.conf.ProtectionEnabled | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + dns: add "edns_client_subnet" setting | https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1 | dnsforward/dnsforward_http.go |
resp.BlockingIPv6 = s.conf.BlockingIPv6
resp.RateLimit = s.conf.Ratelimit
s.RUnlock()
js, err := json.Marshal(resp)
if err != nil {
httpError(r, w, http.StatusInternalServerError, "json.Marshal: %s", err)
| </s> | resp.EDNSCSEnabled = s.conf.EnableEDNSClientSubnet | resp.BlockingIPv6 = s.conf.BlockingIPv6
resp.RateLimit = s.conf.Ratelimit
resp.EDNSCSEnabled = s.conf.EnableEDNSClientSubnet
s.RUnlock()
js, err := json.Marshal(resp)
if err != nil {
httpError(r, w, http.StatusInternalServerError, "json.Marshal: %s", err) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + dns: add "edns_client_subnet" setting | https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1 | dnsforward/dnsforward_http.go |
}
s.Unlock()
s.conf.ConfigModified()
if restart {
| </s> | if js.Exists("edns_cs_enabled") {
s.conf.EnableEDNSClientSubnet = req.EDNSCSEnabled
restart = true
}
| }
if js.Exists("edns_cs_enabled") {
s.conf.EnableEDNSClientSubnet = req.EDNSCSEnabled
restart = true
}
s.Unlock()
s.conf.ConfigModified()
if restart { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + dns: add "edns_client_subnet" setting | https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1 | dnsforward/dnsforward_http.go |
blocking_ipv6:
type: "string"
UpstreamsConfig:
type: "object"
description: "Upstreams configuration"
| </s> | edns_cs_enabled:
type: "boolean" | blocking_ipv6:
type: "string"
edns_cs_enabled:
type: "boolean"
UpstreamsConfig:
type: "object"
description: "Upstreams configuration" | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + dns: add "edns_client_subnet" setting | https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1 | openapi/openapi.yaml |
}
func handleStatsTop(w http.ResponseWriter, r *http.Request) {
resp, err := client.Get("http://127.0.0.1:8618/querylog")
if err != nil {
errortext := fmt.Sprintf("Couldn't get querylog from coredns: %T %s\n", err, err)
log.Println(errortext)
http.Error(w, errortext, http.StatusBadGateway)
| </s> remove func init() {
</s> add func purgeStats() { </s> remove periodic.Entries = statsEntries{}
</s> add *periodic = periodicStats{} | func handleStatsReset(w http.ResponseWriter, r *http.Request) {
purgeStats()
_, err := fmt.Fprintf(w, "OK\n")
if err != nil {
httpError(w, http.StatusInternalServerError, "Couldn't write body: %s", err)
return
}
}
|
}
func handleStatsReset(w http.ResponseWriter, r *http.Request) {
purgeStats()
_, err := fmt.Fprintf(w, "OK\n")
if err != nil {
httpError(w, http.StatusInternalServerError, "Couldn't write body: %s", err)
return
}
}
func handleStatsTop(w http.ResponseWriter, r *http.Request) {
resp, err := client.Get("http://127.0.0.1:8618/querylog")
if err != nil {
errortext := fmt.Sprintf("Couldn't get querylog from coredns: %T %s\n", err, err)
log.Println(errortext)
http.Error(w, errortext, http.StatusBadGateway) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Add API call to reset stats | https://github.com/AdguardTeam/AdGuardHome/commit/19e76b693803220dffcd0a1fb1fe1e654309a11a | control.go |
http.HandleFunc("/control/stats_history", optionalAuth(ensureGET(handleStatsHistory)))
http.HandleFunc("/control/stats_top", optionalAuth(ensureGET(handleStatsTop)))
http.HandleFunc("/control/querylog", optionalAuth(ensureGET(handleQueryLog)))
http.HandleFunc("/control/querylog_enable", optionalAuth(ensurePOST(handleQueryLogEnable)))
http.HandleFunc("/control/querylog_disable", optionalAuth(ensurePOST(handleQueryLogDisable)))
http.HandleFunc("/control/set_upstream_dns", optionalAuth(ensurePOST(handleSetUpstreamDNS)))
http.HandleFunc("/control/test_upstream_dns", optionalAuth(ensurePOST(handleTestUpstreamDNS)))
http.HandleFunc("/control/version.json", optionalAuth(handleGetVersionJSON))
| </s> remove func init() {
</s> add func purgeStats() { </s> remove periodic.Entries = statsEntries{}
</s> add *periodic = periodicStats{} | http.HandleFunc("/control/stats_reset", optionalAuth(ensurePOST(handleStatsReset))) | http.HandleFunc("/control/stats_history", optionalAuth(ensureGET(handleStatsHistory)))
http.HandleFunc("/control/stats_top", optionalAuth(ensureGET(handleStatsTop)))
http.HandleFunc("/control/stats_reset", optionalAuth(ensurePOST(handleStatsReset)))
http.HandleFunc("/control/querylog", optionalAuth(ensureGET(handleQueryLog)))
http.HandleFunc("/control/querylog_enable", optionalAuth(ensurePOST(handleQueryLogEnable)))
http.HandleFunc("/control/querylog_disable", optionalAuth(ensurePOST(handleQueryLogDisable)))
http.HandleFunc("/control/set_upstream_dns", optionalAuth(ensurePOST(handleSetUpstreamDNS)))
http.HandleFunc("/control/test_upstream_dns", optionalAuth(ensurePOST(handleTestUpstreamDNS)))
http.HandleFunc("/control/version.json", optionalAuth(handleGetVersionJSON)) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Add API call to reset stats | https://github.com/AdguardTeam/AdGuardHome/commit/19e76b693803220dffcd0a1fb1fe1e654309a11a | control.go |
var statistics stats
func initPeriodicStats(periodic *periodicStats) {
periodic.Entries = statsEntries{}
}
func init() {
initPeriodicStats(&statistics.PerSecond)
initPeriodicStats(&statistics.PerMinute)
| </s> remove func init() {
</s> add func purgeStats() { | *periodic = periodicStats{} |
var statistics stats
func initPeriodicStats(periodic *periodicStats) {
*periodic = periodicStats{}
}
func init() {
initPeriodicStats(&statistics.PerSecond)
initPeriodicStats(&statistics.PerMinute) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Add API call to reset stats | https://github.com/AdguardTeam/AdGuardHome/commit/19e76b693803220dffcd0a1fb1fe1e654309a11a | stats.go |
func initPeriodicStats(periodic *periodicStats) {
periodic.Entries = statsEntries{}
}
func init() {
initPeriodicStats(&statistics.PerSecond)
initPeriodicStats(&statistics.PerMinute)
initPeriodicStats(&statistics.PerHour)
initPeriodicStats(&statistics.PerDay)
}
| </s> remove periodic.Entries = statsEntries{}
</s> add *periodic = periodicStats{} | func purgeStats() { | func initPeriodicStats(periodic *periodicStats) {
periodic.Entries = statsEntries{}
}
func purgeStats() {
initPeriodicStats(&statistics.PerSecond)
initPeriodicStats(&statistics.PerMinute)
initPeriodicStats(&statistics.PerHour)
initPeriodicStats(&statistics.PerDay)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Add API call to reset stats | https://github.com/AdguardTeam/AdGuardHome/commit/19e76b693803220dffcd0a1fb1fe1e654309a11a | stats.go |
require (
github.com/AdguardTeam/dnsproxy v0.40.4
github.com/AdguardTeam/golibs v0.10.4
github.com/AdguardTeam/urlfilter v0.15.1
github.com/NYTimes/gziphandler v1.1.1
github.com/ameshkov/dnscrypt/v2 v2.2.3
github.com/digineo/go-ipset/v2 v2.2.1
github.com/fsnotify/fsnotify v1.5.1
github.com/go-ping/ping v0.0.0-20211130115550-779d1e919534
| </s> remove github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M=
github.com/AdguardTeam/urlfilter v0.15.1/go.mod h1:EwXwrYhowP7bedqmOrmKKmQtpBYFyDNEBFQ+lxdUgQU=
</s> add github.com/AdguardTeam/urlfilter v0.15.2 h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ=
github.com/AdguardTeam/urlfilter v0.15.2/go.mod h1:46YZDOV1+qtdRDuhZKVPSSp7JWWes0KayqHrKAFBdEI= </s> remove github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY=
</s> add </s> remove golang.org/x/net v0.0.0-20210908191846-a5e095526f91/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
</s> add | github.com/AdguardTeam/urlfilter v0.15.2 |
require (
github.com/AdguardTeam/dnsproxy v0.40.4
github.com/AdguardTeam/golibs v0.10.4
github.com/AdguardTeam/urlfilter v0.15.2
github.com/NYTimes/gziphandler v1.1.1
github.com/ameshkov/dnscrypt/v2 v2.2.3
github.com/digineo/go-ipset/v2 v2.2.1
github.com/fsnotify/fsnotify v1.5.1
github.com/go-ping/ping v0.0.0-20211130115550-779d1e919534 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4133 empty rewrite
Merge in DNS/adguard-home from 4133-empty-rewrite to master
Closes #4133.
Squashed commit of the following:
commit 4d2313c211c3955922d340c006b323c65e5e5ba4
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 18 21:36:21 2022 +0300
all: log changes
commit 5b8e392a2225c215fc117223d3f6553f8bdf21cd
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 18 21:32:57 2022 +0300
all: upd urlfilter | https://github.com/AdguardTeam/AdGuardHome/commit/1a3bf5ebda7310146486aeff23b5e3307860c6bc | go.mod |
github.com/AdguardTeam/dnsproxy v0.40.4 h1:dnI60dO/lm7ILSZ5GLV5bt3Vp8jFUPKqpaWewWpb3gY=
github.com/AdguardTeam/dnsproxy v0.40.4/go.mod h1:PZ9l22h3Er+5mxFQB7oHZMTvx+aa9R6LbzA/ikXQlS0=
github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY=
github.com/AdguardTeam/golibs v0.10.3/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
github.com/AdguardTeam/golibs v0.10.4 h1:TMBkablZC0IZOpRgg9fzAKlxxNhSN2YJq7qbgtuZ7PQ=
github.com/AdguardTeam/golibs v0.10.4/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M=
| </s> remove github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M=
github.com/AdguardTeam/urlfilter v0.15.1/go.mod h1:EwXwrYhowP7bedqmOrmKKmQtpBYFyDNEBFQ+lxdUgQU=
</s> add github.com/AdguardTeam/urlfilter v0.15.2 h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ=
github.com/AdguardTeam/urlfilter v0.15.2/go.mod h1:46YZDOV1+qtdRDuhZKVPSSp7JWWes0KayqHrKAFBdEI= </s> remove github.com/AdguardTeam/urlfilter v0.15.1
</s> add github.com/AdguardTeam/urlfilter v0.15.2 </s> remove golang.org/x/net v0.0.0-20210908191846-a5e095526f91/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
</s> add | github.com/AdguardTeam/dnsproxy v0.40.4 h1:dnI60dO/lm7ILSZ5GLV5bt3Vp8jFUPKqpaWewWpb3gY=
github.com/AdguardTeam/dnsproxy v0.40.4/go.mod h1:PZ9l22h3Er+5mxFQB7oHZMTvx+aa9R6LbzA/ikXQlS0=
github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
github.com/AdguardTeam/golibs v0.10.3/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
github.com/AdguardTeam/golibs v0.10.4 h1:TMBkablZC0IZOpRgg9fzAKlxxNhSN2YJq7qbgtuZ7PQ=
github.com/AdguardTeam/golibs v0.10.4/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M= | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4133 empty rewrite
Merge in DNS/adguard-home from 4133-empty-rewrite to master
Closes #4133.
Squashed commit of the following:
commit 4d2313c211c3955922d340c006b323c65e5e5ba4
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 18 21:36:21 2022 +0300
all: log changes
commit 5b8e392a2225c215fc117223d3f6553f8bdf21cd
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 18 21:32:57 2022 +0300
all: upd urlfilter | https://github.com/AdguardTeam/AdGuardHome/commit/1a3bf5ebda7310146486aeff23b5e3307860c6bc | go.sum |
|
github.com/AdguardTeam/golibs v0.10.3/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
github.com/AdguardTeam/golibs v0.10.4 h1:TMBkablZC0IZOpRgg9fzAKlxxNhSN2YJq7qbgtuZ7PQ=
github.com/AdguardTeam/golibs v0.10.4/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M=
github.com/AdguardTeam/urlfilter v0.15.1/go.mod h1:EwXwrYhowP7bedqmOrmKKmQtpBYFyDNEBFQ+lxdUgQU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
| </s> remove github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY=
</s> add </s> remove github.com/AdguardTeam/urlfilter v0.15.1
</s> add github.com/AdguardTeam/urlfilter v0.15.2 </s> remove golang.org/x/net v0.0.0-20210908191846-a5e095526f91/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
</s> add | github.com/AdguardTeam/urlfilter v0.15.2 h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ=
github.com/AdguardTeam/urlfilter v0.15.2/go.mod h1:46YZDOV1+qtdRDuhZKVPSSp7JWWes0KayqHrKAFBdEI= | github.com/AdguardTeam/golibs v0.10.3/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
github.com/AdguardTeam/golibs v0.10.4 h1:TMBkablZC0IZOpRgg9fzAKlxxNhSN2YJq7qbgtuZ7PQ=
github.com/AdguardTeam/golibs v0.10.4/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
github.com/AdguardTeam/urlfilter v0.15.2 h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ=
github.com/AdguardTeam/urlfilter v0.15.2/go.mod h1:46YZDOV1+qtdRDuhZKVPSSp7JWWes0KayqHrKAFBdEI=
github.com/AdguardTeam/urlfilter v0.15.2 h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ=
github.com/AdguardTeam/urlfilter v0.15.2/go.mod h1:46YZDOV1+qtdRDuhZKVPSSp7JWWes0KayqHrKAFBdEI=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4133 empty rewrite
Merge in DNS/adguard-home from 4133-empty-rewrite to master
Closes #4133.
Squashed commit of the following:
commit 4d2313c211c3955922d340c006b323c65e5e5ba4
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 18 21:36:21 2022 +0300
all: log changes
commit 5b8e392a2225c215fc117223d3f6553f8bdf21cd
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 18 21:32:57 2022 +0300
all: upd urlfilter | https://github.com/AdguardTeam/AdGuardHome/commit/1a3bf5ebda7310146486aeff23b5e3307860c6bc | go.sum |
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210908191846-a5e095526f91/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
| </s> remove github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M=
github.com/AdguardTeam/urlfilter v0.15.1/go.mod h1:EwXwrYhowP7bedqmOrmKKmQtpBYFyDNEBFQ+lxdUgQU=
</s> add github.com/AdguardTeam/urlfilter v0.15.2 h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ=
github.com/AdguardTeam/urlfilter v0.15.2/go.mod h1:46YZDOV1+qtdRDuhZKVPSSp7JWWes0KayqHrKAFBdEI= </s> remove github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY=
</s> add </s> remove github.com/AdguardTeam/urlfilter v0.15.1
</s> add github.com/AdguardTeam/urlfilter v0.15.2 | golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4133 empty rewrite
Merge in DNS/adguard-home from 4133-empty-rewrite to master
Closes #4133.
Squashed commit of the following:
commit 4d2313c211c3955922d340c006b323c65e5e5ba4
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 18 21:36:21 2022 +0300
all: log changes
commit 5b8e392a2225c215fc117223d3f6553f8bdf21cd
Author: Eugene Burkov <[email protected]>
Date: Tue Jan 18 21:32:57 2022 +0300
all: upd urlfilter | https://github.com/AdguardTeam/AdGuardHome/commit/1a3bf5ebda7310146486aeff23b5e3307860c6bc | go.sum |
|
return <div key={response} className={className}>{`${response}\n`}</div>;
})}</div>;
};
const FILTERED_STATUS_TO_FIELDS_MAP = {
[FILTERED_STATUS.NOT_FILTERED_NOT_FOUND]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
response_table_header: renderResponses(response),
},
[FILTERED_STATUS.FILTERED_BLOCKED_SERVICE]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
filter,
rule_label: rule,
response_code: status,
original_response: renderResponses(originalResponse),
},
[FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
filter,
rule_label: rule,
response_code: status,
},
[FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: {
encryption_status: boldStatusLabel,
filter,
rule_label: rule,
response_code: status,
},
[FILTERED_STATUS.FILTERED_SAFE_SEARCH]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
response_table_header: renderResponses(response),
},
[FILTERED_STATUS.FILTERED_BLACK_LIST]: {
encryption_status: boldStatusLabel,
filter,
rule_label: rule,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
original_response: renderResponses(originalResponse),
},
};
const content = FILTERED_STATUS_TO_FIELDS_MAP[reason]
? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason])
: Object.entries(FILTERED_STATUS_TO_FIELDS_MAP.NotFilteredNotFound);
| </s> remove const content = FILTERED_STATUS_TO_FIELDS_MAP[reason]
? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason])
: Object.entries(FILTERED_STATUS_TO_FIELDS_MAP.NotFilteredNotFound);
</s> add const getTooltipContent = (reason) => {
switch (reason) {
case FILTERED_STATUS.FILTERED_BLOCKED_SERVICE:
case FILTERED_STATUS.NOT_FILTERED_WHITE_LIST:
case FILTERED_STATUS.FILTERED_BLACK_LIST: {
return Object.entries(COMMON_CONTENT);
}
default: {
return Object.entries({ ...COMMON_CONTENT, filter: '' });
}
}
}; | const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse), | return <div key={response} className={className}>{`${response}\n`}</div>;
})}</div>;
};
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse),
};
const content = FILTERED_STATUS_TO_FIELDS_MAP[reason]
? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason])
: Object.entries(FILTERED_STATUS_TO_FIELDS_MAP.NotFilteredNotFound); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | - client: show all available information in the response tooltip | https://github.com/AdguardTeam/AdGuardHome/commit/1ab650bb86f4b3103b8c650c6af862c6f1881694 | client/src/components/Logs/Cells/getResponseCell.js |
original_response: renderResponses(originalResponse),
},
};
const content = FILTERED_STATUS_TO_FIELDS_MAP[reason]
? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason])
: Object.entries(FILTERED_STATUS_TO_FIELDS_MAP.NotFilteredNotFound);
const detailedInfo = isBlocked ? filter : formattedElapsedMs;
return (
<div className="logs__row">
| </s> remove const FILTERED_STATUS_TO_FIELDS_MAP = {
[FILTERED_STATUS.NOT_FILTERED_NOT_FOUND]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
response_table_header: renderResponses(response),
},
[FILTERED_STATUS.FILTERED_BLOCKED_SERVICE]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
filter,
rule_label: rule,
response_code: status,
original_response: renderResponses(originalResponse),
},
[FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
filter,
rule_label: rule,
response_code: status,
},
[FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: {
encryption_status: boldStatusLabel,
filter,
rule_label: rule,
response_code: status,
},
[FILTERED_STATUS.FILTERED_SAFE_SEARCH]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
response_table_header: renderResponses(response),
},
[FILTERED_STATUS.FILTERED_BLACK_LIST]: {
encryption_status: boldStatusLabel,
filter,
rule_label: rule,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
original_response: renderResponses(originalResponse),
},
</s> add const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse), | const getTooltipContent = (reason) => {
switch (reason) {
case FILTERED_STATUS.FILTERED_BLOCKED_SERVICE:
case FILTERED_STATUS.NOT_FILTERED_WHITE_LIST:
case FILTERED_STATUS.FILTERED_BLACK_LIST: {
return Object.entries(COMMON_CONTENT);
}
default: {
return Object.entries({ ...COMMON_CONTENT, filter: '' });
}
}
}; | original_response: renderResponses(originalResponse),
},
};
const getTooltipContent = (reason) => {
switch (reason) {
case FILTERED_STATUS.FILTERED_BLOCKED_SERVICE:
case FILTERED_STATUS.NOT_FILTERED_WHITE_LIST:
case FILTERED_STATUS.FILTERED_BLACK_LIST: {
return Object.entries(COMMON_CONTENT);
}
default: {
return Object.entries({ ...COMMON_CONTENT, filter: '' });
}
}
};
const getTooltipContent = (reason) => {
switch (reason) {
case FILTERED_STATUS.FILTERED_BLOCKED_SERVICE:
case FILTERED_STATUS.NOT_FILTERED_WHITE_LIST:
case FILTERED_STATUS.FILTERED_BLACK_LIST: {
return Object.entries(COMMON_CONTENT);
}
default: {
return Object.entries({ ...COMMON_CONTENT, filter: '' });
}
}
};
const getTooltipContent = (reason) => {
switch (reason) {
case FILTERED_STATUS.FILTERED_BLOCKED_SERVICE:
case FILTERED_STATUS.NOT_FILTERED_WHITE_LIST:
case FILTERED_STATUS.FILTERED_BLACK_LIST: {
return Object.entries(COMMON_CONTENT);
}
default: {
return Object.entries({ ...COMMON_CONTENT, filter: '' });
}
}
};
const detailedInfo = isBlocked ? filter : formattedElapsedMs;
return (
<div className="logs__row"> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | - client: show all available information in the response tooltip | https://github.com/AdguardTeam/AdGuardHome/commit/1ab650bb86f4b3103b8c650c6af862c6f1881694 | client/src/components/Logs/Cells/getResponseCell.js |
}
};
const detailedInfo = isBlocked ? filter : formattedElapsedMs;
return (
<div className="logs__row">
{getIconTooltip({
| </s> remove const FILTERED_STATUS_TO_FIELDS_MAP = {
[FILTERED_STATUS.NOT_FILTERED_NOT_FOUND]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
response_table_header: renderResponses(response),
},
[FILTERED_STATUS.FILTERED_BLOCKED_SERVICE]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
filter,
rule_label: rule,
response_code: status,
original_response: renderResponses(originalResponse),
},
[FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
filter,
rule_label: rule,
response_code: status,
},
[FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: {
encryption_status: boldStatusLabel,
filter,
rule_label: rule,
response_code: status,
},
[FILTERED_STATUS.FILTERED_SAFE_SEARCH]: {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
response_table_header: renderResponses(response),
},
[FILTERED_STATUS.FILTERED_BLACK_LIST]: {
encryption_status: boldStatusLabel,
filter,
rule_label: rule,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
original_response: renderResponses(originalResponse),
},
</s> add const COMMON_CONTENT = {
encryption_status: boldStatusLabel,
install_settings_dns: upstream,
elapsed: formattedElapsedMs,
response_code: status,
filter,
rule_label: rule,
response_table_header: renderResponses(response),
original_response: renderResponses(originalResponse), </s> remove const content = FILTERED_STATUS_TO_FIELDS_MAP[reason]
? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason])
: Object.entries(FILTERED_STATUS_TO_FIELDS_MAP.NotFilteredNotFound);
</s> add const getTooltipContent = (reason) => {
switch (reason) {
case FILTERED_STATUS.FILTERED_BLOCKED_SERVICE:
case FILTERED_STATUS.NOT_FILTERED_WHITE_LIST:
case FILTERED_STATUS.FILTERED_BLACK_LIST: {
return Object.entries(COMMON_CONTENT);
}
default: {
return Object.entries({ ...COMMON_CONTENT, filter: '' });
}
}
}; | const content = getTooltipContent(reason); | }
};
const content = getTooltipContent(reason);
const detailedInfo = isBlocked ? filter : formattedElapsedMs;
return (
<div className="logs__row">
{getIconTooltip({ | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | - client: show all available information in the response tooltip | https://github.com/AdguardTeam/AdGuardHome/commit/1ab650bb86f4b3103b8c650c6af862c6f1881694 | client/src/components/Logs/Cells/getResponseCell.js |
"example_regex_meaning": "block access to domains matching the specified regular expression.",
"example_upstream_regular": "regular DNS (over UDP);",
"example_upstream_udp": "regular DNS (over UDP, hostname);",
"example_upstream_dot": "encrypted <0>DNS-over-TLS</0>;",
"example_upstream_doh": "encrypted <0>DNS-over-HTTPS</0>;",
"example_upstream_doq": "encrypted <0>DNS-over-QUIC</0>;",
| </s> remove 'default': 784
</s> add 'default': 853 </s> remove * `quic://unfiltered.adguard-dns.com:784`: encrypted DNS-over-QUIC
(experimental).
</s> add * `quic://unfiltered.adguard-dns.com`: encrypted DNS-over-QUIC. </s> remove <code>sdns://...</code>:
<span>
<Trans
components={[
<a
href="https://dnscrypt.info/stamps/"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS Stamps
</a>,
<a
href="https://dnscrypt.info/"
target="_blank"
rel="noopener noreferrer"
key="1"
>
DNSCrypt
</a>,
<a
href="https://en.wikipedia.org/wiki/DNS_over_HTTPS"
target="_blank"
rel="noopener noreferrer"
key="2"
>
DNS-over-HTTPS
</a>,
]}
>
example_upstream_sdns
</Trans>
</span>
</s> add <code>sdns://...</code>: <Trans
components={[
<a
href="https://dnscrypt.info/stamps/"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS Stamps
</a>,
<a
href="https://dnscrypt.info/"
target="_blank"
rel="noopener noreferrer"
key="1"
>
DNSCrypt
</a>,
<a
href="https://en.wikipedia.org/wiki/DNS_over_HTTPS"
target="_blank"
rel="noopener noreferrer"
key="2"
>
DNS-over-HTTPS
</a>,
]}
>
example_upstream_sdns
</Trans> | "example_upstream_regular_port": "regular DNS (over UDP, with port);", | "example_regex_meaning": "block access to domains matching the specified regular expression.",
"example_upstream_regular": "regular DNS (over UDP);",
"example_upstream_regular_port": "regular DNS (over UDP, with port);",
"example_upstream_udp": "regular DNS (over UDP, hostname);",
"example_upstream_dot": "encrypted <0>DNS-over-TLS</0>;",
"example_upstream_doh": "encrypted <0>DNS-over-HTTPS</0>;",
"example_upstream_doq": "encrypted <0>DNS-over-QUIC</0>;", | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request #1572: 4640-imp-upstream-doc
Updates #4640.
Squashed commit of the following:
commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2
Merge: 7bace870 6856a803
Author: Ainar Garipov <[email protected]>
Date: Fri Aug 19 17:17:44 2022 +0300
Merge branch 'master' into 4640-imp-upstream-doc
commit 7bace870102633a2b8323c5f448ed38b65f4b482
Author: Ainar Garipov <[email protected]>
Date: Thu Aug 18 19:49:07 2022 +0300
all: imp upstream examples | https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d | client/src/__locales/en.json |
"example_upstream_sdns": "<0>DNS Stamps</0> for <1>DNSCrypt</1> or <2>DNS-over-HTTPS</2> resolvers;",
"example_upstream_tcp": "regular DNS (over TCP);",
"example_upstream_tcp_hostname": "regular DNS (over TCP, hostname);",
"all_lists_up_to_date_toast": "All lists are already up-to-date",
"updated_upstream_dns_toast": "Upstream servers successfully saved",
"dns_test_ok_toast": "Specified DNS servers are working correctly",
"dns_test_not_ok_toast": "Server \"{{key}}\": could not be used, please check that you've written it correctly",
| </s> remove * `quic://unfiltered.adguard-dns.com:784`: encrypted DNS-over-QUIC
(experimental).
</s> add * `quic://unfiltered.adguard-dns.com`: encrypted DNS-over-QUIC. </s> remove 'default': 784
</s> add 'default': 853 </s> remove <code>sdns://...</code>:
<span>
<Trans
components={[
<a
href="https://dnscrypt.info/stamps/"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS Stamps
</a>,
<a
href="https://dnscrypt.info/"
target="_blank"
rel="noopener noreferrer"
key="1"
>
DNSCrypt
</a>,
<a
href="https://en.wikipedia.org/wiki/DNS_over_HTTPS"
target="_blank"
rel="noopener noreferrer"
key="2"
>
DNS-over-HTTPS
</a>,
]}
>
example_upstream_sdns
</Trans>
</span>
</s> add <code>sdns://...</code>: <Trans
components={[
<a
href="https://dnscrypt.info/stamps/"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS Stamps
</a>,
<a
href="https://dnscrypt.info/"
target="_blank"
rel="noopener noreferrer"
key="1"
>
DNSCrypt
</a>,
<a
href="https://en.wikipedia.org/wiki/DNS_over_HTTPS"
target="_blank"
rel="noopener noreferrer"
key="2"
>
DNS-over-HTTPS
</a>,
]}
>
example_upstream_sdns
</Trans> </s> remove 'default': 784
</s> add 'default': 853 | "example_upstream_tcp_port": "regular DNS (over TCP, with port);", | "example_upstream_sdns": "<0>DNS Stamps</0> for <1>DNSCrypt</1> or <2>DNS-over-HTTPS</2> resolvers;",
"example_upstream_tcp": "regular DNS (over TCP);",
"example_upstream_tcp_port": "regular DNS (over TCP, with port);",
"example_upstream_tcp_hostname": "regular DNS (over TCP, hostname);",
"all_lists_up_to_date_toast": "All lists are already up-to-date",
"updated_upstream_dns_toast": "Upstream servers successfully saved",
"dns_test_ok_toast": "Specified DNS servers are working correctly",
"dns_test_not_ok_toast": "Server \"{{key}}\": could not be used, please check that you've written it correctly", | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request #1572: 4640-imp-upstream-doc
Updates #4640.
Squashed commit of the following:
commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2
Merge: 7bace870 6856a803
Author: Ainar Garipov <[email protected]>
Date: Fri Aug 19 17:17:44 2022 +0300
Merge branch 'master' into 4640-imp-upstream-doc
commit 7bace870102633a2b8323c5f448ed38b65f4b482
Author: Ainar Garipov <[email protected]>
Date: Thu Aug 18 19:49:07 2022 +0300
all: imp upstream examples | https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d | client/src/__locales/en.json |
<div className="list leading-loose">
<Trans>examples_title</Trans>:
<ol className="leading-loose">
<li>
<code>94.140.14.140</code>: {props.t('example_upstream_regular')}
</li>
<li>
<code>udp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_udp</Trans>
</li>
<li>
| </s> remove <code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans>
</s> add <code>tcp://94.140.14.140</code>, <code>tcp://[2a10:50c0::1:ff]</code>: <Trans>example_upstream_tcp</Trans>
</li>
<li>
<code>tcp://94.140.14.140:53</code>, <code>tcp://[2a10:50c0::1:ff]:53</code>: <Trans>example_upstream_tcp_port</Trans> </s> remove <code>tls://unfiltered.adguard-dns.com</code>:
<span>
<Trans
components={[
<a
href="https://en.wikipedia.org/wiki/DNS_over_TLS"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-TLS
</a>,
]}
>
example_upstream_dot
</Trans>
</span>
</s> add <code>tls://unfiltered.adguard-dns.com</code>: <Trans
components={[
<a
href="https://en.wikipedia.org/wiki/DNS_over_TLS"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-TLS
</a>,
]}
>
example_upstream_dot
</Trans> </s> remove <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>:
<span>
<Trans>example_upstream_comment</Trans>
</span>
</s> add <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <Trans>
example_upstream_comment
</Trans> </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>:
<span>
<Trans
components={[
<a
href="https://en.wikipedia.org/wiki/DNS_over_HTTPS"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-HTTPS
</a>,
]}
>
example_upstream_doh
</Trans>
</span>
</s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans
components={[
<a
href="https://en.wikipedia.org/wiki/DNS_over_HTTPS"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-HTTPS
</a>,
]}
>
example_upstream_doh
</Trans> </s> remove <code>quic://unfiltered.adguard-dns.com:784</code>:
<span>
<Trans
components={[
<a
href="https://datatracker.ietf.org/doc/html/rfc9250"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-QUIC
</a>,
]}
>
example_upstream_doq
</Trans>
</span>
</s> add <code>quic://unfiltered.adguard-dns.com</code>: <Trans
components={[
<a
href="https://datatracker.ietf.org/doc/html/rfc9250"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-QUIC
</a>,
]}
>
example_upstream_doq
</Trans> | <code>94.140.14.140</code>, <code>2a10:50c0::1:ff</code>: {props.t('example_upstream_regular')}
</li>
<li>
<code>94.140.14.140:53</code>, <code>[2a10:50c0::1:ff]:53</code>: {props.t('example_upstream_regular_port')} | <div className="list leading-loose">
<Trans>examples_title</Trans>:
<ol className="leading-loose">
<li>
<code>94.140.14.140</code>, <code>2a10:50c0::1:ff</code>: {props.t('example_upstream_regular')}
</li>
<li>
<code>94.140.14.140:53</code>, <code>[2a10:50c0::1:ff]:53</code>: {props.t('example_upstream_regular_port')}
</li>
<li>
<code>udp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_udp</Trans>
</li>
<li> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request #1572: 4640-imp-upstream-doc
Updates #4640.
Squashed commit of the following:
commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2
Merge: 7bace870 6856a803
Author: Ainar Garipov <[email protected]>
Date: Fri Aug 19 17:17:44 2022 +0300
Merge branch 'master' into 4640-imp-upstream-doc
commit 7bace870102633a2b8323c5f448ed38b65f4b482
Author: Ainar Garipov <[email protected]>
Date: Thu Aug 18 19:49:07 2022 +0300
all: imp upstream examples | https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d | client/src/components/Settings/Dns/Upstream/Examples.js |
<li>
<code>udp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_udp</Trans>
</li>
<li>
<code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans>
</li>
<li>
<code>tcp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_tcp_hostname</Trans>
</li>
<li>
| </s> remove <code>94.140.14.140</code>: {props.t('example_upstream_regular')}
</s> add <code>94.140.14.140</code>, <code>2a10:50c0::1:ff</code>: {props.t('example_upstream_regular')}
</li>
<li>
<code>94.140.14.140:53</code>, <code>[2a10:50c0::1:ff]:53</code>: {props.t('example_upstream_regular_port')} </s> remove <code>tls://unfiltered.adguard-dns.com</code>:
<span>
<Trans
components={[
<a
href="https://en.wikipedia.org/wiki/DNS_over_TLS"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-TLS
</a>,
]}
>
example_upstream_dot
</Trans>
</span>
</s> add <code>tls://unfiltered.adguard-dns.com</code>: <Trans
components={[
<a
href="https://en.wikipedia.org/wiki/DNS_over_TLS"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-TLS
</a>,
]}
>
example_upstream_dot
</Trans> </s> remove <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>:
<span>
<Trans>example_upstream_comment</Trans>
</span>
</s> add <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <Trans>
example_upstream_comment
</Trans> </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>:
<span>
<Trans
components={[
<a
href="https://en.wikipedia.org/wiki/DNS_over_HTTPS"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-HTTPS
</a>,
]}
>
example_upstream_doh
</Trans>
</span>
</s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans
components={[
<a
href="https://en.wikipedia.org/wiki/DNS_over_HTTPS"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-HTTPS
</a>,
]}
>
example_upstream_doh
</Trans> </s> remove <code>quic://unfiltered.adguard-dns.com:784</code>:
<span>
<Trans
components={[
<a
href="https://datatracker.ietf.org/doc/html/rfc9250"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-QUIC
</a>,
]}
>
example_upstream_doq
</Trans>
</span>
</s> add <code>quic://unfiltered.adguard-dns.com</code>: <Trans
components={[
<a
href="https://datatracker.ietf.org/doc/html/rfc9250"
target="_blank"
rel="noopener noreferrer"
key="0"
>
DNS-over-QUIC
</a>,
]}
>
example_upstream_doq
</Trans> | <code>tcp://94.140.14.140</code>, <code>tcp://[2a10:50c0::1:ff]</code>: <Trans>example_upstream_tcp</Trans>
</li>
<li>
<code>tcp://94.140.14.140:53</code>, <code>tcp://[2a10:50c0::1:ff]:53</code>: <Trans>example_upstream_tcp_port</Trans> | <li>
<code>udp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_udp</Trans>
</li>
<li>
<code>tcp://94.140.14.140</code>, <code>tcp://[2a10:50c0::1:ff]</code>: <Trans>example_upstream_tcp</Trans>
</li>
<li>
<code>tcp://94.140.14.140:53</code>, <code>tcp://[2a10:50c0::1:ff]:53</code>: <Trans>example_upstream_tcp_port</Trans>
</li>
<li>
<code>tcp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_tcp_hostname</Trans>
</li>
<li> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request #1572: 4640-imp-upstream-doc
Updates #4640.
Squashed commit of the following:
commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2
Merge: 7bace870 6856a803
Author: Ainar Garipov <[email protected]>
Date: Fri Aug 19 17:17:44 2022 +0300
Merge branch 'master' into 4640-imp-upstream-doc
commit 7bace870102633a2b8323c5f448ed38b65f4b482
Author: Ainar Garipov <[email protected]>
Date: Thu Aug 18 19:49:07 2022 +0300
all: imp upstream examples | https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d | client/src/components/Settings/Dns/Upstream/Examples.js |
Subsets and Splits