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
//go:embed build
<mask> // Embed the prebuilt client here since we strive to keep .go files inside the <mask> // internal directory and the embed package is unable to embed files located <mask> // outside of the same or underlying directory. <mask> <mask> //go:embed build2 <mask> var clientBuildFS embed.FS <mask> <mask> func ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
main_next.go
<mask> 'content': <mask> 'application/json': <mask> 'schema': <mask> '$ref': '#/components/schemas/LanguageSettings' <mask> '/install/get_addresses_beta': <mask> 'get': <mask> 'tags': <mask> - 'install' <mask> 'operationId': 'installGe...
[ "keep", "keep", "keep", "keep", "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/54a141abdeca00005a75f4af141645520b3f6b52
openapi/openapi.yaml
<mask> 'content': <mask> 'application/json': <mask> 'schema': <mask> '$ref': '#/components/schemas/AddressesInfo' <mask> '/install/check_config_beta': <mask> 'post': <mask> 'tags': <mask> - 'install' <mask> 'operationId': 'installCheck...
[ "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/54a141abdeca00005a75f4af141645520b3f6b52
openapi/openapi.yaml
<mask> '$ref': '#/components/schemas/CheckConfigResponse' <mask> '400': <mask> 'description': > <mask> Failed to parse JSON or cannot listen on the specified address. <mask> '/install/configure_beta': <mask> 'post': <mask> 'tags': <mask> - 'install...
[ "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/54a141abdeca00005a75f4af141645520b3f6b52
openapi/openapi.yaml
<mask> 'items': <mask> 'type': 'string' <mask> 'mtu': <mask> 'type': 'integer' <mask> 'AddressInfoBeta': <mask> 'type': 'object' <mask> 'description': 'Port information' <mask> 'required': <mask> - 'ip' <mask> - 'port' <mask> 'pr...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "k...
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
openapi/openapi.yaml
<mask> 'web_port': <mask> 'type': 'integer' <mask> 'format': 'uint16' <mask> 'example': 80 <mask> 'AddressesInfoBeta': <mask> 'type': 'object' <mask> 'description': 'AdGuard Home addresses configuration' <mask> 'required': <mask> - 'dns_port' <...
[ "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/54a141abdeca00005a75f4af141645520b3f6b52
openapi/openapi.yaml
<mask> - 'id' <mask> - 'name' <mask> - 'rules' <mask> 'type': 'object' <mask> 'CheckConfigRequestBeta': <mask> 'type': 'object' <mask> 'description': 'Configuration to be checked' <mask> 'properties': <mask> 'dns': <mask> '$ref': '#/components/sc...
[ "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/54a141abdeca00005a75f4af141645520b3f6b52
openapi/openapi.yaml
<mask> '$ref': '#/components/schemas/CheckConfigRequestInfo' <mask> 'set_static_ip': <mask> 'type': 'boolean' <mask> 'example': false <mask> 'CheckConfigRequestInfoBeta': <mask> 'type': 'object' <mask> 'properties': <mask> 'ip': <mask> 'ty...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
openapi/openapi.yaml
<mask> 'error': <mask> 'type': 'string' <mask> 'default': '' <mask> 'description': 'Error text. Set if static=error' <mask> 'InitialConfigurationBeta': <mask> 'type': 'object' <mask> 'description': > <mask> AdGuard Home initial configuration for the ...
[ "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/54a141abdeca00005a75f4af141645520b3f6b52
openapi/openapi.yaml
<mask> then <mask> make VERBOSE="$verbose" js-lint js-test <mask> fi <mask> <mask> if [ "$( git diff --cached --name-only -- 'client2/*.js' 'client2/*.ts' 'client2/*.tsx' )" ] <mask> then <mask> make VERBOSE="$verbose" js-beta-lint js-beta-test <mask> fi <mask> <mask> if [ "$( git diff --cached --name-onl...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
scripts/hooks/pre-commit
// Set the filter ID log.Printf("Seting ID=%d for filter %s", NextFilterId, filter.URL) filter.ID = NextFilterId NextFilterId++
<mask> for i := range config.Filters { <mask> <mask> filter := &config.Filters[i] // otherwise we will be operating on a copy <mask> <mask> log.Printf("Seting ID=%d for filter %s", i, filter.URL) <mask> filter.ID = i + 1 // start with ID=1 <mask> <mask> // Forcibly update the filter <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
app.go
<mask> package main <mask> <mask> import ( <mask> "bytes" <mask> "gopkg.in/yaml.v2" <mask> "io/ioutil" <mask> "log" <mask> "os" <mask> "path/filepath" <mask> "regexp" </s> Fix review comments: NextFilterId collisions </s> remove func (d *Dnsfilter) parseEtcHosts(input string, filterListID uint32) boo...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
config.go
"gopkg.in/yaml.v2"
<mask> "regexp" <mask> "sync" <mask> "text/template" <mask> "time" <mask> ) <mask> <mask> // Current schema version. We compare it with the value from <mask> // the configuration file and perform necessary upgrade operations if needed <mask> const SchemaVersion = 1 </s> Fix review comments: NextFilterId ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
config.go
// User filter ID is always 0 const UserFilterId = 0
<mask> const FiltersDir = "filters" <mask> <mask> // Just a counter that we use for incrementing the filter ID <mask> var NextFilterId = time.Now().Unix() <mask> <mask> // configuration is loaded from YAML </s> Fix review comments: NextFilterId collisions </s> remove var NextFilterId int </s> add var NextFilt...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
config.go
var NextFilterId = time.Now().Unix()
<mask> // Directory where we'll store all downloaded filters contents <mask> const FiltersDir = "filters" <mask> <mask> // Just a counter that we use for incrementing the filter ID <mask> var NextFilterId int <mask> <mask> // configuration is loaded from YAML <mask> type configuration struct { <mask> // Con...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
config.go
ID int64 `yaml:"-"`
<mask> sync.RWMutex `yaml:"-"` <mask> } <mask> <mask> type coreDnsFilter struct { <mask> ID int `yaml:"-"` <mask> Path string `yaml:"-"` <mask> } <mask> <mask> type coreDNSConfig struct { <mask> binaryFile string </s> Fix review comments: NextFilterId collisions </s> remove ID uint32 ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
config.go
ID int64 `json:"id" yaml:"id"` // auto-assigned when filter is added (see NextFilterId)
<mask> UpstreamDNS []string `yaml:"upstream_dns"` <mask> } <mask> <mask> type filter struct { <mask> ID int `json:"id" yaml:"id"` // auto-assigned when filter is added (see NextFilterId) <mask> URL string `json:"url"` <mask> Name string `json:"name" yaml:"name"` <m...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
config.go
// User filter always has constant ID=0 ID: UserFilterId,
<mask> contents = append(contents, '\n') <mask> } <mask> <mask> userFilter := filter{ <mask> // User filter always has ID=0 <mask> ID: 0, <mask> contents: contents, <mask> Enabled: true, <mask> } <mask> <mask> return userFilter </s> Fix review comments: NextFilterId collisions </s> re...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
config.go
corednsplugin "github.com/AdguardTeam/AdGuardHome/coredns_plugin"
<mask> "strconv" <mask> "strings" <mask> "time" <mask> <mask> coreDnsPlugin "github.com/AdguardTeam/AdGuardHome/coredns_plugin" <mask> "github.com/miekg/dns" <mask> "gopkg.in/asaskevich/govalidator.v4" <mask> ) <mask> <mask> const updatePeriod = time.Minute * 30 </s> Fix review comments: NextFilterId...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
control.go
corednsplugin.Reload <- true
<mask> // ------------------- <mask> // coredns run control <mask> // ------------------- <mask> func tellCoreDNSToReload() { <mask> coreDnsPlugin.Reload <- true <mask> } <mask> <mask> func writeAllConfigsAndReloadCoreDNS() error { <mask> err := writeAllConfigs() <mask> if err != nil { </s> Fix review co...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
control.go
return filepath.Join(config.ourBinaryDir, config.ourDataDir, FiltersDir, strconv.FormatInt(filter.ID, 10)+".txt")
<mask> } <mask> <mask> // Path to the filter contents <mask> func (filter *filter) getFilterFilePath() string { <mask> return filepath.Join(config.ourBinaryDir, config.ourDataDir, FiltersDir, strconv.Itoa(filter.ID)+".txt") <mask> } <mask> <mask> // ------------ <mask> // safebrowsing <mask> // -----------...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
control.go
http.HandleFunc("/control/querylog", optionalAuth(ensureGET(corednsplugin.HandleQueryLog)))
<mask> func registerControlHandlers() { <mask> http.HandleFunc("/control/status", optionalAuth(ensureGET(handleStatus))) <mask> http.HandleFunc("/control/enable_protection", optionalAuth(ensurePOST(handleProtectionEnable))) <mask> http.HandleFunc("/control/disable_protection", optionalAuth(ensurePOST(handleProte...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
control.go
http.HandleFunc("/control/stats_top", optionalAuth(ensureGET(corednsplugin.HandleStatsTop))) http.HandleFunc("/control/stats", optionalAuth(ensureGET(corednsplugin.HandleStats))) http.HandleFunc("/control/stats_history", optionalAuth(ensureGET(corednsplugin.HandleStatsHistory))) http.HandleFunc("/control/stats_rese...
<mask> http.HandleFunc("/control/querylog_enable", optionalAuth(ensurePOST(handleQueryLogEnable))) <mask> http.HandleFunc("/control/querylog_disable", optionalAuth(ensurePOST(handleQueryLogDisable))) <mask> http.HandleFunc("/control/set_upstream_dns", optionalAuth(ensurePOST(handleSetUpstreamDNS))) <mask> http....
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
control.go
ID int64
<mask> lookupCache = map[string]cacheEntry{} <mask> ) <mask> <mask> type plugFilter struct { <mask> ID uint32 <mask> Path string <mask> } <mask> <mask> type plugSettings struct { <mask> SafeBrowsingBlockHost string </s> Fix review comments: NextFilterId collisions </s> remove ID int `yaml:"...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
coredns_plugin/coredns_plugin.go
filterId, err := strconv.ParseInt(c.Val(), 10, 64)
<mask> if !c.NextArg() { <mask> return nil, c.ArgErr() <mask> } <mask> <mask> filterId, err := strconv.Atoi(c.Val()) <mask> if err != nil { <mask> return nil, c.ArgErr() <mask> } <mask> if !c.NextArg() { <mask> return nil, c.ArgErr() </s> Fix review comments: NextFilte...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
coredns_plugin/coredns_plugin.go
ID: filterId,
<mask> filterPath := c.Val() <mask> <mask> // Initialize filter and add it to the list <mask> p.settings.Filters = append(p.settings.Filters, plugFilter{ <mask> ID: uint32(filterId), <mask> Path: filterPath, <mask> }) <mask> } <mask> } <mask> } </s> Fix review comments: Nex...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
coredns_plugin/coredns_plugin.go
listID int64
<mask> isWhitelist bool <mask> isImportant bool <mask> <mask> // user-supplied data <mask> listID uint32 <mask> <mask> // suffix matching <mask> isSuffix bool <mask> suffix string <mask> </s> Fix review comments: NextFilterId collisions </s> remove FilterID uint32 `json:",omitempty"` // Filter...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
dnsfilter/dnsfilter.go
FilterID int64 `json:",omitempty"` // Filter ID the rule belongs to
<mask> IsFiltered bool `json:",omitempty"` // True if the host name is filtered <mask> Reason Reason `json:",omitempty"` // Reason for blocking / unblocking <mask> Rule string `json:",omitempty"` // Original rule text <mask> Ip net.IP `json:",omitempty"` // Not nil only in the case of a host...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
dnsfilter/dnsfilter.go
func (d *Dnsfilter) AddRule(input string, filterListID int64) error {
<mask> // Adding rule and matching against the rules <mask> // <mask> <mask> // AddRule adds a rule, checking if it is a valid rule first and if it wasn't added already <mask> func (d *Dnsfilter) AddRule(input string, filterListID uint32) error { <mask> input = strings.TrimSpace(input) <mask> d.storageMutex.R...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
dnsfilter/dnsfilter.go
func (d *Dnsfilter) parseEtcHosts(input string, filterListID int64) bool {
<mask> return nil <mask> } <mask> <mask> // Parses the hosts-syntax rules. Returns false if the input string is not of hosts-syntax. <mask> func (d *Dnsfilter) parseEtcHosts(input string, filterListID uint32) bool { <mask> // Strip the trailing comment <mask> ruleText := input <mask> if pos := strings.Inde...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54bdacdde282a4b9b7dde55df7ed4aeda3df375d
dnsfilter/dnsfilter.go
<mask> "strings" <mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghio" <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> // systemResolvers...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghnet/systemresolvers_windows.go
<mask> if err != nil { <mask> return nil, fmt.Errorf("getting the command's stdout pipe: %w", err) <mask> } <mask> <mask> var stdoutLimited io.Reader <mask> stdoutLimited, err = aghio.LimitReader(stdout, aghos.MaxCmdOutputSize) <mask> if err != nil { <mask> return nil, fmt.Errorf("limiting stdout read...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghnet/systemresolvers_windows.go
s := bufio.NewScanner(stdout)
<mask> if err != nil { <mask> return nil, fmt.Errorf("start command executing: %w", err) <mask> } <mask> <mask> s := bufio.NewScanner(stdoutLimited) <mask> addrs = scanAddrs(s) <mask> <mask> err = cmd.Wait() <mask> if err != nil { <mask> return nil, fmt.Errorf("executing the command: %w", err) </...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghnet/systemresolvers_windows.go
"bufio"
<mask> <mask> import ( <mask> "fmt" <mask> "io" <mask> "os/exec" <mask> "path" <mask> "runtime" </s> Pull request: 3457 fix service reload Merge in DNS/adguard-home from 3457-darwin-svc-reload to master Closes #3457. Squashed commit of the following: commit e3d6fbccf8373194360b6480e2d702ccd0ec7107 Aut...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os.go
"io"
<mask> "bufio" <mask> "fmt" <mask> "os/exec" <mask> "path" <mask> "runtime" <mask> "strconv" <mask> "strings" <mask> </s> Pull request: 3457 fix service reload Merge in DNS/adguard-home from 3457-darwin-svc-reload to master Closes #3457. Squashed commit of the following: commit e3d6fbccf8373194360b...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os.go
"path"
<mask> "bufio" <mask> "fmt" <mask> "io" <mask> "os/exec" <mask> "runtime" <mask> "strconv" <mask> "strings" <mask> <mask> "github.com/AdguardTeam/golibs/log" </s> Pull request: 3457 fix service reload Merge in DNS/adguard-home from 3457-darwin-svc-reload to master Closes #3457. Squashed commit of ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os.go
"strconv" "strings" "github.com/AdguardTeam/golibs/log"
<mask> import ( <mask> "fmt" <mask> "os/exec" <mask> "runtime" <mask> "syscall" <mask> ) <mask> <mask> // UnsupportedError is returned by functions and methods when a particular <mask> // operation Op cannot be performed on the current OS. <mask> type UnsupportedError struct { </s> Pull request: 3457 fi...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os.go
<mask> func HaveAdminRights() (bool, error) { <mask> return haveAdminRights() <mask> } <mask> <mask> // SendProcessSignal sends signal to a process. <mask> func SendProcessSignal(pid int, sig syscall.Signal) error { <mask> return sendProcessSignal(pid, sig) <mask> } <mask> <mask> // MaxCmdOutputSize is th...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os.go
<mask> func haveAdminRights() (bool, error) { <mask> return os.Getuid() == 0, nil <mask> } <mask> <mask> func sendProcessSignal(pid int, sig syscall.Signal) error { <mask> return syscall.Kill(pid, sig) <mask> } <mask> <mask> func isOpenWrt() (ok bool) { <mask> return false <mask> } </s> Pull request: 3...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os_bsd.go
<mask> func haveAdminRights() (bool, error) { <mask> return os.Getuid() == 0, nil <mask> } <mask> <mask> func sendProcessSignal(pid int, sig syscall.Signal) error { <mask> return syscall.Kill(pid, sig) <mask> } <mask> <mask> func isOpenWrt() (ok bool) { <mask> return false <mask> } </s> Pull request: 3...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os_freebsd.go
<mask> // requires returning an error. <mask> return os.Getuid() == 0, nil <mask> } <mask> <mask> func sendProcessSignal(pid int, sig syscall.Signal) error { <mask> return syscall.Kill(pid, sig) <mask> } <mask> <mask> func isOpenWrt() (ok bool) { <mask> var err error <mask> ok, err = FileWalker(func(r...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os_linux.go
<mask> <mask> package aghos <mask> <mask> import ( <mask> "syscall" <mask> <mask> "golang.org/x/sys/windows" <mask> ) <mask> <mask> func setRlimit(val uint64) (err error) { <mask> return Unsupported("setrlimit") </s> Pull request: 3457 fix service reload Merge in DNS/adguard-home from 3457-darwin-sv...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os_windows.go
<mask> } <mask> return true, nil <mask> } <mask> <mask> func sendProcessSignal(pid int, sig syscall.Signal) error { <mask> return Unsupported("kill") <mask> } <mask> <mask> func isOpenWrt() (ok bool) { <mask> return false <mask> } </s> Pull request: 3457 fix service reload Merge in DNS/adguard-home f...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/aghos/os_windows.go
var pid int
<mask> } <mask> <mask> pidfile := fmt.Sprintf("/var/run/%s.pid", serviceName) <mask> data, err := os.ReadFile(pidfile) <mask> if errors.Is(err, os.ErrNotExist) { <mask> if pid, err = aghos.PIDByCommand(serviceName, os.Getpid()); err != nil { <mask> log.Error("finding AdGuardHome process: %s", err) </s...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
if pid, err = aghos.PIDByCommand(serviceName, os.Getpid()); err != nil { log.Error("finding AdGuardHome process: %s", err)
<mask> <mask> pidfile := fmt.Sprintf("/var/run/%s.pid", serviceName) <mask> data, err := os.ReadFile(pidfile) <mask> if errors.Is(err, os.ErrNotExist) { <mask> var code int <mask> var psdata string <mask> code, psdata, err = aghos.RunCommand("ps", "-C", serviceName, "-o", "pid=") <mask> if err != ni...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
<mask> log.Error("finding AdGuardHome process: code: %d, error: %s", code, err) <mask> <mask> return <mask> } <mask> <mask> data = []byte(psdata) <mask> } else if err != nil { <mask> log.Error("reading pid file %s: %s", pidfile, err) <mask> <mask> return <mask> } </s> Pull request: 3457 f...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
<mask> } else if err != nil { <mask> log.Error("reading pid file %s: %s", pidfile, err) <mask> <mask> return <mask> } <mask> <mask> parts := strings.SplitN(string(data), "\n", 2) <mask> if len(parts) == 0 { <mask> log.Error("Can't read PID file %s: bad value", pidfile) <mask> return </s> Pull r...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
} else { parts := strings.SplitN(string(data), "\n", 2) if len(parts) == 0 { log.Error("can't read pid file %s: bad value", pidfile) return } if pid, err = strconv.Atoi(strings.TrimSpace(parts[0])); err != nil { log.Error("can't read pid file %s: %s", pidfile, err) return }
<mask> <mask> return <mask> } <mask> <mask> parts := strings.SplitN(string(data), "\n", 2) <mask> if len(parts) == 0 { <mask> log.Error("Can't read PID file %s: bad value", pidfile) <mask> return <mask> } <mask> <mask> pid, err := strconv.Atoi(strings.TrimSpace(parts[0])) <mask> if err != nil...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
var proc *os.Process if proc, err = os.FindProcess(pid); err != nil { log.Error("can't send signal to pid %d: %s", pid, err)
<mask> log.Error("Can't read PID file %s: bad value", pidfile) <mask> return <mask> } <mask> <mask> pid, err := strconv.Atoi(strings.TrimSpace(parts[0])) <mask> if err != nil { <mask> log.Error("Can't read PID file %s: %s", pidfile, err) <mask> return <mask> } <mask> err = aghos.SendProcessSigna...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
if err = proc.Signal(syscall.SIGHUP); err != nil { log.Error("Can't send signal to pid %d: %s", pid, err)
<mask> if err != nil { <mask> log.Error("Can't read PID file %s: %s", pidfile, err) <mask> return <mask> } <mask> err = aghos.SendProcessSignal(pid, syscall.SIGHUP) <mask> if err != nil { <mask> log.Error("Can't send signal to PID %d: %s", pid, err) <mask> return <mask> } <mask> log.Debug("Sent ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
log.Debug("sent signal to PID %d", pid)
<mask> if err != nil { <mask> log.Error("Can't send signal to PID %d: %s", pid, err) <mask> return <mask> } <mask> log.Debug("Sent signal to PID %d", pid) <mask> } <mask> <mask> // handleServiceControlAction one of the possible control actions: <mask> // install -- installs a service/daemon <mask> // ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
command_args="-p ${pidfile} -f -r {{.WorkingDirectory}}/{{.Name}}"
<mask> {{.Name}}_env="IS_DAEMON=1" <mask> {{.Name}}_user="root" <mask> pidfile="/var/run/${name}.pid" <mask> command="/usr/sbin/daemon" <mask> command_args="-P ${pidfile} -f -r {{.WorkingDirectory}}/{{.Name}}" <mask> run_rc_command "$1" <mask> ` </s> Pull request: 3457 fix service reload Merge in DNS/adguard-h...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/550b1798a169d07139f8f079bc5c83271a181f7f
internal/home/service.go
github.com/AdguardTeam/dnsproxy v0.23.5
<mask> <mask> go 1.13 <mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.23.4 <mask> github.com/AdguardTeam/golibs v0.3.0 <mask> github.com/AdguardTeam/urlfilter v0.7.0 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/etcd-io/bbolt v1.3.3 <mask> github.com/go-test/deep v1....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5556e34e7e82a9f15d3bb67c6a01e6ac220c0a7d
go.mod
github.com/miekg/dns v1.1.26
<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/miekg/dns v1.1.19 <mask> github...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5556e34e7e82a9f15d3bb67c6a01e6ac220c0a7d
go.mod
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 golang.org/x/sys v0.0.0-20191224085550-c709ea063b76
<mask> github.com/miekg/dns v1.1.19 <mask> github.com/sparrc/go-ping v0.0.0-20181106165434-ef3ab45e41b0 <mask> github.com/stretchr/testify v1.4.0 <mask> go.etcd.io/bbolt v1.3.3 // indirect <mask> golang.org/x/crypto v0.0.0-20191001170739-f9e2070545dc <mask> golang.org/x/net v0.0.0-20191002035440-2ec189313ef...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5556e34e7e82a9f15d3bb67c6a01e6ac220c0a7d
go.mod
github.com/AdguardTeam/dnsproxy v0.23.5 h1:allfgFioe0e6QvSqKVeS0ZQAo9jHR+2XdNuT1isK7og= github.com/AdguardTeam/dnsproxy v0.23.5/go.mod h1:2qy8rpdfBzKgMPxkHmPdaNK4XZJ322v4KtVGI8s8Bn0=
<mask> github.com/AdguardTeam/dnsproxy v0.23.4 h1:23o1mOdORJrkuMgRHXVa1oO0zRf+lZ1K6l9HxdLr+Ig= <mask> github.com/AdguardTeam/dnsproxy v0.23.4/go.mod h1:2qy8rpdfBzKgMPxkHmPdaNK4XZJ322v4KtVGI8s8Bn0= <mask> github.com/AdguardTeam/golibs v0.2.4 h1:GUssokegKxKF13K67Pgl0ZGwqHjNN6X7sep5ik6ORdY= <mask> github.com/AdguardTe...
[ "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5556e34e7e82a9f15d3bb67c6a01e6ac220c0a7d
go.sum
github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
<mask> github.com/miekg/dns v1.1.19 h1:0ymbfaLG1/utH2+BydNiF+dx1jSEmdr/nylOtkGHZZg= <mask> github.com/miekg/dns v1.1.19/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= <mask> github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= <mask> githu...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5556e34e7e82a9f15d3bb67c6a01e6ac220c0a7d
go.sum
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 h1:aJ0ex187qoXrJHPo8ZasVTASQB7llQP6YeNzgDALPRk= golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= <mask> golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= <mask> golang.org/x/crypto v0.0.0-20191001170739-f9e2070545dc h1:KyTYo8xkh/2WdbFLUy...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5556e34e7e82a9f15d3bb67c6a01e6ac220c0a7d
go.sum
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= <mask> golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 h1:2mqDk8w/o6UmeUCu5Qiq2y7iMf6anbx+YA8d1JFoFrs= <mask> golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5556e34e7e82a9f15d3bb67c6a01e6ac220c0a7d
go.sum
golang.org/x/sys v0.0.0-20191224085550-c709ea063b76 h1:Dho5nD6R3PcW2SH1or8vS0dszDaXRxIw55lBX7XiE5g= golang.org/x/sys v0.0.0-20191224085550-c709ea063b76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20191002091554-b397fe3ad8ed h1:5TJcLJn2a55mJjzYk0yOoqN8X1OdvBDUnaZaKKyQtkY= <mask> golang.org/x/sys v0.0.0-20191002091554-b397fe3ad8ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9Dt...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5556e34e7e82a9f15d3bb67c6a01e6ac220c0a7d
go.sum
"local_ptr_title": "Private reverse DNS servers",
<mask> "load_balancing": "Load-balancing", <mask> "load_balancing_desc": "Query one upstream server at a time. AdGuard Home will use the weighted random algorithm to pick the server so that the fastest server is used more often.", <mask> "bootstrap_dns": "Bootstrap DNS servers", <mask> "bootstrap_dn...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/__locales/en.json
"use_private_ptr_resolvers_title": "Use private rDNS resolvers", "use_private_ptr_resolvers_desc": "Perform reverse DNS lookups for locally-served addresses using these upstream servers. If disabled, AdGuard Home responds with NXDOMAIN to all such PTR requests except for clients known from DHCP, /etc/hosts, and...
<mask> "local_ptr_desc": "The DNS servers that AdGuard Home uses for local PTR queries. These servers are used to resolve the hostnames of clients with private IP addresses, for example \"192.168.12.34\", using rDNS. If not set, AdGuard Home uses the default DNS resolvers of your OS.", <mask> "local_ptr_place...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/__locales/en.json
<div className="col-12 mb-2">
<mask> <div className="col-12"> <mask> <Examples /> <mask> <hr /> <mask> </div> <mask> <div className="col-12 mb-4"> <mask> <label <mask> className="form__label form__label--with-desc" <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/components/Settings/Dns/Upstream/Form.js
<div className="col-12">
<mask> </div> <mask> <div className="col-12"> <mask> <hr /> <mask> </div> <mask> <div className="col-12 mb-4"> <mask> <label <mask> className="form__label form__label--with-desc" <mask> htmlFo...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/components/Settings/Dns/Upstream/Form.js
<div className="mt-4"> <Field name="use_private_ptr_resolvers" type="checkbox" component={CheckboxField} placeholder={t('use_private_ptr_resolvers_title')} subtitle...
<mask> placeholder={t('local_ptr_placeholder')} <mask> disabled={processingSetConfig} <mask> normalizeOnBlur={removeEmptyLines} <mask> /> <mask> </div> <mask> <div className="col-12 mb-4"> <mask> <...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/components/Settings/Dns/Upstream/Form.js
use_private_ptr_resolvers,
<mask> resolve_clients, <mask> local_ptr_upstreams, <mask> } = useSelector((state) => state.dnsConfig, shallowEqual); <mask> <mask> const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file); <mask> <mask> const handleSubmit = (values) => { <mask> c...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/components/Settings/Dns/Upstream/index.js
use_private_ptr_resolvers,
<mask> upstream_dns, <mask> upstream_mode, <mask> resolve_clients, <mask> local_ptr_upstreams, <mask> } = values; <mask> <mask> const dnsConfig = { <mask> bootstrap_dns, </s> Pull request: 3184 disable private ptr Merge in DNS/adguar...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/components/Settings/Dns/Upstream/index.js
use_private_ptr_resolvers,
<mask> resolve_clients, <mask> local_ptr_upstreams, <mask> ...(upstream_dns_file ? null : { upstream_dns }), <mask> }; <mask> <mask> dispatch(setDnsConfig(dnsConfig)); <mask> }; <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-ho...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/components/Settings/Dns/Upstream/index.js
use_private_ptr_resolvers,
<mask> resolve_clients, <mask> local_ptr_upstreams, <mask> }} <mask> onSubmit={handleSubmit} <mask> /> <mask> </div> <mask> </div> <mask> </Card>; </s> Pull request: 3184 disable priv...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
client/src/components/Settings/Dns/Upstream/index.js
func (s *Server) accessListJSON() (j accessListJSON) { s.serverLock.RLock() defer s.serverLock.RUnlock() return accessListJSON{ AllowedClients: aghstrings.CloneSlice(s.conf.AllowedClients), DisallowedClients: aghstrings.CloneSlice(s.conf.DisallowedClients), BlockedHosts: aghstrings.CloneSlice(s.conf.B...
<mask> DisallowedClients []string `json:"disallowed_clients"` <mask> BlockedHosts []string `json:"blocked_hosts"` <mask> } <mask> <mask> func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { <mask> s.RLock() <mask> j := accessListJSON{ <mask> AllowedClients: s.conf.AllowedCl...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/access.go
} func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) { j := s.accessListJSON()
<mask> AllowedClients: s.conf.AllowedClients, <mask> DisallowedClients: s.conf.DisallowedClients, <mask> BlockedHosts: s.conf.BlockedHosts, <mask> } <mask> s.RUnlock() <mask> <mask> w.Header().Set("Content-Type", "application/json") <mask> err := json.NewEncoder(w).Encode(j) <mask> if err !...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/access.go
defer log.Debug("Access: updated lists: %d, %d, %d", len(j.AllowedClients), len(j.DisallowedClients), len(j.BlockedHosts)) defer s.conf.ConfigModified() s.serverLock.Lock() defer s.serverLock.Unlock()
<mask> <mask> return <mask> } <mask> <mask> s.Lock() <mask> s.conf.AllowedClients = j.AllowedClients <mask> s.conf.DisallowedClients = j.DisallowedClients <mask> s.conf.BlockedHosts = j.BlockedHosts <mask> s.access = a <mask> s.Unlock() </s> Pull request: 3184 disable private ptr Merge in DNS/adg...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/access.go
<mask> s.conf.AllowedClients = j.AllowedClients <mask> s.conf.DisallowedClients = j.DisallowedClients <mask> s.conf.BlockedHosts = j.BlockedHosts <mask> s.access = a <mask> s.Unlock() <mask> s.conf.ConfigModified() <mask> <mask> log.Debug("Access: updated lists: %d, %d, %d", <mask> len(j.AllowedClien...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/access.go
// UsePrivateRDNS defines if the PTR requests for unknown addresses from // locally-served networks should be resolved via private PTR resolvers. UsePrivateRDNS bool
<mask> <mask> // ResolveClients signals if the RDNS should resolve clients' addresses. <mask> ResolveClients bool <mask> <mask> // LocalPTRResolvers is a slice of addresses to be used as upstreams for <mask> // resolving PTR queries for local addresses. <mask> LocalPTRResolvers []string <mask> } </s> Pu...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/config.go
s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> } <mask> <mask> if !s.subnetDetector.IsLocallyServedNetwork(ip) { <mask> return resultCodeSuccess <mask> } <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the following: commit b78ac2eeb1b408586808ddb...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
if s.conf.UsePrivateRDNS { if err := s.localResolvers.Resolve(d); err != nil { ctx.err = err
<mask> if !s.subnetDetector.IsLocallyServedNetwork(ip) { <mask> return resultCodeSuccess <mask> } <mask> <mask> err := s.localResolvers.Resolve(d) <mask> if err != nil { <mask> ctx.err = err <mask> <mask> return resultCodeError <mask> } <mask> <mask> if d.Res == nil { </s> Pull request: 3184...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
return resultCodeError }
<mask> err := s.localResolvers.Resolve(d) <mask> if err != nil { <mask> ctx.err = err <mask> <mask> return resultCodeError <mask> } <mask> <mask> if d.Res == nil { <mask> d.Res = s.genNXDomain(d.Req) <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
// Do not even put into query log.
<mask> if d.Res == nil { <mask> d.Res = s.genNXDomain(d.Req) <mask> <mask> return resultCodeFinish <mask> } <mask> <mask> return resultCodeSuccess <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit of the fol...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> if d.Res != nil { <mask> return resultCodeSuccess // response is already set - nothing to do <mask> } <mask> <mask> s.RLock() <mask> // Synchronize access to s.dnsFilter so it won't be suddenly uninitialized while in use. <mask> // This could happen after proxy server has been stopped, but its wor...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
<mask> // A better approach is for proxy.Stop() to wait until all its workers exit, <mask> // but this would require the Upstream interface to have Close() function <mask> // (to prevent from hanging while waiting for unresponsive DNS server to respond). <mask> <mask> var err error <mask> ctx.protectionEn...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
if !ctx.protectionEnabled { return resultCodeSuccess
<mask> // (to prevent from hanging while waiting for unresponsive DNS server to respond). <mask> <mask> var err error <mask> ctx.protectionEnabled = s.conf.ProtectionEnabled && s.dnsFilter != nil <mask> if ctx.protectionEnabled { <mask> if ctx.setts == nil { <mask> ctx.setts = s.getClientRequestFilter...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
<mask> ctx.setts = s.getClientRequestFilteringSettings(ctx) <mask> } <mask> ctx.result, err = s.filterDNSRequest(ctx) <mask> } <mask> s.RUnlock() <mask> <mask> if err != nil { <mask> ctx.err = err <mask> <mask> return resultCodeError </s> Pull request: 3184 disable private ptr Merge in DNS/a...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
if ctx.setts == nil { ctx.setts = s.getClientRequestFilteringSettings(ctx) } var err error ctx.result, err = s.filterDNSRequest(ctx)
<mask> if !ctx.protectionEnabled { <mask> return resultCodeSuccess <mask> } <mask> <mask> if err != nil { <mask> ctx.err = err <mask> <mask> return resultCodeError </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed commit ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns.go
func TestServer_ProcessRestrictLocal(t *testing.T) {
<mask> }) <mask> } <mask> } <mask> <mask> func TestLocalRestriction(t *testing.T) { <mask> ups := &aghtest.TestUpstream{ <mask> Reverse: map[string][]string{ <mask> "251.252.253.254.in-addr.arpa.": {"host1.example.net."}, <mask> "1.1.168.192.in-addr.arpa.": {"some.local-client."}, <mask> },...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dns_test.go
<mask> internalProxy *proxy.Proxy <mask> <mask> isRunning bool <mask> <mask> sync.RWMutex <mask> conf ServerConfig <mask> } <mask> <mask> // defaultLocalDomainSuffix is the default suffix used to detect internal hosts <mask> // when no suffix is provided. </s> Pull request: 3184 disable private ptr M...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
// serverLock protects Server. serverLock sync.RWMutex
<mask> isRunning bool <mask> <mask> conf ServerConfig <mask> } <mask> <mask> // defaultLocalDomainSuffix is the default suffix used to detect internal hosts <mask> // when no suffix is provided. <mask> // </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
// Close gracefully closes the server. It is safe for concurrent use. // // TODO(e.burkov): A better approach would be making Stop method waiting for all // its workers finished. But it would require the upstream.Upstream to have the // Close method to prevent from hanging while waiting for unresponsive server to // ...
<mask> <mask> return s <mask> } <mask> <mask> // Close - close object <mask> func (s *Server) Close() { <mask> s.Lock() <mask> s.dnsFilter = nil <mask> s.stats = nil <mask> s.queryLog = nil </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
s.serverLock.Lock() defer s.serverLock.Unlock()
<mask> } <mask> <mask> // Close - close object <mask> func (s *Server) Close() { <mask> s.Lock() <mask> s.dnsFilter = nil <mask> s.stats = nil <mask> s.queryLog = nil <mask> s.dnsProxy = nil <mask> </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
if err := s.ipset.Close(); err != nil {
<mask> s.stats = nil <mask> s.queryLog = nil <mask> s.dnsProxy = nil <mask> <mask> err := s.ipset.Close() <mask> if err != nil { <mask> log.Error("closing ipset: %s", err) <mask> } <mask> <mask> s.Unlock() <mask> } </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-d...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
<mask> err := s.ipset.Close() <mask> if err != nil { <mask> log.Error("closing ipset: %s", err) <mask> } <mask> <mask> s.Unlock() <mask> } <mask> <mask> // WriteDiskConfig - write configuration <mask> func (s *Server) WriteDiskConfig(c *FilteringConfig) { <mask> s.RLock() </s> Pull request: 3184 di...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> } <mask> <mask> // WriteDiskConfig - write configuration <mask> func (s *Server) WriteDiskConfig(c *FilteringConfig) { <mask> s.RLock() <mask> sc := s.conf.FilteringConfig <mask> *c = sc <mask> c.RatelimitWhitelist = aghstrings.CloneSlice(sc.RatelimitWhitelist) <mask> c.BootstrapDNS = aghstrings.C...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
<mask> c.AllowedClients = aghstrings.CloneSlice(sc.AllowedClients) <mask> c.DisallowedClients = aghstrings.CloneSlice(sc.DisallowedClients) <mask> c.BlockedHosts = aghstrings.CloneSlice(sc.BlockedHosts) <mask> c.UpstreamDNS = aghstrings.CloneSlice(sc.UpstreamDNS) <mask> s.RUnlock() <mask> } <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients, resolvePTR bool) { s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> s.RUnlock() <mask> } <mask> <mask> // RDNSSettings returns the copy of actual RDNS configuration. <mask> func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) { <mask> s.RLock() <mask> defer s.RUnlock() <mask> <mask> return aghstrings.CloneSlice(s.conf.LocalPTRResolvers...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients, s.conf.UsePrivateRDNS
<mask> func (s *Server) RDNSSettings() (localPTRResolvers []string, resolveClients bool) { <mask> s.RLock() <mask> defer s.RUnlock() <mask> <mask> return aghstrings.CloneSlice(s.conf.LocalPTRResolvers), s.conf.ResolveClients <mask> } <mask> <mask> // Resolve - get IP addresses by host name from an upstream...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> // No request/response filtering is performed. <mask> // Query log and Stats are not updated. <mask> // This method may be called before Start(). <mask> func (s *Server) Resolve(host string) ([]net.IPAddr, error) { <mask> s.RLock() <mask> defer s.RUnlock() <mask> return s.internalProxy.LookupIPAddr(hos...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
// ResolvesPrivatePTR returns true if the RDNSExchanger is able to // resolve PTR requests for locally-served addresses. ResolvesPrivatePTR() (ok bool)
<mask> // Exchange tries to resolve the ip in a suitable way, e.g. either as <mask> // local or as external. <mask> Exchange(ip net.IP) (host string, err error) <mask> } <mask> <mask> const ( <mask> // rDNSEmptyAnswerErr is returned by Exchange method when the answer <mask> // section of respond is empty....
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
s.serverLock.RLock() defer s.serverLock.RUnlock()
<mask> ) <mask> <mask> // Exchange implements the RDNSExchanger interface for *Server. <mask> func (s *Server) Exchange(ip net.IP) (host string, err error) { <mask> s.RLock() <mask> defer s.RUnlock() <mask> <mask> if !s.conf.ResolveClients { <mask> return "", nil <mask> } <mask> </s> Pull request: ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
var resolver *proxy.Proxy = s.localResolvers if !s.subnetDetector.IsLocallyServedNetwork(ip) { resolver = s.internalProxy } else if !s.conf.UsePrivateRDNS { return "", nil }
<mask> return "", nil <mask> } <mask> <mask> arpa := dns.Fqdn(aghnet.ReverseAddr(ip)) <mask> req := &dns.Msg{ <mask> MsgHdr: dns.MsgHdr{ <mask> Id: dns.Id(), </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to master Updates #3184. Squashed ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
err = resolver.Resolve(ctx)
<mask> StartTime: time.Now(), <mask> } <mask> <mask> var resp *dns.Msg <mask> if s.subnetDetector.IsLocallyServedNetwork(ip) { <mask> err = s.localResolvers.Resolve(ctx) <mask> } else { <mask> err = s.internalProxy.Resolve(ctx) <mask> } <mask> if err != nil { <mask> return "", err <mask> } ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go
// ResolvesPrivatePTR implements the RDNSExchanger interface for *Server. func (s *Server) ResolvesPrivatePTR() (ok bool) { s.serverLock.RLock() defer s.serverLock.RUnlock() return s.conf.UsePrivateRDNS }
<mask> return strings.TrimSuffix(ptr.Ptr, "."), nil <mask> } <mask> <mask> // Start starts the DNS server. <mask> func (s *Server) Start() error { <mask> s.serverLock.Lock() <mask> defer s.serverLock.Unlock() </s> Pull request: 3184 disable private ptr Merge in DNS/adguard-home from 3184-disable-ptr to mas...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/557bbcbf37a8f1d6092a51064e329ecc50bebb9d
internal/dnsforward/dnsforward.go