docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> return nil <mask> } <mask> <mask> // ServerConfig - DHCP server configuration <mask> // field ordering is important -- yaml fields will mirror ordering from here <mask> type ServerConfig struct { <mask> Enabled bool `yaml:"enabled"` <mask> InterfaceName string `yaml:"interface_name"` <mask> <mask> Conf4 V4ServerConf `yaml:"dhcpv4"` </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` </s> remove DBFilePath string `yaml:"-"` // path to DB file // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add DBFilePath string `yaml:"-"` </s> remove conf ServerConfig </s> add // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code. </s> add // TODO(a.garipov): Properly decouple the DHCP server from the client // storage. if runtime.GOOS == "windows" { t.Skip("skipping dhcp test on windows") }
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd.go
keep add keep keep keep keep keep keep
<mask> // fields is important, since the YAML configuration file follows it. <mask> type ServerConfig struct { <mask> Enabled bool `yaml:"enabled"` <mask> InterfaceName string `yaml:"interface_name"` <mask> <mask> // LocalDomainName is the domain name used for DHCP hosts. For example, <mask> // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" <mask> // when LocalDomainName is "lan". </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` </s> remove // ServerConfig - DHCP server configuration // field ordering is important -- yaml fields will mirror ordering from here </s> add // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. </s> remove // LocalDomainName is the domain name used for known internal hosts. // For example, a machine called "myhost" can be addressed as // "myhost.lan" when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` </s> add </s> remove conf ServerConfig </s> add // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig </s> remove DBFilePath string `yaml:"-"` // path to DB file // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add DBFilePath string `yaml:"-"` </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code.
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd.go
keep keep keep add keep keep keep keep
<mask> <mask> Enabled bool `yaml:"enabled"` <mask> InterfaceName string `yaml:"interface_name"` <mask> <mask> Conf4 V4ServerConf `yaml:"dhcpv4"` <mask> Conf6 V6ServerConf `yaml:"dhcpv6"` <mask> <mask> WorkDir string `yaml:"-"` </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove DBFilePath string `yaml:"-"` // path to DB file // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add DBFilePath string `yaml:"-"` </s> remove // ServerConfig - DHCP server configuration // field ordering is important -- yaml fields will mirror ordering from here </s> add // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. </s> add // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add data []byte </s> remove data []byte </s> add </s> add wantErrMsg string
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd.go
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
<mask> Conf4 V4ServerConf `yaml:"dhcpv4"` <mask> Conf6 V6ServerConf `yaml:"dhcpv6"` <mask> <mask> WorkDir string `yaml:"-"` <mask> DBFilePath string `yaml:"-"` // path to DB file <mask> <mask> // Called when the configuration is changed by HTTP request <mask> ConfigModified func() `yaml:"-"` <mask> <mask> // Register an HTTP handler <mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` <mask> } <mask> <mask> // OnLeaseChangedT is a callback for lease changes. <mask> type OnLeaseChangedT func(flags int) <mask> </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` </s> remove // ServerConfig - DHCP server configuration // field ordering is important -- yaml fields will mirror ordering from here </s> add // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. </s> remove conf ServerConfig </s> add // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig </s> remove // LocalDomainName is the domain name used for known internal hosts. // For example, a machine called "myhost" can be addressed as // "myhost.lan" when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` </s> add </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, }
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd.go
keep keep keep keep replace keep keep keep keep keep
<mask> type Server struct { <mask> srv4 DHCPServer <mask> srv6 DHCPServer <mask> <mask> conf ServerConfig <mask> <mask> // Called when the leases DB is modified <mask> onLeaseChanged []OnLeaseChangedT <mask> } <mask> </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> remove // ServerConfig - DHCP server configuration // field ordering is important -- yaml fields will mirror ordering from here </s> add // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. </s> remove DBFilePath string `yaml:"-"` // path to DB file // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add DBFilePath string `yaml:"-"` </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove const currentSchemaVersion = 12 </s> add const currentSchemaVersion = 13 </s> add // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"`
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd.go
keep keep replace replace keep replace replace replace replace replace keep keep keep
<mask> <mask> // Create - create object <mask> func Create(conf ServerConfig) (s *Server, err error) { <mask> s = &Server{} <mask> <mask> s.conf.Enabled = conf.Enabled <mask> s.conf.InterfaceName = conf.InterfaceName <mask> s.conf.HTTPRegister = conf.HTTPRegister <mask> s.conf.ConfigModified = conf.ConfigModified <mask> s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) <mask> <mask> if !webHandlersRegistered && s.conf.HTTPRegister != nil { <mask> if runtime.GOOS == "windows" { </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove c := dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(&c) </s> add c := &dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(c) </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> remove conf: ServerConfig{ </s> add conf: &ServerConfig{ </s> add c.LocalDomainName = s.conf.LocalDomainName </s> remove LocalDomain: config.DNS.LocalDomainName, </s> add LocalDomain: config.DHCP.LocalDomainName,
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd.go
keep add keep keep keep keep keep
<mask> c.Enabled = s.conf.Enabled <mask> c.InterfaceName = s.conf.InterfaceName <mask> s.srv4.WriteDiskConfig4(&c.Conf4) <mask> s.srv6.WriteDiskConfig6(&c.Conf6) <mask> } <mask> <mask> // Start will listen on port 67 and serve DHCP requests. </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove func Create(conf ServerConfig) (s *Server, err error) { s = &Server{} </s> add func Create(conf *ServerConfig) (s *Server, err error) { s = &Server{ conf: &ServerConfig{ ConfigModified: conf.ConfigModified, </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove // TODO(e.burkov): leases.db isn't created on Windows so removing it // causes an error. Split the test to make it run properly on different // operating systems. t.Cleanup(func() { _ = os.Remove("leases.db") }) </s> add testutil.CleanupAndRequireSuccess(t, func() (err error) { return os.Remove("leases.db") }) </s> remove // Set the broadcast bit in the DHCPNAK, so that the // relay agent broadcasted it to the client, because the // client may not have a correct network address or // subnet mask, and the client may not be answering ARP // requests. </s> add // Set the broadcast bit in the DHCPNAK, so that the relay agent // broadcasts it to the client, because the client may not have // a correct network address or subnet mask, and the client may not // be answering ARP requests. </s> remove c := dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(&c) </s> add c := &dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(c)
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd.go
keep keep keep keep replace keep keep keep keep keep
<mask> // Leases database store/load. <mask> func TestDB(t *testing.T) { <mask> var err error <mask> s := Server{ <mask> conf: ServerConfig{ <mask> DBFilePath: dbFilename, <mask> }, <mask> } <mask> <mask> s.srv4, err = v4Create(V4ServerConf{ </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove func Create(conf ServerConfig) (s *Server, err error) { s = &Server{} </s> add func Create(conf *ServerConfig) (s *Server, err error) { s = &Server{ conf: &ServerConfig{ ConfigModified: conf.ConfigModified, </s> add // TODO(a.garipov): Properly decouple the DHCP server from the client // storage. if runtime.GOOS == "windows" { t.Skip("skipping dhcp test on windows") } </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> add upgradeSchema12to13,
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd_test.go
keep add keep keep keep keep keep
<mask> testCases := []struct { <mask> name string <mask> gatewayIP net.IP <mask> subnetMask net.IP <mask> }{{ <mask> name: "gateway_in_range", <mask> wantErrMsg: "dhcpv4: gateway ip 192.168.10.120 in the ip range: " + </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove wantErrMsg string </s> add </s> remove name: "gateway_in_range", gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> add name: "gateway_in_range", </s> add gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> remove name: "outside_range_start", gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 240}, </s> add name: "outside_range_start", </s> add data []byte </s> remove data []byte </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd_test.go
keep replace keep replace replace replace keep keep
<mask> subnetMask net.IP <mask> wantErrMsg string <mask> }{{ <mask> name: "gateway_in_range", <mask> gatewayIP: net.IP{192, 168, 10, 120}, <mask> subnetMask: net.IP{255, 255, 255, 0}, <mask> wantErrMsg: "dhcpv4: gateway ip 192.168.10.120 in the ip range: " + <mask> "192.168.10.20-192.168.10.200", </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> remove name: "outside_range_start", gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 240}, </s> add name: "outside_range_start", </s> add wantErrMsg string </s> remove }, { name: "outside_range_end", </s> add </s> remove subnetMask: net.IP{255, 255, 255, 224}, </s> add subnetMask: net.IP{255, 255, 255, 240}, }, { name: "outside_range_end",
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd_test.go
keep add keep keep keep keep
<mask> wantErrMsg: "dhcpv4: gateway ip 192.168.10.120 in the ip range: " + <mask> "192.168.10.20-192.168.10.200", <mask> }, { <mask> name: "outside_range_start", <mask> wantErrMsg: "dhcpv4: range start 192.168.10.20 is outside network " + <mask> "192.168.10.1/28", </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove name: "outside_range_start", gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 240}, </s> add name: "outside_range_start", </s> remove }, { name: "outside_range_end", </s> add </s> remove name: "gateway_in_range", gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> add name: "gateway_in_range", </s> add wantErrMsg string </s> remove wantErrMsg string </s> add </s> remove subnetMask: net.IP{255, 255, 255, 224}, </s> add subnetMask: net.IP{255, 255, 255, 240}, }, { name: "outside_range_end",
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd_test.go
keep keep keep replace replace replace keep keep keep keep keep keep keep keep replace replace keep keep
<mask> wantErrMsg: "dhcpv4: gateway ip 192.168.10.120 in the ip range: " + <mask> "192.168.10.20-192.168.10.200", <mask> }, { <mask> name: "outside_range_start", <mask> gatewayIP: net.IP{192, 168, 10, 1}, <mask> subnetMask: net.IP{255, 255, 255, 240}, <mask> wantErrMsg: "dhcpv4: range start 192.168.10.20 is outside network " + <mask> "192.168.10.1/28", <mask> }, { <mask> name: "outside_range_end", <mask> gatewayIP: net.IP{192, 168, 10, 1}, <mask> subnetMask: net.IP{255, 255, 255, 240}, <mask> wantErrMsg: "dhcpv4: range start 192.168.10.20 is outside network " + <mask> "192.168.10.1/28", <mask> }, { <mask> name: "outside_range_end", <mask> gatewayIP: net.IP{192, 168, 10, 1}, <mask> subnetMask: net.IP{255, 255, 255, 224}, </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> remove subnetMask: net.IP{255, 255, 255, 224}, </s> add subnetMask: net.IP{255, 255, 255, 240}, }, { name: "outside_range_end", </s> remove name: "gateway_in_range", gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> add name: "gateway_in_range", </s> add gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 224}, </s> remove wantErrMsg string </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> "192.168.10.1/28", <mask> }, { <mask> name: "outside_range_end", <mask> gatewayIP: net.IP{192, 168, 10, 1}, <mask> subnetMask: net.IP{255, 255, 255, 224}, <mask> wantErrMsg: "dhcpv4: range end 192.168.10.200 is outside network " + <mask> "192.168.10.1/27", <mask> }} <mask> <mask> for _, tc := range testCases { </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 224}, </s> remove }, { name: "outside_range_end", </s> add </s> remove name: "outside_range_start", gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 240}, </s> add name: "outside_range_start", </s> add gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> remove name: "gateway_in_range", gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> add name: "gateway_in_range", </s> remove wantErrMsg string </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd_test.go
keep add keep keep keep keep
<mask> wantErrMsg: "dhcpv4: range end 192.168.10.200 is outside network " + <mask> "192.168.10.1/27", <mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove subnetMask: net.IP{255, 255, 255, 224}, </s> add subnetMask: net.IP{255, 255, 255, 240}, }, { name: "outside_range_end", </s> remove }, { name: "outside_range_end", </s> add </s> remove data: []byte("flase"), wantErrMsg: `invalid nullBool value "flase"`, </s> add wantErrMsg: `invalid nullBool value "invalid"`, data: []byte("invalid"), </s> add gatewayIP: net.IP{192, 168, 10, 120}, subnetMask: net.IP{255, 255, 255, 0}, </s> remove name: "outside_range_start", gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 240}, </s> add name: "outside_range_start", </s> add wantErrMsg string
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/dhcpd_test.go
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> if err != nil && !errors.Is(err, os.ErrNotExist) { <mask> log.Error("dhcp: removing db: %s", err) <mask> } <mask> <mask> oldconf := s.conf <mask> s.conf = ServerConfig{ <mask> WorkDir: oldconf.WorkDir, <mask> HTTPRegister: oldconf.HTTPRegister, <mask> ConfigModified: oldconf.ConfigModified, <mask> DBFilePath: oldconf.DBFilePath, <mask> } <mask> <mask> v4conf := V4ServerConf{ <mask> LeaseDuration: DefaultDHCPLeaseTTL, <mask> ICMPTimeout: DefaultDHCPTimeoutICMP, </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove conf: ServerConfig{ </s> add conf: &ServerConfig{ </s> remove c := dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(&c) </s> add c := &dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(c) </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code. </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove LocalDomain: config.DNS.LocalDomainName, </s> add LocalDomain: config.DHCP.LocalDomainName,
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/http.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> func TestNullBool_UnmarshalJSON(t *testing.T) { <mask> testCases := []struct { <mask> name string <mask> data []byte <mask> wantErrMsg string <mask> want nullBool <mask> }{{ <mask> name: "empty", <mask> data: []byte{}, </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add data []byte </s> remove data: []byte{}, </s> add </s> add wantErrMsg string </s> remove wantErrMsg string </s> add </s> remove data: []byte("flase"), wantErrMsg: `invalid nullBool value "flase"`, </s> add wantErrMsg: `invalid nullBool value "invalid"`, data: []byte("invalid"), </s> add data: []byte{},
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep add keep keep keep keep
<mask> testCases := []struct { <mask> name string <mask> wantErrMsg string <mask> want nullBool <mask> }{{ <mask> name: "empty", <mask> wantErrMsg: "", </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove data []byte </s> add </s> remove data: []byte{}, </s> add </s> add wantErrMsg string </s> remove wantErrMsg string </s> add </s> remove data: []byte("flase"), wantErrMsg: `invalid nullBool value "flase"`, </s> add wantErrMsg: `invalid nullBool value "invalid"`, data: []byte("invalid"), </s> add data: []byte{},
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> wantErrMsg string <mask> want nullBool <mask> }{{ <mask> name: "empty", <mask> data: []byte{}, <mask> wantErrMsg: "", <mask> want: nbNull, <mask> }, { <mask> name: "null", <mask> data: []byte("null"), </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add data: []byte{}, </s> remove data []byte </s> add </s> remove data: []byte("null"), </s> add </s> add data: []byte("null"), </s> add data []byte </s> add data: []byte("false"),
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep add keep keep keep keep keep keep
<mask> name: "empty", <mask> wantErrMsg: "", <mask> want: nbNull, <mask> }, { <mask> name: "null", <mask> wantErrMsg: "", <mask> data: []byte("null"), <mask> want: nbNull, </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add data: []byte("null"), </s> remove data: []byte("null"), </s> add </s> remove data: []byte{}, </s> add </s> remove data: []byte("true"), </s> add </s> add data: []byte("false"), </s> remove data: []byte("false"), </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> wantErrMsg: "", <mask> want: nbNull, <mask> }, { <mask> name: "null", <mask> data: []byte("null"), <mask> wantErrMsg: "", <mask> want: nbNull, <mask> }, { <mask> name: "true", <mask> data: []byte("true"), </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add data: []byte("null"), </s> add data: []byte{}, </s> remove data: []byte("true"), </s> add </s> remove data: []byte{}, </s> add </s> add data: []byte("true"), </s> add data: []byte("false"),
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep keep add keep keep keep keep
<mask> want: nbNull, <mask> }, { <mask> name: "null", <mask> wantErrMsg: "", <mask> want: nbNull, <mask> }, { <mask> name: "true", <mask> wantErrMsg: "", </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove data: []byte("null"), </s> add </s> add data: []byte{}, </s> remove data: []byte("true"), </s> add </s> remove data: []byte{}, </s> add </s> add data: []byte("false"), </s> add data: []byte("true"),
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> wantErrMsg: "", <mask> want: nbNull, <mask> }, { <mask> name: "true", <mask> data: []byte("true"), <mask> wantErrMsg: "", <mask> want: nbTrue, <mask> }, { <mask> name: "false", <mask> data: []byte("false"), </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add data: []byte("true"), </s> remove data: []byte("false"), </s> add </s> remove data: []byte("null"), </s> add </s> add data: []byte("false"), </s> add data: []byte("null"), </s> add data: []byte{},
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep add keep keep keep keep
<mask> name: "true", <mask> wantErrMsg: "", <mask> want: nbTrue, <mask> }, { <mask> name: "false", <mask> wantErrMsg: "", </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove data: []byte("true"), </s> add </s> remove data: []byte("false"), </s> add </s> add data: []byte("false"), </s> add data: []byte("null"), </s> remove data: []byte("null"), </s> add </s> add data: []byte{},
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> wantErrMsg: "", <mask> want: nbTrue, <mask> }, { <mask> name: "false", <mask> data: []byte("false"), <mask> wantErrMsg: "", <mask> want: nbFalse, <mask> }, { <mask> name: "invalid", <mask> data: []byte("flase"), </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add data: []byte("false"), </s> remove data: []byte("true"), </s> add </s> add data: []byte("true"), </s> remove data: []byte("flase"), wantErrMsg: `invalid nullBool value "flase"`, </s> add wantErrMsg: `invalid nullBool value "invalid"`, data: []byte("invalid"), </s> remove data: []byte("null"), </s> add </s> add data: []byte{},
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep keep add keep keep keep keep keep keep
<mask> want: nbTrue, <mask> }, { <mask> name: "false", <mask> wantErrMsg: "", <mask> want: nbFalse, <mask> }, { <mask> name: "invalid", <mask> wantErrMsg: `invalid nullBool value "invalid"`, <mask> data: []byte("invalid"), <mask> want: nbNull, </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove data: []byte("flase"), wantErrMsg: `invalid nullBool value "flase"`, </s> add wantErrMsg: `invalid nullBool value "invalid"`, data: []byte("invalid"), </s> remove data: []byte("false"), </s> add </s> remove data: []byte("true"), </s> add </s> add data: []byte("true"), </s> remove data: []byte("null"), </s> add </s> add data: []byte("null"),
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> wantErrMsg: "", <mask> want: nbFalse, <mask> }, { <mask> name: "invalid", <mask> data: []byte("flase"), <mask> wantErrMsg: `invalid nullBool value "flase"`, <mask> want: nbNull, <mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add data: []byte("false"), </s> remove data: []byte("false"), </s> add </s> add gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 224}, </s> remove data: []byte("null"), </s> add </s> add data: []byte("null"), </s> remove data: []byte("true"), </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/nullbool_test.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> IP: giaddr, <mask> Port: dhcpv4.ServerPort, <mask> } <mask> if mtype == dhcpv4.MessageTypeNak { <mask> // Set the broadcast bit in the DHCPNAK, so that the <mask> // relay agent broadcasted it to the client, because the <mask> // client may not have a correct network address or <mask> // subnet mask, and the client may not be answering ARP <mask> // requests. <mask> resp.SetBroadcast() <mask> } <mask> case mtype == dhcpv4.MessageTypeNak: <mask> // Broadcast any DHCPNAK messages to 0xffffffff. <mask> case ciaddr != nil && !ciaddr.IsUnspecified(): </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> add // TODO(a.garipov): Move everything related to DHCP local domain to the DHCP // server. </s> add // TODO(a.garipov): Properly decouple the DHCP server from the client // storage. if runtime.GOOS == "windows" { t.Skip("skipping dhcp test on windows") } </s> remove // TODO(e.burkov): leases.db isn't created on Windows so removing it // causes an error. Split the test to make it run properly on different // operating systems. t.Cleanup(func() { _ = os.Remove("leases.db") }) </s> add testutil.CleanupAndRequireSuccess(t, func() (err error) { return os.Remove("leases.db") }) </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code.
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dhcpd/v4.go
keep keep keep keep replace replace replace keep keep keep keep keep
<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.ValidateDomainName(l.Hostname) <mask> if err != nil { <mask> log.Debug( <mask> "dns: skipping invalid hostname %q from dhcp: %s", <mask> l.Hostname, </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add // TODO(a.garipov): Properly decouple the DHCP server from the client // storage. if runtime.GOOS == "windows" { t.Skip("skipping dhcp test on windows") } </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> add upgradeSchema12to13, </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove c := dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(&c) </s> add c := &dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(c)
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dnsforward/dns.go
keep keep add keep keep keep keep keep keep
<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. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add // TODO(a.garipov): Properly decouple the DHCP server from the client // storage. if runtime.GOOS == "windows" { t.Skip("skipping dhcp test on windows") } </s> remove c := dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(&c) </s> add c := &dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(c) </s> add upgradeSchema12to13, </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove conf: ServerConfig{ </s> add conf: &ServerConfig{
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/dnsforward/dns.go
keep add keep keep keep keep keep
<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 e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add "github.com/AdguardTeam/golibs/testutil" </s> remove data: []byte{}, </s> add </s> remove data []byte </s> add </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> add gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 224}, </s> remove subnetMask: net.IP{255, 255, 255, 224}, </s> add subnetMask: net.IP{255, 255, 255, 240}, }, { name: "outside_range_end",
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/clients_test.go
keep keep keep add keep keep keep keep
<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 following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add "runtime" </s> remove const currentSchemaVersion = 12 </s> add const currentSchemaVersion = 13 </s> remove data []byte </s> add </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> add gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 224}, </s> remove subnetMask: net.IP{255, 255, 255, 224}, </s> add subnetMask: net.IP{255, 255, 255, 240}, }, { name: "outside_range_end",
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/clients_test.go
keep keep keep add keep keep keep keep
<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 e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove config := dhcpd.ServerConfig{ </s> add config := &dhcpd.ServerConfig{ </s> remove conf: ServerConfig{ </s> add conf: &ServerConfig{ </s> add gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 224}, </s> remove data: []byte("flase"), wantErrMsg: `invalid nullBool value "flase"`, </s> add wantErrMsg: `invalid nullBool value "invalid"`, data: []byte("invalid"), </s> remove // TODO(e.burkov): leases.db isn't created on Windows so removing it // causes an error. Split the test to make it run properly on different // operating systems. t.Cleanup(func() { _ = os.Remove("leases.db") }) </s> add testutil.CleanupAndRequireSuccess(t, func() (err error) { return os.Remove("leases.db") }) </s> remove data []byte </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/clients_test.go
keep keep keep keep replace keep keep keep keep keep
<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.IP{1, 2, 3, 1}, </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add // TODO(a.garipov): Properly decouple the DHCP server from the client // storage. if runtime.GOOS == "windows" { t.Skip("skipping dhcp test on windows") } </s> remove LocalDomainName: "lan", </s> add </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove conf ServerConfig </s> add // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code. </s> add // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"`
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/clients_test.go
keep keep keep keep replace replace replace replace keep keep keep keep keep
<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.Cleanup(func() { _ = os.Remove("leases.db") }) <mask> <mask> err = clients.dhcpServer.AddStaticLease(&dhcpd.Lease{ <mask> HWAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, <mask> IP: ip, <mask> Hostname: "testhost", </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> add // TODO(a.garipov): Properly decouple the DHCP server from the client // storage. if runtime.GOOS == "windows" { t.Skip("skipping dhcp test on windows") } </s> remove // Set the broadcast bit in the DHCPNAK, so that the // relay agent broadcasted it to the client, because the // client may not have a correct network address or // subnet mask, and the client may not be answering ARP // requests. </s> add // Set the broadcast bit in the DHCPNAK, so that the relay agent // broadcasts it to the client, because the client may not have // a correct network address or subnet mask, and the client may not // be answering ARP requests. </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> add c.LocalDomainName = s.conf.LocalDomainName
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/clients_test.go
keep keep keep keep replace keep keep keep keep keep
<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. <mask> // This field is only used for reading and writing persistent client data. <mask> // Keep this field sorted to ensure consistent ordering. <mask> Clients []*clientObject `yaml:"clients"` </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove // ServerConfig - DHCP server configuration // field ordering is important -- yaml fields will mirror ordering from here </s> add // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. </s> add // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code. </s> add // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` </s> remove // Set the broadcast bit in the DHCPNAK, so that the // relay agent broadcasted it to the client, because the // client may not have a correct network address or // subnet mask, and the client may not be answering ARP // requests. </s> add // Set the broadcast bit in the DHCPNAK, so that the relay agent // broadcasts it to the client, because the client may not have // a correct network address or subnet mask, and the client may not // be answering ARP requests. </s> remove // LocalDomainName is the domain name used for known internal hosts. // For example, a machine called "myhost" can be addressed as // "myhost.lan" when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/config.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<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> // "myhost.lan" when LocalDomainName is "lan". <mask> LocalDomainName string `yaml:"local_domain_name"` <mask> <mask> // ResolveClients enables and disables resolving clients with RDNS. <mask> ResolveClients bool `yaml:"resolve_clients"` <mask> <mask> // UsePrivateRDNS defines if the PTR requests for unknown addresses from <mask> // locally-served networks should be resolved via private PTR resolvers. </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add // LocalDomainName is the domain name used for DHCP hosts. For example, // a DHCP client with the hostname "myhost" can be addressed as "myhost.lan" // when LocalDomainName is "lan". LocalDomainName string `yaml:"local_domain_name"` </s> add // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> remove conf ServerConfig </s> add // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig </s> remove // ServerConfig - DHCP server configuration // field ordering is important -- yaml fields will mirror ordering from here </s> add // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. </s> remove DBFilePath string `yaml:"-"` // path to DB file // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add DBFilePath string `yaml:"-"` </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading.
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<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, <mask> UsePrivateRDNS: true, <mask> }, <mask> TLS: tlsConfigSettings{ <mask> PortHTTPS: defaultPortHTTPS, </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> add DHCP: &dhcpd.ServerConfig{ LocalDomainName: "lan", }, </s> remove config := dhcpd.ServerConfig{ </s> add config := &dhcpd.ServerConfig{ </s> remove // Set the broadcast bit in the DHCPNAK, so that the // relay agent broadcasted it to the client, because the // client may not have a correct network address or // subnet mask, and the client may not be answering ARP // requests. </s> add // Set the broadcast bit in the DHCPNAK, so that the relay agent // broadcasts it to the client, because the client may not have // a correct network address or subnet mask, and the client may not // be answering ARP requests. </s> remove conf ServerConfig </s> add // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath,
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/config.go
keep keep keep add keep keep keep keep
<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> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove LocalDomainName: "lan", </s> add </s> remove // Set the broadcast bit in the DHCPNAK, so that the // relay agent broadcasted it to the client, because the // client may not have a correct network address or // subnet mask, and the client may not be answering ARP // requests. </s> add // Set the broadcast bit in the DHCPNAK, so that the relay agent // broadcasts it to the client, because the client may not have // a correct network address or subnet mask, and the client may not // be answering ARP requests. </s> add // TODO(a.garipov): Move everything related to DHCP local domain to the DHCP // server. </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove DHCP dhcpd.ServerConfig `yaml:"dhcp"` </s> add DHCP *dhcpd.ServerConfig `yaml:"dhcp"` </s> remove DBFilePath string `yaml:"-"` // path to DB file // Called when the configuration is changed by HTTP request ConfigModified func() `yaml:"-"` // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"` </s> add DBFilePath string `yaml:"-"`
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/config.go
keep keep keep keep replace replace keep keep keep keep keep
<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 request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove LocalDomain: config.DNS.LocalDomainName, </s> add LocalDomain: config.DHCP.LocalDomainName, </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code. </s> add upgradeSchema12to13,
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<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.dhcpServer <mask> } <mask> </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove c := dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(&c) </s> add c := &dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(c) </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code. </s> add upgradeSchema12to13,
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<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 domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove // ignores broadcasted packets when reading. </s> add // ignores broadcast packets when reading. </s> remove // ServerConfig - DHCP server configuration // field ordering is important -- yaml fields will mirror ordering from here </s> add // ServerConfig is the configuration for the DHCP server. The order of YAML // fields is important, since the YAML configuration file follows it. </s> remove func Create(conf ServerConfig) (s *Server, err error) { s = &Server{} </s> add func Create(conf *ServerConfig) (s *Server, err error) { s = &Server{ conf: &ServerConfig{ ConfigModified: conf.ConfigModified, </s> add c.LocalDomainName = s.conf.LocalDomainName </s> remove s.conf.Enabled = conf.Enabled s.conf.InterfaceName = conf.InterfaceName s.conf.HTTPRegister = conf.HTTPRegister s.conf.ConfigModified = conf.ConfigModified s.conf.DBFilePath = filepath.Join(conf.WorkDir, dbFilename) </s> add HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, DBFilePath: filepath.Join(conf.WorkDir, dbFilename), }, } </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code.
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/upgrade.go
keep keep add keep keep keep keep keep keep
<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 of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove // TODO(a.garipov): Remove this after we're finished // with the client hostname validations in the DHCP // server code. </s> add // TODO(a.garipov): Remove this after we're finished with the client // hostname validations in the DHCP server code. </s> remove c := dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(&c) </s> add c := &dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(c) </s> remove oldconf := s.conf s.conf = ServerConfig{ WorkDir: oldconf.WorkDir, HTTPRegister: oldconf.HTTPRegister, ConfigModified: oldconf.ConfigModified, DBFilePath: oldconf.DBFilePath, </s> add s.conf = &ServerConfig{ ConfigModified: s.conf.ConfigModified, HTTPRegister: s.conf.HTTPRegister, LocalDomainName: s.conf.LocalDomainName, WorkDir: s.conf.WorkDir, DBFilePath: s.conf.DBFilePath, </s> remove conf: ServerConfig{ </s> add conf: &ServerConfig{ </s> add gatewayIP: net.IP{192, 168, 10, 1}, subnetMask: net.IP{255, 255, 255, 224}, </s> remove subnetMask: net.IP{255, 255, 255, 224}, </s> add subnetMask: net.IP{255, 255, 255, 240}, }, { name: "outside_range_end",
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/upgrade.go
keep keep keep keep replace keep keep keep keep keep
<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, oldDNSConf, newDNSConf, excludedEntries, excludedEntries) </s> Pull request: home: mv local domain name to dhcp setts Closes #3367. Squashed commit of the following: commit e2cabcac2d91af24b9e5f4ac8f78daf5e8d339b9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:35:31 2022 +0300 home: imp test, skip dhcp test on windows commit e58053f11e081630ad4e8d1e77a7a74226029db0 Merge: ff2fe87d 0b72bcc5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jan 25 19:10:25 2022 +0300 Merge branch 'master' into 3367-dhcp-local-domain-name commit ff2fe87d8cab12e60d045be636e366e392d6d96f Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 30 20:55:34 2021 +0300 home: mv local domain name to dhcp setts </s> remove conf ServerConfig </s> add // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig </s> add upgradeSchema12to13, </s> add // TODO(a.garipov): Move everything related to DHCP local domain to the DHCP // server. </s> remove c := dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(&c) </s> add c := &dhcpd.ServerConfig{} Context.dhcpServer.WriteDiskConfig(c) </s> remove // Set the broadcast bit in the DHCPNAK, so that the // relay agent broadcasted it to the client, because the // client may not have a correct network address or // subnet mask, and the client may not be answering ARP // requests. </s> add // Set the broadcast bit in the DHCPNAK, so that the relay agent // broadcasts it to the client, because the client may not have // a correct network address or subnet mask, and the client may not // be answering ARP requests. </s> remove const currentSchemaVersion = 12 </s> add const currentSchemaVersion = 13
https://github.com/AdguardTeam/AdGuardHome/commit/90c17c79de14b51d1979c67650177b784216487c
internal/home/upgrade_test.go
keep keep keep keep replace keep keep keep keep keep
<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 args := options{runningAsService: true} </s> add args := p.opts args.runningAsService = true </s> remove func handleServiceControlAction(action string) { </s> add func handleServiceControlAction(opts options) { action := opts.serviceControlAction </s> add runOpts := opts runOpts.serviceControlAction = "run" </s> remove prg := &program{} </s> add prg := &program{runOpts} </s> add opts options </s> remove Arguments: []string{"-s", "run"}, </s> add Arguments: serialize(runOpts),
https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f
home/home.go
keep keep add keep keep keep keep keep
<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> service: installation and running of AGH as a service with CLI args </s> remove args := options{runningAsService: true} </s> add args := p.opts args.runningAsService = true </s> remove func handleServiceControlAction(action string) { </s> add func handleServiceControlAction(opts options) { action := opts.serviceControlAction </s> remove handleServiceControlAction(args.serviceControlAction) </s> add handleServiceControlAction(args) </s> add runOpts := opts runOpts.serviceControlAction = "run" </s> remove prg := &program{} </s> add prg := &program{runOpts} </s> remove Arguments: []string{"-s", "run"}, </s> add Arguments: serialize(runOpts),
https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f
home/service.go
keep keep keep keep replace keep keep keep keep keep
<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 program </s> service: installation and running of AGH as a service with CLI args </s> add opts options </s> remove handleServiceControlAction(args.serviceControlAction) </s> add handleServiceControlAction(args) </s> remove func handleServiceControlAction(action string) { </s> add func handleServiceControlAction(opts options) { action := opts.serviceControlAction </s> add runOpts := opts runOpts.serviceControlAction = "run" </s> remove prg := &program{} </s> add prg := &program{runOpts} </s> remove Arguments: []string{"-s", "run"}, </s> add Arguments: serialize(runOpts),
https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f
home/service.go
keep keep keep keep replace keep keep keep keep keep
<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 handleServiceControlAction(action string) { <mask> log.Printf("Service control action: %s", action) <mask> <mask> if action == "reload" { <mask> sendSigReload() <mask> return </s> service: installation and running of AGH as a service with CLI args </s> add opts options </s> remove handleServiceControlAction(args.serviceControlAction) </s> add handleServiceControlAction(args) </s> add runOpts := opts runOpts.serviceControlAction = "run" </s> remove args := options{runningAsService: true} </s> add args := p.opts args.runningAsService = true </s> remove prg := &program{} </s> add prg := &program{runOpts} </s> remove Arguments: []string{"-s", "run"}, </s> add Arguments: serialize(runOpts),
https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f
home/service.go
keep keep add keep keep keep keep
<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 running of AGH as a service with CLI args </s> remove Arguments: []string{"-s", "run"}, </s> add Arguments: serialize(runOpts), </s> remove func handleServiceControlAction(action string) { </s> add func handleServiceControlAction(opts options) { action := opts.serviceControlAction </s> remove prg := &program{} </s> add prg := &program{runOpts} </s> remove handleServiceControlAction(args.serviceControlAction) </s> add handleServiceControlAction(args) </s> remove args := options{runningAsService: true} </s> add args := p.opts args.runningAsService = true </s> add opts options
https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f
home/service.go
keep replace keep keep replace keep keep
<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 { </s> service: installation and running of AGH as a service with CLI args </s> add runOpts := opts runOpts.serviceControlAction = "run" </s> remove handleServiceControlAction(args.serviceControlAction) </s> add handleServiceControlAction(args) </s> remove args := options{runningAsService: true} </s> add args := p.opts args.runningAsService = true </s> remove func handleServiceControlAction(action string) { </s> add func handleServiceControlAction(opts options) { action := opts.serviceControlAction </s> add opts options
https://github.com/AdguardTeam/AdGuardHome/commit/90ef204d0473c9df6bba468f33f2669a0bcf519f
home/service.go
keep keep keep keep replace keep keep keep keep keep
<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/v2 v2.2.1 <mask> github.com/fsnotify/fsnotify v1.4.9 </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 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging </s> add github.com/AdguardTeam/golibs v0.4.5 h1:RRA9ZsmbJEN4OllAx0BcfvSbRBxxpWluJijBYmtp13U= github.com/AdguardTeam/golibs v0.4.5/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= </s> add "fmt" </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove log.Error("rdns: resolving %q: %s", ip, err) </s> add log.Debug("rdns: resolving %q: %s", ip, err) </s> remove log.Info("Configuration file is OK") </s> add log.Info("configuration file is ok")
https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892
go.mod
keep add keep keep keep keep keep keep
<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/AdguardTeam/urlfilter v0.14.4 h1:lrS7lrfxVCFh4TFB6nwPp5UE4n1XNvv3zUetduD9mZw= <mask> github.com/AdguardTeam/urlfilter v0.14.4/go.mod h1:klx4JbOfc4EaNb5lWLqOwfg+pVcyRukmoJRvO55lL5U= <mask> github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= <mask> github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= <mask> github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= </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 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging </s> remove github.com/AdguardTeam/golibs v0.4.4 </s> add github.com/AdguardTeam/golibs v0.4.5 </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove log.Error("rdns: resolving %q: %s", ip, err) </s> add log.Debug("rdns: resolving %q: %s", ip, err) </s> remove log.Info("Configuration file is OK") </s> add log.Info("configuration file is ok") </s> remove log.Error("Failed to parse configuration, exiting") </s> add log.Error("parsing configuration file: %s", err)
https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892
go.sum
keep keep keep add keep keep keep keep keep
<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 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging </s> remove github.com/AdguardTeam/golibs v0.4.4 </s> add github.com/AdguardTeam/golibs v0.4.5 </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove log.Error("rdns: resolving %q: %s", ip, err) </s> add log.Debug("rdns: resolving %q: %s", ip, err) </s> remove log.Info("Configuration file is OK") </s> add log.Info("configuration file is ok") </s> remove log.Error("Failed to parse configuration, exiting") </s> add log.Error("parsing configuration file: %s", err)
https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892
internal/home/config.go
keep keep keep keep replace replace keep keep keep keep keep
<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 YAML file and also saves the user filter contents to a file </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 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging </s> remove log.Error("Failed to parse configuration, exiting") </s> add log.Error("parsing configuration file: %s", err) </s> remove log.Error("rdns: resolving %q: %s", ip, err) </s> add log.Debug("rdns: resolving %q: %s", ip, err) </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove log.Info("Configuration file is OK") </s> add log.Info("configuration file is ok") </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> add "fmt"
https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892
internal/home/config.go
keep keep replace keep keep keep keep replace keep keep keep keep
<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") <mask> os.Exit(0) <mask> } <mask> } <mask> </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 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging </s> remove log.Error("Couldn't read config file %s: %s", configFile, err) return nil, err </s> add return nil, fmt.Errorf("couldn't read config file %s: %w", configFile, err) </s> remove log.Error("rdns: resolving %q: %s", ip, err) </s> add log.Debug("rdns: resolving %q: %s", ip, err) </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> add "fmt"
https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892
internal/home/home.go
keep keep keep keep replace keep keep keep keep keep
<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 2954-wrong-logs to master Closes #2954. Squashed commit of the following: commit 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging </s> remove log.Error("Failed to parse configuration, exiting") </s> add log.Error("parsing configuration file: %s", err) </s> remove log.Error("Couldn't read config file %s: %s", configFile, err) return nil, err </s> add return nil, fmt.Errorf("couldn't read config file %s: %w", configFile, err) </s> remove log.Info("Configuration file is OK") </s> add log.Info("configuration file is ok") </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> add "fmt"
https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892
internal/home/rdns.go
keep keep keep keep replace keep keep keep keep keep
<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.Itoa(web.conf.BindPort)), <mask> Handler: withMiddlewares(Context.mux, limitRequestBody), <mask> ReadTimeout: web.conf.ReadTimeout, <mask> ReadHeaderTimeout: web.conf.ReadHeaderTimeout, <mask> WriteTimeout: web.conf.WriteTimeout, </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 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove log.Error("Couldn't read config file %s: %s", configFile, err) return nil, err </s> add return nil, fmt.Errorf("couldn't read config file %s: %w", configFile, err) </s> remove log.Error("Failed to parse configuration, exiting") </s> add log.Error("parsing configuration file: %s", err) </s> remove log.Info("Configuration file is OK") </s> add log.Info("configuration file is ok") </s> remove log.Error("rdns: resolving %q: %s", ip, err) </s> add log.Debug("rdns: resolving %q: %s", ip, err) </s> add "fmt"
https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892
internal/home/web.go
keep keep keep keep replace keep keep keep keep keep
<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(Context.mux, limitRequestBody, web.wrapIndexBeta), <mask> ReadTimeout: web.conf.ReadTimeout, <mask> ReadHeaderTimeout: web.conf.ReadHeaderTimeout, <mask> WriteTimeout: web.conf.WriteTimeout, </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 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging </s> remove ErrorLog: log.StdLog("web: http", log.DEBUG), </s> add ErrorLog: log.StdLog("web: plain", log.DEBUG), </s> remove log.Error("Failed to parse configuration, exiting") </s> add log.Error("parsing configuration file: %s", err) </s> remove log.Error("rdns: resolving %q: %s", ip, err) </s> add log.Debug("rdns: resolving %q: %s", ip, err) </s> remove log.Info("Configuration file is OK") </s> add log.Info("configuration file is ok") </s> remove log.Error("Couldn't read config file %s: %s", configFile, err) return nil, err </s> add return nil, fmt.Errorf("couldn't read config file %s: %w", configFile, err) </s> add "fmt"
https://github.com/AdguardTeam/AdGuardHome/commit/91304663b7196dbbb1652e3ba0f41f0c68504892
internal/home/web.go
keep add keep keep keep keep
<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 <e.burkov@adguard.com> Date: Mon Mar 1 17:02:24 2021 +0300 util: convert only once commit f1c74f4d18898f286d70c58f93b2fa21de6b5780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 16:22:51 2021 +0300 util: log changes, imp docs commit 0a4558d044602058255db71f825a730642cc9b07 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 15:53:26 2021 +0300 util: imp os detection </s> add "path/filepath" </s> remove return strings.Contains(string(body), "OpenWrt") </s> add // 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(etcDir, fileInfo.Name())) if err != nil { continue } if bytes.Contains(body, osNameData) { return true } } return false </s> remove body, err := ioutil.ReadFile("/etc/os-release") </s> add 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) </s> remove // IsOpenWRT checks if OS is OpenWRT. </s> add // IsOpenWRT returns true if host OS is OpenWRT.
https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359
internal/util/helpers.go
keep keep keep add keep keep keep keep keep keep
<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/adguard-home from 2757-openwrt to master Updates #2757. Squashed commit of the following: commit 8e94e6a67ae702bd1b281b306555a4ce9ecc6391 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 17:02:24 2021 +0300 util: convert only once commit f1c74f4d18898f286d70c58f93b2fa21de6b5780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 16:22:51 2021 +0300 util: log changes, imp docs commit 0a4558d044602058255db71f825a730642cc9b07 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 15:53:26 2021 +0300 util: imp os detection </s> remove // IsOpenWRT checks if OS is OpenWRT. </s> add // IsOpenWRT returns true if host OS is OpenWRT. </s> add "bytes" </s> remove return strings.Contains(string(body), "OpenWrt") </s> add // 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(etcDir, fileInfo.Name())) if err != nil { continue } if bytes.Contains(body, osNameData) { return true } } return false </s> remove body, err := ioutil.ReadFile("/etc/os-release") </s> add 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)
https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359
internal/util/helpers.go
keep keep keep keep replace keep keep keep keep keep
<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 master Updates #2757. Squashed commit of the following: commit 8e94e6a67ae702bd1b281b306555a4ce9ecc6391 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 17:02:24 2021 +0300 util: convert only once commit f1c74f4d18898f286d70c58f93b2fa21de6b5780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 16:22:51 2021 +0300 util: log changes, imp docs commit 0a4558d044602058255db71f825a730642cc9b07 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 15:53:26 2021 +0300 util: imp os detection </s> remove body, err := ioutil.ReadFile("/etc/os-release") </s> add 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) </s> remove return strings.Contains(string(body), "OpenWrt") </s> add // 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(etcDir, fileInfo.Name())) if err != nil { continue } if bytes.Contains(body, osNameData) { return true } } return false </s> add "path/filepath" </s> add "bytes"
https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359
internal/util/helpers.go
keep keep replace keep keep keep keep replace
<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 DNS/adguard-home from 2757-openwrt to master Updates #2757. Squashed commit of the following: commit 8e94e6a67ae702bd1b281b306555a4ce9ecc6391 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 17:02:24 2021 +0300 util: convert only once commit f1c74f4d18898f286d70c58f93b2fa21de6b5780 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 16:22:51 2021 +0300 util: log changes, imp docs commit 0a4558d044602058255db71f825a730642cc9b07 Author: Eugene Burkov <e.burkov@adguard.com> Date: Mon Mar 1 15:53:26 2021 +0300 util: imp os detection </s> remove // IsOpenWRT checks if OS is OpenWRT. </s> add // IsOpenWRT returns true if host OS is OpenWRT. </s> add "path/filepath" </s> add "bytes"
https://github.com/AdguardTeam/AdGuardHome/commit/91403d0b95e30e071bdf425a95e0f3746c76d359
internal/util/helpers.go
keep keep keep keep replace keep keep keep keep keep
<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> "requires": { <mask> "html-minifier": "^3.2.3", <mask> "loader-utils": "^0.2.16", </s> Move tiny-version-compare module to helpers </s> remove "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> add "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> remove "tiny-version-compare": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/tiny-version-compare/-/tiny-version-compare-0.9.1.tgz", "integrity": "sha512-kYim94l7ptSmj9rqxUMkrcMCJ448CS+hwqjA7OFcRi0ISdi0zjgdSUklQ4velVVECCjCo5frU3tNZ3oSgIKzsA==" }, </s> add </s> remove "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> add "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> remove "tiny-version-compare": "^0.9.1", </s> add </s> remove import versionCompare from 'tiny-version-compare'; </s> add </s> add import versionCompare from '../helpers/versionCompare';
https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846
client/package-lock.json
keep keep keep keep replace keep keep keep keep keep
<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, <mask> "requires": { <mask> "core-util-is": "~1.0.0", <mask> "inherits": "~2.0.1", </s> Move tiny-version-compare module to helpers </s> remove "tiny-version-compare": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/tiny-version-compare/-/tiny-version-compare-0.9.1.tgz", "integrity": "sha512-kYim94l7ptSmj9rqxUMkrcMCJ448CS+hwqjA7OFcRi0ISdi0zjgdSUklQ4velVVECCjCo5frU3tNZ3oSgIKzsA==" }, </s> add </s> remove "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> add "resolved": "http://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> remove "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> add "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> remove import versionCompare from 'tiny-version-compare'; </s> add </s> remove "tiny-version-compare": "^0.9.1", </s> add </s> add import versionCompare from '../helpers/versionCompare';
https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846
client/package-lock.json
keep keep keep keep replace keep keep keep keep keep
<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": { <mask> "version": "2.0.3", </s> Move tiny-version-compare module to helpers </s> remove "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> add "resolved": "http://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> remove "tiny-version-compare": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/tiny-version-compare/-/tiny-version-compare-0.9.1.tgz", "integrity": "sha512-kYim94l7ptSmj9rqxUMkrcMCJ448CS+hwqjA7OFcRi0ISdi0zjgdSUklQ4velVVECCjCo5frU3tNZ3oSgIKzsA==" }, </s> add </s> remove "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> add "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> remove "tiny-version-compare": "^0.9.1", </s> add </s> remove import versionCompare from 'tiny-version-compare'; </s> add </s> add import versionCompare from '../helpers/versionCompare';
https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846
client/package-lock.json
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<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-kYim94l7ptSmj9rqxUMkrcMCJ448CS+hwqjA7OFcRi0ISdi0zjgdSUklQ4velVVECCjCo5frU3tNZ3oSgIKzsA==" <mask> }, <mask> "tmp": { <mask> "version": "0.0.33", <mask> "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", <mask> "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", <mask> "dev": true, </s> Move tiny-version-compare module to helpers </s> remove "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> add "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> remove "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> add "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> remove "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> add "resolved": "http://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> remove "tiny-version-compare": "^0.9.1", </s> add </s> remove import versionCompare from 'tiny-version-compare'; </s> add </s> add import versionCompare from '../helpers/versionCompare';
https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846
client/package-lock.json
keep keep keep keep replace keep keep keep keep keep
<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> "babel-core": "6.26.0", </s> Move tiny-version-compare module to helpers </s> remove "tiny-version-compare": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/tiny-version-compare/-/tiny-version-compare-0.9.1.tgz", "integrity": "sha512-kYim94l7ptSmj9rqxUMkrcMCJ448CS+hwqjA7OFcRi0ISdi0zjgdSUklQ4velVVECCjCo5frU3tNZ3oSgIKzsA==" }, </s> add </s> remove "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> add "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> remove "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> add "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> remove "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> add "resolved": "http://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> remove import versionCompare from 'tiny-version-compare'; </s> add </s> add import versionCompare from '../helpers/versionCompare';
https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846
client/package.json
keep keep keep replace keep keep keep keep keep
<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 '../actions'; <mask> <mask> const settings = handleActions({ </s> Move tiny-version-compare module to helpers </s> add import versionCompare from '../helpers/versionCompare'; </s> remove "tiny-version-compare": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/tiny-version-compare/-/tiny-version-compare-0.9.1.tgz", "integrity": "sha512-kYim94l7ptSmj9rqxUMkrcMCJ448CS+hwqjA7OFcRi0ISdi0zjgdSUklQ4velVVECCjCo5frU3tNZ3oSgIKzsA==" }, </s> add </s> remove "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> add "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> remove "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> add "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> remove "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> add "resolved": "http://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> remove "tiny-version-compare": "^0.9.1", </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846
client/src/reducers/index.js
keep add keep keep keep keep
<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-compare'; </s> add </s> remove "tiny-version-compare": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/tiny-version-compare/-/tiny-version-compare-0.9.1.tgz", "integrity": "sha512-kYim94l7ptSmj9rqxUMkrcMCJ448CS+hwqjA7OFcRi0ISdi0zjgdSUklQ4velVVECCjCo5frU3tNZ3oSgIKzsA==" }, </s> add </s> remove "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> add "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", </s> remove "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> add "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", </s> remove "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> add "resolved": "http://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", </s> remove "tiny-version-compare": "^0.9.1", </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/9173b0ee7a94527870e9b35478e03d6030c26846
client/src/reducers/index.js
keep replace replace replace replace replace replace replace replace keep keep replace replace replace keep keep
<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) <mask> 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> </s> + auth: add more tests * use directory "./agh-test" </s> remove s := fmt.Sprintf("session=%s; Path=/; HttpOnly; Expires=%s", hex.EncodeToString(sess), expstr) w.Header().Set("Set-Cookie", s) </s> add 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 } cookie := httpCookie(req) if len(cookie) == 0 { time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return } w.Header().Set("Set-Cookie", cookie) </s> remove _ = os.RemoveAll(config.getDataDir()) defer func() { _ = os.RemoveAll(config.getDataDir()) }() </s> add func TestAuth(t *testing.T) { dir := prepareTestDir() defer func() { _ = os.RemoveAll(dir) }() fn := filepath.Join(dir, "sessions.db") </s> remove func TestAuth(t *testing.T) { config.ourWorkingDir = "." fn := filepath.Join(config.getDataDir(), "sessions.db") </s> add func prepareTestDir() string { const dir = "./agh-test" _ = os.RemoveAll(dir) _ = os.MkdirAll(dir, 0755) return dir } </s> add a := InitAuth(fn, nil) </s> remove os.MkdirAll(config.getDataDir(), 0755) a := InitAuth(fn, users) </s> add user := User{Name: "name"} a.UserAdd(&user, "password")
https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7
home/auth.go
keep keep keep keep replace replace keep keep keep keep keep
<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-Control", "no-store, no-cache, must-revalidate, proxy-revalidate") <mask> w.Header().Set("Pragma", "no-cache") <mask> w.Header().Set("Expires", "0") <mask> </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") </s> add a := InitAuth(fn, nil) </s> remove time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return </s> add return "" </s> remove _ = os.RemoveAll(config.getDataDir()) defer func() { _ = os.RemoveAll(config.getDataDir()) }() </s> add func TestAuth(t *testing.T) { dir := prepareTestDir() defer func() { _ = os.RemoveAll(dir) }() fn := filepath.Join(dir, "sessions.db") </s> remove 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 } </s> add func httpCookie(req loginJSON) string { </s> remove func TestAuth(t *testing.T) { config.ourWorkingDir = "." fn := filepath.Join(config.getDataDir(), "sessions.db") </s> add func prepareTestDir() string { const dir = "./agh-test" _ = os.RemoveAll(dir) _ = os.MkdirAll(dir, 0755) return dir }
https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7
home/auth.go
keep add keep keep keep keep
<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") </s> add a := InitAuth(fn, nil) </s> remove _ = os.RemoveAll(config.getDataDir()) defer func() { _ = os.RemoveAll(config.getDataDir()) }() </s> add func TestAuth(t *testing.T) { dir := prepareTestDir() defer func() { _ = os.RemoveAll(dir) }() fn := filepath.Join(dir, "sessions.db") </s> remove func TestAuth(t *testing.T) { config.ourWorkingDir = "." fn := filepath.Join(config.getDataDir(), "sessions.db") </s> add func prepareTestDir() string { const dir = "./agh-test" _ = os.RemoveAll(dir) _ = os.MkdirAll(dir, 0755) return dir } </s> remove s := fmt.Sprintf("session=%s; Path=/; HttpOnly; Expires=%s", hex.EncodeToString(sess), expstr) w.Header().Set("Set-Cookie", s) </s> add 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 } cookie := httpCookie(req) if len(cookie) == 0 { time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return } w.Header().Set("Set-Cookie", cookie) </s> remove time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return </s> add return ""
https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7
home/auth_test.go
keep keep keep replace replace replace keep replace replace keep
<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.getDataDir()) }() <mask> </s> + auth: add more tests * use directory "./agh-test" </s> remove 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 } </s> add func httpCookie(req loginJSON) string { </s> remove s := fmt.Sprintf("session=%s; Path=/; HttpOnly; Expires=%s", hex.EncodeToString(sess), expstr) w.Header().Set("Set-Cookie", s) </s> add 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 } cookie := httpCookie(req) if len(cookie) == 0 { time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return } w.Header().Set("Set-Cookie", cookie) </s> remove time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return </s> add return "" </s> remove os.MkdirAll(config.getDataDir(), 0755) a := InitAuth(fn, users) </s> add user := User{Name: "name"} a.UserAdd(&user, "password") </s> add a := InitAuth(fn, nil)
https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7
home/auth_test.go
keep keep add keep keep keep keep keep
<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 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") </s> remove _ = os.RemoveAll(config.getDataDir()) defer func() { _ = os.RemoveAll(config.getDataDir()) }() </s> add func TestAuth(t *testing.T) { dir := prepareTestDir() defer func() { _ = os.RemoveAll(dir) }() fn := filepath.Join(dir, "sessions.db") </s> remove time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return </s> add return "" </s> remove 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 } </s> add func httpCookie(req loginJSON) string { </s> remove s := fmt.Sprintf("session=%s; Path=/; HttpOnly; Expires=%s", hex.EncodeToString(sess), expstr) w.Header().Set("Set-Cookie", s) </s> add 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 } cookie := httpCookie(req) if len(cookie) == 0 { time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return } w.Header().Set("Set-Cookie", cookie) </s> remove func TestAuth(t *testing.T) { config.ourWorkingDir = "." fn := filepath.Join(config.getDataDir(), "sessions.db") </s> add func prepareTestDir() string { const dir = "./agh-test" _ = os.RemoveAll(dir) _ = os.MkdirAll(dir, 0755) return dir }
https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7
home/auth_test.go
keep keep keep keep replace replace keep keep keep keep keep
<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.RemoveSession("notfound") <mask> <mask> sess := getSession(&users[0]) </s> + auth: add more tests * use directory "./agh-test" </s> add a := InitAuth(fn, nil) </s> remove _ = os.RemoveAll(config.getDataDir()) defer func() { _ = os.RemoveAll(config.getDataDir()) }() </s> add func TestAuth(t *testing.T) { dir := prepareTestDir() defer func() { _ = os.RemoveAll(dir) }() fn := filepath.Join(dir, "sessions.db") </s> remove time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return </s> add return "" </s> remove func TestAuth(t *testing.T) { config.ourWorkingDir = "." fn := filepath.Join(config.getDataDir(), "sessions.db") </s> add func prepareTestDir() string { const dir = "./agh-test" _ = os.RemoveAll(dir) _ = os.MkdirAll(dir, 0755) return dir } </s> remove 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 } </s> add func httpCookie(req loginJSON) string { </s> remove s := fmt.Sprintf("session=%s; Path=/; HttpOnly; Expires=%s", hex.EncodeToString(sess), expstr) w.Header().Set("Set-Cookie", s) </s> add 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 } cookie := httpCookie(req) if len(cookie) == 0 { time.Sleep(1 * time.Second) httpError(w, http.StatusBadRequest, "invalid login or password") return } w.Header().Set("Set-Cookie", cookie)
https://github.com/AdguardTeam/AdGuardHome/commit/91bb9ccae69afadc06206d413d57c1c3b136e7a7
home/auth_test.go
keep keep keep replace keep keep keep keep keep
<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 './Examples'; <mask> import Check from './Check'; <mask> import { getTextareaCommentsHighlight, syncScroll } from '../../helpers/highlightTextareaComments'; </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove import { COMMENT_LINE_DEFAULT_TOKEN, isFirefox } from '../../helpers/constants'; </s> add import { COMMENT_LINE_DEFAULT_TOKEN } from '../../helpers/constants'; </s> remove isFirefox, </s> add </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px; </s> add position: relative; </s> remove height: 10rem; </s> add min-height: 240px; overflow: hidden; </s> remove { name: UPSTREAM_DNS_NAME, type: 'text', component: renderTextareaWithHighlightField, className: classnames('form-control form-control--textarea font-monospace text-input', { 'text-input--larger': isFirefox, }), containerClass: classnames('text-edit-container', { 'mb-4': !isFirefox, 'mb-6': isFirefox, }), placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/Filters/CustomRules.js
keep keep keep keep replace keep keep keep keep keep
<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/constants'; <mask> import '../ui/texareaCommentsHighlight.css'; <mask> <mask> class CustomRules extends Component { <mask> ref = React.createRef(); <mask> </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove import classnames from 'classnames'; </s> add </s> remove isFirefox, </s> add </s> remove { name: UPSTREAM_DNS_NAME, type: 'text', component: renderTextareaWithHighlightField, className: classnames('form-control form-control--textarea font-monospace text-input', { 'text-input--larger': isFirefox, }), containerClass: classnames('text-edit-container', { 'mb-4': !isFirefox, 'mb-6': isFirefox, }), placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, </s> add </s> remove subtitle: PropTypes.string.isRequired, </s> add </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px; </s> add position: relative;
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/Filters/CustomRules.js
keep keep replace replace replace keep replace replace replace replace replace replace replace replace
<mask> <> <mask> <PageTitle title={t('custom_filtering_rules')} /> <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> 'mb-4': !isFirefox, <mask> 'mb-6': isFirefox, <mask> })}> <mask> <textarea <mask> className={classnames('form-control font-monospace text-input form-control--textarea-large', { <mask> 'text-input--largest': isFirefox, <mask> })} </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove { name: UPSTREAM_DNS_NAME, type: 'text', component: renderTextareaWithHighlightField, className: classnames('form-control form-control--textarea font-monospace text-input', { 'text-input--larger': isFirefox, }), containerClass: classnames('text-edit-container', { 'mb-4': !isFirefox, 'mb-6': isFirefox, }), placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, </s> add </s> add <div className="col-12 mb-4"> <div className="text-edit-container"> <Field id={UPSTREAM_DNS_NAME} name={UPSTREAM_DNS_NAME} component={renderTextareaWithHighlightField} type="text" className="form-control form-control--textarea font-monospace text-input" placeholder={t('upstream_dns')} disabled={processingSetConfig || processingTestUpstream} normalizeOnBlur={removeEmptyLines} /> </div> </div> </s> remove isFirefox, </s> add </s> remove /> </s> add /> </s> remove classnames({ 'form-control--textarea-large': isFirefox }), </s> add undefined,
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/Filters/CustomRules.js
keep replace keep keep keep replace keep keep
<mask> onScroll={this.onScroll} <mask> /> <mask> {getTextareaCommentsHighlight( <mask> this.ref, <mask> userRules, <mask> classnames({ 'form-control--textarea-large': isFirefox }), <mask> [COMMENT_LINE_DEFAULT_TOKEN, '!'], <mask> )} </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove <div className={classnames('col-12 text-edit-container form-control--textarea-large', { 'mb-4': !isFirefox, 'mb-6': isFirefox, })}> <textarea className={classnames('form-control font-monospace text-input form-control--textarea-large', { 'text-input--largest': isFirefox, })} </s> add <div className="text-edit-container mb-4"> <textarea className="form-control font-monospace text-input" </s> remove { name: UPSTREAM_DNS_NAME, type: 'text', component: renderTextareaWithHighlightField, className: classnames('form-control form-control--textarea font-monospace text-input', { 'text-input--larger': isFirefox, }), containerClass: classnames('text-edit-container', { 'mb-4': !isFirefox, 'mb-6': isFirefox, }), placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, </s> add </s> add <div className="col-12 mb-4"> <div className="text-edit-container"> <Field id={UPSTREAM_DNS_NAME} name={UPSTREAM_DNS_NAME} component={renderTextareaWithHighlightField} type="text" className="form-control form-control--textarea font-monospace text-input" placeholder={t('upstream_dns')} disabled={processingSetConfig || processingTestUpstream} normalizeOnBlur={removeEmptyLines} /> </div> </div> </s> remove import { COMMENT_LINE_DEFAULT_TOKEN, isFirefox } from '../../helpers/constants'; </s> add import { COMMENT_LINE_DEFAULT_TOKEN } from '../../helpers/constants'; </s> remove <Card subtitle={t('custom_filter_rules_hint')} > </s> add <Card subtitle={t('custom_filter_rules_hint')}>
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/Filters/CustomRules.js
keep keep keep keep replace keep keep keep keep keep
<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 { testUpstreamWithFormValues } from '../../../../actions'; <mask> import { removeEmptyLines, trimLinesAndRemoveEmpty } from '../../../../helpers/helpers'; <mask> import { getTextareaCommentsHighlight, syncScroll } from '../../../../helpers/highlightTextareaComments'; </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove import classnames from 'classnames'; </s> add </s> remove import { COMMENT_LINE_DEFAULT_TOKEN, isFirefox } from '../../helpers/constants'; </s> add import { COMMENT_LINE_DEFAULT_TOKEN } from '../../helpers/constants'; </s> remove { name: UPSTREAM_DNS_NAME, type: 'text', component: renderTextareaWithHighlightField, className: classnames('form-control form-control--textarea font-monospace text-input', { 'text-input--larger': isFirefox, }), containerClass: classnames('text-edit-container', { 'mb-4': !isFirefox, 'mb-6': isFirefox, }), placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, </s> add </s> remove <div className={classnames('col-12 text-edit-container form-control--textarea-large', { 'mb-4': !isFirefox, 'mb-6': isFirefox, })}> <textarea className={classnames('form-control font-monospace text-input form-control--textarea-large', { 'text-input--largest': isFirefox, })} </s> add <div className="text-edit-container mb-4"> <textarea className="form-control font-monospace text-input" </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px; </s> add position: relative;
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/Settings/Dns/Upstream/Form.js
keep keep keep replace keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep
<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 = [ <mask> { <mask> name: UPSTREAM_DNS_NAME, <mask> type: 'text', <mask> component: renderTextareaWithHighlightField, <mask> className: classnames('form-control form-control--textarea font-monospace text-input', { <mask> 'text-input--larger': isFirefox, <mask> }), <mask> containerClass: classnames('text-edit-container', { <mask> 'mb-4': !isFirefox, <mask> 'mb-6': isFirefox, <mask> }), <mask> placeholder: 'upstream_dns', <mask> normalizeOnBlur: removeEmptyLines, <mask> }, <mask> { <mask> name: UPSTREAM_MODE_NAME, <mask> type: 'radio', </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove <div className={classnames('col-12 text-edit-container form-control--textarea-large', { 'mb-4': !isFirefox, 'mb-6': isFirefox, })}> <textarea className={classnames('form-control font-monospace text-input form-control--textarea-large', { 'text-input--largest': isFirefox, })} </s> add <div className="text-edit-container mb-4"> <textarea className="form-control font-monospace text-input" </s> remove <Card subtitle={t('custom_filter_rules_hint')} > </s> add <Card subtitle={t('custom_filter_rules_hint')}> </s> remove isFirefox, </s> add </s> remove import { COMMENT_LINE_DEFAULT_TOKEN, isFirefox } from '../../helpers/constants'; </s> add import { COMMENT_LINE_DEFAULT_TOKEN } from '../../helpers/constants'; </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px;
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/Settings/Dns/Upstream/Form.js
keep keep add keep keep keep keep keep
<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: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove classnames({ 'form-control--textarea-large': isFirefox }), </s> add undefined, </s> remove <Card subtitle={t('custom_filter_rules_hint')} > </s> add <Card subtitle={t('custom_filter_rules_hint')}> </s> remove <div className={classnames('col-12 text-edit-container form-control--textarea-large', { 'mb-4': !isFirefox, 'mb-6': isFirefox, })}> <textarea className={classnames('form-control font-monospace text-input form-control--textarea-large', { 'text-input--largest': isFirefox, })} </s> add <div className="text-edit-container mb-4"> <textarea className="form-control font-monospace text-input" </s> remove /> </s> add /> </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px; </s> add position: relative;
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/Settings/Dns/Upstream/Form.js
keep keep replace keep keep keep keep keep
<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 commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> add position: relative; </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px; </s> remove } .form--upstream .text-input, .form--upstream .text-output { width: 98%; left: 1%; </s> add overscroll-behavior: none; </s> remove isFirefox, </s> add </s> remove import { COMMENT_LINE_DEFAULT_TOKEN, isFirefox } from '../../helpers/constants'; </s> add import { COMMENT_LINE_DEFAULT_TOKEN } from '../../helpers/constants'; </s> remove { name: UPSTREAM_DNS_NAME, type: 'text', component: renderTextareaWithHighlightField, className: classnames('form-control form-control--textarea font-monospace text-input', { 'text-input--larger': isFirefox, }), containerClass: classnames('text-edit-container', { 'mb-4': !isFirefox, 'mb-6': isFirefox, }), placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/ui/texareaCommentsHighlight.css
keep keep keep keep replace keep keep replace
<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; </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove } .form--upstream .text-input, .form--upstream .text-output { width: 98%; left: 1%; </s> add overscroll-behavior: none; </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px; </s> remove height: 10rem; </s> add min-height: 240px; overflow: hidden; </s> add position: relative; </s> add <div className="col-12 mb-4"> <div className="text-edit-container"> <Field id={UPSTREAM_DNS_NAME} name={UPSTREAM_DNS_NAME} component={renderTextareaWithHighlightField} type="text" className="form-control form-control--textarea font-monospace text-input" placeholder={t('upstream_dns')} disabled={processingSetConfig || processingTestUpstream} normalizeOnBlur={removeEmptyLines} /> </div> </div>
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/ui/texareaCommentsHighlight.css
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<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> .text-input { <mask> opacity: 1; <mask> resize: none; </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove padding: 1rem; </s> add padding: 16px; </s> remove line-height: 1.5rem; </s> add line-height: 24px; </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px; </s> add position: relative; </s> remove height: 10rem; </s> add min-height: 240px; overflow: hidden; </s> remove isFirefox, </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/ui/texareaCommentsHighlight.css
keep keep keep add keep keep keep keep keep
<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 of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove resize: none; height: 10rem; } .text-input--larger { height: 11rem; } .text-input--largest { height: 16rem; </s> add min-height: 240px; </s> remove } .form--upstream .text-input, .form--upstream .text-output { width: 98%; left: 1%; </s> add overscroll-behavior: none; </s> remove height: 10rem; </s> add min-height: 240px; overflow: hidden; </s> remove isFirefox, </s> add </s> remove import { COMMENT_LINE_DEFAULT_TOKEN, isFirefox } from '../../helpers/constants'; </s> add import { COMMENT_LINE_DEFAULT_TOKEN } from '../../helpers/constants'; </s> remove { name: UPSTREAM_DNS_NAME, type: 'text', component: renderTextareaWithHighlightField, className: classnames('form-control form-control--textarea font-monospace text-input', { 'text-input--larger': isFirefox, }), containerClass: classnames('text-edit-container', { 'mb-4': !isFirefox, 'mb-6': isFirefox, }), placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/ui/texareaCommentsHighlight.css
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<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> pointer-events: none; <mask> z-index: 3; </s> Pull request #1273: 3438 make highlighted inputs resizable Merge in DNS/adguard-home from 3438-inputs-height to master Squashed commit of the following: commit a049febdc8490505d665c0939c01a14da997f861 Merge: 7035339b 42b2c3ab Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:36:58 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 7035339b26fa205a844e79713179c7b623c90ce0 Merge: 20ef34c4 784bc318 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 17:28:06 2021 +0300 Merge branch 'master' into 3438-inputs-height commit 20ef34c4a6078658c444e310800923b8b3f74c1c Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:41:46 2021 +0300 client: remove unused commit f2ace4ef452bbdc4b955e510aa07d1c93ec79ee4 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Aug 16 13:30:58 2021 +0300 client: make highlighted inputs resizable </s> remove } .form--upstream .text-input, .form--upstream .text-output { width: 98%; left: 1%; </s> add overscroll-behavior: none; </s> add position: relative; </s> remove height: 10rem; </s> add min-height: 240px; overflow: hidden; </s> remove isFirefox, </s> add </s> remove line-height: 1.5rem; </s> add line-height: 24px; </s> remove padding: 1rem; </s> add padding: 16px;
https://github.com/AdguardTeam/AdGuardHome/commit/91c1c9e61d8c984251f1b59988b2b2867dd48ea0
client/src/components/ui/texareaCommentsHighlight.css
keep keep add keep keep keep keep keep
<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 per-client tags </s> add Tags []string `json:"tags"` </s> add Tags []string </s> add Tags []string `yaml:"tags"` </s> add Tags []string `json:"supported_tags"` </s> add func (clients *clientsContainer) tagKnown(tag string) bool { _, ok := clients.allTags[tag] return ok } </s> remove return d.matchHost(host, qtype) </s> add return d.matchHost(host, qtype, setts.ClientTags)
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<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(host string, qtype uint16, setts *RequestFilteringSettings) (Result, error) { </s> + clients: support per-client tags </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { </s> remove result, err = d.matchHost(host, qtype) </s> add result, err = d.matchHost(host, qtype, setts.ClientTags) </s> remove frules, ok := d.filteringEngine.Match(host) </s> add frules, ok := d.filteringEngine.Match(host, ctags) </s> remove func (c *Client) check() error { </s> add func (clients *clientsContainer) check(c *Client) error { </s> remove err := c.check() </s> add err := clients.check(&c) </s> remove e := c.check() </s> add e := clients.check(&c)
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<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 </s> remove err := c.check() </s> add err := clients.check(&c) </s> add for _, t := range c.Tags { if !clients.tagKnown(t) { return fmt.Errorf("Invalid tag: %s", t) } } sort.Strings(c.Tags) </s> add 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) </s> add setts.ClientTags = c.Tags </s> remove return d.matchHost(host, qtype) </s> add return d.matchHost(host, qtype, setts.ClientTags) </s> remove frules, ok := d.filteringEngine.Match(host) </s> add frules, ok := d.filteringEngine.Match(host, ctags)
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<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.RUnlock() <mask> if d.filteringEngine == nil { <mask> return Result{}, nil <mask> } </s> + clients: support per-client tags </s> remove return d.matchHost(host, qtype) </s> add return d.matchHost(host, qtype, setts.ClientTags) </s> remove frules, ok := d.filteringEngine.Match(host) </s> add frules, ok := d.filteringEngine.Match(host, ctags) </s> remove err := c.check() </s> add err := clients.check(&c) </s> add allTags map[string]bool </s> remove e := c.check() </s> add e := clients.check(&c) </s> add func stringArrayDup(a []string) []string { a2 := make([]string, len(a)) copy(a2, a) return a2 }
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<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 tags </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { </s> remove return d.matchHost(host, qtype) </s> add return d.matchHost(host, qtype, setts.ClientTags) </s> add 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) </s> add for _, t := range c.Tags { if !clients.tagKnown(t) { return fmt.Errorf("Invalid tag: %s", t) } } sort.Strings(c.Tags) </s> remove result, err = d.matchHost(host, qtype) </s> add result, err = d.matchHost(host, qtype, setts.ClientTags) </s> remove func (c *Client) check() error { </s> add func (clients *clientsContainer) check(c *Client) error {
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<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> github.com/gobuffalo/packr v1.19.0 <mask> github.com/joomcode/errorx v1.0.0 </s> + clients: support per-client tags </s> remove github.com/AdguardTeam/urlfilter v0.7.2 h1:0XyepkVAvY1eYtNKgDRCkookfaBmROvY6VE23ebPUNc= github.com/AdguardTeam/urlfilter v0.7.2/go.mod h1:GHXPzEG59ezyff22lXSQ7dicj1kFZBrH5kmZ6EvQzfk= </s> add github.com/AdguardTeam/urlfilter v0.8.1 h1:9YRQOR15DU7+k01PWAgc/Ay12jjxVqSi6P0+whFm0f4= github.com/AdguardTeam/urlfilter v0.8.1/go.mod h1:GHXPzEG59ezyff22lXSQ7dicj1kFZBrH5kmZ6EvQzfk= </s> add allTags map[string]bool </s> remove e := c.check() </s> add e := clients.check(&c) </s> remove return d.matchHost(host, qtype) </s> add return d.matchHost(host, qtype, setts.ClientTags) </s> add Tags []string </s> remove err := c.check() </s> add err := clients.check(&c)
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
go.mod
keep keep keep keep replace replace keep keep keep keep keep
<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/AdguardTeam/urlfilter v0.7.0/go.mod h1:GHXPzEG59ezyff22lXSQ7dicj1kFZBrH5kmZ6EvQzfk= <mask> github.com/AdguardTeam/urlfilter v0.7.2 h1:0XyepkVAvY1eYtNKgDRCkookfaBmROvY6VE23ebPUNc= <mask> github.com/AdguardTeam/urlfilter v0.7.2/go.mod h1:GHXPzEG59ezyff22lXSQ7dicj1kFZBrH5kmZ6EvQzfk= <mask> github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= <mask> github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= <mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 h1:UUppSQnhf4Yc6xGxSkoQpPhb7RVzuv5Nb1mwJ5VId9s= <mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= <mask> github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= </s> + clients: support per-client tags </s> remove github.com/AdguardTeam/urlfilter v0.7.2 </s> add github.com/AdguardTeam/urlfilter v0.8.1 </s> add setts.ClientTags = c.Tags </s> add func (clients *clientsContainer) tagKnown(tag string) bool { _, ok := clients.allTags[tag] return ok } </s> remove return d.matchHost(host, qtype) </s> add return d.matchHost(host, qtype, setts.ClientTags) </s> remove result, err = d.matchHost(host, qtype) </s> add result, err = d.matchHost(host, qtype, setts.ClientTags) </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) {
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
go.sum
keep keep add keep keep keep keep keep
<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> add setts.ClientTags = c.Tags </s> add func (clients *clientsContainer) tagKnown(tag string) bool { _, ok := clients.allTags[tag] return ok } </s> remove return d.matchHost(host, qtype) </s> add return d.matchHost(host, qtype, setts.ClientTags) </s> remove result, err = d.matchHost(host, qtype) </s> add result, err = d.matchHost(host, qtype, setts.ClientTags) </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { </s> remove frules, ok := d.filteringEngine.Match(host) </s> add frules, ok := d.filteringEngine.Match(host, ctags)
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
home/clients.go
keep add keep keep keep keep keep
<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 </s> add Tags []string `json:"tags"` </s> add Tags []string `yaml:"tags"` </s> add ClientTags []string </s> add func (clients *clientsContainer) tagKnown(tag string) bool { _, ok := clients.allTags[tag] return ok } </s> add Tags []string `json:"supported_tags"` </s> add allTags map[string]bool
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
home/clients.go
keep keep add keep keep keep keep keep
<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: support per-client tags </s> add func stringArrayDup(a []string) []string { a2 := make([]string, len(a)) copy(a2, a) return a2 } </s> remove func (d *Dnsfilter) matchHost(host string, qtype uint16) (Result, error) { </s> add func (d *Dnsfilter) matchHost(host string, qtype uint16, ctags []string) (Result, error) { </s> add clients.allTags = make(map[string]bool) for _, t := range clientTags { clients.allTags[t] = false } </s> remove e := c.check() </s> add e := clients.check(&c) </s> add for _, t := range c.Tags { if !clients.tagKnown(t) { return fmt.Errorf("Invalid tag: %s", t) } } sort.Strings(c.Tags) </s> add func (clients *clientsContainer) tagKnown(tag string) bool { _, ok := clients.allTags[tag] return ok }
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
home/clients.go
keep add keep keep keep keep
<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> add setts.ClientTags = c.Tags </s> remove return clients.findByIP(ip) </s> add 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 </s> remove result, err = d.matchHost(host, qtype) </s> add result, err = d.matchHost(host, qtype, setts.ClientTags) </s> remove cy.IDs = make([]string, len(cli.IDs)) copy(cy.IDs, cli.IDs) cy.BlockedServices = make([]string, len(cli.BlockedServices)) copy(cy.BlockedServices, cli.BlockedServices) cy.Upstreams = make([]string, len(cli.Upstreams)) copy(cy.Upstreams, cli.Upstreams) </s> add cy.Tags = stringArrayDup(cli.Tags) cy.IDs = stringArrayDup(cli.IDs) cy.BlockedServices = stringArrayDup(cli.BlockedServices) cy.Upstreams = stringArrayDup(cli.Upstreams) </s> add data.Tags = clientTags </s> add 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)
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
home/clients.go
keep add keep keep keep keep keep
<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:"parental_enabled"` <mask> SafeSearchEnabled bool `yaml:"safesearch_enabled"` </s> + clients: support per-client tags </s> add Tags []string `json:"tags"` </s> add Tags []string </s> add ClientTags []string </s> add func (clients *clientsContainer) tagKnown(tag string) bool { _, ok := clients.allTags[tag] return ok } </s> add Tags []string `json:"supported_tags"` </s> add allTags map[string]bool
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
home/clients.go
keep keep keep add keep keep keep keep keep
<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: support per-client tags </s> add 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) </s> add for _, t := range c.Tags { if !clients.tagKnown(t) { return fmt.Errorf("Invalid tag: %s", t) } } sort.Strings(c.Tags) </s> add func stringArrayDup(a []string) []string { a2 := make([]string, len(a)) copy(a2, a) return a2 } </s> add clients.allTags = make(map[string]bool) for _, t := range clientTags { clients.allTags[t] = false } </s> add Tags []string `json:"supported_tags"` </s> remove err := c.check() </s> add err := clients.check(&c)
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
home/clients.go
keep keep add keep keep keep keep
<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> add for _, t := range c.Tags { if !clients.tagKnown(t) { return fmt.Errorf("Invalid tag: %s", t) } } sort.Strings(c.Tags) </s> remove err := c.check() </s> add err := clients.check(&c) </s> remove result, err = d.matchHost(host, qtype) </s> add result, err = d.matchHost(host, qtype, setts.ClientTags) </s> add func (clients *clientsContainer) tagKnown(tag string) bool { _, ok := clients.allTags[tag] return ok } </s> remove frules, ok := d.filteringEngine.Match(host) </s> add frules, ok := d.filteringEngine.Match(host, ctags) </s> add clients.allTags = make(map[string]bool) for _, t := range clientTags { clients.allTags[t] = false }
https://github.com/AdguardTeam/AdGuardHome/commit/91c271236605b3e4c22a1d673c25f91536223b7f
home/clients.go