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 |
|---|---|---|---|---|
// TODO(a.garipov): Remove this after we're finished with the client
// hostname validations in the DHCP server code. | <mask> hostToIP = make(hostToIPTable, len(ll))
<mask> ipToHost = netutil.NewIPMap(len(ll))
<mask>
<mask> for _, l := range ll {
<mask> // TODO(a.garipov): Remove this after we're finished
<mask> // with the client hostname validations in the DHCP
<mask> // server code.
<mask> err = netutil.Va... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/dnsforward/dns.go |
// TODO(a.garipov): Move everything related to DHCP local domain to the DHCP
// server. | <mask> }
<mask>
<mask> reqHost := strings.ToLower(q.Name)
<mask> host := strings.TrimSuffix(reqHost, s.localDomainSuffix)
<mask> if host == reqHost {
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> d := dctx.proxyCtx
</s> Pull request: home: mv local domain name to dhcp setts
Closes #3367.
... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/dnsforward/dns.go |
"runtime" | <mask> "net"
<mask> "os"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask> "github.com/AdguardTeam/golibs/testutil"
</s> Pull request: home: mv local domain name to dhcp setts
Closes #3367.
Squashed commit of the following:
commit e2cabcac2d91af24b... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/clients_test.go |
"github.com/AdguardTeam/golibs/testutil" | <mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
<mask>
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
</s> Pull request: home: mv local domain name to dhcp setts
Closes #3367.
Squashed commit of the fol... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/clients_test.go |
// TODO(a.garipov): Properly decouple the DHCP server from the client
// storage.
if runtime.GOOS == "windows" {
t.Skip("skipping dhcp test on windows")
}
| <mask> assert.True(t, ok)
<mask> })
<mask>
<mask> t.Run("complicated", func(t *testing.T) {
<mask> var err error
<mask>
<mask> ip := net.IP{1, 2, 3, 4}
<mask>
</s> Pull request: home: mv local domain name to dhcp setts
Closes #3367.
Squashed commit of the following:
commit e2cabcac2d91af24b9e5f4a... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/clients_test.go |
config := &dhcpd.ServerConfig{ | <mask>
<mask> ip := net.IP{1, 2, 3, 4}
<mask>
<mask> // First, init a DHCP server with a single static lease.
<mask> config := dhcpd.ServerConfig{
<mask> Enabled: true,
<mask> DBFilePath: "leases.db",
<mask> Conf4: dhcpd.V4ServerConf{
<mask> Enabled: true,
<mask> GatewayIP: net... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/clients_test.go |
testutil.CleanupAndRequireSuccess(t, func() (err error) {
return os.Remove("leases.db")
}) | <mask> }
<mask>
<mask> clients.dhcpServer, err = dhcpd.Create(config)
<mask> require.NoError(t, err)
<mask> // TODO(e.burkov): leases.db isn't created on Windows so removing it
<mask> // causes an error. Split the test to make it run properly on different
<mask> // operating systems.
<mask> t.C... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/clients_test.go |
DHCP *dhcpd.ServerConfig `yaml:"dhcp"` | <mask> Filters []filter `yaml:"filters"`
<mask> WhitelistFilters []filter `yaml:"whitelist_filters"`
<mask> UserRules []string `yaml:"user_rules"`
<mask>
<mask> DHCP dhcpd.ServerConfig `yaml:"dhcp"`
<mask>
<mask> // Clients contains the YAML representations of the persistent clients.
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/config.go |
<mask>
<mask> // UpstreamTimeout is the timeout for querying upstream servers.
<mask> UpstreamTimeout timeutil.Duration `yaml:"upstream_timeout"`
<mask>
<mask> // LocalDomainName is the domain name used for known internal hosts.
<mask> // For example, a machine called "myhost" can be addressed as
<mask> /... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/config.go | |
<mask> },
<mask> FilteringEnabled: true, // whether or not use filter lists
<mask> FiltersUpdateIntervalHours: 24,
<mask> UpstreamTimeout: timeutil.Duration{Duration: dnsforward.DefaultTimeout},
<mask> LocalDomainName: "lan",
<mask> ResolveClients: true,
<m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/config.go | |
DHCP: &dhcpd.ServerConfig{
LocalDomainName: "lan",
}, | <mask> PortHTTPS: defaultPortHTTPS,
<mask> PortDNSOverTLS: defaultPortTLS, // needs to be passed through to dnsproxy
<mask> PortDNSOverQUIC: defaultPortQUIC,
<mask> },
<mask> logSettings: logSettings{
<mask> LogCompress: false,
<mask> LogLocalTime: false,
<mask> LogMaxBackups: 0,
</s> P... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/config.go |
c := &dhcpd.ServerConfig{}
Context.dhcpServer.WriteDiskConfig(c) | <mask> dns.UsePrivateRDNS = s.RDNSSettings()
<mask> }
<mask>
<mask> if Context.dhcpServer != nil {
<mask> c := dhcpd.ServerConfig{}
<mask> Context.dhcpServer.WriteDiskConfig(&c)
<mask> config.DHCP = c
<mask> }
<mask>
<mask> config.Clients = Context.clients.forConfig()
<mask>
</s> Pull reques... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/config.go |
LocalDomain: config.DHCP.LocalDomainName, | <mask> Stats: Context.stats,
<mask> QueryLog: Context.queryLog,
<mask> SubnetDetector: Context.subnetDetector,
<mask> Anonymizer: anonymizer,
<mask> LocalDomain: config.DNS.LocalDomainName,
<mask> }
<mask> if Context.dhcpServer != nil {
<mask> p.DHCPServer = Context.dhcpServe... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/dns.go |
const currentSchemaVersion = 13 | <mask> yaml "gopkg.in/yaml.v2"
<mask> )
<mask>
<mask> // currentSchemaVersion is the current schema version.
<mask> const currentSchemaVersion = 12
<mask>
<mask> // These aliases are provided for convenience.
<mask> type (
<mask> any = interface{}
<mask> yarr = []any
</s> Pull request: home: mv local d... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/upgrade.go |
upgradeSchema12to13, | <mask> upgradeSchema9to10,
<mask> upgradeSchema10to11,
<mask> upgradeSchema11to12,
<mask> }
<mask>
<mask> n := 0
<mask> for i, u := range upgrades {
<mask> if i >= oldVersion {
<mask> err = u(diskConf)
</s> Pull request: home: mv local domain name to dhcp setts
Closes #3367.
Squashed commit o... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/upgrade.go |
t.Fatalf("wrong type for bootstrap dns: %T", v) | <mask> case []string:
<mask> require.Len(t, v, 1)
<mask> require.Equal(t, "8.8.8.8:53", v[0])
<mask> default:
<mask> t.Fatalf("wrong type for bootsrap dns: %T", v)
<mask> }
<mask>
<mask> excludedEntries := []string{"bootstrap_dns"}
<mask> oldDNSConf := testDNSConf(2)
<mask> assertEqualExcept(t, o... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c | internal/home/upgrade_test.go |
handleServiceControlAction(args) | <mask> }
<mask> }()
<mask>
<mask> if args.serviceControlAction != "" {
<mask> handleServiceControlAction(args.serviceControlAction)
<mask> return
<mask> }
<mask>
<mask> // run the protection
<mask> run(args)
</s> service: installation and running of AGH as a service with CLI args </s> remove ar... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f | home/home.go |
opts options | <mask>
<mask> // Represents the program that will be launched by a service or daemon
<mask> type program struct {
<mask> }
<mask>
<mask> // Start should quickly start the program
<mask> func (p *program) Start(s service.Service) error {
<mask> // Start should not block. Do the actual work async.
</s> servic... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f | home/service.go |
args := p.opts
args.runningAsService = true | <mask>
<mask> // Start should quickly start the program
<mask> func (p *program) Start(s service.Service) error {
<mask> // Start should not block. Do the actual work async.
<mask> args := options{runningAsService: true}
<mask> go run(args)
<mask> return nil
<mask> }
<mask>
<mask> // Stop stops the prog... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f | home/service.go |
func handleServiceControlAction(opts options) {
action := opts.serviceControlAction | <mask> // restart - restarts the previously installed service
<mask> // run - this is a special command that is not supposed to be used directly
<mask> // it is specified when we register a service, and it indicates to the app
<mask> // that it is being run as a service/daemon.
<mask> func handleServiceControlActi... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f | home/service.go |
runOpts := opts
runOpts.serviceControlAction = "run" | <mask> if err != nil {
<mask> log.Fatal("Unable to find the path to the current directory")
<mask> }
<mask> svcConfig := &service.Config{
<mask> Name: serviceName,
<mask> DisplayName: serviceDisplayName,
<mask> Description: serviceDescription,
</s> service: installation and runn... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f | home/service.go |
Arguments: serialize(runOpts), | <mask> Name: serviceName,
<mask> DisplayName: serviceDisplayName,
<mask> Description: serviceDescription,
<mask> WorkingDirectory: pwd,
<mask> Arguments: []string{"-s", "run"},
<mask> }
<mask> configureService(svcConfig)
<mask> prg := &program{}
<mask> s, err := servi... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f | home/service.go |
prg := &program{runOpts} | <mask> WorkingDirectory: pwd,
<mask> Arguments: []string{"-s", "run"},
<mask> }
<mask> configureService(svcConfig)
<mask> prg := &program{}
<mask> s, err := service.New(prg, svcConfig)
<mask> if err != nil {
<mask> log.Fatal(err)
<mask> }
<mask>
</s> service: installation and running of A... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f | home/service.go |
github.com/AdguardTeam/golibs v0.4.5 | <mask> go 1.15
<mask>
<mask> require (
<mask> github.com/AdguardTeam/dnsproxy v0.35.5
<mask> github.com/AdguardTeam/golibs v0.4.4
<mask> github.com/AdguardTeam/urlfilter v0.14.4
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/ameshkov/dnscrypt/v2 v2.0.3
<mask> github.com/digineo/go-ipset/... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | go.mod |
github.com/AdguardTeam/golibs v0.4.5 h1:RRA9ZsmbJEN4OllAx0BcfvSbRBxxpWluJijBYmtp13U=
github.com/AdguardTeam/golibs v0.4.5/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= | <mask> github.com/AdguardTeam/golibs v0.4.4 h1:cM9UySQiYFW79zo5XRwnaIWVzfW4eNXmZktMrWbthpw=
<mask> github.com/AdguardTeam/golibs v0.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
<mask> github.com/Adg... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | go.sum |
"fmt" | <mask> package home
<mask>
<mask> import (
<mask> "errors"
<mask> "io/ioutil"
<mask> "net"
<mask> "os"
<mask> "path/filepath"
<mask> "sync"
</s> Pull request: 2954 wrong logs
Merge in DNS/adguard-home from 2954-wrong-logs to master
Closes #2954.
Squashed commit of the following:
commit 94c77a4dfcad... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | internal/home/config.go |
return nil, fmt.Errorf("couldn't read config file %s: %w", configFile, err) | <mask>
<mask> configFile := config.getConfigFilename()
<mask> d, err := ioutil.ReadFile(configFile)
<mask> if err != nil {
<mask> log.Error("Couldn't read config file %s: %s", configFile, err)
<mask> return nil, err
<mask> }
<mask> return d, nil
<mask> }
<mask>
<mask> // Saves configuration to the... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | internal/home/config.go |
log.Error("parsing configuration file: %s", err)
| <mask> }
<mask>
<mask> err = parseConfig()
<mask> if err != nil {
<mask> log.Error("Failed to parse configuration, exiting")
<mask> os.Exit(1)
<mask> }
<mask>
<mask> if args.checkConfig {
<mask> log.Info("Configuration file is OK")
</s> Pull request: 2954 wrong logs
Merge in DNS/adguard... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | internal/home/home.go |
log.Info("configuration file is ok")
| <mask> os.Exit(1)
<mask> }
<mask>
<mask> if args.checkConfig {
<mask> log.Info("Configuration file is OK")
<mask> os.Exit(0)
<mask> }
<mask> }
<mask>
<mask> Context.mux = http.NewServeMux()
</s> Pull request: 2954 wrong logs
Merge in DNS/adguard-home from 2954-wrong-logs to master
Closes... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | internal/home/home.go |
log.Debug("rdns: resolving %q: %s", ip, err) | <mask>
<mask> for ip := range r.ipCh {
<mask> host, err := r.exchanger.Exchange(ip)
<mask> if err != nil {
<mask> log.Error("rdns: resolving %q: %s", ip, err)
<mask>
<mask> continue
<mask> }
<mask>
<mask> if host == "" {
</s> Pull request: 2954 wrong logs
Merge in DNS/adguard-home from 295... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | internal/home/rdns.go |
ErrorLog: log.StdLog("web: plain", log.DEBUG), | <mask>
<mask> hostStr := web.conf.BindHost.String()
<mask> // we need to have new instance, because after Shutdown() the Server is not usable
<mask> web.httpServer = &http.Server{
<mask> ErrorLog: log.StdLog("web: http", log.DEBUG),
<mask> Addr: net.JoinHostPort(hostStr, strconv... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | internal/home/web.go |
ErrorLog: log.StdLog("web: plain", log.DEBUG), | <mask> }()
<mask>
<mask> if web.conf.BetaBindPort != 0 {
<mask> web.httpServerBeta = &http.Server{
<mask> ErrorLog: log.StdLog("web: http", log.DEBUG),
<mask> Addr: net.JoinHostPort(hostStr, strconv.Itoa(web.conf.BetaBindPort)),
<mask> Handler: withMiddlewares(... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892 | internal/home/web.go |
"bytes" | <mask>
<mask> import (
<mask> "fmt"
<mask> "io/ioutil"
<mask> "os"
<mask> "os/exec"
</s> Pull request: 2757 fix OpenWRT detection
Merge in DNS/adguard-home from 2757-openwrt to master
Updates #2757.
Squashed commit of the following:
commit 8e94e6a67ae702bd1b281b306555a4ce9ecc6391
Author: Eugene Burkov <... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359 | internal/util/helpers.go |
"path/filepath" | <mask> "fmt"
<mask> "io/ioutil"
<mask> "os"
<mask> "os/exec"
<mask> "runtime"
<mask> "strings"
<mask> )
<mask>
<mask> // ContainsString checks if string is in the slice of strings.
<mask> func ContainsString(strs []string, str string) bool {
</s> Pull request: 2757 fix OpenWRT detection
Merge in DNS/... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359 | internal/util/helpers.go |
// IsOpenWRT returns true if host OS is OpenWRT. | <mask> }
<mask> return strings.TrimSpace(s)
<mask> }
<mask>
<mask> // IsOpenWRT checks if OS is OpenWRT.
<mask> func IsOpenWRT() bool {
<mask> if runtime.GOOS != "linux" {
<mask> return false
<mask> }
<mask>
</s> Pull request: 2757 fix OpenWRT detection
Merge in DNS/adguard-home from 2757-openwrt to... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359 | internal/util/helpers.go |
const etcDir = "/etc"
// TODO(e.burkov): Take care of dealing with fs package after updating
// Go version to 1.16.
fileInfos, err := ioutil.ReadDir(etcDir) | <mask> if runtime.GOOS != "linux" {
<mask> return false
<mask> }
<mask>
<mask> body, err := ioutil.ReadFile("/etc/os-release")
<mask> if err != nil {
<mask> return false
<mask> }
<mask>
<mask> return strings.Contains(string(body), "OpenWrt")
</s> Pull request: 2757 fix OpenWRT detection
Merge in... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359 | internal/util/helpers.go |
// fNameSubstr is a part of a name of the desired file.
const fNameSubstr = "release"
osNameData := []byte("OpenWrt")
for _, fileInfo := range fileInfos {
if fileInfo.IsDir() {
continue
}
if !strings.Contains(fileInfo.Name(), fNameSubstr) {
continue
}
body, err := ioutil.ReadFile(filepath.Join(et... | <mask> if err != nil {
<mask> return false
<mask> }
<mask>
<mask> return strings.Contains(string(body), "OpenWrt")
<mask> }
</s> Pull request: 2757 fix OpenWRT detection
Merge in DNS/adguard-home from 2757-openwrt to master
Updates #2757.
Squashed commit of the following:
commit 8e94e6a67ae702bd1b281b3... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359 | internal/util/helpers.go |
"resolved": "http://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", | <mask> "dev": true
<mask> },
<mask> "html-webpack-plugin": {
<mask> "version": "3.2.0",
<mask> "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz",
<mask> "integrity": "sha1-sBq71yOsqqeze2r0SS69oD2d03s=",
<mask> "dev": true,
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846 | client/package-lock.json |
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", | <mask> }
<mask> },
<mask> "readable-stream": {
<mask> "version": "1.0.34",
<mask> "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
<mask> "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
<mask> "dev": true,
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846 | client/package-lock.json |
"resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", | <mask> "dev": true
<mask> },
<mask> "through": {
<mask> "version": "2.3.8",
<mask> "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
<mask> "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
<mask> "dev": true
<mask> },
<mask> "through2": {
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846 | client/package-lock.json |
<mask> "requires": {
<mask> "setimmediate": "^1.0.4"
<mask> }
<mask> },
<mask> "tiny-version-compare": {
<mask> "version": "0.9.1",
<mask> "resolved": "https://registry.npmjs.org/tiny-version-compare/-/tiny-version-compare-0.9.1.tgz",
<mask> "integrity": "sha512-kYi... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846 | client/package-lock.json | |
<mask> "redux": "^4.0.0",
<mask> "redux-actions": "^2.4.0",
<mask> "redux-thunk": "^2.3.0",
<mask> "svg-url-loader": "^2.3.2",
<mask> "tiny-version-compare": "^0.9.1",
<mask> "whatwg-fetch": "2.0.3"
<mask> },
<mask> "devDependencies": {
<mask> "autoprefixer": "^8.6.3",
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846 | client/package.json | |
<mask> import { combineReducers } from 'redux';
<mask> import { handleActions } from 'redux-actions';
<mask> import { loadingBarReducer } from 'react-redux-loading-bar';
<mask> import versionCompare from 'tiny-version-compare';
<mask> import nanoid from 'nanoid';
<mask>
<mask> import * as actions from '../actio... | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846 | client/src/reducers/index.js | |
import versionCompare from '../helpers/versionCompare'; | <mask> import { loadingBarReducer } from 'react-redux-loading-bar';
<mask> import nanoid from 'nanoid';
<mask>
<mask> import * as actions from '../actions';
<mask>
<mask> const settings = handleActions({
</s> Move tiny-version-compare module to helpers </s> remove import versionCompare from 'tiny-version-compa... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846 | client/src/reducers/index.js |
func httpCookie(req loginJSON) string { | <mask> hash := sha256.Sum256(d)
<mask> return hash[:]
<mask> }
<mask>
<mask> func handleLogin(w http.ResponseWriter, r *http.Request) {
<mask> req := loginJSON{}
<mask> err := json.NewDecoder(r.Body).Decode(&req)
<mask> if err != nil {
<mask> httpError(w, http.StatusBadRequest, "json decode: %s", err)
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7 | home/auth.go |
return "" | <mask> }
<mask>
<mask> u := config.auth.UserFind(req.Name, req.Password)
<mask> if len(u.Name) == 0 {
<mask> time.Sleep(1 * time.Second)
<mask> httpError(w, http.StatusBadRequest, "invalid login or password")
<mask> return
<mask> }
<mask>
<mask> sess := getSession(&u)
<mask>
<mask> now := tim... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7 | home/auth.go |
return fmt.Sprintf("session=%s; Path=/; HttpOnly; Expires=%s", hex.EncodeToString(sess), expstr)
}
func handleLogin(w http.ResponseWriter, r *http.Request) {
req := loginJSON{}
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil {
httpError(w, http.StatusBadRequest, "json decode: %s", err)
return
}
co... | <mask>
<mask> expireSess := uint32(now.Unix()) + expireTime*60*60
<mask> config.auth.storeSession(sess, expireSess)
<mask>
<mask> s := fmt.Sprintf("session=%s; Path=/; HttpOnly; Expires=%s", hex.EncodeToString(sess), expstr)
<mask> w.Header().Set("Set-Cookie", s)
<mask>
<mask> w.Header().Set("Cache-Cont... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7 | home/auth.go |
"net/http"
"net/url" | <mask> import (
<mask> "encoding/hex"
<mask> "os"
<mask> "path/filepath"
<mask> "testing"
<mask> "time"
</s> + auth: add more tests
* use directory "./agh-test" </s> remove os.MkdirAll(config.getDataDir(), 0755)
a := InitAuth(fn, users)
</s> add user := User{Name: "name"}
a.UserAdd(&user, "password") ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7 | home/auth_test.go |
func prepareTestDir() string {
const dir = "./agh-test"
_ = os.RemoveAll(dir)
_ = os.MkdirAll(dir, 0755)
return dir
} | <mask>
<mask> "github.com/stretchr/testify/assert"
<mask> )
<mask>
<mask> func TestAuth(t *testing.T) {
<mask> config.ourWorkingDir = "."
<mask> fn := filepath.Join(config.getDataDir(), "sessions.db")
<mask>
<mask> _ = os.RemoveAll(config.getDataDir())
<mask> defer func() { _ = os.RemoveAll(config.get... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7 | home/auth_test.go |
func TestAuth(t *testing.T) {
dir := prepareTestDir()
defer func() { _ = os.RemoveAll(dir) }()
fn := filepath.Join(dir, "sessions.db") | <mask> func TestAuth(t *testing.T) {
<mask> config.ourWorkingDir = "."
<mask> fn := filepath.Join(config.getDataDir(), "sessions.db")
<mask>
<mask> _ = os.RemoveAll(config.getDataDir())
<mask> defer func() { _ = os.RemoveAll(config.getDataDir()) }()
<mask>
<mask> users := []User{
<mask> User{Name: "na... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7 | home/auth_test.go |
a := InitAuth(fn, nil) | <mask> users := []User{
<mask> User{Name: "name", PasswordHash: "$2y$05$..vyzAECIhJPfaQiOK17IukcQnqEgKJHy0iETyYqxn3YXJl8yZuo2"},
<mask> }
<mask>
<mask> user := User{Name: "name"}
<mask> a.UserAdd(&user, "password")
<mask>
<mask> assert.True(t, a.CheckSession("notfound") == -1)
</s> + auth: add more te... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7 | home/auth_test.go |
user := User{Name: "name"}
a.UserAdd(&user, "password") | <mask> users := []User{
<mask> User{Name: "name", PasswordHash: "$2y$05$..vyzAECIhJPfaQiOK17IukcQnqEgKJHy0iETyYqxn3YXJl8yZuo2"},
<mask> }
<mask>
<mask> os.MkdirAll(config.getDataDir(), 0755)
<mask> a := InitAuth(fn, users)
<mask>
<mask> assert.True(t, a.CheckSession("notfound") == -1)
<mask> a.Remove... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7 | home/auth_test.go |
<mask> import React, { Component } from 'react';
<mask> import PropTypes from 'prop-types';
<mask> import { Trans, withTranslation } from 'react-i18next';
<mask> import classnames from 'classnames';
<mask> import Card from '../ui/Card';
<mask> import PageTitle from '../ui/PageTitle';
<mask> import Examples from ... | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Filters/CustomRules.js | |
import { COMMENT_LINE_DEFAULT_TOKEN } from '../../helpers/constants'; | <mask> import PageTitle from '../ui/PageTitle';
<mask> import Examples from './Examples';
<mask> import Check from './Check';
<mask> import { getTextareaCommentsHighlight, syncScroll } from '../../helpers/highlightTextareaComments';
<mask> import { COMMENT_LINE_DEFAULT_TOKEN, isFirefox } from '../../helpers/consta... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Filters/CustomRules.js |
<Card subtitle={t('custom_filter_rules_hint')}> | <mask>
<mask> return (
<mask> <>
<mask> <PageTitle title={t('custom_filtering_rules')} />
<mask> <Card
<mask> subtitle={t('custom_filter_rules_hint')}
<mask> >
<mask> <form onSubmit={this.handleSubmit}>
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Filters/CustomRules.js |
<div className="text-edit-container mb-4">
<textarea
className="form-control font-monospace text-input" | <mask> <Card
<mask> subtitle={t('custom_filter_rules_hint')}
<mask> >
<mask> <form onSubmit={this.handleSubmit}>
<mask> <div className={classnames('col-12 text-edit-container form-control--textarea-large', {
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Filters/CustomRules.js |
/> | <mask> })}
<mask> value={userRules}
<mask> onChange={this.handleChange}
<mask> onScroll={this.onScroll}
<mask> />
<mask> {getTextareaC... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Filters/CustomRules.js |
undefined, | <mask> />
<mask> {getTextareaCommentsHighlight(
<mask> this.ref,
<mask> userRules,
<mask> classnames({ 'form-control--textarea-large': isFirefox }),
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Filters/CustomRules.js |
<mask> import { renderRadioField, renderTextareaField, CheckboxField } from '../../../../helpers/form';
<mask> import {
<mask> DNS_REQUEST_OPTIONS,
<mask> FORM_NAME,
<mask> isFirefox,
<mask> UPSTREAM_CONFIGURATION_WIKI_LINK,
<mask> } from '../../../../helpers/constants';
<mask> import { testUpst... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Settings/Dns/Upstream/Form.js | |
<mask> meta: PropTypes.object,
<mask> normalizeOnBlur: PropTypes.func,
<mask> onScroll: PropTypes.func,
<mask> placeholder: PropTypes.string.isRequired,
<mask> subtitle: PropTypes.string.isRequired,
<mask> type: PropTypes.string.isRequired,
<mask> };
<mask>
<mask> const INPUT_FIELDS = ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Settings/Dns/Upstream/Form.js | |
<mask> type: PropTypes.string.isRequired,
<mask> };
<mask>
<mask> const INPUT_FIELDS = [
<mask> {
<mask> name: UPSTREAM_DNS_NAME,
<mask> type: 'text',
<mask> component: renderTextareaWithHighlightField,
<mask> className: classnames('form-control form-control--textarea f... | [
"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/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Settings/Dns/Upstream/Form.js | |
<div className="col-12 mb-4">
<div className="text-edit-container">
<Field
id={UPSTREAM_DNS_NAME}
name={UPSTREAM_DNS_NAME}
component={renderTextareaWithHighlightField}
type="te... | <mask> dns_providers
<mask> </Trans>
<mask> </label>
<mask> {INPUT_FIELDS.map(renderField)}
<mask> <div className="col-12">
<mask> <Examples />
<mask> <hr />
<mask> </div>
</s> Pull request #1273... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/Settings/Dns/Upstream/Form.js |
min-height: 240px;
overflow: hidden; | <mask> .text-edit-container {
<mask> position: relative;
<mask> height: 10rem;
<mask> }
<mask>
<mask> .text-input,
<mask> .text-output {
<mask> position: absolute;
</s> Pull request #1273: 3438 make highlighted inputs resizable
Merge in DNS/adguard-home from 3438-inputs-height to master
Squashed... | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/ui/texareaCommentsHighlight.css |
padding: 16px; | <mask> top: 0;
<mask> left: 0;
<mask> width: 100%;
<mask> height: 100%;
<mask> padding: 1rem;
<mask> background: transparent;
<mask> white-space: pre-wrap;
<mask> line-height: 1.5rem;
<mask> word-wrap: break-word;
<mask> font-size: var(--font-size-disable-autozoom);
</... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/ui/texareaCommentsHighlight.css |
line-height: 24px; | <mask> height: 100%;
<mask> padding: 1rem;
<mask> background: transparent;
<mask> white-space: pre-wrap;
<mask> line-height: 1.5rem;
<mask> word-wrap: break-word;
<mask> font-size: var(--font-size-disable-autozoom);
<mask> margin: 0;
<mask> }
<mask>
</s> Pull request #1273: 3... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/ui/texareaCommentsHighlight.css |
overscroll-behavior: none; | <mask> line-height: 1.5rem;
<mask> word-wrap: break-word;
<mask> font-size: var(--font-size-disable-autozoom);
<mask> margin: 0;
<mask> }
<mask>
<mask> .form--upstream .text-input,
<mask> .form--upstream .text-output {
<mask> width: 98%;
<mask> left: 1%;
<mask> }
<mask>
<mask> .te... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/ui/texareaCommentsHighlight.css |
position: relative; | <mask> overscroll-behavior: none;
<mask> }
<mask>
<mask> .text-input {
<mask> opacity: 1;
<mask> min-height: 240px;
<mask> }
<mask>
<mask> .text-output {
</s> Pull request #1273: 3438 make highlighted inputs resizable
Merge in DNS/adguard-home from 3438-inputs-height to master
Squashed commit ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/ui/texareaCommentsHighlight.css |
min-height: 240px; | <mask> }
<mask>
<mask> .text-input {
<mask> opacity: 1;
<mask> resize: none;
<mask> height: 10rem;
<mask> }
<mask>
<mask> .text-input--larger {
<mask> height: 11rem;
<mask> }
<mask>
<mask> .text-input--largest {
<mask> height: 16rem;
<mask> }
<mask>
<mask> .text-output {
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0 | client/src/components/ui/texareaCommentsHighlight.css |
ClientTags []string | <mask> SafeSearchEnabled bool
<mask> SafeBrowsingEnabled bool
<mask> ParentalEnabled bool
<mask> ServicesRules []ServiceEntry
<mask> }
<mask>
<mask> // Config allows you to configure DNS filtering with New() or just change variables directly.
<mask> type Config struct {
</s> + clients: support... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | dnsfilter/dnsfilter.go |
return d.matchHost(host, qtype, setts.ClientTags) | <mask> if !setts.FilteringEnabled {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> return d.matchHost(host, qtype)
<mask> }
<mask>
<mask> // CheckHost tries to match the host against filtering rules,
<mask> // then safebrowsing and parental if they are enabled
<mask> func (d *Dnsfilter) CheckHost(h... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | dnsfilter/dnsfilter.go |
result, err = d.matchHost(host, qtype, setts.ClientTags) | <mask> }
<mask>
<mask> // try filter lists first
<mask> if setts.FilteringEnabled {
<mask> result, err = d.matchHost(host, qtype)
<mask> if err != nil {
<mask> return result, err
<mask> }
<mask> if result.Reason.Matched() {
<mask> return result, nil
</s> + clients: support per-client tags <... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | dnsfilter/dnsfilter.go |
func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { | <mask> return nil
<mask> }
<mask>
<mask> // matchHost is a low-level way to check only if hostname is filtered by rules, skipping expensive safebrowsing and parental lookups
<mask> func (d *Dnsfilter) matchHost(host string, qtype uint16) (Result, error) {
<mask> d.engineLock.RLock()
<mask> defer d.engineLock... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | dnsfilter/dnsfilter.go |
frules, ok := d.filteringEngine.Match(host, ctags) | <mask> if d.filteringEngine == nil {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> frules, ok := d.filteringEngine.Match(host)
<mask> if !ok {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> log.Tracef("%d rules matched for host '%s'", len(frules), host)
</s> + clients: support per-client... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | dnsfilter/dnsfilter.go |
github.com/AdguardTeam/urlfilter v0.8.1 | <mask>
<mask> require (
<mask> github.com/AdguardTeam/dnsproxy v0.23.7
<mask> github.com/AdguardTeam/golibs v0.3.0
<mask> github.com/AdguardTeam/urlfilter v0.7.2
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/etcd-io/bbolt v1.3.3
<mask> github.com/go-test/deep v1.0.4 // indirect
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | go.mod |
github.com/AdguardTeam/urlfilter v0.8.1 h1:9YRQOR15DU7+k01PWAgc/Ay12jjxVqSi6P0+whFm0f4=
github.com/AdguardTeam/urlfilter v0.8.1/go.mod h1:GHXPzEG59ezyff22lXSQ7dicj1kFZBrH5kmZ6EvQzfk= | <mask> github.com/AdguardTeam/golibs v0.3.0/go.mod h1:R3M+mAg3nWG4X4Hsag5eef/TckHFH12ZYhK7AzJc8+U=
<mask> github.com/AdguardTeam/gomitmproxy v0.1.2/go.mod h1:Mrt/3EfiXIYY2aZ7KsLuCUJzUARD/fWJ119IfzOB13M=
<mask> github.com/AdguardTeam/urlfilter v0.7.0 h1:ffFLt4rA3GX8PJYGL3bGcT5bSxZlML5k6cKpSeN2UI8=
<mask> github.com/... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | go.sum |
"sort" | <mask> "os"
<mask> "os/exec"
<mask> "runtime"
<mask> "strings"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/dhcpd"
</s> + clients: support per-client tags </s> remove return d.matchHost(host, qtype)
</s> add return d.matchHost(host, qtype, setts.ClientTags) </s> remo... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
Tags []string | <mask> type Client struct {
<mask> IDs []string
<mask> Name string
<mask> UseOwnSettings bool // false: use global settings
<mask> FilteringEnabled bool
<mask> SafeSearchEnabled bool
<mask> SafeBrowsingEnabled bool
</s> + clients: support per-client tags | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
allTags map[string]bool
| <mask> ipHost map[string]*ClientHost // IP -> Hostname
<mask> lock sync.Mutex
<mask>
<mask> // dhcpServer is used for looking up clients IP addresses by MAC addresses
<mask> dhcpServer *dhcpd.Server
<mask>
<mask> testing bool // if TRUE, this object is used for internal tests
<mask> }
</s> + clients... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
clients.allTags = make(map[string]bool)
for _, t := range clientTags {
clients.allTags[t] = false
}
| <mask> clients.idIndex = make(map[string]*Client)
<mask> clients.ipHost = make(map[string]*ClientHost)
<mask> clients.dhcpServer = dhcpServer
<mask> clients.addFromConfig(objects)
<mask>
<mask> if !clients.testing {
</s> + clients: support per-client tags </s> remove return clients.findByIP(ip)
</s> add ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
Tags []string `yaml:"tags"` | <mask> type clientObject struct {
<mask> Name string `yaml:"name"`
<mask> IDs []string `yaml:"ids"`
<mask> UseGlobalSettings bool `yaml:"use_global_settings"`
<mask> FilteringEnabled bool `yaml:"filtering_enabled"`
<mask> ParentalEnabled bool `yaml:"paren... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
func (clients *clientsContainer) tagKnown(tag string) bool {
_, ok := clients.allTags[tag]
return ok
}
| <mask>
<mask> Upstreams []string `yaml:"upstreams"`
<mask> }
<mask>
<mask> func (clients *clientsContainer) addFromConfig(objects []clientObject) {
<mask> for _, cy := range objects {
<mask> cli := Client{
<mask> Name: cy.Name,
<mask> IDs: cy.IDs,
</s> + clients: sup... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
for _, t := range cy.Tags {
if !clients.tagKnown(t) {
log.Debug("Clients: skipping unknown tag '%s'", t)
continue
}
cli.Tags = append(cli.Tags, t)
}
sort.Strings(cli.Tags)
| <mask>
<mask> Upstreams: cy.Upstreams,
<mask> }
<mask> _, err := clients.Add(cli)
<mask> if err != nil {
<mask> log.Tracef("clientAdd: %s", err)
<mask> }
</s> + clients: support per-client tags </s> remove err := c.check()
</s> add err := clients.check(&c) </s> remove result, err = d.matchHo... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
cy.Tags = stringArrayDup(cli.Tags)
cy.IDs = stringArrayDup(cli.IDs)
cy.BlockedServices = stringArrayDup(cli.BlockedServices)
cy.Upstreams = stringArrayDup(cli.Upstreams) | <mask> SafeBrowsingEnabled: cli.SafeBrowsingEnabled,
<mask> UseGlobalBlockedServices: !cli.UseOwnBlockedServices,
<mask> }
<mask>
<mask> cy.IDs = make([]string, len(cli.IDs))
<mask> copy(cy.IDs, cli.IDs)
<mask>
<mask> cy.BlockedServices = make([]string, len(cli.BlockedServices))
<mask> c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
func stringArrayDup(a []string) []string {
a2 := make([]string, len(a))
copy(a2, a)
return a2
}
| <mask> return true
<mask> }
<mask>
<mask> // Find searches for a client by IP
<mask> func (clients *clientsContainer) Find(ip string) (Client, bool) {
<mask> clients.lock.Lock()
<mask> defer clients.lock.Unlock()
</s> + clients: support per-client tags </s> remove return clients.findByIP(ip)
</s> add c, ... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
c, ok := clients.findByIP(ip)
if !ok {
return Client{}, false
}
c.IDs = stringArrayDup(c.IDs)
c.Tags = stringArrayDup(c.Tags)
c.BlockedServices = stringArrayDup(c.BlockedServices)
c.Upstreams = stringArrayDup(c.Upstreams)
return c, true | <mask> func (clients *clientsContainer) Find(ip string) (Client, bool) {
<mask> clients.lock.Lock()
<mask> defer clients.lock.Unlock()
<mask>
<mask> return clients.findByIP(ip)
<mask> }
<mask>
<mask> func upstreamArrayCopy(a []upstream.Upstream) []upstream.Upstream {
<mask> a2 := make([]upstream.Upstream... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
func (clients *clientsContainer) check(c *Client) error { | <mask> return ClientHost{}, false
<mask> }
<mask>
<mask> // Check if Client object's fields are correct
<mask> func (c *Client) check() error {
<mask> if len(c.Name) == 0 {
<mask> return fmt.Errorf("Invalid Name")
<mask> }
<mask>
<mask> if len(c.IDs) == 0 {
</s> + clients: support per-client tags </s... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
for _, t := range c.Tags {
if !clients.tagKnown(t) {
return fmt.Errorf("Invalid tag: %s", t)
}
}
sort.Strings(c.Tags)
| <mask> }
<mask>
<mask> if len(c.Upstreams) != 0 {
<mask> err := dnsforward.ValidateUpstreams(c.Upstreams)
<mask> if err != nil {
<mask> return fmt.Errorf("Invalid upstream servers: %s", err)
</s> + clients: support per-client tags </s> remove result, err = d.matchHost(host, qtype)
</s> add result,... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
e := clients.check(&c) | <mask>
<mask> // Add a new client object
<mask> // Return true: success; false: client exists.
<mask> func (clients *clientsContainer) Add(c Client) (bool, error) {
<mask> e := c.check()
<mask> if e != nil {
<mask> return false, e
<mask> }
<mask>
<mask> clients.lock.Lock()
</s> + clients: support pe... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
err := clients.check(&c) | <mask> }
<mask>
<mask> // Update a client
<mask> func (clients *clientsContainer) Update(name string, c Client) error {
<mask> err := c.check()
<mask> if err != nil {
<mask> return err
<mask> }
<mask>
<mask> clients.lock.Lock()
</s> + clients: support per-client tags </s> remove e := c.check()
</s>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients.go |
Tags []string `json:"tags"` | <mask>
<mask> type clientJSON struct {
<mask> IDs []string `json:"ids"`
<mask> Name string `json:"name"`
<mask> UseGlobalSettings bool `json:"use_global_settings"`
<mask> FilteringEnabled bool `json:"filtering_enabled"`
<mask> ParentalEnabled bool `json... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients_http.go |
Tags []string `json:"supported_tags"` | <mask>
<mask> type clientListJSON struct {
<mask> Clients []clientJSON `json:"clients"`
<mask> AutoClients []clientHostJSON `json:"auto_clients"`
<mask> }
<mask>
<mask> // respond with information about configured clients
<mask> func (clients *clientsContainer) handleGetClients(w http.ResponseWriter... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients_http.go |
data.Tags = clientTags
| <mask> clients.lock.Unlock()
<mask>
<mask> w.Header().Set("Content-Type", "application/json")
<mask> e := json.NewEncoder(w).Encode(data)
<mask> if e != nil {
<mask> httpError(w, http.StatusInternalServerError, "Failed to encode to json: %v", e)
</s> + clients: support per-client tags </s> remove e := c.... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients_http.go |
Tags: cj.Tags, | <mask> Name: cj.Name,
<mask> IDs: cj.IDs,
<mask> UseOwnSettings: !cj.UseGlobalSettings,
<mask> FilteringEnabled: cj.FilteringEnabled,
<mask> ParentalEnabled: cj.ParentalEnabled,
<mask> SafeSearchEnabled: cj.SafeSearchEnabled,
<mask> SafeBrowsingEnabled: ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients_http.go |
Tags: c.Tags, | <mask> Name: c.Name,
<mask> IDs: c.IDs,
<mask> UseGlobalSettings: !c.UseOwnSettings,
<mask> FilteringEnabled: c.FilteringEnabled,
<mask> ParentalEnabled: c.ParentalEnabled,
<mask> SafeSearchEnabled: c.SafeSearchEnabled,
<mask> SafeBrowsingEnabled: c.SafeBro... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/clients_http.go |
setts.ClientTags = c.Tags
| <mask> }
<mask>
<mask> if !c.UseOwnSettings {
<mask> return
<mask> }
<mask>
<mask> setts.FilteringEnabled = c.FilteringEnabled
</s> + clients: support per-client tags </s> remove result, err = d.matchHost(host, qtype)
</s> add result, err = d.matchHost(host, qtype, setts.ClientTags) </s> remove re... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f | home/dns.go |
"time" | <mask> "path/filepath"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter"
<mask> "github.com/AdguardTeam/AdGuardHome/dnsforward"
<mask> "gopkg.in/yaml.v2"
</s> Add DHCP API stubs for JS development. | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9294c9ecb2db05dab83b3e168df80c27be15f000 | config.go |
DHCP dhcpState `yaml:"dhcp"` | <mask> DNS dnsConfig `yaml:"dns"`
<mask> Filters []filter `yaml:"filters"`
<mask> UserRules []string `yaml:"user_rules"`
<mask>
<mask> sync.RWMutex `yaml:"-"`
<mask>
<mask> SchemaVersion int `yaml:"schema_version"` // keeping last so that users will be less tempted to change it -- used when upgr... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9294c9ecb2db05dab83b3e168df80c27be15f000 | config.go |
DHCP: dhcpState{dhcpConfig: dhcpConfig{
LeaseDuration: time.Hour * 12,
}}, | <mask> {Filter: dnsfilter.Filter{ID: 2}, Enabled: false, URL: "https://adaway.org/hosts.txt", Name: "AdAway"},
<mask> {Filter: dnsfilter.Filter{ID: 3}, Enabled: false, URL: "https://hosts-file.net/ad_servers.txt", Name: "hpHosts - Ad and Tracking servers only"},
<mask> {Filter: dnsfilter.Filter{ID: 4}, Enabled... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9294c9ecb2db05dab83b3e168df80c27be15f000 | config.go |
http.HandleFunc("/control/dhcp/status", optionalAuth(ensureGET(handleDHCPStatus)))
http.HandleFunc("/control/dhcp/set_config", optionalAuth(ensurePOST(handleDHCPSetConfig)))
http.HandleFunc("/control/dhcp/find_active_dhcp", optionalAuth(ensurePOST(handleDHCPFindActiveServer))) | <mask> http.HandleFunc("/control/safesearch/enable", optionalAuth(ensurePOST(handleSafeSearchEnable)))
<mask> http.HandleFunc("/control/safesearch/disable", optionalAuth(ensurePOST(handleSafeSearchDisable)))
<mask> http.HandleFunc("/control/safesearch/status", optionalAuth(ensureGET(handleSafeSearchStatus)))
<ma... | [
"keep",
"keep",
"add",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/9294c9ecb2db05dab83b3e168df80c27be15f000 | control.go |
dispatch(getDhcpStatus()); | <mask> Object.values(DHCP_FORM_NAMES)
<mask> .forEach((formName) => dispatch(destroy(formName)));
<mask> dispatch(resetDhcp());
<mask> }
<mask> };
<mask>
<mask> const handleSubmit = (values) => {
<mask> dispatch(setDhcpConfig({
<mask> ... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/936a7057fd17809bb3c8e49ec590abd48a12c0b3 | client/src/components/Settings/Dhcp/index.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.