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
) (f func(name []byte, b *bbolt.Bucket) (err error)) { return func(name []byte, _ *bbolt.Bucket) (err error) {
<mask> func newBucketWalker( <mask> tx *bolt.Tx, <mask> unitDelPtr *int, <mask> firstID uint32, <mask> ) (f func(name []byte, b *bolt.Bucket) (err error)) { <mask> return func(name []byte, _ *bolt.Bucket) (err error) { <mask> nameID, ok := unitNameToID(name) <mask> if !ok || nameID < firstID { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// Start makes s process the incoming data. func (s *StatsCtx) Start() {
<mask> return errStop <mask> } <mask> } <mask> <mask> func (s *statsCtx) Start() { <mask> s.initWeb() <mask> go s.periodicFlush() <mask> } <mask> <mask> func checkInterval(days uint32) bool { </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to master Updates #4358. Upd...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// checkInterval returns true if days is valid to be used as statistics // retention interval. The valid values are 0, 1, 7, 30 and 90. func checkInterval(days uint32) (ok bool) {
<mask> s.initWeb() <mask> go s.periodicFlush() <mask> } <mask> <mask> func checkInterval(days uint32) bool { <mask> return days == 0 || days == 1 || days == 7 || days == 30 || days == 90 <mask> } <mask> <mask> func (s *statsCtx) dbOpen() bool { <mask> var err error </s> Pull request: 4358 fix stats Me...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// dbOpen returns an error if the database can't be opened from the specified // file. It's safe for concurrent use. func (s *StatsCtx) dbOpen() (err error) {
<mask> func checkInterval(days uint32) bool { <mask> return days == 0 || days == 1 || days == 7 || days == 30 || days == 90 <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, 0o644, nil) <mask> if er...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
s.dbMu.Lock() defer s.dbMu.Unlock() s.db, err = bbolt.Open(s.filename, 0o644, nil)
<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, 0o644, nil) <mask> if err != nil { <mask> log.Error("stats: open DB: %s: %s", s.conf.Filename, err) <mask> if err.Error() == "invalid argument" { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
log.Error("stats: open DB: %s: %s", s.filename, err)
<mask> var err error <mask> log.Tracef("db.Open...") <mask> s.db, err = bolt.Open(s.conf.Filename, 0o644, nil) <mask> if err != nil { <mask> log.Error("stats: open DB: %s: %s", s.conf.Filename, err) <mask> if err.Error() == "invalid argument" { <mask> log.Error("AdGuard Home cannot be initialized due ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
<mask> log.Error("stats: open DB: %s: %s", s.conf.Filename, err) <mask> if err.Error() == "invalid argument" { <mask> log.Error("AdGuard Home cannot be initialized due to an incompatible file system.\nPlease read the explanation here: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#limitations...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
return err }
<mask> log.Tracef("db.Open") <mask> return true <mask> } <mask> <mask> // Atomically swap the currently active unit with a new value <mask> // Return old value <mask> func (s *statsCtx) swapUnit(new *unit) (u *unit) { <mask> s.mu.Lock() <mask> defer s.mu.Unlock() <mask> <mask> u = s.current <mask> s...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
log.Tracef("db.Open")
<mask> func (s *statsCtx) swapUnit(new *unit) (u *unit) { <mask> s.mu.Lock() <mask> defer s.mu.Unlock() <mask> <mask> u = s.current <mask> s.current = new <mask> <mask> return u <mask> } <mask> <mask> // Get unit ID for the current hour </s> Pull request: 4358 fix stats Merge in DNS/adguard-home fr...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
return nil
<mask> <mask> u = s.current <mask> s.current = new <mask> <mask> return u <mask> } <mask> <mask> // Get unit ID for the current hour <mask> func newUnitID() uint32 { <mask> return uint32(time.Now().Unix() / (60 * 60)) </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// newUnitID is the default UnitIDGenFunc that generates the unique id hourly. func newUnitID() (id uint32) { const secsInHour = int64(time.Hour / time.Second) return uint32(time.Now().Unix() / secsInHour)
<mask> <mask> return u <mask> } <mask> <mask> // Get unit ID for the current hour <mask> func newUnitID() uint32 { <mask> return uint32(time.Now().Unix() / (60 * 60)) <mask> } <mask> <mask> // Initialize a unit <mask> func (s *statsCtx) initUnit(u *unit, id uint32) { <mask> u.id = id </s> Pull reques...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// newUnit allocates the new *unit. func newUnit(id uint32) (u *unit) { return &unit{ mu: &sync.RWMutex{}, id: id, nResult: make([]uint64, resultLast), domains: make(map[string]uint64), blockedDomains: make(map[string]uint64), clients: make(map[string]uint64), ...
<mask> func newUnitID() uint32 { <mask> return uint32(time.Now().Unix() / (60 * 60)) <mask> } <mask> <mask> // Initialize a unit <mask> func (s *statsCtx) initUnit(u *unit, id uint32) { <mask> u.id = id <mask> u.nResult = make([]uint64, rLast) <mask> u.domains = make(map[string]uint64) <mask> u.blockedD...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// beginTxn opens a new database transaction. If writable is true, the // transaction will be opened for writing, and for reading otherwise. It // returns nil if the transaction can't be created. func beginTxn(db *bbolt.DB, writable bool) (tx *bbolt.Tx) {
<mask> u.blockedDomains = make(map[string]uint64) <mask> u.clients = make(map[string]uint64) <mask> } <mask> <mask> // Open a DB transaction <mask> func (s *statsCtx) beginTxn(wr bool) *bolt.Tx { <mask> db := s.db <mask> if db == nil { <mask> return nil <mask> } <mask> <mask> log.Tracef("db.Begin....
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
log.Tracef("opening a database transaction") tx, err := db.Begin(writable)
<mask> if db == nil { <mask> return nil <mask> } <mask> <mask> log.Tracef("db.Begin...") <mask> tx, err := db.Begin(wr) <mask> if err != nil { <mask> log.Error("db.Begin: %s", err) <mask> return nil <mask> } <mask> log.Tracef("db.Begin") </s> Pull request: 4358 fix stats Merge in DNS/adguard-...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
log.Error("stats: opening a transaction: %s", err)
<mask> <mask> log.Tracef("db.Begin...") <mask> tx, err := db.Begin(wr) <mask> if err != nil { <mask> log.Error("db.Begin: %s", err) <mask> return nil <mask> } <mask> log.Tracef("db.Begin") <mask> return tx <mask> } </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
log.Tracef("transaction has been opened")
<mask> if err != nil { <mask> log.Error("db.Begin: %s", err) <mask> return nil <mask> } <mask> log.Tracef("db.Begin") <mask> return tx <mask> } <mask> <mask> func (s *statsCtx) commitTxn(tx *bolt.Tx) { <mask> err := tx.Commit() </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// commitTxn applies the changes made in tx to the database. func (s *StatsCtx) commitTxn(tx *bbolt.Tx) {
<mask> log.Tracef("db.Begin") <mask> return tx <mask> } <mask> <mask> func (s *statsCtx) commitTxn(tx *bolt.Tx) { <mask> err := tx.Commit() <mask> if err != nil { <mask> log.Debug("tx.Commit: %s", err) <mask> return <mask> } </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
log.Error("stats: committing a transaction: %s", err)
<mask> <mask> func (s *statsCtx) commitTxn(tx *bolt.Tx) { <mask> err := tx.Commit() <mask> if err != nil { <mask> log.Debug("tx.Commit: %s", err) <mask> return <mask> } <mask> log.Tracef("tx.Commit") <mask> } <mask> </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
log.Tracef("transaction has been committed")
<mask> if err != nil { <mask> log.Debug("tx.Commit: %s", err) <mask> return <mask> } <mask> log.Tracef("tx.Commit") <mask> } <mask> <mask> // bucketNameLen is the length of a bucket, a 64-bit unsigned integer. <mask> // <mask> // TODO(a.garipov): Find out why a 64-bit integer is used when IDs seem to ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
n := [bucketNameLen]byte{} binary.BigEndian.PutUint64(n[:], uint64(id))
<mask> const bucketNameLen = 8 <mask> <mask> // idToUnitName converts a numerical ID into a database unit name. <mask> func idToUnitName(id uint32) (name []byte) { <mask> name = make([]byte, bucketNameLen) <mask> binary.BigEndian.PutUint64(name, uint64(id)) <mask> <mask> return name <mask> } <mask> <ma...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
return n[:]
<mask> func idToUnitName(id uint32) (name []byte) { <mask> name = make([]byte, bucketNameLen) <mask> binary.BigEndian.PutUint64(name, uint64(id)) <mask> <mask> return name <mask> } <mask> <mask> // unitNameToID converts a database unit name into a numerical ID. ok is false <mask> // if name is not a vali...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
<mask> <mask> return uint32(binary.BigEndian.Uint64(name)), true <mask> } <mask> <mask> func (s *statsCtx) ongoing() (u *unit) { <mask> s.mu.Lock() <mask> defer s.mu.Unlock() <mask> <mask> return s.current <mask> } <mask> <mask> // Flush the current unit to DB and delete an old unit when a new hour ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) periodicFlush() { for ptr := s.ongoing(); ptr != nil; ptr = s.ongoing() { id := s.unitIDGen() // Access the unit's ID with atomic to avoid locking the whole unit. if !s.isEnabled() || atomic.LoadUint32(&ptr.id) == id {
<mask> // This is important to do it inside DB lock, so the reader won't get inconsistent results. <mask> // . write the unit to DB <mask> // . remove the stale unit from DB <mask> // . unlock DB <mask> func (s *statsCtx) periodicFlush() { <mask> for { <mask> ptr := s.ongoing() <mask> if ptr == nil { <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
tx := beginTxn(s.database(), true)
<mask> <mask> continue <mask> } <mask> <mask> tx := s.beginTxn(true) <mask> <mask> nu := unit{} <mask> s.initUnit(&nu, id) <mask> u := s.swapUnit(&nu) <mask> udb := serialize(u) </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to master Updates #4358. Update...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
nu := newUnit(id) u := s.swapCurrent(nu) udb := u.serialize()
<mask> } <mask> <mask> tx := s.beginTxn(true) <mask> <mask> nu := unit{} <mask> s.initUnit(&nu, id) <mask> u := s.swapUnit(&nu) <mask> udb := serialize(u) <mask> <mask> if tx == nil { <mask> continue <mask> } <mask> </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
flushOK := flushUnitToDB(tx, u.id, udb) delOK := s.deleteUnit(tx, id-atomic.LoadUint32(&s.limitHours)) if flushOK || delOK {
<mask> if tx == nil { <mask> continue <mask> } <mask> <mask> ok1 := s.flushUnitToDB(tx, u.id, udb) <mask> ok2 := s.deleteUnit(tx, id-s.conf.limit) <mask> if ok1 || ok2 { <mask> s.commitTxn(tx) <mask> } else { <mask> _ = tx.Rollback() <mask> } <mask> } </s> Pull request: 4358 fix st...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// deleteUnit removes the unit by it's id from the database the tx belongs to. func (s *StatsCtx) deleteUnit(tx *bbolt.Tx, id uint32) bool {
<mask> <mask> log.Tracef("periodicFlush() exited") <mask> } <mask> <mask> // Delete unit's data from file <mask> func (s *statsCtx) deleteUnit(tx *bolt.Tx, id uint32) bool { <mask> err := tx.DeleteBucket(idToUnitName(id)) <mask> if err != nil { <mask> log.Tracef("stats: bolt DeleteBucket: %s", err) <ma...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
a = append(a, countPair{Name: k, Count: v})
<mask> <mask> func convertMapToSlice(m map[string]uint64, max int) []countPair { <mask> a := []countPair{} <mask> for k, v := range m { <mask> pair := countPair{} <mask> pair.Name = k <mask> pair.Count = v <mask> a = append(a, pair) <mask> } <mask> less := func(i, j int) bool { <mask> return a...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// serialize converts u to the *unitDB. It's safe for concurrent use. func (u *unit) serialize() (udb *unitDB) { u.mu.RLock() defer u.mu.RUnlock()
<mask> } <mask> return m <mask> } <mask> <mask> func serialize(u *unit) *unitDB { <mask> udb := unitDB{} <mask> udb.NTotal = u.nTotal <mask> <mask> udb.NResult = append(udb.NResult, u.nResult...) <mask> <mask> if u.nTotal != 0 { <mask> udb.TimeAvg = uint32(u.timeSum / u.nTotal) <mask> } <mask>...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
var timeAvg uint32 = 0
<mask> defer u.mu.RUnlock() <mask> <mask> if u.nTotal != 0 { <mask> timeAvg = uint32(u.timeSum / u.nTotal) <mask> } <mask> <mask> return &unitDB{ <mask> NTotal: u.nTotal, </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to master Updates #4358. Updates #4342. ...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
timeAvg = uint32(u.timeSum / u.nTotal)
<mask> <mask> udb.NResult = append(udb.NResult, u.nResult...) <mask> <mask> if u.nTotal != 0 { <mask> udb.TimeAvg = uint32(u.timeSum / u.nTotal) <mask> } <mask> <mask> udb.Domains = convertMapToSlice(u.domains, maxDomains) <mask> udb.BlockedDomains = convertMapToSlice(u.blockedDomains, maxDomains) <...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
return &unitDB{ NTotal: u.nTotal, NResult: append([]uint64{}, u.nResult...), Domains: convertMapToSlice(u.domains, maxDomains), BlockedDomains: convertMapToSlice(u.blockedDomains, maxDomains), Clients: convertMapToSlice(u.clients, maxClients), TimeAvg: timeAvg, }
<mask> if u.nTotal != 0 { <mask> udb.TimeAvg = uint32(u.timeSum / u.nTotal) <mask> } <mask> <mask> udb.Domains = convertMapToSlice(u.domains, maxDomains) <mask> udb.BlockedDomains = convertMapToSlice(u.blockedDomains, maxDomains) <mask> udb.Clients = convertMapToSlice(u.clients, maxClients) <mask> <ma...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// deserealize assigns the appropriate values from udb to u. u must not be nil. // It's safe for concurrent use. func (u *unit) deserialize(udb *unitDB) { if udb == nil { return
<mask> <mask> return &udb <mask> } <mask> <mask> func deserialize(u *unit, udb *unitDB) { <mask> u.nTotal = udb.NTotal <mask> <mask> n := len(udb.NResult) <mask> if n < len(u.nResult) { <mask> n = len(u.nResult) // n = min(len(udb.NResult), len(u.nResult)) <mask> } <mask> for i := 1; i < n; i++ {...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
u.mu.Lock() defer u.mu.Unlock() u.nTotal = udb.NTotal u.nResult = make([]uint64, resultLast) copy(u.nResult, udb.NResult)
<mask> } <mask> <mask> u.domains = convertSliceToMap(udb.Domains) <mask> u.blockedDomains = convertSliceToMap(udb.BlockedDomains) <mask> u.clients = convertSliceToMap(udb.Clients) <mask> u.timeSum = uint64(udb.TimeAvg) * udb.NTotal <mask> } <mask> </s> Pull request: 4358 fix stats Merge in DNS/adguard-...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
u.timeSum = uint64(udb.TimeAvg) * udb.NTotal
<mask> <mask> u.domains = convertSliceToMap(udb.Domains) <mask> u.blockedDomains = convertSliceToMap(udb.BlockedDomains) <mask> u.clients = convertSliceToMap(udb.Clients) <mask> u.timeSum = uint64(udb.TimeAvg) * u.nTotal <mask> } <mask> <mask> func (s *statsCtx) flushUnitToDB(tx *bolt.Tx, id uint32, udb *...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func flushUnitToDB(tx *bbolt.Tx, id uint32, udb *unitDB) bool {
<mask> u.clients = convertSliceToMap(udb.Clients) <mask> u.timeSum = uint64(udb.TimeAvg) * u.nTotal <mask> } <mask> <mask> func (s *statsCtx) flushUnitToDB(tx *bolt.Tx, id uint32, udb *unitDB) bool { <mask> log.Tracef("Flushing unit %d", id) <mask> <mask> bkt, err := tx.CreateBucketIfNotExists(idToUnitNam...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) loadUnitFromDB(tx *bbolt.Tx, id uint32) *unitDB {
<mask> <mask> return true <mask> } <mask> <mask> func (s *statsCtx) loadUnitFromDB(tx *bolt.Tx, id uint32) *unitDB { <mask> bkt := tx.Bucket(idToUnitName(id)) <mask> if bkt == nil { <mask> return nil <mask> } <mask> </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func convertTopSlice(a []countPair) (m []map[string]uint64) { m = make([]map[string]uint64, 0, len(a))
<mask> <mask> return &udb <mask> } <mask> <mask> func convertTopSlice(a []countPair) []map[string]uint64 { <mask> m := []map[string]uint64{} <mask> for _, it := range a { <mask> ent := map[string]uint64{} <mask> ent[it.Name] = it.Count <mask> m = append(m, ent) <mask> } </s> Pull request: 4358 f...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
m = append(m, map[string]uint64{it.Name: it.Count})
<mask> <mask> func convertTopSlice(a []countPair) []map[string]uint64 { <mask> m := []map[string]uint64{} <mask> for _, it := range a { <mask> ent := map[string]uint64{} <mask> ent[it.Name] = it.Count <mask> m = append(m, ent) <mask> } <mask> return m <mask> } <mask> <mask> func (s *statsCtx) se...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) setLimit(limitDays int) { atomic.StoreUint32(&s.limitHours, uint32(24*limitDays))
<mask> } <mask> return m <mask> } <mask> <mask> func (s *statsCtx) setLimit(limitDays int) { <mask> s.conf.limit = uint32(limitDays) * 24 <mask> if limitDays == 0 { <mask> s.clear() <mask> } <mask> <mask> log.Debug("stats: set limit: %d", limitDays) </s> Pull request: 4358 fix stats Merge in DNS/...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
log.Debug("stats: set limit: %d days", limitDays)
<mask> if limitDays == 0 { <mask> s.clear() <mask> } <mask> <mask> log.Debug("stats: set limit: %d", limitDays) <mask> } <mask> <mask> func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { <mask> dc.Interval = s.conf.limit / 24 <mask> } </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) WriteDiskConfig(dc *DiskConfig) { dc.Interval = atomic.LoadUint32(&s.limitHours) / 24
<mask> <mask> log.Debug("stats: set limit: %d", limitDays) <mask> } <mask> <mask> func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { <mask> dc.Interval = s.conf.limit / 24 <mask> } <mask> <mask> func (s *statsCtx) Close() { <mask> u := s.swapUnit(nil) <mask> udb := serialize(u) </s> Pull request: 4...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) Close() { u := s.swapCurrent(nil) db := s.database() if tx := beginTxn(db, true); tx != nil { udb := u.serialize() if flushUnitToDB(tx, u.id, udb) {
<mask> func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) { <mask> dc.Interval = s.conf.limit / 24 <mask> } <mask> <mask> func (s *statsCtx) Close() { <mask> u := s.swapUnit(nil) <mask> udb := serialize(u) <mask> tx := s.beginTxn(true) <mask> if tx != nil { <mask> if s.flushUnitToDB(tx, u.id, udb) { ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
if db != nil {
<mask> _ = tx.Rollback() <mask> } <mask> } <mask> <mask> if s.db != nil { <mask> log.Tracef("db.Close...") <mask> _ = s.db.Close() <mask> log.Tracef("db.Close") <mask> } <mask> </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to master Updates #4358. Updates #...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
_ = db.Close()
<mask> } <mask> <mask> if s.db != nil { <mask> log.Tracef("db.Close...") <mask> _ = s.db.Close() <mask> log.Tracef("db.Close") <mask> } <mask> <mask> log.Debug("stats: closed") <mask> } </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to master Updates #4358. Upda...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) clear() { db := s.database() tx := beginTxn(db, true)
<mask> log.Debug("stats: closed") <mask> } <mask> <mask> // Reset counters and clear database <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() <mask> // the active transactions can continue using d...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
_ = s.swapDatabase(nil)
<mask> // Reset counters and clear database <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() <mask> // the active transactions can continue using database, <mask> // but no new transactions will be ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
u := newUnit(s.unitIDGen()) _ = s.swapCurrent(u)
<mask> log.Tracef("db.Close") <mask> // all active transactions are now closed <mask> } <mask> <mask> u := unit{} <mask> s.initUnit(&u, s.conf.UnitID()) <mask> _ = s.swapUnit(&u) <mask> <mask> err := os.Remove(s.conf.Filename) <mask> if err != nil { <mask> log.Error("os.Remove: %s", err) <mask...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
err := os.Remove(s.filename)
<mask> u := unit{} <mask> s.initUnit(&u, s.conf.UnitID()) <mask> _ = s.swapUnit(&u) <mask> <mask> err := os.Remove(s.conf.Filename) <mask> if err != nil { <mask> log.Error("os.Remove: %s", err) <mask> } <mask> <mask> _ = s.dbOpen() </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) Update(e Entry) { if !s.isEnabled() {
<mask> <mask> log.Debug("stats: cleared") <mask> } <mask> <mask> func (s *statsCtx) Update(e Entry) { <mask> if s.conf.limit == 0 { <mask> return <mask> } <mask> <mask> if e.Result == 0 || <mask> e.Result >= rLast || </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
e.Result >= resultLast ||
<mask> return <mask> } <mask> <mask> if e.Result == 0 || <mask> e.Result >= rLast || <mask> e.Domain == "" || <mask> e.Client == "" { <mask> return <mask> } <mask> </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to master Updates #4358. Updates #4342. Squashe...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
u := s.ongoing() if u == nil { return }
<mask> if ip := net.ParseIP(clientID); ip != nil { <mask> clientID = ip.String() <mask> } <mask> <mask> s.mu.Lock() <mask> defer s.mu.Unlock() <mask> <mask> u := s.current <mask> <mask> u.nResult[e.Result]++ <mask> </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
u.mu.Lock() defer u.mu.Unlock()
<mask> <mask> s.mu.Lock() <mask> defer s.mu.Unlock() <mask> <mask> u := s.current <mask> <mask> u.nResult[e.Result]++ <mask> <mask> if e.Result == RNotFiltered { <mask> u.domains[e.Domain]++ </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to master Updates #4358. ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) loadUnits(limit uint32) ([]*unitDB, uint32) { tx := beginTxn(s.database(), false)
<mask> u.timeSum += uint64(e.Time) <mask> u.nTotal++ <mask> } <mask> <mask> func (s *statsCtx) loadUnits(limit uint32) ([]*unitDB, uint32) { <mask> tx := s.beginTxn(false) <mask> if tx == nil { <mask> return nil, 0 <mask> } <mask> <mask> cur := s.ongoing() </s> Pull request: 4358 fix stats Merge ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
var curID uint32 if cur != nil { curID = atomic.LoadUint32(&cur.id) } else { curID = s.unitIDGen() }
<mask> return nil, 0 <mask> } <mask> <mask> cur := s.ongoing() <mask> curID := cur.id <mask> <mask> // Per-hour units. <mask> units := []*unitDB{} <mask> firstID := curID - limit + 1 <mask> for i := firstID; i != curID; i++ { </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-f...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
u.NResult = make([]uint64, resultLast)
<mask> for i := firstID; i != curID; i++ { <mask> u := s.loadUnitFromDB(tx, i) <mask> if u == nil { <mask> u = &unitDB{} <mask> u.NResult = make([]uint64, rLast) <mask> } <mask> units = append(units, u) <mask> } <mask> <mask> _ = tx.Rollback() </s> Pull request: 4358 fix stats Merge in DNS...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
if cur != nil { units = append(units, cur.serialize()) }
<mask> } <mask> <mask> _ = tx.Rollback() <mask> <mask> units = append(units, serialize(cur)) <mask> <mask> if len(units) != int(limit) { <mask> log.Fatalf("len(units) != limit: %d %d", len(units), limit) <mask> } <mask> </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-sta...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
// topsCollector collects statistics about highest values from the given *unitDB
<mask> <mask> // pairsGetter is a signature for topsCollector argument. <mask> type pairsGetter func(u *unitDB) (pairs []countPair) <mask> <mask> // topsCollector collects statistics about highest values fro the given *unitDB <mask> // slice using pg to retrieve data. <mask> func topsCollector(units []*unitDB,...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
for _, cp := range pg(u) { m[cp.Name] += cp.Count
<mask> // slice using pg to retrieve data. <mask> func topsCollector(units []*unitDB, max int, pg pairsGetter) []map[string]uint64 { <mask> m := map[string]uint64{} <mask> for _, u := range units { <mask> for _, it := range pg(u) { <mask> m[it.Name] += it.Count <mask> } <mask> } <mask> a2 := convert...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) getData() (statsResponse, bool) { limit := atomic.LoadUint32(&s.limitHours) if limit == 0 { return statsResponse{ TimeUnits: "days", TopBlocked: []topAddrs{}, TopClients: []topAddrs{}, TopQueried: []topAddrs{}, BlockedFiltering: []uint64{}, DNSQueries: []uint64{}...
<mask> * safesearch-blocked <mask> * parental-blocked <mask> These values are just the sum of data for all units. <mask> */ <mask> func (s *statsCtx) getData() (statsResponse, bool) { <mask> limit := s.conf.limit <mask> <mask> timeUnit := Hours <mask> if limit/24 > 7 { <mask> timeUnit = Days <mas...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
NResult: make([]uint64, resultLast),
<mask> } <mask> <mask> // Total counters: <mask> sum := unitDB{ <mask> NResult: make([]uint64, rLast), <mask> } <mask> timeN := 0 <mask> for _, u := range units { <mask> sum.NTotal += u.NTotal <mask> sum.TimeAvg += u.TimeAvg </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
func (s *StatsCtx) GetTopClientsIP(maxCount uint) []net.IP { if !s.isEnabled() {
<mask> <mask> return data, true <mask> } <mask> <mask> func (s *statsCtx) GetTopClientsIP(maxCount uint) []net.IP { <mask> if s.conf.limit == 0 { <mask> return nil <mask> } <mask> <mask> units, _ := s.loadUnits(s.conf.limit) <mask> if units == nil { </s> Pull request: 4358 fix stats Merge in DNS/...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
units, _ := s.loadUnits(atomic.LoadUint32(&s.limitHours))
<mask> if s.conf.limit == 0 { <mask> return nil <mask> } <mask> <mask> units, _ := s.loadUnits(s.conf.limit) <mask> if units == nil { <mask> return nil <mask> } <mask> <mask> // top clients </s> Pull request: 4358 fix stats Merge in DNS/adguard-home from 4358-fix-stats to master Updates #4358. ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc
internal/stats/unit.go
"install_devices_android_list_5": "Change DNS 1 and DNS 2 values to your AdGuard Home server addresses.",
<mask> "install_devices_android_list_1": "From the Android Menu home screen, tap Settings.", <mask> "install_devices_android_list_2": "Tap Wi-Fi on the menu. The screen listing all of the available networks will be shown (it is impossible to set custom DNS for mobile connection).", <mask> "install_device...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/42ec9cae76bd747391d670c6a046ec4800ca60f5
client/src/__locales/en.json
"client_identifier_desc": "Clients can be identified by the IP address, CIDR, MAC address, or a special client ID (can be used for DoT/DoH/DoQ). <0>Here</0> you can learn more about how to identify clients.",
<mask> "client_new": "New Client", <mask> "client_edit": "Edit Client", <mask> "client_identifier": "Identifier", <mask> "ip_address": "IP address", <mask> "client_identifier_desc": "Clients can be identified by the IP address, CIDR, MAC address or a special client ID (can be used for DoT/DoH/D...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/42ec9cae76bd747391d670c6a046ec4800ca60f5
client/src/__locales/en.json
"access_blocked_desc": "Don't confuse this with filters. AdGuard Home will drop DNS queries with these domains in queries' questions. Here you can specify the exact domain names, wildcards, and URL filter rules, e.g. \"example.org\", \"*.example.org\", or \"||example.org^\".",
<mask> "access_allowed_desc": "A list of CIDR or IP addresses. If configured, AdGuard Home will accept requests from these IP addresses only.", <mask> "access_disallowed_title": "Disallowed clients", <mask> "access_disallowed_desc": "A list of CIDR or IP addresses. If configured, AdGuard Home will drop r...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/42ec9cae76bd747391d670c6a046ec4800ca60f5
client/src/__locales/en.json
"filter_category_security_desc": "Lists that specialize on blocking malware, phishing, or scam domains",
<mask> "filter_category_security": "Security", <mask> "filter_category_regional": "Regional", <mask> "filter_category_other": "Other", <mask> "filter_category_general_desc": "Lists that block tracking and advertising on most of the devices", <mask> "filter_category_security_desc": "Lists that s...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/42ec9cae76bd747391d670c6a046ec4800ca60f5
client/src/__locales/en.json
CacheSize uint32 `json:"cache_size"` CacheMinTTL uint32 `json:"cache_ttl_min"` CacheMaxTTL uint32 `json:"cache_ttl_max"`
<mask> DisableIPv6 bool `json:"disable_ipv6"` <mask> UpstreamMode string `json:"upstream_mode"` <mask> } <mask> <mask> func (s *Server) handleGetConfig(w http.ResponseWriter, r *http.Request) { <mask> resp := dnsConfigJSON{} </s> + dns: new settings for cache Squashed commit of the following: ...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4303b3dd2f6c4e1f64e8cd8575070de35b3d6df7
dnsforward/dnsforward_http.go
resp.CacheSize = s.conf.CacheSize resp.CacheMinTTL = s.conf.CacheMinTTL resp.CacheMaxTTL = s.conf.CacheMaxTTL
<mask> resp.DNSSECEnabled = s.conf.EnableDNSSEC <mask> resp.DisableIPv6 = s.conf.AAAADisabled <mask> if s.conf.FastestAddr { <mask> resp.UpstreamMode = "fastest_addr" <mask> } else if s.conf.AllServers { <mask> resp.UpstreamMode = "parallel" <mask> } </s> + dns: new settings for cache Squashed commit ...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4303b3dd2f6c4e1f64e8cd8575070de35b3d6df7
dnsforward/dnsforward_http.go
if req.CacheMinTTL > req.CacheMaxTTL { httpError(r, w, http.StatusBadRequest, "cache_ttl_min must be less or equal than cache_ttl_max") return }
<mask> return <mask> } <mask> <mask> restart := false <mask> s.Lock() <mask> <mask> if js.Exists("upstream_dns") { <mask> s.conf.UpstreamDNS = req.Upstreams <mask> restart = true </s> + dns: new settings for cache Squashed commit of the following: commit e5b488249a4d972efd63c6e96830d9f30829aee1 ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4303b3dd2f6c4e1f64e8cd8575070de35b3d6df7
dnsforward/dnsforward_http.go
if js.Exists("cache_size") { s.conf.CacheSize = req.CacheSize restart = true } if js.Exists("cache_ttl_min") { s.conf.CacheMinTTL = req.CacheMinTTL restart = true } if js.Exists("cache_ttl_max") { s.conf.CacheMaxTTL = req.CacheMaxTTL restart = true }
<mask> s.conf.AAAADisabled = req.DisableIPv6 <mask> } <mask> <mask> if js.Exists("upstream_mode") { <mask> s.conf.FastestAddr = false <mask> s.conf.AllServers = false <mask> switch req.UpstreamMode { <mask> case "": <mask> // </s> + dns: new settings for cache Squashed commit of the following...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4303b3dd2f6c4e1f64e8cd8575070de35b3d6df7
dnsforward/dnsforward_http.go
cache_size: type: integer cache_ttl_min: type: integer cache_ttl_max: type: integer
<mask> edns_cs_enabled: <mask> type: boolean <mask> dnssec_enabled: <mask> type: boolean <mask> upstream_mode: <mask> enum: <mask> - "" <mask> - parallel <...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4303b3dd2f6c4e1f64e8cd8575070de35b3d6df7
openapi/openapi.yaml
"tiny-version-compare": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/tiny-version-compare/-/tiny-version-compare-0.9.1.tgz", "integrity": "sha512-kYim94l7ptSmj9rqxUMkrcMCJ448CS+hwqjA7OFcRi0ISdi0zjgdSUklQ4velVVECCjCo5frU3tNZ3oSgIKzsA==" },
<mask> } <mask> }, <mask> "tmp": { <mask> "version": "0.0.33", <mask> "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", <mask> "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", <mask> "dev": true, <m...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/package-lock.json
"tiny-version-compare": "^0.9.1",
<mask> "svg-url-loader": "^2.3.2", <mask> "tabler-react": "^1.10.0", <mask> "whatwg-fetch": "2.0.3" <mask> }, <mask> "devDependencies": { <mask> "autoprefixer": "^8.6.3", <mask> "babel-core": "6.26.0", <mask> "babel-eslint": "^8.2.3", </s> Add update check Closes #338
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/package.json
export const getVersionRequest = createAction('GET_VERSION_REQUEST'); export const getVersionFailure = createAction('GET_VERSION_FAILURE'); export const getVersionSuccess = createAction('GET_VERSION_SUCCESS'); export const getVersion = () => async (dispatch) => { dispatch(getVersionRequest()); try { co...
<mask> dispatch(getStatsFailure()); <mask> } <mask> }; <mask> <mask> export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST'); <mask> export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE'); <mask> export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS')...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/actions/index.js
GLOBAL_VERSION = { path: 'version.json', method: 'GET' };
<mask> GLOBAL_QUERY_LOG = { path: 'querylog', method: 'GET' }; <mask> GLOBAL_QUERY_LOG_ENABLE = { path: 'querylog_enable', method: 'POST' }; <mask> GLOBAL_QUERY_LOG_DISABLE = { path: 'querylog_disable', method: 'POST' }; <mask> GLOBAL_SET_UPSTREAM_DNS = { path: 'set_upstream_dns', method: 'POST' }; ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/api/Api.js
getGlobalVersion() { const { path, method } = this.GLOBAL_VERSION; return this.makeRequest(path, method); }
<mask> return this.makeRequest(path, method, config); <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/disab...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/api/Api.js
import Update from '../ui/Update';
<mask> import Toasts from '../Toasts'; <mask> import Status from '../ui/Status'; <mask> <mask> class App extends Component { <mask> componentDidMount() { <mask> this.props.getDnsStatus(); <mask> this.props.getVersion(); </s> Add update check Closes #338
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/App/index.js
this.props.getVersion();
<mask> <mask> class App extends Component { <mask> componentDidMount() { <mask> this.props.getDnsStatus(); <mask> } <mask> <mask> handleStatusChange = () => { <mask> this.props.enableDns(); <mask> }; </s> Add update check Closes #338
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/App/index.js
const updateAvailable = !dashboard.processingVersions && dashboard.isCoreRunning && dashboard.isUpdateAvailable;
<mask> }; <mask> <mask> render() { <mask> const { dashboard } = this.props; <mask> return ( <mask> <HashRouter hashType='noslash'> <mask> <Fragment> <mask> {updateAvailable && <mask> <Update </s> Add update check ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/App/index.js
{updateAvailable && <Update announcement={dashboard.announcement} announcementUrl={dashboard.announcementUrl} /> }
<mask> <HashRouter hashType='noslash'> <mask> <Fragment> <mask> <LoadingBar className="loading-bar" updateTime={1000} /> <mask> <Route component={Header} /> <mask> <div className="container container--wrap"> <mask> ...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/App/index.js
getVersion: PropTypes.func,
<mask> isCoreRunning: PropTypes.bool, <mask> error: PropTypes.string, <mask> }; <mask> <mask> export default App; </s> Add update check Closes #338 </s> remove version {dnsVersion} / address: {dnsAddress}:{dnsPort} </s> add <div className="nav-version__text"> ver...
[ "keep", "add", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/App/index.js
padding: 7px 0; font-size: 0.80rem;
<mask> overflow: hidden; <mask> } <mask> <mask> .nav-version { <mask> padding: 16px 0; <mask> font-size: 0.85rem; <mask> text-align: right; <mask> } <mask> <mask> .header-brand-img { <mask> height: 26px; </s> Add update check Closes #338 </s> remove font-size: 0.9rem; </s> ad...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/Header/Header.css
.nav-version__value { font-weight: 600; }
<mask> font-size: 0.80rem; <mask> text-align: right; <mask> } <mask> <mask> .header-brand-img { <mask> height: 26px; <mask> } <mask> <mask> @media screen and (min-width: 992px) { </s> Add update check Closes #338 </s> remove padding: 16px 0; font-size: 0.85rem; </s> add padding: 7p...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/Header/Header.css
font-size: 0.85rem;
<mask> } <mask> <mask> .nav-version { <mask> padding: 0; <mask> font-size: 0.9rem; <mask> } <mask> } <mask> <mask> .dns-status { <mask> padding: 0.35em 0.5em; </s> Add update check Closes #338 </s> remove padding: 16px 0; font-size: 0.85rem; </s> add padding: 7...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/Header/Header.css
<div className="nav-version__text"> version: <span className="nav-version__value">{dnsVersion}</span> </div> <div className="nav-version__text"> address: <span className="nav-version__value">{dnsAddress}:{dnsPort}</span> </div>
<mask> export default function Version(props) { <mask> const { dnsVersion, dnsAddress, dnsPort } = props; <mask> return ( <mask> <div className="nav-version"> <mask> version {dnsVersion} / address: {dnsAddress}:{dnsPort} <mask> </div> <mask> ); <mask> } <mask> <mask> V...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/components/Header/Version.js
import versionCompare from 'tiny-version-compare';
<mask> import { combineReducers } from 'redux'; <mask> import { handleActions } from 'redux-actions'; <mask> import { loadingBarReducer } from 'react-redux-loading-bar'; <mask> import nanoid from 'nanoid'; <mask> <mask> import * as actions from '../actions'; <mask> <mask> const settings = handleActions({ <ma...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/reducers/index.js
processingVersion: true,
<mask> processingTopStats: true, <mask> processingStats: true, <mask> logStatusProcessing: false, <mask> }); <mask> <mask> const queryLogs = handleActions({ <mask> [actions.getLogsRequest]: state => ({ ...state, getLogsProcessing: true }), <mask> [actions.getLogsFailure]: state => ({ ...sta...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/43fcf4117db0e1e26085a0cc20a574edc8bd6255
client/src/reducers/index.js
"dnscrypt": "DNSCrypt",
<mask> "custom_ip": "Custom IP", <mask> "blocking_ipv4": "Blocking IPv4", <mask> "blocking_ipv6": "Blocking IPv6", <mask> "dns_over_https": "DNS-over-HTTPS", <mask> "dns_over_tls": "DNS-over-TLS", <mask> "dns_over_quic": "DNS-over-QUIC", <mask> "client_id": "Client ID", <mask> "c...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/44168292d5f466b9e7cda271987f03363ab6d6a8
client/src/__locales/en.json
<mask> "port_53_faq_link": "Port 53 is often occupied by \"DNSStubListener\" or \"systemd-resolved\" services. Please read <0>this instruction</0> on how to resolve this.", <mask> "adg_will_drop_dns_queries": "AdGuard Home will be dropping all DNS queries from this client.", <mask> "client_not_in_allowed...
[ "keep", "keep", "keep", "keep", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/44168292d5f466b9e7cda271987f03363ab6d6a8
client/src/__locales/en.json
}
<mask> "adg_will_drop_dns_queries": "AdGuard Home will be dropping all DNS queries from this client.", <mask> "client_not_in_allowed_clients": "The client is not allowed because it is not in the \"Allowed clients\" list.", <mask> "experimental": "Experimental" <mask> } </s> Pull request: 2662 dnscrypt ...
[ "keep", "keep", "keep", "add" ]
https://github.com/AdguardTeam/AdGuardHome/commit/44168292d5f466b9e7cda271987f03363ab6d6a8
client/src/__locales/en.json
dnscrypt: 'dnscrypt',
<mask> <mask> export const SCHEME_TO_PROTOCOL_MAP = { <mask> doh: 'dns_over_https', <mask> dot: 'dns_over_tls', <mask> doq: 'dns_over_quic', <mask> '': 'plain_dns', <mask> }; <mask> </s> Pull request: 2662 dnscrypt logs Merge in DNS/adguard-home from 2662-dnscrypt-logs to master Closes #266...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/44168292d5f466b9e7cda271987f03363ab6d6a8
client/src/helpers/constants.js
ClientProtoDNSCrypt,
<mask> ClientProtoDOH, <mask> ClientProtoDOQ, <mask> ClientProtoDOT, <mask> ClientProtoPlain: <mask> <mask> return cp, nil <mask> default: <mask> return "", fmt.Errorf("invalid client proto: %q", s) </s> Pull request: 2662 dnscrypt logs Merge in DNS/adguard-home from 2662-dnscrypt-logs to master...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/44168292d5f466b9e7cda271987f03363ab6d6a8
internal/querylog/qlog.go
s.conf.HTTPRegister(http.MethodGet, "/control/dns_info", s.handleGetConfig) s.conf.HTTPRegister(http.MethodPost, "/control/dns_config", s.handleSetConfig) s.conf.HTTPRegister(http.MethodPost, "/control/test_upstream_dns", s.handleTestUpstreamDNS)
<mask> s.ServeHTTP(w, r) <mask> } <mask> <mask> func (s *Server) registerHandlers() { <mask> s.conf.HTTPRegister("GET", "/control/dns_info", s.handleGetConfig) <mask> s.conf.HTTPRegister("POST", "/control/dns_config", s.handleSetConfig) <mask> s.conf.HTTPRegister("POST", "/control/test_upstream_dns", s.hand...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4474e9fcf9073af593df76b4844f4091c1c7946e
internal/dnsforward/http.go
s.conf.HTTPRegister(http.MethodGet, "/control/access/list", s.handleAccessList) s.conf.HTTPRegister(http.MethodPost, "/control/access/set", s.handleAccessSet)
<mask> s.conf.HTTPRegister("GET", "/control/dns_info", s.handleGetConfig) <mask> s.conf.HTTPRegister("POST", "/control/dns_config", s.handleSetConfig) <mask> s.conf.HTTPRegister("POST", "/control/test_upstream_dns", s.handleTestUpstreamDNS) <mask> <mask> s.conf.HTTPRegister("GET", "/control/access/list", s.ha...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4474e9fcf9073af593df76b4844f4091c1c7946e
internal/dnsforward/http.go
Context.mux.Handle("/control/login", postInstallHandler(ensureHandler(http.MethodPost, handleLogin))) httpRegister(http.MethodGet, "/control/logout", handleLogout)
<mask> } <mask> <mask> // RegisterAuthHandlers - register handlers <mask> func RegisterAuthHandlers() { <mask> Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) <mask> httpRegister("GET", "/control/logout", handleLogout) <mask> } <mask> <mask> func parseCookie(coo...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4474e9fcf9073af593df76b4844f4091c1c7946e
internal/home/auth.go
r.Method = http.MethodGet
<mask> w := testResponseWriter{} <mask> w.hdr = make(http.Header) <mask> r := http.Request{} <mask> r.Header = make(http.Header) <mask> r.Method = "GET" <mask> <mask> // get / - we're redirected to login page <mask> r.URL = &url.URL{Path: "/"} <mask> handlerCalled = false <mask> handler2(&w, &r) </...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4474e9fcf9073af593df76b4844f4091c1c7946e
internal/home/auth_test.go
r, _ := http.NewRequest(http.MethodGet, "http://localhost/", nil)
<mask> } else { <mask> binary.BigEndian.PutUint32(data, tval) <mask> } <mask> assert.Nil(t, ioutil.WriteFile(glFilePrefix+"test", data, 0o644)) <mask> r, _ := http.NewRequest("GET", "http://localhost/", nil) <mask> r.AddCookie(&http.Cookie{Name: glCookieName, Value: "test"}) <mask> assert.True(t, glProce...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4474e9fcf9073af593df76b4844f4091c1c7946e
internal/home/authglinet_test.go
func handleStatus(w http.ResponseWriter, _ *http.Request) {
<mask> } <mask> *dnsAddresses = append(*dnsAddresses, addr) <mask> } <mask> <mask> func handleStatus(w http.ResponseWriter, r *http.Request) { <mask> c := dnsforward.FilteringConfig{} <mask> if Context.dnsServer != nil { <mask> Context.dnsServer.WriteDiskConfig(&c) <mask> } <mask> </s> Pull request:...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4474e9fcf9073af593df76b4844f4091c1c7946e
internal/home/control.go
if method == http.MethodPost || method == http.MethodPut || method == http.MethodDelete {
<mask> http.Error(w, "This request must be "+method, http.StatusMethodNotAllowed) <mask> return <mask> } <mask> <mask> if method == "POST" || method == "PUT" || method == "DELETE" { <mask> Context.controlLock.Lock() <mask> defer Context.controlLock.Unlock() <mask> } <mask> <mask> handler...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/4474e9fcf9073af593df76b4844f4091c1c7946e
internal/home/control.go