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
<mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/AdguardTeam/golibs/cache" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/filtering/safebrowsing.go
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/AdguardTeam/golibs/cache" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com/miekg/dns" <mask> "golang.org/x/exp/sl...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/filtering/safebrowsing.go
<mask> ) <mask> <mask> // Safe browsing and parental control methods. <mask> <mask> // TODO(a.garipov): Make configurable. <mask> const ( <mask> dnsTimeout = 3 * time.Second <mask> defaultSafebrowsingServer = `https://family.adguard-dns.com/dns-query` <mask> defaultParentalServer = `htt...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/filtering/safebrowsing.go
<mask> timer := log.StartTimer() <mask> defer timer.LogElapsed("safebrowsing lookup for %q", host) <mask> } <mask> <mask> sctx := &sbCtx{ <mask> host: host, <mask> svc: "SafeBrowsing", <mask> cache: d.safebrowsingCache, <mask> cacheTime: d.Config.CacheTime, <mask> } <mask> <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/filtering/safebrowsing.go
block, err := d.safeBrowsingChecker.Check(host) if !block || err != nil { return Result{}, err } return res, nil
<mask> Reason: FilteredSafeBrowsing, <mask> IsFiltered: true, <mask> } <mask> <mask> return check(sctx, res, d.safeBrowsingUpstream) <mask> } <mask> <mask> // TODO(a.garipov): Unify with checkSafeBrowsing. <mask> func (d *DNSFilter) checkParental( <mask> host string, </s> Pull request 1837: AG-2...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/filtering/safebrowsing.go
<mask> timer := log.StartTimer() <mask> defer timer.LogElapsed("parental lookup for %q", host) <mask> } <mask> <mask> sctx := &sbCtx{ <mask> host: host, <mask> svc: "Parental", <mask> cache: d.parentalCache, <mask> cacheTime: d.Config.CacheTime, <mask> } <mask> <mask> res = ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/filtering/safebrowsing.go
block, err := d.parentalControlChecker.Check(host) if !block || err != nil { return Result{}, err } return res, nil
<mask> Reason: FilteredParental, <mask> IsFiltered: true, <mask> } <mask> <mask> return check(sctx, res, d.parentalUpstream) <mask> } <mask> <mask> // setProtectedBool sets the value of a boolean pointer under a lock. l must <mask> // protect the value under ptr. <mask> // </s> Pull request 1837...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/filtering/safebrowsing.go
"github.com/AdguardTeam/AdGuardHome/internal/filtering/hashprefix"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering" <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering/safesearch" <mask> "github.com/AdguardTeam/AdGuardHome/internal/querylog" <mask> "github.com/AdguardTeam/AdGuardHome/inte...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/home/home.go
"github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/stats" <mask> "github.com/AdguardTeam/AdGuardHome/internal/updater" <mask> "github.com/AdguardTeam/AdGuardHome/internal/version" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/381f2f651d1a94d29bf534185e531b05a755f16c
internal/home/home.go
"github.com/AdguardTeam/urlfilter/rules"
<mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com/AdguardTeam/urlfilter" <mask> "github.com/AdguardTeam/urlfilter/filterlist" <mask> ) <mask> <mask> // unit is a convenient alias for struct{} <mask> type unit = struct{} <mask> </s> Pull reque...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access.go
func (a *accessManager) isBlockedHost(host string, qt rules.RRType) (ok bool) { _, ok = a.blockedHostsEng.MatchRequest(&urlfilter.DNSRequest{ Hostname: host, ClientIP: "0.0.0.0", DNSType: qt, })
<mask> return a.blockedClientIDs.Has(id) <mask> } <mask> <mask> // isBlockedHost returns true if host should be blocked. <mask> func (a *accessManager) isBlockedHost(host string) (ok bool) { <mask> _, ok = a.blockedHostsEng.Match(strings.ToLower(host)) <mask> <mask> return ok <mask> } <mask> <mask> // ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access.go
"github.com/AdguardTeam/urlfilter/rules" "github.com/miekg/dns"
<mask> "testing" <mask> <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestIsBlockedClientID(t *testing.T) { </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75b...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
"||*^$dnstype=HTTPS",
<mask> "*.host.com", <mask> "||host3.com^", <mask> }) <mask> require.NoError(t, err) <mask> <mask> testCases := []struct { <mask> want assert.BoolAssertionFunc </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want assert.BoolAssertionFunc
<mask> }) <mask> require.NoError(t, err) <mask> <mask> testCases := []struct { <mask> name string <mask> host string <mask> qt rules.RRType <mask> }{{ <mask> want: assert.True, </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt rules.RRType
<mask> <mask> testCases := []struct { <mask> name string <mask> host string <mask> want bool <mask> }{{ <mask> name: "plain_match", <mask> host: "host1", <mask> want: true, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit e...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.True,
<mask> name string <mask> host string <mask> qt rules.RRType <mask> }{{ <mask> name: "plain_match", <mask> host: "host1", <mask> qt: dns.TypeA, <mask> }, { <mask> want: assert.False, <mask> name: "plain_mismatch", </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA,
<mask> want bool <mask> }{{ <mask> name: "plain_match", <mask> host: "host1", <mask> want: true, <mask> }, { <mask> name: "plain_mismatch", <mask> host: "host2", <mask> want: false, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following:...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.False,
<mask> qt: dns.TypeA, <mask> }, { <mask> name: "plain_mismatch", <mask> host: "host2", <mask> qt: dns.TypeA, <mask> }, { <mask> want: assert.True, </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad A...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA,
<mask> want: true, <mask> }, { <mask> name: "plain_mismatch", <mask> host: "host2", <mask> want: false, <mask> }, { <mask> name: "subdomain_match_short", <mask> host: "asdf.host.com", <mask> want: true, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed com...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.True,
<mask> host: "host2", <mask> qt: dns.TypeA, <mask> }, { <mask> name: "subdomain_match_short", <mask> host: "asdf.host.com", <mask> qt: dns.TypeA, <mask> }, { <mask> want: assert.True, <mask> name: "subdomain_match_long", </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squa...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA,
<mask> want: false, <mask> }, { <mask> name: "subdomain_match_short", <mask> host: "asdf.host.com", <mask> want: true, <mask> }, { <mask> name: "subdomain_match_long", <mask> host: "qwer.asdf.host.com", <mask> want: true, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.True,
<mask> host: "asdf.host.com", <mask> qt: dns.TypeA, <mask> }, { <mask> name: "subdomain_match_long", <mask> host: "qwer.asdf.host.com", <mask> qt: dns.TypeA, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa7...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA,
<mask> want: true, <mask> }, { <mask> name: "subdomain_match_long", <mask> host: "qwer.asdf.host.com", <mask> want: true, <mask> }, { <mask> name: "subdomain_mismatch_no_lead", <mask> host: "host.com", <mask> want: false, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.False,
<mask> qt: dns.TypeA, <mask> }, { <mask> name: "subdomain_mismatch_no_lead", <mask> host: "host.com", <mask> qt: dns.TypeA, <mask> }, { <mask> want: assert.False, <mask> name: "subdomain_mismatch_bad_asterisk", </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit o...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA,
<mask> want: true, <mask> }, { <mask> name: "subdomain_mismatch_no_lead", <mask> host: "host.com", <mask> want: false, <mask> }, { <mask> name: "subdomain_mismatch_bad_asterisk", <mask> host: "asdf.zhost.com", <mask> want: false, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype U...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.False,
<mask> qt: dns.TypeA, <mask> }, { <mask> name: "subdomain_mismatch_bad_asterisk", <mask> host: "asdf.zhost.com", <mask> qt: dns.TypeA, <mask> }, { <mask> want: assert.True, </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA,
<mask> want: false, <mask> }, { <mask> name: "subdomain_mismatch_bad_asterisk", <mask> host: "asdf.zhost.com", <mask> want: false, <mask> }, { <mask> name: "rule_match_simple", <mask> host: "host3.com", <mask> want: true, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.True,
<mask> name: "subdomain_mismatch_bad_asterisk", <mask> host: "asdf.zhost.com", <mask> qt: dns.TypeA, <mask> }, { <mask> name: "rule_match_simple", <mask> host: "host3.com", <mask> qt: dns.TypeA, <mask> }, { <mask> want: assert.True, <mask> name: "rule_match_complex", </s> Pull request 1...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA,
<mask> want: false, <mask> }, { <mask> name: "rule_match_simple", <mask> host: "host3.com", <mask> want: true, <mask> }, { <mask> name: "rule_match_complex", <mask> host: "asdf.host3.com", <mask> want: true, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashe...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.True,
<mask> host: "host3.com", <mask> qt: dns.TypeA, <mask> }, { <mask> name: "rule_match_complex", <mask> host: "asdf.host3.com", <mask> qt: dns.TypeA, <mask> }, { <mask> want: assert.False, </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA,
<mask> want: true, <mask> }, { <mask> name: "rule_match_complex", <mask> host: "asdf.host3.com", <mask> want: true, <mask> }, { <mask> name: "rule_mismatch", <mask> host: ".host3.com", <mask> want: false, <mask> }} </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed com...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
want: assert.False,
<mask> qt: dns.TypeA, <mask> }, { <mask> name: "rule_mismatch", <mask> host: ".host3.com", <mask> qt: dns.TypeA, <mask> }, { <mask> want: assert.True, <mask> name: "by_qtype", </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
qt: dns.TypeA, }, { want: assert.True, name: "by_qtype", host: "site-with-https-record.example", qt: dns.TypeHTTPS, }, { want: assert.False, name: "by_qtype_other", host: "site-with-https-record.example", qt: dns.TypeA,
<mask> want: true, <mask> }, { <mask> name: "rule_mismatch", <mask> host: ".host3.com", <mask> want: false, <mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { <mask> assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> Pull request 1750: 5468...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
tc.want(t, a.isBlockedHost(tc.host, tc.qt))
<mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name, func(t *testing.T) { <mask> assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) <mask> }) <mask> } <mask> } <mask> <mask> func TestIsBlockedIP(t *testing.T) { </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
ip netip.Addr
<mask> require.NoError(t, err) <mask> <mask> testCases := []struct { <mask> name string <mask> wantRule string <mask> wantBlocked bool <mask> }{{ </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099a...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
<mask> <mask> testCases := []struct { <mask> name string <mask> wantRule string <mask> ip netip.Addr <mask> wantBlocked bool <mask> }{{ <mask> name: "match_ip", <mask> wantRule: "1.2.3.4", <mask> ip: netip.MustParseAddr("1.2.3.4"), </s> Pull request 1750...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
ip: netip.MustParseAddr("1.2.3.4"),
<mask> wantRule string <mask> wantBlocked bool <mask> }{{ <mask> name: "match_ip", <mask> wantRule: "1.2.3.4", <mask> wantBlocked: true, <mask> }, { <mask> ip: netip.MustParseAddr("5.6.7.100"), <mask> name: "match_cidr", </s> Pull request 1750: 5468-disallowed-dnst...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
<mask> wantBlocked bool <mask> }{{ <mask> name: "match_ip", <mask> wantRule: "1.2.3.4", <mask> ip: netip.MustParseAddr("1.2.3.4"), <mask> wantBlocked: true, <mask> }, { <mask> name: "match_cidr", <mask> wantRule: "5.6.7.8/24", <mask> ip: netip.MustParseA...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
ip: netip.MustParseAddr("5.6.7.100"),
<mask> wantRule: "1.2.3.4", <mask> wantBlocked: true, <mask> }, { <mask> name: "match_cidr", <mask> wantRule: "5.6.7.8/24", <mask> wantBlocked: true, <mask> }, { </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
<mask> wantBlocked: true, <mask> }, { <mask> name: "match_cidr", <mask> wantRule: "5.6.7.8/24", <mask> ip: netip.MustParseAddr("5.6.7.100"), <mask> wantBlocked: true, <mask> }, { <mask> name: "no_match_ip", <mask> wantRule: "", <mask> ip: netip.MustParse...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
ip: netip.MustParseAddr("9.2.3.4"),
<mask> wantBlocked: true, <mask> }, { <mask> name: "no_match_ip", <mask> wantRule: "", <mask> wantBlocked: false, <mask> }, { <mask> ip: netip.MustParseAddr("9.6.7.100"), <mask> name: "no_match_cidr", </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squas...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
<mask> wantBlocked: true, <mask> }, { <mask> name: "no_match_ip", <mask> wantRule: "", <mask> ip: netip.MustParseAddr("9.2.3.4"), <mask> wantBlocked: false, <mask> }, { <mask> name: "no_match_cidr", <mask> wantRule: "", <mask> ip: netip.MustParseAddr("9....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
ip: netip.MustParseAddr("9.6.7.100"),
<mask> wantBlocked: false, <mask> }, { <mask> name: "no_match_cidr", <mask> wantRule: "", <mask> wantBlocked: false, <mask> }} <mask> </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: A...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
<mask> wantBlocked: false, <mask> }, { <mask> name: "no_match_cidr", <mask> wantRule: "", <mask> ip: netip.MustParseAddr("9.6.7.100"), <mask> wantBlocked: false, <mask> }} <mask> <mask> t.Run("allow", func(t *testing.T) { <mask> for _, tc := range testCases { </s> Pull requ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/access_test.go
q := pctx.Req.Question[0] qt := q.Qtype host := strings.TrimSuffix(q.Name, ".") if s.access.isBlockedHost(host, qt) { log.Debug("request %s %s is in access blocklist", dns.Type(qt), host)
<mask> return s.preBlockedResponse(pctx) <mask> } <mask> <mask> if len(pctx.Req.Question) == 1 { <mask> host := strings.TrimSuffix(pctx.Req.Question[0].Name, ".") <mask> if s.access.isBlockedHost(host) { <mask> log.Debug("host %s is in access blocklist", host) <mask> <mask> return s.preBlockedR...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/386add033b91e3110c822369fa91629d9006436c
internal/dnsforward/filter.go
dispatch(getTlsStatus());
<mask> <mask> await apiClient.setTlsConfig(values); <mask> dispatch(setTlsConfigSuccess(config)); <mask> dispatch(addSuccessToast('encryption_config_saved')); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(setTlsConfigFailure()); ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/38983097785c3d7f37c99cc2560512c4b342a201
client/src/actions/index.js
{encryption &&
<mask> } = encryption; <mask> <mask> return ( <mask> <div className="encryption"> <mask> {encryption && !encryption.processing && <mask> <Card <mask> title={t('encryption_title')} <mask> subtitle={t(...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/38983097785c3d7f37c99cc2560512c4b342a201
client/src/components/Settings/Encryption/index.js
status_cert: '', status_key: '',
<mask> processing: true, <mask> processingConfig: false, <mask> }); <mask> <mask> export default combineReducers({ <mask> settings, <mask> dashboard, </s> Request tls status after save </s> remove {encryption && !encryption.processing && </s> add {encryption &&
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/38983097785c3d7f37c99cc2560512c4b342a201
client/src/reducers/index.js
"context"
<mask> <mask> import ( <mask> "encoding/binary" <mask> "fmt" <mask> "io/ioutil" <mask> "net" <mask> "strings" </s> * whois: use the upstream server to resolve whois server hostname Close #1535 Squashed commit of the following: commit 7755d7a50e48db5d341029e1c21da95a396d9090 Merge: e24e945f 5c2ca690 Auth...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/391e619979e1849947d55eac78a6664745e4d288
home/whois.go
conn, err := customDialContext(context.TODO(), "tcp", serverAddr)
<mask> addr, _, _ := net.SplitHostPort(serverAddr) <mask> if addr == "whois.arin.net" { <mask> target = "n + " + target <mask> } <mask> conn, err := net.DialTimeout("tcp", serverAddr, time.Duration(w.timeoutMsec)*time.Millisecond) <mask> if err != nil { <mask> return "", err <mask> } <mask> defer co...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/391e619979e1849947d55eac78a6664745e4d288
home/whois.go
"time"
<mask> <mask> import ( <mask> "testing" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/stretchr/testify/assert" </s> * whois: use the upstream server to resolve whois server hostname Close #1535 Squashed commit of the follow...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/391e619979e1849947d55eac78a6664745e4d288
home/whois_test.go
"github.com/AdguardTeam/AdGuardHome/dnsforward" "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "time" <mask> <mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func prepareTestDNSServer() error { <mask> config.DNS.Port = 1234 </s> * whois: use the upstream server to resolve whois server hostname Close #1535 Squashed commit of the following: commit 7755d7a50e48db5d341029e1c21...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/391e619979e1849947d55eac78a6664745e4d288
home/whois_test.go
func prepareTestDNSServer() error { config.DNS.Port = 1234 Context.dnsServer = dnsforward.NewServer(nil, nil, nil) conf := &dnsforward.ServerConfig{} uc, err := proxy.ParseUpstreamsConfig([]string{"1.1.1.1"}, nil, time.Second*5) if err != nil { return err } conf.UpstreamConfig = &uc return Context.dnsServer.P...
<mask> ) <mask> <mask> func TestWhois(t *testing.T) { <mask> err := prepareTestDNSServer() <mask> assert.Nil(t, err) <mask> <mask> w := Whois{timeoutMsec: 5000} <mask> resp, err := w.queryAll("8.8.8.8") </s> * whois: use the upstream server to resolve whois server hostname Close #1535 Squashed commit of...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/391e619979e1849947d55eac78a6664745e4d288
home/whois_test.go
err := prepareTestDNSServer() assert.Nil(t, err)
<mask> <mask> func TestWhois(t *testing.T) { <mask> w := Whois{timeoutMsec: 5000} <mask> resp, err := w.queryAll("8.8.8.8") <mask> assert.True(t, err == nil) <mask> m := whoisParse(resp) <mask> assert.True(t, m["orgname"] == "Google LLC") </s> * whois: use the upstream server to resolve whois server hostn...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/391e619979e1849947d55eac78a6664745e4d288
home/whois_test.go
controlLock.Lock() cached := now.Sub(versionCheckLastTime) <= versionCheckPeriod && len(versionCheckJSON) != 0 data := versionCheckJSON controlLock.Unlock() if cached {
<mask> } <mask> } <mask> <mask> // Set necessary properties <mask> f.ID = assignUniqueFilterID() <mask> f.Enabled = true <mask> <mask> // Download the filter contents <mask> ok, err := f.update(true) <mask> if err != nil { </s> - control: fix race in /control/version.json handler </s> remove w.W...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/392c7b6ee19ed38650fc9d7f4f3750d965e94da5
control.go
w.Write(data)
<mask> now := time.Now() <mask> if now.Sub(versionCheckLastTime) <= versionCheckPeriod && len(versionCheckJSON) != 0 { <mask> // return cached copy <mask> w.Header().Set("Content-Type", "application/json") <mask> w.Write(versionCheckJSON) <mask> return <mask> } <mask> <mask> resp, err := client.Ge...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/392c7b6ee19ed38650fc9d7f4f3750d965e94da5
control.go
controlLock.Lock()
<mask> if err != nil { <mask> httpError(w, http.StatusInternalServerError, "Couldn't write body: %s", err) <mask> } <mask> <mask> versionCheckLastTime = now <mask> versionCheckJSON = body <mask> controlLock.Unlock() <mask> } <mask> </s> - control: fix race in /control/version.json handler </s> remove...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/392c7b6ee19ed38650fc9d7f4f3750d965e94da5
control.go
controlLock.Unlock()
<mask> <mask> controlLock.Lock() <mask> versionCheckLastTime = now <mask> versionCheckJSON = body <mask> } <mask> <mask> // --------- <mask> // filtering <mask> // --------- <mask> </s> - control: fix race in /control/version.json handler </s> remove f.ID = assignUniqueFilterID() </s> add controlLoc...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/392c7b6ee19ed38650fc9d7f4f3750d965e94da5
control.go
CHANNEL ?= release
<mask> NATIVE_GOARCH = $(shell unset GOARCH; go env GOARCH) <mask> GOPATH := $(shell go env GOPATH) <mask> JSFILES = $(shell find client -path client/node_modules -prune -o -type f -name '*.js') <mask> STATIC = build/static/index.html <mask> <mask> TARGET=AdGuardHome <mask> <mask> .PHONY: all build clean <ma...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/395833056097fa44c1221da33319cd64e4a5ca62
Makefile
CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION) -X main.updateChannel=$(CHANNEL)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)"
<mask> <mask> $(TARGET): $(STATIC) *.go dhcpd/*.go dnsfilter/*.go dnsforward/*.go <mask> GOOS=$(NATIVE_GOOS) GOARCH=$(NATIVE_GOARCH) GO111MODULE=off go get -v github.com/gobuffalo/packr/... <mask> PATH=$(GOPATH)/bin:$(PATH) packr -z <mask> CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERS...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/395833056097fa44c1221da33319cd64e4a5ca62
Makefile
"time"
<mask> "strings" <mask> "sync" <mask> "syscall" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/NYTimes/gziphandler" <mask> "github.com/gobuffalo/packr" <mask> ) </s> Fix #773 - preparing the new update channel </s> remove const versionCheckURL = "https://adguardteam.github.io/AdGua...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/395833056097fa44c1221da33319cd64e4a5ca62
app.go
// updateChannel can be set via ldflags var updateChannel = "release" var versionCheckURL = "https://static.adguard.com/adguardhome/" + updateChannel + "/version.json" const versionCheckPeriod = time.Hour * 8
<mask> <mask> // VersionString will be set through ldflags, contains current version <mask> var VersionString = "undefined" <mask> var httpServer *http.Server <mask> var httpsServer struct { <mask> server *http.Server <mask> cond *sync.Cond // reacts to config.TLS.Enabled, PortHTTPS, CertificateChai...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/395833056097fa44c1221da33319cd64e4a5ca62
app.go
log.Printf("AdGuard Home, version %s, channel %s\n", VersionString, updateChannel)
<mask> // enable TLS 1.3 <mask> enableTLS13() <mask> <mask> // print the first message after logger is configured <mask> log.Printf("AdGuard Home, version %s\n", VersionString) <mask> log.Debug("Current working directory is %s", config.ourWorkingDir) <mask> if args.runningAsService { <mask> log.Info("A...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/395833056097fa44c1221da33319cd64e4a5ca62
app.go
<mask> var versionCheckLastTime time.Time <mask> <mask> var protocols = []string{"tls://", "https://", "tcp://", "sdns://"} <mask> <mask> const versionCheckURL = "https://adguardteam.github.io/AdGuardHome/version.json" <mask> const versionCheckPeriod = time.Hour * 8 <mask> <mask> var transport = &http.Transp...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/395833056097fa44c1221da33319cd64e4a5ca62
control.go
<mask> // Initialize and run the admin Web interface <mask> box := packr.NewBox("build/static") <mask> // if not configured, redirect / to /install.html, otherwise redirect /install.html to / <mask> http.Handle("/", postInstallHandler(optionalAuthHandler(http.FileServer(box)))) <mask> http.Handle("/install.ht...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/398312cd80537d49b3c8752425ab7fd8358c7bc0
app.go
// add handlers for /install paths, we only need them when we're not configured yet if config.firstRun { http.Handle("/install.html", preInstallHandler(http.FileServer(box))) registerInstallHandlers() }
<mask> http.Handle("/", postInstallHandler(optionalAuthHandler(http.FileServer(box)))) <mask> registerControlHandlers() <mask> <mask> // this loop is used as an ability to change listening host and/or port <mask> for { <mask> address := net.JoinHostPort(config.BindHost, strconv.Itoa(config.BindPort)) <mas...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/398312cd80537d49b3c8752425ab7fd8358c7bc0
app.go
func registerInstallHandlers() { http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(handleInstallGetAddresses))) http.HandleFunc("/control/install/configure", preInstall(ensurePOST(handleInstallConfigure))) }
<mask> } <mask> <mask> func registerControlHandlers() { <mask> http.HandleFunc("/control/status", postInstall(optionalAuth(ensureGET(handleStatus)))) <mask> http.HandleFunc("/control/enable_protection", postInstall(optionalAuth(ensurePOST(handleProtectionEnable)))) <mask> http.HandleFunc("/control/disable_pro...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/398312cd80537d49b3c8752425ab7fd8358c7bc0
control.go
<mask> http.HandleFunc("/control/dhcp/status", postInstall(optionalAuth(ensureGET(handleDHCPStatus)))) <mask> http.HandleFunc("/control/dhcp/interfaces", postInstall(optionalAuth(ensureGET(handleDHCPInterfaces)))) <mask> http.HandleFunc("/control/dhcp/set_config", postInstall(optionalAuth(ensurePOST(handleDHCPSet...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/398312cd80537d49b3c8752425ab7fd8358c7bc0
control.go
"disabled_safe_browsing_toast": "Disabled Safe Browsing", "enabled_safe_browsing_toast": "Enabled Safe Browsing",
<mask> "upstreams": "Upstreams", <mask> "apply_btn": "Apply", <mask> "disabled_filtering_toast": "Disabled filtering", <mask> "enabled_filtering_toast": "Enabled filtering", <mask> "disabled_safe_browsing_toast": "Disabled safebrowsing", <mask> "enabled_safe_browsing_toast": "Enabled safeb...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39c4999d2d3d78eb6a1de4fc29d464767965043e
client/src/__locales/en.json
"blocked_safebrowsing": "Blocked by Safe Browsing", "blocked_adult_websites": "Blocked by Parental Control",
<mask> "all_queries": "All queries", <mask> "show_blocked_responses": "Blocked", <mask> "show_whitelisted_responses": "Allowed", <mask> "show_processed_responses": "Processed", <mask> "blocked_safebrowsing": "Blocked by Safebrowsing", <mask> "blocked_adult_websites": "Blocked Adult Website...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39c4999d2d3d78eb6a1de4fc29d464767965043e
client/src/__locales/en.json
"parental_control": "Parental Control", "safe_browsing": "Safe Browsing",
<mask> "filter_allowlist": "WARNING: This action also will exclude the rule \"{{disallowed_rule}}\" from the list of allowed clients.", <mask> "last_rule_in_allowlist": "Cannot disallow this client because excluding the rule \"{{disallowed_rule}}\" will DISABLE \"Allowed clients\" list.", <mask> "experim...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39c4999d2d3d78eb6a1de4fc29d464767965043e
client/src/__locales/en.json
/^[^[:space:]]/ { is_http = /^http:/ }
<mask> # Don't consider the HTTPS hostname since the enforced HTTPS redirection should <mask> # work if the SSL check skipped. See file docker/healthcheck.sh. <mask> /^bind_host:/ { host = $2 } <mask> <mask> /^bind_port:/ { port = $2 } <mask> <mask> END { <mask> if (match(host, ":")) { </s> Pull request...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
docker/web-bind.awk
/^[[:space:]]+address:/ { if (is_http) print "http://" $2 }
<mask> # Don't consider the HTTPS hostname since the enforced HTTPS redirection should <mask> # work if the SSL check skipped. See file docker/healthcheck.sh. <mask> /^bind_host:/ { host = $2 } <mask> <mask> /^bind_port:/ { port = $2 } <mask> <mask> END { <mask> if (match(host, ":")) { <mask> pr...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
docker/web-bind.awk
// configuration is loaded from YAML. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary.
<mask> DHCP bool `yaml:"dhcp"` <mask> HostsFile bool `yaml:"hosts"` <mask> } <mask> <mask> // configuration is loaded from YAML <mask> // field ordering is important -- yaml fields will mirror ordering from here <mask> type configuration struct { <mask> // Raw file data to avoid re-reading of configura...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/config.go
// HTTPConfig is the block with http conf. HTTPConfig httpConfig `yaml:"http"`
<mask> // Raw file data to avoid re-reading of configuration file <mask> // It's reset after config is parsed <mask> fileData []byte <mask> <mask> // BindHost is the address for the web interface server to listen on. <mask> BindHost netip.Addr `yaml:"bind_host"` <mask> // BindPort is the port for the web ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/config.go
<mask> Theme Theme `yaml:"theme"` <mask> // DebugPProf defines if the profiling HTTP handler will listen on :6060. <mask> DebugPProf bool `yaml:"debug_pprof"` <mask> <mask> // TTL for a web session (in hours) <mask> // An active session is automatically refreshed once a day. <mask> WebSessionTTLHours uint...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/config.go
// httpConfig is a block with HTTP configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. type httpConfig struct { // Address is the address to serve the web UI on. Address netip.AddrPort // SessionTTL for a web session. // An active se...
<mask> <mask> SchemaVersion int `yaml:"schema_version"` // keeping last so that users will be less tempted to change it -- used when upgrading between versions <mask> } <mask> <mask> // field ordering is important -- yaml fields will mirror ordering from here <mask> type dnsConfig struct { <mask> BindHosts [...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/config.go
AuthAttempts: 5, AuthBlockMin: 15, HTTPConfig: httpConfig{ Address: netip.AddrPortFrom(netip.IPv4Unspecified(), 3000), SessionTTL: timeutil.Duration{Duration: 30 * timeutil.Day}, },
<mask> // config is the global configuration structure. <mask> // <mask> // TODO(a.garipov, e.burkov): This global is awful and must be removed. <mask> var config = &configuration{ <mask> BindPort: 3000, <mask> BindHost: netip.IPv4Unspecified(), <mask> AuthAttempts: 5, <mask> AuthB...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/config.go
if !conf.HTTPConfig.Address.IsValid() { return errors.Error("http.address is not a valid ip address")
<mask> <mask> // validateBindHosts returns error if any of binding hosts from configuration is <mask> // not a valid IP address. <mask> func validateBindHosts(conf *configuration) (err error) { <mask> if !conf.BindHost.IsValid() { <mask> return errors.Error("bind_host is not a valid ip address") <mask> } <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/config.go
addPorts(tcpPorts, tcpPort(config.HTTPConfig.Address.Port()))
<mask> return err <mask> } <mask> <mask> tcpPorts := aghalg.UniqChecker[tcpPort]{} <mask> addPorts(tcpPorts, tcpPort(config.BindPort)) <mask> <mask> udpPorts := aghalg.UniqChecker[udpPort]{} <mask> addPorts(udpPorts, udpPort(config.DNS.Port)) <mask> <mask> if config.TLS.Enabled { </s> Pull request...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/config.go
HTTPPort uint16 `json:"http_port"`
<mask> Version string `json:"version"` <mask> Language string `json:"language"` <mask> DNSAddrs []string `json:"dns_addresses"` <mask> DNSPort int `json:"dns_port"` <mask> HTTPPort int `json:"http_port"` <mask> <mask> // ProtectionDisabledDuration is the duration of the protection pause in...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/control.go
HTTPPort: config.HTTPConfig.Address.Port(),
<mask> Version: version.Version(), <mask> Language: config.Language, <mask> DNSAddrs: dnsAddrs, <mask> DNSPort: config.DNS.Port, <mask> HTTPPort: config.BindPort, <mask> ProtectionDisabledDuration: protec...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/control.go
// TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort)
<mask> // be set. <mask> func (req *checkConfReq) validateWeb(tcpPorts aghalg.UniqChecker[tcpPort]) (err error) { <mask> defer func() { err = errors.Annotate(err, "validating ports: %w") }() <mask> <mask> portInt := req.Web.Port <mask> port := tcpPort(portInt) <mask> addPorts(tcpPorts, port) <mask> if err...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlinstall.go
switch reqPort { case 0, config.HTTPConfig.Address.Port():
<mask> <mask> return err <mask> } <mask> <mask> switch portInt { <mask> case 0, config.BindPort: <mask> return nil <mask> default: <mask> // Go on and check the port binding only if it's not zero or won't be <mask> // unbound after install. <mask> } </s> Pull request: home: http conf Updates...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlinstall.go
return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort))
<mask> // Go on and check the port binding only if it's not zero or won't be <mask> // unbound after install. <mask> } <mask> <mask> return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) <mask> } <mask> <mask> // validateDNS returns error if the DNS part of the initial configur...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlinstall.go
port := uint16(req.DNS.Port)
<mask> tcpPorts aghalg.UniqChecker[tcpPort], <mask> ) (canAutofix bool, err error) { <mask> defer func() { err = errors.Annotate(err, "validating ports: %w") }() <mask> <mask> port := req.DNS.Port <mask> switch port { <mask> case 0: <mask> return false, nil <mask> case config.BindPort: <mask> // Go...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlinstall.go
case config.HTTPConfig.Address.Port():
<mask> port := req.DNS.Port <mask> switch port { <mask> case 0: <mask> return false, nil <mask> case config.BindPort: <mask> // Go on and only check the UDP port since the TCP one is already bound <mask> // by AdGuard Home for web interface. <mask> default: <mask> // Check TCP as well. <mask> a...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlinstall.go
dst.HTTPConfig = src.HTTPConfig
<mask> <mask> // copyInstallSettings copies the installation parameters between two <mask> // configuration structures. <mask> func copyInstallSettings(dst, src *configuration) { <mask> dst.BindHost = src.BindHost <mask> dst.BindPort = src.BindPort <mask> dst.DNS.BindHosts = src.DNS.BindHosts <mask> dst.DN...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlinstall.go
config.HTTPConfig.Address = netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port))
<mask> curConfig := &configuration{} <mask> copyInstallSettings(curConfig, config) <mask> <mask> Context.firstRun = false <mask> config.BindHost = req.Web.IP <mask> config.BindPort = req.Web.Port <mask> config.DNS.BindHosts = []netip.Addr{req.DNS.IP} <mask> config.DNS.Port = req.DNS.Port <mask> <mask...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlinstall.go
addrPort := config.HTTPConfig.Address restartHTTP = addrPort.Addr() != req.Web.IP || int(addrPort.Port()) != req.Web.Port
<mask> if req.Web.Port == 0 || req.DNS.Port == 0 { <mask> return nil, false, errors.Error("ports cannot be 0") <mask> } <mask> <mask> restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port <mask> if restartHTTP { <mask> err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP,...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlinstall.go
if tlsConfUsesPrivilegedPorts(tlsConf) || config.HTTPConfig.Address.Port() < 1024 || config.DNS.Port < 1024 {
<mask> tlsConf := &tlsConfigSettings{} <mask> Context.tls.WriteDiskConfig(tlsConf) <mask> <mask> canUpdate := true <mask> if tlsConfUsesPrivilegedPorts(tlsConf) || config.BindPort < 1024 || config.DNS.Port < 1024 { <mask> canUpdate, err = aghnet.CanBindPrivilegedPorts() <mask> if err != nil { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/controlupdate.go
bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr
<mask> } <mask> <mask> // setupBindOpts overrides bind host/port from the opts. <mask> func setupBindOpts(opts options) (err error) { <mask> if opts.bindPort != 0 { <mask> config.BindPort = opts.bindPort <mask> <mask> err = checkPorts() <mask> if err != nil { <mask> // Don't wrap the error, becaus...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go
if config.HTTPConfig.Address.Port() != 0 { err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err }
<mask> func setupBindOpts(opts options) (err error) { <mask> if opts.bindPort != 0 { <mask> config.BindPort = opts.bindPort <mask> <mask> err = checkPorts() <mask> if err != nil { <mask> // Don't wrap the error, because it's informative enough as is. <mask> return err <mask> } <mask> } <mask...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go
<mask> if err != nil { <mask> // Don't wrap the error, because it's informative enough as is. <mask> return err <mask> } <mask> } <mask> <mask> if opts.bindHost.IsValid() { <mask> config.BindHost = opts.bindHost <mask> } <mask> </s> Pull request: home: http conf Updates #2860. Squashed com...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go
return nil
<mask> return err <mask> } <mask> } <mask> <mask> if opts.bindHost.IsValid() { <mask> config.BindHost = opts.bindHost <mask> } <mask> <mask> // Rewrite deprecated options. <mask> bindAddr := opts.bindAddr <mask> if bindAddr.IsValid() { </s> Pull request: home: http conf Updates #2860. Squas...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go
if opts.bindPort != 0 { config.HTTPConfig.Address = netip.AddrPortFrom( config.HTTPConfig.Address.Addr(), uint16(opts.bindPort), )
<mask> if opts.bindHost.IsValid() { <mask> config.BindHost = opts.bindHost <mask> } <mask> <mask> // Rewrite deprecated options. <mask> bindAddr := opts.bindAddr <mask> if bindAddr.IsValid() { <mask> config.BindHost = bindAddr.Addr() <mask> config.BindPort = int(bindAddr.Port()) <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go
if opts.bindHost.IsValid() { config.HTTPConfig.Address = netip.AddrPortFrom( opts.bindHost, config.HTTPConfig.Address.Port(), ) }
<mask> return err <mask> } <mask> } <mask> <mask> return nil <mask> } <mask> <mask> // setupDNSFilteringConf sets up DNS filtering configuration settings. </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a20...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go
addPorts(tcpPorts, tcpPort(config.HTTPConfig.Address.Port()))
<mask> <mask> // checkPorts is a helper for ports validation in config. <mask> func checkPorts() (err error) { <mask> tcpPorts := aghalg.UniqChecker[tcpPort]{} <mask> addPorts(tcpPorts, tcpPort(config.BindPort)) <mask> <mask> udpPorts := aghalg.UniqChecker[udpPort]{} <mask> addPorts(udpPorts, udpPort(conf...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go
BindHost: config.HTTPConfig.Address.Addr(), BindPort: int(config.HTTPConfig.Address.Port()),
<mask> } <mask> <mask> webConf := webConfig{ <mask> firstRun: Context.firstRun, <mask> BindHost: config.BindHost, <mask> BindPort: config.BindPort, <mask> <mask> ReadTimeout: readTimeout, <mask> ReadHeaderTimeout: readHdrTimeout, <mask> WriteTimeout: writeTimeout, <mask> </s> Pul...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go
sessionTTL := config.HTTPConfig.SessionTTL.Seconds() auth = InitAuth(sessFilename, config.Users, uint32(sessionTTL), rateLimiter)
<mask> } else { <mask> log.Info("authratelimiter is disabled") <mask> } <mask> <mask> sessionTTL := config.WebSessionTTLHours * 60 * 60 <mask> auth = InitAuth(sessFilename, config.Users, sessionTTL, rateLimiter) <mask> if auth == nil { <mask> return nil, errors.Error("initializing auth module failed")...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go