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 |
|---|---|---|---|---|
errortext := fmt.Sprintf("Couldn't read response body: %s", err) | <mask> summed["stats_period"] = "24 hours"
<mask>
<mask> json, err := json.Marshal(summed)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to marshal status json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> w.Header().... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
http.Error(w, errortext, http.StatusBadGateway) | <mask> json, err := json.Marshal(summed)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to marshal status json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> w.Header().Set("Content-Type", "application/json")
<mask> _, er... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
// forward body entirely with status code | <mask> return
<mask> }
<mask> w.Header().Set("Content-Type", "application/json")
<mask> w.Header().Set("Content-Length", strconv.Itoa(len(body)))
<mask> w.WriteHeader(resp.StatusCode)
<mask> _, err = w.Write(body)
</s> Implement online stats calculation in coredns plugin instead of scraping prometheus. </... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
w.Header().Set("Content-Length", strconv.Itoa(len(body)))
w.WriteHeader(resp.StatusCode)
_, err = w.Write(body) | <mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> w.Header().Set("Content-Type", "application/json")
<mask> _, err = w.Write(json)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to write response json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, e... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
errortext := fmt.Sprintf("Couldn't write body: %s", err) | <mask> }
<mask> w.Header().Set("Content-Type", "application/json")
<mask> _, err = w.Write(json)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to write response json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> }
</s... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
http.Error(w, errortext, http.StatusInternalServerError) | <mask> _, err = w.Write(json)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to write response json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> }
<mask>
<mask> func handleStatsHistory(w http.ResponseWriter, r *http.Req... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
resp, err := client.Get("http://127.0.0.1:8618/stats_history?" + r.URL.RawQuery) | <mask> }
<mask> }
<mask>
<mask> func handleStatsHistory(w http.ResponseWriter, r *http.Request) {
<mask> // handle time unit and prepare our time window size
<mask> now := time.Now()
<mask> timeUnitString := r.URL.Query().Get("time_unit")
<mask> var stats *periodicStats
<mask> var timeUnit time.Duration... | [
"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",
"re... | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
errortext := fmt.Sprintf("Couldn't get stats_top from coredns: %T %s\n", err, err) | <mask> return
<mask> }
<mask> endTime, err := time.Parse(time.RFC3339, r.URL.Query().Get("end_time"))
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Must specify valid end_time parameter: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 400)
<mask> return
<mask> }
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
http.Error(w, errortext, http.StatusBadGateway) | <mask> endTime, err := time.Parse(time.RFC3339, r.URL.Query().Get("end_time"))
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Must specify valid end_time parameter: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 400)
<mask> return
<mask> }
<mask>
<mask> // check i... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
if resp != nil && resp.Body != nil {
defer resp.Body.Close() | <mask> if endTime.Add(timeRange).Before(now) {
<mask> http.Error(w, "end_time parameter is outside of supported range", 501)
<mask> return
<mask> }
<mask>
<mask> // calculate start and end of our array
<mask> // basically it's how many hours/minutes/etc have passed since now
<mask> start := int(now.Su... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
// read the body entirely
body, err := ioutil.ReadAll(resp.Body) | <mask> if start > end {
<mask> start, end = end, start
<mask> }
<mask>
<mask> data := generateMapFromStats(stats, start, end)
<mask> json, err := json.Marshal(data)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to marshal status json: %s", err)
<mask> log.Println(errortext)
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
errortext := fmt.Sprintf("Couldn't read response body: %s", err) | <mask>
<mask> data := generateMapFromStats(stats, start, end)
<mask> json, err := json.Marshal(data)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to marshal status json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> w... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
http.Error(w, errortext, http.StatusBadGateway) | <mask> json, err := json.Marshal(data)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to marshal status json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> w.Header().Set("Content-Type", "application/json")
<mask> _, err ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
// forward body entirely with status code | <mask> http.Error(w, errortext, http.StatusBadGateway)
<mask> return
<mask> }
<mask> w.Header().Set("Content-Type", "application/json")
<mask> w.Header().Set("Content-Length", strconv.Itoa(len(body)))
<mask> w.WriteHeader(resp.StatusCode)
<mask> _, err = w.Write(body)
<mask> if err != nil {
<mask> ... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
w.Header().Set("Content-Length", strconv.Itoa(len(body)))
w.WriteHeader(resp.StatusCode)
_, err = w.Write(body) | <mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> w.Header().Set("Content-Type", "application/json")
<mask> _, err = w.Write(json)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to write response json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, e... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
errortext := fmt.Sprintf("Couldn't write body: %s", err) | <mask> }
<mask> w.Header().Set("Content-Type", "application/json")
<mask> _, err = w.Write(json)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to write response json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> }
</s... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
http.Error(w, errortext, http.StatusInternalServerError) | <mask> _, err = w.Write(json)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to write response json: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 500)
<mask> return
<mask> }
<mask> }
<mask>
<mask> func handleQueryLog(w http.ResponseWriter, r *http.Request... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | control.go |
<mask> ParentalBlockHost: "family.block.dns.adguard.com",
<mask> BlockedTTL: 3600, // in seconds
<mask> }
<mask>
<mask> func newDNSCounter(name string, help string) prometheus.Counter {
<mask> return prometheus.NewCounter(prometheus.CounterOpts{
<mask> Namespace: plugin.Namespace,
<mask> ... | [
"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",
"ke... | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/coredns_plugin.go | |
log.Printf("Loading stats from querylog")
err := fillStatsFromQueryLog() | <mask> return nil, err
<mask> }
<mask> }
<mask>
<mask> log.Printf("Loading top from querylog")
<mask> err := loadTopFromFiles()
<mask> if err != nil {
<mask> log.Printf("Failed to load top from querylog: %s", err)
<mask> return nil, err
<mask> }
<mask>
</s> Implement online stats calculation... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/coredns_plugin.go |
log.Printf("Failed to load stats from querylog: %s", err) | <mask>
<mask> log.Printf("Loading top from querylog")
<mask> err := loadTopFromFiles()
<mask> if err != nil {
<mask> log.Printf("Failed to load top from querylog: %s", err)
<mask> return nil, err
<mask> }
<mask>
<mask> if p.settings.QueryLogEnabled {
<mask> onceQueryLog.Do(func() {
</s> Implemen... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/coredns_plugin.go |
x.MustRegister(elapsedTime) | <mask> x.MustRegister(whitelisted)
<mask> x.MustRegister(safesearch)
<mask> x.MustRegister(errorsTotal)
<mask> x.MustRegister(p)
<mask> }
<mask> return nil
<mask> })
<mask> c.OnShutdown(p.onShutdown)
</s> Implement online stats calculation in coredns plugin instead of scraping prometheus. </s... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/coredns_plugin.go |
elapsed := time.Since(start)
elapsedTime.Observe(elapsed.Seconds()) | <mask>
<mask> // log
<mask> if p.settings.QueryLogEnabled {
<mask> logRequest(r, rrw.Msg, result, time.Since(start), ip)
<mask> }
<mask> return rcode, err
<mask> }
</s> Implement online stats calculation in coredns plugin instead of scraping prometheus. </s> remove log.Printf("Failed to load top from q... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/coredns_plugin.go |
err = runningTop.addEntry(&entry, question, now) | <mask> }
<mask> logBufferLock.Unlock()
<mask>
<mask> // add it to running top
<mask> err = runningTop.addEntry(&entry, now)
<mask> if err != nil {
<mask> log.Printf("Failed to add entry to running top: %s", err)
<mask> // don't do failure, just log
<mask> }
<mask>
</s> Implement online stats calc... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog.go |
<mask> // write to file
<mask> // do it in separate goroutine -- we are stalling DNS response this whole time
<mask> go flushToFile(flushBuffer)
<mask> }
<mask> return
<mask> }
<mask>
<mask> func handleQueryLog(w http.ResponseWriter, r *http.Request) {
<mask> now := time.Now()
<mask>
</s> Implemen... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog.go | |
values = logBuffer | <mask>
<mask> if needRefresh {
<mask> // need to get fresh data
<mask> logBufferLock.RLock()
<mask> values := logBuffer
<mask> logBufferLock.RUnlock()
<mask>
<mask> if len(values) < queryLogCacheSize {
<mask> values = appendFromLogFile(values, queryLogCacheSize, queryLogTimeLimit)
<mask> }
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog.go |
go statsRotator() | <mask> listenAddr := net.JoinHostPort("127.0.0.1", queryLogAPIPort)
<mask>
<mask> go periodicQueryLogRotate()
<mask> go periodicHourlyTopRotate()
<mask>
<mask> http.HandleFunc("/querylog", handleQueryLog)
<mask> http.HandleFunc("/stats", handleStats)
<mask> http.HandleFunc("/stats_top", handleStatsTop)
... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog.go |
http.HandleFunc("/stats", handleStats) | <mask> go periodicHourlyTopRotate()
<mask> go statsRotator()
<mask>
<mask> http.HandleFunc("/querylog", handleQueryLog)
<mask> http.HandleFunc("/stats_top", handleStatsTop)
<mask> http.HandleFunc("/stats_history", handleStatsHistory)
<mask> if err := http.ListenAndServe(listenAddr, nil); err != nil {
<ma... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog.go |
http.HandleFunc("/stats_history", handleStatsHistory) | <mask> http.HandleFunc("/querylog", handleQueryLog)
<mask> http.HandleFunc("/stats", handleStats)
<mask> http.HandleFunc("/stats_top", handleStatsTop)
<mask> if err := http.ListenAndServe(listenAddr, nil); err != nil {
<mask> log.Fatalf("error in ListenAndServe: %s", err)
<mask> }
<mask> }
<mask>
<mask... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog.go |
elapsed := time.Since(now)
log.Printf("file \"%s\": read %d entries in %v, %v/entry", file, i, elapsed, elapsed/time.Duration(i)) | <mask> if err != nil {
<mask> return err
<mask> }
<mask> }
<mask> log.Printf("file \"%s\": read %d entries", file, i)
<mask> }
<mask> return nil
<mask> }
<mask>
<mask> func appendFromLogFile(values []logEntry, maxLen int, timeWindow time.Duration) []logEntry {
</s> Implement online stats cal... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog_file.go |
"github.com/AdguardTeam/AdguardDNS/dnsfilter" | <mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/bluele/gcache"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
</s> Implement online stats calculation in coredns plugin instead of scraping prometheus. </s> remove func newDNSCounter(name string, help string) prometheus.Counter {
return prometheus.NewC... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog_top.go |
func (r *dayTop) addEntry(entry *logEntry, q *dns.Msg, now time.Time) error { | <mask> func (top *hourTop) lockedGetClients(key string) (int, error) {
<mask> return top.lockedGetValue(key, top.clients)
<mask> }
<mask>
<mask> func (r *dayTop) addEntry(entry *logEntry, now time.Time) error {
<mask> if len(entry.Question) == 0 {
<mask> log.Printf("entry question is absent, skipping")
<ma... | [
"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/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog_top.go |
<mask> log.Printf("t %v is >24 hours ago, ignoring", entry.Time)
<mask> return nil
<mask> }
<mask>
<mask> q := new(dns.Msg)
<mask> if err := q.Unpack(entry.Question); err != nil {
<mask> log.Printf("failed to unpack dns message question: %s", err)
<mask> return err
<mask> }
<mask>
<mask> if le... | [
"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/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog_top.go | |
func fillStatsFromQueryLog() error { | <mask>
<mask> return nil
<mask> }
<mask>
<mask> func loadTopFromFiles() error {
<mask> now := time.Now()
<mask> runningTop.loadedWriteLock()
<mask> defer runningTop.loadedWriteUnlock()
<mask> if runningTop.loaded {
<mask> return nil
</s> Implement online stats calculation in coredns plugin instead o... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog_top.go |
if len(entry.Question) == 0 {
log.Printf("entry question is absent, skipping")
return nil
}
if entry.Time.After(now) {
log.Printf("t %v vs %v is in the future, ignoring", entry.Time, now)
return nil
}
q := new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Printf("failed to u... | <mask> if runningTop.loaded {
<mask> return nil
<mask> }
<mask> onEntry := func(entry *logEntry) error {
<mask> err := runningTop.addEntry(entry, now)
<mask> if err != nil {
<mask> log.Printf("Failed to add entry to running top: %s", err)
<mask> return err
<mask> }
<mask> return nil
</s> I... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37f6d38c498740c7c3db59c31da031cd5c305694 | coredns_plugin/querylog_top.go |
github.com/kr/pretty v0.1.0 // indirect | <mask> github.com/gobuffalo/packr v1.19.0
<mask> github.com/joomcode/errorx v1.0.0
<mask> github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 // indirect
<mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b
<mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414
<mask> ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.mod |
<mask> github.com/joomcode/errorx v1.0.0
<mask> github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 // indirect
<mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b
<mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414
<mask> github.com/likexian/whois-go v0.0.0-20190627... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.mod | |
<mask> github.com/AdguardTeam/dnsproxy v0.19.4 h1:rZb40VUr/yN8RG4j3+NuGqODmPvte7acPfSDl0j2wiU=
<mask> github.com/AdguardTeam/dnsproxy v0.19.4/go.mod h1:NaulY9i279jZwN8QBbvbZnn5HkrjBgJi4hbFY5nW+Kc=
<mask> github.com/AdguardTeam/dnsproxy v0.19.5 h1:QAKWa2+rTp7GAeOFLMPqIYPS7eglLVEkVLH4kHRbnCQ=
<mask> github.com/Adguar... | [
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum | |
<mask> github.com/AdguardTeam/golibs v0.1.3 h1:hmapdTtMtIk3T8eQDwTOLdqZLGDKNKk9325uC8z12xg=
<mask> github.com/AdguardTeam/golibs v0.1.3/go.mod h1:b0XkhgIcn2TxwX6C5AQMtpIFAgjPehNgxJErWkwA3ko=
<mask> github.com/AdguardTeam/golibs v0.2.1 h1:jGCnbM5UOUq/GrG+8eLN7Y+OTfEo5F/8L0wq3ur2h4E=
<mask> github.com/AdguardTeam/gol... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum | |
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= | <mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 h1:UUppSQnhf4Yc6xGxSkoQpPhb7RVzuv5Nb1mwJ5VId9s=
<mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
<mask> github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/g... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum |
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.... | <mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b h1:vfiqKno48aUndBMjTeWFpCExNnTf2Xnd6d228L4EfTQ=
<mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b/go.mod h1:10UU/bEkzh2iEN6aYzbevY7J6p03KO5siTxQWXMEerg=
<mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414 h1:6wn... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum |
<mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b h1:vfiqKno48aUndBMjTeWFpCExNnTf2Xnd6d228L4EfTQ=
<mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b/go.mod h1:10UU/bEkzh2iEN6aYzbevY7J6p03KO5siTxQWXMEerg=
<mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414 h1:6wn... | [
"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/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum | |
github.com/shirou/gopsutil v2.19.9+incompatible h1:IrPVlK4nfwW10DF7pW+7YJKws9NkgNzWozwwWv9FsgY= | <mask> github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
<mask> github.com/rogpeppe/go-charset v0.0.0-20190617161244-0dc95cdf6f31/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
<mask> github.com/shirou/gopsutil v2.18.12+incompatible h1:1e... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum |
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSb... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum | |
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= | <mask> golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
<mask> golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
<mask> golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejp... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum |
<mask> golang.org/x/sys v0.0.0-20190122071731-054c452bb702/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
<mask> golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
<mask> golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E4... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum | |
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= | <mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | go.sum |
const topClientsNumber = 30 // the number of clients to get
topClients := config.stats.GetTopClientsIP(topClientsNumber) | <mask>
<mask> config.dnsctx.rdns = InitRDNS(&config.clients)
<mask> config.dnsctx.whois = initWhois(&config.clients)
<mask>
<mask> topClients := config.stats.GetTopData(30)
<mask> for _, ip := range topClients {
<mask> ipAddr := net.ParseIP(ip)
<mask> if !ipAddr.IsLoopback() {
<mask> config.dnsctx... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/dns.go |
"github.com/stretchr/testify/assert" | <mask> import (
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> func TestGetValidNetInterfacesForWeb(t *testing.T) {
<mask> ifaces, err := getValidNetInterfacesForWeb()
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/helpers_test.go |
func TestSplitNext(t *testing.T) {
s := " a,b , c "
assert.True(t, SplitNext(&s, ',') == "a")
assert.True(t, SplitNext(&s, ',') == "b")
assert.True(t, SplitNext(&s, ',') == "c" && len(s) == 0)
} | <mask>
<mask> log.Printf("%v", iface)
<mask> }
<mask> }
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
* faster response parsing
* don't use likexian/whois-go package </s> remove info := whoisProcess(ip)
</s> add info := w.process(ip) </s> remove resp, err ... | [
"keep",
"keep",
"keep",
"add"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/helpers_test.go |
"fmt"
"io/ioutil"
"net" | <mask>
<mask> import (
<mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
* faster response parsing
* don't use likexian/whois-go package </s> remove whois "github.co... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
"time" | <mask> "io/ioutil"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> const (
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
* faster response parsing
* don't use likexian/whois-go package ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> whois "github.com/likexian/whois-go"
<mask> )
<mask>
<mask> const maxValueLength = 250
<mask>
<mask> // Whois - module context
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go | |
const (
defaultServer = "whois.arin.net"
defaultPort = "43"
maxValueLength = 250
) | <mask> "github.com/AdguardTeam/golibs/log"
<mask> whois "github.com/likexian/whois-go"
<mask> )
<mask>
<mask> const maxValueLength = 250
<mask>
<mask> // Whois - module context
<mask> type Whois struct {
<mask> clients *clientsContainer
<mask> ips map[string]bool
</s> * whois: use whois.arin.net
+... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
clients *clientsContainer
ips map[string]bool
lock sync.Mutex
ipChan chan string
timeoutMsec uint | <mask> const maxValueLength = 250
<mask>
<mask> // Whois - module context
<mask> type Whois struct {
<mask> clients *clientsContainer
<mask> ips map[string]bool
<mask> lock sync.Mutex
<mask> ipChan chan string
<mask> }
<mask>
<mask> // Create module context
<mask> func initWhois(clients *clien... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
w.timeoutMsec = 5000 | <mask> func initWhois(clients *clientsContainer) *Whois {
<mask> w := Whois{}
<mask> w.clients = clients
<mask> w.ips = make(map[string]bool)
<mask> w.ipChan = make(chan string, 255)
<mask> go w.workerLoop()
<mask> return &w
<mask> }
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decreas... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
for len(data) != 0 {
ln := SplitNext(&data, '\n')
if len(ln) == 0 || ln[0] == '#' || ln[0] == '%' { | <mask> func whoisParse(data string) map[string]string {
<mask> m := map[string]string{}
<mask> descr := ""
<mask> netname := ""
<mask> lines := strings.Split(data, "\n")
<mask> for _, ln := range lines {
<mask> ln = strings.TrimSpace(ln)
<mask>
<mask> if len(ln) == 0 || ln[0] == '#' {
<mask> cont... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
case "whois": // "whois: whois.arin.net"
m["whois"] = v
case "referralserver": // "ReferralServer: whois://whois.ripe.net"
if strings.HasPrefix(v, "whois://") {
m["whois"] = v[len("whois://"):]
} | <mask> case "descr":
<mask> descr = v
<mask> case "netname":
<mask> netname = v
<mask> }
<mask> }
<mask>
<mask> // descr or netname -> orgname
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
* faster response parsing
* don't use likexian/whois-go pa... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
func (w *Whois) process(ip string) [][]string { | <mask> return m
<mask> }
<mask>
<mask> // Request WHOIS information
<mask> func whoisProcess(ip string) [][]string {
<mask> data := [][]string{}
<mask> resp, err := whois.Whois(ip)
<mask> if err != nil {
<mask> log.Debug("Whois: error: %s IP:%s", err, ip)
<mask> return data
</s> * whois: use whois.... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
resp, err := w.queryAll(ip) | <mask>
<mask> // Request WHOIS information
<mask> func whoisProcess(ip string) [][]string {
<mask> data := [][]string{}
<mask> resp, err := whois.Whois(ip)
<mask> if err != nil {
<mask> log.Debug("Whois: error: %s IP:%s", err, ip)
<mask> return data
<mask> }
<mask>
</s> * whois: use whois.arin.net... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
info := w.process(ip) | <mask> for {
<mask> var ip string
<mask> ip = <-w.ipChan
<mask>
<mask> info := whoisProcess(ip)
<mask> if len(info) == 0 {
<mask> continue
<mask> }
<mask>
<mask> w.clients.SetWhoisInfo(ip, info)
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
*... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois.go |
<mask> package home
<mask>
<mask> import (
<mask> "strings"
<mask> "testing"
<mask>
<mask> whois "github.com/likexian/whois-go"
<mask> "github.com/stretchr/testify/assert"
<mask> )
</s> * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
* faster response parsing
* ... | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois_test.go | |
<mask> import (
<mask> "strings"
<mask> "testing"
<mask>
<mask> whois "github.com/likexian/whois-go"
<mask> "github.com/stretchr/testify/assert"
<mask> )
<mask>
<mask> func TestWhois(t *testing.T) {
<mask> resp, err := whois.Whois("8.8.8.8")
</s> * whois: use whois.arin.net
+ robust redirect mechanis... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois_test.go | |
w := Whois{timeoutMsec: 5000}
resp, err := w.queryAll("8.8.8.8") | <mask> "github.com/stretchr/testify/assert"
<mask> )
<mask>
<mask> func TestWhois(t *testing.T) {
<mask> resp, err := whois.Whois("8.8.8.8")
<mask> assert.True(t, err == nil)
<mask> assert.True(t, strings.Index(resp, "OrgName: Google LLC") != -1)
<mask> assert.True(t, strings.Index(resp, "City: ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois_test.go |
<mask>
<mask> func TestWhois(t *testing.T) {
<mask> resp, err := whois.Whois("8.8.8.8")
<mask> assert.True(t, err == nil)
<mask> assert.True(t, strings.Index(resp, "OrgName: Google LLC") != -1)
<mask> assert.True(t, strings.Index(resp, "City: Mountain View") != -1)
<mask> assert.True(t, st... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/37fe3c148f6edcb7ad8567ed2490f8c67208c50f | home/whois_test.go | |
"github.com/AdguardTeam/AdGuardHome/internal/filtering/hashprefix" | <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering/safesearch"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/dnsforward/dnsforward_test.go |
const (
hostname = "wmconvirus.narod.ru"
cacheTime = 10 * time.Minute
cacheSize = 10000
)
sbChecker := hashprefix.New(&hashprefix.Config{
CacheTime: cacheTime,
CacheSize: cacheSize,
Upstream: aghtest.NewBlockUpstream(hostname, true),
}) | <mask> assert.Equalf(t, net.IP{127, 0, 0, 1}, a.A, "dns server %s returned wrong answer instead of 8.8.8.8: %v", addr, a.A)
<mask> }
<mask>
<mask> func TestBlockedBySafeBrowsing(t *testing.T) {
<mask> const hostname = "wmconvirus.narod.ru"
<mask>
<mask> sbUps := aghtest.NewBlockUpstream(hostname, true)
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/dnsforward/dnsforward_test.go |
<mask>
<mask> func TestBlockedBySafeBrowsing(t *testing.T) {
<mask> const hostname = "wmconvirus.narod.ru"
<mask>
<mask> sbUps := aghtest.NewBlockUpstream(hostname, true)
<mask> ans4, _ := (&aghtest.TestResolver{}).HostToIPs(hostname)
<mask>
<mask> filterConf := &filtering.Config{
<mask> SafeBrowsingE... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/dnsforward/dnsforward_test.go | |
SafeBrowsingChecker: sbChecker, | <mask>
<mask> filterConf := &filtering.Config{
<mask> SafeBrowsingEnabled: true,
<mask> }
<mask> forwardConf := ServerConfig{
<mask> UDPListenAddrs: []*net.UDPAddr{{}},
<mask> TCPListenAddrs: []*net.TCPAddr{{}},
<mask> FilteringConfig: FilteringConfig{
</s> Pull request 1837: AG-21462-imp-safebrows... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/dnsforward/dnsforward_test.go |
<mask> },
<mask> },
<mask> }
<mask> s := createTestServer(t, filterConf, forwardConf, nil)
<mask> s.dnsFilter.SetSafeBrowsingUpstream(sbUps)
<mask> startDeferStop(t, s)
<mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP)
<mask>
<mask> // SafeBrowsing blocking.
<mask> req := createTestMessage(hostname ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/dnsforward/dnsforward_test.go | |
<mask> "sync/atomic"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/cache"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go | |
// SafeBrowsingChecker is the safe browsing hash-prefix checker.
SafeBrowsingChecker Checker `yaml:"-"`
// ParentControl is the parental control hash-prefix checker.
ParentalControlChecker Checker `yaml:"-"`
| <mask> // Config allows you to configure DNS filtering with New() or just change variables directly.
<mask> type Config struct {
<mask> // enabled is used to be returned within Settings.
<mask> //
<mask> // It is of type uint32 to be accessed by atomic.
<mask> //
</s> Pull request 1837: AG-21462-imp-safebrow... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go |
// Checker is used for safe browsing or parental control hash-prefix filtering.
type Checker interface {
// Check returns true if request for the host should be blocked.
Check(host string) (block bool, err error)
}
| <mask> check func(host string, qtype uint16, setts *Settings) (res Result, err error)
<mask> name string
<mask> }
<mask>
<mask> // DNSFilter matches hostnames and DNS requests against filtering rules.
<mask> type DNSFilter struct {
<mask> safeSearch SafeSearch
<mask>
<mask> // safeBrowsingChecker is the... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go |
safeSearch SafeSearch
// safeBrowsingChecker is the safe browsing hash-prefix checker.
safeBrowsingChecker Checker
// parentalControl is the parental control hash-prefix checker.
parentalControlChecker Checker
| <mask> }
<mask>
<mask> // DNSFilter matches hostnames and DNS requests against filtering rules.
<mask> type DNSFilter struct {
<mask> rulesStorage *filterlist.RuleStorage
<mask> filteringEngine *urlfilter.DNSEngine
<mask>
<mask> rulesStorageAllow *filterlist.RuleStorage
<mask> filteringEngineAllow ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go |
<mask> filteringEngineAllow *urlfilter.DNSEngine
<mask>
<mask> engineLock sync.RWMutex
<mask>
<mask> parentalServer string // access via methods
<mask> safeBrowsingServer string // access via methods
<mask> parentalUpstream upstream.Upstream
<mask> safeBrowsingUpstream upstream.Upstream
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go | |
<mask> //
<mask> // TODO(e.burkov): Don't use regexp for such a simple text processing task.
<mask> filterTitleRegexp *regexp.Regexp
<mask>
<mask> safeSearch SafeSearch
<mask> hostCheckers []hostChecker
<mask> }
<mask>
<mask> // Filter represents a filter list
<mask> type Filter struct {
</s> Pull ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go | |
refreshLock: &sync.Mutex{},
filterTitleRegexp: regexp.MustCompile(`^! Title: +(.*)$`),
safeBrowsingChecker: c.SafeBrowsingChecker,
parentalControlChecker: c.ParentalControlChecker, | <mask> // New creates properly initialized DNS Filter that is ready to be used. c must
<mask> // be non-nil.
<mask> func New(c *Config, blockFilters []Filter) (d *DNSFilter, err error) {
<mask> d = &DNSFilter{
<mask> refreshLock: &sync.Mutex{},
<mask> filterTitleRegexp: regexp.MustCompile(`^! Title: +... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go |
<mask> refreshLock: &sync.Mutex{},
<mask> filterTitleRegexp: regexp.MustCompile(`^! Title: +(.*)$`),
<mask> }
<mask>
<mask> d.safebrowsingCache = cache.New(cache.Config{
<mask> EnableLRU: true,
<mask> MaxSize: c.SafeBrowsingCacheSize,
<mask> })
<mask> d.parentalCache = cache.New(cache.Conf... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go | |
<mask> }}
<mask>
<mask> defer func() { err = errors.Annotate(err, "filtering: %w") }()
<mask>
<mask> err = d.initSecurityServices()
<mask> if err != nil {
<mask> return nil, fmt.Errorf("initializing services: %s", err)
<mask> }
<mask>
<mask> d.Config = *c
<mask> d.filtersMu = &sync.RWMutex{}
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering.go | |
"github.com/AdguardTeam/AdGuardHome/internal/filtering/hashprefix" | <mask> "net"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/golibs/cache"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/AdguardTeam/urlfilter/rules"
<mask> "github.com/m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go |
<mask> )
<mask>
<mask> // Helpers.
<mask>
<mask> func purgeCaches(d *DNSFilter) {
<mask> for _, c := range []cache.Cache{
<mask> d.safebrowsingCache,
<mask> d.parentalCache,
<mask> } {
<mask> if c != nil {
<mask> c.Clear()
<mask> }
<mask> }
<mask> }
<mask>
<mask> func newForTest(t testi... | [
"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/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
<mask> }
<mask> f, err := New(c, filters)
<mask> require.NoError(t, err)
<mask>
<mask> purgeCaches(f)
<mask>
<mask> return f, setts
<mask> }
<mask>
<mask> func (d *DNSFilter) checkMatch(t *testing.T, hostname string, setts *Settings) {
<mask> t.Helper()
</s> Pull request 1837: AG-21462-imp-safebrow... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
func newChecker(host string) Checker {
return hashprefix.New(&hashprefix.Config{
CacheTime: 10,
CacheSize: 100000,
Upstream: aghtest.NewBlockUpstream(host, true),
})
}
| <mask> }
<mask>
<mask> func (d *DNSFilter) checkMatch(t *testing.T, hostname string, setts *Settings) {
<mask> t.Helper()
<mask>
<mask> res, err := d.CheckHost(hostname, dns.TypeA, setts)
</s> Pull request 1837: AG-21462-imp-safebrowsing-parental
Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-pare... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go |
sbChecker := newChecker(sbBlocked)
d, setts := newForTest(t, &Config{
SafeBrowsingEnabled: true,
SafeBrowsingChecker: sbChecker,
}, nil) | <mask> logOutput := &bytes.Buffer{}
<mask> aghtest.ReplaceLogWriter(t, logOutput)
<mask> aghtest.ReplaceLogLevel(t, log.DEBUG)
<mask>
<mask> d, setts := newForTest(t, &Config{SafeBrowsingEnabled: true}, nil)
<mask> t.Cleanup(d.Close)
<mask>
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlo... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go |
<mask>
<mask> d, setts := newForTest(t, &Config{SafeBrowsingEnabled: true}, nil)
<mask> t.Cleanup(d.Close)
<mask>
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true))
<mask> d.checkMatch(t, sbBlocked, setts)
<mask>
<mask> require.Contains(t, logOutput.String(), fmt.Sprintf("safebr... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
<mask> d.checkMatchEmpty(t, "yandex.ru", setts)
<mask> d.checkMatchEmpty(t, pcBlocked, setts)
<mask>
<mask> // Cached result.
<mask> d.safeBrowsingServer = "127.0.0.1"
<mask> d.checkMatch(t, sbBlocked, setts)
<mask> d.checkMatchEmpty(t, pcBlocked, setts)
<mask> d.safeBrowsingServer = defaultSafebrowsing... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
<mask> // Cached result.
<mask> d.safeBrowsingServer = "127.0.0.1"
<mask> d.checkMatch(t, sbBlocked, setts)
<mask> d.checkMatchEmpty(t, pcBlocked, setts)
<mask> d.safeBrowsingServer = defaultSafebrowsingServer
<mask> }
<mask>
<mask> func TestParallelSB(t *testing.T) {
<mask> d, setts := newForTest(t, &C... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
d, setts := newForTest(t, &Config{
SafeBrowsingEnabled: true,
SafeBrowsingChecker: newChecker(sbBlocked),
}, nil) | <mask> d.safeBrowsingServer = defaultSafebrowsingServer
<mask> }
<mask>
<mask> func TestParallelSB(t *testing.T) {
<mask> d, setts := newForTest(t, &Config{SafeBrowsingEnabled: true}, nil)
<mask> t.Cleanup(d.Close)
<mask>
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true))
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go |
<mask> func TestParallelSB(t *testing.T) {
<mask> d, setts := newForTest(t, &Config{SafeBrowsingEnabled: true}, nil)
<mask> t.Cleanup(d.Close)
<mask>
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true))
<mask>
<mask> t.Run("group", func(t *testing.T) {
<mask> for i := 0; i < 100; ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
d, setts := newForTest(t, &Config{
ParentalEnabled: true,
ParentalControlChecker: newChecker(pcBlocked),
}, nil) | <mask> logOutput := &bytes.Buffer{}
<mask> aghtest.ReplaceLogWriter(t, logOutput)
<mask> aghtest.ReplaceLogLevel(t, log.DEBUG)
<mask>
<mask> d, setts := newForTest(t, &Config{ParentalEnabled: true}, nil)
<mask> t.Cleanup(d.Close)
<mask>
<mask> d.SetParentalUpstream(aghtest.NewBlockUpstream(pcBlocked, tr... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go |
<mask>
<mask> d, setts := newForTest(t, &Config{ParentalEnabled: true}, nil)
<mask> t.Cleanup(d.Close)
<mask>
<mask> d.SetParentalUpstream(aghtest.NewBlockUpstream(pcBlocked, true))
<mask> d.checkMatch(t, pcBlocked, setts)
<mask> require.Contains(t, logOutput.String(), fmt.Sprintf("parental lookup for %q"... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
<mask> d.checkMatchEmpty(t, "yandex.ru", setts)
<mask> d.checkMatchEmpty(t, "api.jquery.com", setts)
<mask>
<mask> // Test cached result.
<mask> d.parentalServer = "127.0.0.1"
<mask> d.checkMatch(t, pcBlocked, setts)
<mask> d.checkMatchEmpty(t, "yandex.ru", setts)
<mask> }
<mask>
<mask> // Filtering.
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
ParentalEnabled: true,
SafeBrowsingEnabled: false,
SafeBrowsingChecker: newChecker(sbBlocked),
ParentalControlChecker: newChecker(pcBlocked), | <mask>
<mask> func TestClientSettings(t *testing.T) {
<mask> d, setts := newForTest(t,
<mask> &Config{
<mask> ParentalEnabled: true,
<mask> SafeBrowsingEnabled: false,
<mask> },
<mask> []Filter{{
<mask> ID: 0, Data: []byte("||example.org^\n"),
<mask> }},
<mask> )
</s> Pull request 18... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go |
<mask> }},
<mask> )
<mask> t.Cleanup(d.Close)
<mask>
<mask> d.SetParentalUpstream(aghtest.NewBlockUpstream(pcBlocked, true))
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true))
<mask>
<mask> type testCase struct {
<mask> name string
<mask> host string
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
d, setts := newForTest(b, &Config{
SafeBrowsingEnabled: true,
SafeBrowsingChecker: newChecker(sbBlocked),
}, nil) | <mask>
<mask> // Benchmarks.
<mask>
<mask> func BenchmarkSafeBrowsing(b *testing.B) {
<mask> d, setts := newForTest(b, &Config{SafeBrowsingEnabled: true}, nil)
<mask> b.Cleanup(d.Close)
<mask>
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true))
<mask>
<mask> for n := 0; n < b.N... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go |
<mask> func BenchmarkSafeBrowsing(b *testing.B) {
<mask> d, setts := newForTest(b, &Config{SafeBrowsingEnabled: true}, nil)
<mask> b.Cleanup(d.Close)
<mask>
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true))
<mask>
<mask> for n := 0; n < b.N; n++ {
<mask> res, err := d.CheckHost... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
d, setts := newForTest(b, &Config{
SafeBrowsingEnabled: true,
SafeBrowsingChecker: newChecker(sbBlocked),
}, nil) | <mask> }
<mask> }
<mask>
<mask> func BenchmarkSafeBrowsingParallel(b *testing.B) {
<mask> d, setts := newForTest(b, &Config{SafeBrowsingEnabled: true}, nil)
<mask> b.Cleanup(d.Close)
<mask>
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true))
<mask>
<mask> b.RunParallel(func(pb ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go |
<mask> func BenchmarkSafeBrowsingParallel(b *testing.B) {
<mask> d, setts := newForTest(b, &Config{SafeBrowsingEnabled: true}, nil)
<mask> b.Cleanup(d.Close)
<mask>
<mask> d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true))
<mask>
<mask> b.RunParallel(func(pb *testing.PB) {
<mask> for p... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/filtering_test.go | |
<mask> package filtering
<mask>
<mask> import (
<mask> "bytes"
<mask> "crypto/sha256"
<mask> "encoding/binary"
<mask> "encoding/hex"
<mask> "fmt"
<mask> "net"
<mask> "net/http"
<mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
</s> Pull request 1837: AG-21462-imp-safebrowsing-parental
Merg... | [
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/safebrowsing.go | |
<mask> "encoding/hex"
<mask> "fmt"
<mask> "net"
<mask> "net/http"
<mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
</s> Pull request 1837: AG-21462-imp-safebrowsing-parental
Merge in D... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/safebrowsing.go | |
<mask> "net"
<mask> "net/http"
<mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/cache"
<mask> "github.com/AdguardTeam/golibs/log"
</s> Pull request... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c | internal/filtering/safebrowsing.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.