docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
sequencelengths
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/miekg/dns" <mask> "golang.org/x/exp/slices" <mask> "golang.org/x/net/publicsuffix" </s> Pull request 1837: AG-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove "github.com/AdguardTeam/golibs/stringutil" "github.com/miekg/dns" "golang.org/x/exp/slices" "golang.org/x/net/publicsuffix" </s> add </s> remove "time" </s> add </s> remove "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/cache" </s> add </s> remove "strings" </s> add </s> remove "github.com/AdguardTeam/golibs/cache" </s> add "github.com/AdguardTeam/AdGuardHome/internal/filtering/hashprefix"
[ "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/slices" <mask> "golang.org/x/net/publicsuffix" <mask> ) <mask> <mask> // Safe browsing and parental control methods. <mask> <mask> // TODO(a.garipov): Make configurable. </s> Pull request 1837: AG-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/cache" </s> add </s> remove "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/cache" </s> add </s> remove "time" </s> add </s> remove "github.com/AdguardTeam/golibs/cache" </s> add "github.com/AdguardTeam/AdGuardHome/internal/filtering/hashprefix"
[ "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 = `https://family.adguard-dns.com/dns-query` <mask> sbTXTSuffix = `sb.dns.adguard.com.` <mask> pcTXTSuffix = `pc.dns.adguard.com.` <mask> ) <mask> <mask> // SetParentalUpstream sets the parental upstream for *DNSFilter. <mask> // <mask> // TODO(e.burkov): Remove this in v1 API to forbid the direct access. <mask> func (d *DNSFilter) SetParentalUpstream(u upstream.Upstream) { <mask> d.parentalUpstream = u <mask> } <mask> <mask> // SetSafeBrowsingUpstream sets the safe browsing upstream for *DNSFilter. <mask> // <mask> // TODO(e.burkov): Remove this in v1 API to forbid the direct access. <mask> func (d *DNSFilter) SetSafeBrowsingUpstream(u upstream.Upstream) { <mask> d.safeBrowsingUpstream = u <mask> } <mask> <mask> func (d *DNSFilter) initSecurityServices() error { <mask> var err error <mask> d.safeBrowsingServer = defaultSafebrowsingServer <mask> d.parentalServer = defaultParentalServer <mask> opts := &upstream.Options{ <mask> Timeout: dnsTimeout, <mask> ServerIPAddrs: []net.IP{ <mask> {94, 140, 14, 15}, <mask> {94, 140, 15, 16}, <mask> net.ParseIP("2a10:50c0::bad1:ff"), <mask> net.ParseIP("2a10:50c0::bad2:ff"), <mask> }, <mask> } <mask> <mask> parUps, err := upstream.AddressToUpstream(d.parentalServer, opts) <mask> if err != nil { <mask> return fmt.Errorf("converting parental server: %w", err) <mask> } <mask> d.SetParentalUpstream(parUps) <mask> <mask> sbUps, err := upstream.AddressToUpstream(d.safeBrowsingServer, opts) <mask> if err != nil { <mask> return fmt.Errorf("converting safe browsing server: %w", err) <mask> } <mask> d.SetSafeBrowsingUpstream(sbUps) <mask> <mask> return nil <mask> } <mask> <mask> /* <mask> expire byte[4] <mask> hash byte[32] <mask> ... <mask> */ <mask> func (c *sbCtx) setCache(prefix, hashes []byte) { <mask> d := make([]byte, 4+len(hashes)) <mask> expire := uint(time.Now().Unix()) + c.cacheTime*60 <mask> binary.BigEndian.PutUint32(d[:4], uint32(expire)) <mask> copy(d[4:], hashes) <mask> c.cache.Set(prefix, d) <mask> log.Debug("%s: stored in cache: %v", c.svc, prefix) <mask> } <mask> <mask> // findInHash returns 32-byte hash if it's found in hashToHost. <mask> func (c *sbCtx) findInHash(val []byte) (hash32 [32]byte, found bool) { <mask> for i := 4; i < len(val); i += 32 { <mask> hash := val[i : i+32] <mask> <mask> copy(hash32[:], hash[0:32]) <mask> <mask> _, found = c.hashToHost[hash32] <mask> if found { <mask> return hash32, found <mask> } <mask> } <mask> <mask> return [32]byte{}, false <mask> } <mask> <mask> func (c *sbCtx) getCached() int { <mask> now := time.Now().Unix() <mask> hashesToRequest := map[[32]byte]string{} <mask> for k, v := range c.hashToHost { <mask> // nolint:looppointer // The subsilce is used for a safe cache lookup. <mask> val := c.cache.Get(k[0:2]) <mask> if val == nil || now >= int64(binary.BigEndian.Uint32(val)) { <mask> hashesToRequest[k] = v <mask> continue <mask> } <mask> if hash32, found := c.findInHash(val); found { <mask> log.Debug("%s: found in cache: %s: blocked by %v", c.svc, c.host, hash32) <mask> return 1 <mask> } <mask> } <mask> <mask> if len(hashesToRequest) == 0 { <mask> log.Debug("%s: found in cache: %s: not blocked", c.svc, c.host) <mask> return -1 <mask> } <mask> <mask> c.hashToHost = hashesToRequest <mask> return 0 <mask> } <mask> <mask> type sbCtx struct { <mask> host string <mask> svc string <mask> hashToHost map[[32]byte]string <mask> cache cache.Cache <mask> cacheTime uint <mask> } <mask> <mask> func hostnameToHashes(host string) map[[32]byte]string { <mask> hashes := map[[32]byte]string{} <mask> tld, icann := publicsuffix.PublicSuffix(host) <mask> if !icann { <mask> // private suffixes like cloudfront.net <mask> tld = "" <mask> } <mask> curhost := host <mask> <mask> nDots := 0 <mask> for i := len(curhost) - 1; i >= 0; i-- { <mask> if curhost[i] == '.' { <mask> nDots++ <mask> if nDots == 4 { <mask> curhost = curhost[i+1:] // "xxx.a.b.c.d" -> "a.b.c.d" <mask> break <mask> } <mask> } <mask> } <mask> <mask> for { <mask> if curhost == "" { <mask> // we've reached end of string <mask> break <mask> } <mask> if tld != "" && curhost == tld { <mask> // we've reached the TLD, don't hash it <mask> break <mask> } <mask> <mask> sum := sha256.Sum256([]byte(curhost)) <mask> hashes[sum] = curhost <mask> <mask> pos := strings.IndexByte(curhost, byte('.')) <mask> if pos < 0 { <mask> break <mask> } <mask> curhost = curhost[pos+1:] <mask> } <mask> return hashes <mask> } <mask> <mask> // convert hash array to string <mask> func (c *sbCtx) getQuestion() string { <mask> b := &strings.Builder{} <mask> <mask> for hash := range c.hashToHost { <mask> // nolint:looppointer // The subsilce is used for safe hex encoding. <mask> stringutil.WriteToBuilder(b, hex.EncodeToString(hash[0:2]), ".") <mask> } <mask> <mask> if c.svc == "SafeBrowsing" { <mask> stringutil.WriteToBuilder(b, sbTXTSuffix) <mask> <mask> return b.String() <mask> } <mask> <mask> stringutil.WriteToBuilder(b, pcTXTSuffix) <mask> <mask> return b.String() <mask> } <mask> <mask> // Find the target hash in TXT response <mask> func (c *sbCtx) processTXT(resp *dns.Msg) (bool, [][]byte) { <mask> matched := false <mask> hashes := [][]byte{} <mask> for _, a := range resp.Answer { <mask> txt, ok := a.(*dns.TXT) <mask> if !ok { <mask> continue <mask> } <mask> log.Debug("%s: received hashes for %s: %v", c.svc, c.host, txt.Txt) <mask> <mask> for _, t := range txt.Txt { <mask> if len(t) != 32*2 { <mask> continue <mask> } <mask> hash, err := hex.DecodeString(t) <mask> if err != nil { <mask> continue <mask> } <mask> <mask> hashes = append(hashes, hash) <mask> <mask> if !matched { <mask> var hash32 [32]byte <mask> copy(hash32[:], hash) <mask> <mask> var hashHost string <mask> hashHost, ok = c.hashToHost[hash32] <mask> if ok { <mask> log.Debug("%s: matched %s by %s/%s", c.svc, c.host, hashHost, t) <mask> matched = true <mask> } <mask> } <mask> } <mask> } <mask> <mask> return matched, hashes <mask> } <mask> <mask> func (c *sbCtx) storeCache(hashes [][]byte) { <mask> slices.SortFunc(hashes, func(a, b []byte) (sortsBefore bool) { <mask> return bytes.Compare(a, b) == -1 <mask> }) <mask> <mask> var curData []byte <mask> var prevPrefix []byte <mask> for i, hash := range hashes { <mask> // nolint:looppointer // The subsilce is used for a safe comparison. <mask> if !bytes.Equal(hash[0:2], prevPrefix) { <mask> if i != 0 { <mask> c.setCache(prevPrefix, curData) <mask> curData = nil <mask> } <mask> prevPrefix = hashes[i][0:2] <mask> } <mask> curData = append(curData, hash...) <mask> } <mask> <mask> if len(prevPrefix) != 0 { <mask> c.setCache(prevPrefix, curData) <mask> } <mask> <mask> for hash := range c.hashToHost { <mask> // nolint:looppointer // The subsilce is used for a safe cache lookup. <mask> prefix := hash[0:2] <mask> val := c.cache.Get(prefix) <mask> if val == nil { <mask> c.setCache(prefix, nil) <mask> } <mask> } <mask> } <mask> <mask> func check(c *sbCtx, r Result, u upstream.Upstream) (Result, error) { <mask> c.hashToHost = hostnameToHashes(c.host) <mask> switch c.getCached() { <mask> case -1: <mask> return Result{}, nil <mask> case 1: <mask> return r, nil <mask> } <mask> <mask> question := c.getQuestion() <mask> <mask> log.Tracef("%s: checking %s: %s", c.svc, c.host, question) <mask> req := (&dns.Msg{}).SetQuestion(question, dns.TypeTXT) <mask> <mask> resp, err := u.Exchange(req) <mask> if err != nil { <mask> return Result{}, err <mask> } <mask> <mask> matched, receivedHashes := c.processTXT(resp) <mask> <mask> c.storeCache(receivedHashes) <mask> if matched { <mask> return r, nil <mask> } <mask> <mask> return Result{}, nil <mask> } <mask> <mask> // TODO(a.garipov): Unify with checkParental. <mask> func (d *DNSFilter) checkSafeBrowsing( <mask> host string, <mask> _ uint16, <mask> setts *Settings, </s> Pull request 1837: AG-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove return check(sctx, res, d.safeBrowsingUpstream) </s> add block, err := d.safeBrowsingChecker.Check(host) if !block || err != nil { return Result{}, err } return res, nil </s> remove return check(sctx, res, d.parentalUpstream) </s> add block, err := d.parentalControlChecker.Check(host) if !block || err != nil { return Result{}, err } return res, nil </s> remove func purgeCaches(d *DNSFilter) { for _, c := range []cache.Cache{ d.safebrowsingCache, d.parentalCache, } { if c != nil { c.Clear() } } } </s> add </s> remove err = d.initSecurityServices() if err != nil { return nil, fmt.Errorf("initializing services: %s", err) } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/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> <mask> res = Result{ <mask> Rules: []*ResultRule{{ <mask> Text: "adguard-malware-shavar", <mask> FilterListID: SafeBrowsingListID, <mask> }}, </s> Pull request 1837: AG-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove sctx := &sbCtx{ host: host, svc: "Parental", cache: d.parentalCache, cacheTime: d.Config.CacheTime, } </s> add </s> remove func purgeCaches(d *DNSFilter) { for _, c := range []cache.Cache{ d.safebrowsingCache, d.parentalCache, } { if c != nil { c.Clear() } } } </s> add </s> remove d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true)) </s> add </s> remove d, setts := newForTest(t, &Config{ParentalEnabled: true}, nil) </s> add d, setts := newForTest(t, &Config{ ParentalEnabled: true, ParentalControlChecker: newChecker(pcBlocked), }, nil) </s> remove d.SetParentalUpstream(aghtest.NewBlockUpstream(pcBlocked, true)) </s> add
[ "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-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove return check(sctx, res, d.parentalUpstream) </s> add block, err := d.parentalControlChecker.Check(host) if !block || err != nil { return Result{}, err } return res, nil </s> remove purgeCaches(f) </s> add </s> remove // TODO(a.garipov): Make configurable. const ( dnsTimeout = 3 * time.Second defaultSafebrowsingServer = `https://family.adguard-dns.com/dns-query` defaultParentalServer = `https://family.adguard-dns.com/dns-query` sbTXTSuffix = `sb.dns.adguard.com.` pcTXTSuffix = `pc.dns.adguard.com.` ) // SetParentalUpstream sets the parental upstream for *DNSFilter. // // TODO(e.burkov): Remove this in v1 API to forbid the direct access. func (d *DNSFilter) SetParentalUpstream(u upstream.Upstream) { d.parentalUpstream = u } // SetSafeBrowsingUpstream sets the safe browsing upstream for *DNSFilter. // // TODO(e.burkov): Remove this in v1 API to forbid the direct access. func (d *DNSFilter) SetSafeBrowsingUpstream(u upstream.Upstream) { d.safeBrowsingUpstream = u } func (d *DNSFilter) initSecurityServices() error { var err error d.safeBrowsingServer = defaultSafebrowsingServer d.parentalServer = defaultParentalServer opts := &upstream.Options{ Timeout: dnsTimeout, ServerIPAddrs: []net.IP{ {94, 140, 14, 15}, {94, 140, 15, 16}, net.ParseIP("2a10:50c0::bad1:ff"), net.ParseIP("2a10:50c0::bad2:ff"), }, } parUps, err := upstream.AddressToUpstream(d.parentalServer, opts) if err != nil { return fmt.Errorf("converting parental server: %w", err) } d.SetParentalUpstream(parUps) sbUps, err := upstream.AddressToUpstream(d.safeBrowsingServer, opts) if err != nil { return fmt.Errorf("converting safe browsing server: %w", err) } d.SetSafeBrowsingUpstream(sbUps) return nil } /* expire byte[4] hash byte[32] ... */ func (c *sbCtx) setCache(prefix, hashes []byte) { d := make([]byte, 4+len(hashes)) expire := uint(time.Now().Unix()) + c.cacheTime*60 binary.BigEndian.PutUint32(d[:4], uint32(expire)) copy(d[4:], hashes) c.cache.Set(prefix, d) log.Debug("%s: stored in cache: %v", c.svc, prefix) } // findInHash returns 32-byte hash if it's found in hashToHost. func (c *sbCtx) findInHash(val []byte) (hash32 [32]byte, found bool) { for i := 4; i < len(val); i += 32 { hash := val[i : i+32] copy(hash32[:], hash[0:32]) _, found = c.hashToHost[hash32] if found { return hash32, found } } return [32]byte{}, false } func (c *sbCtx) getCached() int { now := time.Now().Unix() hashesToRequest := map[[32]byte]string{} for k, v := range c.hashToHost { // nolint:looppointer // The subsilce is used for a safe cache lookup. val := c.cache.Get(k[0:2]) if val == nil || now >= int64(binary.BigEndian.Uint32(val)) { hashesToRequest[k] = v continue } if hash32, found := c.findInHash(val); found { log.Debug("%s: found in cache: %s: blocked by %v", c.svc, c.host, hash32) return 1 } } if len(hashesToRequest) == 0 { log.Debug("%s: found in cache: %s: not blocked", c.svc, c.host) return -1 } c.hashToHost = hashesToRequest return 0 } type sbCtx struct { host string svc string hashToHost map[[32]byte]string cache cache.Cache cacheTime uint } func hostnameToHashes(host string) map[[32]byte]string { hashes := map[[32]byte]string{} tld, icann := publicsuffix.PublicSuffix(host) if !icann { // private suffixes like cloudfront.net tld = "" } curhost := host nDots := 0 for i := len(curhost) - 1; i >= 0; i-- { if curhost[i] == '.' { nDots++ if nDots == 4 { curhost = curhost[i+1:] // "xxx.a.b.c.d" -> "a.b.c.d" break } } } for { if curhost == "" { // we've reached end of string break } if tld != "" && curhost == tld { // we've reached the TLD, don't hash it break } sum := sha256.Sum256([]byte(curhost)) hashes[sum] = curhost pos := strings.IndexByte(curhost, byte('.')) if pos < 0 { break } curhost = curhost[pos+1:] } return hashes } // convert hash array to string func (c *sbCtx) getQuestion() string { b := &strings.Builder{} for hash := range c.hashToHost { // nolint:looppointer // The subsilce is used for safe hex encoding. stringutil.WriteToBuilder(b, hex.EncodeToString(hash[0:2]), ".") } if c.svc == "SafeBrowsing" { stringutil.WriteToBuilder(b, sbTXTSuffix) return b.String() } stringutil.WriteToBuilder(b, pcTXTSuffix) return b.String() } // Find the target hash in TXT response func (c *sbCtx) processTXT(resp *dns.Msg) (bool, [][]byte) { matched := false hashes := [][]byte{} for _, a := range resp.Answer { txt, ok := a.(*dns.TXT) if !ok { continue } log.Debug("%s: received hashes for %s: %v", c.svc, c.host, txt.Txt) for _, t := range txt.Txt { if len(t) != 32*2 { continue } hash, err := hex.DecodeString(t) if err != nil { continue } hashes = append(hashes, hash) if !matched { var hash32 [32]byte copy(hash32[:], hash) var hashHost string hashHost, ok = c.hashToHost[hash32] if ok { log.Debug("%s: matched %s by %s/%s", c.svc, c.host, hashHost, t) matched = true } } } } return matched, hashes } func (c *sbCtx) storeCache(hashes [][]byte) { slices.SortFunc(hashes, func(a, b []byte) (sortsBefore bool) { return bytes.Compare(a, b) == -1 }) var curData []byte var prevPrefix []byte for i, hash := range hashes { // nolint:looppointer // The subsilce is used for a safe comparison. if !bytes.Equal(hash[0:2], prevPrefix) { if i != 0 { c.setCache(prevPrefix, curData) curData = nil } prevPrefix = hashes[i][0:2] } curData = append(curData, hash...) } if len(prevPrefix) != 0 { c.setCache(prevPrefix, curData) } for hash := range c.hashToHost { // nolint:looppointer // The subsilce is used for a safe cache lookup. prefix := hash[0:2] val := c.cache.Get(prefix) if val == nil { c.setCache(prefix, nil) } } } func check(c *sbCtx, r Result, u upstream.Upstream) (Result, error) { c.hashToHost = hostnameToHashes(c.host) switch c.getCached() { case -1: return Result{}, nil case 1: return r, nil } question := c.getQuestion() log.Tracef("%s: checking %s: %s", c.svc, c.host, question) req := (&dns.Msg{}).SetQuestion(question, dns.TypeTXT) resp, err := u.Exchange(req) if err != nil { return Result{}, err } matched, receivedHashes := c.processTXT(resp) c.storeCache(receivedHashes) if matched { return r, nil } return Result{}, nil } </s> add </s> remove func purgeCaches(d *DNSFilter) { for _, c := range []cache.Cache{ d.safebrowsingCache, d.parentalCache, } { if c != nil { c.Clear() } } } </s> add
[ "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 = Result{ <mask> Rules: []*ResultRule{{ <mask> Text: "parental CATEGORY_BLACKLISTED", <mask> FilterListID: ParentalListID, <mask> }}, </s> Pull request 1837: AG-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove sctx := &sbCtx{ host: host, svc: "SafeBrowsing", cache: d.safebrowsingCache, cacheTime: d.Config.CacheTime, } </s> add </s> remove func purgeCaches(d *DNSFilter) { for _, c := range []cache.Cache{ d.safebrowsingCache, d.parentalCache, } { if c != nil { c.Clear() } } } </s> add </s> remove d.SetSafeBrowsingUpstream(aghtest.NewBlockUpstream(sbBlocked, true)) </s> add </s> remove d, setts := newForTest(t, &Config{ParentalEnabled: true}, nil) </s> add d, setts := newForTest(t, &Config{ ParentalEnabled: true, ParentalControlChecker: newChecker(pcBlocked), }, nil) </s> remove d.SetParentalUpstream(aghtest.NewBlockUpstream(pcBlocked, true)) </s> add
[ "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: AG-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove return check(sctx, res, d.safeBrowsingUpstream) </s> add block, err := d.safeBrowsingChecker.Check(host) if !block || err != nil { return Result{}, err } return res, nil </s> remove safeSearch SafeSearch </s> add </s> remove // TODO(a.garipov): Make configurable. const ( dnsTimeout = 3 * time.Second defaultSafebrowsingServer = `https://family.adguard-dns.com/dns-query` defaultParentalServer = `https://family.adguard-dns.com/dns-query` sbTXTSuffix = `sb.dns.adguard.com.` pcTXTSuffix = `pc.dns.adguard.com.` ) // SetParentalUpstream sets the parental upstream for *DNSFilter. // // TODO(e.burkov): Remove this in v1 API to forbid the direct access. func (d *DNSFilter) SetParentalUpstream(u upstream.Upstream) { d.parentalUpstream = u } // SetSafeBrowsingUpstream sets the safe browsing upstream for *DNSFilter. // // TODO(e.burkov): Remove this in v1 API to forbid the direct access. func (d *DNSFilter) SetSafeBrowsingUpstream(u upstream.Upstream) { d.safeBrowsingUpstream = u } func (d *DNSFilter) initSecurityServices() error { var err error d.safeBrowsingServer = defaultSafebrowsingServer d.parentalServer = defaultParentalServer opts := &upstream.Options{ Timeout: dnsTimeout, ServerIPAddrs: []net.IP{ {94, 140, 14, 15}, {94, 140, 15, 16}, net.ParseIP("2a10:50c0::bad1:ff"), net.ParseIP("2a10:50c0::bad2:ff"), }, } parUps, err := upstream.AddressToUpstream(d.parentalServer, opts) if err != nil { return fmt.Errorf("converting parental server: %w", err) } d.SetParentalUpstream(parUps) sbUps, err := upstream.AddressToUpstream(d.safeBrowsingServer, opts) if err != nil { return fmt.Errorf("converting safe browsing server: %w", err) } d.SetSafeBrowsingUpstream(sbUps) return nil } /* expire byte[4] hash byte[32] ... */ func (c *sbCtx) setCache(prefix, hashes []byte) { d := make([]byte, 4+len(hashes)) expire := uint(time.Now().Unix()) + c.cacheTime*60 binary.BigEndian.PutUint32(d[:4], uint32(expire)) copy(d[4:], hashes) c.cache.Set(prefix, d) log.Debug("%s: stored in cache: %v", c.svc, prefix) } // findInHash returns 32-byte hash if it's found in hashToHost. func (c *sbCtx) findInHash(val []byte) (hash32 [32]byte, found bool) { for i := 4; i < len(val); i += 32 { hash := val[i : i+32] copy(hash32[:], hash[0:32]) _, found = c.hashToHost[hash32] if found { return hash32, found } } return [32]byte{}, false } func (c *sbCtx) getCached() int { now := time.Now().Unix() hashesToRequest := map[[32]byte]string{} for k, v := range c.hashToHost { // nolint:looppointer // The subsilce is used for a safe cache lookup. val := c.cache.Get(k[0:2]) if val == nil || now >= int64(binary.BigEndian.Uint32(val)) { hashesToRequest[k] = v continue } if hash32, found := c.findInHash(val); found { log.Debug("%s: found in cache: %s: blocked by %v", c.svc, c.host, hash32) return 1 } } if len(hashesToRequest) == 0 { log.Debug("%s: found in cache: %s: not blocked", c.svc, c.host) return -1 } c.hashToHost = hashesToRequest return 0 } type sbCtx struct { host string svc string hashToHost map[[32]byte]string cache cache.Cache cacheTime uint } func hostnameToHashes(host string) map[[32]byte]string { hashes := map[[32]byte]string{} tld, icann := publicsuffix.PublicSuffix(host) if !icann { // private suffixes like cloudfront.net tld = "" } curhost := host nDots := 0 for i := len(curhost) - 1; i >= 0; i-- { if curhost[i] == '.' { nDots++ if nDots == 4 { curhost = curhost[i+1:] // "xxx.a.b.c.d" -> "a.b.c.d" break } } } for { if curhost == "" { // we've reached end of string break } if tld != "" && curhost == tld { // we've reached the TLD, don't hash it break } sum := sha256.Sum256([]byte(curhost)) hashes[sum] = curhost pos := strings.IndexByte(curhost, byte('.')) if pos < 0 { break } curhost = curhost[pos+1:] } return hashes } // convert hash array to string func (c *sbCtx) getQuestion() string { b := &strings.Builder{} for hash := range c.hashToHost { // nolint:looppointer // The subsilce is used for safe hex encoding. stringutil.WriteToBuilder(b, hex.EncodeToString(hash[0:2]), ".") } if c.svc == "SafeBrowsing" { stringutil.WriteToBuilder(b, sbTXTSuffix) return b.String() } stringutil.WriteToBuilder(b, pcTXTSuffix) return b.String() } // Find the target hash in TXT response func (c *sbCtx) processTXT(resp *dns.Msg) (bool, [][]byte) { matched := false hashes := [][]byte{} for _, a := range resp.Answer { txt, ok := a.(*dns.TXT) if !ok { continue } log.Debug("%s: received hashes for %s: %v", c.svc, c.host, txt.Txt) for _, t := range txt.Txt { if len(t) != 32*2 { continue } hash, err := hex.DecodeString(t) if err != nil { continue } hashes = append(hashes, hash) if !matched { var hash32 [32]byte copy(hash32[:], hash) var hashHost string hashHost, ok = c.hashToHost[hash32] if ok { log.Debug("%s: matched %s by %s/%s", c.svc, c.host, hashHost, t) matched = true } } } } return matched, hashes } func (c *sbCtx) storeCache(hashes [][]byte) { slices.SortFunc(hashes, func(a, b []byte) (sortsBefore bool) { return bytes.Compare(a, b) == -1 }) var curData []byte var prevPrefix []byte for i, hash := range hashes { // nolint:looppointer // The subsilce is used for a safe comparison. if !bytes.Equal(hash[0:2], prevPrefix) { if i != 0 { c.setCache(prevPrefix, curData) curData = nil } prevPrefix = hashes[i][0:2] } curData = append(curData, hash...) } if len(prevPrefix) != 0 { c.setCache(prevPrefix, curData) } for hash := range c.hashToHost { // nolint:looppointer // The subsilce is used for a safe cache lookup. prefix := hash[0:2] val := c.cache.Get(prefix) if val == nil { c.setCache(prefix, nil) } } } func check(c *sbCtx, r Result, u upstream.Upstream) (Result, error) { c.hashToHost = hostnameToHashes(c.host) switch c.getCached() { case -1: return Result{}, nil case 1: return r, nil } question := c.getQuestion() log.Tracef("%s: checking %s: %s", c.svc, c.host, question) req := (&dns.Msg{}).SetQuestion(question, dns.TypeTXT) resp, err := u.Exchange(req) if err != nil { return Result{}, err } matched, receivedHashes := c.processTXT(resp) c.storeCache(receivedHashes) if matched { return r, nil } return Result{}, nil } </s> add
[ "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/internal/stats" <mask> "github.com/AdguardTeam/AdGuardHome/internal/updater" <mask> "github.com/AdguardTeam/AdGuardHome/internal/version" </s> Pull request 1837: AG-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove sctx := &sbCtx{ host: host, svc: "Parental", cache: d.parentalCache, cacheTime: d.Config.CacheTime, } </s> add </s> remove safeSearch SafeSearch </s> add </s> remove d, setts := newForTest(t, &Config{SafeBrowsingEnabled: true}, nil) </s> add sbChecker := newChecker(sbBlocked) d, setts := newForTest(t, &Config{ SafeBrowsingEnabled: true, SafeBrowsingChecker: sbChecker, }, nil)
[ "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/netutil" <mask> "golang.org/x/exp/slices" </s> Pull request 1837: AG-21462-imp-safebrowsing-parental Merge in DNS/adguard-home from AG-21462-imp-safebrowsing-parental to master Squashed commit of the following: commit 85016d4f1105e21a407efade0bd45b8362808061 Merge: 0e61edade 620b51e3e Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 16:36:30 2023 +0300 Merge branch 'master' into AG-21462-imp-safebrowsing-parental commit 0e61edadeff34f6305e941c1db94575c82f238d9 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 14:51:37 2023 +0300 filtering: imp tests commit 994255514cc0f67dfe33d5a0892432e8924d1e36 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:13:19 2023 +0300 filtering: fix typo commit 96d1069573171538333330d6af94ef0f4208a9c4 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 27 11:00:18 2023 +0300 filtering: imp code more commit c2a5620b04c4a529eea69983f1520cd2bc82ea9b Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 19:13:26 2023 +0300 all: add todo commit e5dcc2e9701f8bccfde6ef8c01a4a2e7eb31599e Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 26 14:36:08 2023 +0300 all: imp code more commit b6e734ccbeda82669023f6578481260b7c1f7161 Author: Stanislav Chzhen <[email protected]> Date: Tue Apr 25 15:01:56 2023 +0300 filtering: imp code commit 530648dadf836c1a4bd9917e0d3b47256fa8ff52 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 20:06:36 2023 +0300 all: imp code commit 49fa6e587052a40bb431fea457701ee860493527 Author: Stanislav Chzhen <[email protected]> Date: Mon Apr 24 14:57:19 2023 +0300 all: rm safe browsing ctx commit bbcb66cb03e18fa875e3c33cf16295892739e507 Author: Stanislav Chzhen <[email protected]> Date: Fri Apr 21 17:54:18 2023 +0300 filtering: add cache item commit cb7c9fffe8c4ff5e7a21ca912c223c799f61385f Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 18:43:02 2023 +0300 filtering: fix hashes commit 153fec46270212af03f3631bfb42c5d680c4e142 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 16:15:15 2023 +0300 filtering: add test cases commit 09372f92bbb1fc082f1b1283594ee589100209c5 Author: Stanislav Chzhen <[email protected]> Date: Thu Apr 20 15:38:05 2023 +0300 filtering: imp code commit 466bc26d524ea6d1c3efb33692a7785d39e491ca Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 18:38:40 2023 +0300 filtering: add tests commit 24365ecf8c60512fdac65833ee603c80864ae018 Author: Stanislav Chzhen <[email protected]> Date: Wed Apr 19 11:38:57 2023 +0300 filtering: add hashprefix </s> remove "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/cache" </s> add </s> remove "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/cache" </s> add </s> remove "github.com/AdguardTeam/golibs/stringutil" "github.com/miekg/dns" "golang.org/x/exp/slices" "golang.org/x/net/publicsuffix" </s> add
[ "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 request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove func (a *accessManager) isBlockedHost(host string) (ok bool) { _, ok = a.blockedHostsEng.Match(strings.ToLower(host)) </s> add 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, }) </s> remove host := strings.TrimSuffix(pctx.Req.Question[0].Name, ".") if s.access.isBlockedHost(host) { log.Debug("host %s is in access blocklist", host) </s> add 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) </s> remove ip: netip.MustParseAddr("9.6.7.100"), </s> add </s> remove assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> add tc.want(t, a.isBlockedHost(tc.host, tc.qt))
[ "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> // isBlockedIP returns the status of the IP address blocking as well as the rule </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove host := strings.TrimSuffix(pctx.Req.Question[0].Name, ".") if s.access.isBlockedHost(host) { log.Debug("host %s is in access blocklist", host) </s> add 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) </s> remove assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> add tc.want(t, a.isBlockedHost(tc.host, tc.qt)) </s> remove ip: netip.MustParseAddr("9.6.7.100"), </s> add
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> add tc.want(t, a.isBlockedHost(tc.host, tc.qt)) </s> remove ip: netip.MustParseAddr("9.6.7.100"), </s> add </s> remove func (a *accessManager) isBlockedHost(host string) (ok bool) { _, ok = a.blockedHostsEng.Match(strings.ToLower(host)) </s> add 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, }) </s> remove want: false, </s> add 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,
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want bool </s> add qt rules.RRType </s> remove assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> add tc.want(t, a.isBlockedHost(tc.host, tc.qt)) </s> remove ip netip.Addr </s> add
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want bool </s> add qt rules.RRType </s> remove ip netip.Addr </s> add
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip netip.Addr </s> add </s> remove want: true, </s> add qt: dns.TypeA,
[ "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 commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want bool </s> add qt rules.RRType </s> remove want: true, </s> add qt: dns.TypeA, </s> remove ip netip.Addr </s> add
[ "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: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want bool </s> add qt rules.RRType </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA,
[ "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 commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA,
[ "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 #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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 commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add 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,
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add 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, </s> remove want: true, </s> add qt: dns.TypeA,
[ "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-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> add tc.want(t, a.isBlockedHost(tc.host, tc.qt)) </s> remove ip: netip.MustParseAddr("9.6.7.100"), </s> add </s> remove want: true, </s> add qt: dns.TypeA, </s> remove want: false, </s> add qt: dns.TypeA,
[ "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. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove want: false, </s> add 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, </s> remove ip: netip.MustParseAddr("9.6.7.100"), </s> add </s> remove func (a *accessManager) isBlockedHost(host string) (ok bool) { _, ok = a.blockedHostsEng.Match(strings.ToLower(host)) </s> add 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, }) </s> remove host := strings.TrimSuffix(pctx.Req.Question[0].Name, ".") if s.access.isBlockedHost(host) { log.Debug("host %s is in access blocklist", host) </s> add 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)
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip netip.Addr </s> add </s> remove want bool </s> add qt rules.RRType
[ "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: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip: netip.MustParseAddr("1.2.3.4"), </s> add </s> remove want bool </s> add qt rules.RRType
[ "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-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip: netip.MustParseAddr("1.2.3.4"), </s> add </s> remove ip netip.Addr </s> add </s> remove ip: netip.MustParseAddr("5.6.7.100"), </s> add
[ "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.MustParseAddr("5.6.7.100"), </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip: netip.MustParseAddr("5.6.7.100"), </s> add </s> remove ip netip.Addr </s> add </s> remove ip: netip.MustParseAddr("9.2.3.4"), </s> add
[ "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 ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip: netip.MustParseAddr("1.2.3.4"), </s> add </s> remove ip: netip.MustParseAddr("5.6.7.100"), </s> add </s> remove ip: netip.MustParseAddr("9.2.3.4"), </s> add
[ "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.MustParseAddr("9.2.3.4"), </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip: netip.MustParseAddr("9.2.3.4"), </s> add </s> remove ip: netip.MustParseAddr("1.2.3.4"), </s> add
[ "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. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip: netip.MustParseAddr("9.2.3.4"), </s> add </s> remove ip: netip.MustParseAddr("5.6.7.100"), </s> add </s> remove ip: netip.MustParseAddr("9.6.7.100"), </s> add
[ "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.6.7.100"), </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip: netip.MustParseAddr("5.6.7.100"), </s> add </s> remove ip: netip.MustParseAddr("9.6.7.100"), </s> add
[ "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: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove ip: netip.MustParseAddr("9.2.3.4"), </s> add </s> remove ip: netip.MustParseAddr("9.6.7.100"), </s> add </s> remove ip: netip.MustParseAddr("5.6.7.100"), </s> add
[ "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 request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> add tc.want(t, a.isBlockedHost(tc.host, tc.qt)) </s> remove ip: netip.MustParseAddr("9.2.3.4"), </s> add </s> remove want: false, </s> add 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,
[ "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.preBlockedResponse(pctx) <mask> } <mask> } <mask> </s> Pull request 1750: 5468-disallowed-dnstype Updates #5468. Squashed commit of the following: commit ecb0c7cc53d43fe5aa75be0c5fc0f2a9179099ad Author: Ainar Garipov <[email protected]> Date: Mon Feb 27 13:57:40 2023 +0300 dnsforward: imp access test commit 3fdc2c4533d1fce8a01f6e636e326454ef96565b Author: Ainar Garipov <[email protected]> Date: Wed Feb 22 19:29:50 2023 +0300 dnsforward: allow dnstype rules in disallowed domains </s> remove func (a *accessManager) isBlockedHost(host string) (ok bool) { _, ok = a.blockedHostsEng.Match(strings.ToLower(host)) </s> add 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, }) </s> remove assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> add tc.want(t, a.isBlockedHost(tc.host, tc.qt)) </s> remove want bool </s> add qt rules.RRType
[ "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()); <mask> } </s> Request tls status after save </s> remove {encryption && !encryption.processing && </s> add {encryption &&
[ "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('encryption_desc')} <mask> bodyType="card-body box-body--settings" <mask> > </s> Request tls status after save
[ "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 Author: Simon Zolin <[email protected]> Date: Wed May 27 14:41:24 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit e24e945f9b949e3cabcddb3a8a62962bb7a5b0b9 Merge: db764710 355e634f Author: Simon Zolin <[email protected]> Date: Wed May 27 14:29:44 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit db764710a0f0b60293f7bdf6b0d7b858d56819e0 Author: Simon Zolin <[email protected]> Date: Wed May 27 12:57:00 2020 +0300 fix commit dc38f668d5845cfd696b3107a8f02dda4f10298e Author: Simon Zolin <[email protected]> Date: Wed May 27 12:44:10 2020 +0300 * whois: use the upstream server to resolve whois server hostname </s> remove conn, err := net.DialTimeout("tcp", serverAddr, time.Duration(w.timeoutMsec)*time.Millisecond) </s> add conn, err := customDialContext(context.TODO(), "tcp", serverAddr)
[ "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 conn.Close() <mask> </s> * whois: use the upstream server to resolve whois server hostname Close #1535 Squashed commit of the following: commit 7755d7a50e48db5d341029e1c21da95a396d9090 Merge: e24e945f 5c2ca690 Author: Simon Zolin <[email protected]> Date: Wed May 27 14:41:24 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit e24e945f9b949e3cabcddb3a8a62962bb7a5b0b9 Merge: db764710 355e634f Author: Simon Zolin <[email protected]> Date: Wed May 27 14:29:44 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit db764710a0f0b60293f7bdf6b0d7b858d56819e0 Author: Simon Zolin <[email protected]> Date: Wed May 27 12:57:00 2020 +0300 fix commit dc38f668d5845cfd696b3107a8f02dda4f10298e Author: Simon Zolin <[email protected]> Date: Wed May 27 12:44:10 2020 +0300 * whois: use the upstream server to resolve whois server hostname
[ "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 following: commit 7755d7a50e48db5d341029e1c21da95a396d9090 Merge: e24e945f 5c2ca690 Author: Simon Zolin <[email protected]> Date: Wed May 27 14:41:24 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit e24e945f9b949e3cabcddb3a8a62962bb7a5b0b9 Merge: db764710 355e634f Author: Simon Zolin <[email protected]> Date: Wed May 27 14:29:44 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit db764710a0f0b60293f7bdf6b0d7b858d56819e0 Author: Simon Zolin <[email protected]> Date: Wed May 27 12:57:00 2020 +0300 fix commit dc38f668d5845cfd696b3107a8f02dda4f10298e Author: Simon Zolin <[email protected]> Date: Wed May 27 12:44:10 2020 +0300 * whois: use the upstream server to resolve whois server hostname </s> remove conn, err := net.DialTimeout("tcp", serverAddr, time.Duration(w.timeoutMsec)*time.Millisecond) </s> add conn, err := customDialContext(context.TODO(), "tcp", serverAddr)
[ "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 7755d7a50e48db5d341029e1c21da95a396d9090 Merge: e24e945f 5c2ca690 Author: Simon Zolin <[email protected]> Date: Wed May 27 14:41:24 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit e24e945f9b949e3cabcddb3a8a62962bb7a5b0b9 Merge: db764710 355e634f Author: Simon Zolin <[email protected]> Date: Wed May 27 14:29:44 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit db764710a0f0b60293f7bdf6b0d7b858d56819e0 Author: Simon Zolin <[email protected]> Date: Wed May 27 12:57:00 2020 +0300 fix commit dc38f668d5845cfd696b3107a8f02dda4f10298e Author: Simon Zolin <[email protected]> Date: Wed May 27 12:44:10 2020 +0300 * whois: use the upstream server to resolve whois server hostname </s> remove conn, err := net.DialTimeout("tcp", serverAddr, time.Duration(w.timeoutMsec)*time.Millisecond) </s> add conn, err := customDialContext(context.TODO(), "tcp", serverAddr)
[ "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.Prepare(conf) }
<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 the following: commit 7755d7a50e48db5d341029e1c21da95a396d9090 Merge: e24e945f 5c2ca690 Author: Simon Zolin <[email protected]> Date: Wed May 27 14:41:24 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit e24e945f9b949e3cabcddb3a8a62962bb7a5b0b9 Merge: db764710 355e634f Author: Simon Zolin <[email protected]> Date: Wed May 27 14:29:44 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit db764710a0f0b60293f7bdf6b0d7b858d56819e0 Author: Simon Zolin <[email protected]> Date: Wed May 27 12:57:00 2020 +0300 fix commit dc38f668d5845cfd696b3107a8f02dda4f10298e Author: Simon Zolin <[email protected]> Date: Wed May 27 12:44:10 2020 +0300 * whois: use the upstream server to resolve whois server hostname </s> remove conn, err := net.DialTimeout("tcp", serverAddr, time.Duration(w.timeoutMsec)*time.Millisecond) </s> add conn, err := customDialContext(context.TODO(), "tcp", serverAddr)
[ "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 hostname Close #1535 Squashed commit of the following: commit 7755d7a50e48db5d341029e1c21da95a396d9090 Merge: e24e945f 5c2ca690 Author: Simon Zolin <[email protected]> Date: Wed May 27 14:41:24 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit e24e945f9b949e3cabcddb3a8a62962bb7a5b0b9 Merge: db764710 355e634f Author: Simon Zolin <[email protected]> Date: Wed May 27 14:29:44 2020 +0300 Merge remote-tracking branch 'origin/master' into 1535-whois-resolve commit db764710a0f0b60293f7bdf6b0d7b858d56819e0 Author: Simon Zolin <[email protected]> Date: Wed May 27 12:57:00 2020 +0300 fix commit dc38f668d5845cfd696b3107a8f02dda4f10298e Author: Simon Zolin <[email protected]> Date: Wed May 27 12:44:10 2020 +0300 * whois: use the upstream server to resolve whois server hostname </s> remove conn, err := net.DialTimeout("tcp", serverAddr, time.Duration(w.timeoutMsec)*time.Millisecond) </s> add conn, err := customDialContext(context.TODO(), "tcp", serverAddr)
[ "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.Write(versionCheckJSON) </s> add w.Write(data)
[ "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.Get(versionCheckURL) <mask> if err != nil { </s> - control: fix race in /control/version.json handler </s> remove f.ID = assignUniqueFilterID() </s> add controlLock.Lock() cached := now.Sub(versionCheckLastTime) <= versionCheckPeriod && len(versionCheckJSON) != 0 data := versionCheckJSON controlLock.Unlock() if cached {
[ "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 f.ID = assignUniqueFilterID() </s> add controlLock.Lock() cached := now.Sub(versionCheckLastTime) <= versionCheckPeriod && len(versionCheckJSON) != 0 data := versionCheckJSON controlLock.Unlock() if cached { </s> remove w.Write(versionCheckJSON) </s> add w.Write(data)
[ "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 controlLock.Lock() cached := now.Sub(versionCheckLastTime) <= versionCheckPeriod && len(versionCheckJSON) != 0 data := versionCheckJSON controlLock.Unlock() if cached { </s> remove w.Write(versionCheckJSON) </s> add w.Write(data)
[ "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 <mask> all: build </s> Fix #773 - preparing the new update channel </s> remove CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)" </s> add CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION) -X main.updateChannel=$(CHANNEL)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)" </s> remove const versionCheckURL = "https://adguardteam.github.io/AdGuardHome/version.json" const versionCheckPeriod = time.Hour * 8 </s> add </s> remove log.Printf("AdGuard Home, version %s\n", VersionString) </s> add log.Printf("AdGuard Home, version %s, channel %s\n", VersionString, updateChannel)
[ "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_VERSION)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)" <mask> PATH=$(GOPATH)/bin:$(PATH) packr clean <mask> <mask> clean: <mask> $(MAKE) cleanfast <mask> rm -rf build </s> Fix #773 - preparing the new update channel </s> remove const versionCheckURL = "https://adguardteam.github.io/AdGuardHome/version.json" const versionCheckPeriod = time.Hour * 8 </s> add </s> remove log.Printf("AdGuard Home, version %s\n", VersionString) </s> add log.Printf("AdGuard Home, version %s, channel %s\n", VersionString, updateChannel)
[ "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/AdGuardHome/version.json" const versionCheckPeriod = time.Hour * 8 </s> add </s> remove log.Printf("AdGuard Home, version %s\n", VersionString) </s> add log.Printf("AdGuard Home, version %s, channel %s\n", VersionString, updateChannel) </s> remove CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)" </s> add CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION) -X main.updateChannel=$(CHANNEL)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)"
[ "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, CertificateChain and PrivateKey <mask> sync.Mutex // protects config.TLS <mask> shutdown bool // if TRUE, don't restart the server </s> Fix #773 - preparing the new update channel </s> remove log.Printf("AdGuard Home, version %s\n", VersionString) </s> add log.Printf("AdGuard Home, version %s, channel %s\n", VersionString, updateChannel) </s> remove const versionCheckURL = "https://adguardteam.github.io/AdGuardHome/version.json" const versionCheckPeriod = time.Hour * 8 </s> add </s> remove CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)" </s> add CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION) -X main.updateChannel=$(CHANNEL)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)"
[ "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("AdGuard Home is running as a service") <mask> } <mask> config.runningAsService = args.runningAsService </s> Fix #773 - preparing the new update channel </s> remove const versionCheckURL = "https://adguardteam.github.io/AdGuardHome/version.json" const versionCheckPeriod = time.Hour * 8 </s> add </s> remove CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)" </s> add CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION) -X main.updateChannel=$(CHANNEL)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)"
[ "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.Transport{ <mask> DialContext: customDialContext, <mask> } <mask> <mask> var client = &http.Client{ </s> Fix #773 - preparing the new update channel </s> remove log.Printf("AdGuard Home, version %s\n", VersionString) </s> add log.Printf("AdGuard Home, version %s, channel %s\n", VersionString, updateChannel) </s> remove CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)" </s> add CGO_ENABLED=0 go build -ldflags="-s -w -X main.VersionString=$(GIT_VERSION) -X main.updateChannel=$(CHANNEL)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)"
[ "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.html", preInstallHandler(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)) </s> Move installation of /install handlers into a separate optional function </s> remove // TODO: move to registerInstallHandlers() http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(handleInstallGetAddresses))) http.HandleFunc("/control/install/configure", preInstall(ensurePOST(handleInstallConfigure))) </s> add
[ "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)) <mask> URL := fmt.Sprintf("http://%s", address) </s> Move installation of /install handlers into a separate optional function </s> remove http.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> add </s> remove // TODO: move to registerInstallHandlers() http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(handleInstallGetAddresses))) http.HandleFunc("/control/install/configure", preInstall(ensurePOST(handleInstallConfigure))) </s> add
[ "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_protection", postInstall(optionalAuth(ensurePOST(handleProtectionDisable)))) <mask> http.HandleFunc("/control/querylog", postInstall(optionalAuth(ensureGET(dnsforward.HandleQueryLog)))) <mask> http.HandleFunc("/control/querylog_enable", postInstall(optionalAuth(ensurePOST(handleQueryLogEnable)))) </s> Move installation of /install handlers into a separate optional function </s> remove http.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> add </s> remove // TODO: move to registerInstallHandlers() http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(handleInstallGetAddresses))) http.HandleFunc("/control/install/configure", preInstall(ensurePOST(handleInstallConfigure))) </s> add
[ "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(handleDHCPSetConfig)))) <mask> http.HandleFunc("/control/dhcp/find_active_dhcp", postInstall(optionalAuth(ensurePOST(handleDHCPFindActiveServer)))) <mask> <mask> // TODO: move to registerInstallHandlers() <mask> http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(handleInstallGetAddresses))) <mask> http.HandleFunc("/control/install/configure", preInstall(ensurePOST(handleInstallConfigure))) <mask> } </s> Move installation of /install handlers into a separate optional function </s> remove http.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> add
[ "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 safebrowsing", <mask> "disabled_parental_toast": "Disabled parental control", <mask> "enabled_parental_toast": "Enabled parental control", <mask> "disabled_safe_search_toast": "Disabled safe search", <mask> "enabled_save_search_toast": "Enabled safe search", <mask> "enabled_table_header": "Enabled", </s> Pull request: client: imp en i18n Merge in DNS/adguard-home from en-i18n-safe-browsing to master Squashed commit of the following: commit dd32a58c3761818a10386b4a1d9e6871da59c71e Author: Ainar Garipov <[email protected]> Date: Wed Dec 22 17:31:35 2021 +0300 client: imp en i18n </s> remove "blocked_safebrowsing": "Blocked by Safebrowsing", "blocked_adult_websites": "Blocked Adult Websites", </s> add "blocked_safebrowsing": "Blocked by Safe Browsing", "blocked_adult_websites": "Blocked by Parental Control", </s> remove "parental_control": "Parental control", "safe_browsing": "Safe browsing", </s> add "parental_control": "Parental Control", "safe_browsing": "Safe Browsing",
[ "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 Websites", <mask> "blocked_threats": "Blocked Threats", <mask> "allowed": "Allowed", <mask> "filtered": "Filtered", <mask> "rewritten": "Rewritten", <mask> "safe_search": "Safe search", </s> Pull request: client: imp en i18n Merge in DNS/adguard-home from en-i18n-safe-browsing to master Squashed commit of the following: commit dd32a58c3761818a10386b4a1d9e6871da59c71e Author: Ainar Garipov <[email protected]> Date: Wed Dec 22 17:31:35 2021 +0300 client: imp en i18n </s> remove "disabled_safe_browsing_toast": "Disabled safebrowsing", "enabled_safe_browsing_toast": "Enabled safebrowsing", </s> add "disabled_safe_browsing_toast": "Disabled Safe Browsing", "enabled_safe_browsing_toast": "Enabled Safe Browsing", </s> remove "parental_control": "Parental control", "safe_browsing": "Safe browsing", </s> add "parental_control": "Parental Control", "safe_browsing": "Safe Browsing",
[ "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> "experimental": "Experimental", <mask> "use_saved_key": "Use the previously saved key", <mask> "parental_control": "Parental control", <mask> "safe_browsing": "Safe browsing", <mask> "served_from_cache": "{{value}} <i>(served from cache)</i>" <mask> } </s> Pull request: client: imp en i18n Merge in DNS/adguard-home from en-i18n-safe-browsing to master Squashed commit of the following: commit dd32a58c3761818a10386b4a1d9e6871da59c71e Author: Ainar Garipov <[email protected]> Date: Wed Dec 22 17:31:35 2021 +0300 client: imp en i18n </s> remove "disabled_safe_browsing_toast": "Disabled safebrowsing", "enabled_safe_browsing_toast": "Enabled safebrowsing", </s> add "disabled_safe_browsing_toast": "Disabled Safe Browsing", "enabled_safe_browsing_toast": "Enabled Safe Browsing", </s> remove "blocked_safebrowsing": "Blocked by Safebrowsing", "blocked_adult_websites": "Blocked Adult Websites", </s> add "blocked_safebrowsing": "Blocked by Safe Browsing", "blocked_adult_websites": "Blocked by Parental Control",
[ "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: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove /^bind_port:/ { port = $2 } END { if (match(host, ":")) { print "http://[" host "]:" port } else { print "http://" host ":" port } } </s> add /^[[:space:]]+address:/ { if (is_http) print "http://" $2 } </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove } </s> add </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil </s> add addrPort := netip.AddrPortFrom(config.HTTPConfig.Address.Addr(), uint16(port)) return aghnet.CheckPort("tcp", addrPort) == nil </s> remove port := config.BindPort </s> add port := int(config.HTTPConfig.Address.Port())
[ "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> print "http://[" host "]:" port <mask> } else { <mask> print "http://" host ":" port <mask> } <mask> } </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove /^bind_host:/ { host = $2 } </s> add /^[^[:space:]]/ { is_http = /^http:/ } </s> remove port := config.BindPort </s> add port := int(config.HTTPConfig.Address.Port()) </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove } </s> add </s> remove switch portInt { case 0, config.BindPort: </s> add switch reqPort { case 0, config.HTTPConfig.Address.Port():
[ "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 configuration file <mask> // It's reset after config is parsed <mask> fileData []byte <mask> </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove // field ordering is important -- yaml fields will mirror ordering from here </s> add // 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 session is automatically refreshed once a day. SessionTTL timeutil.Duration `yaml:"session_ttl"` } // dnsConfig is a block with DNS configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` </s> add // HTTPConfig is the block with http conf. HTTPConfig httpConfig `yaml:"http"` </s> remove if !conf.BindHost.IsValid() { return errors.Error("bind_host is not a valid ip address") </s> add if !conf.HTTPConfig.Address.IsValid() { return errors.Error("http.address is not a valid ip address") </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort)) </s> remove // TTL for a web session (in hours) // An active session is automatically refreshed once a day. WebSessionTTLHours uint32 `yaml:"web_session_ttl"` </s> add
[ "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 interface server to listen on. <mask> BindPort int `yaml:"bind_port"` <mask> <mask> // Users are the clients capable for accessing the web interface. <mask> Users []webUser `yaml:"users"` <mask> // AuthAttempts is the maximum number of failed login attempts a user <mask> // can do before being blocked. <mask> AuthAttempts uint `yaml:"auth_attempts"` </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove // configuration is loaded from YAML // field ordering is important -- yaml fields will mirror ordering from here </s> add // configuration is loaded from YAML. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove // field ordering is important -- yaml fields will mirror ordering from here </s> add // 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 session is automatically refreshed once a day. SessionTTL timeutil.Duration `yaml:"session_ttl"` } // dnsConfig is a block with DNS configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove case config.BindPort: </s> add case config.HTTPConfig.Address.Port(): </s> remove // TTL for a web session (in hours) // An active session is automatically refreshed once a day. WebSessionTTLHours uint32 `yaml:"web_session_ttl"` </s> add </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort))
[ "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 uint32 `yaml:"web_session_ttl"` <mask> <mask> DNS dnsConfig `yaml:"dns"` <mask> TLS tlsConfigSettings `yaml:"tls"` <mask> QueryLog queryLogConfig `yaml:"querylog"` <mask> Stats statsConfig `yaml:"statistics"` <mask> </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove // field ordering is important -- yaml fields will mirror ordering from here </s> add // 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 session is automatically refreshed once a day. SessionTTL timeutil.Duration `yaml:"session_ttl"` } // dnsConfig is a block with DNS configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` </s> add // HTTPConfig is the block with http conf. HTTPConfig httpConfig `yaml:"http"` </s> remove // configuration is loaded from YAML // field ordering is important -- yaml fields will mirror ordering from here </s> add // configuration is loaded from YAML. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove if !conf.BindHost.IsValid() { return errors.Error("bind_host is not a valid ip address") </s> add if !conf.HTTPConfig.Address.IsValid() { return errors.Error("http.address is not a valid ip address") </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort))
[ "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 session is automatically refreshed once a day. SessionTTL timeutil.Duration `yaml:"session_ttl"` } // dnsConfig is a block with DNS configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary.
<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 []netip.Addr `yaml:"bind_hosts"` <mask> Port int `yaml:"port"` <mask> <mask> // AnonymizeClientIP defines if clients' IP addresses should be anonymized </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove // configuration is loaded from YAML // field ordering is important -- yaml fields will mirror ordering from here </s> add // configuration is loaded from YAML. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove // TTL for a web session (in hours) // An active session is automatically refreshed once a day. WebSessionTTLHours uint32 `yaml:"web_session_ttl"` </s> add </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort) </s> remove printWebAddrs(proto, bindhost.String(), port) </s> add printWebAddrs(proto, bindHost.String(), port) </s> remove HTTPPort int `json:"http_port"` </s> add HTTPPort uint16 `json:"http_port"`
[ "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> AuthBlockMin: 15, <mask> WebSessionTTLHours: 30 * 24, <mask> DNS: dnsConfig{ <mask> BindHosts: []netip.Addr{netip.IPv4Unspecified()}, <mask> Port: defaultPortDNS, <mask> FilteringConfig: dnsforward.FilteringConfig{ <mask> ProtectionEnabled: true, // whether or not use any of filtering features </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove // configuration is loaded from YAML // field ordering is important -- yaml fields will mirror ordering from here </s> add // configuration is loaded from YAML. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort)) </s> remove // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` </s> add // HTTPConfig is the block with http conf. HTTPConfig httpConfig `yaml:"http"` </s> remove // field ordering is important -- yaml fields will mirror ordering from here </s> add // 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 session is automatically refreshed once a day. SessionTTL timeutil.Duration `yaml:"session_ttl"` } // dnsConfig is a block with DNS configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove if !conf.BindHost.IsValid() { return errors.Error("bind_host is not a valid ip address") </s> add if !conf.HTTPConfig.Address.IsValid() { return errors.Error("http.address is not a valid ip address")
[ "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> } <mask> <mask> for i, addr := range conf.DNS.BindHosts { <mask> if !addr.IsValid() { <mask> return fmt.Errorf("dns.bind_hosts at index %d is not a valid ip address", i) </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove // field ordering is important -- yaml fields will mirror ordering from here </s> add // 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 session is automatically refreshed once a day. SessionTTL timeutil.Duration `yaml:"session_ttl"` } // dnsConfig is a block with DNS configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove addPorts(tcpPorts, tcpPort(config.BindPort)) </s> add addPorts(tcpPorts, tcpPort(config.HTTPConfig.Address.Port())) </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort)) </s> remove // configuration is loaded from YAML // field ordering is important -- yaml fields will mirror ordering from here </s> add // configuration is loaded from YAML. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr
[ "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: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove addPorts(tcpPorts, tcpPort(config.BindPort)) </s> add addPorts(tcpPorts, tcpPort(config.HTTPConfig.Address.Port())) </s> remove bindhost := config.BindHost if !bindhost.IsUnspecified() { printWebAddrs(proto, bindhost.String(), port) </s> add bindHost := config.HTTPConfig.Address.Addr() if !bindHost.IsUnspecified() { printWebAddrs(proto, bindHost.String(), port) </s> remove if opts.bindHost.IsValid() { config.BindHost = opts.bindHost </s> add return nil </s> remove port := req.DNS.Port </s> add port := uint16(req.DNS.Port) </s> remove if tlsConfUsesPrivilegedPorts(tlsConf) || config.BindPort < 1024 || config.DNS.Port < 1024 { </s> add if tlsConfUsesPrivilegedPorts(tlsConf) || config.HTTPConfig.Address.Port() < 1024 || config.DNS.Port < 1024 {
[ "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 <mask> // milliseconds. <mask> ProtectionDisabledDuration int64 `json:"protection_disabled_duration"` <mask> </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` </s> add // HTTPConfig is the block with http conf. HTTPConfig httpConfig `yaml:"http"` </s> remove // field ordering is important -- yaml fields will mirror ordering from here </s> add // 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 session is automatically refreshed once a day. SessionTTL timeutil.Duration `yaml:"session_ttl"` } // dnsConfig is a block with DNS configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove config.BindHost = req.Web.IP config.BindPort = req.Web.Port </s> add config.HTTPConfig.Address = netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port)) </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort)) </s> remove BindPort: 3000, BindHost: netip.IPv4Unspecified(), AuthAttempts: 5, AuthBlockMin: 15, WebSessionTTLHours: 30 * 24, </s> add AuthAttempts: 5, AuthBlockMin: 15, HTTPConfig: httpConfig{ Address: netip.AddrPortFrom(netip.IPv4Unspecified(), 3000), SessionTTL: timeutil.Duration{Duration: 30 * timeutil.Day}, },
[ "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: protectionDisabledDuration, <mask> ProtectionEnabled: protectionEnabled, <mask> IsRunning: isRunning(), <mask> } <mask> }() </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove BindHost: config.BindHost, BindPort: config.BindPort, </s> add BindHost: config.HTTPConfig.Address.Addr(), BindPort: int(config.HTTPConfig.Address.Port()), </s> remove port := req.DNS.Port </s> add port := uint16(req.DNS.Port) </s> remove BindPort: 3000, BindHost: netip.IPv4Unspecified(), AuthAttempts: 5, AuthBlockMin: 15, WebSessionTTLHours: 30 * 24, </s> add AuthAttempts: 5, AuthBlockMin: 15, HTTPConfig: httpConfig{ Address: netip.AddrPortFrom(netip.IPv4Unspecified(), 3000), SessionTTL: timeutil.Duration{Duration: 30 * timeutil.Day}, }, </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort)
[ "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 = tcpPorts.Validate(); err != nil { <mask> // Reset the value for the port to 1 to make sure that validateDNS <mask> // doesn't throw the same error, unless the same TCP port is set there <mask> // as well. </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove port := req.DNS.Port </s> add port := uint16(req.DNS.Port) </s> remove case config.BindPort: </s> add case config.HTTPConfig.Address.Port(): </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove port := config.BindPort </s> add port := int(config.HTTPConfig.Address.Port())
[ "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 #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort)) </s> remove case config.BindPort: </s> add case config.HTTPConfig.Address.Port(): </s> remove port := req.DNS.Port </s> add port := uint16(req.DNS.Port) </s> remove port := config.BindPort </s> add port := int(config.HTTPConfig.Address.Port()) </s> remove } </s> add
[ "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 configuration can't <mask> // be set. canAutofix is true if the port can be unbound by AdGuard Home <mask> // automatically. </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove switch portInt { case 0, config.BindPort: </s> add switch reqPort { case 0, config.HTTPConfig.Address.Port(): </s> remove case config.BindPort: </s> add case config.HTTPConfig.Address.Port(): </s> remove // field ordering is important -- yaml fields will mirror ordering from here </s> add // 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 session is automatically refreshed once a day. SessionTTL timeutil.Duration `yaml:"session_ttl"` } // dnsConfig is a block with DNS configuration params. // // Field ordering is important, YAML fields better not to be reordered, if it's // not absolutely necessary. </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort) </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil </s> add addrPort := netip.AddrPortFrom(config.HTTPConfig.Address.Addr(), uint16(port)) return aghnet.CheckPort("tcp", addrPort) == nil
[ "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 on and only check the UDP port since the TCP one is already bound </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove case config.BindPort: </s> add case config.HTTPConfig.Address.Port(): </s> remove switch portInt { case 0, config.BindPort: </s> add switch reqPort { case 0, config.HTTPConfig.Address.Port(): </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort) </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort)) </s> remove port := config.BindPort </s> add port := int(config.HTTPConfig.Address.Port())
[ "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> addPorts(tcpPorts, tcpPort(port)) </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove port := req.DNS.Port </s> add port := uint16(req.DNS.Port) </s> remove switch portInt { case 0, config.BindPort: </s> add switch reqPort { case 0, config.HTTPConfig.Address.Port(): </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort)) </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort) </s> remove // BindHost is the address for the web interface server to listen on. BindHost netip.Addr `yaml:"bind_host"` // BindPort is the port for the web interface server to listen on. BindPort int `yaml:"bind_port"` </s> add // HTTPConfig is the block with http conf. HTTPConfig httpConfig `yaml:"http"`
[ "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.DNS.Port = src.DNS.Port <mask> } <mask> <mask> // shutdownTimeout is the timeout for shutting HTTP server down operation. </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort) </s> remove config.BindHost = req.Web.IP config.BindPort = req.Web.Port </s> add config.HTTPConfig.Address = netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port)) </s> remove const currentSchemaVersion = 22 </s> add const currentSchemaVersion = 23
[ "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> // TODO(e.burkov): StartMods() should be put in a separate goroutine at the <mask> // moment we'll allow setting up TLS in the initial configuration or the </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> add addrPort := config.HTTPConfig.Address restartHTTP = addrPort.Addr() != req.Web.IP || int(addrPort.Port()) != req.Web.Port </s> remove // Rewrite deprecated options. bindAddr := opts.bindAddr if bindAddr.IsValid() { config.BindHost = bindAddr.Addr() config.BindPort = int(bindAddr.Port()) </s> add if opts.bindPort != 0 { config.HTTPConfig.Address = netip.AddrPortFrom( config.HTTPConfig.Address.Addr(), uint16(opts.bindPort), ) </s> remove port := config.BindPort </s> add port := int(config.HTTPConfig.Address.Port()) </s> remove dst.BindHost = src.BindHost dst.BindPort = src.BindPort </s> add dst.HTTPConfig = src.HTTPConfig </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort)
[ "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, uint16(req.Web.Port))) <mask> if err != nil { <mask> return nil, false, fmt.Errorf( <mask> "checking address %s:%d: %w", </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove if tlsConfUsesPrivilegedPorts(tlsConf) || config.BindPort < 1024 || config.DNS.Port < 1024 { </s> add if tlsConfUsesPrivilegedPorts(tlsConf) || config.HTTPConfig.Address.Port() < 1024 || config.DNS.Port < 1024 { </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove // Rewrite deprecated options. bindAddr := opts.bindAddr if bindAddr.IsValid() { config.BindHost = bindAddr.Addr() config.BindPort = int(bindAddr.Port()) </s> add if opts.bindPort != 0 { config.HTTPConfig.Address = netip.AddrPortFrom( config.HTTPConfig.Address.Addr(), uint16(opts.bindPort), ) </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil </s> add addrPort := netip.AddrPortFrom(config.HTTPConfig.Address.Addr(), uint16(port)) return aghnet.CheckPort("tcp", addrPort) == nil
[ "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> return fmt.Errorf("checking ability to bind privileged ports: %w", err) <mask> } <mask> } </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> add addrPort := config.HTTPConfig.Address restartHTTP = addrPort.Addr() != req.Web.IP || int(addrPort.Port()) != req.Web.Port </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil </s> add addrPort := netip.AddrPortFrom(config.HTTPConfig.Address.Addr(), uint16(port)) return aghnet.CheckPort("tcp", addrPort) == nil </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove // Rewrite deprecated options. bindAddr := opts.bindAddr if bindAddr.IsValid() { config.BindHost = bindAddr.Addr() config.BindPort = int(bindAddr.Port()) </s> add if opts.bindPort != 0 { config.HTTPConfig.Address = netip.AddrPortFrom( config.HTTPConfig.Address.Addr(), uint16(opts.bindPort), )
[ "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, because it's informative enough as is. <mask> return err </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove // Rewrite deprecated options. bindAddr := opts.bindAddr if bindAddr.IsValid() { config.BindHost = bindAddr.Addr() config.BindPort = int(bindAddr.Port()) </s> add if opts.bindPort != 0 { config.HTTPConfig.Address = netip.AddrPortFrom( config.HTTPConfig.Address.Addr(), uint16(opts.bindPort), ) </s> remove } </s> add </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort) </s> remove restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> add addrPort := config.HTTPConfig.Address restartHTTP = addrPort.Addr() != req.Web.IP || int(addrPort.Port()) != req.Web.Port
[ "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> <mask> if opts.bindHost.IsValid() { <mask> config.BindHost = opts.bindHost </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove // Rewrite deprecated options. bindAddr := opts.bindAddr if bindAddr.IsValid() { config.BindHost = bindAddr.Addr() config.BindPort = int(bindAddr.Port()) </s> add if opts.bindPort != 0 { config.HTTPConfig.Address = netip.AddrPortFrom( config.HTTPConfig.Address.Addr(), uint16(opts.bindPort), ) </s> remove } </s> add </s> remove if opts.bindHost.IsValid() { config.BindHost = opts.bindHost </s> add return nil </s> remove restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> add addrPort := config.HTTPConfig.Address restartHTTP = addrPort.Addr() != req.Web.IP || int(addrPort.Port()) != req.Web.Port
[ "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 commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove // Rewrite deprecated options. bindAddr := opts.bindAddr if bindAddr.IsValid() { config.BindHost = bindAddr.Addr() config.BindPort = int(bindAddr.Port()) </s> add if opts.bindPort != 0 { config.HTTPConfig.Address = netip.AddrPortFrom( config.HTTPConfig.Address.Addr(), uint16(opts.bindPort), ) </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove if opts.bindHost.IsValid() { config.BindHost = opts.bindHost </s> add return nil
[ "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. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove // Rewrite deprecated options. bindAddr := opts.bindAddr if bindAddr.IsValid() { config.BindHost = bindAddr.Addr() config.BindPort = int(bindAddr.Port()) </s> add if opts.bindPort != 0 { config.HTTPConfig.Address = netip.AddrPortFrom( config.HTTPConfig.Address.Addr(), uint16(opts.bindPort), ) </s> remove } </s> add </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 }
[ "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> err = checkPorts() <mask> if err != nil { <mask> // Don't wrap the error, because it's informative enough as is. <mask> return err </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 } </s> remove } </s> add </s> remove if opts.bindHost.IsValid() { config.BindHost = opts.bindHost </s> add return nil </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> add addrPort := config.HTTPConfig.Address restartHTTP = addrPort.Addr() != req.Web.IP || int(addrPort.Port()) != req.Web.Port
[ "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: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, reqPort)) </s> remove if opts.bindHost.IsValid() { config.BindHost = opts.bindHost </s> add return nil </s> remove } </s> add </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil </s> add addrPort := netip.AddrPortFrom(config.HTTPConfig.Address.Addr(), uint16(port)) return aghnet.CheckPort("tcp", addrPort) == nil </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 }
[ "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(config.DNS.Port)) <mask> <mask> if config.TLS.Enabled { </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove addPorts(tcpPorts, tcpPort(config.BindPort)) </s> add addPorts(tcpPorts, tcpPort(config.HTTPConfig.Address.Port())) </s> remove if !conf.BindHost.IsValid() { return errors.Error("bind_host is not a valid ip address") </s> add if !conf.HTTPConfig.Address.IsValid() { return errors.Error("http.address is not a valid ip address") </s> remove if opts.bindPort != 0 { config.BindPort = opts.bindPort </s> add bindAddr := opts.bindAddr if bindAddr != (netip.AddrPort{}) { config.HTTPConfig.Address = bindAddr </s> remove portInt := req.Web.Port port := tcpPort(portInt) </s> add // TODO(a.garipov): Declare all port variables anywhere as uint16. reqPort := uint16(req.Web.Port) port := tcpPort(reqPort) </s> remove err = checkPorts() if err != nil { // Don't wrap the error, because it's informative enough as is. return err </s> add 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 }
[ "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> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove HTTPPort: config.BindPort, </s> add HTTPPort: config.HTTPConfig.Address.Port(), </s> remove BindPort: 3000, BindHost: netip.IPv4Unspecified(), AuthAttempts: 5, AuthBlockMin: 15, WebSessionTTLHours: 30 * 24, </s> add AuthAttempts: 5, AuthBlockMin: 15, HTTPConfig: httpConfig{ Address: netip.AddrPortFrom(netip.IPv4Unspecified(), 3000), SessionTTL: timeutil.Duration{Duration: 30 * timeutil.Day}, }, </s> remove printWebAddrs(proto, addr.String(), config.BindPort) </s> add printWebAddrs(proto, addr.String(), port) </s> remove bindhost := config.BindHost if !bindhost.IsUnspecified() { printWebAddrs(proto, bindhost.String(), port) </s> add bindHost := config.HTTPConfig.Address.Addr() if !bindHost.IsUnspecified() { printWebAddrs(proto, bindHost.String(), port)
[ "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") <mask> } <mask> <mask> config.Users = nil </s> Pull request: home: http conf Updates #2860. Squashed commit of the following: commit 0d55a99d5c0b9f1d8c9497775dd69929e5091eaa Merge: 73a203ac8 d4a4bda64 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:25:36 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 73a203ac8acf083fa289015e1f301d05bf320ea7 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 16:21:48 2023 +0400 home: imp docs commit a4819ace94bfe4427f70f1b8341c9babc9234740 Author: Dimitry Kolyshev <[email protected]> Date: Thu Jun 29 11:45:30 2023 +0400 snap: imp script commit b0913c7ac5c6c46d6a73790fd57d8c5f9d7ace75 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 17:34:03 2023 +0400 all: docs commit 14820d6d56f958081d9f236277fd34f356bdab33 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:21:43 2023 +0400 home: imp tests commit 9db800d3ce39c36da7959e37b4a46736f4217e5c Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 13:17:34 2023 +0400 all: docs commit 9174a0ae710da51d85b4e1b1af79eda6a61dd3a2 Merge: ca8c4ae95 d88181343 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:19:01 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf # Conflicts: # CHANGELOG.md # internal/home/upgrade.go # internal/home/upgrade_test.go commit ca8c4ae954ece25d78ef2f873bb3ba71fa4b8fa9 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 10:07:15 2023 +0400 snap: imp script commit d84473f8e07b2c6e65023613eb4032fd01951521 Author: Dimitry Kolyshev <[email protected]> Date: Wed Jun 28 09:59:57 2023 +0400 snap: imp script commit 8a0808e42ddbff7d9d3345d758f91b14bb4453be Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 15:03:53 2023 +0400 home: http conf commit e8fbb89cc5748f9d8fa4be9e702756bd8b869de9 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 14:59:37 2023 +0400 home: imp code commit 46541aabc421118562d564675dfd7e594d2056aa Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:36:14 2023 +0400 snap: bind port commit cecda5fcfd8c473db42f235b4f586b2193086997 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 12:12:39 2023 +0400 docker: bind port commit 8d8945b70366c6b018616a32421c77eb281a6ea1 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:06:32 2023 +0400 home: imp code commit ae5e8c1c4333d7b752c08605d80e41f55ee50e59 Author: Dimitry Kolyshev <[email protected]> Date: Tue Jun 27 11:02:09 2023 +0400 home: imp code commit c9ee460f37e32941b84ea5fa94d21b186d6dd82b Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 17:11:10 2023 +0400 home: imp code commit 44c72445112ef38d6ec9c25b197c119edd6c959f Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:52:19 2023 +0400 all: docs commit e3bf5faeb748f347b1202a496788739ff9219ed0 Merge: 38cc0f639 e7e638443 Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:39:12 2023 +0400 Merge remote-tracking branch 'origin/master' into http-yaml-conf commit 38cc0f6399040f1fa39d9da31ad6db65a6bdd4cc Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:38:17 2023 +0400 snap: bind port commit 3b9cb9e8cc89a67e55cecc7a2040c150f8675b4c Author: Dimitry Kolyshev <[email protected]> Date: Mon Jun 26 11:25:03 2023 +0400 docker: bind port ... and 4 more commits </s> remove restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> add addrPort := config.HTTPConfig.Address restartHTTP = addrPort.Addr() != req.Web.IP || int(addrPort.Port()) != req.Web.Port </s> remove port := config.BindPort </s> add port := int(config.HTTPConfig.Address.Port()) </s> remove /^bind_port:/ { port = $2 } END { if (match(host, ":")) { print "http://[" host "]:" port } else { print "http://" host ":" port } } </s> add /^[[:space:]]+address:/ { if (is_http) print "http://" $2 } </s> remove if opts.bindHost.IsValid() { config.BindHost = opts.bindHost </s> add return nil </s> remove return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil </s> add addrPort := netip.AddrPortFrom(config.HTTPConfig.Address.Addr(), uint16(port)) return aghnet.CheckPort("tcp", addrPort) == nil
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/39f5c50acd9da08dca22a0a3170f3f47446210df
internal/home/home.go