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 d...
[ "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> <...
[ "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.Fil...
[ "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...
[ "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:...
[ "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(gziph...
[ "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> er...
[ "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 {...
[ "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 handl...
[ "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 p...
[ "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,...
[ "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 d...
[ "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...
[ "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 ...
[ "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,...
[ "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 T...
[ "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 ...
[ "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 ...
[ "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 ...
[ "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 h...
[ "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 addi...
[ "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(n...
[ "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 parameter...
[ "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 { <mas...
[ "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:...
[ "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 } ho...
<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 <mas...
[ "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 h...
[ "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.SplitHostP...
[ "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...
[ "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...
[ "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 { co...
<mask> dispatch(findActiveDhcpFailure()); <mask> } <mask> } <mask> }; </s> + client: added name for client </s> remove {queryLogEnabled && queryLogs.getLogsProcessing && <Loading />} {queryLogEnabled && !queryLogs.getLogsProcessing && ...
[ "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: ...
[ "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', met...
[ "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> ...
[ "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) => { <m...
[ "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; } retu...
<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) ...
[ "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...
[ "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="...
[ "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> im...
[ "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> ...
[ "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> ...
[ "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)}...
[ "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 &...
<mask> {this.renderButtons(queryLogEnabled, dashboard.logStatusProcessing)} <mask> </div> <mask> </PageTitle> <mask> <Card> <mask> {queryLogEnabled && queryLogs.getLogsProcessing && <Loading />} <mask> ...
[ "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 &...
[ "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, pro...
<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 ...
[ "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 } = thi...
[ "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, ...
[ "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 = ...
[ "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 } fr...
[ "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; ...
<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> <Resp...
[ "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=...
[ "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 in...
[ "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_s...
[ "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>...
[ "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 langua...
[ "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 ...
[ "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> ns...
[ "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 <mas...
[ "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> }, ...
[ "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...
[ "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-...
[ "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-fi...
[ "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) ...
[ "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 Me...
[ "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 commi...
[ "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...
[ "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> ...
[ "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. S...
[ "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: ...
[ "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...
<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...
[ "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> <ma...
[ "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.i...
<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) ToByte...
[ "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 ...
[ "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 = "" ...
[ "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 optio...
[ "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> }...
[ "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 { <...
[ "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 Me...
[ "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 ...
[ "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 Me...
[ "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 i...
[ "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/fsno...
[ "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/...
[ "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/...
[ "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:lmL...
[ "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= ...
[ "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:LzIPMQfyMNh...
[ "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:m0MpNAwzfU5UDzcl9v0D...
[ "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:9nx3DQGgdP8bBQD5qxJ1...
[ "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:h1NjWce9XRLGQEsW7wpK...
[ "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 c...
[ "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> d...
[ "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=adgua...
[ "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> ...
[ "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> ...
[ "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...
[ "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. Updat...
[ "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>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/be4e110732c256edad1d5c14ea90197e4d4329e3
internal/home/service.go