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 |
|---|---|---|---|---|
getTopStats, | <mask> const mapDispatchToProps = {
<mask> getClients,
<mask> addClient,
<mask> updateClient,
<mask> deleteClient,
<mask> toggleClientModal,
</s> * client: remove /clients and /stats_top request from global requests </s> remove import { getClients } from '../actions';
</s> add import { getCl... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2520a62e2430dac1d9bf689c567b95d419a78339 | client/src/containers/Clients.js |
import { getLogs, toggleLogStatus, downloadQueryLog, getFilteringStatus, setRules, addSuccessToast, getClients } from '../actions'; | <mask> import { connect } from 'react-redux';
<mask> import { getLogs, toggleLogStatus, downloadQueryLog, getFilteringStatus, setRules, addSuccessToast } from '../actions';
<mask> import Logs from '../components/Logs';
<mask>
<mask> const mapStateToProps = (state) => {
<mask> const { queryLogs, dashboard, fi... | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2520a62e2430dac1d9bf689c567b95d419a78339 | client/src/containers/Logs.js |
getClients, | <mask> getFilteringStatus,
<mask> setRules,
<mask> addSuccessToast,
<mask> };
<mask>
<mask> export default connect(
<mask> mapStateToProps,
<mask> mapDispatchToProps,
</s> * client: remove /clients and /stats_top request from global requests </s> remove import { getLogs, toggleLogStatus, d... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2520a62e2430dac1d9bf689c567b95d419a78339 | client/src/containers/Logs.js |
Result dnsfilter.Result | <mask>
<mask> type logEntry struct {
<mask> Question []byte
<mask> Answer []byte `json:",omitempty"` // sometimes empty answers happen like binerdunt.top or rev2.globalrootservers.net
<mask> Result *dnsfilter.Result
<mask> Time time.Time
<mask> Elapsed time.Duration
<mask> IP string
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/253d8a4016d66863ecee426b8f7d74841c4ed4de | dnsforward/querylog.go |
if result == nil {
result = &dnsfilter.Result{}
}
| <mask> }
<mask>
<mask> now := time.Now()
<mask> entry := logEntry{
<mask> Question: q,
<mask> Answer: a,
</s> Pointer for dnsfilter.Result in querylog didn't make things simpler, revert that change and all related changes. </s> remove Result: result,
</s> add Result: *result, </s> remove swi... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/253d8a4016d66863ecee426b8f7d74841c4ed4de | dnsforward/querylog.go |
Result: *result, | <mask> now := time.Now()
<mask> entry := logEntry{
<mask> Question: q,
<mask> Answer: a,
<mask> Result: result,
<mask> Time: now,
<mask> Elapsed: elapsed,
<mask> IP: ip,
<mask> Upstream: upstream,
<mask> }
</s> Pointer for dnsfilter.Result in querylog didn't make things simple... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/253d8a4016d66863ecee426b8f7d74841c4ed4de | dnsforward/querylog.go |
if entry.Result.IsFiltered { | <mask> log.Printf("Failed to increment value: %s", err)
<mask> return err
<mask> }
<mask>
<mask> if entry.Result != nil && entry.Result.IsFiltered {
<mask> err := runningTop.hours[hour].incrementBlocked(hostname)
<mask> if err != nil {
<mask> log.Printf("Failed to increment value: %s", err)
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/253d8a4016d66863ecee426b8f7d74841c4ed4de | dnsforward/querylog_top.go |
if entry.Result.IsFiltered {
filtered.IncWithTime(entry.Time)
} | <mask> // stats
<mask> // -----
<mask> func incrementCounters(entry *logEntry) {
<mask> requests.IncWithTime(entry.Time)
<mask> if entry.Result != nil {
<mask> if entry.Result.IsFiltered {
<mask> filtered.IncWithTime(entry.Time)
<mask> }
<mask>
<mask> switch entry.Result.Reason {
<mask> case dn... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/253d8a4016d66863ecee426b8f7d74841c4ed4de | dnsforward/stats.go |
switch entry.Result.Reason {
case dnsfilter.NotFilteredWhiteList:
whitelisted.IncWithTime(entry.Time)
case dnsfilter.NotFilteredError:
errorsTotal.IncWithTime(entry.Time)
case dnsfilter.FilteredBlackList:
filteredLists.IncWithTime(entry.Time)
case dnsfilter.FilteredSafeBrowsing:
filteredSafebrowsing.IncWit... | <mask> if entry.Result.IsFiltered {
<mask> filtered.IncWithTime(entry.Time)
<mask> }
<mask>
<mask> switch entry.Result.Reason {
<mask> case dnsfilter.NotFilteredWhiteList:
<mask> whitelisted.IncWithTime(entry.Time)
<mask> case dnsfilter.NotFilteredError:
<mask> errorsTotal.IncWithTime(entry... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/253d8a4016d66863ecee426b8f7d74841c4ed4de | dnsforward/stats.go |
"io/ioutil" | <mask> import (
<mask> "context"
<mask> "encoding/json"
<mask> "fmt"
<mask> "net"
<mask> "net/http"
<mask> "os"
<mask> "os/exec"
<mask> "path/filepath"
</s> - install: fix DNS nameserver issue after we disable DNSStubListener on Ubuntu </s> remove cmd = exec.Command("systemctl", "reload-or-restart", ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/254cab3a2310e5f6af2994527fccdac3ea74143c | home/control_install.go |
"os" | <mask> "fmt"
<mask> "io/ioutil"
<mask> "net"
<mask> "net/http"
<mask> "os/exec"
<mask> "path/filepath"
<mask> "runtime"
<mask> "strconv"
</s> - install: fix DNS nameserver issue after we disable DNSStubListener on Ubuntu </s> remove cmd = exec.Command("systemctl", "reload-or-restart", "systemd-resolve... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/254cab3a2310e5f6af2994527fccdac3ea74143c | home/control_install.go |
"path/filepath" | <mask> "os"
<mask> "os/exec"
<mask> "runtime"
<mask> "strconv"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
</s> - install: fix DNS nameserver issue after we disable DNSStubListener on Ubuntu </s> remove cmd = exec.Command("systemctl", "reload-or-restart", "systemd-resolved")
</s>... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/254cab3a2310e5f6af2994527fccdac3ea74143c | home/control_install.go |
const resolvedConfPath = "/etc/systemd/resolved.conf.d/adguardhome.conf"
const resolvedConfData = `[Resolve]
DNS=127.0.0.1
DNSStubListener=no
`
const resolvConfPath = "/etc/resolv.conf"
| <mask> }
<mask>
<mask> // Deactivate DNSStubListener
<mask> func disableDNSStubListener() error {
<mask> dir := filepath.Dir(resolvedConfPath)
<mask> err := os.MkdirAll(dir, 0755)
<mask> if err != nil {
</s> - install: fix DNS nameserver issue after we disable DNSStubListener on Ubuntu </s> remove cmd := e... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/254cab3a2310e5f6af2994527fccdac3ea74143c | home/control_install.go |
dir := filepath.Dir(resolvedConfPath)
err := os.MkdirAll(dir, 0755) | <mask> }
<mask>
<mask> // Deactivate DNSStubListener
<mask> func disableDNSStubListener() error {
<mask> cmd := exec.Command("sed", "-r", "-i.orig", "s/#?DNSStubListener=yes/DNSStubListener=no/g", "/etc/systemd/resolved.conf")
<mask> log.Tracef("executing %s %v", cmd.Path, cmd.Args)
<mask> _, err := cmd.Outp... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/254cab3a2310e5f6af2994527fccdac3ea74143c | home/control_install.go |
return fmt.Errorf("os.MkdirAll: %s: %s", dir, err) | <mask> cmd := exec.Command("sed", "-r", "-i.orig", "s/#?DNSStubListener=yes/DNSStubListener=no/g", "/etc/systemd/resolved.conf")
<mask> log.Tracef("executing %s %v", cmd.Path, cmd.Args)
<mask> _, err := cmd.Output()
<mask> if err != nil {
<mask> return err
<mask> }
<mask> if cmd.ProcessState.ExitCode() !... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/254cab3a2310e5f6af2994527fccdac3ea74143c | home/control_install.go |
err = ioutil.WriteFile(resolvedConfPath, []byte(resolvedConfData), 0644)
if err != nil {
return fmt.Errorf("ioutil.WriteFile: %s: %s", resolvedConfPath, err)
}
_ = os.Rename(resolvConfPath, resolvConfPath+".backup")
err = os.Symlink("/run/systemd/resolve/resolv.conf", resolvConfPath)
if err != nil {
_ = os.R... | <mask> _, err := cmd.Output()
<mask> if err != nil {
<mask> return err
<mask> }
<mask> if cmd.ProcessState.ExitCode() != 0 {
<mask> return fmt.Errorf("process %s exited with an error: %d",
<mask> cmd.Path, cmd.ProcessState.ExitCode())
<mask> }
<mask>
<mask> cmd = exec.Command("systemctl", "reloa... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/254cab3a2310e5f6af2994527fccdac3ea74143c | home/control_install.go |
cmd := exec.Command("systemctl", "reload-or-restart", "systemd-resolved") | <mask> return fmt.Errorf("process %s exited with an error: %d",
<mask> cmd.Path, cmd.ProcessState.ExitCode())
<mask> }
<mask>
<mask> cmd = exec.Command("systemctl", "reload-or-restart", "systemd-resolved")
<mask> log.Tracef("executing %s %v", cmd.Path, cmd.Args)
<mask> _, err = cmd.Output()
<mask> if... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/254cab3a2310e5f6af2994527fccdac3ea74143c | home/control_install.go |
<mask> if ip = net.ParseIP(fields[0]); ip == nil {
<mask> return nil, nil
<mask> }
<mask>
<mask> loop:
<mask> for _, f := range fields[1:] {
<mask> switch hashIdx := strings.IndexByte(f, '#'); hashIdx {
<mask> case 0:
<mask> // The rest of the fields are a part of the comment so skip
<mask> //... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghnet/hostscontainer.go | |
<mask>
<mask> loop:
<mask> for _, f := range fields[1:] {
<mask> switch hashIdx := strings.IndexByte(f, '#'); hashIdx {
<mask> case 0:
<mask> // The rest of the fields are a part of the comment so skip
<mask> // immediately.
<mask> break loop
<mask> case -1:
<mask> hosts = append(hosts, f)... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghnet/hostscontainer.go | |
continue
case 0:
// Go on. | <mask> for _, f := range fields[1:] {
<mask> switch hashIdx := strings.IndexByte(f, '#'); hashIdx {
<mask> case -1:
<mask> hosts = append(hosts, f)
<mask> default:
<mask> // Only a part of the field is a comment.
<mask> hosts = append(hosts, f[:hashIdx])
<mask> }
<mask>
</s> Pull request: a... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghnet/hostscontainer.go |
<mask> hosts = append(hosts, f)
<mask> default:
<mask> // Only a part of the field is a comment.
<mask> hosts = append(hosts, f[:hashIdx])
<mask>
<mask> break loop
<mask> }
<mask> }
<mask>
<mask> return ip, hosts
<mask> }
</s> Pull request: all: get rid of labels
Merge in DNS/adguard-ho... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghnet/hostscontainer.go | |
// The rest of the fields are a part of the comment so skip
// immediately.
break | <mask> default:
<mask> // Only a part of the field is a comment.
<mask> hosts = append(hosts, f[:hashIdx])
<mask> }
<mask> }
<mask>
<mask> return ip, hosts
<mask> }
<mask>
<mask> // Simple types of hosts in hosts database. Zero value isn't used to be able
</s> Pull request: all: get rid of lab... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghnet/hostscontainer.go |
pid, instNum, err = parsePSOutput(stdout, command, except) | <mask> return 0, fmt.Errorf("start command executing: %w", err)
<mask> }
<mask>
<mask> var instNum int
<mask> pid, instNum, err = parsePSOutput(stdout, command, except...)
<mask> if err != nil {
<mask> return 0, err
<mask> }
<mask>
<mask> if err = cmd.Wait(); err != nil {
</s> Pull request: all: ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os.go |
func parsePSOutput(r io.Reader, cmdName string, ignore []int) (largest, instNum int, err error) { | <mask> // 123 ./example-cmd
<mask> // 1230 some/base/path/example-cmd
<mask> // 3210 example-cmd
<mask> //
<mask> func parsePSOutput(r io.Reader, cmdName string, ignore ...int) (largest, instNum int, err error) {
<mask> s := bufio.NewScanner(r)
<mask> ScanLoop:
<mask> for s.Scan() {
<mask> fields :=... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os.go |
<mask> // 3210 example-cmd
<mask> //
<mask> func parsePSOutput(r io.Reader, cmdName string, ignore ...int) (largest, instNum int, err error) {
<mask> s := bufio.NewScanner(r)
<mask> ScanLoop:
<mask> for s.Scan() {
<mask> fields := strings.Fields(s.Text())
<mask> if len(fields) != 2 || path.Base(fields[1... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os.go | |
if aerr != nil || cur < 0 || intIn(cur, ignore) { | <mask> continue
<mask> }
<mask>
<mask> cur, aerr := strconv.Atoi(fields[0])
<mask> if aerr != nil || cur < 0 {
<mask> continue
<mask> }
<mask>
<mask> for _, pid := range ignore {
<mask> if cur == pid {
</s> Pull request: all: get rid of labels
Merge in DNS/adguard-home from rm-labels to... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os.go |
<mask> if aerr != nil || cur < 0 {
<mask> continue
<mask> }
<mask>
<mask> for _, pid := range ignore {
<mask> if cur == pid {
<mask> continue ScanLoop
<mask> }
<mask> }
<mask>
<mask> instNum++
<mask> if cur > largest {
<mask> largest = cur
<mask> }
<mask> }
</s> Pull req... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os.go | |
// intIn returns true if nums contains n.
func intIn(n int, nums []int) (ok bool) {
for _, nn := range nums {
if n == nn {
return true
}
}
return false
}
| <mask>
<mask> return largest, instNum, nil
<mask> }
<mask>
<mask> // IsOpenWrt returns true if host OS is OpenWrt.
<mask> func IsOpenWrt() (ok bool) {
<mask> return isOpenWrt()
<mask> }
</s> Pull request: all: get rid of labels
Merge in DNS/adguard-home from rm-labels to master
Squashed commit of the fol... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os.go |
pid, instNum, err := parsePSOutput(r, comm, nil) | <mask> for _, tc := range testCases {
<mask> r := bytes.NewReader(tc.data)
<mask>
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> pid, instNum, err := parsePSOutput(r, comm)
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, tc.wantPID, pid)
<mask> assert.Equal(t, tc.wantInstNum,... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os_test.go |
_, _, err = parsePSOutput(lr, "", nil) | <mask> lr, err := aghio.LimitReader(bytes.NewReader([]byte{1, 2, 3}), 0)
<mask> require.NoError(t, err)
<mask>
<mask> target := &aghio.LimitReachedError{}
<mask> _, _, err = parsePSOutput(lr, "")
<mask> require.ErrorAs(t, err, &target)
<mask>
<mask> assert.EqualValues(t, 0, target.Limit)
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os_test.go |
pid, instances, err := parsePSOutput(r, comm, []int{1, 3}) | <mask> `2 ` + comm + nl +
<mask> `3` + comm + nl,
<mask> ))
<mask>
<mask> pid, instances, err := parsePSOutput(r, comm, 1, 3)
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, 2, pid)
<mask> assert.Equal(t, 1, instances)
<mask> })
</s> Pull request: all: get rid of labels
Merge... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/25fd34c51459d9b3b9d5fde4060902228a5569ec | internal/aghos/os_test.go |
d.Config.HTTPRegister(http.MethodGet, "/control/blocked_services/list", d.handleBlockedServicesList)
d.Config.HTTPRegister(http.MethodPost, "/control/blocked_services/set", d.handleBlockedServicesSet) | <mask> }
<mask>
<mask> // registerBlockedServicesHandlers - register HTTP handlers
<mask> func (d *DNSFilter) registerBlockedServicesHandlers() {
<mask> d.Config.HTTPRegister("GET", "/control/blocked_services/list", d.handleBlockedServicesList)
<mask> d.Config.HTTPRegister("POST", "/control/blocked_services/se... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/dnsfilter/blocked.go |
d.Config.HTTPRegister(http.MethodGet, "/control/rewrite/list", d.handleRewriteList)
d.Config.HTTPRegister(http.MethodPost, "/control/rewrite/add", d.handleRewriteAdd)
d.Config.HTTPRegister(http.MethodPost, "/control/rewrite/delete", d.handleRewriteDelete) | <mask> d.Config.ConfigModified()
<mask> }
<mask>
<mask> func (d *DNSFilter) registerRewritesHandlers() {
<mask> d.Config.HTTPRegister("GET", "/control/rewrite/list", d.handleRewriteList)
<mask> d.Config.HTTPRegister("POST", "/control/rewrite/add", d.handleRewriteAdd)
<mask> d.Config.HTTPRegister("POST", "/c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/dnsfilter/rewrites.go |
d.Config.HTTPRegister(http.MethodPost, "/control/safebrowsing/enable", d.handleSafeBrowsingEnable)
d.Config.HTTPRegister(http.MethodPost, "/control/safebrowsing/disable", d.handleSafeBrowsingDisable)
d.Config.HTTPRegister(http.MethodGet, "/control/safebrowsing/status", d.handleSafeBrowsingStatus) | <mask> }
<mask> }
<mask>
<mask> func (d *DNSFilter) registerSecurityHandlers() {
<mask> d.Config.HTTPRegister("POST", "/control/safebrowsing/enable", d.handleSafeBrowsingEnable)
<mask> d.Config.HTTPRegister("POST", "/control/safebrowsing/disable", d.handleSafeBrowsingDisable)
<mask> d.Config.HTTPRegister("G... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/dnsfilter/safebrowsing.go |
d.Config.HTTPRegister(http.MethodPost, "/control/parental/enable", d.handleParentalEnable)
d.Config.HTTPRegister(http.MethodPost, "/control/parental/disable", d.handleParentalDisable)
d.Config.HTTPRegister(http.MethodGet, "/control/parental/status", d.handleParentalStatus) | <mask> d.Config.HTTPRegister("POST", "/control/safebrowsing/enable", d.handleSafeBrowsingEnable)
<mask> d.Config.HTTPRegister("POST", "/control/safebrowsing/disable", d.handleSafeBrowsingDisable)
<mask> d.Config.HTTPRegister("GET", "/control/safebrowsing/status", d.handleSafeBrowsingStatus)
<mask>
<mask> d.Co... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/dnsfilter/safebrowsing.go |
d.Config.HTTPRegister(http.MethodPost, "/control/safesearch/enable", d.handleSafeSearchEnable)
d.Config.HTTPRegister(http.MethodPost, "/control/safesearch/disable", d.handleSafeSearchDisable)
d.Config.HTTPRegister(http.MethodGet, "/control/safesearch/status", d.handleSafeSearchStatus) | <mask> d.Config.HTTPRegister("POST", "/control/parental/enable", d.handleParentalEnable)
<mask> d.Config.HTTPRegister("POST", "/control/parental/disable", d.handleParentalDisable)
<mask> d.Config.HTTPRegister("GET", "/control/parental/status", d.handleParentalStatus)
<mask>
<mask> d.Config.HTTPRegister("POST"... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/dnsfilter/safebrowsing.go |
httpRegister(http.MethodGet, "/control/clients", clients.handleGetClients)
httpRegister(http.MethodPost, "/control/clients/add", clients.handleAddClient)
httpRegister(http.MethodPost, "/control/clients/delete", clients.handleDelClient)
httpRegister(http.MethodPost, "/control/clients/update", clients.handleUpdateCli... | <mask> }
<mask>
<mask> // RegisterClientsHandlers registers HTTP handlers
<mask> func (clients *clientsContainer) registerWebHandlers() {
<mask> httpRegister("GET", "/control/clients", clients.handleGetClients)
<mask> httpRegister("POST", "/control/clients/add", clients.handleAddClient)
<mask> httpRegister("... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/home/clientshttp.go |
httpRegister(http.MethodGet, "/control/filtering/status", f.handleFilteringStatus)
httpRegister(http.MethodPost, "/control/filtering/config", f.handleFilteringConfig)
httpRegister(http.MethodPost, "/control/filtering/add_url", f.handleFilteringAddURL)
httpRegister(http.MethodPost, "/control/filtering/remove_url", f... | <mask> }
<mask>
<mask> // RegisterFilteringHandlers - register handlers
<mask> func (f *Filtering) RegisterFilteringHandlers() {
<mask> httpRegister("GET", "/control/filtering/status", f.handleFilteringStatus)
<mask> httpRegister("POST", "/control/filtering/config", f.handleFilteringConfig)
<mask> httpRegist... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/home/controlfiltering.go |
httpRegister(http.MethodGet, "/control/tls/status", t.handleTLSStatus)
httpRegister(http.MethodPost, "/control/tls/configure", t.handleTLSConfigure)
httpRegister(http.MethodPost, "/control/tls/validate", t.handleTLSValidate) | <mask> }
<mask>
<mask> // registerWebHandlers registers HTTP handlers for TLS configuration
<mask> func (t *TLSMod) registerWebHandlers() {
<mask> httpRegister("GET", "/control/tls/status", t.handleTLSStatus)
<mask> httpRegister("POST", "/control/tls/configure", t.handleTLSConfigure)
<mask> httpRegister("POS... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/home/tls.go |
l.conf.HTTPRegister(http.MethodGet, "/control/querylog", l.handleQueryLog)
l.conf.HTTPRegister(http.MethodGet, "/control/querylog_info", l.handleQueryLogInfo)
l.conf.HTTPRegister(http.MethodPost, "/control/querylog_clear", l.handleQueryLogClear)
l.conf.HTTPRegister(http.MethodPost, "/control/querylog_config", l.han... | <mask> }
<mask>
<mask> // Register web handlers
<mask> func (l *queryLog) initWeb() {
<mask> l.conf.HTTPRegister("GET", "/control/querylog", l.handleQueryLog)
<mask> l.conf.HTTPRegister("GET", "/control/querylog_info", l.handleQueryLogInfo)
<mask> l.conf.HTTPRegister("POST", "/control/querylog_clear", l.hand... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/querylog/http.go |
s.conf.HTTPRegister(http.MethodGet, "/control/stats", s.handleStats)
s.conf.HTTPRegister(http.MethodPost, "/control/stats_reset", s.handleStatsReset)
s.conf.HTTPRegister(http.MethodPost, "/control/stats_config", s.handleStatsConfig)
s.conf.HTTPRegister(http.MethodGet, "/control/stats_info", s.handleStatsInfo) | <mask> if s.conf.HTTPRegister == nil {
<mask> return
<mask> }
<mask>
<mask> s.conf.HTTPRegister("GET", "/control/stats", s.handleStats)
<mask> s.conf.HTTPRegister("POST", "/control/stats_reset", s.handleStatsReset)
<mask> s.conf.HTTPRegister("POST", "/control/stats_config", s.handleStatsConfig)
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2638e271fed1937ceafaefeefe8086cb249eaf72 | internal/stats/http.go |
Ratelimit uint32 `yaml:"ratelimit"` // max number of requests per second from a given IP (0 to disable) | <mask> ProtectionEnabled bool `yaml:"protection_enabled"` // whether or not use any of dnsfilter features
<mask>
<mask> BlockingMode string `yaml:"blocking_mode"` // mode how to answer filtered requests
<mask> BlockedResponseTTL uint32 `yaml:"blocked_response_ttl"` // if 0, then default is used... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/26ccee47b5045261907d65129fa1dea250efaf02 | dnsforward/dnsforward.go |
Ratelimit: int(s.conf.Ratelimit), | <mask>
<mask> proxyConfig := proxy.Config{
<mask> UDPListenAddr: s.conf.UDPListenAddr,
<mask> TCPListenAddr: s.conf.TCPListenAddr,
<mask> Ratelimit: s.conf.Ratelimit,
<mask> RatelimitWhitelist: s.conf.RatelimitWhitelist,
<mask> RefuseAny: s.co... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/26ccee47b5045261907d65129fa1dea250efaf02 | dnsforward/dnsforward.go |
s.conf.HTTPRegister("GET", "/control/dns_info", s.handleGetConfig)
s.conf.HTTPRegister("POST", "/control/dns_config", s.handleSetConfig) | <mask>
<mask> func (s *Server) registerHandlers() {
<mask> s.conf.HTTPRegister("POST", "/control/enable_protection", s.handleProtectionEnable)
<mask> s.conf.HTTPRegister("POST", "/control/disable_protection", s.handleProtectionDisable)
<mask> s.conf.HTTPRegister("POST", "/control/set_upstreams_config", s.handl... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/26ccee47b5045261907d65129fa1dea250efaf02 | dnsforward/dnsforward_http.go |
// . Stop server
// . For each filter:
// . If filter data hasn't changed, just set new update time on file
// . If filter data has changed, save it on disk | <mask> //
<mask> // Algorithm:
<mask> // . Get the list of filters to be updated
<mask> // . For each filter run the download and checksum check operation
<mask> // . If filter data hasn't changed, set new update time
<mask> // . If filter data has changed, parse it, save it on disk, set new update time
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/27006f58c506b3dd365a1dea3a9e42f41d5c2a6e | home/filter.go |
// . Start server | <mask> // . For each filter run the download and checksum check operation
<mask> // . If filter data hasn't changed, set new update time
<mask> // . If filter data has changed, parse it, save it on disk, set new update time
<mask> // . Apply changes to the current configuration
<mask> // . Restart server
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/27006f58c506b3dd365a1dea3a9e42f41d5c2a6e | home/filter.go |
var updateFlags []bool // 'true' if filter data has changed | <mask> // . Start server
<mask> func refreshFiltersIfNecessary(force bool) int {
<mask> var updateFilters []filter
<mask>
<mask> if config.firstRun {
<mask> return 0
<mask> }
<mask>
<mask> config.RLock()
</s> - filters: windows: fix update procedure
We couldn't write filter files on Windows due to
"... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/27006f58c506b3dd365a1dea3a9e42f41d5c2a6e | home/filter.go |
uf.LastUpdated = time.Now()
updateFlags = append(updateFlags, updated)
}
isRunning := isRunning()
_ = dnsServer.Stop()
for i := range updateFilters {
uf := &updateFilters[i]
updated := updateFlags[i] | <mask> log.Printf("Failed to update filter %s: %s\n", uf.URL, err)
<mask> continue
<mask> }
<mask> if updated {
<mask> // Saving it to the filters dir now
<mask> err := uf.save()
<mask> if err != nil {
<mask> log.Printf("Failed to save the updated filter %d: %s", uf.ID, err)
<mask> c... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/27006f58c506b3dd365a1dea3a9e42f41d5c2a6e | home/filter.go |
err := uf.save() | <mask> continue
<mask> }
<mask> if updated {
<mask> // Saving it to the filters dir now
<mask> err = uf.save()
<mask> if err != nil {
<mask> log.Printf("Failed to save the updated filter %d: %s", uf.ID, err)
<mask> continue
<mask> }
<mask>
</s> - filters: windows: fix update proce... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/27006f58c506b3dd365a1dea3a9e42f41d5c2a6e | home/filter.go |
e := os.Chtimes(uf.Path(), uf.LastUpdated, uf.LastUpdated) | <mask> continue
<mask> }
<mask>
<mask> } else {
<mask> mtime := time.Now()
<mask> e := os.Chtimes(uf.Path(), mtime, mtime)
<mask> if e != nil {
<mask> log.Error("os.Chtimes(): %v", e)
<mask> }
<mask> uf.LastUpdated = mtime
<mask> }
</s> - filters: windows: fix update procedure... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/27006f58c506b3dd365a1dea3a9e42f41d5c2a6e | home/filter.go |
<mask> e := os.Chtimes(uf.Path(), mtime, mtime)
<mask> if e != nil {
<mask> log.Error("os.Chtimes(): %v", e)
<mask> }
<mask> uf.LastUpdated = mtime
<mask> }
<mask>
<mask> config.Lock()
<mask> for k := range config.Filters {
<mask> f := &config.Filters[k]
</s> - filters: windows: fix... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/27006f58c506b3dd365a1dea3a9e42f41d5c2a6e | home/filter.go | |
if updateCount > 0 && isRunning { | <mask> }
<mask> config.Unlock()
<mask> }
<mask>
<mask> if updateCount > 0 && isRunning() {
<mask> err := reconfigureDNSServer()
<mask> if err != nil {
<mask> msg := fmt.Sprintf("SHOULD NOT HAPPEN: cannot reconfigure DNS server with the new filters: %s", err)
<mask> panic(msg)
<mask> }
</s>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/27006f58c506b3dd365a1dea3a9e42f41d5c2a6e | home/filter.go |
left: -10px;
min-width: 270px; | <mask> .stats__table .popover__body {
<mask> left: 0;
<mask> transform: none;
<mask> }
<mask>
<mask> .stats__table .popover__body:after {
<mask> left: 13px;
</s> - client: fix popover in the dashboard tables </s> remove left: 13px;
</s> add left: 23px; </s> remove <div classNam... | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/271ff4fe8358eed5de3bbeb76ab9ec7a6a369b89 | client/src/components/Dashboard/Dashboard.css |
left: 23px; | <mask> transform: none;
<mask> }
<mask>
<mask> .stats__table .popover__body:after {
<mask> left: 13px;
<mask> }
<mask>
<mask> .stats__table .rt-tr-group:first-child .popover__body,
<mask> .stats__table .rt-tr-group:nth-child(2) .popover__body {
<mask> top: calc(100% + 5px);
</s> - client: fix p... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/271ff4fe8358eed5de3bbeb76ab9ec7a6a369b89 | client/src/components/Dashboard/Dashboard.css |
<div className="logs__text logs__text--domain" title={value}> | <mask> const trackerData = getTrackerData(value);
<mask>
<mask> return (
<mask> <div className="logs__row">
<mask> <div className="logs__text" title={value}>
<mask> {value}
<mask> </div>
<mask> {trackerData && <Popover data={trackerData} />}
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/271ff4fe8358eed5de3bbeb76ab9ec7a6a369b89 | client/src/components/Dashboard/DomainCell.js |
.logs__text--domain {
max-width: 285px;
}
| <mask> width: 100%;
<mask> }
<mask>
<mask> .logs__text--wrap,
<mask> .logs__text--whois {
<mask> line-height: 1.4;
<mask> white-space: normal;
<mask> }
<mask>
</s> - client: fix popover in the dashboard tables </s> remove left: 13px;
</s> add left: 23px; </s> remove left: 0;
</s> a... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/271ff4fe8358eed5de3bbeb76ab9ec7a6a369b89 | client/src/components/Logs/Logs.css |
type HTTPSServer struct {
server *http.Server
cond *sync.Cond // reacts to config.TLS.Enabled, PortHTTPS, CertificateChain and PrivateKey
sync.Mutex // protects config.TLS
shutdown bool // if TRUE, don't restart the server
}
| <mask> }
<mask>
<mask> // configuration is loaded from YAML
<mask> // field ordering is important -- yaml fields will mirror ordering from here
<mask> type configuration struct {
<mask> // Raw file data to avoid re-reading of configuration file
<mask> // It's reset after config is parsed
<mask> fileData []b... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/config.go |
httpsServer HTTPSServer
| <mask> versionCheckJSON []byte
<mask> versionCheckLastTime time.Time
<mask>
<mask> BindHost string `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to
<mask> BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server
<mask> AuthName string `... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/config.go |
if config.httpsServer.server != nil { | <mask>
<mask> // check if port is available
<mask> // BUT: if we are already using this port, no need
<mask> alreadyRunning := false
<mask> if httpsServer.server != nil {
<mask> alreadyRunning = true
<mask> }
<mask> if !alreadyRunning {
<mask> err = checkPortAvailable(config.BindHost, data.PortHTTPS... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/control_tls.go |
if config.httpsServer.server != nil { | <mask>
<mask> // check if port is available
<mask> // BUT: if we are already using this port, no need
<mask> alreadyRunning := false
<mask> if httpsServer.server != nil {
<mask> alreadyRunning = true
<mask> }
<mask> if !alreadyRunning {
<mask> err = checkPortAvailable(config.BindHost, data.PortHTTPS... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/control_tls.go |
config.httpsServer.cond.L.Lock()
config.httpsServer.cond.Broadcast()
if config.httpsServer.server != nil {
config.httpsServer.server.Shutdown(context.TODO()) | <mask> // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
<mask> if restartHTTPS {
<mask> go func() {
<mask> time.Sleep(time.Second) // TODO: could not find a way to reliably know that data was fully sent to client by https server, so we wait a bit to l... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/control_tls.go |
config.httpsServer.cond.L.Unlock() | <mask> httpsServer.cond.Broadcast()
<mask> if httpsServer.server != nil {
<mask> httpsServer.server.Shutdown(context.TODO())
<mask> }
<mask> httpsServer.cond.L.Unlock()
<mask> }()
<mask> }
<mask> }
<mask>
<mask> func verifyCertChain(data *tlsConfigStatus, certChain string, serverName strin... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/control_tls.go |
if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && config.httpsServer.server != nil { | <mask> http.Redirect(w, r, "/install.html", http.StatusSeeOther) // should not be cacheable
<mask> return
<mask> }
<mask> // enforce https?
<mask> if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && httpsServer.server != nil {
<mask> // yes, and we want ho... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/helpers.go |
<mask> "github.com/gobuffalo/packr"
<mask> )
<mask>
<mask> var httpServer *http.Server
<mask> var httpsServer struct {
<mask> server *http.Server
<mask> cond *sync.Cond // reacts to config.TLS.Enabled, PortHTTPS, CertificateChain and PrivateKey
<mask> sync.Mutex // protects config.TLS
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go | |
config.httpsServer.cond = sync.NewCond(&config.httpsServer.Mutex) | <mask> http.Handle("/install.html", preInstallHandler(http.FileServer(box)))
<mask> registerInstallHandlers()
<mask> }
<mask>
<mask> httpsServer.cond = sync.NewCond(&httpsServer.Mutex)
<mask>
<mask> // for https, we have a separate goroutine loop
<mask> go httpServerLoop()
<mask>
<mask> // this lo... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go |
for !config.httpsServer.shutdown { | <mask> // for https, we have a separate goroutine loop
<mask> go httpServerLoop()
<mask>
<mask> // this loop is used as an ability to change listening host and/or port
<mask> for !httpsServer.shutdown {
<mask> printHTTPAddresses("http")
<mask>
<mask> // we need to have new instance, because after Shut... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go |
for !config.httpsServer.shutdown {
config.httpsServer.cond.L.Lock() | <mask> select {}
<mask> }
<mask>
<mask> func httpServerLoop() {
<mask> for !httpsServer.shutdown {
<mask> httpsServer.cond.L.Lock()
<mask> // this mechanism doesn't let us through until all conditions are met
<mask> for config.TLS.Enabled == false ||
<mask> config.TLS.PortHTTPS == 0 ||
<mask> c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go |
config.httpsServer.cond.Wait() | <mask> for config.TLS.Enabled == false ||
<mask> config.TLS.PortHTTPS == 0 ||
<mask> config.TLS.PrivateKey == "" ||
<mask> config.TLS.CertificateChain == "" { // sleep until necessary data is supplied
<mask> httpsServer.cond.Wait()
<mask> }
<mask> address := net.JoinHostPort(config.BindHost, st... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go |
config.httpsServer.cond.L.Unlock() | <mask> if err != nil {
<mask> cleanupAlways()
<mask> log.Fatal(err)
<mask> }
<mask> httpsServer.cond.L.Unlock()
<mask>
<mask> // prepare HTTPS server
<mask> httpsServer.server = &http.Server{
<mask> Addr: address,
<mask> TLSConfig: &tls.Config{
</s> * move "httpsServer" to "config" </s... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go |
config.httpsServer.server = &http.Server{ | <mask> }
<mask> httpsServer.cond.L.Unlock()
<mask>
<mask> // prepare HTTPS server
<mask> httpsServer.server = &http.Server{
<mask> Addr: address,
<mask> TLSConfig: &tls.Config{
<mask> Certificates: []tls.Certificate{cert},
<mask> MinVersion: tls.VersionTLS12,
<mask> },
</s> * move... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go |
err = config.httpsServer.server.ListenAndServeTLS("", "") | <mask> },
<mask> }
<mask>
<mask> printHTTPAddresses("https")
<mask> err = httpsServer.server.ListenAndServeTLS("", "")
<mask> if err != http.ErrServerClosed {
<mask> cleanupAlways()
<mask> log.Fatal(err)
<mask> }
<mask> }
</s> * move "httpsServer" to "config" </s> remove httpsServer.co... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go |
config.httpsServer.shutdown = true
if config.httpsServer.server != nil {
config.httpsServer.server.Shutdown(context.TODO()) | <mask> }
<mask>
<mask> // Stop HTTP server, possibly waiting for all active connections to be closed
<mask> func stopHTTPServer() {
<mask> httpsServer.shutdown = true
<mask> if httpsServer.server != nil {
<mask> httpsServer.server.Shutdown(context.TODO())
<mask> }
<mask> httpServer.Shutdown(context.TODO... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2780ace63e6950f7d685a499a20d36216416963b | home/home.go |
const rcConfFilename = "etc/rc.conf" | <mask> return aghos.HaveAdminRights()
<mask> }
<mask>
<mask> func ifaceHasStaticIP(ifaceName string) (ok bool, err error) {
<mask> const filename = "/etc/rc.conf"
<mask>
<mask> return aghos.FileWalker(interfaceName(ifaceName).rcConfStaticConfig).Walk(filename)
<mask> }
<mask>
<mask> // rcConfStaticConfi... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_freebsd.go |
walker := aghos.FileWalker(interfaceName(ifaceName).rcConfStaticConfig)
return walker.Walk(aghos.RootDirFS(), rcConfFilename) | <mask>
<mask> func ifaceHasStaticIP(ifaceName string) (ok bool, err error) {
<mask> const filename = "/etc/rc.conf"
<mask>
<mask> return aghos.FileWalker(interfaceName(ifaceName).rcConfStaticConfig).Walk(filename)
<mask> }
<mask>
<mask> // rcConfStaticConfig checks if the interface is configured by /etc/rc... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_freebsd.go |
for _, pair := range [...]struct { | <mask> // is not the most desirable behavior.
<mask>
<mask> iface := interfaceName(ifaceName)
<mask>
<mask> for _, pair := range []struct {
<mask> aghos.FileWalker
<mask> filename string
<mask> }{{
<mask> FileWalker: iface.dhcpcdStaticConfig,
<mask> filename: "/etc/dhcpcd.conf",
</s> Pull req... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_linux.go |
filename: "etc/dhcpcd.conf", | <mask> aghos.FileWalker
<mask> filename string
<mask> }{{
<mask> FileWalker: iface.dhcpcdStaticConfig,
<mask> filename: "/etc/dhcpcd.conf",
<mask> }, {
<mask> FileWalker: iface.ifacesStaticConfig,
<mask> filename: "/etc/network/interfaces",
<mask> }} {
<mask> has, err = pair.Walk(pair.fil... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_linux.go |
filename: "etc/network/interfaces", | <mask> FileWalker: iface.dhcpcdStaticConfig,
<mask> filename: "/etc/dhcpcd.conf",
<mask> }, {
<mask> FileWalker: iface.ifacesStaticConfig,
<mask> filename: "/etc/network/interfaces",
<mask> }} {
<mask> has, err = pair.Walk(pair.filename)
<mask> if err != nil {
<mask> return false, err
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_linux.go |
has, err = pair.Walk(aghos.RootDirFS(), pair.filename) | <mask> }, {
<mask> FileWalker: iface.ifacesStaticConfig,
<mask> filename: "/etc/network/interfaces",
<mask> }} {
<mask> has, err = pair.Walk(pair.filename)
<mask> if err != nil {
<mask> return false, err
<mask> }
<mask>
<mask> if has {
</s> Pull request: 2499 merge rewrites vol.1
Merge i... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_linux.go |
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> const nl = "\n"
<mask>
<mask> func TestDHCPCDStaticConfig(t *testing.T) {
<mask> const iface interfaceName = `wlan0`
<mask>
<mask> testCases := []struct {
<mask> name string
</s> Pull... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_linux_test.go | |
filename := fmt.Sprintf("etc/hostname.%s", ifaceName) | <mask> return aghos.HaveAdminRights()
<mask> }
<mask>
<mask> func ifaceHasStaticIP(ifaceName string) (ok bool, err error) {
<mask> filename := fmt.Sprintf("/etc/hostname.%s", ifaceName)
<mask>
<mask> return aghos.FileWalker(hostnameIfStaticConfig).Walk(filename)
<mask> }
<mask>
<mask> // hostnameIfStati... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_openbsd.go |
return aghos.FileWalker(hostnameIfStaticConfig).Walk(aghos.RootDirFS(), filename) | <mask>
<mask> func ifaceHasStaticIP(ifaceName string) (ok bool, err error) {
<mask> filename := fmt.Sprintf("/etc/hostname.%s", ifaceName)
<mask>
<mask> return aghos.FileWalker(hostnameIfStaticConfig).Walk(filename)
<mask> }
<mask>
<mask> // hostnameIfStaticConfig checks if the interface is configured by
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_openbsd.go |
"github.com/AdguardTeam/AdGuardHome/internal/aghtest" | <mask> "net"
<mask> "testing"
<mask>
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_test.go |
func TestMain(m *testing.M) {
aghtest.DiscardLogOutput(m)
}
| <mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> func TestGetValidNetInterfacesForWeb(t *testing.T) {
<mask> ifaces, err := GetValidNetInterfacesForWeb()
<mask> require.NoErrorf(t, err, "cannot get net interfaces: %s", err)
<mask> require.NotE... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghnet/net_test.go |
"io/fs" | <mask>
<mask> import (
<mask> "fmt"
<mask> "io"
<mask> "os"
<mask> "path/filepath"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghio"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/stringutil"
<mask> )
</s> Pull request: 2499 merge rewrites vol.1
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
// should be valid for fs.Glob. If cont is false, the walking terminates. Each
// opened file is also limited for reading to MaxWalkedFileSize. | <mask>
<mask> // FileWalker is the signature of a function called for files in the file tree.
<mask> // As opposed to filepath.Walk it only walk the files (not directories) matching
<mask> // the provided pattern and those returned by function itself. All patterns
<mask> // should be valid for filepath.Glob. If... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
// TODO(e.burkov, a.garipov): Move into another package like aghfs. | <mask> // the provided pattern and those returned by function itself. All patterns
<mask> // should be valid for filepath.Glob. If cont is false, the walking terminates.
<mask> // Each opened file is also limited for reading to MaxWalkedFileSize.
<mask> //
<mask> // TODO(e.burkov): Consider moving to the separa... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
// checkFile tries to open and process a single file located on sourcePath in
// the specified fsys. The path is skipped if it's a directory.
func checkFile(
fsys fs.FS,
c FileWalker,
sourcePath string,
) (patterns []string, cont bool, err error) {
var f fs.File
f, err = fsys.Open(sourcePath) | <mask> // MaxWalkedFileSize is the maximum length of the file that FileWalker can
<mask> // check.
<mask> const MaxWalkedFileSize = 1024 * 1024
<mask>
<mask> // checkFile tries to open and process a single file located on sourcePath.
<mask> func checkFile(c FileWalker, sourcePath string) (patterns []string, cont... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
if errors.Is(err, fs.ErrNotExist) {
// Ignore non-existing files since this may only happen when the
// file was removed after filepath.Glob matched it. | <mask> func checkFile(c FileWalker, sourcePath string) (patterns []string, cont bool, err error) {
<mask> var f *os.File
<mask> f, err = os.Open(sourcePath)
<mask> if err != nil {
<mask> if errors.Is(err, os.ErrNotExist) {
<mask> // Ignore non-existing files since this may only happen
<mask> // when t... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
var fi fs.FileInfo
if fi, err = f.Stat(); err != nil {
return nil, true, err
}
if fi.IsDir() {
// Skip the directories.
return nil, true, nil
}
| <mask> defer func() { err = errors.WithDeferred(err, f.Close()) }()
<mask>
<mask> var r io.Reader
<mask> // Ignore the error since LimitReader function returns error only if passed
<mask> // limit value is less than zero, but the constant used.
<mask> //
<mask> // TODO(e.burkov): Make variable.
<mask> ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
// Ignore the error since LimitReader function returns error only if passed
// limit value is less than zero, but the constant used. | <mask> }
<mask> defer func() { err = errors.WithDeferred(err, f.Close()) }()
<mask>
<mask> var r io.Reader
<mask> // Ignore the error since LimitReader function returns error only if
<mask> // passed limit value is less than zero, but the constant used.
<mask> //
<mask> // TODO(e.burkov): Make variable... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
// handlePatterns parses the patterns in fsys and ignores duplicates using
// srcSet. srcSet must be non-nil.
func handlePatterns(
fsys fs.FS,
srcSet *stringutil.Set,
patterns ...string,
) (sub []string, err error) { | <mask>
<mask> return c(r)
<mask> }
<mask>
<mask> // handlePatterns parses the patterns and ignores duplicates using srcSet.
<mask> // srcSet must be non-nil.
<mask> func handlePatterns(srcSet *stringutil.Set, patterns ...string) (sub []string, err error) {
<mask> sub = make([]string, 0, len(patterns))
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
matches, err = fs.Glob(fsys, p) | <mask> func handlePatterns(srcSet *stringutil.Set, patterns ...string) (sub []string, err error) {
<mask> sub = make([]string, 0, len(patterns))
<mask> for _, p := range patterns {
<mask> var matches []string
<mask> matches, err = filepath.Glob(p)
<mask> if err != nil {
<mask> // Enrich error with the... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
// Walk starts walking the files in fsys defined by patterns from initial.
// It only returns true if fw signed to stop walking.
func (fw FileWalker) Walk(fsys fs.FS, initial ...string) (ok bool, err error) {
// The slice of sources keeps the order in which the files are walked since
// srcSet.Values() returns string... | <mask>
<mask> return sub, nil
<mask> }
<mask>
<mask> // Walk starts walking the files defined by initPattern. It only returns true
<mask> // if c signed to stop walking.
<mask> func (c FileWalker) Walk(initPattern string) (ok bool, err error) {
<mask> // The slice of sources keeps the order in which the fi... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
src, err = handlePatterns(fsys, srcSet, initial...) | <mask> // The slice of sources keeps the order in which the files are walked
<mask> // since srcSet.Values() returns strings in undefined order.
<mask> srcSet := stringutil.NewSet()
<mask> var src []string
<mask> src, err = handlePatterns(srcSet, initPattern)
<mask> if err != nil {
<mask> return false, e... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
patterns, cont, err = checkFile(fsys, fw, src[i]) | <mask> for i := 0; i < len(src); i++ {
<mask> var patterns []string
<mask> var cont bool
<mask> filename = src[i]
<mask> patterns, cont, err = checkFile(c, src[i])
<mask> if err != nil {
<mask> return false, err
<mask> }
<mask>
<mask> if !cont {
</s> Pull request: 2499 merge rewrites vol.1... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
subsrc, err = handlePatterns(fsys, srcSet, patterns...) | <mask> return true, nil
<mask> }
<mask>
<mask> var subsrc []string
<mask> subsrc, err = handlePatterns(srcSet, patterns...)
<mask> if err != nil {
<mask> return false, err
<mask> }
<mask>
<mask> src = append(src, subsrc...)
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguar... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker.go |
"path" | <mask> import (
<mask> "bufio"
<mask> "io"
<mask> "io/fs"
<mask> "os"
<mask> "path/filepath"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
</s> Pull request: 2499 merge rewrites vol.1
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker_test.go |
"testing/fstest" | <mask> "path"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker_test.go |
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> // testFSDir maps entries' names to entries which should either be a testFSDir
<mask> // or byte slice.
<mask> type testFSDir map[string]interface{}
<mask>
<mask> // testFSGen is used to generate... | [
"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/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker_test.go | |
makeFileWalker := func(_ string) (fw FileWalker) { | <mask>
<mask> func TestFileWalker_Walk(t *testing.T) {
<mask> const attribute = `000`
<mask>
<mask> makeFileWalker := func(dirName string) (fw FileWalker) {
<mask> return func(r io.Reader) (patterns []string, cont bool, err error) {
<mask> s := bufio.NewScanner(r)
<mask> for s.Scan() {
<mask> l... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/filewalker_test.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.