docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
Filters []plugFilter
<mask> ParentalBlockHost string <mask> QueryLogEnabled bool <mask> BlockedTTL uint32 // in seconds, default 3600 <mask> } <mask> <mask> type plug struct { <mask> d *dnsfilter.Dnsfilter <mask> Next plugin.Handler </s> Fix #371 #421 Filters are now saved to a file Also, the...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
Filters: make([]plugFilter, 0),
<mask> ParentalBlockHost: "family.block.dns.adguard.com", <mask> BlockedTTL: 3600, // in seconds <mask> } <mask> <mask> // <mask> // coredns handling functions <mask> // <mask> func setupPlugin(c *caddy.Controller) (*plug, error) { </s> Fix #371 #421 Filters are now saved to a file Also, the...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
log.Println("Initializing the CoreDNS plugin")
<mask> settings: defaultPluginSettings, <mask> d: dnsfilter.New(), <mask> } <mask> <mask> filterFileNames := []string{} <mask> for c.Next() { <mask> args := c.RemainingArgs() <mask> if len(args) > 0 { <mask> filterFileNames = append(filterFileNames, args...) <mask> } </s> Fix #371 #42...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
<mask> } <mask> <mask> filterFileNames := []string{} <mask> for c.Next() { <mask> args := c.RemainingArgs() <mask> if len(args) > 0 { <mask> filterFileNames = append(filterFileNames, args...) <mask> } <mask> for c.NextBlock() { <mask> switch c.Val() { <mask> case "safebrowsing": <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
blockValue := c.Val() switch blockValue {
<mask> if len(args) > 0 { <mask> filterFileNames = append(filterFileNames, args...) <mask> } <mask> for c.NextBlock() { <mask> switch c.Val() { <mask> case "safebrowsing": <mask> p.d.EnableSafeBrowsing() <mask> if c.NextArg() { <mask> if len(c.Val()) == 0 { <mask> return nil,...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
for _, filter := range p.settings.Filters { log.Printf("Loading rules from %s", filter.Path)
<mask> } <mask> } <mask> } <mask> <mask> log.Printf("filterFileNames = %+v", filterFileNames) <mask> <mask> for i, filterFileName := range filterFileNames { <mask> file, err := os.Open(filterFileName) <mask> if err != nil { <mask> return nil, err </s> Fix #371 #421 Filters are now saved to ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
file, err := os.Open(filter.Path)
<mask> } <mask> <mask> log.Printf("filterFileNames = %+v", filterFileNames) <mask> <mask> for i, filterFileName := range filterFileNames { <mask> file, err := os.Open(filterFileName) <mask> if err != nil { <mask> return nil, err <mask> } <mask> defer file.Close() <mask> </s> Fix #371 #421 ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
//noinspection GoDeferInLoop
<mask> if err != nil { <mask> return nil, err <mask> } <mask> defer file.Close() <mask> <mask> count := 0 <mask> scanner := bufio.NewScanner(file) </s> Fix #371 #421 Filters are now saved to a file Also, they're loaded from the file on startup Filter ID is not passed to the CoreDNS plugin config ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
err = p.d.AddRule(text, filter.ID)
<mask> scanner := bufio.NewScanner(file) <mask> for scanner.Scan() { <mask> text := scanner.Text() <mask> <mask> err = p.d.AddRule(text, uint32(i)) <mask> if err == dnsfilter.ErrAlreadyExists || err == dnsfilter.ErrInvalidSyntax { <mask> continue <mask> } <mask> if err != nil { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
log.Printf("Added %d rules from %d", count, filter.ID)
<mask> continue <mask> } <mask> count++ <mask> } <mask> log.Printf("Added %d rules from %s", count, filterFileName) <mask> <mask> if err = scanner.Err(); err != nil { <mask> return nil, err <mask> } <mask> } </s> Fix #371 #421 Filters are now saved to a file Also, they're loaded from ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
//noinspection GoUnusedParameter
<mask> } <mask> <mask> type statsFunc func(ch interface{}, name string, text string, value float64, valueType prometheus.ValueType) <mask> <mask> func doDesc(ch interface{}, name string, text string, value float64, valueType prometheus.ValueType) { <mask> realch, ok := ch.(chan<- *prometheus.Desc) <mask> if ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
return dns.RcodeFormatError, dnsfilter.Result{}, fmt.Errorf("got a DNS request with more than one Question")
<mask> <mask> func (p *plug) serveDNSInternal(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, dnsfilter.Result, error) { <mask> if len(r.Question) != 1 { <mask> // google DNS, bind and others do the same <mask> return dns.RcodeFormatError, dnsfilter.Result{}, fmt.Errorf("Got DNS request with != ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin.go
// TODO: Change tests -- there's new config template now
<mask> ) <mask> <mask> func TestSetup(t *testing.T) { <mask> for i, testcase := range []struct { <mask> config string <mask> failing bool <mask> }{ <mask> {`dnsfilter`, false}, </s> Fix #371 #421 Filters are now saved to a file Also, they're loaded from the file on startup Filter ID is not passed to...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
coredns_plugin/coredns_plugin_test.go
"io/ioutil"
<mask> "bufio" <mask> "errors" <mask> "fmt" <mask> "io" <mask> "net/http" <mask> "os" <mask> "path" <mask> "path/filepath" <mask> "runtime" </s> Fix #371 #421 Filters are now saved to a file Also, they're loaded from the file on startup Filter ID is not passed to the CoreDNS plugin config (server-si...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
helpers.go
"path/filepath"
<mask> "io/ioutil" <mask> "net/http" <mask> "os" <mask> "path" <mask> "runtime" <mask> "strings" <mask> ) <mask> </s> Fix #371 #421 Filters are now saved to a file Also, they're loaded from the file on startup Filter ID is not passed to the CoreDNS plugin config (server-side AG DNS must be changed acco...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
helpers.go
// ---------------------------------- // helper functions for working with files // ---------------------------------- // Writes data first to a temporary file and then renames it to what's specified in path func writeFileSafe(path string, data []byte) error { dir := filepath.Dir(path) err := os.MkdirAll(dir, 0755)...
<mask> "runtime" <mask> "strings" <mask> ) <mask> <mask> func clamp(value, low, high int) int { <mask> if value < low { <mask> return low <mask> } <mask> if value > high { <mask> return high <mask> } <mask> return value </s> Fix #371 #421 Filters are now saved to a file Also, they're loaded fr...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
helpers.go
err = os.Rename(tmpPath, path) if err != nil { return err
<mask> func clamp(value, low, high int) int { <mask> if value < low { <mask> return low <mask> } <mask> if value > high { <mask> return high <mask> } <mask> return value <mask> } <mask> <mask> // ---------------------------------- </s> Fix #371 #421 Filters are now saved to a file Also, they're l...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
helpers.go
return nil
<mask> } <mask> if value > high { <mask> return high <mask> } <mask> return value <mask> } <mask> <mask> // ---------------------------------- <mask> // helper functions for HTTP handlers <mask> // ---------------------------------- </s> Fix #371 #421 Filters are now saved to a file Also, they're loa...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
helpers.go
<mask> <mask> // --------------------- <mask> // debug logging helpers <mask> // --------------------- <mask> func _Func() string { <mask> pc := make([]uintptr, 10) // at least 1 entry needed <mask> runtime.Callers(2, pc) <mask> f := runtime.FuncForPC(pc[0]) <mask> return path.Base(f.Name()) <mask> } <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/32d4e80c93cba5b3ef4bb96c79f7256b5cb4d913
helpers.go
clientID, err = clientIDFromDNSContextHTTPS(pctx) if err != nil { return "", fmt.Errorf("checking url: %w", err) } else if clientID != "" { return clientID, nil } // Go on and check the domain name as well.
<mask> // is not one of these, clientID is an empty string and err is nil. <mask> func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { <mask> proto := pctx.Proto <mask> if proto == proxy.ProtoHTTPS { <mask> return clientIDFromDNSContextHTTPS(pctx) <mask> } else if pr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
cliSrvName, err := clientServerName(pctx, proto) if err != nil { return "", err } clientID, err = clientIDFromClientServerName( hostSrvName, cliSrvName, s.conf.StrictSNICheck, ) if err != nil { return "", fmt.Errorf("clientid check: %w", err) } return clientID, nil } // clientServerName returns the...
<mask> if hostSrvName == "" { <mask> return "", nil <mask> } <mask> <mask> cliSrvName := "" <mask> switch proto { <mask> case proxy.ProtoTLS: <mask> conn := pctx.Conn <mask> tc, ok := conn.(tlsConn) <mask> if !ok { </s> Pull request: 3418-clientid-doh Closes #3418. Squashed commit of the foll...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
case proxy.ProtoHTTPS: if connState := pctx.HTTPRequest.TLS; connState != nil { srvName = pctx.HTTPRequest.TLS.ServerName
<mask> } <mask> <mask> cliSrvName := "" <mask> switch proto { <mask> case proxy.ProtoTLS: <mask> conn := pctx.Conn <mask> tc, ok := conn.(tlsConn) <mask> if !ok { <mask> return "", fmt.Errorf( <mask> "proxy ctx conn of proto %s is %T, want *tls.Conn", <mask> proto, <mask> conn, <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
<mask> proto, <mask> conn, <mask> ) <mask> } <mask> <mask> cliSrvName = tc.ConnectionState().ServerName <mask> case proxy.ProtoQUIC: <mask> conn, ok := pctx.QUICConnection.(quicConnection) <mask> if !ok { <mask> return "", fmt.Errorf( <mask> "proxy ctx quic conn of proto %s is %T,...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
qConn := pctx.QUICConnection conn, ok := qConn.(quicConnection)
<mask> } <mask> <mask> cliSrvName = tc.ConnectionState().ServerName <mask> case proxy.ProtoQUIC: <mask> conn, ok := pctx.QUICConnection.(quicConnection) <mask> if !ok { <mask> return "", fmt.Errorf( <mask> "proxy ctx quic conn of proto %s is %T, want quic.Connection", <mask> proto, <mask>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
qConn,
<mask> if !ok { <mask> return "", fmt.Errorf( <mask> "proxy ctx quic conn of proto %s is %T, want quic.Connection", <mask> proto, <mask> pctx.QUICConnection, <mask> ) <mask> } <mask> <mask> cliSrvName = conn.ConnectionState().TLS.ServerName <mask> } </s> Pull request: 3418-clientid-...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
srvName = conn.ConnectionState().TLS.ServerName case proxy.ProtoTLS: conn := pctx.Conn tc, ok := conn.(tlsConn) if !ok { return "", fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn) }
<mask> pctx.QUICConnection, <mask> ) <mask> } <mask> <mask> cliSrvName = conn.ConnectionState().TLS.ServerName <mask> } <mask> <mask> clientID, err = clientIDFromClientServerName( <mask> hostSrvName, <mask> cliSrvName, <mask> s.conf.StrictSNICheck, </s> Pull request: 3418-clientid-doh ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
srvName = tc.ConnectionState().ServerName
<mask> <mask> cliSrvName = conn.ConnectionState().TLS.ServerName <mask> } <mask> <mask> clientID, err = clientIDFromClientServerName( <mask> hostSrvName, <mask> cliSrvName, <mask> s.conf.StrictSNICheck, <mask> ) <mask> if err != nil { <mask> return "", fmt.Errorf("clientid check: %w", err) <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
return srvName, nil
<mask> if err != nil { <mask> return "", fmt.Errorf("clientid check: %w", err) <mask> } <mask> <mask> return clientID, nil <mask> } </s> Pull request: 3418-clientid-doh Closes #3418. Squashed commit of the following: commit 8a1180f8ef03d30ea3ae6a3e3121ddcac513f45b Author: Ainar Garipov <A.Garipov@AdGuar...
[ "keep", "keep", "keep", "keep", "replace", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid.go
var ( conn net.Conn qconn quic.Connection httpReq *http.Request ) switch tc.proto { case proxy.ProtoHTTPS: u := &url.URL{ Path: "/dns-query", } connState := &tls.ConnectionState{ ServerName: tc.cliSrvName,
<mask> srv := &Server{ <mask> conf: ServerConfig{TLSConfig: tlsConf}, <mask> } <mask> <mask> var conn net.Conn <mask> if tc.proto == proxy.ProtoTLS { <mask> conn = testTLSConn{ <mask> serverName: tc.cliSrvName, <mask> } <mask> } <mask> <mask> var qconn quic.Connection <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
<mask> if tc.proto == proxy.ProtoTLS { <mask> conn = testTLSConn{ <mask> serverName: tc.cliSrvName, <mask> } <mask> } <mask> <mask> var qconn quic.Connection <mask> if tc.proto == proxy.ProtoQUIC { <mask> qconn = testQUICConnection{ <mask> serverName: tc.cliSrvName, </s> Pu...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
httpReq = &http.Request{ URL: u, TLS: connState, } case proxy.ProtoQUIC:
<mask> serverName: tc.cliSrvName, <mask> } <mask> } <mask> <mask> var qconn quic.Connection <mask> if tc.proto == proxy.ProtoQUIC { <mask> qconn = testQUICConnection{ <mask> serverName: tc.cliSrvName, <mask> } <mask> } <mask> </s> Pull request: 3418-clientid-doh Closes #...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
case proxy.ProtoTLS: conn = testTLSConn{ serverName: tc.cliSrvName, }
<mask> case proxy.ProtoQUIC: <mask> qconn = testQUICConnection{ <mask> serverName: tc.cliSrvName, <mask> } <mask> } <mask> <mask> pctx := &proxy.DNSContext{ <mask> Proto: tc.proto, <mask> Conn: conn, <mask> HTTPRequest: httpReq, </s> Pull request: 3418...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
HTTPRequest: httpReq,
<mask> pctx := &proxy.DNSContext{ <mask> Proto: tc.proto, <mask> Conn: conn, <mask> QUICConnection: qconn, <mask> } <mask> <mask> clientID, err := srv.clientIDFromDNSContext(pctx) <mask> assert.Equal(t, tc.wantClientID, clientID) <mask> </s> Pull request: 3418-clie...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName string
<mask> name string <mask> path string <mask> wantClientID string <mask> wantErrMsg string <mask> }{{ <mask> name: "no_clientid", </s> Pull request: 3418-clientid-doh Closes #3418. Squashed commit of the following: commit 8a1180f8ef03d30ea3ae6a3e3121ddcac513f45b Author: Ain...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName: "example.com",
<mask> name: "no_clientid", <mask> path: "/dns-query", <mask> wantClientID: "", <mask> wantErrMsg: "", <mask> }, { <mask> name: "no_clientid_slash", <mask> path: "/dns-query/", <mask> cliSrvName: "example.com", </s> Pull request: 3418-clientid-doh Closes #341...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName: "example.com",
<mask> wantErrMsg: "", <mask> }, { <mask> name: "no_clientid_slash", <mask> path: "/dns-query/", <mask> wantClientID: "", <mask> wantErrMsg: "", <mask> }, { <mask> name: "clientid", <mask> path: "/dns-query/cli", </s> Pull request: 3418-clientid-doh Closes ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName: "example.com",
<mask> name: "clientid", <mask> path: "/dns-query/cli", <mask> wantClientID: "cli", <mask> wantErrMsg: "", <mask> }, { <mask> name: "clientid_slash", </s> Pull request: 3418-clientid-doh Closes #3418. Squashed commit of the following: commit 8a1180f8ef03d30ea3ae6a3e3121ddc...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName: "example.com",
<mask> wantErrMsg: "", <mask> }, { <mask> name: "clientid_slash", <mask> path: "/dns-query/cli/", <mask> wantClientID: "cli", <mask> wantErrMsg: "", <mask> }, { <mask> name: "clientid_case", <mask> path: "/dns-query/InSeNsItIvE", <mask> cliSrvName: "exam...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName: "example.com",
<mask> name: "clientid_case", <mask> path: "/dns-query/InSeNsItIvE", <mask> wantClientID: "insensitive", <mask> wantErrMsg: ``, <mask> }, { <mask> name: "bad_url", <mask> path: "/foo", <mask> cliSrvName: "example.com", </s> Pull request: 3418-clientid-doh Clo...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName: "example.com",
<mask> wantErrMsg: ``, <mask> }, { <mask> name: "bad_url", <mask> path: "/foo", <mask> wantClientID: "", <mask> wantErrMsg: `clientid check: invalid path "/foo"`, <mask> }, { <mask> name: "extra", </s> Pull request: 3418-clientid-doh Closes #3418. Squashed commit of ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName: "example.com",
<mask> name: "extra", <mask> path: "/dns-query/cli/foo", <mask> wantClientID: "", <mask> wantErrMsg: `clientid check: invalid path "/dns-query/cli/foo": extra parts`, <mask> }, { <mask> name: "invalid_clientid", <mask> path: "/dns-query/!!!", </s> Pull request: 341...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
cliSrvName: "example.com",
<mask> name: "invalid_clientid", <mask> path: "/dns-query/!!!", <mask> wantClientID: "", <mask> wantErrMsg: `clientid check: invalid clientid "!!!": bad domain name label rune '!'`, <mask> }, { <mask> name: "both_ids", <mask> path: "/dns-query/right", </s> Pull req...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
}, { name: "both_ids", path: "/dns-query/right", cliSrvName: "wrong.example.com", wantClientID: "right", wantErrMsg: "",
<mask> cliSrvName: "example.com", <mask> wantClientID: "", <mask> wantErrMsg: `clientid check: invalid clientid "!!!": bad domain name label rune '!'`, <mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { <mask> connState := &tls.ConnectionState{ <...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
connState := &tls.ConnectionState{ ServerName: tc.cliSrvName, }
<mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { <mask> r := &http.Request{ <mask> URL: &url.URL{ <mask> Path: tc.path, <mask> }, </s> Pull request: 3418-clientid-doh Closes #3418. Squashed commit of the following: commit 8a1180f8ef03d30e...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
TLS: connState,
<mask> URL: &url.URL{ <mask> Path: tc.path, <mask> }, <mask> } <mask> <mask> pctx := &proxy.DNSContext{ <mask> Proto: proxy.ProtoHTTPS, <mask> HTTPRequest: r, </s> Pull request: 3418-clientid-doh Closes #3418. Squashed commit of the following: commit 8a1180f8ef03d30ea3ae6a3...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/330ac303242970d79b557e611bec3227b0af5a7b
internal/dnsforward/clientid_test.go
--green79: #67b279;
<mask> :root { <mask> --yellow-pale: rgba(247, 181, 0, 0.1); <mask> --green79: #67B279; <mask> --gray-a5: #a5a5a5; <mask> --gray-d8: #d8d8d8; <mask> --gray-f3: #F3F3F3; <mask> --font-family-monospace: Monaco, Menlo, "Ubuntu Mono", Consolas, source-code-pro, monospace; <mask> } </s> Fix ...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/App/index.css
--gray-f3: #f3f3f3;
<mask> --yellow-pale: rgba(247, 181, 0, 0.1); <mask> --green79: #67B279; <mask> --gray-a5: #a5a5a5; <mask> --gray-d8: #d8d8d8; <mask> --gray-f3: #F3F3F3; <mask> --font-family-monospace: Monaco, Menlo, "Ubuntu Mono", Consolas, source-code-pro, monospace; <mask> } <mask> <mask> body { <...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/App/index.css
.dashboard-title__button {
<mask> display: flex; <mask> align-items: center; <mask> } <mask> <mask> .dashboard-title__button{ <mask> margin: 0 0.5rem; <mask> } <mask> <mask> @media (max-width: 767.98px) { <mask> .page-title--dashboard { </s> Fix a couple of stylelint violations </s> remove .dashboard-title__butto...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Dashboard/Dashboard.css
.dashboard-title__button {
<mask> flex-direction: column; <mask> align-items: flex-start; <mask> } <mask> <mask> .dashboard-title__button{ <mask> margin: 0.5rem 0; <mask> display: block; <mask> } <mask> } </s> Fix a couple of stylelint violations </s> remove .dashboard-title__button{ </s> a...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Dashboard/Dashboard.css
content: ":";
<mask> } <mask> } <mask> <mask> .grid .key-colon:nth-child(odd)::after { <mask> content: ':'; <mask> } <mask> <mask> .grid__one-row { <mask> grid-template-columns: 15rem; <mask> } </s> Fix a couple of stylelint violations </s> remove content: ''; </s> add content: ""; </s> remove ....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Logs/Cells/IconTooltip.css
content: "";
<mask> padding-top: 2rem; <mask> } <mask> <mask> .title--border:before { <mask> content: ''; <mask> position: absolute; <mask> left: 0; <mask> border-top: 0.5px solid var(--gray-d8) !important; <mask> width: 100%; <mask> margin-top: -1rem; </s> Fix a couple of stylelint violation...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Logs/Cells/IconTooltip.css
--gray-4d: #4d4d4d; --gray-f3: #f3f3f3;
<mask> --size-domain: 180; <mask> --size-response: 150; <mask> --size-client: 123; <mask> --gray-216: rgba(216, 216, 216, 0.23); <mask> --gray-4d: #4D4D4D; <mask> --gray-f3: #F3F3F3; <mask> --gray-8: #888; <mask> --gray-3: #333; <mask> --danger: #DF3812; <mask> --white8...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Logs/Logs.css
--danger: #df3812;
<mask> --gray-4d: #4D4D4D; <mask> --gray-f3: #F3F3F3; <mask> --gray-8: #888; <mask> --gray-3: #333; <mask> --danger: #DF3812; <mask> --white80: rgba(255, 255, 255, 0.8); <mask> <mask> --btn-block: #C23814; <mask> --btn-block-disabled: #E3B3A6; <mask> --btn-block-active: #A...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Logs/Logs.css
--btn-block: #c23814; --btn-block-disabled: #e3b3a6; --btn-block-active: #a62200;
<mask> --gray-8: #888; <mask> --gray-3: #333; <mask> --danger: #DF3812; <mask> --white80: rgba(255, 255, 255, 0.8); <mask> <mask> --btn-block: #C23814; <mask> --btn-block-disabled: #E3B3A6; <mask> --btn-block-active: #A62200; <mask> <mask> --btn-unblock: #888888; <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Logs/Logs.css
--btn-unblock-disabled: #d8d8d8; --btn-unblock-active: #4d4d4d;
<mask> --btn-block-disabled: #E3B3A6; <mask> --btn-block-active: #A62200; <mask> <mask> --btn-unblock: #888888; <mask> --btn-unblock-disabled: #D8D8D8; <mask> --btn-unblock-active: #4D4D4D; <mask> <mask> --option-border-radius: 4px; <mask> } <mask> <mask> .logs__text { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Logs/Logs.css
background: var(--white) url("../ui/svg/chevron-down.svg") no-repeat;
<mask> cursor: pointer; <mask> } <mask> <mask> .custom-select__arrow--left { <mask> background: var(--white) url('../ui/svg/chevron-down.svg') no-repeat; <mask> background-position: 5px 9px; <mask> background-size: 22px; <mask> } <mask> <mask> .custom-select--logs { </s> Fix a couple of sty...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/334b3fc636025657ac6af2df0b90ec01332c8187
client/src/components/Logs/Logs.css
REWRITE_RULE: 'RewriteRule',
<mask> REWRITE: 'Rewrite', <mask> REWRITE_HOSTS: 'RewriteEtcHosts', <mask> FILTERED_SAFE_SEARCH: 'FilteredSafeSearch', <mask> FILTERED_SAFE_BROWSING: 'FilteredSafeBrowsing', <mask> FILTERED_PARENTAL: 'FilteredParental', <mask> }; <mask> </s> Pull request: all: improve dnsrewrite handling M...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
client/src/helpers/constants.js
[FILTERED_STATUS.REWRITE_RULE]: { LABEL: RESPONSE_FILTER.REWRITTEN.LABEL, COLOR: QUERY_STATUS_COLORS.BLUE, },
<mask> LABEL: RESPONSE_FILTER.REWRITTEN.LABEL, <mask> COLOR: QUERY_STATUS_COLORS.BLUE, <mask> }, <mask> [FILTERED_STATUS.FILTERED_SAFE_BROWSING]: { <mask> LABEL: RESPONSE_FILTER.BLOCKED_THREATS.LABEL, <mask> COLOR: QUERY_STATUS_COLORS.YELLOW, <mask> }, <mask> [FIL...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
client/src/helpers/constants.js
// Rewritten is returned when there was a rewrite by a legacy DNS // rewrite rule. Rewritten // RewrittenAutoHosts is returned when there was a rewrite by autohosts // rules (/etc/hosts and so on). RewrittenAutoHosts // RewrittenRule is returned when a $dnsrewrite filter rule was applied. // // TODO(a.garipo...
<mask> FilteredSafeSearch <mask> // FilteredBlockedService - the host is blocked by "blocked services" settings <mask> FilteredBlockedService <mask> <mask> // ReasonRewrite is returned when there was a rewrite by <mask> // a legacy DNS Rewrite rule. <mask> ReasonRewrite <mask> <mask> // RewriteAutoHos...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
Rewritten: "Rewrite", RewrittenAutoHosts: "RewriteEtcHosts", RewrittenRule: "RewriteRule",
<mask> FilteredInvalid: "FilteredInvalid", <mask> FilteredSafeSearch: "FilteredSafeSearch", <mask> FilteredBlockedService: "FilteredBlockedService", <mask> <mask> ReasonRewrite: "Rewrite", <mask> <mask> RewriteAutoHosts: "RewriteEtcHosts", <mask> <mask> DNSRewriteRule: "DNSRewriteRule", <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
// empty unless Reason is set to RewrittenAutoHosts.
<mask> // is not nil. <mask> Rules []*ResultRule `json:",omitempty"` <mask> <mask> // ReverseHosts is the reverse lookup rewrite result. It is <mask> // empty unless Reason is set to RewriteAutoHosts. <mask> ReverseHosts []string `json:",omitempty"` <mask> <mask> // IPList is the lookup rewrite result....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
// Reason is set to RewrittenAutoHosts or Rewritten.
<mask> // empty unless Reason is set to RewriteAutoHosts. <mask> ReverseHosts []string `json:",omitempty"` <mask> <mask> // IPList is the lookup rewrite result. It is empty unless <mask> // Reason is set to RewriteAutoHosts or ReasonRewrite. <mask> IPList []net.IP `json:",omitempty"` <mask> <mask> // C...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
// It is empty unless Reason is set to Rewritten or RewrittenRule.
<mask> // Reason is set to RewriteAutoHosts or ReasonRewrite. <mask> IPList []net.IP `json:",omitempty"` <mask> <mask> // CanonName is the CNAME value from the lookup rewrite result. <mask> // It is empty unless Reason is set to ReasonRewrite. <mask> CanonName string `json:",omitempty"` <mask> <mask> //...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
if result.Reason == Rewritten {
<mask> var err error <mask> <mask> // first - check rewrites, they have the highest priority <mask> result = d.processRewrites(host, qtype) <mask> if result.Reason == ReasonRewrite { <mask> return result, nil <mask> } <mask> <mask> // Now check the hosts file -- do we have any rules for it? <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
result.Reason = RewrittenAutoHosts
<mask> <mask> func (d *DNSFilter) checkAutoHosts(host string, qtype uint16, result *Result) (matched bool) { <mask> ips := d.Config.AutoHosts.Process(host, qtype) <mask> if ips != nil { <mask> result.Reason = RewriteAutoHosts <mask> result.IPList = ips <mask> <mask> return true <mask> } <mask> </...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
result.Reason = RewrittenAutoHosts
<mask> } <mask> <mask> revHosts := d.Config.AutoHosts.ProcessReverse(host, qtype) <mask> if len(revHosts) != 0 { <mask> result.Reason = RewriteAutoHosts <mask> <mask> // TODO(a.garipov): Optimize this with a buffer. <mask> result.ReverseHosts = make([]string, len(revHosts)) <mask> for i := range r...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
res.Reason = Rewritten
<mask> defer d.confLock.RUnlock() <mask> <mask> rr := findRewrites(d.Rewrites, host) <mask> if len(rr) != 0 { <mask> res.Reason = ReasonRewrite <mask> } <mask> <mask> cnames := map[string]bool{} <mask> origHost := host <mask> for len(rr) != 0 && rr[0].Type == dns.TypeCNAME { </s> Pull request: all...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
if res.Reason == RewrittenRule && res.CanonName == host {
<mask> // Check DNS rewrites first, because the API there is a bit <mask> // awkward. <mask> if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 { <mask> res = d.processDNSRewrites(dnsr) <mask> if res.Reason == DNSRewriteRule && res.CanonName == host { <mask> // A rewrite of a host to itself. Go on and <ma...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsfilter.go
Reason: RewrittenRule,
<mask> Text: nr.RuleText, <mask> }} <mask> <mask> return Result{ <mask> Reason: DNSRewriteRule, <mask> Rules: rules, <mask> CanonName: dr.NewCNAME, <mask> } <mask> } <mask> </s> Pull request: all: improve dnsrewrite handling Merge in DNS/adguard-home from 2491-dns...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsrewrite.go
Reason: RewrittenRule,
<mask> RCode: dr.RCode, <mask> } <mask> <mask> return Result{ <mask> Reason: DNSRewriteRule, <mask> Rules: rules, <mask> DNSRewriteResult: dnsrr, <mask> } <mask> } <mask> } </s> Pull request: all: improve dnsrewrite handling Merge in DNS/adguard-home from 24...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsrewrite.go
Reason: RewrittenRule,
<mask> } <mask> } <mask> <mask> return Result{ <mask> Reason: DNSRewriteRule, <mask> Rules: rules, <mask> DNSRewriteResult: dnsrr, <mask> } <mask> } </s> Pull request: all: improve dnsrewrite handling Merge in DNS/adguard-home from 2491-dnsrewrite-log to master Closes #2491....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/dnsrewrite.go
assert.Equal(t, Rewritten, r.Reason)
<mask> r := d.processRewrites("host2.com", dns.TypeA) <mask> assert.Equal(t, NotFilteredNotFound, r.Reason) <mask> <mask> r = d.processRewrites("www.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "host.com", r.CanonName) <mask> assert.Equal(t, 2, len(r.IPList)...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> assert.True(t, r.IPList[1].Equal(net.ParseIP("1.2.3.5"))) <mask> <mask> r = d.processRewrites("www.host.com", dns.TypeAAAA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "host.com", r.CanonName) <mask> assert....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> {"*.host.com", "1.2.3.5", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> <mask> r = d.processRewrites("www.host.com", dns.Type...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> <mask> r = d.processRewrites("www.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.5"))) <mask> <mask> r...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> {"*.host.com", "1.2.3.5", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("a.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.True(t, len(r.IPList) == 1) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> {"*.host.com", "host.com", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("www.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "host.com", r.CanonName) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> {"host.com", "1.2.3.4", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("b.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "host.com", r.CanonName) <mask> assert.True(t, len(r.IPList) == 1) <mask> assert.True(t, r.IPList[0].E...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> {"*.somehost.com", "1.2.3.4", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("b.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "x.somehost.com", r.CanonName) <mask> assert.True(t, len(r.IPList) == 1) <mask> assert.True(t, r...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> d.prepareRewrites() <mask> <mask> // match exact <mask> r := d.processRewrites("host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, 1, len(r.IPList)) <mask> assert.Equal(t, "1.1.1.1", r.IPList[0].String()) <mask> <mask> // match L2 <mask> r = d.process...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> assert.Equal(t, "1.1.1.1", r.IPList[0].String()) <mask> <mask> // match L2 <mask> r = d.processRewrites("sub.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, 1, len(r.IPList)) <mask> assert.Equal(t, "2.2.2.2", r.IPList[0].String()) <mask> <mask> // ma...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> assert.Equal(t, "2.2.2.2", r.IPList[0].String()) <mask> <mask> // match L3 <mask> r = d.processRewrites("my.sub.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, 1, len(r.IPList)) <mask> assert.Equal(t, "3.3.3.3", r.IPList[0].String()) <mask> } <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> d.prepareRewrites() <mask> <mask> // match sub-domain <mask> r := d.processRewrites("my.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, 1, len(r.IPList)) <mask> assert.Equal(t, "2.2.2.2", r.IPList[0].String()) <mask> <mask> // match sub-domain, but h...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> d.prepareRewrites() <mask> <mask> // match sub-domain <mask> r := d.processRewrites("my.host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, 1, len(r.IPList)) <mask> assert.Equal(t, "2.2.2.2", r.IPList[0].String()) <mask> <mask> // match sub-domain, but h...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> d.prepareRewrites() <mask> <mask> // match domain <mask> r := d.processRewrites("host.com", dns.TypeA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, 1, len(r.IPList)) <mask> assert.Equal(t, "1.2.3.4", r.IPList[0].String()) <mask> <mask> // match exception <mask> r = d...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> assert.Equal(t, NotFilteredNotFound, r.Reason) <mask> <mask> // match domain <mask> r = d.processRewrites("host2.com", dns.TypeAAAA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, 1, len(r.IPList)) <mask> assert.Equal(t, "::1", r.IPList[0].String()) <mask> <mask> // matc...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
assert.Equal(t, Rewritten, r.Reason)
<mask> assert.Equal(t, NotFilteredNotFound, r.Reason) <mask> <mask> // match domain <mask> r = d.processRewrites("host3.com", dns.TypeAAAA) <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, 0, len(r.IPList)) <mask> } </s> Pull request: all: improve dnsrewrite handling Merge in DNS/ad...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsfilter/rewrites_test.go
case dnsfilter.Rewritten, dnsfilter.RewrittenRule:
<mask> res := ctx.result <mask> var err error <mask> <mask> switch res.Reason { <mask> case dnsfilter.ReasonRewrite, <mask> dnsfilter.DNSRewriteRule: <mask> <mask> if len(ctx.origQuestion.Name) == 0 { <mask> // origQuestion is set in case we get only CNAME without IP from rewrites table <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsforward/dns.go
} else if res.Reason.In(dnsfilter.Rewritten, dnsfilter.RewrittenRule) &&
<mask> return nil, fmt.Errorf("dnsfilter failed to check host %q: %w", host, err) <mask> } else if res.IsFiltered { <mask> log.Tracef("Host %s is filtered, reason - %q, matched rule: %q", host, res.Reason, res.Rules[0].Text) <mask> d.Res = s.genDNSFilterMessage(d, &res) <mask> } else if res.Reason.In(dnsfi...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsforward/filter.go
} else if res.Reason == dnsfilter.RewrittenAutoHosts && len(res.ReverseHosts) != 0 {
<mask> // name. The original question is readded in <mask> // processFilteringAfterResponse. <mask> ctx.origQuestion = d.Req.Question[0] <mask> d.Req.Question[0].Name = dns.Fqdn(res.CanonName) <mask> } else if res.Reason == dnsfilter.RewriteAutoHosts && len(res.ReverseHosts) != 0 { <mask> resp := s.ma...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsforward/filter.go
} else if res.Reason == dnsfilter.Rewritten || res.Reason == dnsfilter.RewrittenAutoHosts {
<mask> resp.Answer = append(resp.Answer, ptr) <mask> } <mask> <mask> d.Res = resp <mask> } else if res.Reason == dnsfilter.ReasonRewrite || res.Reason == dnsfilter.RewriteAutoHosts { <mask> resp := s.makeResponse(req) <mask> <mask> name := host <mask> if len(res.CanonName) != 0 { <mask> res...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsforward/filter.go
} else if res.Reason == dnsfilter.RewrittenRule {
<mask> } <mask> } <mask> <mask> d.Res = resp <mask> } else if res.Reason == dnsfilter.DNSRewriteRule { <mask> err = s.filterDNSRewrite(req, res, d) <mask> if err != nil { <mask> return nil, err <mask> } <mask> } </s> Pull request: all: improve dnsrewrite handling Merge in DNS/adguard-home...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/dnsforward/filter.go
// for Rewritten:
<mask> <mask> // for FilteredBlockedService: <mask> SvcName string `json:"service_name"` <mask> <mask> // for ReasonRewrite: <mask> CanonName string `json:"cname"` // CNAME value <mask> IPList []net.IP `json:"ip_addrs"` // list of IP addresses <mask> } <mask> <mask> func (f *Filtering) handleC...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/home/controlfiltering.go
Reason: dnsfilter.Rewritten,
<mask> answer.A = net.ParseIP(answerStr) <mask> a.Answer = append(a.Answer, answer) <mask> res := dnsfilter.Result{ <mask> IsFiltered: true, <mask> Reason: dnsfilter.ReasonRewrite, <mask> ServiceName: "SomeService", <mask> Rules: []*dnsfilter.ResultRule{{ <mask> FilterListID: 1, <mask> T...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/querylog/qlog_test.go
dnsfilter.Rewritten, dnsfilter.RewrittenAutoHosts, dnsfilter.RewrittenRule,
<mask> case filteringStatusFiltered: <mask> return res.IsFiltered || <mask> res.Reason.In( <mask> dnsfilter.NotFilteredAllowList, <mask> dnsfilter.ReasonRewrite, <mask> dnsfilter.RewriteAutoHosts, <mask> ) <mask> <mask> case filteringStatusBlocked: <mask> return res.IsFiltered && <ma...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/querylog/searchcriteria.go
return res.Reason.In( dnsfilter.Rewritten, dnsfilter.RewrittenAutoHosts, dnsfilter.RewrittenRule, )
<mask> case filteringStatusWhitelisted: <mask> return res.Reason == dnsfilter.NotFilteredAllowList <mask> <mask> case filteringStatusRewritten: <mask> return res.Reason.In(dnsfilter.ReasonRewrite, dnsfilter.RewriteAutoHosts) <mask> <mask> case filteringStatusSafeSearch: <mask> return res.IsFiltered &...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
internal/querylog/searchcriteria.go
- 'RewriteRule'
<mask> - 'FilteredSafeSearch' <mask> - 'FilteredBlockedService' <mask> - 'Rewrite' <mask> - 'RewriteEtcHosts' <mask> - 'DNSRewriteRule' <mask> 'filter_id': <mask> 'deprecated': true <mask> 'description': > <mask> In case ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
openapi/openapi.yaml
- 'RewriteRule'
<mask> - 'FilteredSafeSearch' <mask> - 'FilteredBlockedService' <mask> - 'Rewrite' <mask> - 'RewriteEtcHosts' <mask> - 'DNSRewriteRule' <mask> 'service_name': <mask> 'type': 'string' <mask> 'description': 'Set if reason=FilteredBlocke...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/338209f32bdb876da19e52c366e440ea3c457470
openapi/openapi.yaml
func startDNSServer() error {
<mask> } <mask> } <mask> return false <mask> } <mask> func handleStart(w http.ResponseWriter, r *http.Request) { <mask> if isRunning() { <mask> http.Error(w, fmt.Sprintf("Unable to start coreDNS: Already running"), 400) <mask> return <mask> } <mask> err := writeCoreDNSConfig() </s> Move starting o...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f
control.go
return fmt.Errorf("Unable to start coreDNS: Already running")
<mask> return false <mask> } <mask> func handleStart(w http.ResponseWriter, r *http.Request) { <mask> if isRunning() { <mask> http.Error(w, fmt.Sprintf("Unable to start coreDNS: Already running"), 400) <mask> return <mask> } <mask> err := writeCoreDNSConfig() <mask> if err != nil { <mask> errortext...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f
control.go