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