docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
const MaxPackageFileSize = 32 * 10 * 1024
<mask> <mask> // MaxPackageFileSize is a maximum package file length in bytes. The largest <mask> // package whose size is limited by this constant currently has the size of <mask> // approximately 9 MiB. <mask> const MaxPackageFileSize = 32 * 1024 * 1024 <mask> <mask> // Download package file and save it to disk <mask> func (u *Updater) downloadPackageFile() (err error) { <mask> var resp *http.Response <mask> resp, err = u.client.Get(u.packageURL) </s> Pull request 1752: 5373-mips-autoupdate Updates #5270. Updates #5373. Squashed commit of the following: commit ad4654fa63beac13c4fbb38aa8fd06eaec25cb5e Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Feb 27 17:00:28 2023 +0300 updater: imp docs commit c3482766df6b831eae529e209ea7fa0a87f1b417 Merge: 1cbee78b 386add03 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Feb 27 16:59:13 2023 +0300 Merge branch 'master' into 5373-mips-autoupdate commit 1cbee78b94914c7d72c837cd2fad96a50ac2c30a Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Feb 27 11:57:28 2023 +0300 all: fix autoupdate on mips* </s> remove // downloadURL returns the download URL for current build. func (u *Updater) downloadURL(json map[string]string) (string, bool) { var key string </s> add // downloadURL returns the download URL for current build as well as its key in // versionObj. If the key is not found, it additionally prints an informative // log message. func (u *Updater) downloadURL(versionObj map[string]string) (dlURL, key string, ok bool) { </s> remove return fmt.Errorf("copySupportingFiles(%s, %s) failed: %s", u.updateDir, u.workDir, err) </s> add return fmt.Errorf("copySupportingFiles(%s, %s) failed: %w", u.updateDir, u.workDir, err) </s> remove packageURL, ok := u.downloadURL(versionJSON) if !ok { return info, fmt.Errorf("version.json: packageURL not found") </s> add packageURL, key, found := u.downloadURL(versionJSON) if !found { return info, fmt.Errorf("version.json: no package URL: key %q not found in object", key) </s> remove return val, true </s> add keys := maps.Keys(versionObj) slices.Sort(keys) log.Error("updater: key %q not found; got keys %q", key, keys) return "", key, false } // isMIPS returns true if arch is any MIPS architecture. func isMIPS(arch string) (ok bool) { switch arch { case "mips", "mips64", "mips64le", "mipsle": return true default: return false }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bb80a7c2159c25189ec9940f20c4436a86e81968
internal/updater/updater.go
AsyncStartup bool `yaml:"-"`
<mask> // Create dnsfilter asynchronously. <mask> // Requests won't be filtered until dnsfilter is created. <mask> // If "restart" command is received while we're creating an old dnsfilter object, <mask> // we delay creation of the new object until the old one is created. <mask> AsyncStartup bool <mask> <mask> ProtectionEnabled bool `yaml:"protection_enabled"` // whether or not use any of dnsfilter features <mask> FilteringEnabled bool `yaml:"filtering_enabled"` // whether or not use filter lists <mask> FiltersUpdateIntervalHours uint32 `yaml:"filters_update_interval"` // time period to update filters (in hours) <mask> </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove // Set new configuration at runtime. // limit: time limit (in days) Configure(limit int) // Reset counters and clear database Clear() </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
dnsforward/dnsforward.go
<mask> log.Error("Couldn't parse config file: %s", err) <mask> return err <mask> } <mask> <mask> if !checkStatsInterval(config.DNS.StatsInterval) { <mask> config.DNS.StatsInterval = 1 <mask> } <mask> if !checkFiltersUpdateIntervalHours(config.DNS.FiltersUpdateIntervalHours) { <mask> config.DNS.FiltersUpdateIntervalHours = 24 <mask> } <mask> <mask> if !checkQueryLogInterval(config.DNS.QueryLogInterval) { </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, </s> add Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, ConfigModified: onConfigModified, HTTPRegister: httpRegister, </s> remove func (s *statsCtx) Configure(limit int) { if limit < 0 { return } s.limit = uint32(limit) * 24 log.Debug("Stats: set limit: %d", limit) </s> add func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
home/config.go
if config.stats != nil { sdc := stats.DiskConfig{} config.stats.WriteDiskConfig(&sdc) config.DNS.StatsInterval = sdc.Interval }
<mask> } <mask> <mask> configFile := config.getConfigFilename() <mask> log.Debug("Writing YAML file: %s", configFile) <mask> yamlText, err := yaml.Marshal(&config) <mask> config.Clients = nil </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove if !checkStatsInterval(config.DNS.StatsInterval) { config.DNS.StatsInterval = 1 } </s> add </s> remove Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, </s> add Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, ConfigModified: onConfigModified, HTTPRegister: httpRegister,
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
home/config.go
<mask> RegisterClientsHandlers() <mask> registerRewritesHandlers() <mask> RegisterBlockedServicesHandlers() <mask> RegisterQueryLogHandlers() <mask> RegisterStatsHandlers() <mask> RegisterAuthHandlers() <mask> <mask> http.HandleFunc("/dns-query", postInstall(handleDOH)) <mask> } <mask> </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove type httpHandlerType func(http.ResponseWriter, *http.Request) func httpRegister(method string, url string, handler httpHandlerType) { </s> add func httpRegister(method string, url string, handler func(http.ResponseWriter, *http.Request)) { </s> remove d := s.GetData(Hours) </s> add d := s.getData(Hours) </s> remove if !checkStatsInterval(config.DNS.StatsInterval) { config.DNS.StatsInterval = 1 } </s> add </s> remove func (s *statsCtx) Configure(limit int) { if limit < 0 { return } s.limit = uint32(limit) * 24 log.Debug("Stats: set limit: %d", limit) </s> add func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
home/control.go
func httpRegister(method string, url string, handler func(http.ResponseWriter, *http.Request)) {
<mask> <mask> http.HandleFunc("/dns-query", postInstall(handleDOH)) <mask> } <mask> <mask> type httpHandlerType func(http.ResponseWriter, *http.Request) <mask> <mask> func httpRegister(method string, url string, handler httpHandlerType) { <mask> http.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) <mask> } </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove RegisterStatsHandlers() </s> add </s> remove func (s *statsCtx) Configure(limit int) { if limit < 0 { return } s.limit = uint32(limit) * 24 log.Debug("Stats: set limit: %d", limit) </s> add func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24 </s> remove if !checkStatsInterval(config.DNS.StatsInterval) { config.DNS.StatsInterval = 1 } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
home/control.go
// Called by other modules when configuration is changed func onConfigModified() { _ = config.write() }
<mask> rdns *RDNS <mask> whois *Whois <mask> } <mask> <mask> // initDNSServer creates an instance of the dnsforward.Server <mask> // Please note that we must do it even if we don't start it <mask> // so that we had access to the query log and the stats <mask> func initDNSServer(baseDir string) { <mask> err := os.MkdirAll(baseDir, 0755) <mask> if err != nil { </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove AsyncStartup bool </s> add AsyncStartup bool `yaml:"-"` </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} { </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
home/dns.go
Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, ConfigModified: onConfigModified, HTTPRegister: httpRegister,
<mask> log.Fatalf("Cannot create DNS data dir at %s: %s", baseDir, err) <mask> } <mask> <mask> statsConf := stats.Config{ <mask> Filename: filepath.Join(baseDir, "stats.db"), <mask> LimitDays: config.DNS.StatsInterval, <mask> } <mask> config.stats, err = stats.New(statsConf) <mask> if err != nil { <mask> log.Fatal("Couldn't initialize statistics module") <mask> } </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove if !checkStatsInterval(config.DNS.StatsInterval) { config.DNS.StatsInterval = 1 } </s> add </s> remove s, _ := New(conf) </s> add s, _ := createObject(conf)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
home/dns.go
"net/http"
<mask> <mask> import ( <mask> "net" <mask> ) <mask> <mask> type unitIDCallback func() uint32 <mask> <mask> // DiskConfig - configuration settings that are stored on disk </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove // Get data GetData(timeUnit TimeUnit) map[string]interface{} </s> add // WriteDiskConfig - write configuration WriteDiskConfig(dc *DiskConfig) </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats.go
// DiskConfig - configuration settings that are stored on disk type DiskConfig struct { Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days) }
<mask> type unitIDCallback func() uint32 <mask> <mask> // Config - module configuration <mask> type Config struct { <mask> Filename string // database file name <mask> LimitDays uint32 // time limit (in days) </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove // Get data GetData(timeUnit TimeUnit) map[string]interface{} </s> add // WriteDiskConfig - write configuration WriteDiskConfig(dc *DiskConfig) </s> remove // Set new configuration at runtime. // limit: time limit (in days) Configure(limit int) // Reset counters and clear database Clear() </s> add </s> remove AsyncStartup bool </s> add AsyncStartup bool `yaml:"-"`
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats.go
// Called when the configuration is changed by HTTP request ConfigModified func() // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
<mask> Filename string // database file name <mask> LimitDays uint32 // time limit (in days) <mask> UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used. <mask> } <mask> <mask> // New - create object <mask> func New(conf Config) (Stats, error) { <mask> return createObject(conf) </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove AsyncStartup bool </s> add AsyncStartup bool `yaml:"-"` </s> remove // Set new configuration at runtime. // limit: time limit (in days) Configure(limit int) // Reset counters and clear database Clear() </s> add </s> remove // Get data GetData(timeUnit TimeUnit) map[string]interface{} </s> add // WriteDiskConfig - write configuration WriteDiskConfig(dc *DiskConfig)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats.go
<mask> // This function is not thread safe <mask> // (can't be called in parallel with any other function of this interface). <mask> Close() <mask> <mask> // Set new configuration at runtime. <mask> // limit: time limit (in days) <mask> Configure(limit int) <mask> <mask> // Reset counters and clear database <mask> Clear() <mask> <mask> // Update counters <mask> Update(e Entry) <mask> <mask> // Get data <mask> GetData(timeUnit TimeUnit) map[string]interface{} </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove // Get data GetData(timeUnit TimeUnit) map[string]interface{} </s> add // WriteDiskConfig - write configuration WriteDiskConfig(dc *DiskConfig) </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() { </s> remove AsyncStartup bool </s> add AsyncStartup bool `yaml:"-"`
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats.go
// WriteDiskConfig - write configuration WriteDiskConfig(dc *DiskConfig)
<mask> <mask> // Update counters <mask> Update(e Entry) <mask> <mask> // Get data <mask> GetData(timeUnit TimeUnit) map[string]interface{} <mask> } <mask> <mask> // TimeUnit - time unit <mask> type TimeUnit int <mask> </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove // Set new configuration at runtime. // limit: time limit (in days) Configure(limit int) // Reset counters and clear database Clear() </s> add </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats.go
s, _ := createObject(conf)
<mask> conf := Config{ <mask> Filename: "./stats.db", <mask> LimitDays: 1, <mask> } <mask> s, _ := New(conf) <mask> <mask> e := Entry{} <mask> <mask> e.Domain = "domain" <mask> e.Client = net.ParseIP("127.0.0.1") </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove s, _ := New(conf) </s> add s, _ := createObject(conf) </s> remove Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, </s> add Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, ConfigModified: onConfigModified, HTTPRegister: httpRegister, </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_test.go
d := s.getData(Hours)
<mask> e.Result = RNotFiltered <mask> e.Time = 123456 <mask> s.Update(e) <mask> <mask> d := s.GetData(Hours) <mask> a := []uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2} <mask> assert.True(t, UIntArrayEquals(d["dns_queries"].([]uint64), a)) <mask> <mask> a = []uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1} <mask> assert.True(t, UIntArrayEquals(d["blocked_filtering"].([]uint64), a)) </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove d := s.GetData(Hours) </s> add d := s.getData(Hours) </s> remove s.Clear() </s> add s.clear() </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} { </s> remove s, _ := New(conf) </s> add s, _ := createObject(conf)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_test.go
s.clear()
<mask> assert.True(t, d["num_replaced_safesearch"].(uint64) == 0) <mask> assert.True(t, d["num_replaced_parental"].(uint64) == 0) <mask> assert.True(t, d["avg_processing_time"].(float64) == 0.123456) <mask> <mask> s.Clear() <mask> s.Close() <mask> os.Remove(conf.Filename) <mask> } <mask> <mask> func TestLargeNumbers(t *testing.T) { </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove d := s.GetData(Hours) </s> add d := s.getData(Hours) </s> remove d := s.GetData(Hours) </s> add d := s.getData(Hours) </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_test.go
s, _ := createObject(conf)
<mask> LimitDays: 1, <mask> UnitID: newID, <mask> } <mask> os.Remove(conf.Filename) <mask> s, _ := New(conf) <mask> e := Entry{} <mask> <mask> n := 1000 // number of distinct clients and domains every hour <mask> for h := 0; h != 12; h++ { <mask> if h != 0 { </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove s, _ := New(conf) </s> add s, _ := createObject(conf) </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() { </s> remove Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, </s> add Filename: filepath.Join(baseDir, "stats.db"), LimitDays: config.DNS.StatsInterval, ConfigModified: onConfigModified, HTTPRegister: httpRegister,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_test.go
d := s.getData(Hours)
<mask> s.Update(e) <mask> } <mask> } <mask> <mask> d := s.GetData(Hours) <mask> assert.True(t, d["num_dns_queries"].(uint64) == uint64(int(hour)*n)) <mask> <mask> s.Close() <mask> os.Remove(conf.Filename) <mask> } </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove s.Clear() </s> add s.clear() </s> remove d := s.GetData(Hours) </s> add d := s.getData(Hours) </s> remove s, _ := New(conf) </s> add s, _ := createObject(conf)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_test.go
if !checkInterval(conf.LimitDays) { conf.LimitDays = 1 }
<mask> func createObject(conf Config) (*statsCtx, error) { <mask> s := statsCtx{} <mask> s.limit = conf.LimitDays * 24 <mask> s.conf = conf <mask> if conf.UnitID == nil { <mask> s.conf.UnitID = newUnitID </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove func (s *statsCtx) Configure(limit int) { if limit < 0 { return } s.limit = uint32(limit) * 24 log.Debug("Stats: set limit: %d", limit) </s> add func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24 </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} { </s> remove if !checkStatsInterval(config.DNS.StatsInterval) { config.DNS.StatsInterval = 1 } </s> add </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() {
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_unit.go
s.initWeb()
<mask> deserialize(&u, udb) <mask> } <mask> s.unit = &u <mask> <mask> go s.periodicFlush() <mask> <mask> log.Debug("Stats: initialized") <mask> return &s, nil <mask> } </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove func (s *statsCtx) Configure(limit int) { if limit < 0 { return } s.limit = uint32(limit) * 24 log.Debug("Stats: set limit: %d", limit) </s> add func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24 </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() { </s> remove if !checkStatsInterval(config.DNS.StatsInterval) { config.DNS.StatsInterval = 1 } </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_unit.go
func checkInterval(days uint32) bool { return days == 1 || days == 7 || days == 30 || days == 90 }
<mask> log.Debug("Stats: initialized") <mask> return &s, nil <mask> } <mask> <mask> func (s *statsCtx) dbOpen() bool { <mask> var err error <mask> log.Tracef("db.Open...") <mask> s.db, err = bolt.Open(s.conf.Filename, 0644, nil) </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove func (s *statsCtx) Configure(limit int) { if limit < 0 { return } s.limit = uint32(limit) * 24 log.Debug("Stats: set limit: %d", limit) </s> add func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24 </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() { </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} { </s> remove if !checkStatsInterval(config.DNS.StatsInterval) { config.DNS.StatsInterval = 1 } </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_unit.go
func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24
<mask> } <mask> return m <mask> } <mask> <mask> func (s *statsCtx) Configure(limit int) { <mask> if limit < 0 { <mask> return <mask> } <mask> s.limit = uint32(limit) * 24 <mask> log.Debug("Stats: set limit: %d", limit) <mask> } <mask> <mask> func (s *statsCtx) Close() { <mask> u := s.swapUnit(nil) <mask> udb := serialize(u) </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() { </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} { </s> remove if !checkStatsInterval(config.DNS.StatsInterval) { config.DNS.StatsInterval = 1 } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_unit.go
// Reset counters and clear database func (s *statsCtx) clear() {
<mask> <mask> log.Debug("Stats: closed") <mask> } <mask> <mask> func (s *statsCtx) Clear() { <mask> tx := s.beginTxn(true) <mask> if tx != nil { <mask> db := s.db <mask> s.db = nil <mask> _ = tx.Rollback() </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { </s> add func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} { </s> remove func (s *statsCtx) Configure(limit int) { if limit < 0 { return } s.limit = uint32(limit) * 24 log.Debug("Stats: set limit: %d", limit) </s> add func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24 </s> remove s, _ := New(conf) </s> add s, _ := createObject(conf)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_unit.go
func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} {
<mask> * parental-blocked <mask> These values are just the sum of data for all units. <mask> */ <mask> // nolint (gocyclo) <mask> func (s *statsCtx) GetData(timeUnit TimeUnit) map[string]interface{} { <mask> d := map[string]interface{}{} <mask> <mask> tx := s.beginTxn(false) <mask> if tx == nil { <mask> return nil </s> * stats: refactor: move HTTP handlers to stats/ DNS module passes additional parameters to Stats module. This allows Stats to handle HTTP requests by itself - completely removing all stats-related code from outside. </s> remove func (s *statsCtx) Clear() { </s> add // Reset counters and clear database func (s *statsCtx) clear() { </s> remove func (s *statsCtx) Configure(limit int) { if limit < 0 { return } s.limit = uint32(limit) * 24 log.Debug("Stats: set limit: %d", limit) </s> add func (s *statsCtx) setLimit(limitDays int) { s.limit = uint32(limitDays) * 24 log.Debug("Stats: set limit: %d", limitDays) } func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = s.limit / 24 </s> remove // Get data GetData(timeUnit TimeUnit) map[string]interface{} </s> add // WriteDiskConfig - write configuration WriteDiskConfig(dc *DiskConfig)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bbb5413331d43bbc182834ea8b3c2318280c7748
stats/stats_unit.go
"errors"
<mask> <mask> import ( <mask> "encoding/json" <mask> "fmt" <mask> "net" <mask> "net/http" <mask> "net/url" <mask> "runtime" <mask> "strconv" </s> Pull request: home: don't allow all origins Merge in DNS/adguard-home from 2484-access-control to master Updates #2484. Squashed commit of the following: commit 4f0c6ddae35b55a9251f4d5e14c4d92fd2107443 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Feb 5 12:42:22 2021 +0300 home: don't allow all origins </s> remove if err == nil && resp.StatusCode != 404 { </s> add if err == nil && resp.StatusCode != http.StatusNotFound { </s> remove w.Header().Set("Access-Control-Allow-Origin", "*") </s> add </s> remove // enforce https? if r.TLS == nil && Context.web.forceHTTPS && Context.web.httpsServer.server != nil { // yes, and we want host from host:port host, _, err := net.SplitHostPort(r.Host) if err != nil { // no port in host host = r.Host } // construct new URL to redirect to newURL := url.URL{ Scheme: "https", Host: net.JoinHostPort(host, strconv.Itoa(Context.web.conf.PortHTTPS)), Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, newURL.String(), http.StatusTemporaryRedirect) </s> add if !handleHTTPSRedirect(w, r) { </s> remove if Context.firstRun && !strings.HasPrefix(r.URL.Path, "/install.") && !strings.HasPrefix(r.URL.Path, "/assets/") { </s> add path := r.URL.Path if Context.firstRun && !strings.HasPrefix(path, "/install.") && !strings.HasPrefix(path, "/assets/") { </s> remove // postInstall lets the handler run only if firstRun is false, and redirects to /install.html otherwise // it also enforces HTTPS if it is enabled and configured </s> add const defaultHTTPSPort = 443 // handleHTTPSRedirect redirects the request to HTTPS, if needed. If ok is // true, the middleware must continue handling the request. func handleHTTPSRedirect(w http.ResponseWriter, r *http.Request) (ok bool) { web := Context.web if web.httpsServer.server == nil { return true } host, _, err := net.SplitHostPort(r.Host) if err != nil { // Check for the missing port error. If it is that error, just // use the host as is. // // See the source code for net.SplitHostPort. const missingPort = "missing port in address" addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { httpError(w, http.StatusBadRequest, "bad host: %s", err) return false } host = r.Host } if r.TLS == nil && web.forceHTTPS { hostPort := host if port := web.conf.PortHTTPS; port != defaultHTTPSPort { portStr := strconv.Itoa(port) hostPort = net.JoinHostPort(host, portStr) } httpsURL := &url.URL{ Scheme: "https", Host: hostPort, Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, httpsURL.String(), http.StatusTemporaryRedirect) return false } // Allow the frontend from the HTTP origin to send requests to the HTTPS // server. This can happen when the user has just set up HTTPS with // redirects. originURL := &url.URL{ Scheme: "http", Host: r.Host, } w.Header().Set("Access-Control-Allow-Origin", originURL.String()) return true } // postInstall lets the handler to run only if firstRun is false. Otherwise, it // redirects to /install.html. It also enforces HTTPS if it is enabled and // configured and sets appropriate access control headers.
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc01f4f8bcf6acef8dbe40d082a881c82cff42cf
internal/home/control.go
const defaultHTTPSPort = 443 // handleHTTPSRedirect redirects the request to HTTPS, if needed. If ok is // true, the middleware must continue handling the request. func handleHTTPSRedirect(w http.ResponseWriter, r *http.Request) (ok bool) { web := Context.web if web.httpsServer.server == nil { return true } host, _, err := net.SplitHostPort(r.Host) if err != nil { // Check for the missing port error. If it is that error, just // use the host as is. // // See the source code for net.SplitHostPort. const missingPort = "missing port in address" addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { httpError(w, http.StatusBadRequest, "bad host: %s", err) return false } host = r.Host } if r.TLS == nil && web.forceHTTPS { hostPort := host if port := web.conf.PortHTTPS; port != defaultHTTPSPort { portStr := strconv.Itoa(port) hostPort = net.JoinHostPort(host, portStr) } httpsURL := &url.URL{ Scheme: "https", Host: hostPort, Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, httpsURL.String(), http.StatusTemporaryRedirect) return false } // Allow the frontend from the HTTP origin to send requests to the HTTPS // server. This can happen when the user has just set up HTTPS with // redirects. originURL := &url.URL{ Scheme: "http", Host: r.Host, } w.Header().Set("Access-Control-Allow-Origin", originURL.String()) return true } // postInstall lets the handler to run only if firstRun is false. Otherwise, it // redirects to /install.html. It also enforces HTTPS if it is enabled and // configured and sets appropriate access control headers.
<mask> func preInstallHandler(handler http.Handler) http.Handler { <mask> return &preInstallHandlerStruct{handler} <mask> } <mask> <mask> // postInstall lets the handler run only if firstRun is false, and redirects to /install.html otherwise <mask> // it also enforces HTTPS if it is enabled and configured <mask> func postInstall(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { <mask> return func(w http.ResponseWriter, r *http.Request) { <mask> if Context.firstRun && <mask> !strings.HasPrefix(r.URL.Path, "/install.") && <mask> !strings.HasPrefix(r.URL.Path, "/assets/") { </s> Pull request: home: don't allow all origins Merge in DNS/adguard-home from 2484-access-control to master Updates #2484. Squashed commit of the following: commit 4f0c6ddae35b55a9251f4d5e14c4d92fd2107443 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Feb 5 12:42:22 2021 +0300 home: don't allow all origins </s> remove if Context.firstRun && !strings.HasPrefix(r.URL.Path, "/install.") && !strings.HasPrefix(r.URL.Path, "/assets/") { </s> add path := r.URL.Path if Context.firstRun && !strings.HasPrefix(path, "/install.") && !strings.HasPrefix(path, "/assets/") { </s> remove // enforce https? if r.TLS == nil && Context.web.forceHTTPS && Context.web.httpsServer.server != nil { // yes, and we want host from host:port host, _, err := net.SplitHostPort(r.Host) if err != nil { // no port in host host = r.Host } // construct new URL to redirect to newURL := url.URL{ Scheme: "https", Host: net.JoinHostPort(host, strconv.Itoa(Context.web.conf.PortHTTPS)), Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, newURL.String(), http.StatusTemporaryRedirect) </s> add if !handleHTTPSRedirect(w, r) { </s> remove if err == nil && resp.StatusCode != 404 { </s> add if err == nil && resp.StatusCode != http.StatusNotFound { </s> remove w.Header().Set("Access-Control-Allow-Origin", "*") </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc01f4f8bcf6acef8dbe40d082a881c82cff42cf
internal/home/control.go
path := r.URL.Path if Context.firstRun && !strings.HasPrefix(path, "/install.") && !strings.HasPrefix(path, "/assets/") {
<mask> // postInstall lets the handler run only if firstRun is false, and redirects to /install.html otherwise <mask> // it also enforces HTTPS if it is enabled and configured <mask> func postInstall(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { <mask> return func(w http.ResponseWriter, r *http.Request) { <mask> if Context.firstRun && <mask> !strings.HasPrefix(r.URL.Path, "/install.") && <mask> !strings.HasPrefix(r.URL.Path, "/assets/") { <mask> http.Redirect(w, r, "/install.html", http.StatusFound) <mask> return <mask> } <mask> <mask> // enforce https? </s> Pull request: home: don't allow all origins Merge in DNS/adguard-home from 2484-access-control to master Updates #2484. Squashed commit of the following: commit 4f0c6ddae35b55a9251f4d5e14c4d92fd2107443 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Feb 5 12:42:22 2021 +0300 home: don't allow all origins </s> remove // postInstall lets the handler run only if firstRun is false, and redirects to /install.html otherwise // it also enforces HTTPS if it is enabled and configured </s> add const defaultHTTPSPort = 443 // handleHTTPSRedirect redirects the request to HTTPS, if needed. If ok is // true, the middleware must continue handling the request. func handleHTTPSRedirect(w http.ResponseWriter, r *http.Request) (ok bool) { web := Context.web if web.httpsServer.server == nil { return true } host, _, err := net.SplitHostPort(r.Host) if err != nil { // Check for the missing port error. If it is that error, just // use the host as is. // // See the source code for net.SplitHostPort. const missingPort = "missing port in address" addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { httpError(w, http.StatusBadRequest, "bad host: %s", err) return false } host = r.Host } if r.TLS == nil && web.forceHTTPS { hostPort := host if port := web.conf.PortHTTPS; port != defaultHTTPSPort { portStr := strconv.Itoa(port) hostPort = net.JoinHostPort(host, portStr) } httpsURL := &url.URL{ Scheme: "https", Host: hostPort, Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, httpsURL.String(), http.StatusTemporaryRedirect) return false } // Allow the frontend from the HTTP origin to send requests to the HTTPS // server. This can happen when the user has just set up HTTPS with // redirects. originURL := &url.URL{ Scheme: "http", Host: r.Host, } w.Header().Set("Access-Control-Allow-Origin", originURL.String()) return true } // postInstall lets the handler to run only if firstRun is false. Otherwise, it // redirects to /install.html. It also enforces HTTPS if it is enabled and // configured and sets appropriate access control headers. </s> remove // enforce https? if r.TLS == nil && Context.web.forceHTTPS && Context.web.httpsServer.server != nil { // yes, and we want host from host:port host, _, err := net.SplitHostPort(r.Host) if err != nil { // no port in host host = r.Host } // construct new URL to redirect to newURL := url.URL{ Scheme: "https", Host: net.JoinHostPort(host, strconv.Itoa(Context.web.conf.PortHTTPS)), Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, newURL.String(), http.StatusTemporaryRedirect) </s> add if !handleHTTPSRedirect(w, r) { </s> remove if err == nil && resp.StatusCode != 404 { </s> add if err == nil && resp.StatusCode != http.StatusNotFound { </s> remove w.Header().Set("Access-Control-Allow-Origin", "*") </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc01f4f8bcf6acef8dbe40d082a881c82cff42cf
internal/home/control.go
if !handleHTTPSRedirect(w, r) {
<mask> http.Redirect(w, r, "/install.html", http.StatusFound) <mask> return <mask> } <mask> <mask> // enforce https? <mask> if r.TLS == nil && Context.web.forceHTTPS && Context.web.httpsServer.server != nil { <mask> // yes, and we want host from host:port <mask> host, _, err := net.SplitHostPort(r.Host) <mask> if err != nil { <mask> // no port in host <mask> host = r.Host <mask> } <mask> // construct new URL to redirect to <mask> newURL := url.URL{ <mask> Scheme: "https", <mask> Host: net.JoinHostPort(host, strconv.Itoa(Context.web.conf.PortHTTPS)), <mask> Path: r.URL.Path, <mask> RawQuery: r.URL.RawQuery, <mask> } <mask> http.Redirect(w, r, newURL.String(), http.StatusTemporaryRedirect) <mask> return <mask> } <mask> <mask> w.Header().Set("Access-Control-Allow-Origin", "*") <mask> handler(w, r) </s> Pull request: home: don't allow all origins Merge in DNS/adguard-home from 2484-access-control to master Updates #2484. Squashed commit of the following: commit 4f0c6ddae35b55a9251f4d5e14c4d92fd2107443 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Feb 5 12:42:22 2021 +0300 home: don't allow all origins </s> remove // postInstall lets the handler run only if firstRun is false, and redirects to /install.html otherwise // it also enforces HTTPS if it is enabled and configured </s> add const defaultHTTPSPort = 443 // handleHTTPSRedirect redirects the request to HTTPS, if needed. If ok is // true, the middleware must continue handling the request. func handleHTTPSRedirect(w http.ResponseWriter, r *http.Request) (ok bool) { web := Context.web if web.httpsServer.server == nil { return true } host, _, err := net.SplitHostPort(r.Host) if err != nil { // Check for the missing port error. If it is that error, just // use the host as is. // // See the source code for net.SplitHostPort. const missingPort = "missing port in address" addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { httpError(w, http.StatusBadRequest, "bad host: %s", err) return false } host = r.Host } if r.TLS == nil && web.forceHTTPS { hostPort := host if port := web.conf.PortHTTPS; port != defaultHTTPSPort { portStr := strconv.Itoa(port) hostPort = net.JoinHostPort(host, portStr) } httpsURL := &url.URL{ Scheme: "https", Host: hostPort, Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, httpsURL.String(), http.StatusTemporaryRedirect) return false } // Allow the frontend from the HTTP origin to send requests to the HTTPS // server. This can happen when the user has just set up HTTPS with // redirects. originURL := &url.URL{ Scheme: "http", Host: r.Host, } w.Header().Set("Access-Control-Allow-Origin", originURL.String()) return true } // postInstall lets the handler to run only if firstRun is false. Otherwise, it // redirects to /install.html. It also enforces HTTPS if it is enabled and // configured and sets appropriate access control headers. </s> remove w.Header().Set("Access-Control-Allow-Origin", "*") </s> add </s> remove if Context.firstRun && !strings.HasPrefix(r.URL.Path, "/install.") && !strings.HasPrefix(r.URL.Path, "/assets/") { </s> add path := r.URL.Path if Context.firstRun && !strings.HasPrefix(path, "/install.") && !strings.HasPrefix(path, "/assets/") { </s> remove if err == nil && resp.StatusCode != 404 { </s> add if err == nil && resp.StatusCode != http.StatusNotFound {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc01f4f8bcf6acef8dbe40d082a881c82cff42cf
internal/home/control.go
<mask> http.Redirect(w, r, newURL.String(), http.StatusTemporaryRedirect) <mask> return <mask> } <mask> <mask> w.Header().Set("Access-Control-Allow-Origin", "*") <mask> handler(w, r) <mask> } <mask> } <mask> <mask> type postInstallHandlerStruct struct { </s> Pull request: home: don't allow all origins Merge in DNS/adguard-home from 2484-access-control to master Updates #2484. Squashed commit of the following: commit 4f0c6ddae35b55a9251f4d5e14c4d92fd2107443 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Feb 5 12:42:22 2021 +0300 home: don't allow all origins </s> remove // enforce https? if r.TLS == nil && Context.web.forceHTTPS && Context.web.httpsServer.server != nil { // yes, and we want host from host:port host, _, err := net.SplitHostPort(r.Host) if err != nil { // no port in host host = r.Host } // construct new URL to redirect to newURL := url.URL{ Scheme: "https", Host: net.JoinHostPort(host, strconv.Itoa(Context.web.conf.PortHTTPS)), Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, newURL.String(), http.StatusTemporaryRedirect) </s> add if !handleHTTPSRedirect(w, r) { </s> remove // postInstall lets the handler run only if firstRun is false, and redirects to /install.html otherwise // it also enforces HTTPS if it is enabled and configured </s> add const defaultHTTPSPort = 443 // handleHTTPSRedirect redirects the request to HTTPS, if needed. If ok is // true, the middleware must continue handling the request. func handleHTTPSRedirect(w http.ResponseWriter, r *http.Request) (ok bool) { web := Context.web if web.httpsServer.server == nil { return true } host, _, err := net.SplitHostPort(r.Host) if err != nil { // Check for the missing port error. If it is that error, just // use the host as is. // // See the source code for net.SplitHostPort. const missingPort = "missing port in address" addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { httpError(w, http.StatusBadRequest, "bad host: %s", err) return false } host = r.Host } if r.TLS == nil && web.forceHTTPS { hostPort := host if port := web.conf.PortHTTPS; port != defaultHTTPSPort { portStr := strconv.Itoa(port) hostPort = net.JoinHostPort(host, portStr) } httpsURL := &url.URL{ Scheme: "https", Host: hostPort, Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, httpsURL.String(), http.StatusTemporaryRedirect) return false } // Allow the frontend from the HTTP origin to send requests to the HTTPS // server. This can happen when the user has just set up HTTPS with // redirects. originURL := &url.URL{ Scheme: "http", Host: r.Host, } w.Header().Set("Access-Control-Allow-Origin", originURL.String()) return true } // postInstall lets the handler to run only if firstRun is false. Otherwise, it // redirects to /install.html. It also enforces HTTPS if it is enabled and // configured and sets appropriate access control headers. </s> remove if Context.firstRun && !strings.HasPrefix(r.URL.Path, "/install.") && !strings.HasPrefix(r.URL.Path, "/assets/") { </s> add path := r.URL.Path if Context.firstRun && !strings.HasPrefix(path, "/install.") && !strings.HasPrefix(path, "/assets/") { </s> remove if err == nil && resp.StatusCode != 404 { </s> add if err == nil && resp.StatusCode != http.StatusNotFound {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc01f4f8bcf6acef8dbe40d082a881c82cff42cf
internal/home/control.go
if err == nil && resp.StatusCode != http.StatusNotFound {
<mask> var resp *http.Response <mask> h := http.Client{} <mask> for i := 0; i != 50; i++ { <mask> resp, err = h.Get("http://127.0.0.1:3000/") <mask> if err == nil && resp.StatusCode != 404 { <mask> break <mask> } <mask> time.Sleep(100 * time.Millisecond) <mask> } <mask> assert.Nilf(t, err, "%s", err) </s> Pull request: home: don't allow all origins Merge in DNS/adguard-home from 2484-access-control to master Updates #2484. Squashed commit of the following: commit 4f0c6ddae35b55a9251f4d5e14c4d92fd2107443 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Feb 5 12:42:22 2021 +0300 home: don't allow all origins </s> remove // postInstall lets the handler run only if firstRun is false, and redirects to /install.html otherwise // it also enforces HTTPS if it is enabled and configured </s> add const defaultHTTPSPort = 443 // handleHTTPSRedirect redirects the request to HTTPS, if needed. If ok is // true, the middleware must continue handling the request. func handleHTTPSRedirect(w http.ResponseWriter, r *http.Request) (ok bool) { web := Context.web if web.httpsServer.server == nil { return true } host, _, err := net.SplitHostPort(r.Host) if err != nil { // Check for the missing port error. If it is that error, just // use the host as is. // // See the source code for net.SplitHostPort. const missingPort = "missing port in address" addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { httpError(w, http.StatusBadRequest, "bad host: %s", err) return false } host = r.Host } if r.TLS == nil && web.forceHTTPS { hostPort := host if port := web.conf.PortHTTPS; port != defaultHTTPSPort { portStr := strconv.Itoa(port) hostPort = net.JoinHostPort(host, portStr) } httpsURL := &url.URL{ Scheme: "https", Host: hostPort, Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, httpsURL.String(), http.StatusTemporaryRedirect) return false } // Allow the frontend from the HTTP origin to send requests to the HTTPS // server. This can happen when the user has just set up HTTPS with // redirects. originURL := &url.URL{ Scheme: "http", Host: r.Host, } w.Header().Set("Access-Control-Allow-Origin", originURL.String()) return true } // postInstall lets the handler to run only if firstRun is false. Otherwise, it // redirects to /install.html. It also enforces HTTPS if it is enabled and // configured and sets appropriate access control headers. </s> remove // enforce https? if r.TLS == nil && Context.web.forceHTTPS && Context.web.httpsServer.server != nil { // yes, and we want host from host:port host, _, err := net.SplitHostPort(r.Host) if err != nil { // no port in host host = r.Host } // construct new URL to redirect to newURL := url.URL{ Scheme: "https", Host: net.JoinHostPort(host, strconv.Itoa(Context.web.conf.PortHTTPS)), Path: r.URL.Path, RawQuery: r.URL.RawQuery, } http.Redirect(w, r, newURL.String(), http.StatusTemporaryRedirect) </s> add if !handleHTTPSRedirect(w, r) { </s> remove if Context.firstRun && !strings.HasPrefix(r.URL.Path, "/install.") && !strings.HasPrefix(r.URL.Path, "/assets/") { </s> add path := r.URL.Path if Context.firstRun && !strings.HasPrefix(path, "/install.") && !strings.HasPrefix(path, "/assets/") { </s> remove w.Header().Set("Access-Control-Allow-Origin", "*") </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc01f4f8bcf6acef8dbe40d082a881c82cff42cf
internal/home/home_test.go
export const getClientsRequest = createAction('GET_CLIENTS_REQUEST'); export const getClientsFailure = createAction('GET_CLIENTS_FAILURE'); export const getClientsSuccess = createAction('GET_CLIENTS_SUCCESS'); export const getClients = () => async (dispatch) => { dispatch(getClientsRequest()); try { const clients = await apiClient.getGlobalClients(); dispatch(getClientsSuccess(clients)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getClientsFailure()); } };
<mask> dispatch(findActiveDhcpFailure()); <mask> } <mask> } <mask> }; </s> + client: added name for client </s> remove {queryLogEnabled && queryLogs.getLogsProcessing && <Loading />} {queryLogEnabled && !queryLogs.getLogsProcessing && this.renderLogs(queryLogs.logs)} </s> add { queryLogEnabled && queryLogs.getLogsProcessing && dashboard.processingClients && <Loading /> } { queryLogEnabled && !queryLogs.getLogsProcessing && !dashboard.processingClients && this.renderLogs(queryLogs.logs) } </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props; </s> remove import { formatTime } from '../../helpers/helpers'; </s> add import { formatTime, getClientName } from '../../helpers/helpers';
[ "keep", "keep", "keep", "add" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/actions/index.js
GLOBAL_CLIENTS = { path: 'clients', method: 'GET' }
<mask> GLOBAL_TEST_UPSTREAM_DNS = { path: 'test_upstream_dns', method: 'POST' }; <mask> GLOBAL_VERSION = { path: 'version.json', method: 'GET' }; <mask> GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; <mask> GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; <mask> <mask> restartGlobalFiltering() { <mask> const { path, method } = this.GLOBAL_RESTART; <mask> return this.makeRequest(path, method); <mask> } <mask> </s> + client: added name for client </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props;
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/api/Api.js
getGlobalClients() { const { path, method } = this.GLOBAL_CLIENTS; return this.makeRequest(path, method); }
<mask> return this.makeRequest(path, method); <mask> } <mask> <mask> // Filtering <mask> FILTERING_STATUS = { path: 'filtering/status', method: 'GET' }; <mask> FILTERING_ENABLE = { path: 'filtering/enable', method: 'POST' }; <mask> FILTERING_DISABLE = { path: 'filtering/disable', method: 'POST' }; <mask> FILTERING_ADD_FILTER = { path: 'filtering/add_url', method: 'PUT' }; </s> + client: added name for client
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/api/Api.js
this.props.getClients();
<mask> class App extends Component { <mask> componentDidMount() { <mask> this.props.getDnsStatus(); <mask> this.props.getVersion(); <mask> } <mask> <mask> componentDidUpdate(prevProps) { <mask> if (this.props.dashboard.language !== prevProps.dashboard.language) { <mask> this.setLanguage(); <mask> } </s> + client: added name for client </s> remove import { getPercent } from '../../helpers/helpers'; </s> add import { getPercent, getClientName } from '../../helpers/helpers'; </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props;
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/App/index.js
getClients: PropTypes.func,
<mask> getVersion: PropTypes.func, <mask> changeLanguage: PropTypes.func, <mask> encryption: PropTypes.object, <mask> }; <mask> <mask> export default withNamespaces()(App); </s> + client: added name for client
[ "keep", "keep", "add", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/App/index.js
import { getPercent, getClientName } from '../../helpers/helpers';
<mask> <mask> import Card from '../ui/Card'; <mask> import Cell from '../ui/Cell'; <mask> <mask> import { getPercent } from '../../helpers/helpers'; <mask> import { STATUS_COLORS } from '../../helpers/constants'; <mask> <mask> class Clients extends Component { <mask> getPercentColor = (percent) => { <mask> if (percent > 50) { </s> + client: added name for client </s> remove import { formatTime } from '../../helpers/helpers'; </s> add import { formatTime, getClientName } from '../../helpers/helpers';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Dashboard/Clients.js
Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); },
<mask> <mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), <mask> sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), <mask> }, { <mask> Header: <Trans>requests_count</Trans>, <mask> accessor: 'count', <mask> Cell: ({ value }) => { </s> + client: added name for client </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Dashboard/Clients.js
clients: PropTypes.array.isRequired,
<mask> dnsQueries: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> t: PropTypes.func, <mask> }; <mask> <mask> export default withNamespaces()(Clients); </s> + client: added name for client
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Dashboard/Clients.js
dashboard.processingClients ||
<mask> dashboard.processingStats || <mask> dashboard.processingStatsHistory || <mask> dashboard.processingTopStats; <mask> <mask> const refreshFullButton = <button type="button" className="btn btn-outline-primary btn-sm" onClick={() => this.getAllStats()}><Trans>refresh_statics</Trans></button>; <mask> const refreshButton = <button type="button" className="btn btn-outline-primary btn-sm card-refresh" onClick={() => this.getAllStats()} />; </s> + client: added name for client </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props;
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Dashboard/index.js
clients={dashboard.clients}
<mask> refreshButton={refreshButton} <mask> topClients={dashboard.topStats.top_clients} <mask> /> <mask> </div> <mask> <div className="col-lg-6"> <mask> <QueriedDomains <mask> dnsQueries={dashboard.stats.dns_queries} </s> + client: added name for client </s> remove {row.value} </s> add {client} </s> remove {queryLogEnabled && queryLogs.getLogsProcessing && <Loading />} {queryLogEnabled && !queryLogs.getLogsProcessing && this.renderLogs(queryLogs.logs)} </s> add { queryLogEnabled && queryLogs.getLogsProcessing && dashboard.processingClients && <Loading /> } { queryLogEnabled && !queryLogs.getLogsProcessing && !dashboard.processingClients && this.renderLogs(queryLogs.logs) } </s> remove Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); },
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Dashboard/index.js
import { formatTime, getClientName } from '../../helpers/helpers';
<mask> import escapeRegExp from 'lodash/escapeRegExp'; <mask> import endsWith from 'lodash/endsWith'; <mask> import { Trans, withNamespaces } from 'react-i18next'; <mask> <mask> import { formatTime } from '../../helpers/helpers'; <mask> import { getTrackerData } from '../../helpers/trackers/trackers'; <mask> import PageTitle from '../ui/PageTitle'; <mask> import Card from '../ui/Card'; <mask> import Loading from '../ui/Loading'; <mask> import PopoverFiltered from '../ui/PopoverFilter'; </s> + client: added name for client </s> remove import { getPercent } from '../../helpers/helpers'; </s> add import { getPercent, getClientName } from '../../helpers/helpers'; </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Logs/index.js
const { t, dashboard } = this.props;
<mask> ); <mask> } <mask> <mask> renderLogs(logs) { <mask> const { t } = this.props; <mask> const columns = [{ <mask> Header: t('time_table_header'), <mask> accessor: 'time', <mask> maxWidth: 110, <mask> filterable: false, </s> + client: added name for client </s> remove Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); },
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Logs/index.js
const clientName = getClientName(dashboard.clients, row.value); let client; if (clientName) { client = <span>{clientName} <small>({row.value})</small></span>; } else { client = row.value; }
<mask> const { reason } = row.original; <mask> const isFiltered = row ? reason.indexOf('Filtered') === 0 : false; <mask> <mask> return ( <mask> <Fragment> <mask> <div className="logs__row"> <mask> {client} </s> + client: added name for client </s> remove {row.value} </s> add {client} </s> remove Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); }, </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props;
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Logs/index.js
{client}
<mask> <mask> return ( <mask> <Fragment> <mask> <div className="logs__row"> <mask> {row.value} <mask> </div> <mask> {this.renderBlockingButton(isFiltered, row.original.domain)} <mask> </Fragment> <mask> ); <mask> }, </s> + client: added name for client </s> remove Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); }, </s> remove {queryLogEnabled && queryLogs.getLogsProcessing && <Loading />} {queryLogEnabled && !queryLogs.getLogsProcessing && this.renderLogs(queryLogs.logs)} </s> add { queryLogEnabled && queryLogs.getLogsProcessing && dashboard.processingClients && <Loading /> } { queryLogEnabled && !queryLogs.getLogsProcessing && !dashboard.processingClients && this.renderLogs(queryLogs.logs) }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Logs/index.js
{ queryLogEnabled && queryLogs.getLogsProcessing && dashboard.processingClients && <Loading /> } { queryLogEnabled && !queryLogs.getLogsProcessing && !dashboard.processingClients && this.renderLogs(queryLogs.logs) }
<mask> {this.renderButtons(queryLogEnabled, dashboard.logStatusProcessing)} <mask> </div> <mask> </PageTitle> <mask> <Card> <mask> {queryLogEnabled && queryLogs.getLogsProcessing && <Loading />} <mask> {queryLogEnabled && !queryLogs.getLogsProcessing && <mask> this.renderLogs(queryLogs.logs)} <mask> </Card> <mask> </Fragment> <mask> ); <mask> } <mask> } </s> + client: added name for client </s> remove {row.value} </s> add {client} </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props; </s> remove Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); },
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/components/Logs/index.js
export const getClientName = (clients, ip) => { const client = clients.find(item => ip === item.ip); return (client && client.name) || ''; };
<mask> } <mask> }; <mask> <mask> export const normalizeTextarea = text => text && text.replace(/[;, ]/g, '\n').split('\n').filter(n => n); </s> + client: added name for client </s> remove {queryLogEnabled && queryLogs.getLogsProcessing && <Loading />} {queryLogEnabled && !queryLogs.getLogsProcessing && this.renderLogs(queryLogs.logs)} </s> add { queryLogEnabled && queryLogs.getLogsProcessing && dashboard.processingClients && <Loading /> } { queryLogEnabled && !queryLogs.getLogsProcessing && !dashboard.processingClients && this.renderLogs(queryLogs.logs) } </s> remove Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); },
[ "keep", "keep", "keep", "add" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/helpers/helpers.js
[actions.getClientsRequest]: state => ({ ...state, processingClients: true }), [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), [actions.getClientsSuccess]: (state, { payload }) => { const newState = { ...state, clients: payload, processingClients: false, }; return newState; },
<mask> const newState = { ...state, language: payload }; <mask> return newState; <mask> }, <mask> }, { <mask> processing: true, <mask> isCoreRunning: false, <mask> processingTopStats: true, <mask> processingStats: true, </s> + client: added name for client </s> remove Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); }, </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props;
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/reducers/index.js
processingClients: true,
<mask> processingVersion: true, <mask> processingFiltering: true, <mask> upstreamDns: '', <mask> bootstrapDns: '', <mask> allServers: false, <mask> protectionEnabled: false, <mask> processingProtection: false, </s> + client: added name for client </s> remove const { t } = this.props; </s> add const { t, dashboard } = this.props;
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/reducers/index.js
clients: [],
<mask> httpPort: 80, <mask> dnsPort: 53, <mask> dnsAddresses: [], <mask> dnsVersion: '', <mask> }); <mask> <mask> const queryLogs = handleActions({ <mask> [actions.getLogsRequest]: state => ({ ...state, getLogsProcessing: true }), <mask> [actions.getLogsFailure]: state => ({ ...state, getLogsProcessing: false }), </s> + client: added name for client </s> remove Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), </s> add Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value); let client; if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); },
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc0b0af06b71197d75c8a7f8c3a401d4c8a49d61
client/src/reducers/index.js
import React, { Component } from 'react';
<mask> import React from 'react'; <mask> import { ResponsiveLine } from '@nivo/line'; <mask> import PropTypes from 'prop-types'; <mask> <mask> import Card from '../ui/Card'; <mask> <mask> const Statistics = props => ( </s> Replace the main Statistics graph with 4 blocks instead </s> remove const Statistics = props => ( <Card title="Statistics" subtitle="for the last 24 hours" bodyType="card-graph" refresh={props.refreshButton}> {props.history ? <ResponsiveLine data={props.history} margin={{ top: 50, right: 40, bottom: 80, left: 80, }} minY="auto" stacked={false} curve='monotoneX' axisBottom={{ orient: 'bottom', tickSize: 5, tickPadding: 5, tickRotation: -45, legendOffset: 50, legendPosition: 'center', }} axisLeft={{ orient: 'left', tickSize: 5, tickPadding: 5, tickRotation: 0, legendOffset: -40, legendPosition: 'center', }} enableArea={true} dotSize={10} dotColor="inherit:darker(0.3)" dotBorderWidth={2} dotBorderColor="#ffffff" dotLabel="y" dotLabelYOffset={-12} animate={true} motionStiffness={90} motionDamping={15} /> : <h2 className="text-muted">Empty data</h2> } </Card> ); </s> add import { getPercent } from '../../helpers/helpers'; import { STATUS_COLORS } from '../../helpers/constants'; class Statistics extends Component { render() { const { dnsQueries, blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const filteringData = [this.props.history[1]]; const queriesData = [this.props.history[2]]; const parentalData = [this.props.history[3]]; const safebrowsingData = [this.props.history[4]]; return ( <div className="row"> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-blue"> {dnsQueries} </div> <div className="card-title-stats"> DNS Queries </div> </div> <div className="card-chart-bg"> <Line data={queriesData} color={STATUS_COLORS.blue}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-red"> {blockedFiltering} </div> <div className="card-value card-value-percent text-red"> {getPercent(dnsQueries, blockedFiltering)} </div> <div className="card-title-stats"> Blocked by Filters </div> </div> <div className="card-chart-bg"> <Line data={filteringData} color={STATUS_COLORS.red}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-green"> {replacedSafebrowsing} </div> <div className="card-value card-value-percent text-green"> {getPercent(dnsQueries, replacedSafebrowsing)} </div> <div className="card-title-stats"> Blocked malware/phishing </div> </div> <div className="card-chart-bg"> <Line data={safebrowsingData} color={STATUS_COLORS.green}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-yellow"> {replacedParental} </div> <div className="card-value card-value-percent text-yellow"> {getPercent(dnsQueries, replacedParental)} </div> <div className="card-title-stats"> Blocked adult websites </div> </div> <div className="card-chart-bg"> <Line data={parentalData} color={STATUS_COLORS.yellow}/> </div> </Card> </div> </div> ); } } </s> remove const STATS_NAMES = { avg_processing_time: 'Average processing time', blocked_filtering: 'Blocked by filters', dns_queries: 'DNS queries', replaced_parental: 'Blocked adult websites', replaced_safebrowsing: 'Blocked malware/phishing', replaced_safesearch: 'Enforced safe search', }; </s> add </s> remove refreshButton: PropTypes.node, </s> add dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, refreshButton: PropTypes.node.isRequired,
[ "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc11f872faa525d86a617159863a79cb63da5537
client/src/components/Dashboard/Statistics.js
import Line from '../ui/Line';
<mask> <mask> import Card from '../ui/Card'; <mask> <mask> import { getPercent } from '../../helpers/helpers'; <mask> import { STATUS_COLORS } from '../../helpers/constants'; <mask> </s> Replace the main Statistics graph with 4 blocks instead </s> remove import React from 'react'; import { ResponsiveLine } from '@nivo/line'; </s> add import React, { Component } from 'react'; </s> remove const Statistics = props => ( <Card title="Statistics" subtitle="for the last 24 hours" bodyType="card-graph" refresh={props.refreshButton}> {props.history ? <ResponsiveLine data={props.history} margin={{ top: 50, right: 40, bottom: 80, left: 80, }} minY="auto" stacked={false} curve='monotoneX' axisBottom={{ orient: 'bottom', tickSize: 5, tickPadding: 5, tickRotation: -45, legendOffset: 50, legendPosition: 'center', }} axisLeft={{ orient: 'left', tickSize: 5, tickPadding: 5, tickRotation: 0, legendOffset: -40, legendPosition: 'center', }} enableArea={true} dotSize={10} dotColor="inherit:darker(0.3)" dotBorderWidth={2} dotBorderColor="#ffffff" dotLabel="y" dotLabelYOffset={-12} animate={true} motionStiffness={90} motionDamping={15} /> : <h2 className="text-muted">Empty data</h2> } </Card> ); </s> add import { getPercent } from '../../helpers/helpers'; import { STATUS_COLORS } from '../../helpers/constants'; class Statistics extends Component { render() { const { dnsQueries, blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const filteringData = [this.props.history[1]]; const queriesData = [this.props.history[2]]; const parentalData = [this.props.history[3]]; const safebrowsingData = [this.props.history[4]]; return ( <div className="row"> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-blue"> {dnsQueries} </div> <div className="card-title-stats"> DNS Queries </div> </div> <div className="card-chart-bg"> <Line data={queriesData} color={STATUS_COLORS.blue}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-red"> {blockedFiltering} </div> <div className="card-value card-value-percent text-red"> {getPercent(dnsQueries, blockedFiltering)} </div> <div className="card-title-stats"> Blocked by Filters </div> </div> <div className="card-chart-bg"> <Line data={filteringData} color={STATUS_COLORS.red}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-green"> {replacedSafebrowsing} </div> <div className="card-value card-value-percent text-green"> {getPercent(dnsQueries, replacedSafebrowsing)} </div> <div className="card-title-stats"> Blocked malware/phishing </div> </div> <div className="card-chart-bg"> <Line data={safebrowsingData} color={STATUS_COLORS.green}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-yellow"> {replacedParental} </div> <div className="card-value card-value-percent text-yellow"> {getPercent(dnsQueries, replacedParental)} </div> <div className="card-title-stats"> Blocked adult websites </div> </div> <div className="card-chart-bg"> <Line data={parentalData} color={STATUS_COLORS.yellow}/> </div> </Card> </div> </div> ); } } </s> remove const STATS_NAMES = { avg_processing_time: 'Average processing time', blocked_filtering: 'Blocked by filters', dns_queries: 'DNS queries', replaced_parental: 'Blocked adult websites', replaced_safebrowsing: 'Blocked malware/phishing', replaced_safesearch: 'Enforced safe search', }; </s> add </s> remove refreshButton: PropTypes.node, </s> add dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, refreshButton: PropTypes.node.isRequired,
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc11f872faa525d86a617159863a79cb63da5537
client/src/components/Dashboard/Statistics.js
import { getPercent } from '../../helpers/helpers'; import { STATUS_COLORS } from '../../helpers/constants'; class Statistics extends Component { render() { const { dnsQueries, blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const filteringData = [this.props.history[1]]; const queriesData = [this.props.history[2]]; const parentalData = [this.props.history[3]]; const safebrowsingData = [this.props.history[4]]; return ( <div className="row"> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-blue"> {dnsQueries} </div> <div className="card-title-stats"> DNS Queries </div> </div> <div className="card-chart-bg"> <Line data={queriesData} color={STATUS_COLORS.blue}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-red"> {blockedFiltering} </div> <div className="card-value card-value-percent text-red"> {getPercent(dnsQueries, blockedFiltering)} </div> <div className="card-title-stats"> Blocked by Filters </div> </div> <div className="card-chart-bg"> <Line data={filteringData} color={STATUS_COLORS.red}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-green"> {replacedSafebrowsing} </div> <div className="card-value card-value-percent text-green"> {getPercent(dnsQueries, replacedSafebrowsing)} </div> <div className="card-title-stats"> Blocked malware/phishing </div> </div> <div className="card-chart-bg"> <Line data={safebrowsingData} color={STATUS_COLORS.green}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-yellow"> {replacedParental} </div> <div className="card-value card-value-percent text-yellow"> {getPercent(dnsQueries, replacedParental)} </div> <div className="card-title-stats"> Blocked adult websites </div> </div> <div className="card-chart-bg"> <Line data={parentalData} color={STATUS_COLORS.yellow}/> </div> </Card> </div> </div> ); } }
<mask> import PropTypes from 'prop-types'; <mask> <mask> import Card from '../ui/Card'; <mask> <mask> const Statistics = props => ( <mask> <Card title="Statistics" subtitle="for the last 24 hours" bodyType="card-graph" refresh={props.refreshButton}> <mask> {props.history ? <mask> <ResponsiveLine <mask> data={props.history} <mask> margin={{ <mask> top: 50, <mask> right: 40, <mask> bottom: 80, <mask> left: 80, <mask> }} <mask> minY="auto" <mask> stacked={false} <mask> curve='monotoneX' <mask> axisBottom={{ <mask> orient: 'bottom', <mask> tickSize: 5, <mask> tickPadding: 5, <mask> tickRotation: -45, <mask> legendOffset: 50, <mask> legendPosition: 'center', <mask> }} <mask> axisLeft={{ <mask> orient: 'left', <mask> tickSize: 5, <mask> tickPadding: 5, <mask> tickRotation: 0, <mask> legendOffset: -40, <mask> legendPosition: 'center', <mask> }} <mask> enableArea={true} <mask> dotSize={10} <mask> dotColor="inherit:darker(0.3)" <mask> dotBorderWidth={2} <mask> dotBorderColor="#ffffff" <mask> dotLabel="y" <mask> dotLabelYOffset={-12} <mask> animate={true} <mask> motionStiffness={90} <mask> motionDamping={15} <mask> /> <mask> : <mask> <h2 className="text-muted">Empty data</h2> <mask> } <mask> </Card> <mask> ); <mask> <mask> Statistics.propTypes = { <mask> history: PropTypes.array.isRequired, <mask> refreshButton: PropTypes.node, <mask> }; </s> Replace the main Statistics graph with 4 blocks instead </s> remove import React from 'react'; import { ResponsiveLine } from '@nivo/line'; </s> add import React, { Component } from 'react'; </s> remove refreshButton: PropTypes.node, </s> add dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, refreshButton: PropTypes.node.isRequired, </s> remove const STATS_NAMES = { avg_processing_time: 'Average processing time', blocked_filtering: 'Blocked by filters', dns_queries: 'DNS queries', replaced_parental: 'Blocked adult websites', replaced_safebrowsing: 'Blocked malware/phishing', replaced_safesearch: 'Enforced safe search', }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/bc11f872faa525d86a617159863a79cb63da5537
client/src/components/Dashboard/Statistics.js
dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, refreshButton: PropTypes.node.isRequired,
<mask> ); <mask> <mask> Statistics.propTypes = { <mask> history: PropTypes.array.isRequired, <mask> refreshButton: PropTypes.node, <mask> }; <mask> <mask> export default Statistics; </s> Replace the main Statistics graph with 4 blocks instead </s> remove const Statistics = props => ( <Card title="Statistics" subtitle="for the last 24 hours" bodyType="card-graph" refresh={props.refreshButton}> {props.history ? <ResponsiveLine data={props.history} margin={{ top: 50, right: 40, bottom: 80, left: 80, }} minY="auto" stacked={false} curve='monotoneX' axisBottom={{ orient: 'bottom', tickSize: 5, tickPadding: 5, tickRotation: -45, legendOffset: 50, legendPosition: 'center', }} axisLeft={{ orient: 'left', tickSize: 5, tickPadding: 5, tickRotation: 0, legendOffset: -40, legendPosition: 'center', }} enableArea={true} dotSize={10} dotColor="inherit:darker(0.3)" dotBorderWidth={2} dotBorderColor="#ffffff" dotLabel="y" dotLabelYOffset={-12} animate={true} motionStiffness={90} motionDamping={15} /> : <h2 className="text-muted">Empty data</h2> } </Card> ); </s> add import { getPercent } from '../../helpers/helpers'; import { STATUS_COLORS } from '../../helpers/constants'; class Statistics extends Component { render() { const { dnsQueries, blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const filteringData = [this.props.history[1]]; const queriesData = [this.props.history[2]]; const parentalData = [this.props.history[3]]; const safebrowsingData = [this.props.history[4]]; return ( <div className="row"> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-blue"> {dnsQueries} </div> <div className="card-title-stats"> DNS Queries </div> </div> <div className="card-chart-bg"> <Line data={queriesData} color={STATUS_COLORS.blue}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-red"> {blockedFiltering} </div> <div className="card-value card-value-percent text-red"> {getPercent(dnsQueries, blockedFiltering)} </div> <div className="card-title-stats"> Blocked by Filters </div> </div> <div className="card-chart-bg"> <Line data={filteringData} color={STATUS_COLORS.red}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-green"> {replacedSafebrowsing} </div> <div className="card-value card-value-percent text-green"> {getPercent(dnsQueries, replacedSafebrowsing)} </div> <div className="card-title-stats"> Blocked malware/phishing </div> </div> <div className="card-chart-bg"> <Line data={safebrowsingData} color={STATUS_COLORS.green}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-yellow"> {replacedParental} </div> <div className="card-value card-value-percent text-yellow"> {getPercent(dnsQueries, replacedParental)} </div> <div className="card-title-stats"> Blocked adult websites </div> </div> <div className="card-chart-bg"> <Line data={parentalData} color={STATUS_COLORS.yellow}/> </div> </Card> </div> </div> ); } } </s> remove const STATS_NAMES = { avg_processing_time: 'Average processing time', blocked_filtering: 'Blocked by filters', dns_queries: 'DNS queries', replaced_parental: 'Blocked adult websites', replaced_safebrowsing: 'Blocked malware/phishing', replaced_safesearch: 'Enforced safe search', }; </s> add </s> remove import React from 'react'; import { ResponsiveLine } from '@nivo/line'; </s> add import React, { Component } from 'react';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc11f872faa525d86a617159863a79cb63da5537
client/src/components/Dashboard/Statistics.js
import { STATS_NAMES } from './constants';
<mask> import addHours from 'date-fns/add_hours'; <mask> import round from 'lodash/round'; <mask> <mask> const formatTime = (time) => { <mask> const parsedTime = dateParse(time); <mask> return dateFormat(parsedTime, 'HH:mm:ss'); <mask> }; <mask> </s> Replace the main Statistics graph with 4 blocks instead </s> remove import React from 'react'; import { ResponsiveLine } from '@nivo/line'; </s> add import React, { Component } from 'react'; </s> remove const Statistics = props => ( <Card title="Statistics" subtitle="for the last 24 hours" bodyType="card-graph" refresh={props.refreshButton}> {props.history ? <ResponsiveLine data={props.history} margin={{ top: 50, right: 40, bottom: 80, left: 80, }} minY="auto" stacked={false} curve='monotoneX' axisBottom={{ orient: 'bottom', tickSize: 5, tickPadding: 5, tickRotation: -45, legendOffset: 50, legendPosition: 'center', }} axisLeft={{ orient: 'left', tickSize: 5, tickPadding: 5, tickRotation: 0, legendOffset: -40, legendPosition: 'center', }} enableArea={true} dotSize={10} dotColor="inherit:darker(0.3)" dotBorderWidth={2} dotBorderColor="#ffffff" dotLabel="y" dotLabelYOffset={-12} animate={true} motionStiffness={90} motionDamping={15} /> : <h2 className="text-muted">Empty data</h2> } </Card> ); </s> add import { getPercent } from '../../helpers/helpers'; import { STATUS_COLORS } from '../../helpers/constants'; class Statistics extends Component { render() { const { dnsQueries, blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const filteringData = [this.props.history[1]]; const queriesData = [this.props.history[2]]; const parentalData = [this.props.history[3]]; const safebrowsingData = [this.props.history[4]]; return ( <div className="row"> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-blue"> {dnsQueries} </div> <div className="card-title-stats"> DNS Queries </div> </div> <div className="card-chart-bg"> <Line data={queriesData} color={STATUS_COLORS.blue}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-red"> {blockedFiltering} </div> <div className="card-value card-value-percent text-red"> {getPercent(dnsQueries, blockedFiltering)} </div> <div className="card-title-stats"> Blocked by Filters </div> </div> <div className="card-chart-bg"> <Line data={filteringData} color={STATUS_COLORS.red}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-green"> {replacedSafebrowsing} </div> <div className="card-value card-value-percent text-green"> {getPercent(dnsQueries, replacedSafebrowsing)} </div> <div className="card-title-stats"> Blocked malware/phishing </div> </div> <div className="card-chart-bg"> <Line data={safebrowsingData} color={STATUS_COLORS.green}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-yellow"> {replacedParental} </div> <div className="card-value card-value-percent text-yellow"> {getPercent(dnsQueries, replacedParental)} </div> <div className="card-title-stats"> Blocked adult websites </div> </div> <div className="card-chart-bg"> <Line data={parentalData} color={STATUS_COLORS.yellow}/> </div> </Card> </div> </div> ); } } </s> remove const STATS_NAMES = { avg_processing_time: 'Average processing time', blocked_filtering: 'Blocked by filters', dns_queries: 'DNS queries', replaced_parental: 'Blocked adult websites', replaced_safebrowsing: 'Blocked malware/phishing', replaced_safesearch: 'Enforced safe search', }; </s> add </s> remove refreshButton: PropTypes.node, </s> add dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, refreshButton: PropTypes.node.isRequired,
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc11f872faa525d86a617159863a79cb63da5537
client/src/helpers/helpers.js
<mask> rule, <mask> }; <mask> }); <mask> <mask> const STATS_NAMES = { <mask> avg_processing_time: 'Average processing time', <mask> blocked_filtering: 'Blocked by filters', <mask> dns_queries: 'DNS queries', <mask> replaced_parental: 'Blocked adult websites', <mask> replaced_safebrowsing: 'Blocked malware/phishing', <mask> replaced_safesearch: 'Enforced safe search', <mask> }; <mask> <mask> export const normalizeHistory = history => Object.keys(history).map((key) => { <mask> let id = STATS_NAMES[key]; <mask> if (!id) { <mask> id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); <mask> } </s> Replace the main Statistics graph with 4 blocks instead </s> remove import React from 'react'; import { ResponsiveLine } from '@nivo/line'; </s> add import React, { Component } from 'react'; </s> remove const Statistics = props => ( <Card title="Statistics" subtitle="for the last 24 hours" bodyType="card-graph" refresh={props.refreshButton}> {props.history ? <ResponsiveLine data={props.history} margin={{ top: 50, right: 40, bottom: 80, left: 80, }} minY="auto" stacked={false} curve='monotoneX' axisBottom={{ orient: 'bottom', tickSize: 5, tickPadding: 5, tickRotation: -45, legendOffset: 50, legendPosition: 'center', }} axisLeft={{ orient: 'left', tickSize: 5, tickPadding: 5, tickRotation: 0, legendOffset: -40, legendPosition: 'center', }} enableArea={true} dotSize={10} dotColor="inherit:darker(0.3)" dotBorderWidth={2} dotBorderColor="#ffffff" dotLabel="y" dotLabelYOffset={-12} animate={true} motionStiffness={90} motionDamping={15} /> : <h2 className="text-muted">Empty data</h2> } </Card> ); </s> add import { getPercent } from '../../helpers/helpers'; import { STATUS_COLORS } from '../../helpers/constants'; class Statistics extends Component { render() { const { dnsQueries, blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const filteringData = [this.props.history[1]]; const queriesData = [this.props.history[2]]; const parentalData = [this.props.history[3]]; const safebrowsingData = [this.props.history[4]]; return ( <div className="row"> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-blue"> {dnsQueries} </div> <div className="card-title-stats"> DNS Queries </div> </div> <div className="card-chart-bg"> <Line data={queriesData} color={STATUS_COLORS.blue}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-red"> {blockedFiltering} </div> <div className="card-value card-value-percent text-red"> {getPercent(dnsQueries, blockedFiltering)} </div> <div className="card-title-stats"> Blocked by Filters </div> </div> <div className="card-chart-bg"> <Line data={filteringData} color={STATUS_COLORS.red}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-green"> {replacedSafebrowsing} </div> <div className="card-value card-value-percent text-green"> {getPercent(dnsQueries, replacedSafebrowsing)} </div> <div className="card-title-stats"> Blocked malware/phishing </div> </div> <div className="card-chart-bg"> <Line data={safebrowsingData} color={STATUS_COLORS.green}/> </div> </Card> </div> <div className="col-sm-6 col-lg-3"> <Card bodyType="card-wrap"> <div className="card-body-stats"> <div className="card-value card-value-stats text-yellow"> {replacedParental} </div> <div className="card-value card-value-percent text-yellow"> {getPercent(dnsQueries, replacedParental)} </div> <div className="card-title-stats"> Blocked adult websites </div> </div> <div className="card-chart-bg"> <Line data={parentalData} color={STATUS_COLORS.yellow}/> </div> </Card> </div> </div> ); } } </s> remove refreshButton: PropTypes.node, </s> add dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, refreshButton: PropTypes.node.isRequired,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bc11f872faa525d86a617159863a79cb63da5537
client/src/helpers/helpers.js
<mask> <mask> export const PRIVACY_POLICY_LINK = 'https://adguard.com/privacy/home.html'; <mask> <mask> export const LANGUAGES = [ <mask> { <mask> key: 'en', <mask> name: 'English', <mask> }, <mask> { <mask> key: 'da', <mask> name: 'Dansk', <mask> }, <mask> { </s> - client: set i18n language only from available languages </s> remove escapeValue: false, // not needed for react!! </s> add escapeValue: false, </s> remove fallbackLng: 'en', keySeparator: false, // we use content as keys nsSeparator: false, // Fix character in content returnEmptyString: false, // count empty value as invalid </s> add fallbackLng: DEFAULT_LANGUAGE, keySeparator: false, nsSeparator: false, returnEmptyString: false,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bd1ee48a4f398495cb67ff3d2595a25fb34536c9
client/src/helpers/constants.js
import { DEFAULT_LANGUAGE } from './helpers/constants';
<mask> import langDetect from 'i18next-browser-languagedetector'; <mask> <mask> import vi from './__locales/vi.json'; <mask> import en from './__locales/en.json'; <mask> import ru from './__locales/ru.json'; <mask> import es from './__locales/es.json'; </s> - client: set i18n language only from available languages </s> remove escapeValue: false, // not needed for react!! </s> add escapeValue: false, </s> remove fallbackLng: 'en', keySeparator: false, // we use content as keys nsSeparator: false, // Fix character in content returnEmptyString: false, // count empty value as invalid </s> add fallbackLng: DEFAULT_LANGUAGE, keySeparator: false, nsSeparator: false, returnEmptyString: false, </s> remove .use(reactI18nextModule) // passes i18n down to react-i18next </s> add .use(reactI18nextModule)
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bd1ee48a4f398495cb67ff3d2595a25fb34536c9
client/src/i18n.js
const availableLanguages = Object.keys(resources);
<mask> }; <mask> <mask> i18n <mask> .use(langDetect) <mask> .use(initReactI18n) <mask> .use(reactI18nextModule) <mask> .init({ <mask> resources, </s> - client: set i18n language only from available languages </s> remove .use(reactI18nextModule) // passes i18n down to react-i18next </s> add .use(reactI18nextModule) </s> remove fallbackLng: 'en', keySeparator: false, // we use content as keys nsSeparator: false, // Fix character in content returnEmptyString: false, // count empty value as invalid </s> add fallbackLng: DEFAULT_LANGUAGE, keySeparator: false, nsSeparator: false, returnEmptyString: false, </s> remove escapeValue: false, // not needed for react!! </s> add escapeValue: false,
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bd1ee48a4f398495cb67ff3d2595a25fb34536c9
client/src/i18n.js
.use(reactI18nextModule)
<mask> <mask> i18n <mask> .use(langDetect) <mask> .use(initReactI18n) <mask> .use(reactI18nextModule) // passes i18n down to react-i18next <mask> .init({ <mask> resources, <mask> fallbackLng: 'en', <mask> keySeparator: false, // we use content as keys <mask> nsSeparator: false, // Fix character in content </s> - client: set i18n language only from available languages </s> remove fallbackLng: 'en', keySeparator: false, // we use content as keys nsSeparator: false, // Fix character in content returnEmptyString: false, // count empty value as invalid </s> add fallbackLng: DEFAULT_LANGUAGE, keySeparator: false, nsSeparator: false, returnEmptyString: false, </s> remove escapeValue: false, // not needed for react!! </s> add escapeValue: false, </s> remove { key: 'en', name: 'English', }, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bd1ee48a4f398495cb67ff3d2595a25fb34536c9
client/src/i18n.js
fallbackLng: DEFAULT_LANGUAGE, keySeparator: false, nsSeparator: false, returnEmptyString: false,
<mask> .use(initReactI18n) <mask> .use(reactI18nextModule) // passes i18n down to react-i18next <mask> .init({ <mask> resources, <mask> fallbackLng: 'en', <mask> keySeparator: false, // we use content as keys <mask> nsSeparator: false, // Fix character in content <mask> returnEmptyString: false, // count empty value as invalid <mask> interpolation: { <mask> escapeValue: false, // not needed for react!! <mask> }, <mask> react: { <mask> wait: true, </s> - client: set i18n language only from available languages </s> remove escapeValue: false, // not needed for react!! </s> add escapeValue: false, </s> remove .use(reactI18nextModule) // passes i18n down to react-i18next </s> add .use(reactI18nextModule) </s> remove { key: 'en', name: 'English', }, </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bd1ee48a4f398495cb67ff3d2595a25fb34536c9
client/src/i18n.js
escapeValue: false,
<mask> keySeparator: false, // we use content as keys <mask> nsSeparator: false, // Fix character in content <mask> returnEmptyString: false, // count empty value as invalid <mask> interpolation: { <mask> escapeValue: false, // not needed for react!! <mask> }, <mask> react: { <mask> wait: true, <mask> }, <mask> }); </s> - client: set i18n language only from available languages </s> remove fallbackLng: 'en', keySeparator: false, // we use content as keys nsSeparator: false, // Fix character in content returnEmptyString: false, // count empty value as invalid </s> add fallbackLng: DEFAULT_LANGUAGE, keySeparator: false, nsSeparator: false, returnEmptyString: false, </s> remove .use(reactI18nextModule) // passes i18n down to react-i18next </s> add .use(reactI18nextModule) </s> remove { key: 'en', name: 'English', }, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bd1ee48a4f398495cb67ff3d2595a25fb34536c9
client/src/i18n.js
if (!i18n.language.includes(availableLanguages)) { i18n.changeLanguage(DEFAULT_LANGUAGE); }
<mask> }, <mask> }); <mask> <mask> export default i18n; </s> - client: set i18n language only from available languages </s> remove { key: 'en', name: 'English', }, </s> add </s> remove escapeValue: false, // not needed for react!! </s> add escapeValue: false, </s> remove fallbackLng: 'en', keySeparator: false, // we use content as keys nsSeparator: false, // Fix character in content returnEmptyString: false, // count empty value as invalid </s> add fallbackLng: DEFAULT_LANGUAGE, keySeparator: false, nsSeparator: false, returnEmptyString: false, </s> remove .use(reactI18nextModule) // passes i18n down to react-i18next </s> add .use(reactI18nextModule)
[ "keep", "keep", "add", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bd1ee48a4f398495cb67ff3d2595a25fb34536c9
client/src/i18n.js
"golang.org/x/exp/slices"
<mask> "github.com/go-ping/ping" <mask> "github.com/insomniacslk/dhcp/dhcpv4" <mask> "github.com/insomniacslk/dhcp/dhcpv4/server4" <mask> <mask> //lint:ignore SA1019 See the TODO in go.mod. <mask> "github.com/mdlayher/raw" <mask> ) <mask> </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove type optFQDN struct { name string } func (o *optFQDN) String() string { return "optFQDN" } // flags[1] // A-RR[1] // PTR-RR[1] // name[] func (o *optFQDN) ToBytes() []byte { b := make([]byte, 3+len(o.name)) i := 0 b[i] = 0x03 // f_server_overrides | f_server i++ b[i] = 255 // A-RR i++ b[i] = 255 // PTR-RR i++ copy(b[i:], []byte(o.name)) return b </s> add // OptionFQDN returns a DHCPv4 option for sending the FQDN to the client // requested another hostname. // // See https://datatracker.ietf.org/doc/html/rfc4702. func OptionFQDN(fqdn string) (opt dhcpv4.Option) { optData := []byte{ // Set only S and O DHCP client FQDN option flags. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.1. 1<<0 | 1<<1, // The RCODE fields should be set to 0xFF in the server responses. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.2. 0xFF, 0xFF, } optData = append(optData, fqdn...) return dhcpv4.OptGeneric(dhcpv4.OptionFQDN, optData)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
} else if s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) hostname = aghnet.GenerateHostname(ip)
<mask> if hostname == "" { <mask> hostname = aghnet.GenerateHostname(ip) <mask> } <mask> <mask> err = netutil.ValidateDomainName(hostname) <mask> if err != nil { <mask> log.Info("dhcpv4: %s", err) <mask> hostname = "" </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname { </s> remove switch req.MessageType() { </s> add switch mt := req.MessageType(); mt { </s> remove // Don't check for hostname uniqueness, since we try to emulate // dnsmasq here, which means that rmDynamicLease below will // simply empty the hostname of the dynamic lease if there even // is one. </s> add // Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added. </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname {
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
for i, l := range s.leases { isStatic := l.IsStatic()
<mask> <mask> // Remove a dynamic lease with the same properties <mask> // Return error if a static lease is found <mask> func (s *v4Server) rmDynamicLease(lease *Lease) (err error) { <mask> for i := 0; i < len(s.leases); i++ { <mask> l := s.leases[i] <mask> <mask> if bytes.Equal(l.HWAddr, lease.HWAddr) { <mask> if l.IsStatic() { <mask> return errors.Error("static lease already exists") <mask> } <mask> <mask> s.rmLeaseByIndex(i) <mask> if i == len(s.leases) { <mask> break <mask> } <mask> <mask> l = s.leases[i] <mask> } <mask> <mask> if l.IP.Equal(lease.IP) { <mask> if l.IsStatic() { <mask> return errors.Error("static lease already exists") <mask> } </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove if l.IP.Equal(lease.IP) { if l.IsStatic() { </s> add if bytes.Equal(l.HWAddr, lease.HWAddr) || l.IP.Equal(lease.IP) { if isStatic { </s> remove l = &Lease{ HWAddr: make([]byte, len(mac)), } copy(l.HWAddr, mac) </s> add l = &Lease{HWAddr: slices.Clone(mac)} </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname { </s> remove // Don't check for hostname uniqueness, since we try to emulate // dnsmasq here, which means that rmDynamicLease below will // simply empty the hostname of the dynamic lease if there even // is one. </s> add // Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added.
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
if bytes.Equal(l.HWAddr, lease.HWAddr) || l.IP.Equal(lease.IP) { if isStatic {
<mask> <mask> l = s.leases[i] <mask> } <mask> <mask> if l.IP.Equal(lease.IP) { <mask> if l.IsStatic() { <mask> return errors.Error("static lease already exists") <mask> } <mask> <mask> s.rmLeaseByIndex(i) <mask> if i == len(s.leases) { </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic() </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname { </s> remove l = &Lease{ HWAddr: make([]byte, len(mac)), } copy(l.HWAddr, mac) </s> add l = &Lease{HWAddr: slices.Clone(mac)} </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
if !isStatic && l.Hostname == lease.Hostname {
<mask> <mask> l = s.leases[i] <mask> } <mask> <mask> if l.Hostname == lease.Hostname { <mask> l.Hostname = "" <mask> } <mask> } <mask> <mask> return nil </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove if l.IP.Equal(lease.IP) { if l.IsStatic() { </s> add if bytes.Equal(l.HWAddr, lease.HWAddr) || l.IP.Equal(lease.IP) { if isStatic { </s> remove s.leases = append(s.leases, l) s.leasedOffsets.set(offset, true) </s> add </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname { </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
// ErrDupHostname is returned by addLease when the added lease has a not empty // non-unique hostname. const ErrDupHostname = errors.Error("hostname is not unique")
<mask> } <mask> <mask> // addLease adds a dynamic or static lease. <mask> func (s *v4Server) addLease(l *Lease) (err error) { <mask> r := s.conf.ipRange <mask> offset, inOffset := r.offset(l.IP) <mask> <mask> if l.IsStatic() { </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic() </s> remove l = &Lease{ HWAddr: make([]byte, len(mac)), } copy(l.HWAddr, mac) </s> add l = &Lease{HWAddr: slices.Clone(mac)} </s> remove // Don't check for hostname uniqueness, since we try to emulate // dnsmasq here, which means that rmDynamicLease below will // simply empty the hostname of the dynamic lease if there even // is one. </s> add // Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added. </s> remove if l.IP.Equal(lease.IP) { if l.IsStatic() { </s> add if bytes.Equal(l.HWAddr, lease.HWAddr) || l.IP.Equal(lease.IP) { if isStatic {
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
<mask> } else if !inOffset { <mask> return fmt.Errorf("lease %s (%s) out of range, not adding", l.IP, l.HWAddr) <mask> } <mask> <mask> s.leases = append(s.leases, l) <mask> s.leasedOffsets.set(offset, true) <mask> <mask> if l.Hostname != "" { <mask> s.leaseHosts.Add(l.Hostname) <mask> } <mask> <mask> return nil </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname { </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
if s.leaseHosts.Has(l.Hostname) { return ErrDupHostname }
<mask> } <mask> <mask> if l.Hostname != "" { <mask> s.leaseHosts.Add(l.Hostname) <mask> } <mask> <mask> s.leases = append(s.leases, l) <mask> s.leasedOffsets.set(offset, true) </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove s.leases = append(s.leases, l) s.leasedOffsets.set(offset, true) </s> add </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname { </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
s.leases = append(s.leases, l) s.leasedOffsets.set(offset, true)
<mask> s.leaseHosts.Add(l.Hostname) <mask> } <mask> <mask> return nil <mask> } <mask> <mask> // rmLease removes a lease with the same properties. </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic() </s> remove // Don't check for hostname uniqueness, since we try to emulate // dnsmasq here, which means that rmDynamicLease below will // simply empty the hostname of the dynamic lease if there even // is one. </s> add // Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added. </s> remove s.leases = append(s.leases, l) s.leasedOffsets.set(offset, true) </s> add </s> remove type optFQDN struct { name string } func (o *optFQDN) String() string { return "optFQDN" } // flags[1] // A-RR[1] // PTR-RR[1] // name[] func (o *optFQDN) ToBytes() []byte { b := make([]byte, 3+len(o.name)) i := 0 b[i] = 0x03 // f_server_overrides | f_server i++ b[i] = 255 // A-RR i++ b[i] = 255 // PTR-RR i++ copy(b[i:], []byte(o.name)) return b </s> add // OptionFQDN returns a DHCPv4 option for sending the FQDN to the client // requested another hostname. // // See https://datatracker.ietf.org/doc/html/rfc4702. func OptionFQDN(fqdn string) (opt dhcpv4.Option) { optData := []byte{ // Set only S and O DHCP client FQDN option flags. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.1. 1<<0 | 1<<1, // The RCODE fields should be set to 0xFF in the server responses. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.2. 0xFF, 0xFF, } optData = append(optData, fqdn...) return dhcpv4.OptGeneric(dhcpv4.OptionFQDN, optData)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
// Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added.
<mask> if err != nil { <mask> return fmt.Errorf("validating hostname: %w", err) <mask> } <mask> <mask> // Don't check for hostname uniqueness, since we try to emulate <mask> // dnsmasq here, which means that rmDynamicLease below will <mask> // simply empty the hostname of the dynamic lease if there even <mask> // is one. <mask> <mask> l.Hostname = hostname <mask> } <mask> <mask> // Perform the following actions in an anonymous function to make sure </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname { </s> remove type optFQDN struct { name string } func (o *optFQDN) String() string { return "optFQDN" } // flags[1] // A-RR[1] // PTR-RR[1] // name[] func (o *optFQDN) ToBytes() []byte { b := make([]byte, 3+len(o.name)) i := 0 b[i] = 0x03 // f_server_overrides | f_server i++ b[i] = 255 // A-RR i++ b[i] = 255 // PTR-RR i++ copy(b[i:], []byte(o.name)) return b </s> add // OptionFQDN returns a DHCPv4 option for sending the FQDN to the client // requested another hostname. // // See https://datatracker.ietf.org/doc/html/rfc4702. func OptionFQDN(fqdn string) (opt dhcpv4.Option) { optData := []byte{ // Set only S and O DHCP client FQDN option flags. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.1. 1<<0 | 1<<1, // The RCODE fields should be set to 0xFF in the server responses. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.2. 0xFF, 0xFF, } optData = append(optData, fqdn...) return dhcpv4.OptGeneric(dhcpv4.OptionFQDN, optData)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
l = &Lease{HWAddr: slices.Clone(mac)}
<mask> <mask> // reserveLease reserves a lease for a client by its MAC-address. It returns <mask> // nil if it couldn't allocate a new lease. <mask> func (s *v4Server) reserveLease(mac net.HardwareAddr) (l *Lease, err error) { <mask> l = &Lease{ <mask> HWAddr: make([]byte, len(mac)), <mask> } <mask> <mask> copy(l.HWAddr, mac) <mask> <mask> l.IP = s.nextIP() <mask> if l.IP == nil { <mask> i := s.findExpiredLease() <mask> if i < 0 { </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic() </s> remove type optFQDN struct { name string } func (o *optFQDN) String() string { return "optFQDN" } // flags[1] // A-RR[1] // PTR-RR[1] // name[] func (o *optFQDN) ToBytes() []byte { b := make([]byte, 3+len(o.name)) i := 0 b[i] = 0x03 // f_server_overrides | f_server i++ b[i] = 255 // A-RR i++ b[i] = 255 // PTR-RR i++ copy(b[i:], []byte(o.name)) return b </s> add // OptionFQDN returns a DHCPv4 option for sending the FQDN to the client // requested another hostname. // // See https://datatracker.ietf.org/doc/html/rfc4702. func OptionFQDN(fqdn string) (opt dhcpv4.Option) { optData := []byte{ // Set only S and O DHCP client FQDN option flags. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.1. 1<<0 | 1<<1, // The RCODE fields should be set to 0xFF in the server responses. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.2. 0xFF, 0xFF, } optData = append(optData, fqdn...) return dhcpv4.OptGeneric(dhcpv4.OptionFQDN, optData) </s> remove if l.IP.Equal(lease.IP) { if l.IsStatic() { </s> add if bytes.Equal(l.HWAddr, lease.HWAddr) || l.IP.Equal(lease.IP) { if isStatic {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
// OptionFQDN returns a DHCPv4 option for sending the FQDN to the client // requested another hostname. // // See https://datatracker.ietf.org/doc/html/rfc4702. func OptionFQDN(fqdn string) (opt dhcpv4.Option) { optData := []byte{ // Set only S and O DHCP client FQDN option flags. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.1. 1<<0 | 1<<1, // The RCODE fields should be set to 0xFF in the server responses. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.2. 0xFF, 0xFF, } optData = append(optData, fqdn...) return dhcpv4.OptGeneric(dhcpv4.OptionFQDN, optData)
<mask> <mask> return l, nil <mask> } <mask> <mask> type optFQDN struct { <mask> name string <mask> } <mask> <mask> func (o *optFQDN) String() string { <mask> return "optFQDN" <mask> } <mask> <mask> // flags[1] <mask> // A-RR[1] <mask> // PTR-RR[1] <mask> // name[] <mask> func (o *optFQDN) ToBytes() []byte { <mask> b := make([]byte, 3+len(o.name)) <mask> i := 0 <mask> <mask> b[i] = 0x03 // f_server_overrides | f_server <mask> i++ <mask> <mask> b[i] = 255 // A-RR <mask> i++ <mask> <mask> b[i] = 255 // PTR-RR <mask> i++ <mask> <mask> copy(b[i:], []byte(o.name)) <mask> return b <mask> } <mask> <mask> // checkLease checks if the pair of mac and ip is already leased. The mismatch <mask> // is true when the existing lease has the same hardware address but differs in <mask> // its IP address. </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic() </s> remove l = &Lease{ HWAddr: make([]byte, len(mac)), } copy(l.HWAddr, mac) </s> add l = &Lease{HWAddr: slices.Clone(mac)} </s> remove // Don't check for hostname uniqueness, since we try to emulate // dnsmasq here, which means that rmDynamicLease below will // simply empty the hostname of the dynamic lease if there even // is one. </s> add // Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added. </s> remove o := &optFQDN{ name: lease.Hostname, } fqdn := dhcpv4.Option{ Code: dhcpv4.OptionFQDN, Value: o, } resp.UpdateOption(fqdn) </s> add // TODO(e.burkov): This option is used to update the server's DNS // mapping. The option should only be answered when it has been // requested. resp.UpdateOption(OptionFQDN(lease.Hostname))
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
// TODO(e.burkov): The IP address can only be requested in DHCPDISCOVER // message.
<mask> <mask> // processRequest is the handler for the DHCP Request request. <mask> func (s *v4Server) processRequest(req, resp *dhcpv4.DHCPv4) (lease *Lease, needsReply bool) { <mask> mac := req.ClientHWAddr <mask> reqIP := req.RequestedIPAddress() <mask> if reqIP == nil { <mask> reqIP = req.ClientIPAddr <mask> } <mask> <mask> sid := req.ServerIdentifier() </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove l = &Lease{ HWAddr: make([]byte, len(mac)), } copy(l.HWAddr, mac) </s> add l = &Lease{HWAddr: slices.Clone(mac)} </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic() </s> remove type optFQDN struct { name string } func (o *optFQDN) String() string { return "optFQDN" } // flags[1] // A-RR[1] // PTR-RR[1] // name[] func (o *optFQDN) ToBytes() []byte { b := make([]byte, 3+len(o.name)) i := 0 b[i] = 0x03 // f_server_overrides | f_server i++ b[i] = 255 // A-RR i++ b[i] = 255 // PTR-RR i++ copy(b[i:], []byte(o.name)) return b </s> add // OptionFQDN returns a DHCPv4 option for sending the FQDN to the client // requested another hostname. // // See https://datatracker.ietf.org/doc/html/rfc4702. func OptionFQDN(fqdn string) (opt dhcpv4.Option) { optData := []byte{ // Set only S and O DHCP client FQDN option flags. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.1. 1<<0 | 1<<1, // The RCODE fields should be set to 0xFF in the server responses. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.2. 0xFF, 0xFF, } optData = append(optData, fqdn...) return dhcpv4.OptGeneric(dhcpv4.OptionFQDN, optData) </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
if lease.Hostname != hostname {
<mask> <mask> if !lease.IsStatic() { <mask> cliHostname := req.HostName() <mask> hostname := s.validHostnameForClient(cliHostname, reqIP) <mask> if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { <mask> log.Info("dhcpv4: hostname %q already exists", hostname) <mask> lease.Hostname = "" <mask> } else { <mask> lease.Hostname = hostname <mask> } <mask> <mask> s.commitLease(lease) <mask> } else if lease.Hostname != "" { </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname { </s> remove o := &optFQDN{ name: lease.Hostname, } fqdn := dhcpv4.Option{ Code: dhcpv4.OptionFQDN, Value: o, } resp.UpdateOption(fqdn) </s> add // TODO(e.burkov): This option is used to update the server's DNS // mapping. The option should only be answered when it has been // requested. resp.UpdateOption(OptionFQDN(lease.Hostname)) </s> remove s.leases = append(s.leases, l) s.leasedOffsets.set(offset, true) </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
resp.UpdateOption(dhcpv4.OptHostName(hostname))
<mask> cliHostname := req.HostName() <mask> hostname := s.validHostnameForClient(cliHostname, reqIP) <mask> if lease.Hostname != hostname { <mask> lease.Hostname = hostname <mask> } <mask> <mask> s.commitLease(lease) <mask> } else if lease.Hostname != "" { <mask> // TODO(e.burkov): This option is used to update the server's DNS <mask> // mapping. The option should only be answered when it has been </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove o := &optFQDN{ name: lease.Hostname, } fqdn := dhcpv4.Option{ Code: dhcpv4.OptionFQDN, Value: o, } resp.UpdateOption(fqdn) </s> add // TODO(e.burkov): This option is used to update the server's DNS // mapping. The option should only be answered when it has been // requested. resp.UpdateOption(OptionFQDN(lease.Hostname)) </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname { </s> remove // Don't check for hostname uniqueness, since we try to emulate // dnsmasq here, which means that rmDynamicLease below will // simply empty the hostname of the dynamic lease if there even // is one. </s> add // Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added. </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
// TODO(e.burkov): This option is used to update the server's DNS // mapping. The option should only be answered when it has been // requested. resp.UpdateOption(OptionFQDN(lease.Hostname))
<mask> } <mask> <mask> s.commitLease(lease) <mask> } else if lease.Hostname != "" { <mask> o := &optFQDN{ <mask> name: lease.Hostname, <mask> } <mask> fqdn := dhcpv4.Option{ <mask> Code: dhcpv4.OptionFQDN, <mask> Value: o, <mask> } <mask> <mask> resp.UpdateOption(fqdn) <mask> } <mask> <mask> resp.UpdateOption(dhcpv4.OptMessageType(dhcpv4.MessageTypeAck)) <mask> <mask> return lease, true </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname { </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname { </s> remove s.leases = append(s.leases, l) s.leasedOffsets.set(offset, true) </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
switch mt := req.MessageType(); mt {
<mask> resp.UpdateOption(dhcpv4.OptServerIdentifier(s.conf.dnsIPAddrs[0])) <mask> <mask> // TODO(a.garipov): Refactor this into handlers. <mask> var l *Lease <mask> switch req.MessageType() { <mask> case dhcpv4.MessageTypeDiscover: <mask> l, err = s.processDiscover(req, resp) <mask> if err != nil { <mask> log.Error("dhcpv4: processing discover: %s", err) <mask> </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove l = &Lease{ HWAddr: make([]byte, len(mac)), } copy(l.HWAddr, mac) </s> add l = &Lease{HWAddr: slices.Clone(mac)} </s> remove // Don't check for hostname uniqueness, since we try to emulate // dnsmasq here, which means that rmDynamicLease below will // simply empty the hostname of the dynamic lease if there even // is one. </s> add // Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added. </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic() </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4.go
"time"
<mask> "net" <mask> "strings" <mask> "testing" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com/AdguardTeam/golibs/testutil" <mask> "github.com/insomniacslk/dhcp/dhcpv4" </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic()
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4_test.go
"github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "testing" <mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com/AdguardTeam/golibs/testutil" <mask> "github.com/insomniacslk/dhcp/dhcpv4" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic() { return errors.Error("static lease already exists") } s.rmLeaseByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } </s> add for i, l := range s.leases { isStatic := l.IsStatic()
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4_test.go
DefaultSelfIP = net.IP{192, 168, 10, 2}
<mask> DefaultRangeStart = net.IP{192, 168, 10, 100} <mask> DefaultRangeEnd = net.IP{192, 168, 10, 200} <mask> DefaultGatewayIP = net.IP{192, 168, 10, 1} <mask> DefaultSubnetMask = net.IP{255, 255, 255, 0} <mask> ) <mask> <mask> func notify4(flags uint32) { </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove l = &Lease{ HWAddr: make([]byte, len(mac)), } copy(l.HWAddr, mac) </s> add l = &Lease{HWAddr: slices.Clone(mac)} </s> remove if l.Hostname == lease.Hostname { </s> add if !isStatic && l.Hostname == lease.Hostname { </s> remove if hostname != lease.Hostname && s.leaseHosts.Has(hostname) { log.Info("dhcpv4: hostname %q already exists", hostname) lease.Hostname = "" } else { </s> add if lease.Hostname != hostname { </s> remove type optFQDN struct { name string } func (o *optFQDN) String() string { return "optFQDN" } // flags[1] // A-RR[1] // PTR-RR[1] // name[] func (o *optFQDN) ToBytes() []byte { b := make([]byte, 3+len(o.name)) i := 0 b[i] = 0x03 // f_server_overrides | f_server i++ b[i] = 255 // A-RR i++ b[i] = 255 // PTR-RR i++ copy(b[i:], []byte(o.name)) return b </s> add // OptionFQDN returns a DHCPv4 option for sending the FQDN to the client // requested another hostname. // // See https://datatracker.ietf.org/doc/html/rfc4702. func OptionFQDN(fqdn string) (opt dhcpv4.Option) { optData := []byte{ // Set only S and O DHCP client FQDN option flags. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.1. 1<<0 | 1<<1, // The RCODE fields should be set to 0xFF in the server responses. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.2. 0xFF, 0xFF, } optData = append(optData, fqdn...) return dhcpv4.OptGeneric(dhcpv4.OptionFQDN, optData)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4_test.go
dnsIPAddrs: []net.IP{DefaultSelfIP},
<mask> RangeEnd: DefaultRangeEnd, <mask> GatewayIP: DefaultGatewayIP, <mask> SubnetMask: DefaultSubnetMask, <mask> notify: notify4, <mask> } <mask> } <mask> <mask> // defaultSrv prepares the default DHCPServer to use in tests. The underlying </s> Pull request: 4745 Fix DHCP hostnames Merge in DNS/adguard-home from 4745-fix-dhcp-hostnames to master Closes #4745. Squashed commit of the following: commit fe03c8eda6c8ee35a10eb5f5a8e4d4d0c7373246 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:16:16 2022 +0300 dhcpd: imp code, naming commit 7a7129268917d99ba16781b7f2e9bfb7ae84ff3e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 18:10:12 2022 +0300 dhcpd: add tests commit bb14a4a62df1eed6492d30f622c3e22da9a6f4be Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:58:29 2022 +0300 dhcpd: imp code, docs commit 2ada39f994cb9dbb2208d47a588eb72056bb5306 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:44:35 2022 +0300 all: log changes commit cbd3ed254865921be09376097dac9f5926b2349a Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:40:54 2022 +0300 dhcpd: imp option 81 commit 64dabb52560f5edc08f17aadaa43172a5d74463d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 14:10:15 2022 +0300 dhcpd: fix empty hostname in static lease commit 0df5d10d0d94863b9bbab28129bcc3436fb71222 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 23 13:34:31 2022 +0300 dhcpd: report dupl hostnames of static lease </s> remove type optFQDN struct { name string } func (o *optFQDN) String() string { return "optFQDN" } // flags[1] // A-RR[1] // PTR-RR[1] // name[] func (o *optFQDN) ToBytes() []byte { b := make([]byte, 3+len(o.name)) i := 0 b[i] = 0x03 // f_server_overrides | f_server i++ b[i] = 255 // A-RR i++ b[i] = 255 // PTR-RR i++ copy(b[i:], []byte(o.name)) return b </s> add // OptionFQDN returns a DHCPv4 option for sending the FQDN to the client // requested another hostname. // // See https://datatracker.ietf.org/doc/html/rfc4702. func OptionFQDN(fqdn string) (opt dhcpv4.Option) { optData := []byte{ // Set only S and O DHCP client FQDN option flags. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.1. 1<<0 | 1<<1, // The RCODE fields should be set to 0xFF in the server responses. // // See https://datatracker.ietf.org/doc/html/rfc4702#section-2.2. 0xFF, 0xFF, } optData = append(optData, fqdn...) return dhcpv4.OptGeneric(dhcpv4.OptionFQDN, optData) </s> remove o := &optFQDN{ name: lease.Hostname, } fqdn := dhcpv4.Option{ Code: dhcpv4.OptionFQDN, Value: o, } resp.UpdateOption(fqdn) </s> add // TODO(e.burkov): This option is used to update the server's DNS // mapping. The option should only be answered when it has been // requested. resp.UpdateOption(OptionFQDN(lease.Hostname)) </s> remove // Don't check for hostname uniqueness, since we try to emulate // dnsmasq here, which means that rmDynamicLease below will // simply empty the hostname of the dynamic lease if there even // is one. </s> add // Don't check for hostname uniqueness, since we try to emulate dnsmasq // here, which means that rmDynamicLease below will simply empty the // hostname of the dynamic lease if there even is one. In case a static // lease with the same name already exists, addLease will return an // error and the lease won't be added.
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdcf345155207a25e48872175de9ddcbbc44af62
internal/dhcpd/v4_test.go
github.com/ameshkov/dnscrypt/v2 v2.2.2
<mask> github.com/AdguardTeam/dnsproxy v0.39.4 <mask> github.com/AdguardTeam/golibs v0.9.2 <mask> github.com/AdguardTeam/urlfilter v0.14.6 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/ameshkov/dnscrypt/v2 v2.2.1 <mask> github.com/digineo/go-ipset/v2 v2.2.1 <mask> github.com/fsnotify/fsnotify v1.4.9 <mask> github.com/go-ping/ping v0.0.0-20210506233800-ff8be3320020 <mask> github.com/google/go-cmp v0.5.5 <mask> github.com/google/renameio v1.0.1 </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove github.com/ameshkov/dnscrypt/v2 v2.2.1 h1:+cApRxzeBZqjUNsN26TTz7r5A8U+buON3kJgIYE3QWQ= github.com/ameshkov/dnscrypt/v2 v2.2.1/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo= </s> add github.com/ameshkov/dnscrypt/v2 v2.2.2 h1:lxtS1iSA2EjTOMToSi+2+rwspNA+b/wG5/JpccvE9CU= github.com/ameshkov/dnscrypt/v2 v2.2.2/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo= </s> remove golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= </s> add </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.mod
github.com/miekg/dns v1.1.43
<mask> github.com/kardianos/service v1.2.0 <mask> github.com/lucas-clemente/quic-go v0.21.1 <mask> github.com/mdlayher/netlink v1.4.0 <mask> github.com/mdlayher/raw v0.0.0-20210412142147-51b895745faf // indirect <mask> github.com/miekg/dns v1.1.42 <mask> github.com/satori/go.uuid v1.2.0 <mask> github.com/stretchr/objx v0.1.1 // indirect <mask> github.com/stretchr/testify v1.7.0 <mask> github.com/ti-mo/netfilter v0.4.0 <mask> go.etcd.io/bbolt v1.3.6 </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/net v0.0.0-20210825183410-e898025ed96a golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e </s> remove github.com/miekg/dns v1.1.42 h1:gWGe42RGaIqXQZ+r3WUGEKBEtvPHY2SXo4dqixDNxuY= github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= </s> add github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= </s> remove golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.mod
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/net v0.0.0-20210825183410-e898025ed96a golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e
<mask> github.com/stretchr/objx v0.1.1 // indirect <mask> github.com/stretchr/testify v1.7.0 <mask> github.com/ti-mo/netfilter v0.4.0 <mask> go.etcd.io/bbolt v1.3.6 <mask> golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a <mask> golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 <mask> golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf <mask> gopkg.in/natefinch/lumberjack.v2 v2.0.0 <mask> gopkg.in/yaml.v2 v2.4.0 <mask> howett.net/plist v0.0.0-20201203080718-1454fab16a06 <mask> ) <mask> </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove github.com/miekg/dns v1.1.42 </s> add github.com/miekg/dns v1.1.43 </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= </s> remove golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.mod
github.com/ameshkov/dnscrypt/v2 v2.2.2 h1:lxtS1iSA2EjTOMToSi+2+rwspNA+b/wG5/JpccvE9CU= github.com/ameshkov/dnscrypt/v2 v2.2.2/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo=
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= <mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw= <mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us= <mask> github.com/ameshkov/dnscrypt/v2 v2.1.3/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo= <mask> github.com/ameshkov/dnscrypt/v2 v2.2.1 h1:+cApRxzeBZqjUNsN26TTz7r5A8U+buON3kJgIYE3QWQ= <mask> github.com/ameshkov/dnscrypt/v2 v2.2.1/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo= <mask> github.com/ameshkov/dnsstamps v1.0.1/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A= <mask> github.com/ameshkov/dnsstamps v1.0.3 h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1OYVo= <mask> github.com/ameshkov/dnsstamps v1.0.3/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A= <mask> github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= <mask> github.com/beefsack/go-rate v0.0.0-20200827232406-6cde80facd47 h1:M57m0xQqZIhx7CEJgeLSvRFKEK1RjzRuIXiA3HfYU7g= </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove github.com/ameshkov/dnscrypt/v2 v2.2.1 </s> add github.com/ameshkov/dnscrypt/v2 v2.2.2 </s> remove github.com/miekg/dns v1.1.42 h1:gWGe42RGaIqXQZ+r3WUGEKBEtvPHY2SXo4dqixDNxuY= github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= </s> add github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= </s> remove golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.sum
github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
<mask> github.com/mdlayher/raw v0.0.0-20210412142147-51b895745faf/go.mod h1:7EpbotpCmVZcu+KCX4g9WaRNuu11uyhiW7+Le1dKawg= <mask> github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= <mask> github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= <mask> github.com/miekg/dns v1.1.40/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= <mask> github.com/miekg/dns v1.1.42 h1:gWGe42RGaIqXQZ+r3WUGEKBEtvPHY2SXo4dqixDNxuY= <mask> github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= <mask> github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= <mask> github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= <mask> github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= <mask> github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= <mask> github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove github.com/miekg/dns v1.1.42 </s> add github.com/miekg/dns v1.1.43 </s> remove github.com/ameshkov/dnscrypt/v2 v2.2.1 h1:+cApRxzeBZqjUNsN26TTz7r5A8U+buON3kJgIYE3QWQ= github.com/ameshkov/dnscrypt/v2 v2.2.1/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo= </s> add github.com/ameshkov/dnscrypt/v2 v2.2.2 h1:lxtS1iSA2EjTOMToSi+2+rwspNA+b/wG5/JpccvE9CU= github.com/ameshkov/dnscrypt/v2 v2.2.2/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo= </s> remove golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.sum
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
<mask> golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= <mask> golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= <mask> golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= <mask> golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= <mask> golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= <mask> golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= <mask> golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= <mask> golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= <mask> golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= <mask> golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= <mask> golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/net v0.0.0-20210825183410-e898025ed96a golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e </s> remove golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= </s> add </s> remove github.com/miekg/dns v1.1.42 h1:gWGe42RGaIqXQZ+r3WUGEKBEtvPHY2SXo4dqixDNxuY= github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= </s> add github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.sum
<mask> golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= <mask> golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= <mask> golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= <mask> golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= <mask> golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= <mask> golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/net v0.0.0-20210825183410-e898025ed96a golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e </s> remove golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= </s> remove github.com/miekg/dns v1.1.42 h1:gWGe42RGaIqXQZ+r3WUGEKBEtvPHY2SXo4dqixDNxuY= github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= </s> add github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.sum
golang.org/x/net v0.0.0-20210825183410-e898025ed96a h1:bRuuGXV8wwSdGTB+CtJf+FjgO1APK1CoO39T4BN/XBw= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
<mask> golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= <mask> golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= <mask> golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= <mask> golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= <mask> golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= </s> add </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/net v0.0.0-20210825183410-e898025ed96a golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e </s> remove golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= </s> remove github.com/miekg/dns v1.1.42 h1:gWGe42RGaIqXQZ+r3WUGEKBEtvPHY2SXo4dqixDNxuY= github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= </s> add github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.sum
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e h1:XMgFehsDnnLGtjvjOfqWSUzt0alpTR1RSEuznObga2c= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
<mask> golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= <mask> golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= <mask> golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= <mask> golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= <mask> golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= <mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= <mask> golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= <mask> golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= </s> Pull request: all: upd dnscrypt and deps Merge in DNS/adguard-home from upd-dnscrypt to master Squashed commit of the following: commit 99870b4f544ac90b1a5132e4f18b74fe93950a17 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 20:09:45 2021 +0300 all: upd dnscrypt and deps </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/net v0.0.0-20210825183410-e898025ed96a golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e </s> remove golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= </s> add </s> remove golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= </s> add golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= </s> remove github.com/miekg/dns v1.1.42 h1:gWGe42RGaIqXQZ+r3WUGEKBEtvPHY2SXo4dqixDNxuY= github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= </s> add github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/bdd0ca54230495beed842d0adf5a712a0d78060e
go.sum
COMMIT="${bamboo.repository.revision.number}" export COMMIT readonly COMMIT
<mask> set -e -f -u -x <mask> <mask> # Explicitly checkout the revision that we need. <mask> git checkout "$COMMIT" <mask> <mask> # Install Qemu, create builder. </s> Pull request 1741: docker-spec-no-make Merge in DNS/adguard-home from docker-spec-no-make to master Squashed commit of the following: commit 897edba3bc23cdc105bc0f4017c862d84128fd71 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 16 16:57:31 2023 +0300 bamboo-specs: do not require make where not needed </s> remove git checkout "${bamboo.repository.revision.number}" </s> add git checkout "$COMMIT" </s> remove make\ </s> add env\ </s> remove build-docker </s> add sh ./scripts/make/build-docker.sh
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be43ce1760a10360d0a1379234b33ced3c647251
bamboo-specs/release.yaml
git checkout "$COMMIT"
<mask> <mask> set -e -f -u -x <mask> <mask> # Explicitly checkout the revision that we need. <mask> git checkout "${bamboo.repository.revision.number}" <mask> <mask> # Install Qemu, create builder. <mask> docker version -f '{{ .Server.Experimental }}' <mask> docker buildx rm buildx-builder || : <mask> docker buildx create --name buildx-builder --driver docker-container\ </s> Pull request 1741: docker-spec-no-make Merge in DNS/adguard-home from docker-spec-no-make to master Squashed commit of the following: commit 897edba3bc23cdc105bc0f4017c862d84128fd71 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 16 16:57:31 2023 +0300 bamboo-specs: do not require make where not needed </s> remove make\ </s> add env\ </s> remove build-docker </s> add sh ./scripts/make/build-docker.sh
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be43ce1760a10360d0a1379234b33ced3c647251
bamboo-specs/release.yaml
env\
<mask> # Print Docker info. <mask> docker info <mask> <mask> # Prepare and push the build. <mask> make\ <mask> CHANNEL="${bamboo.channel}"\ <mask> DOCKER_IMAGE_NAME='adguard/adguardhome'\ <mask> DOCKER_OUTPUT="type=image,name=adguard/adguardhome,push=true"\ <mask> VERBOSE='1'\ <mask> build-docker </s> Pull request 1741: docker-spec-no-make Merge in DNS/adguard-home from docker-spec-no-make to master Squashed commit of the following: commit 897edba3bc23cdc105bc0f4017c862d84128fd71 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 16 16:57:31 2023 +0300 bamboo-specs: do not require make where not needed </s> remove build-docker </s> add sh ./scripts/make/build-docker.sh </s> remove git checkout "${bamboo.repository.revision.number}" </s> add git checkout "$COMMIT"
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be43ce1760a10360d0a1379234b33ced3c647251
bamboo-specs/release.yaml
DIST_DIR='dist'\
<mask> # Prepare and push the build. <mask> env\ <mask> CHANNEL="${bamboo.channel}"\ <mask> DOCKER_IMAGE_NAME='adguard/adguardhome'\ <mask> DOCKER_OUTPUT="type=image,name=adguard/adguardhome,push=true"\ <mask> VERBOSE='1'\ <mask> sh ./scripts/make/build-docker.sh <mask> 'environment': <mask> DOCKER_CLI_EXPERIMENTAL=enabled </s> Pull request 1741: docker-spec-no-make Merge in DNS/adguard-home from docker-spec-no-make to master Squashed commit of the following: commit 897edba3bc23cdc105bc0f4017c862d84128fd71 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 16 16:57:31 2023 +0300 bamboo-specs: do not require make where not needed </s> remove make\ </s> add env\ </s> remove build-docker </s> add sh ./scripts/make/build-docker.sh </s> remove git checkout "${bamboo.repository.revision.number}" </s> add git checkout "$COMMIT"
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be43ce1760a10360d0a1379234b33ced3c647251
bamboo-specs/release.yaml
sh ./scripts/make/build-docker.sh
<mask> CHANNEL="${bamboo.channel}"\ <mask> DOCKER_IMAGE_NAME='adguard/adguardhome'\ <mask> DOCKER_OUTPUT="type=image,name=adguard/adguardhome,push=true"\ <mask> VERBOSE='1'\ <mask> build-docker <mask> 'environment': <mask> DOCKER_CLI_EXPERIMENTAL=enabled <mask> 'final-tasks': <mask> - 'clean' <mask> 'requirements': </s> Pull request 1741: docker-spec-no-make Merge in DNS/adguard-home from docker-spec-no-make to master Squashed commit of the following: commit 897edba3bc23cdc105bc0f4017c862d84128fd71 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 16 16:57:31 2023 +0300 bamboo-specs: do not require make where not needed </s> remove make\ </s> add env\ </s> remove git checkout "${bamboo.repository.revision.number}" </s> add git checkout "$COMMIT"
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be43ce1760a10360d0a1379234b33ced3c647251
bamboo-specs/release.yaml
'dockerGo': 'adguard/golang-ubuntu:3.1'
<mask> # Set the default release channel on the release branch to beta, as we may <mask> # need to build a few of these. <mask> 'variables': <mask> 'channel': 'beta' <mask> 'dockerGo': 'adguard/golang-ubuntu:2.0' <mask> # release-vX.Y.Z branches are the branches from which the actual final release <mask> # is built. <mask> - '^release-v[0-9]+\.[0-9]+\.[0-9]+': <mask> # Build final releases on release branches manually. <mask> 'triggers': [] </s> Pull request: all: imp new plat docs Updates #2441. Updates #2443. Squashed commit of the following: commit 6e5218916753bffb91f9fc6d5a546487add620d5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jun 1 15:56:21 2021 +0300 all: imp new plat docs </s> remove 'dockerGo': 'adguard/golang-ubuntu:2.0' </s> add 'dockerGo': 'adguard/golang-ubuntu:3.1' </s> remove // OS X </s> add // macOS
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be4e110732c256edad1d5c14ea90197e4d4329e3
bamboo-specs/release.yaml
'dockerGo': 'adguard/golang-ubuntu:3.1'
<mask> # Set the default release channel on the final branch to release, as these <mask> # are the ones that actually get released. <mask> 'variables': <mask> 'channel': 'release' <mask> 'dockerGo': 'adguard/golang-ubuntu:2.0' </s> Pull request: all: imp new plat docs Updates #2441. Updates #2443. Squashed commit of the following: commit 6e5218916753bffb91f9fc6d5a546487add620d5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jun 1 15:56:21 2021 +0300 all: imp new plat docs </s> remove 'dockerGo': 'adguard/golang-ubuntu:2.0' </s> add 'dockerGo': 'adguard/golang-ubuntu:3.1' </s> remove // OS X </s> add // macOS
[ "keep", "keep", "keep", "keep", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be4e110732c256edad1d5c14ea90197e4d4329e3
bamboo-specs/release.yaml
// macOS
<mask> // configureService defines additional settings of the service <mask> func configureService(c *service.Config) { <mask> c.Option = service.KeyValue{} <mask> <mask> // OS X <mask> // Redefines the launchd config file template <mask> // The purpose is to enable stdout/stderr redirect by default <mask> c.Option["LaunchdConfig"] = launchdConfig <mask> // This key is used to start the job as soon as it has been loaded. For daemons this means execution at boot time, for agents execution at login. <mask> c.Option["RunAtLoad"] = true </s> Pull request: all: imp new plat docs Updates #2441. Updates #2443. Squashed commit of the following: commit 6e5218916753bffb91f9fc6d5a546487add620d5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Jun 1 15:56:21 2021 +0300 all: imp new plat docs </s> remove 'dockerGo': 'adguard/golang-ubuntu:2.0' </s> add 'dockerGo': 'adguard/golang-ubuntu:3.1' </s> remove 'dockerGo': 'adguard/golang-ubuntu:2.0' </s> add 'dockerGo': 'adguard/golang-ubuntu:3.1'
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be4e110732c256edad1d5c14ea90197e4d4329e3
internal/home/service.go