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 |
|---|---|---|---|---|
func() {
d.filtersMu.Lock()
defer d.filtersMu.Unlock() | <mask> filters = &d.WhitelistFilters
<mask> }
<mask>
<mask> var deleted FilterYAML
<mask> var newFilters []FilterYAML
<mask> for _, flt := range *filters {
<mask> if flt.URL != req.URL {
<mask> newFilters = append(newFilters, flt)
<mask>
<mask> continue
<mask> }
<mask>
<mask> deleted = flt
</s> Pull request 1790: 5624-fix-filter-add
Merge in DNS/adguard-home from 5624-fix-filter-add to master
Updates #5624.
Squashed commit of the following:
commit 211100409d2c711a5ccb5aeafbe16115388aaff7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 20:46:48 2023 +0500
filtering: imp names
commit b42ed3748e5d4310a9f8a6a37cee5bf56104917f
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 17:41:49 2023 +0500
filtering: imp logging, lock properly </s> remove d.filtersMu.Lock()
filters := &d.Filters
if req.Whitelist {
filters = &d.WhitelistFilters
}
</s> add </s> remove continue
</s> add filters := &d.Filters
if req.Whitelist {
filters = &d.WhitelistFilters </s> remove deleted = flt
path := flt.Path(d.DataDir)
err = os.Rename(path, path+".old")
</s> add delIdx := slices.IndexFunc(*filters, func(flt FilterYAML) bool {
return flt.URL == req.URL
})
if delIdx == -1 {
log.Error("deleting filter with url %q: %s", req.URL, errFilterNotExist)
return
}
deleted = (*filters)[delIdx]
p := deleted.Path(d.DataDir)
err = os.Rename(p, p+".old") </s> remove log.Error("deleting filter %q: %s", path, err)
</s> add log.Error("deleting filter %d: renaming file %q: %s", deleted.ID, p, err)
return </s> remove }
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/da9008aba345ee6792470ff3a3b7588482ee1e4d | internal/filtering/http.go |
filters := &d.Filters
if req.Whitelist {
filters = &d.WhitelistFilters | <mask> for _, flt := range *filters {
<mask> if flt.URL != req.URL {
<mask> newFilters = append(newFilters, flt)
<mask>
<mask> continue
<mask> }
<mask>
<mask> deleted = flt
<mask> path := flt.Path(d.DataDir)
<mask> err = os.Rename(path, path+".old")
</s> Pull request 1790: 5624-fix-filter-add
Merge in DNS/adguard-home from 5624-fix-filter-add to master
Updates #5624.
Squashed commit of the following:
commit 211100409d2c711a5ccb5aeafbe16115388aaff7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 20:46:48 2023 +0500
filtering: imp names
commit b42ed3748e5d4310a9f8a6a37cee5bf56104917f
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 17:41:49 2023 +0500
filtering: imp logging, lock properly </s> remove var newFilters []FilterYAML
for _, flt := range *filters {
if flt.URL != req.URL {
newFilters = append(newFilters, flt)
</s> add func() {
d.filtersMu.Lock()
defer d.filtersMu.Unlock() </s> remove d.filtersMu.Lock()
filters := &d.Filters
if req.Whitelist {
filters = &d.WhitelistFilters
}
</s> add </s> remove log.Error("deleting filter %q: %s", path, err)
</s> add log.Error("deleting filter %d: renaming file %q: %s", deleted.ID, p, err)
return </s> remove deleted = flt
path := flt.Path(d.DataDir)
err = os.Rename(path, path+".old")
</s> add delIdx := slices.IndexFunc(*filters, func(flt FilterYAML) bool {
return flt.URL == req.URL
})
if delIdx == -1 {
log.Error("deleting filter with url %q: %s", req.URL, errFilterNotExist)
return
}
deleted = (*filters)[delIdx]
p := deleted.Path(d.DataDir)
err = os.Rename(p, p+".old") </s> remove }
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/da9008aba345ee6792470ff3a3b7588482ee1e4d | internal/filtering/http.go |
delIdx := slices.IndexFunc(*filters, func(flt FilterYAML) bool {
return flt.URL == req.URL
})
if delIdx == -1 {
log.Error("deleting filter with url %q: %s", req.URL, errFilterNotExist)
return
}
deleted = (*filters)[delIdx]
p := deleted.Path(d.DataDir)
err = os.Rename(p, p+".old") | <mask>
<mask> continue
<mask> }
<mask>
<mask> deleted = flt
<mask> path := flt.Path(d.DataDir)
<mask> err = os.Rename(path, path+".old")
<mask> if err != nil {
<mask> log.Error("deleting filter %q: %s", path, err)
<mask> }
<mask> }
<mask>
</s> Pull request 1790: 5624-fix-filter-add
Merge in DNS/adguard-home from 5624-fix-filter-add to master
Updates #5624.
Squashed commit of the following:
commit 211100409d2c711a5ccb5aeafbe16115388aaff7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 20:46:48 2023 +0500
filtering: imp names
commit b42ed3748e5d4310a9f8a6a37cee5bf56104917f
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 17:41:49 2023 +0500
filtering: imp logging, lock properly </s> remove log.Error("deleting filter %q: %s", path, err)
</s> add log.Error("deleting filter %d: renaming file %q: %s", deleted.ID, p, err)
return </s> remove }
</s> add </s> remove continue
</s> add filters := &d.Filters
if req.Whitelist {
filters = &d.WhitelistFilters </s> remove _ = os.Remove(uf.Path(d.DataDir) + ".old")
</s> add p := uf.Path(d.DataDir)
err := os.Remove(p + ".old")
if err != nil {
log.Debug("filtering: removing old filter file %q: %s", p, err)
} </s> remove var newFilters []FilterYAML
for _, flt := range *filters {
if flt.URL != req.URL {
newFilters = append(newFilters, flt)
</s> add func() {
d.filtersMu.Lock()
defer d.filtersMu.Unlock() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/da9008aba345ee6792470ff3a3b7588482ee1e4d | internal/filtering/http.go |
log.Error("deleting filter %d: renaming file %q: %s", deleted.ID, p, err)
return | <mask> deleted = flt
<mask> path := flt.Path(d.DataDir)
<mask> err = os.Rename(path, path+".old")
<mask> if err != nil {
<mask> log.Error("deleting filter %q: %s", path, err)
<mask> }
<mask> }
<mask>
<mask> *filters = newFilters
<mask> d.filtersMu.Unlock()
</s> Pull request 1790: 5624-fix-filter-add
Merge in DNS/adguard-home from 5624-fix-filter-add to master
Updates #5624.
Squashed commit of the following:
commit 211100409d2c711a5ccb5aeafbe16115388aaff7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 20:46:48 2023 +0500
filtering: imp names
commit b42ed3748e5d4310a9f8a6a37cee5bf56104917f
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 17:41:49 2023 +0500
filtering: imp logging, lock properly </s> remove }
</s> add </s> remove deleted = flt
path := flt.Path(d.DataDir)
err = os.Rename(path, path+".old")
</s> add delIdx := slices.IndexFunc(*filters, func(flt FilterYAML) bool {
return flt.URL == req.URL
})
if delIdx == -1 {
log.Error("deleting filter with url %q: %s", req.URL, errFilterNotExist)
return
}
deleted = (*filters)[delIdx]
p := deleted.Path(d.DataDir)
err = os.Rename(p, p+".old") </s> remove continue
</s> add filters := &d.Filters
if req.Whitelist {
filters = &d.WhitelistFilters </s> remove *filters = newFilters
d.filtersMu.Unlock()
</s> add *filters = slices.Delete(*filters, delIdx, delIdx+1)
log.Info("deleted filter %d", deleted.ID)
}() </s> remove var newFilters []FilterYAML
for _, flt := range *filters {
if flt.URL != req.URL {
newFilters = append(newFilters, flt)
</s> add func() {
d.filtersMu.Lock()
defer d.filtersMu.Unlock() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/da9008aba345ee6792470ff3a3b7588482ee1e4d | internal/filtering/http.go |
<mask> err = os.Rename(path, path+".old")
<mask> if err != nil {
<mask> log.Error("deleting filter %q: %s", path, err)
<mask> }
<mask> }
<mask>
<mask> *filters = newFilters
<mask> d.filtersMu.Unlock()
<mask>
<mask> d.ConfigModified()
</s> Pull request 1790: 5624-fix-filter-add
Merge in DNS/adguard-home from 5624-fix-filter-add to master
Updates #5624.
Squashed commit of the following:
commit 211100409d2c711a5ccb5aeafbe16115388aaff7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 20:46:48 2023 +0500
filtering: imp names
commit b42ed3748e5d4310a9f8a6a37cee5bf56104917f
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 17:41:49 2023 +0500
filtering: imp logging, lock properly </s> remove log.Error("deleting filter %q: %s", path, err)
</s> add log.Error("deleting filter %d: renaming file %q: %s", deleted.ID, p, err)
return </s> remove deleted = flt
path := flt.Path(d.DataDir)
err = os.Rename(path, path+".old")
</s> add delIdx := slices.IndexFunc(*filters, func(flt FilterYAML) bool {
return flt.URL == req.URL
})
if delIdx == -1 {
log.Error("deleting filter with url %q: %s", req.URL, errFilterNotExist)
return
}
deleted = (*filters)[delIdx]
p := deleted.Path(d.DataDir)
err = os.Rename(p, p+".old") </s> remove *filters = newFilters
d.filtersMu.Unlock()
</s> add *filters = slices.Delete(*filters, delIdx, delIdx+1)
log.Info("deleted filter %d", deleted.ID)
}() </s> remove continue
</s> add filters := &d.Filters
if req.Whitelist {
filters = &d.WhitelistFilters </s> remove _ = os.Remove(uf.Path(d.DataDir) + ".old")
</s> add p := uf.Path(d.DataDir)
err := os.Remove(p + ".old")
if err != nil {
log.Debug("filtering: removing old filter file %q: %s", p, err)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/da9008aba345ee6792470ff3a3b7588482ee1e4d | internal/filtering/http.go | |
*filters = slices.Delete(*filters, delIdx, delIdx+1)
log.Info("deleted filter %d", deleted.ID)
}() | <mask> log.Error("deleting filter %q: %s", path, err)
<mask> }
<mask> }
<mask>
<mask> *filters = newFilters
<mask> d.filtersMu.Unlock()
<mask>
<mask> d.ConfigModified()
<mask> d.EnableFilters(true)
<mask>
<mask> // NOTE: The old files "filter.txt.old" aren't deleted. It's not really
</s> Pull request 1790: 5624-fix-filter-add
Merge in DNS/adguard-home from 5624-fix-filter-add to master
Updates #5624.
Squashed commit of the following:
commit 211100409d2c711a5ccb5aeafbe16115388aaff7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 20:46:48 2023 +0500
filtering: imp names
commit b42ed3748e5d4310a9f8a6a37cee5bf56104917f
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 17:41:49 2023 +0500
filtering: imp logging, lock properly </s> remove }
</s> add </s> remove log.Error("deleting filter %q: %s", path, err)
</s> add log.Error("deleting filter %d: renaming file %q: %s", deleted.ID, p, err)
return </s> remove deleted = flt
path := flt.Path(d.DataDir)
err = os.Rename(path, path+".old")
</s> add delIdx := slices.IndexFunc(*filters, func(flt FilterYAML) bool {
return flt.URL == req.URL
})
if delIdx == -1 {
log.Error("deleting filter with url %q: %s", req.URL, errFilterNotExist)
return
}
deleted = (*filters)[delIdx]
p := deleted.Path(d.DataDir)
err = os.Rename(p, p+".old") </s> remove _ = os.Remove(uf.Path(d.DataDir) + ".old")
</s> add p := uf.Path(d.DataDir)
err := os.Remove(p + ".old")
if err != nil {
log.Debug("filtering: removing old filter file %q: %s", p, err)
} </s> remove var newFilters []FilterYAML
for _, flt := range *filters {
if flt.URL != req.URL {
newFilters = append(newFilters, flt)
</s> add func() {
d.filtersMu.Lock()
defer d.filtersMu.Unlock() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/da9008aba345ee6792470ff3a3b7588482ee1e4d | internal/filtering/http.go |
<mask> func (d *DNSFilter) handleFilteringRefresh(w http.ResponseWriter, r *http.Request) {
<mask> type Req struct {
<mask> White bool `json:"whitelist"`
<mask> }
<mask> type Resp struct {
<mask> Updated int `json:"updated"`
<mask> }
<mask> resp := Resp{}
<mask> var err error
<mask>
<mask> req := Req{}
<mask> err = json.NewDecoder(r.Body).Decode(&req)
<mask> if err != nil {
</s> Pull request 1790: 5624-fix-filter-add
Merge in DNS/adguard-home from 5624-fix-filter-add to master
Updates #5624.
Squashed commit of the following:
commit 211100409d2c711a5ccb5aeafbe16115388aaff7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 20:46:48 2023 +0500
filtering: imp names
commit b42ed3748e5d4310a9f8a6a37cee5bf56104917f
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 17:41:49 2023 +0500
filtering: imp logging, lock properly </s> remove var rc io.ReadCloser
</s> add var r io.Reader </s> remove return fmt.Errorf("checking filter file: %w", err)
</s> add // Don't wrap the error since it's informative enough as is.
return err </s> remove e := os.Chtimes(filter.Path(d.DataDir), filter.LastUpdated, filter.LastUpdated)
if e != nil {
log.Error("os.Chtimes(): %v", e)
</s> add chErr := os.Chtimes(
filter.Path(d.DataDir),
filter.LastUpdated,
filter.LastUpdated,
)
if chErr != nil {
log.Error("os.Chtimes(): %v", chErr) </s> remove rc, err = os.Open(flt.URL)
</s> add var f *os.File
f, err = os.Open(flt.URL) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/da9008aba345ee6792470ff3a3b7588482ee1e4d | internal/filtering/http.go | |
resp := struct {
Updated int `json:"updated"`
}{} | <mask>
<mask> var ok bool
<mask> resp.Updated, _, ok = d.tryRefreshFilters(!req.White, req.White, true)
<mask> if !ok {
<mask> aghhttp.Error(
<mask> r,
<mask> w,
<mask> http.StatusInternalServerError,
</s> Pull request 1790: 5624-fix-filter-add
Merge in DNS/adguard-home from 5624-fix-filter-add to master
Updates #5624.
Squashed commit of the following:
commit 211100409d2c711a5ccb5aeafbe16115388aaff7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 20:46:48 2023 +0500
filtering: imp names
commit b42ed3748e5d4310a9f8a6a37cee5bf56104917f
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Wed Mar 29 17:41:49 2023 +0500
filtering: imp logging, lock properly </s> remove "Filter at the url %s is invalid (maybe it points to blank page?)",
</s> add "Filter with URL %q is invalid (maybe it points to blank page?)", </s> remove err = errors.WithDeferred(err, d.finalizeUpdate(tmpFile, flt, ok, name, rnum, cs))
if ok && err == nil {
</s> add finErr := d.finalizeUpdate(tmpFile, flt, ok, name, rnum, cs)
if ok && finErr == nil { </s> remove d.filtersMu.Lock()
filters := &d.Filters
if req.Whitelist {
filters = &d.WhitelistFilters
}
</s> add </s> remove var newFilters []FilterYAML
for _, flt := range *filters {
if flt.URL != req.URL {
newFilters = append(newFilters, flt)
</s> add func() {
d.filtersMu.Lock()
defer d.filtersMu.Unlock() | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/da9008aba345ee6792470ff3a3b7588482ee1e4d | internal/filtering/http.go |
// nolint(gocyclo) | <mask> return ""
<mask> }
<mask>
<mask> func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) {
<mask> return func(w http.ResponseWriter, r *http.Request) {
<mask>
<mask> if r.URL.Path == "/login.html" {
<mask> // redirect to dashboard if already authenticated
<mask> authRequired := Context.auth != nil && Context.auth.AuthRequired()
</s> + "--glinet" command-line argument: Run in GL-Inet compatibility mode
Close #1853
Squashed commit of the following:
commit 3730cafabe8fa1dbf2bf75915079d2effe4ff9a3
Merge: 533ae3c2 6b134469
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:21:08 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 533ae3c2678cd6cfd26bf9560bee4eb5a015a615
Merge: 3521992b 21dfb5ff
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:14:45 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 3521992b4609fa3400942c89f7a7546dade459bc
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 18:04:53 2020 +0300
logs
commit 3e0258782b1a14c08156fe65940ae7b661a42b54
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 17:11:47 2020 +0300
fix
commit bb814db9df1c770d0ea02eafd12bedd122bef894
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:58:37 2020 +0300
minor
commit b161bbc5749ce76b16600e0153120935ad20077e
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:53:22 2020 +0300
move code
commit c506e81265bdee140c0f61255f927c13738efc1a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:50:56 2020 +0300
test
commit c09f201cbd88498a2328be332197e4d96e5fb115
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:42:23 2020 +0300
+ "--glinet" command-line argument: Run in GL-Inet compatibility mode </s> remove if err == nil {
</s> add if glProcessCookie(r) {
log.Debug("Auth: authentification was handled by GL-Inet submodule")
} else if err == nil { </s> remove w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
</s> add if glProcessRedirect(w, r) {
log.Debug("Auth: redirected to login page by GL-Inet submodule")
} else {
w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab0a9d87a6f49ebbf1f61fee805775acca82b99 | home/auth.go |
if glProcessCookie(r) {
log.Debug("Auth: authentification was handled by GL-Inet submodule")
} else if err == nil { | <mask> } else if Context.auth != nil && Context.auth.AuthRequired() {
<mask> // redirect to login page if not authenticated
<mask> ok := false
<mask> cookie, err := r.Cookie(sessionCookieName)
<mask> if err == nil {
<mask> r := Context.auth.CheckSession(cookie.Value)
<mask> if r == 0 {
<mask> ok = true
<mask> } else if r < 0 {
<mask> log.Debug("Auth: invalid cookie value: %s", cookie)
</s> + "--glinet" command-line argument: Run in GL-Inet compatibility mode
Close #1853
Squashed commit of the following:
commit 3730cafabe8fa1dbf2bf75915079d2effe4ff9a3
Merge: 533ae3c2 6b134469
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:21:08 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 533ae3c2678cd6cfd26bf9560bee4eb5a015a615
Merge: 3521992b 21dfb5ff
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:14:45 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 3521992b4609fa3400942c89f7a7546dade459bc
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 18:04:53 2020 +0300
logs
commit 3e0258782b1a14c08156fe65940ae7b661a42b54
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 17:11:47 2020 +0300
fix
commit bb814db9df1c770d0ea02eafd12bedd122bef894
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:58:37 2020 +0300
minor
commit b161bbc5749ce76b16600e0153120935ad20077e
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:53:22 2020 +0300
move code
commit c506e81265bdee140c0f61255f927c13738efc1a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:50:56 2020 +0300
test
commit c09f201cbd88498a2328be332197e4d96e5fb115
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:42:23 2020 +0300
+ "--glinet" command-line argument: Run in GL-Inet compatibility mode </s> remove w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
</s> add if glProcessRedirect(w, r) {
log.Debug("Auth: redirected to login page by GL-Inet submodule")
} else {
w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab0a9d87a6f49ebbf1f61fee805775acca82b99 | home/auth.go |
if glProcessRedirect(w, r) {
log.Debug("Auth: redirected to login page by GL-Inet submodule")
} else {
w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
} | <mask> }
<mask> }
<mask> if !ok {
<mask> if r.URL.Path == "/" || r.URL.Path == "/index.html" {
<mask> w.Header().Set("Location", "/login.html")
<mask> w.WriteHeader(http.StatusFound)
<mask> } else {
<mask> w.WriteHeader(http.StatusForbidden)
<mask> _, _ = w.Write([]byte("Forbidden"))
<mask> }
<mask> return
</s> + "--glinet" command-line argument: Run in GL-Inet compatibility mode
Close #1853
Squashed commit of the following:
commit 3730cafabe8fa1dbf2bf75915079d2effe4ff9a3
Merge: 533ae3c2 6b134469
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:21:08 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 533ae3c2678cd6cfd26bf9560bee4eb5a015a615
Merge: 3521992b 21dfb5ff
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:14:45 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 3521992b4609fa3400942c89f7a7546dade459bc
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 18:04:53 2020 +0300
logs
commit 3e0258782b1a14c08156fe65940ae7b661a42b54
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 17:11:47 2020 +0300
fix
commit bb814db9df1c770d0ea02eafd12bedd122bef894
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:58:37 2020 +0300
minor
commit b161bbc5749ce76b16600e0153120935ad20077e
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:53:22 2020 +0300
move code
commit c506e81265bdee140c0f61255f927c13738efc1a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:50:56 2020 +0300
test
commit c09f201cbd88498a2328be332197e4d96e5fb115
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:42:23 2020 +0300
+ "--glinet" command-line argument: Run in GL-Inet compatibility mode </s> remove if err == nil {
</s> add if glProcessCookie(r) {
log.Debug("Auth: authentification was handled by GL-Inet submodule")
} else if err == nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab0a9d87a6f49ebbf1f61fee805775acca82b99 | home/auth.go |
if GLMode {
return true
}
| <mask> }
<mask>
<mask> // AuthRequired - if authentication is required
<mask> func (a *Auth) AuthRequired() bool {
<mask> a.lock.Lock()
<mask> r := (len(a.users) != 0)
<mask> a.lock.Unlock()
<mask> return r
<mask> }
</s> + "--glinet" command-line argument: Run in GL-Inet compatibility mode
Close #1853
Squashed commit of the following:
commit 3730cafabe8fa1dbf2bf75915079d2effe4ff9a3
Merge: 533ae3c2 6b134469
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:21:08 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 533ae3c2678cd6cfd26bf9560bee4eb5a015a615
Merge: 3521992b 21dfb5ff
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:14:45 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 3521992b4609fa3400942c89f7a7546dade459bc
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 18:04:53 2020 +0300
logs
commit 3e0258782b1a14c08156fe65940ae7b661a42b54
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 17:11:47 2020 +0300
fix
commit bb814db9df1c770d0ea02eafd12bedd122bef894
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:58:37 2020 +0300
minor
commit b161bbc5749ce76b16600e0153120935ad20077e
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:53:22 2020 +0300
move code
commit c506e81265bdee140c0f61255f927c13738efc1a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:50:56 2020 +0300
test
commit c09f201cbd88498a2328be332197e4d96e5fb115
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:42:23 2020 +0300
+ "--glinet" command-line argument: Run in GL-Inet compatibility mode </s> remove if err == nil {
</s> add if glProcessCookie(r) {
log.Debug("Auth: authentification was handled by GL-Inet submodule")
} else if err == nil { </s> remove w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
</s> add if glProcessRedirect(w, r) {
log.Debug("Auth: redirected to login page by GL-Inet submodule")
} else {
w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
} | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab0a9d87a6f49ebbf1f61fee805775acca82b99 | home/auth.go |
GLMode = args.glinetMode | <mask>
<mask> sessFilename := filepath.Join(Context.getDataDir(), "sessions.db")
<mask> Context.auth = InitAuth(sessFilename, config.Users, config.WebSessionTTLHours*60*60)
<mask> if Context.auth == nil {
<mask> log.Fatalf("Couldn't initialize Auth module")
<mask> }
</s> + "--glinet" command-line argument: Run in GL-Inet compatibility mode
Close #1853
Squashed commit of the following:
commit 3730cafabe8fa1dbf2bf75915079d2effe4ff9a3
Merge: 533ae3c2 6b134469
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:21:08 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 533ae3c2678cd6cfd26bf9560bee4eb5a015a615
Merge: 3521992b 21dfb5ff
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:14:45 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 3521992b4609fa3400942c89f7a7546dade459bc
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 18:04:53 2020 +0300
logs
commit 3e0258782b1a14c08156fe65940ae7b661a42b54
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 17:11:47 2020 +0300
fix
commit bb814db9df1c770d0ea02eafd12bedd122bef894
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:58:37 2020 +0300
minor
commit b161bbc5749ce76b16600e0153120935ad20077e
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:53:22 2020 +0300
move code
commit c506e81265bdee140c0f61255f927c13738efc1a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:50:56 2020 +0300
test
commit c09f201cbd88498a2328be332197e4d96e5fb115
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:42:23 2020 +0300
+ "--glinet" command-line argument: Run in GL-Inet compatibility mode </s> remove if err == nil {
</s> add if glProcessCookie(r) {
log.Debug("Auth: authentification was handled by GL-Inet submodule")
} else if err == nil { </s> remove w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
</s> add if glProcessRedirect(w, r) {
log.Debug("Auth: redirected to login page by GL-Inet submodule")
} else {
w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
} | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab0a9d87a6f49ebbf1f61fee805775acca82b99 | home/home.go |
glinetMode bool // Activate GL-Inet mode | <mask> serviceControlAction string
<mask>
<mask> // runningAsService flag is set to true when options are passed from the service runner
<mask> runningAsService bool
<mask> }
<mask>
<mask> // loadOptions reads command line arguments and initializes configuration
<mask> func loadOptions() options {
<mask> o := options{}
</s> + "--glinet" command-line argument: Run in GL-Inet compatibility mode
Close #1853
Squashed commit of the following:
commit 3730cafabe8fa1dbf2bf75915079d2effe4ff9a3
Merge: 533ae3c2 6b134469
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:21:08 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 533ae3c2678cd6cfd26bf9560bee4eb5a015a615
Merge: 3521992b 21dfb5ff
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:14:45 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 3521992b4609fa3400942c89f7a7546dade459bc
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 18:04:53 2020 +0300
logs
commit 3e0258782b1a14c08156fe65940ae7b661a42b54
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 17:11:47 2020 +0300
fix
commit bb814db9df1c770d0ea02eafd12bedd122bef894
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:58:37 2020 +0300
minor
commit b161bbc5749ce76b16600e0153120935ad20077e
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:53:22 2020 +0300
move code
commit c506e81265bdee140c0f61255f927c13738efc1a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:50:56 2020 +0300
test
commit c09f201cbd88498a2328be332197e4d96e5fb115
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:42:23 2020 +0300
+ "--glinet" command-line argument: Run in GL-Inet compatibility mode </s> remove if err == nil {
</s> add if glProcessCookie(r) {
log.Debug("Auth: authentification was handled by GL-Inet submodule")
} else if err == nil { </s> remove w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
</s> add if glProcessRedirect(w, r) {
log.Debug("Auth: redirected to login page by GL-Inet submodule")
} else {
w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
} | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab0a9d87a6f49ebbf1f61fee805775acca82b99 | home/home.go |
{"glinet", "", "Run in GL-Inet compatibility mode", nil, func() { o.glinetMode = true }}, | <mask> {"check-config", "", "Check configuration and exit", nil, func() { o.checkConfig = true }},
<mask> {"no-check-update", "", "Don't check for updates", nil, func() { o.disableUpdate = true }},
<mask> {"verbose", "v", "Enable verbose output", nil, func() { o.verbose = true }},
<mask> {"version", "", "Show the version and exit", nil, func() {
<mask> fmt.Printf("AdGuardHome %s\n", versionString)
<mask> os.Exit(0)
<mask> }},
</s> + "--glinet" command-line argument: Run in GL-Inet compatibility mode
Close #1853
Squashed commit of the following:
commit 3730cafabe8fa1dbf2bf75915079d2effe4ff9a3
Merge: 533ae3c2 6b134469
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:21:08 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 533ae3c2678cd6cfd26bf9560bee4eb5a015a615
Merge: 3521992b 21dfb5ff
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 19:14:45 2020 +0300
Merge remote-tracking branch 'origin/master' into 1853-glinet
commit 3521992b4609fa3400942c89f7a7546dade459bc
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 18:04:53 2020 +0300
logs
commit 3e0258782b1a14c08156fe65940ae7b661a42b54
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 17:11:47 2020 +0300
fix
commit bb814db9df1c770d0ea02eafd12bedd122bef894
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:58:37 2020 +0300
minor
commit b161bbc5749ce76b16600e0153120935ad20077e
Author: Simon Zolin <s.zolin@adguard.com>
Date: Fri Jul 3 16:53:22 2020 +0300
move code
commit c506e81265bdee140c0f61255f927c13738efc1a
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:50:56 2020 +0300
test
commit c09f201cbd88498a2328be332197e4d96e5fb115
Author: Simon Zolin <s.zolin@adguard.com>
Date: Thu Jul 2 10:42:23 2020 +0300
+ "--glinet" command-line argument: Run in GL-Inet compatibility mode </s> remove if err == nil {
</s> add if glProcessCookie(r) {
log.Debug("Auth: authentification was handled by GL-Inet submodule")
} else if err == nil { </s> remove w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
</s> add if glProcessRedirect(w, r) {
log.Debug("Auth: redirected to login page by GL-Inet submodule")
} else {
w.Header().Set("Location", "/login.html")
w.WriteHeader(http.StatusFound)
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab0a9d87a6f49ebbf1f61fee805775acca82b99 | home/home.go |
- 'Publish to GitHub Releases': | <mask> 'final': false
<mask> 'jobs':
<mask> - 'Publish to Snapstore'
<mask>
<mask> - 'Publish to Github Releases':
<mask> 'manual': false
<mask> 'final': false
<mask> 'jobs':
<mask> - 'Publish to Github Releases'
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove - 'Publish to Github Releases'
</s> add - 'Publish to GitHub Releases' </s> remove 'Publish to Github Releases':
</s> add 'Publish to GitHub Releases': </s> remove echo "don't publish to Github Releases for this channel"
</s> add echo "don't publish to GitHub Releases for this channel" </s> remove 'description': 'AdGuard Home HTTPS/DOH/DOT settings'
</s> add 'description': 'AdGuard Home HTTPS/DoH/DoQ/DoT settings' </s> remove log.Debug("Whois: redirected to %s IP:%s", redir, target)
</s> add log.Debug("whois: redirected to %s IP:%s", redir, target) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | bamboo-specs/release.yaml |
- 'Publish to GitHub Releases' | <mask> - 'Publish to Github Releases':
<mask> 'manual': false
<mask> 'final': false
<mask> 'jobs':
<mask> - 'Publish to Github Releases'
<mask>
<mask> 'Make release':
<mask> 'docker':
<mask> 'image': '${bamboo.dockerGo}'
<mask> 'volumes':
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove - 'Publish to Github Releases':
</s> add - 'Publish to GitHub Releases': </s> remove 'Publish to Github Releases':
</s> add 'Publish to GitHub Releases': </s> remove echo "don't publish to Github Releases for this channel"
</s> add echo "don't publish to GitHub Releases for this channel" </s> remove 'description': 'AdGuard Home HTTPS/DOH/DOT settings'
</s> add 'description': 'AdGuard Home HTTPS/DoH/DoQ/DoT settings' </s> remove log.Debug("Whois: redirected to %s IP:%s", redir, target)
</s> add log.Debug("whois: redirected to %s IP:%s", redir, target) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | bamboo-specs/release.yaml |
'Publish to GitHub Releases': | <mask> - 'clean'
<mask> 'requirements':
<mask> - 'adg-docker': 'true'
<mask>
<mask> 'Publish to Github Releases':
<mask> 'key': 'PTGR'
<mask> 'other':
<mask> 'clean-working-dir': true
<mask> 'tasks':
<mask> - 'clean'
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove - 'Publish to Github Releases':
</s> add - 'Publish to GitHub Releases': </s> remove - 'Publish to Github Releases'
</s> add - 'Publish to GitHub Releases' </s> remove 'description': 'AdGuard Home HTTPS/DOH/DOT settings'
</s> add 'description': 'AdGuard Home HTTPS/DoH/DoQ/DoT settings' </s> remove // Whois - module context
type Whois struct {
</s> add // WHOIS - module context
type WHOIS struct { </s> remove func (w *Whois) Begin(ip net.IP) {
</s> add func (w *WHOIS) Begin(ip net.IP) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | bamboo-specs/release.yaml |
echo "don't publish to GitHub Releases for this channel" | <mask>
<mask> export CHANNEL="${bamboo.channel}"
<mask> if [ "$CHANNEL" != 'release' ] && [ "${CHANNEL}" != 'beta' ]
<mask> then
<mask> echo "don't publish to Github Releases for this channel"
<mask>
<mask> exit 0
<mask> fi
<mask>
<mask> cd ./dist/
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (w *Whois) Begin(ip net.IP) {
</s> add func (w *WHOIS) Begin(ip net.IP) { </s> remove - 'Publish to Github Releases':
</s> add - 'Publish to GitHub Releases': </s> remove - 'Publish to Github Releases'
</s> add - 'Publish to GitHub Releases' </s> remove if isWhoisComment(l) {
</s> add if isWHOISComment(l) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | bamboo-specs/release.yaml |
// hardwarePortInfo contains information about the current state of the internet
// connection obtained from macOS networksetup. | <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> )
<mask>
<mask> // hardwarePortInfo - information obtained using MacOS networksetup
<mask> // about the current state of the internet connection
<mask> type hardwarePortInfo struct {
<mask> name string
<mask> ip string
<mask> subnet string
<mask> gatewayIP string
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add WHOISInfo *RuntimeClientWHOISInfo </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/aghnet/net_darwin.go |
// DoT or DoQ request or the path of the client's DoH. | <mask> ConnectionState() (cs quic.ConnectionState)
<mask> }
<mask>
<mask> // processClientID extracts the client's ID from the server name of the client's
<mask> // DOT or DOQ request or the path of the client's DOH.
<mask> func processClientID(dctx *dnsContext) (rc resultCode) {
<mask> pctx := dctx.proxyCtx
<mask> proto := pctx.Proto
<mask> if proto == proxy.ProtoHTTPS {
<mask> return processClientIDHTTPS(dctx)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // clientID is the clientID from DOH, DOQ, or DOT, if provided.
</s> add // clientID is the clientID from DoH, DoQ, or DoT, if provided. </s> remove // hardwarePortInfo - information obtained using MacOS networksetup
// about the current state of the internet connection
</s> add // hardwarePortInfo contains information about the current state of the internet
// connection obtained from macOS networksetup. </s> remove // isWhoisComment returns true if the string is empty or is a WHOIS comment.
func isWhoisComment(s string) (ok bool) {
</s> add // isWHOISComment returns true if the string is empty or is a WHOIS comment.
func isWHOISComment(s string) (ok bool) { </s> remove func (w *Whois) workerLoop() {
</s> add func (w *WHOIS) workerLoop() { </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/clientid.go |
TLSAllowUnencryptedDoH bool | <mask>
<mask> FilteringConfig
<mask> TLSConfig
<mask> DNSCryptConfig
<mask> TLSAllowUnencryptedDOH bool
<mask>
<mask> // UpstreamTimeout is the timeout for querying upstream servers.
<mask> UpstreamTimeout time.Duration
<mask>
<mask> TLSv12Roots *x509.CertPool // list of root CAs for TLSv1.2
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. </s> remove PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DOT will be disabled
</s> add PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DoT will be disabled </s> remove Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DOT/DOH/HTTPS) status
</s> add Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DoT/DoH/HTTPS) status </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/config.go |
// clientID is the clientID from DoH, DoQ, or DoT, if provided. | <mask> // was successfully parsed.
<mask> unreversedReqIP net.IP
<mask> // err is the error returned from a processing function.
<mask> err error
<mask> // clientID is the clientID from DOH, DOQ, or DOT, if provided.
<mask> clientID string
<mask> // origQuestion is the question received from the client. It is set
<mask> // when the request is modified by rewrites.
<mask> origQuestion dns.Question
<mask> // protectionEnabled shows if the filtering is enabled, and if the
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove log.Debug("Whois: queue is full")
</s> add log.Debug("whois: queue is full") </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. </s> remove // isWhoisComment returns true if the string is empty or is a WHOIS comment.
func isWhoisComment(s string) (ok bool) {
</s> add // isWHOISComment returns true if the string is empty or is a WHOIS comment.
func isWHOISComment(s string) (ok bool) { </s> remove // DOT or DOQ request or the path of the client's DOH.
</s> add // DoT or DoQ request or the path of the client's DoH. </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/dns.go |
// -> dnsforward.handleDoH -> dnsforward.ServeHTTP | <mask> }
<mask>
<mask> // Control flow:
<mask> // web
<mask> // -> dnsforward.handleDOH -> dnsforward.ServeHTTP
<mask> // -> proxy.ServeHTTP -> proxy.handleDNSRequest
<mask> // -> dnsforward.handleDNSRequest
<mask> func (s *Server) handleDOH(w http.ResponseWriter, r *http.Request) {
<mask> if !s.conf.TLSAllowUnencryptedDOH && r.TLS == nil {
<mask> httpError(r, w, http.StatusNotFound, "Not Found")
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (s *Server) handleDOH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDOH && r.TLS == nil {
</s> add func (s *Server) handleDoH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDoH && r.TLS == nil { </s> remove func handleMobileConfigDOT(w http.ResponseWriter, r *http.Request) {
</s> add func handleMobileConfigDoT(w http.ResponseWriter, r *http.Request) { </s> remove func handleMobileConfigDOH(w http.ResponseWriter, r *http.Request) {
</s> add func handleMobileConfigDoH(w http.ResponseWriter, r *http.Request) { </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove func toQueryLogWhois(wi *RuntimeClientWhoisInfo) (cw *querylog.ClientWhois) {
</s> add func toQueryLogWHOIS(wi *RuntimeClientWHOISInfo) (cw *querylog.ClientWHOIS) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/http.go |
func (s *Server) handleDoH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDoH && r.TLS == nil { | <mask> // web
<mask> // -> dnsforward.handleDOH -> dnsforward.ServeHTTP
<mask> // -> proxy.ServeHTTP -> proxy.handleDNSRequest
<mask> // -> dnsforward.handleDNSRequest
<mask> func (s *Server) handleDOH(w http.ResponseWriter, r *http.Request) {
<mask> if !s.conf.TLSAllowUnencryptedDOH && r.TLS == nil {
<mask> httpError(r, w, http.StatusNotFound, "Not Found")
<mask> return
<mask> }
<mask>
<mask> if !s.IsRunning() {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // -> dnsforward.handleDOH -> dnsforward.ServeHTTP
</s> add // -> dnsforward.handleDoH -> dnsforward.ServeHTTP </s> remove func handleMobileConfigDOT(w http.ResponseWriter, r *http.Request) {
</s> add func handleMobileConfigDoT(w http.ResponseWriter, r *http.Request) { </s> remove func handleMobileConfigDOH(w http.ResponseWriter, r *http.Request) {
</s> add func handleMobileConfigDoH(w http.ResponseWriter, r *http.Request) { </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove func toQueryLogWhois(wi *RuntimeClientWhoisInfo) (cw *querylog.ClientWhois) {
</s> add func toQueryLogWHOIS(wi *RuntimeClientWHOISInfo) (cw *querylog.ClientWHOIS) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/http.go |
s.conf.HTTPRegister("", "/dns-query", s.handleDoH)
s.conf.HTTPRegister("", "/dns-query/", s.handleDoH) | <mask> //
<mask> // See go doc net/http.ServeMux.
<mask> //
<mask> // See also https://github.com/AdguardTeam/AdGuardHome/issues/2628.
<mask> s.conf.HTTPRegister("", "/dns-query", s.handleDOH)
<mask> s.conf.HTTPRegister("", "/dns-query/", s.handleDOH)
<mask> }
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // Allow DOH queries via unencrypted HTTP (e.g. for reverse proxying)
AllowUnencryptedDOH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"`
</s> add // Allow DoH queries via unencrypted HTTP (e.g. for reverse proxying)
AllowUnencryptedDoH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"` </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove // -> dnsforward.handleDOH -> dnsforward.ServeHTTP
</s> add // -> dnsforward.handleDoH -> dnsforward.ServeHTTP </s> remove log.Debug("Whois: queue is full")
</s> add log.Debug("whois: queue is full") </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/http.go |
p.ClientProto = querylog.ClientProtoDoH | <mask> }
<mask>
<mask> switch pctx.Proto {
<mask> case proxy.ProtoHTTPS:
<mask> p.ClientProto = querylog.ClientProtoDOH
<mask> case proxy.ProtoQUIC:
<mask> p.ClientProto = querylog.ClientProtoDOQ
<mask> case proxy.ProtoTLS:
<mask> p.ClientProto = querylog.ClientProtoDOT
<mask> case proxy.ProtoDNSCrypt:
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove p.ClientProto = querylog.ClientProtoDOQ
</s> add p.ClientProto = querylog.ClientProtoDoQ </s> remove p.ClientProto = querylog.ClientProtoDOT
</s> add p.ClientProto = querylog.ClientProtoDoT </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove ClientProtoDOH,
ClientProtoDOQ,
ClientProtoDOT,
</s> add ClientProtoDoH,
ClientProtoDoQ,
ClientProtoDoT, </s> remove log.Debug("Whois: adding %s", ip)
</s> add log.Debug("whois: adding %s", ip) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/stats.go |
p.ClientProto = querylog.ClientProtoDoQ | <mask> switch pctx.Proto {
<mask> case proxy.ProtoHTTPS:
<mask> p.ClientProto = querylog.ClientProtoDOH
<mask> case proxy.ProtoQUIC:
<mask> p.ClientProto = querylog.ClientProtoDOQ
<mask> case proxy.ProtoTLS:
<mask> p.ClientProto = querylog.ClientProtoDOT
<mask> case proxy.ProtoDNSCrypt:
<mask> p.ClientProto = querylog.ClientProtoDNSCrypt
<mask> default:
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove p.ClientProto = querylog.ClientProtoDOH
</s> add p.ClientProto = querylog.ClientProtoDoH </s> remove p.ClientProto = querylog.ClientProtoDOT
</s> add p.ClientProto = querylog.ClientProtoDoT </s> remove ClientProtoDOH,
ClientProtoDOQ,
ClientProtoDOT,
</s> add ClientProtoDoH,
ClientProtoDoQ,
ClientProtoDoT, </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove log.Debug("Whois: adding %s", ip)
</s> add log.Debug("whois: adding %s", ip) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/stats.go |
p.ClientProto = querylog.ClientProtoDoT | <mask> p.ClientProto = querylog.ClientProtoDOH
<mask> case proxy.ProtoQUIC:
<mask> p.ClientProto = querylog.ClientProtoDOQ
<mask> case proxy.ProtoTLS:
<mask> p.ClientProto = querylog.ClientProtoDOT
<mask> case proxy.ProtoDNSCrypt:
<mask> p.ClientProto = querylog.ClientProtoDNSCrypt
<mask> default:
<mask> // Consider this a plain DNS-over-UDP or DNS-over-TCP
<mask> // request.
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove p.ClientProto = querylog.ClientProtoDOQ
</s> add p.ClientProto = querylog.ClientProtoDoQ </s> remove p.ClientProto = querylog.ClientProtoDOH
</s> add p.ClientProto = querylog.ClientProtoDoH </s> remove ClientProtoDOH,
ClientProtoDOQ,
ClientProtoDOT,
</s> add ClientProtoDoH,
ClientProtoDoQ,
ClientProtoDoT, </s> remove log.Debug("Whois: adding %s", ip)
</s> add log.Debug("whois: adding %s", ip) </s> remove log.Debug("Whois: queue is full")
</s> add log.Debug("whois: queue is full") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/stats.go |
wantLogProto: querylog.ClientProtoDoT, | <mask> name: "success_tls_client_id",
<mask> proto: proxy.ProtoTLS,
<mask> addr: &net.TCPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234},
<mask> clientID: "cli42",
<mask> wantLogProto: querylog.ClientProtoDOT,
<mask> wantStatClient: "cli42",
<mask> wantCode: resultCodeSuccess,
<mask> reason: filtering.NotFilteredNotFound,
<mask> wantStatResult: stats.RNotFiltered,
<mask> }, {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove wantLogProto: querylog.ClientProtoDOT,
</s> add wantLogProto: querylog.ClientProtoDoT, </s> remove wantLogProto: querylog.ClientProtoDOH,
</s> add wantLogProto: querylog.ClientProtoDoH, </s> remove wantLogProto: querylog.ClientProtoDOQ,
</s> add wantLogProto: querylog.ClientProtoDoQ, </s> remove Whois: whois,
</s> add WHOIS: whois, </s> remove if isWhoisComment(l) {
</s> add if isWHOISComment(l) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/stats_test.go |
wantLogProto: querylog.ClientProtoDoT, | <mask> name: "success_tls",
<mask> proto: proxy.ProtoTLS,
<mask> addr: &net.TCPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234},
<mask> clientID: "",
<mask> wantLogProto: querylog.ClientProtoDOT,
<mask> wantStatClient: "1.2.3.4",
<mask> wantCode: resultCodeSuccess,
<mask> reason: filtering.NotFilteredNotFound,
<mask> wantStatResult: stats.RNotFiltered,
<mask> }, {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove wantLogProto: querylog.ClientProtoDOT,
</s> add wantLogProto: querylog.ClientProtoDoT, </s> remove wantLogProto: querylog.ClientProtoDOH,
</s> add wantLogProto: querylog.ClientProtoDoH, </s> remove wantLogProto: querylog.ClientProtoDOQ,
</s> add wantLogProto: querylog.ClientProtoDoQ, </s> remove log.Debug("Whois: redirected to %s IP:%s", redir, target)
</s> add log.Debug("whois: redirected to %s IP:%s", redir, target) </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/stats_test.go |
wantLogProto: querylog.ClientProtoDoQ, | <mask> name: "success_quic",
<mask> proto: proxy.ProtoQUIC,
<mask> addr: &net.UDPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234},
<mask> clientID: "",
<mask> wantLogProto: querylog.ClientProtoDOQ,
<mask> wantStatClient: "1.2.3.4",
<mask> wantCode: resultCodeSuccess,
<mask> reason: filtering.NotFilteredNotFound,
<mask> wantStatResult: stats.RNotFiltered,
<mask> }, {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove wantLogProto: querylog.ClientProtoDOT,
</s> add wantLogProto: querylog.ClientProtoDoT, </s> remove wantLogProto: querylog.ClientProtoDOH,
</s> add wantLogProto: querylog.ClientProtoDoH, </s> remove wantLogProto: querylog.ClientProtoDOT,
</s> add wantLogProto: querylog.ClientProtoDoT, </s> remove log.Debug("Whois: redirected to %s IP:%s", redir, target)
</s> add log.Debug("whois: redirected to %s IP:%s", redir, target) </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/stats_test.go |
wantLogProto: querylog.ClientProtoDoH, | <mask> name: "success_https",
<mask> proto: proxy.ProtoHTTPS,
<mask> addr: &net.TCPAddr{IP: net.IP{1, 2, 3, 4}, Port: 1234},
<mask> clientID: "",
<mask> wantLogProto: querylog.ClientProtoDOH,
<mask> wantStatClient: "1.2.3.4",
<mask> wantCode: resultCodeSuccess,
<mask> reason: filtering.NotFilteredNotFound,
<mask> wantStatResult: stats.RNotFiltered,
<mask> }, {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove wantLogProto: querylog.ClientProtoDOT,
</s> add wantLogProto: querylog.ClientProtoDoT, </s> remove wantLogProto: querylog.ClientProtoDOQ,
</s> add wantLogProto: querylog.ClientProtoDoQ, </s> remove wantLogProto: querylog.ClientProtoDOT,
</s> add wantLogProto: querylog.ClientProtoDoT, </s> remove log.Debug("Whois: redirected to %s IP:%s", redir, target)
</s> add log.Debug("whois: redirected to %s IP:%s", redir, target) </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/dnsforward/stats_test.go |
WHOISInfo *RuntimeClientWHOISInfo | <mask> )
<mask>
<mask> // RuntimeClient information
<mask> type RuntimeClient struct {
<mask> WhoisInfo *RuntimeClientWhoisInfo
<mask> Host string
<mask> Source clientSource
<mask> }
<mask>
<mask> // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the </s> remove WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
</s> add WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
// RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { | <mask> Host string
<mask> Source clientSource
<mask> }
<mask>
<mask> // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
<mask> type RuntimeClientWhoisInfo struct {
<mask> City string `json:"city,omitempty"`
<mask> Country string `json:"country,omitempty"`
<mask> Orgname string `json:"orgname,omitempty"`
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add WHOISInfo *RuntimeClientWHOISInfo </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. </s> remove WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
</s> add WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
func toQueryLogWHOIS(wi *RuntimeClientWHOISInfo) (cw *querylog.ClientWHOIS) { | <mask> // Return false if the new source has higher priority.
<mask> return source <= rc.Source
<mask> }
<mask>
<mask> func toQueryLogWhois(wi *RuntimeClientWhoisInfo) (cw *querylog.ClientWhois) {
<mask> if wi == nil {
<mask> return &querylog.ClientWhois{}
<mask> }
<mask>
<mask> return &querylog.ClientWhois{
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} </s> remove return &querylog.ClientWhois{
</s> add return &querylog.ClientWHOIS{ </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { </s> remove func (s *Server) handleDOH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDOH && r.TLS == nil {
</s> add func (s *Server) handleDoH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDoH && r.TLS == nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
return &querylog.ClientWHOIS{} | <mask> }
<mask>
<mask> func toQueryLogWhois(wi *RuntimeClientWhoisInfo) (cw *querylog.ClientWhois) {
<mask> if wi == nil {
<mask> return &querylog.ClientWhois{}
<mask> }
<mask>
<mask> return &querylog.ClientWhois{
<mask> City: wi.City,
<mask> Country: wi.Country,
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove return &querylog.ClientWhois{
</s> add return &querylog.ClientWHOIS{ </s> remove func toQueryLogWhois(wi *RuntimeClientWhoisInfo) (cw *querylog.ClientWhois) {
</s> add func toQueryLogWHOIS(wi *RuntimeClientWHOISInfo) (cw *querylog.ClientWHOIS) { </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
return &querylog.ClientWHOIS{ | <mask> if wi == nil {
<mask> return &querylog.ClientWhois{}
<mask> }
<mask>
<mask> return &querylog.ClientWhois{
<mask> City: wi.City,
<mask> Country: wi.Country,
<mask> Orgname: wi.Orgname,
<mask> }
<mask> }
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} </s> remove func toQueryLogWhois(wi *RuntimeClientWhoisInfo) (cw *querylog.ClientWhois) {
</s> add func toQueryLogWHOIS(wi *RuntimeClientWHOISInfo) (cw *querylog.ClientWHOIS) { </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove wi = &RuntimeClientWhoisInfo{
</s> add wi = &RuntimeClientWHOISInfo{ </s> remove log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
</s> add log.Debug("whois: IP:%s response: %d bytes", ip, len(resp)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
whois := &querylog.ClientWHOIS{} | <mask> // the query log. err is always nil.
<mask> func (clients *clientsContainer) findMultiple(ids []string) (c *querylog.Client, err error) {
<mask> for _, id := range ids {
<mask> var name string
<mask> whois := &querylog.ClientWhois{}
<mask>
<mask> c, ok := clients.Find(id)
<mask> if ok {
<mask> name = c.Name
<mask> } else {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { </s> remove if isWhoisComment(l) {
</s> add if isWHOISComment(l) { </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove func TestWhois(t *testing.T) {
</s> add func TestWHOIS(t *testing.T) { </s> remove func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
</s> add func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
whois = toQueryLogWHOIS(rc.WHOISInfo) | <mask> continue
<mask> }
<mask>
<mask> name = rc.Host
<mask> whois = toQueryLogWhois(rc.WhoisInfo)
<mask> }
<mask>
<mask> ip := net.ParseIP(id)
<mask> disallowed, disallowedRule := clients.dnsServer.IsBlockedIP(ip)
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove whois := &querylog.ClientWhois{}
</s> add whois := &querylog.ClientWHOIS{} </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove w.clients.SetWhoisInfo(id, info)
</s> add w.clients.SetWHOISInfo(id, info) </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove whois := &RuntimeClientWhoisInfo{
</s> add whois := &RuntimeClientWHOISInfo{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
WHOIS: whois, | <mask>
<mask> return &querylog.Client{
<mask> Name: name,
<mask> DisallowedRule: disallowedRule,
<mask> Whois: whois,
<mask> Disallowed: disallowed,
<mask> }, nil
<mask> }
<mask>
<mask> return nil, nil
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add WHOISInfo: &RuntimeClientWHOISInfo{}, </s> remove return &querylog.ClientWhois{
</s> add return &querylog.ClientWHOIS{ </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} </s> remove Context.whois = initWhois(&Context.clients)
</s> add Context.whois = initWHOIS(&Context.clients) </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
// SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { | <mask>
<mask> return nil
<mask> }
<mask>
<mask> // SetWhoisInfo sets the WHOIS information for a client.
<mask> func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
<mask> clients.lock.Lock()
<mask> defer clients.lock.Unlock()
<mask>
<mask> _, ok := clients.findLocked(ip)
<mask> if ok {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove whois := &querylog.ClientWhois{}
</s> add whois := &querylog.ClientWHOIS{} </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove func toQueryLogWhois(wi *RuntimeClientWhoisInfo) (cw *querylog.ClientWhois) {
</s> add func toQueryLogWHOIS(wi *RuntimeClientWHOISInfo) (cw *querylog.ClientWHOIS) { </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} </s> remove func (w *Whois) workerLoop() {
</s> add func (w *WHOIS) workerLoop() { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
rc.WHOISInfo = wi | <mask> }
<mask>
<mask> rc, ok := clients.ipToRC[ip]
<mask> if ok {
<mask> rc.WhoisInfo = wi
<mask> log.Debug("clients: set whois info for runtime client %s: %+v", rc.Host, wi)
<mask>
<mask> return
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove whois := &querylog.ClientWhois{}
</s> add whois := &querylog.ClientWHOIS{} </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { </s> remove log.Debug("Whois: received response (%d bytes) from %s IP:%s", len(resp), server, target)
</s> add log.Debug("whois: received response (%d bytes) from %s IP:%s", len(resp), server, target) </s> remove func (w *Whois) Begin(ip net.IP) {
</s> add func (w *WHOIS) Begin(ip net.IP) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
rc.WHOISInfo = wi | <mask> rc = &RuntimeClient{
<mask> Source: ClientSourceWHOIS,
<mask> }
<mask>
<mask> rc.WhoisInfo = wi
<mask> clients.ipToRC[ip] = rc
<mask>
<mask> log.Debug("clients: set whois info for runtime client with ip %s: %+v", ip, wi)
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add WHOISInfo: &RuntimeClientWHOISInfo{}, </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove whois = toQueryLogWhois(rc.WhoisInfo)
</s> add whois = toQueryLogWHOIS(rc.WHOISInfo) </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
WHOISInfo: &RuntimeClientWHOISInfo{}, | <mask> } else {
<mask> rc = &RuntimeClient{
<mask> Host: host,
<mask> Source: src,
<mask> WhoisInfo: &RuntimeClientWhoisInfo{},
<mask> }
<mask>
<mask> clients.ipToRC[ip] = rc
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add WHOISInfo: &RuntimeClientWHOISInfo{}, </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients.go |
func TestClientsWHOIS(t *testing.T) { | <mask> assert.False(t, ok)
<mask> })
<mask> }
<mask>
<mask> func TestClientsWhois(t *testing.T) {
<mask> clients := clientsContainer{
<mask> testing: true,
<mask> }
<mask> clients.Init(nil, nil, nil)
<mask> whois := &RuntimeClientWhoisInfo{
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove whois := &RuntimeClientWhoisInfo{
</s> add whois := &RuntimeClientWHOISInfo{ </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove func TestHandleMobileConfigDOH(t *testing.T) {
</s> add func TestHandleMobileConfigDoH(t *testing.T) { </s> remove clients.SetWhoisInfo("1.1.1.2", whois)
</s> add clients.SetWHOISInfo("1.1.1.2", whois) </s> remove func TestWhoisParse(t *testing.T) {
</s> add func TestWHOISParse(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients_test.go |
whois := &RuntimeClientWHOISInfo{ | <mask> clients := clientsContainer{
<mask> testing: true,
<mask> }
<mask> clients.Init(nil, nil, nil)
<mask> whois := &RuntimeClientWhoisInfo{
<mask> Country: "AU",
<mask> Orgname: "Example Org",
<mask> }
<mask>
<mask> t.Run("new_client", func(t *testing.T) {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func TestClientsWhois(t *testing.T) {
</s> add func TestClientsWHOIS(t *testing.T) { </s> remove clients.SetWhoisInfo("1.1.1.255", whois)
</s> add clients.SetWHOISInfo("1.1.1.255", whois) </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove wi = &RuntimeClientWhoisInfo{
</s> add wi = &RuntimeClientWHOISInfo{ </s> remove func TestHandleMobileConfigDOH(t *testing.T) {
</s> add func TestHandleMobileConfigDoH(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients_test.go |
clients.SetWHOISInfo("1.1.1.255", whois) | <mask> Orgname: "Example Org",
<mask> }
<mask>
<mask> t.Run("new_client", func(t *testing.T) {
<mask> clients.SetWhoisInfo("1.1.1.255", whois)
<mask>
<mask> require.NotNil(t, clients.ipToRC["1.1.1.255"])
<mask>
<mask> h := clients.ipToRC["1.1.1.255"]
<mask> require.NotNil(t, h)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove whois := &RuntimeClientWhoisInfo{
</s> add whois := &RuntimeClientWHOISInfo{ </s> remove clients.SetWhoisInfo("1.1.1.1", whois)
</s> add clients.SetWHOISInfo("1.1.1.1", whois) </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients_test.go |
assert.Equal(t, h.WHOISInfo, whois) | <mask>
<mask> h := clients.ipToRC["1.1.1.255"]
<mask> require.NotNil(t, h)
<mask>
<mask> assert.Equal(t, h.WhoisInfo, whois)
<mask> })
<mask>
<mask> t.Run("existing_auto-client", func(t *testing.T) {
<mask> ok, err := clients.AddHost("1.1.1.1", "host", ClientSourceRDNS)
<mask> require.NoError(t, err)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove clients.SetWhoisInfo("1.1.1.1", whois)
</s> add clients.SetWHOISInfo("1.1.1.1", whois) </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove clients.SetWhoisInfo("1.1.1.255", whois)
</s> add clients.SetWHOISInfo("1.1.1.255", whois) </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients_test.go |
clients.SetWHOISInfo("1.1.1.1", whois) | <mask> ok, err := clients.AddHost("1.1.1.1", "host", ClientSourceRDNS)
<mask> require.NoError(t, err)
<mask> assert.True(t, ok)
<mask>
<mask> clients.SetWhoisInfo("1.1.1.1", whois)
<mask>
<mask> require.NotNil(t, clients.ipToRC["1.1.1.1"])
<mask> h := clients.ipToRC["1.1.1.1"]
<mask> require.NotNil(t, h)
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove clients.SetWhoisInfo("1.1.1.255", whois)
</s> add clients.SetWHOISInfo("1.1.1.255", whois) </s> remove clients.SetWhoisInfo("1.1.1.2", whois)
</s> add clients.SetWHOISInfo("1.1.1.2", whois) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients_test.go |
assert.Equal(t, h.WHOISInfo, whois) | <mask> require.NotNil(t, clients.ipToRC["1.1.1.1"])
<mask> h := clients.ipToRC["1.1.1.1"]
<mask> require.NotNil(t, h)
<mask>
<mask> assert.Equal(t, h.WhoisInfo, whois)
<mask> })
<mask>
<mask> t.Run("can't_set_manually-added", func(t *testing.T) {
<mask> ok, err := clients.Add(&Client{
<mask> IDs: []string{"1.1.1.2"},
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove clients.SetWhoisInfo("1.1.1.1", whois)
</s> add clients.SetWHOISInfo("1.1.1.1", whois) </s> remove clients.SetWhoisInfo("1.1.1.255", whois)
</s> add clients.SetWHOISInfo("1.1.1.255", whois) </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients_test.go |
clients.SetWHOISInfo("1.1.1.2", whois) | <mask> })
<mask> require.NoError(t, err)
<mask> assert.True(t, ok)
<mask>
<mask> clients.SetWhoisInfo("1.1.1.2", whois)
<mask> require.Nil(t, clients.ipToRC["1.1.1.2"])
<mask> assert.True(t, clients.Del("client1"))
<mask> })
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove clients.SetWhoisInfo("1.1.1.1", whois)
</s> add clients.SetWHOISInfo("1.1.1.1", whois) </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) </s> remove func TestClientsWhois(t *testing.T) {
</s> add func TestClientsWHOIS(t *testing.T) { </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clients_test.go |
WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info,omitempty"` | <mask> // disallowed by the "allowed IP list", that is it is not included in
<mask> // the allowlist.
<mask> DisallowedRule *string `json:"disallowed_rule,omitempty"`
<mask>
<mask> WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
<mask>
<mask> Name string `json:"name"`
<mask>
<mask> BlockedServices []string `json:"blocked_services"`
<mask> IDs []string `json:"ids"`
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
</s> add WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info"` </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add WHOISInfo *RuntimeClientWHOISInfo </s> remove log.Debug("Whois: queue is full")
</s> add log.Debug("whois: queue is full") </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clientshttp.go |
WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info"` | <mask> UseGlobalSettings bool `json:"use_global_settings"`
<mask> }
<mask>
<mask> type runtimeClientJSON struct {
<mask> WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
<mask>
<mask> IP string `json:"ip"`
<mask> Name string `json:"name"`
<mask> Source string `json:"source"`
<mask> }
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add WHOISInfo *RuntimeClientWHOISInfo </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` </s> remove WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
</s> add WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info,omitempty"` </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clientshttp.go |
WHOISInfo: rc.WHOISInfo, | <mask> for ip, rc := range clients.ipToRC {
<mask> cj := runtimeClientJSON{
<mask> IP: ip,
<mask> Name: rc.Host,
<mask> WhoisInfo: rc.WhoisInfo,
<mask> }
<mask>
<mask> cj.Source = "etc/hosts"
<mask> switch rc.Source {
<mask> case ClientSourceDHCP:
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add WHOISInfo: &RuntimeClientWHOISInfo{}, </s> remove p.ClientProto = querylog.ClientProtoDOH
</s> add p.ClientProto = querylog.ClientProtoDoH </s> remove log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
</s> add log.Debug("whois: IP:%s response: %d bytes", ip, len(resp)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clientshttp.go |
WHOISInfo: rc.WHOISInfo, | <mask> func runtimeClientToJSON(ip string, rc RuntimeClient) (cj clientJSON) {
<mask> cj = clientJSON{
<mask> Name: rc.Host,
<mask> IDs: []string{ip},
<mask> WhoisInfo: rc.WhoisInfo,
<mask> }
<mask>
<mask> return cj
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add WHOISInfo: &RuntimeClientWHOISInfo{}, </s> remove WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add WHOISInfo: &RuntimeClientWHOISInfo{}, </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clientshttp.go |
WHOISInfo: &RuntimeClientWHOISInfo{}, | <mask> cj = clientJSON{
<mask> IDs: []string{idStr},
<mask> Disallowed: &disallowed,
<mask> DisallowedRule: &rule,
<mask> WhoisInfo: &RuntimeClientWhoisInfo{},
<mask> }
<mask>
<mask> return cj, true
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove Whois: whois,
</s> add WHOIS: whois, </s> remove WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add WHOISInfo: &RuntimeClientWHOISInfo{}, </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, </s> remove // isWhoisComment returns true if the string is empty or is a WHOIS comment.
func isWhoisComment(s string) (ok bool) {
</s> add // isWHOISComment returns true if the string is empty or is a WHOIS comment.
func isWHOISComment(s string) (ok bool) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/clientshttp.go |
Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DoT/DoH/HTTPS) status | <mask> LocalPTRResolvers []string `yaml:"local_ptr_upstreams"`
<mask> }
<mask>
<mask> type tlsConfigSettings struct {
<mask> Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DOT/DOH/HTTPS) status
<mask> ServerName string `yaml:"server_name" json:"server_name,omitempty"` // ServerName is the hostname of your HTTPS/TLS server
<mask> ForceHTTPS bool `yaml:"force_https" json:"force_https,omitempty"` // ForceHTTPS: if true, forces HTTP->HTTPS redirect
<mask> PortHTTPS int `yaml:"port_https" json:"port_https,omitempty"` // HTTPS port. If 0, HTTPS will be disabled
<mask> PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DOT will be disabled
<mask> PortDNSOverQUIC int `yaml:"port_dns_over_quic" json:"port_dns_over_quic,omitempty"` // DNS-over-QUIC port. If 0, DoQ will be disabled
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DOT will be disabled
</s> add PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DoT will be disabled </s> remove 'description': 'DNS-over-TLS port. If 0, DOT will be disabled.'
</s> add 'description': 'DNS-over-TLS port. If 0, DoT will be disabled.' </s> remove 'description': 'DNS-over-QUIC port. If 0, DOQ will be disabled.'
</s> add 'description': 'DNS-over-QUIC port. If 0, DoQ will be disabled.' </s> remove 'description': 'enabled is the encryption (DOT/DOH/HTTPS) status'
</s> add 'description': 'enabled is the encryption (DoT/DoH/HTTPS) status' </s> remove // Allow DOH queries via unencrypted HTTP (e.g. for reverse proxying)
AllowUnencryptedDOH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"`
</s> add // Allow DoH queries via unencrypted HTTP (e.g. for reverse proxying)
AllowUnencryptedDoH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/config.go |
PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DoT will be disabled | <mask> Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DOT/DOH/HTTPS) status
<mask> ServerName string `yaml:"server_name" json:"server_name,omitempty"` // ServerName is the hostname of your HTTPS/TLS server
<mask> ForceHTTPS bool `yaml:"force_https" json:"force_https,omitempty"` // ForceHTTPS: if true, forces HTTP->HTTPS redirect
<mask> PortHTTPS int `yaml:"port_https" json:"port_https,omitempty"` // HTTPS port. If 0, HTTPS will be disabled
<mask> PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DOT will be disabled
<mask> PortDNSOverQUIC int `yaml:"port_dns_over_quic" json:"port_dns_over_quic,omitempty"` // DNS-over-QUIC port. If 0, DoQ will be disabled
<mask>
<mask> // PortDNSCrypt is the port for DNSCrypt requests. If it's zero,
<mask> // DNSCrypt is disabled.
<mask> PortDNSCrypt int `yaml:"port_dnscrypt" json:"port_dnscrypt"`
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DOT/DOH/HTTPS) status
</s> add Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DoT/DoH/HTTPS) status </s> remove 'description': 'DNS-over-TLS port. If 0, DOT will be disabled.'
</s> add 'description': 'DNS-over-TLS port. If 0, DoT will be disabled.' </s> remove 'description': 'DNS-over-QUIC port. If 0, DOQ will be disabled.'
</s> add 'description': 'DNS-over-QUIC port. If 0, DoQ will be disabled.' </s> remove 'description': 'enabled is the encryption (DOT/DOH/HTTPS) status'
</s> add 'description': 'enabled is the encryption (DoT/DoH/HTTPS) status' </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/config.go |
// Allow DoH queries via unencrypted HTTP (e.g. for reverse proxying)
AllowUnencryptedDoH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"` | <mask> // See https://github.com/AdguardTeam/dnsproxy and
<mask> // https://github.com/ameshkov/dnscrypt.
<mask> DNSCryptConfigFile string `yaml:"dnscrypt_config_file" json:"dnscrypt_config_file"`
<mask>
<mask> // Allow DOH queries via unencrypted HTTP (e.g. for reverse proxying)
<mask> AllowUnencryptedDOH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"`
<mask>
<mask> dnsforward.TLSConfig `yaml:",inline" json:",inline"`
<mask> }
<mask>
<mask> // initialize to default values, will be changed later when reading config or parsing command line
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DOT/DOH/HTTPS) status
</s> add Enabled bool `yaml:"enabled" json:"enabled"` // Enabled is the encryption (DoT/DoH/HTTPS) status </s> remove PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DOT will be disabled
</s> add PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DoT will be disabled </s> remove // clientID is the clientID from DOH, DOQ, or DOT, if provided.
</s> add // clientID is the clientID from DoH, DoQ, or DoT, if provided. </s> remove s.conf.HTTPRegister("", "/dns-query", s.handleDOH)
s.conf.HTTPRegister("", "/dns-query/", s.handleDOH)
</s> add s.conf.HTTPRegister("", "/dns-query", s.handleDoH)
s.conf.HTTPRegister("", "/dns-query/", s.handleDoH) </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/config.go |
// No auth is necessary for DoH/DoT configurations
Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoH))
Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDoT)) | <mask> Context.mux.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON)))
<mask> httpRegister(http.MethodPost, "/control/update", handleUpdate)
<mask> httpRegister(http.MethodGet, "/control/profile", handleGetProfile)
<mask>
<mask> // No auth is necessary for DOH/DOT configurations
<mask> Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDOH))
<mask> Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDOT))
<mask> RegisterAuthHandlers()
<mask> }
<mask>
<mask> func httpRegister(method, url string, handler func(http.ResponseWriter, *http.Request)) {
<mask> if method == "" {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { </s> remove // isWhoisComment returns true if the string is empty or is a WHOIS comment.
func isWhoisComment(s string) (ok bool) {
</s> add // isWHOISComment returns true if the string is empty or is a WHOIS comment.
func isWHOISComment(s string) (ok bool) { </s> remove func (w *Whois) query(ctx context.Context, target, serverAddr string) (data string, err error) {
</s> add func (w *WHOIS) query(ctx context.Context, target, serverAddr string) (data string, err error) { </s> remove func (s *Server) handleDOH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDOH && r.TLS == nil {
</s> add func (s *Server) handleDoH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDoH && r.TLS == nil { </s> remove func (w *Whois) workerLoop() {
</s> add func (w *WHOIS) workerLoop() { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/control.go |
Context.whois = initWHOIS(&Context.clients) | <mask> return fmt.Errorf("dnsServer.Prepare: %w", err)
<mask> }
<mask>
<mask> Context.rdns = NewRDNS(Context.dnsServer, &Context.clients, config.DNS.UsePrivateRDNS)
<mask> Context.whois = initWhois(&Context.clients)
<mask>
<mask> Context.filters.Init()
<mask> return nil
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove return &querylog.ClientWhois{
</s> add return &querylog.ClientWHOIS{ </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} </s> remove Whois: whois,
</s> add WHOIS: whois, </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
</s> add log.Debug("whois: IP:%s response: %d bytes", ip, len(resp)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/dns.go |
newConf.TLSAllowUnencryptedDoH = tlsConf.AllowUnencryptedDoH | <mask> }
<mask>
<mask> newConf.TLSv12Roots = Context.tlsRoots
<mask> newConf.TLSCiphers = Context.tlsCiphers
<mask> newConf.TLSAllowUnencryptedDOH = tlsConf.AllowUnencryptedDOH
<mask>
<mask> newConf.FilterHandler = applyAdditionalFiltering
<mask> newConf.GetCustomUpstreamByClient = Context.clients.findUpstreams
<mask>
<mask> newConf.ResolveClients = dnsConf.ResolveClients
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove whois = toQueryLogWhois(rc.WhoisInfo)
</s> add whois = toQueryLogWHOIS(rc.WHOISInfo) </s> remove Context.whois = initWhois(&Context.clients)
</s> add Context.whois = initWHOIS(&Context.clients) </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi </s> remove p.ClientProto = querylog.ClientProtoDOH
</s> add p.ClientProto = querylog.ClientProtoDoH </s> remove func TestWhoisParse(t *testing.T) {
</s> add func TestWHOISParse(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/dns.go |
whois *WHOIS // WHOIS module | <mask> stats stats.Stats // statistics module
<mask> queryLog querylog.QueryLog // query log module
<mask> dnsServer *dnsforward.Server // DNS module
<mask> rdns *RDNS // rDNS module
<mask> whois *Whois // WHOIS module
<mask> dnsFilter *filtering.DNSFilter // DNS filtering module
<mask> dhcpServer *dhcpd.Server // DHCP module
<mask> auth *Auth // HTTP authentication module
<mask> filters Filtering // DNS filtering module
<mask> web *Web // Web (HTTP, HTTPS) module
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // initWhois creates the Whois module context.
func initWhois(clients *clientsContainer) *Whois {
w := Whois{
</s> add // initWHOIS creates the WHOIS module context.
func initWHOIS(clients *clientsContainer) *WHOIS {
w := WHOIS{ </s> remove // Whois - module context
type Whois struct {
</s> add // WHOIS - module context
type WHOIS struct { </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` </s> remove // clientID is the clientID from DOH, DOQ, or DOT, if provided.
</s> add // clientID is the clientID from DoH, DoQ, or DoT, if provided. </s> remove // Allow DOH queries via unencrypted HTTP (e.g. for reverse proxying)
AllowUnencryptedDOH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"`
</s> add // Allow DoH queries via unencrypted HTTP (e.g. for reverse proxying)
AllowUnencryptedDoH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/home.go |
func handleMobileConfigDoH(w http.ResponseWriter, r *http.Request) { | <mask>
<mask> _, _ = w.Write(mobileconfig)
<mask> }
<mask>
<mask> func handleMobileConfigDOH(w http.ResponseWriter, r *http.Request) {
<mask> handleMobileConfig(w, r, dnsProtoHTTPS)
<mask> }
<mask>
<mask> func handleMobileConfigDOT(w http.ResponseWriter, r *http.Request) {
<mask> handleMobileConfig(w, r, dnsProtoTLS)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func handleMobileConfigDOT(w http.ResponseWriter, r *http.Request) {
</s> add func handleMobileConfigDoT(w http.ResponseWriter, r *http.Request) { </s> remove func (s *Server) handleDOH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDOH && r.TLS == nil {
</s> add func (s *Server) handleDoH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDoH && r.TLS == nil { </s> remove // -> dnsforward.handleDOH -> dnsforward.ServeHTTP
</s> add // -> dnsforward.handleDoH -> dnsforward.ServeHTTP </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove func TestHandleMobileConfigDOH(t *testing.T) {
</s> add func TestHandleMobileConfigDoH(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig.go |
func handleMobileConfigDoT(w http.ResponseWriter, r *http.Request) { | <mask> func handleMobileConfigDOH(w http.ResponseWriter, r *http.Request) {
<mask> handleMobileConfig(w, r, dnsProtoHTTPS)
<mask> }
<mask>
<mask> func handleMobileConfigDOT(w http.ResponseWriter, r *http.Request) {
<mask> handleMobileConfig(w, r, dnsProtoTLS)
<mask> }
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func handleMobileConfigDOH(w http.ResponseWriter, r *http.Request) {
</s> add func handleMobileConfigDoH(w http.ResponseWriter, r *http.Request) { </s> remove func (s *Server) handleDOH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDOH && r.TLS == nil {
</s> add func (s *Server) handleDoH(w http.ResponseWriter, r *http.Request) {
if !s.conf.TLSAllowUnencryptedDoH && r.TLS == nil { </s> remove // -> dnsforward.handleDOH -> dnsforward.ServeHTTP
</s> add // -> dnsforward.handleDoH -> dnsforward.ServeHTTP </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove func TestHandleMobileConfigDOH(t *testing.T) {
</s> add func TestHandleMobileConfigDoH(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig.go |
func TestHandleMobileConfigDoH(t *testing.T) { | <mask> "github.com/stretchr/testify/require"
<mask> "howett.net/plist"
<mask> )
<mask>
<mask> func TestHandleMobileConfigDOH(t *testing.T) {
<mask> t.Run("success", func(t *testing.T) {
<mask> r, err := http.NewRequest(http.MethodGet, "https://example.com:12345/apple/doh.mobileconfig?host=example.org", nil)
<mask> require.NoError(t, err)
<mask>
<mask> w := httptest.NewRecorder()
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove func TestClientsWhois(t *testing.T) {
</s> add func TestClientsWHOIS(t *testing.T) { </s> remove whois := &RuntimeClientWhoisInfo{
</s> add whois := &RuntimeClientWHOISInfo{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig_test.go |
handleMobileConfigDoH(w, r) | <mask> require.NoError(t, err)
<mask>
<mask> w := httptest.NewRecorder()
<mask>
<mask> handleMobileConfigDOH(w, r)
<mask> require.Equal(t, http.StatusOK, w.Code)
<mask>
<mask> var mc mobileConfig
<mask> _, err = plist.Unmarshal(w.Body.Bytes(), &mc)
<mask> require.NoError(t, err)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig_test.go |
handleMobileConfigDoH(w, r) | <mask> require.NoError(t, err)
<mask>
<mask> w := httptest.NewRecorder()
<mask>
<mask> handleMobileConfigDOH(w, r)
<mask> assert.Equal(t, http.StatusInternalServerError, w.Code)
<mask> assert.JSONEq(t, w.Body.String(), b.String())
<mask> })
<mask>
<mask> t.Run("client_id", func(t *testing.T) {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig_test.go |
handleMobileConfigDoH(w, r) | <mask> require.NoError(t, err)
<mask>
<mask> w := httptest.NewRecorder()
<mask>
<mask> handleMobileConfigDOH(w, r)
<mask> require.Equal(t, http.StatusOK, w.Code)
<mask>
<mask> var mc mobileConfig
<mask> _, err = plist.Unmarshal(w.Body.Bytes(), &mc)
<mask> require.NoError(t, err)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig_test.go |
func TestHandleMobileConfigDoT(t *testing.T) { | <mask> assert.Equal(t, "https://example.org/dns-query/cli42", mc.PayloadContent[0].DNSSettings.ServerURL)
<mask> })
<mask> }
<mask>
<mask> func TestHandleMobileConfigDOT(t *testing.T) {
<mask> t.Run("success", func(t *testing.T) {
<mask> r, err := http.NewRequest(http.MethodGet, "https://example.com:12345/apple/dot.mobileconfig?host=example.org", nil)
<mask> require.NoError(t, err)
<mask>
<mask> w := httptest.NewRecorder()
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func TestHandleMobileConfigDOH(t *testing.T) {
</s> add func TestHandleMobileConfigDoH(t *testing.T) { </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove func TestClientsWhois(t *testing.T) {
</s> add func TestClientsWHOIS(t *testing.T) { </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig_test.go |
handleMobileConfigDoT(w, r) | <mask> require.NoError(t, err)
<mask>
<mask> w := httptest.NewRecorder()
<mask>
<mask> handleMobileConfigDOT(w, r)
<mask> require.Equal(t, http.StatusOK, w.Code)
<mask>
<mask> var mc mobileConfig
<mask> _, err = plist.Unmarshal(w.Body.Bytes(), &mc)
<mask> require.NoError(t, err)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig_test.go |
handleMobileConfigDoT(w, r) | <mask> require.NoError(t, err)
<mask>
<mask> w := httptest.NewRecorder()
<mask>
<mask> handleMobileConfigDOT(w, r)
<mask> assert.Equal(t, http.StatusInternalServerError, w.Code)
<mask>
<mask> assert.JSONEq(t, w.Body.String(), b.String())
<mask> })
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig_test.go |
handleMobileConfigDoT(w, r) | <mask> require.NoError(t, err)
<mask>
<mask> w := httptest.NewRecorder()
<mask>
<mask> handleMobileConfigDOT(w, r)
<mask> require.Equal(t, http.StatusOK, w.Code)
<mask>
<mask> var mc mobileConfig
<mask> _, err = plist.Unmarshal(w.Body.Bytes(), &mc)
<mask> require.NoError(t, err)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/mobileconfig_test.go |
AllowUnencryptedDoH: conf.AllowUnencryptedDoH, | <mask> ServerName: conf.ServerName,
<mask> PortHTTPS: conf.PortHTTPS,
<mask> PortDNSOverTLS: conf.PortDNSOverTLS,
<mask> PortDNSOverQUIC: conf.PortDNSOverQUIC,
<mask> AllowUnencryptedDOH: conf.AllowUnencryptedDOH,
<mask> }}
<mask> }
<mask> t.setCertFileTime()
<mask> }
<mask> return t
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove return &querylog.ClientWhois{
</s> add return &querylog.ClientWHOIS{ </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} </s> remove Context.whois = initWhois(&Context.clients)
</s> add Context.whois = initWHOIS(&Context.clients) </s> remove log.Debug("Whois: redirected to %s IP:%s", redir, target)
</s> add log.Debug("whois: redirected to %s IP:%s", redir, target) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/tls.go |
// WHOIS - module context
type WHOIS struct { | <mask> maxValueLength = 250
<mask> whoisTTL = 1 * 60 * 60 // 1 hour
<mask> )
<mask>
<mask> // Whois - module context
<mask> type Whois struct {
<mask> clients *clientsContainer
<mask> ipChan chan net.IP
<mask>
<mask> // dialContext specifies the dial function for creating unencrypted TCP
<mask> // connections.
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` </s> remove // initWhois creates the Whois module context.
func initWhois(clients *clientsContainer) *Whois {
w := Whois{
</s> add // initWHOIS creates the WHOIS module context.
func initWHOIS(clients *clientsContainer) *WHOIS {
w := WHOIS{ </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add WHOISInfo *RuntimeClientWHOISInfo </s> remove // hardwarePortInfo - information obtained using MacOS networksetup
// about the current state of the internet connection
</s> add // hardwarePortInfo contains information about the current state of the internet
// connection obtained from macOS networksetup. </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
// initWHOIS creates the WHOIS module context.
func initWHOIS(clients *clientsContainer) *WHOIS {
w := WHOIS{ | <mask> // TODO(a.garipov): Rewrite to use time.Duration. Like, seriously, why?
<mask> timeoutMsec uint
<mask> }
<mask>
<mask> // initWhois creates the Whois module context.
<mask> func initWhois(clients *clientsContainer) *Whois {
<mask> w := Whois{
<mask> timeoutMsec: 5000,
<mask> clients: clients,
<mask> ipAddrs: cache.New(cache.Config{
<mask> EnableLRU: true,
<mask> MaxCount: 10000,
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove w := Whois{
</s> add w := WHOIS{ </s> remove // Whois - module context
type Whois struct {
</s> add // WHOIS - module context
type WHOIS struct { </s> remove whois *Whois // WHOIS module
</s> add whois *WHOIS // WHOIS module </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
// isWHOISComment returns true if the string is empty or is a WHOIS comment.
func isWHOISComment(s string) (ok bool) { | <mask> }
<mask> return s[:maxValueLength-3] + "..."
<mask> }
<mask>
<mask> // isWhoisComment returns true if the string is empty or is a WHOIS comment.
<mask> func isWhoisComment(s string) (ok bool) {
<mask> return len(s) == 0 || s[0] == '#' || s[0] == '%'
<mask> }
<mask>
<mask> // strmap is an alias for convenience.
<mask> type strmap = map[string]string
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove if *wi == (RuntimeClientWhoisInfo{}) {
</s> add if *wi == (RuntimeClientWHOISInfo{}) { </s> remove func (w *Whois) query(ctx context.Context, target, serverAddr string) (data string, err error) {
</s> add func (w *WHOIS) query(ctx context.Context, target, serverAddr string) (data string, err error) { </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
if isWHOISComment(l) { | <mask>
<mask> var orgname string
<mask> lines := strings.Split(data, "\n")
<mask> for _, l := range lines {
<mask> if isWhoisComment(l) {
<mask> continue
<mask> }
<mask>
<mask> kv := strings.SplitN(l, ":", 2)
<mask> if len(kv) != 2 {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove whois := &querylog.ClientWhois{}
</s> add whois := &querylog.ClientWHOIS{} </s> remove func (w *Whois) workerLoop() {
</s> add func (w *WHOIS) workerLoop() { </s> remove func (w *Whois) Begin(ip net.IP) {
</s> add func (w *WHOIS) Begin(ip net.IP) { </s> remove func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
</s> add func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { </s> remove WhoisInfo: rc.WhoisInfo,
</s> add WHOISInfo: rc.WHOISInfo, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
func (w *WHOIS) query(ctx context.Context, target, serverAddr string) (data string, err error) { | <mask> // MaxConnReadSize is an upper limit in bytes for reading from net.Conn.
<mask> const MaxConnReadSize = 64 * 1024
<mask>
<mask> // Send request to a server and receive the response
<mask> func (w *Whois) query(ctx context.Context, target, serverAddr string) (data string, err error) {
<mask> addr, _, _ := net.SplitHostPort(serverAddr)
<mask> if addr == "whois.arin.net" {
<mask> target = "n + " + target
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
</s> add func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { </s> remove func TestWhois(t *testing.T) {
</s> add func TestWHOIS(t *testing.T) { </s> remove // isWhoisComment returns true if the string is empty or is a WHOIS comment.
func isWhoisComment(s string) (ok bool) {
</s> add // isWHOISComment returns true if the string is empty or is a WHOIS comment.
func isWHOISComment(s string) (ok bool) { </s> remove func (w *Whois) workerLoop() {
</s> add func (w *WHOIS) workerLoop() { </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { | <mask> return string(whoisData), nil
<mask> }
<mask>
<mask> // Query WHOIS servers (handle redirects)
<mask> func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
<mask> server := net.JoinHostPort(defaultServer, defaultPort)
<mask> const maxRedirects = 5
<mask> for i := 0; i != maxRedirects; i++ {
<mask> resp, err := w.query(ctx, target, server)
<mask> if err != nil {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (w *Whois) query(ctx context.Context, target, serverAddr string) (data string, err error) {
</s> add func (w *WHOIS) query(ctx context.Context, target, serverAddr string) (data string, err error) { </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { </s> remove log.Debug("Whois: received response (%d bytes) from %s IP:%s", len(resp), server, target)
</s> add log.Debug("whois: received response (%d bytes) from %s IP:%s", len(resp), server, target) </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) </s> remove func (w *Whois) Begin(ip net.IP) {
</s> add func (w *WHOIS) Begin(ip net.IP) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
log.Debug("whois: received response (%d bytes) from %s IP:%s", len(resp), server, target) | <mask> resp, err := w.query(ctx, target, server)
<mask> if err != nil {
<mask> return "", err
<mask> }
<mask> log.Debug("Whois: received response (%d bytes) from %s IP:%s", len(resp), server, target)
<mask>
<mask> m := whoisParse(resp)
<mask> redir, ok := m["whois"]
<mask> if !ok {
<mask> return resp, nil
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { </s> remove func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
</s> add func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { </s> remove log.Debug("Whois: redirected to %s IP:%s", redir, target)
</s> add log.Debug("whois: redirected to %s IP:%s", redir, target) </s> remove log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
</s> add log.Debug("whois: IP:%s response: %d bytes", ip, len(resp)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
log.Debug("whois: redirected to %s IP:%s", redir, target) | <mask> } else {
<mask> server = redir
<mask> }
<mask>
<mask> log.Debug("Whois: redirected to %s IP:%s", redir, target)
<mask> }
<mask> return "", fmt.Errorf("whois: redirect loop")
<mask> }
<mask>
<mask> // Request WHOIS information
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { </s> remove log.Debug("Whois: received response (%d bytes) from %s IP:%s", len(resp), server, target)
</s> add log.Debug("whois: received response (%d bytes) from %s IP:%s", len(resp), server, target) </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) </s> remove WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add WHOISInfo: &RuntimeClientWHOISInfo{}, </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { | <mask> return "", fmt.Errorf("whois: redirect loop")
<mask> }
<mask>
<mask> // Request WHOIS information
<mask> func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
<mask> resp, err := w.queryAll(ctx, ip.String())
<mask> if err != nil {
<mask> log.Debug("Whois: error: %s IP:%s", err, ip)
<mask>
<mask> return nil
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) </s> remove log.Debug("Whois: redirected to %s IP:%s", redir, target)
</s> add log.Debug("whois: redirected to %s IP:%s", redir, target) </s> remove log.Debug("Whois: received response (%d bytes) from %s IP:%s", len(resp), server, target)
</s> add log.Debug("whois: received response (%d bytes) from %s IP:%s", len(resp), server, target) </s> remove func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
</s> add func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { </s> remove func (w *Whois) Begin(ip net.IP) {
</s> add func (w *WHOIS) Begin(ip net.IP) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
log.Debug("whois: error: %s IP:%s", err, ip) | <mask> // Request WHOIS information
<mask> func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
<mask> resp, err := w.queryAll(ctx, ip.String())
<mask> if err != nil {
<mask> log.Debug("Whois: error: %s IP:%s", err, ip)
<mask>
<mask> return nil
<mask> }
<mask>
<mask> log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { </s> remove log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
</s> add log.Debug("whois: IP:%s response: %d bytes", ip, len(resp)) </s> remove log.Debug("Whois: received response (%d bytes) from %s IP:%s", len(resp), server, target)
</s> add log.Debug("whois: received response (%d bytes) from %s IP:%s", len(resp), server, target) </s> remove wi = &RuntimeClientWhoisInfo{
</s> add wi = &RuntimeClientWHOISInfo{ </s> remove func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
</s> add func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
log.Debug("whois: IP:%s response: %d bytes", ip, len(resp)) | <mask>
<mask> return nil
<mask> }
<mask>
<mask> log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
<mask>
<mask> m := whoisParse(resp)
<mask>
<mask> wi = &RuntimeClientWhoisInfo{
<mask> City: m["city"],
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove wi = &RuntimeClientWhoisInfo{
</s> add wi = &RuntimeClientWHOISInfo{ </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) </s> remove log.Debug("Whois: received response (%d bytes) from %s IP:%s", len(resp), server, target)
</s> add log.Debug("whois: received response (%d bytes) from %s IP:%s", len(resp), server, target) </s> remove return &querylog.ClientWhois{
</s> add return &querylog.ClientWHOIS{ </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
wi = &RuntimeClientWHOISInfo{ | <mask> log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
<mask>
<mask> m := whoisParse(resp)
<mask>
<mask> wi = &RuntimeClientWhoisInfo{
<mask> City: m["city"],
<mask> Country: m["country"],
<mask> Orgname: m["orgname"],
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove log.Debug("Whois: IP:%s response: %d bytes", ip, len(resp))
</s> add log.Debug("whois: IP:%s response: %d bytes", ip, len(resp)) </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) </s> remove return &querylog.ClientWhois{
</s> add return &querylog.ClientWHOIS{ </s> remove whois := &RuntimeClientWhoisInfo{
</s> add whois := &RuntimeClientWHOISInfo{ </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
if *wi == (RuntimeClientWHOISInfo{}) { | <mask> }
<mask>
<mask> // Don't return an empty struct so that the frontend doesn't get
<mask> // confused.
<mask> if *wi == (RuntimeClientWhoisInfo{}) {
<mask> return nil
<mask> }
<mask>
<mask> return wi
<mask> }
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove return &querylog.ClientWhois{
</s> add return &querylog.ClientWHOIS{ </s> remove // isWhoisComment returns true if the string is empty or is a WHOIS comment.
func isWhoisComment(s string) (ok bool) {
</s> add // isWHOISComment returns true if the string is empty or is a WHOIS comment.
func isWHOISComment(s string) (ok bool) { </s> remove return &querylog.ClientWhois{}
</s> add return &querylog.ClientWHOIS{} </s> remove func toQueryLogWhois(wi *RuntimeClientWhoisInfo) (cw *querylog.ClientWhois) {
</s> add func toQueryLogWHOIS(wi *RuntimeClientWHOISInfo) (cw *querylog.ClientWHOIS) { </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
func (w *WHOIS) Begin(ip net.IP) { | <mask> return wi
<mask> }
<mask>
<mask> // Begin - begin requesting WHOIS info
<mask> func (w *Whois) Begin(ip net.IP) {
<mask> now := uint64(time.Now().Unix())
<mask> expire := w.ipAddrs.Get([]byte(ip))
<mask> if len(expire) != 0 {
<mask> exp := binary.BigEndian.Uint64(expire)
<mask> if exp > now {
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { </s> remove func (w *Whois) workerLoop() {
</s> add func (w *WHOIS) workerLoop() { </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) </s> remove func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
</s> add func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { </s> remove rc.WhoisInfo = wi
</s> add rc.WHOISInfo = wi | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
log.Debug("whois: adding %s", ip) | <mask> expire = make([]byte, 8)
<mask> binary.BigEndian.PutUint64(expire, now+whoisTTL)
<mask> _ = w.ipAddrs.Set([]byte(ip), expire)
<mask>
<mask> log.Debug("Whois: adding %s", ip)
<mask> select {
<mask> case w.ipChan <- ip:
<mask> //
<mask> default:
<mask> log.Debug("Whois: queue is full")
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove log.Debug("Whois: queue is full")
</s> add log.Debug("whois: queue is full") </s> remove p.ClientProto = querylog.ClientProtoDOQ
</s> add p.ClientProto = querylog.ClientProtoDoQ </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) </s> remove p.ClientProto = querylog.ClientProtoDOT
</s> add p.ClientProto = querylog.ClientProtoDoT </s> remove p.ClientProto = querylog.ClientProtoDOH
</s> add p.ClientProto = querylog.ClientProtoDoH | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
log.Debug("whois: queue is full") | <mask> select {
<mask> case w.ipChan <- ip:
<mask> //
<mask> default:
<mask> log.Debug("Whois: queue is full")
<mask> }
<mask> }
<mask>
<mask> // workerLoop processes the IP addresses it got from the channel and associates
<mask> // the retrieving WHOIS info with a client.
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (w *Whois) workerLoop() {
</s> add func (w *WHOIS) workerLoop() { </s> remove log.Debug("Whois: adding %s", ip)
</s> add log.Debug("whois: adding %s", ip) </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
func (w *WHOIS) workerLoop() { | <mask> }
<mask>
<mask> // workerLoop processes the IP addresses it got from the channel and associates
<mask> // the retrieving WHOIS info with a client.
<mask> func (w *Whois) workerLoop() {
<mask> for ip := range w.ipChan {
<mask> info := w.process(context.Background(), ip)
<mask> if info == nil {
<mask> continue
<mask> }
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove log.Debug("Whois: queue is full")
</s> add log.Debug("whois: queue is full") </s> remove func (w *Whois) Begin(ip net.IP) {
</s> add func (w *WHOIS) Begin(ip net.IP) { </s> remove func (w *Whois) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWhoisInfo) {
</s> add func (w *WHOIS) process(ctx context.Context, ip net.IP) (wi *RuntimeClientWHOISInfo) { </s> remove // SetWhoisInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWhoisInfo(ip string, wi *RuntimeClientWhoisInfo) {
</s> add // SetWHOISInfo sets the WHOIS information for a client.
func (clients *clientsContainer) SetWHOISInfo(ip string, wi *RuntimeClientWHOISInfo) { </s> remove log.Debug("Whois: error: %s IP:%s", err, ip)
</s> add log.Debug("whois: error: %s IP:%s", err, ip) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
w.clients.SetWHOISInfo(id, info) | <mask> continue
<mask> }
<mask>
<mask> id := ip.String()
<mask> w.clients.SetWhoisInfo(id, info)
<mask> }
<mask> }
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove whois = toQueryLogWhois(rc.WhoisInfo)
</s> add whois = toQueryLogWHOIS(rc.WHOISInfo) </s> remove if isWhoisComment(l) {
</s> add if isWHOISComment(l) { </s> remove func (w *Whois) workerLoop() {
</s> add func (w *WHOIS) workerLoop() { </s> remove whois := &querylog.ClientWhois{}
</s> add whois := &querylog.ClientWHOIS{} </s> remove w := Whois{
</s> add w := WHOIS{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois.go |
func TestWHOIS(t *testing.T) { | <mask> func (c *fakeConn) fakeDial(ctx context.Context, network, addr string) (conn net.Conn, err error) {
<mask> return c, nil
<mask> }
<mask>
<mask> func TestWhois(t *testing.T) {
<mask> const (
<mask> nl = "\n"
<mask> data = `OrgName: FakeOrg LLC` + nl +
<mask> `City: Nonreal` + nl +
<mask> `Country: Imagiland` + nl
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func (w *Whois) query(ctx context.Context, target, serverAddr string) (data string, err error) {
</s> add func (w *WHOIS) query(ctx context.Context, target, serverAddr string) (data string, err error) { </s> remove func (w *Whois) queryAll(ctx context.Context, target string) (string, error) {
</s> add func (w *WHOIS) queryAll(ctx context.Context, target string) (string, error) { </s> remove // isWhoisComment returns true if the string is empty or is a WHOIS comment.
func isWhoisComment(s string) (ok bool) {
</s> add // isWHOISComment returns true if the string is empty or is a WHOIS comment.
func isWHOISComment(s string) (ok bool) { </s> remove func TestWhoisParse(t *testing.T) {
</s> add func TestWHOISParse(t *testing.T) { </s> remove whois := &querylog.ClientWhois{}
</s> add whois := &querylog.ClientWHOIS{} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois_test.go |
w := WHOIS{ | <mask> fc := &fakeConn{
<mask> data: []byte(data),
<mask> }
<mask>
<mask> w := Whois{
<mask> timeoutMsec: 5000,
<mask> dialContext: fc.fakeDial,
<mask> }
<mask> resp, err := w.queryAll(context.Background(), "1.2.3.4")
<mask> assert.NoError(t, err)
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // initWhois creates the Whois module context.
func initWhois(clients *clientsContainer) *Whois {
w := Whois{
</s> add // initWHOIS creates the WHOIS module context.
func initWHOIS(clients *clientsContainer) *WHOIS {
w := WHOIS{ </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove log.Debug("Whois: received response (%d bytes) from %s IP:%s", len(resp), server, target)
</s> add log.Debug("whois: received response (%d bytes) from %s IP:%s", len(resp), server, target) </s> remove handleMobileConfigDOH(w, r)
</s> add handleMobileConfigDoH(w, r) </s> remove handleMobileConfigDOT(w, r)
</s> add handleMobileConfigDoT(w, r) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois_test.go |
func TestWHOISParse(t *testing.T) { | <mask> assert.Equal(t, "Imagiland", m["country"])
<mask> assert.Equal(t, "Nonreal", m["city"])
<mask> }
<mask>
<mask> func TestWhoisParse(t *testing.T) {
<mask> const (
<mask> city = "Nonreal"
<mask> country = "Imagiland"
<mask> orgname = "FakeOrgLLC"
<mask> whois = "whois.example.net"
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove func TestWhois(t *testing.T) {
</s> add func TestWHOIS(t *testing.T) { </s> remove func TestHandleMobileConfigDOT(t *testing.T) {
</s> add func TestHandleMobileConfigDoT(t *testing.T) { </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove assert.Equal(t, h.WhoisInfo, whois)
</s> add assert.Equal(t, h.WHOISInfo, whois) </s> remove whois = toQueryLogWhois(rc.WhoisInfo)
</s> add whois = toQueryLogWHOIS(rc.WHOISInfo) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/home/whois_test.go |
WHOIS *ClientWHOIS `json:"whois,omitempty"` | <mask>
<mask> // Client is the information required by the query log to match against clients
<mask> // during searches.
<mask> type Client struct {
<mask> Whois *ClientWhois `json:"whois,omitempty"`
<mask> Name string `json:"name"`
<mask> DisallowedRule string `json:"disallowed_rule"`
<mask> Disallowed bool `json:"disallowed"`
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. </s> remove WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
</s> add WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info"` </s> remove WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
</s> add WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info,omitempty"` </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/querylog/client.go |
// ClientWHOIS is the filtered WHOIS data for the client. | <mask> DisallowedRule string `json:"disallowed_rule"`
<mask> Disallowed bool `json:"disallowed"`
<mask> }
<mask>
<mask> // ClientWhois is the filtered WHOIS data for the client.
<mask> //
<mask> // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
<mask> // refactoring is done.
<mask> type ClientWhois struct {
<mask> City string `json:"city,omitempty"`
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add WHOISInfo *RuntimeClientWHOISInfo | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/querylog/client.go |
// TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the | <mask> }
<mask>
<mask> // ClientWhois is the filtered WHOIS data for the client.
<mask> //
<mask> // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
<mask> // refactoring is done.
<mask> type ClientWhois struct {
<mask> City string `json:"city,omitempty"`
<mask> Country string `json:"country,omitempty"`
<mask> Orgname string `json:"orgname,omitempty"`
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove type ClientWhois struct {
</s> add type ClientWHOIS struct { </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add WHOISInfo *RuntimeClientWHOISInfo </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/querylog/client.go |
type ClientWHOIS struct { | <mask> // ClientWhois is the filtered WHOIS data for the client.
<mask> //
<mask> // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
<mask> // refactoring is done.
<mask> type ClientWhois struct {
<mask> City string `json:"city,omitempty"`
<mask> Country string `json:"country,omitempty"`
<mask> Orgname string `json:"orgname,omitempty"`
<mask> }
<mask>
</s> Pull request: all: imp docs, names
Merge in DNS/adguard-home from imp-text to master
Squashed commit of the following:
commit fa7d64014fb2ac379e1c137eaccc7aefca86419d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 11 17:09:00 2021 +0300
all: imp docs, names </s> remove // TODO(a.garipov): Merge with home.RuntimeClientWhoisInfo after the
</s> add // TODO(a.garipov): Merge with home.RuntimeClientWHOISInfo after the </s> remove // ClientWhois is the filtered WHOIS data for the client.
</s> add // ClientWHOIS is the filtered WHOIS data for the client. </s> remove // RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
</s> add // RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWHOISInfo struct { </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add WHOISInfo *RuntimeClientWHOISInfo </s> remove Whois *ClientWhois `json:"whois,omitempty"`
</s> add WHOIS *ClientWHOIS `json:"whois,omitempty"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/dab7b439d1f2ab6f3d7ad25c1ca6b0f002fc8ddd | internal/querylog/client.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.