docstring_tokens
stringlengths 18
16.9k
| code_tokens
stringlengths 75
1.81M
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|
keep add keep keep keep keep keep | <mask> "fmt"
<mask> "io"
<mask> "os/exec"
<mask> "path"
<mask> "runtime"
<mask> "strconv"
<mask> "strings"
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove "os"
"path/filepath"
</s> add "path" </s> remove "os"
"path/filepath"
</s> add "io/fs" </s> add "testing/fstest" </s> add "sync/atomic" </s> remove "os"
</s> add </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/os.go |
keep keep add keep keep keep keep keep | <mask> }
<mask>
<mask> func isOpenWrt() (ok bool) {
<mask> var err error
<mask> ok, err = FileWalker(func(r io.Reader) (_ []string, cont bool, err error) {
<mask> const osNameData = "openwrt"
<mask>
<mask> // This use of ReadAll is now safe, because FileWalker's Walk()
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove dir := testFSGen{
"bad_filename.txt": []byte("[]"),
}.gen(t)
fw := FileWalker(func(r io.Reader) (patterns []string, cont bool, err error) {
</s> add const filename = "bad_filename.txt"
f := fstest.MapFS{
filename: &fstest.MapFile{Data: []byte("[]")},
}
ok, err := FileWalker(func(r io.Reader) (patterns []string, cont bool, err error) { </s> remove return aghos.FileWalker(interfaceName(ifaceName).rcConfStaticConfig).Walk(filename)
</s> add walker := aghos.FileWalker(interfaceName(ifaceName).rcConfStaticConfig)
return walker.Walk(aghos.RootDirFS(), rcConfFilename) </s> remove return aghos.FileWalker(hostnameIfStaticConfig).Walk(filename)
</s> add return aghos.FileWalker(hostnameIfStaticConfig).Walk(aghos.RootDirFS(), filename) </s> remove dir := testFSGen{
"mockfile.txt": []byte(`mockdata`),
}.gen(t)
</s> add f := fstest.MapFS{
"mockfile.txt": &fstest.MapFile{Data: []byte(`mockdata`)},
} </s> remove }).Walk(filepath.Join(dir, "*"))
require.Error(t, err)
require.False(t, ok)
</s> add }).Walk(f, "*")
require.ErrorIs(t, err, rerr) </s> remove makeFileWalker := func(dirName string) (fw FileWalker) {
</s> add makeFileWalker := func(_ string) (fw FileWalker) { | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/os_linux.go |
keep keep keep keep replace keep keep keep | <mask> return nil, false, err
<mask> }
<mask>
<mask> return nil, !stringutil.ContainsFold(string(data), osNameData), nil
<mask> }).Walk("/etc/*release*")
<mask>
<mask> return err == nil && ok
<mask> }
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove patterns = append(patterns, filepath.Join(dirName, line))
</s> add patterns = append(patterns, path.Join(".", line)) </s> remove if errors.Is(err, os.ErrNotExist) {
// Ignore non-existing files since this may only happen
// when the file was removed after filepath.Glob matched
// it.
</s> add if errors.Is(err, fs.ErrNotExist) {
// Ignore non-existing files since this may only happen when the
// file was removed after filepath.Glob matched it. </s> remove // A rewrite of a host to itself. Go on and try
// matching other things.
</s> add // A rewrite of a host to itself. Go on and try matching other
// things. </s> remove }).Walk(filepath.Join(dir, "*"))
require.Error(t, err)
require.False(t, ok)
</s> add }).Walk(f, "*")
require.ErrorIs(t, err, rerr) </s> remove // checkEtcHosts compares the host against our /etc/hosts table. The err is
// always nil, it is only there to make this a valid hostChecker function.
func (d *DNSFilter) checkEtcHosts(
host string,
qtype uint16,
_ *Settings,
) (res Result, err error) {
if d.Config.EtcHosts == nil {
</s> add // matchSysHosts tries to match the host against the operating system's hosts
// database.
func (d *DNSFilter) matchSysHosts(host string, qtype uint16, setts *Settings) (res Result, err error) {
if d.EtcHosts == nil { </s> add emptyFS := fstest.MapFS{}
| https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/aghos/os_linux.go |
keep keep keep keep replace keep keep keep keep keep | <mask> "encoding/pem"
<mask> "fmt"
<mask> "math/big"
<mask> "net"
<mask> "os"
<mask> "sync"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> add "sync/atomic" </s> add "testing/fstest" </s> add "io/fs"
"os" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghtest" </s> remove "os"
"path/filepath"
</s> add "io/fs" </s> remove "os"
"path/filepath"
</s> add "path" | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/dnsforward/dnsforward_test.go |
keep keep keep add keep keep keep keep | <mask> "fmt"
<mask> "math/big"
<mask> "net"
<mask> "sync"
<mask> "testing"
<mask> "testing/fstest"
<mask> "time"
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove "os"
</s> add </s> add "testing/fstest" </s> add "testing/fstest" </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghtest" </s> add "io/fs"
"os" </s> remove "os"
"path/filepath"
</s> add "io/fs" | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/dnsforward/dnsforward_test.go |
keep keep keep add keep keep keep keep keep | <mask> "net"
<mask> "sync"
<mask> "sync/atomic"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> add "sync/atomic" </s> remove "os"
</s> add </s> add "github.com/AdguardTeam/AdGuardHome/internal/aghtest" </s> add "testing/fstest" </s> remove "os"
"path/filepath"
</s> add "path" </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/dnsforward/dnsforward_test.go |
keep keep replace replace keep keep replace replace keep keep keep | <mask>
<mask> func TestPTRResponseFromHosts(t *testing.T) {
<mask> c := filtering.Config{
<mask> EtcHosts: &aghnet.EtcHostsContainer{},
<mask> }
<mask>
<mask> // Prepare test hosts file.
<mask> hf, err := os.CreateTemp("", "")
<mask> require.NoError(t, err)
<mask> t.Cleanup(func() {
<mask> assert.NoError(t, hf.Close())
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove assert.NoError(t, hf.Close())
assert.NoError(t, os.Remove(hf.Name()))
})
</s> add assert.Equal(t, uint32(1), atomic.LoadUint32(&eventsCalledCounter)) </s> remove c.EtcHosts.Init(hf.Name())
t.Cleanup(c.EtcHosts.Close)
</s> add c := filtering.Config{
EtcHosts: hc,
} </s> add emptyFS := fstest.MapFS{}
</s> remove _, ok, err := checkFile(nil, "lol")
</s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> add type errFS struct {
fs.GlobFS
}
const errErrFSOpen errors.Error = "this error is always returned"
func (efs *errFS) Open(name string) (fs.File, error) {
return nil, errErrFSOpen
}
| https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/dnsforward/dnsforward_test.go |
keep keep keep keep replace replace replace keep replace replace keep | <mask> // Prepare test hosts file.
<mask> hf, err := os.CreateTemp("", "")
<mask> require.NoError(t, err)
<mask> t.Cleanup(func() {
<mask> assert.NoError(t, hf.Close())
<mask> assert.NoError(t, os.Remove(hf.Name()))
<mask> })
<mask>
<mask> _, _ = hf.WriteString(" 127.0.0.1 host # comment \n")
<mask> _, _ = hf.WriteString(" ::1 localhost#comment \n")
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove c.EtcHosts.Init(hf.Name())
t.Cleanup(c.EtcHosts.Close)
</s> add c := filtering.Config{
EtcHosts: hc,
} </s> remove c := filtering.Config{
EtcHosts: &aghnet.EtcHostsContainer{},
</s> add // Prepare test hosts file.
const hostsFilename = "hosts"
testFS := fstest.MapFS{
hostsFilename: &fstest.MapFile{Data: []byte(`
127.0.0.1 host # comment
::1 localhost#comment
`)}, </s> remove // Prepare test hosts file.
hf, err := os.CreateTemp("", "")
</s> add const closeCalled errors.Error = "close method called"
var eventsCalledCounter uint32
hc, err := aghnet.NewHostsContainer(testFS, &aghtest.FSWatcher{
OnEvents: func() (e <-chan struct{}) {
assert.Equal(t, uint32(1), atomic.AddUint32(&eventsCalledCounter, 1))
return nil
},
OnAdd: func(name string) (err error) {
assert.Equal(t, hostsFilename, name)
return nil
},
OnClose: func() (err error) { return closeCalled },
}, hostsFilename) </s> remove _, ok, err := checkFile(nil, "lol")
</s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> remove const badPath = "\x00"
_, ok, err := checkFile(nil, badPath)
require.Error(t, err)
</s> add _, ok, err := checkFile(&errFS{}, nil, "")
require.ErrorIs(t, err, errErrFSOpen) | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/dnsforward/dnsforward_test.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask>
<mask> _, _ = hf.WriteString(" 127.0.0.1 host # comment \n")
<mask> _, _ = hf.WriteString(" ::1 localhost#comment \n")
<mask>
<mask> c.EtcHosts.Init(hf.Name())
<mask> t.Cleanup(c.EtcHosts.Close)
<mask>
<mask> var snd *aghnet.SubnetDetector
<mask> snd, err = aghnet.NewSubnetDetector()
<mask> require.NoError(t, err)
<mask> require.NotNil(t, snd)
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove _, _ = hf.WriteString(" 127.0.0.1 host # comment \n")
_, _ = hf.WriteString(" ::1 localhost#comment \n")
</s> add require.ErrorIs(t, hc.Close(), closeCalled)
}) </s> remove assert.NoError(t, hf.Close())
assert.NoError(t, os.Remove(hf.Name()))
})
</s> add assert.Equal(t, uint32(1), atomic.LoadUint32(&eventsCalledCounter)) </s> remove c := filtering.Config{
EtcHosts: &aghnet.EtcHostsContainer{},
</s> add // Prepare test hosts file.
const hostsFilename = "hosts"
testFS := fstest.MapFS{
hostsFilename: &fstest.MapFile{Data: []byte(`
127.0.0.1 host # comment
::1 localhost#comment
`)}, </s> remove _, ok, err := checkFile(nil, "lol")
</s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> add emptyFS := fstest.MapFS{}
</s> remove testDir := tc.testFS.gen(t)
fw := makeFileWalker(testDir)
</s> add fw := makeFileWalker("") | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/dnsforward/dnsforward_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> resp, err := dns.Exchange(req, addr.String())
<mask> require.NoError(t, err)
<mask>
<mask> require.Len(t, resp.Answer, 1)
<mask>
<mask> assert.Equal(t, dns.TypePTR, resp.Answer[0].Header().Rrtype)
<mask> assert.Equal(t, "1.0.0.127.in-addr.arpa.", resp.Answer[0].Header().Name)
<mask>
<mask> ptr, ok := resp.Answer[0].(*dns.PTR)
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove assert.Equal(t, tc.want, ok)
</s> add tc.want(t, ok) </s> remove ok, err := fw.Walk(filepath.Join(testDir, tc.initPattern))
</s> add ok, err := fw.Walk(tc.testFS, tc.initPattern) </s> remove // TODO(e.burkov): Use assert.ErrorsIs within the error from
// less platform-dependent package instead of syscall.EINVAL.
//
// See https://github.com/golang/go/issues/46849 and
// https://github.com/golang/go/issues/30322.
pathErr := &os.PathError{}
require.ErrorAs(t, err, &pathErr)
assert.Equal(t, "open", pathErr.Op)
assert.Equal(t, badPath, pathErr.Path)
</s> add })
t.Run("ignore_dirs", func(t *testing.T) {
const dirName = "dir"
testFS := fstest.MapFS{
path.Join(dirName, "file"): &fstest.MapFile{Data: []byte{}},
}
patterns, ok, err := checkFile(testFS, nil, dirName)
require.NoError(t, err)
assert.Empty(t, patterns)
assert.True(t, ok) </s> remove assert.NoError(t, hf.Close())
assert.NoError(t, os.Remove(hf.Name()))
})
</s> add assert.Equal(t, uint32(1), atomic.LoadUint32(&eventsCalledCounter)) </s> remove // Prepare test hosts file.
hf, err := os.CreateTemp("", "")
</s> add const closeCalled errors.Error = "close method called"
var eventsCalledCounter uint32
hc, err := aghnet.NewHostsContainer(testFS, &aghtest.FSWatcher{
OnEvents: func() (e <-chan struct{}) {
assert.Equal(t, uint32(1), atomic.AddUint32(&eventsCalledCounter, 1))
return nil
},
OnAdd: func(name string) (err error) {
assert.Equal(t, hostsFilename, name)
return nil
},
OnClose: func() (err error) { return closeCalled },
}, hostsFilename) </s> remove c := filtering.Config{
EtcHosts: &aghnet.EtcHostsContainer{},
</s> add // Prepare test hosts file.
const hostsFilename = "hosts"
testFS := fstest.MapFS{
hostsFilename: &fstest.MapFile{Data: []byte(`
127.0.0.1 host # comment
::1 localhost#comment
`)}, | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/dnsforward/dnsforward_test.go |
keep keep keep keep replace replace replace keep keep keep keep keep | <mask> // DNSRewriteResultResponse is the collection of DNS response records
<mask> // the server returns.
<mask> type DNSRewriteResultResponse map[rules.RRType][]rules.RRValue
<mask>
<mask> // processDNSRewrites processes DNS rewrite rules in dnsr. It returns
<mask> // an empty result if dnsr is empty. Otherwise, the result will have
<mask> // either CanonName or DNSRewriteResult set.
<mask> func (d *DNSFilter) processDNSRewrites(dnsr []*rules.NetworkRule) (res Result) {
<mask> if len(dnsr) == 0 {
<mask> return Result{}
<mask> }
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove // ServiceName is the name of the blocked service. It is empty
// unless Reason is set to FilteredBlockedService.
</s> add // ServiceName is the name of the blocked service. It is empty unless
// Reason is set to FilteredBlockedService. </s> remove // A rewrite of a host to itself. Go on and try
// matching other things.
</s> add // A rewrite of a host to itself. Go on and try matching other
// things. </s> remove // CanonName is the CNAME value from the lookup rewrite result.
// It is empty unless Reason is set to Rewritten or RewrittenRule.
</s> add // CanonName is the CNAME value from the lookup rewrite result. It is empty
// unless Reason is set to Rewritten or RewrittenRule. </s> remove // IPList is the lookup rewrite result. It is empty unless
// Reason is set to RewrittenAutoHosts or Rewritten.
</s> add // IPList is the lookup rewrite result. It is empty unless Reason is set to
// RewrittenAutoHosts or Rewritten. </s> remove // checkEtcHosts compares the host against our /etc/hosts table. The err is
// always nil, it is only there to make this a valid hostChecker function.
func (d *DNSFilter) checkEtcHosts(
host string,
qtype uint16,
_ *Settings,
) (res Result, err error) {
if d.Config.EtcHosts == nil {
</s> add // matchSysHosts tries to match the host against the operating system's hosts
// database.
func (d *DNSFilter) matchSysHosts(host string, qtype uint16, setts *Settings) (res Result, err error) {
if d.EtcHosts == nil { </s> remove return res, nil
</s> add dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/dnsrewrite.go |
keep keep keep keep replace keep keep keep keep keep | <mask> BlockedServices []string `yaml:"blocked_services"`
<mask>
<mask> // EtcHosts is a container of IP-hostname pairs taken from the operating
<mask> // system configuration files (e.g. /etc/hosts).
<mask> EtcHosts *aghnet.EtcHostsContainer `yaml:"-"`
<mask>
<mask> // Called when the configuration is changed by HTTP request
<mask> ConfigModified func() `yaml:"-"`
<mask>
<mask> // Register an HTTP handler
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove clients clientsContainer // per-client-settings module
stats stats.Stats // statistics module
queryLog querylog.QueryLog // query log module
dnsServer *dnsforward.Server // DNS module
rdns *RDNS // rDNS module
whois *WHOIS // WHOIS module
dnsFilter *filtering.DNSFilter // DNS filtering module
dhcpServer *dhcpd.Server // DHCP module
auth *Auth // HTTP authentication module
filters Filtering // DNS filtering module
web *Web // Web (HTTP, HTTPS) module
tls *TLSMod // TLS module
etcHosts *aghnet.EtcHostsContainer // IP-hostname pairs taken from system configuration (e.g. /etc/hosts) files
updater *updater.Updater
</s> add clients clientsContainer // per-client-settings module
stats stats.Stats // statistics module
queryLog querylog.QueryLog // query log module
dnsServer *dnsforward.Server // DNS module
rdns *RDNS // rDNS module
whois *WHOIS // WHOIS module
dnsFilter *filtering.DNSFilter // DNS filtering module
dhcpServer *dhcpd.Server // DHCP module
auth *Auth // HTTP authentication module
filters Filtering // DNS filtering module
web *Web // Web (HTTP, HTTPS) module
tls *TLSMod // TLS module
// etcHosts is an IP-hostname pairs set taken from system configuration
// (e.g. /etc/hosts) files.
etcHosts *aghnet.HostsContainer
updater *updater.Updater </s> remove etcHosts *aghnet.EtcHostsContainer // get entries from system hosts-files
</s> add // etcHosts contains list of rewrite rules taken from the operating system's
// hosts databse.
etcHosts *aghnet.HostsContainer </s> remove // AddHost adds a new IP-hostname pairing. The priorities of the sources is
</s> add // AddHost adds a new IP-hostname pairing. The priorities of the sources are </s> remove // Rewritten is returned when there was a rewrite by a legacy DNS
// rewrite rule.
</s> add // Rewritten is returned when there was a rewrite by a legacy DNS rewrite
// rule. </s> remove // should be valid for filepath.Glob. If cont is false, the walking terminates.
// Each opened file is also limited for reading to MaxWalkedFileSize.
</s> add // should be valid for fs.Glob. If cont is false, the walking terminates. Each
// opened file is also limited for reading to MaxWalkedFileSize. </s> remove // Walk starts walking the files defined by initPattern. It only returns true
// if c signed to stop walking.
func (c FileWalker) Walk(initPattern string) (ok bool, err error) {
// The slice of sources keeps the order in which the files are walked
// since srcSet.Values() returns strings in undefined order.
</s> add // Walk starts walking the files in fsys defined by patterns from initial.
// It only returns true if fw signed to stop walking.
func (fw FileWalker) Walk(fsys fs.FS, initial ...string) (ok bool, err error) {
// The slice of sources keeps the order in which the files are walked since
// srcSet.Values() returns strings in undefined order. | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> FilteredSafeSearch
<mask> // FilteredBlockedService - the host is blocked by "blocked services" settings
<mask> FilteredBlockedService
<mask>
<mask> // Rewritten is returned when there was a rewrite by a legacy DNS
<mask> // rewrite rule.
<mask> Rewritten
<mask>
<mask> // RewrittenAutoHosts is returned when there was a rewrite by autohosts
<mask> // rules (/etc/hosts and so on).
<mask> RewrittenAutoHosts
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove // TODO(a.garipov): Remove Rewritten and RewrittenAutoHosts by merging
// their functionality into RewrittenRule.
</s> add // TODO(a.garipov): Remove Rewritten and RewrittenAutoHosts by merging their
// functionality into RewrittenRule. </s> remove // A rewrite of a host to itself. Go on and try
// matching other things.
</s> add // A rewrite of a host to itself. Go on and try matching other
// things. </s> remove // CanonName is the CNAME value from the lookup rewrite result.
// It is empty unless Reason is set to Rewritten or RewrittenRule.
</s> add // CanonName is the CNAME value from the lookup rewrite result. It is empty
// unless Reason is set to Rewritten or RewrittenRule. </s> remove // IPList is the lookup rewrite result. It is empty unless
// Reason is set to RewrittenAutoHosts or Rewritten.
</s> add // IPList is the lookup rewrite result. It is empty unless Reason is set to
// RewrittenAutoHosts or Rewritten. </s> remove EtcHosts *aghnet.EtcHostsContainer `yaml:"-"`
</s> add EtcHosts *aghnet.HostsContainer `yaml:"-"` </s> add d.engineLock.RLock()
// Keep in mind that this lock must be held no just when calling Match() but
// also while using the rules returned by it.
//
// TODO(e.burkov): Inspect if the above is true.
defer d.engineLock.RUnlock()
| https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> RewrittenAutoHosts
<mask>
<mask> // RewrittenRule is returned when a $dnsrewrite filter rule was applied.
<mask> //
<mask> // TODO(a.garipov): Remove Rewritten and RewrittenAutoHosts by merging
<mask> // their functionality into RewrittenRule.
<mask> //
<mask> // See https://github.com/AdguardTeam/AdGuardHome/issues/2499.
<mask> RewrittenRule
<mask> )
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove // Rewritten is returned when there was a rewrite by a legacy DNS
// rewrite rule.
</s> add // Rewritten is returned when there was a rewrite by a legacy DNS rewrite
// rule. </s> remove // ServiceName is the name of the blocked service. It is empty
// unless Reason is set to FilteredBlockedService.
</s> add // ServiceName is the name of the blocked service. It is empty unless
// Reason is set to FilteredBlockedService. </s> remove // IPList is the lookup rewrite result. It is empty unless
// Reason is set to RewrittenAutoHosts or Rewritten.
</s> add // IPList is the lookup rewrite result. It is empty unless Reason is set to
// RewrittenAutoHosts or Rewritten. </s> remove // CanonName is the CNAME value from the lookup rewrite result.
// It is empty unless Reason is set to Rewritten or RewrittenRule.
</s> add // CanonName is the CNAME value from the lookup rewrite result. It is empty
// unless Reason is set to Rewritten or RewrittenRule. </s> remove // A rewrite of a host to itself. Go on and try
// matching other things.
</s> add // A rewrite of a host to itself. Go on and try matching other
// things. </s> remove // checkFile tries to open and process a single file located on sourcePath.
func checkFile(c FileWalker, sourcePath string) (patterns []string, cont bool, err error) {
var f *os.File
f, err = os.Open(sourcePath)
</s> add // checkFile tries to open and process a single file located on sourcePath in
// the specified fsys. The path is skipped if it's a directory.
func checkFile(
fsys fs.FS,
c FileWalker,
sourcePath string,
) (patterns []string, cont bool, err error) {
var f fs.File
f, err = fsys.Open(sourcePath) | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep replace replace keep keep replace replace | <mask> Reason Reason `json:",omitempty"`
<mask>
<mask> // Rules are applied rules. If Rules are not empty, each rule
<mask> // is not nil.
<mask> Rules []*ResultRule `json:",omitempty"`
<mask>
<mask> // ReverseHosts is the reverse lookup rewrite result. It is
<mask> // empty unless Reason is set to RewrittenAutoHosts.
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove // IPList is the lookup rewrite result. It is empty unless
// Reason is set to RewrittenAutoHosts or Rewritten.
</s> add // IPList is the lookup rewrite result. It is empty unless Reason is set to
// RewrittenAutoHosts or Rewritten. </s> remove // CanonName is the CNAME value from the lookup rewrite result.
// It is empty unless Reason is set to Rewritten or RewrittenRule.
</s> add // CanonName is the CNAME value from the lookup rewrite result. It is empty
// unless Reason is set to Rewritten or RewrittenRule. </s> remove // ServiceName is the name of the blocked service. It is empty
// unless Reason is set to FilteredBlockedService.
</s> add // ServiceName is the name of the blocked service. It is empty unless
// Reason is set to FilteredBlockedService. </s> remove // processDNSRewrites processes DNS rewrite rules in dnsr. It returns
// an empty result if dnsr is empty. Otherwise, the result will have
// either CanonName or DNSRewriteResult set.
</s> add // processDNSRewrites processes DNS rewrite rules in dnsr. It returns an empty
// result if dnsr is empty. Otherwise, the result will have either CanonName or
// DNSRewriteResult set. </s> remove for _, pair := range []struct {
</s> add for _, pair := range [...]struct { | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace replace keep keep replace replace keep | <mask> // ReverseHosts is the reverse lookup rewrite result. It is
<mask> // empty unless Reason is set to RewrittenAutoHosts.
<mask> ReverseHosts []string `json:",omitempty"`
<mask>
<mask> // IPList is the lookup rewrite result. It is empty unless
<mask> // Reason is set to RewrittenAutoHosts or Rewritten.
<mask> IPList []net.IP `json:",omitempty"`
<mask>
<mask> // CanonName is the CNAME value from the lookup rewrite result.
<mask> // It is empty unless Reason is set to Rewritten or RewrittenRule.
<mask> CanonName string `json:",omitempty"`
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove // ReverseHosts is the reverse lookup rewrite result. It is
// empty unless Reason is set to RewrittenAutoHosts.
</s> add // ReverseHosts is the reverse lookup rewrite result. It is empty unless
// Reason is set to RewrittenAutoHosts. </s> remove // ServiceName is the name of the blocked service. It is empty
// unless Reason is set to FilteredBlockedService.
</s> add // ServiceName is the name of the blocked service. It is empty unless
// Reason is set to FilteredBlockedService. </s> remove // Rules are applied rules. If Rules are not empty, each rule
// is not nil.
</s> add // Rules are applied rules. If Rules are not empty, each rule is not nil. </s> remove // processDNSRewrites processes DNS rewrite rules in dnsr. It returns
// an empty result if dnsr is empty. Otherwise, the result will have
// either CanonName or DNSRewriteResult set.
</s> add // processDNSRewrites processes DNS rewrite rules in dnsr. It returns an empty
// result if dnsr is empty. Otherwise, the result will have either CanonName or
// DNSRewriteResult set. </s> remove // Rewritten is returned when there was a rewrite by a legacy DNS
// rewrite rule.
</s> add // Rewritten is returned when there was a rewrite by a legacy DNS rewrite
// rule. | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> // CanonName is the CNAME value from the lookup rewrite result.
<mask> // It is empty unless Reason is set to Rewritten or RewrittenRule.
<mask> CanonName string `json:",omitempty"`
<mask>
<mask> // ServiceName is the name of the blocked service. It is empty
<mask> // unless Reason is set to FilteredBlockedService.
<mask> ServiceName string `json:",omitempty"`
<mask>
<mask> // DNSRewriteResult is the $dnsrewrite filter rule result.
<mask> DNSRewriteResult *DNSRewriteResult `json:",omitempty"`
<mask> }
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove // CanonName is the CNAME value from the lookup rewrite result.
// It is empty unless Reason is set to Rewritten or RewrittenRule.
</s> add // CanonName is the CNAME value from the lookup rewrite result. It is empty
// unless Reason is set to Rewritten or RewrittenRule. </s> remove // IPList is the lookup rewrite result. It is empty unless
// Reason is set to RewrittenAutoHosts or Rewritten.
</s> add // IPList is the lookup rewrite result. It is empty unless Reason is set to
// RewrittenAutoHosts or Rewritten. </s> remove // ReverseHosts is the reverse lookup rewrite result. It is
// empty unless Reason is set to RewrittenAutoHosts.
</s> add // ReverseHosts is the reverse lookup rewrite result. It is empty unless
// Reason is set to RewrittenAutoHosts. </s> remove // Rules are applied rules. If Rules are not empty, each rule
// is not nil.
</s> add // Rules are applied rules. If Rules are not empty, each rule is not nil. </s> remove // processDNSRewrites processes DNS rewrite rules in dnsr. It returns
// an empty result if dnsr is empty. Otherwise, the result will have
// either CanonName or DNSRewriteResult set.
</s> add // processDNSRewrites processes DNS rewrite rules in dnsr. It returns an empty
// result if dnsr is empty. Otherwise, the result will have either CanonName or
// DNSRewriteResult set. </s> remove // TODO(a.garipov): Remove Rewritten and RewrittenAutoHosts by merging
// their functionality into RewrittenRule.
</s> add // TODO(a.garipov): Remove Rewritten and RewrittenAutoHosts by merging their
// functionality into RewrittenRule. | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep replace replace replace replace replace replace replace replace keep keep keep replace replace replace replace replace replace | <mask>
<mask> // checkEtcHosts compares the host against our /etc/hosts table. The err is
<mask> // always nil, it is only there to make this a valid hostChecker function.
<mask> func (d *DNSFilter) checkEtcHosts(
<mask> host string,
<mask> qtype uint16,
<mask> _ *Settings,
<mask> ) (res Result, err error) {
<mask> if d.Config.EtcHosts == nil {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> ips := d.Config.EtcHosts.Process(host, qtype)
<mask> if ips != nil {
<mask> res = Result{
<mask> Reason: RewrittenAutoHosts,
<mask> IPList: ips,
<mask> }
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove return res, nil
</s> add dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil </s> remove revHosts := d.Config.EtcHosts.ProcessReverse(host, qtype)
if len(revHosts) != 0 {
res = Result{
Reason: RewrittenAutoHosts,
}
</s> add var ips []net.IP
var revHosts []string </s> remove // A rewrite of a host to itself. Go on and try
// matching other things.
</s> add // A rewrite of a host to itself. Go on and try matching other
// things. </s> remove return Result{}, nil
</s> add return Result{
Reason: RewrittenAutoHosts,
IPList: ips,
ReverseHosts: revHosts,
}, nil </s> remove // TODO(a.garipov): Optimize this with a buffer.
res.ReverseHosts = make([]string, len(revHosts))
for i := range revHosts {
res.ReverseHosts[i] = revHosts[i] + "."
</s> add for _, nr := range dnsr {
dr := nr.DNSRewrite
if dr == nil {
continue | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace keep keep keep keep keep | <mask> Reason: RewrittenAutoHosts,
<mask> IPList: ips,
<mask> }
<mask>
<mask> return res, nil
<mask> }
<mask>
<mask> revHosts := d.Config.EtcHosts.ProcessReverse(host, qtype)
<mask> if len(revHosts) != 0 {
<mask> res = Result{
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove revHosts := d.Config.EtcHosts.ProcessReverse(host, qtype)
if len(revHosts) != 0 {
res = Result{
Reason: RewrittenAutoHosts,
}
</s> add var ips []net.IP
var revHosts []string </s> remove ips := d.Config.EtcHosts.Process(host, qtype)
if ips != nil {
res = Result{
Reason: RewrittenAutoHosts,
IPList: ips,
}
</s> add dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
Hostname: host,
SortedClientTags: setts.ClientTags,
// TODO(e.burkov): Wait for urlfilter update to pass net.IP.
ClientIP: setts.ClientIP.String(),
ClientName: setts.ClientName,
DNSType: qtype,
}) </s> remove // TODO(a.garipov): Optimize this with a buffer.
res.ReverseHosts = make([]string, len(revHosts))
for i := range revHosts {
res.ReverseHosts[i] = revHosts[i] + "."
</s> add for _, nr := range dnsr {
dr := nr.DNSRewrite
if dr == nil {
continue </s> remove return Result{}, nil
</s> add return Result{
Reason: RewrittenAutoHosts,
IPList: ips,
ReverseHosts: revHosts,
}, nil </s> remove return res, nil
</s> add switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
} </s> remove // A rewrite of a host to itself. Go on and try
// matching other things.
</s> add // A rewrite of a host to itself. Go on and try matching other
// things. | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep replace replace replace replace replace keep replace replace replace replace keep keep | <mask> }
<mask>
<mask> revHosts := d.Config.EtcHosts.ProcessReverse(host, qtype)
<mask> if len(revHosts) != 0 {
<mask> res = Result{
<mask> Reason: RewrittenAutoHosts,
<mask> }
<mask>
<mask> // TODO(a.garipov): Optimize this with a buffer.
<mask> res.ReverseHosts = make([]string, len(revHosts))
<mask> for i := range revHosts {
<mask> res.ReverseHosts[i] = revHosts[i] + "."
<mask> }
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove return res, nil
</s> add dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil </s> remove return res, nil
</s> add switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
} </s> remove ips := d.Config.EtcHosts.Process(host, qtype)
if ips != nil {
res = Result{
Reason: RewrittenAutoHosts,
IPList: ips,
}
</s> add dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
Hostname: host,
SortedClientTags: setts.ClientTags,
// TODO(e.burkov): Wait for urlfilter update to pass net.IP.
ClientIP: setts.ClientIP.String(),
ClientName: setts.ClientName,
DNSType: qtype,
}) </s> remove return Result{}, nil
</s> add return Result{
Reason: RewrittenAutoHosts,
IPList: ips,
ReverseHosts: revHosts,
}, nil </s> remove matches, err = filepath.Glob(p)
</s> add matches, err = fs.Glob(fsys, p) | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep replace keep keep keep keep keep keep keep keep replace | <mask> }
<mask>
<mask> return res, nil
<mask> }
<mask>
<mask> return Result{}, nil
<mask> }
<mask>
<mask> return res, nil
<mask> }
<mask>
<mask> return Result{}, nil
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove return res, nil
</s> add dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil </s> remove ips := d.Config.EtcHosts.Process(host, qtype)
if ips != nil {
res = Result{
Reason: RewrittenAutoHosts,
IPList: ips,
}
</s> add dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
Hostname: host,
SortedClientTags: setts.ClientTags,
// TODO(e.burkov): Wait for urlfilter update to pass net.IP.
ClientIP: setts.ClientIP.String(),
ClientName: setts.ClientName,
DNSType: qtype,
}) </s> remove // A rewrite of a host to itself. Go on and try
// matching other things.
</s> add // A rewrite of a host to itself. Go on and try matching other
// things. </s> remove // TODO(a.garipov): Optimize this with a buffer.
res.ReverseHosts = make([]string, len(revHosts))
for i := range revHosts {
res.ReverseHosts[i] = revHosts[i] + "."
</s> add for _, nr := range dnsr {
dr := nr.DNSRewrite
if dr == nil {
continue </s> remove // checkEtcHosts compares the host against our /etc/hosts table. The err is
// always nil, it is only there to make this a valid hostChecker function.
func (d *DNSFilter) checkEtcHosts(
host string,
qtype uint16,
_ *Settings,
) (res Result, err error) {
if d.Config.EtcHosts == nil {
</s> add // matchSysHosts tries to match the host against the operating system's hosts
// database.
func (d *DNSFilter) matchSysHosts(host string, qtype uint16, setts *Settings) (res Result, err error) {
if d.EtcHosts == nil { | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep replace replace replace replace replace replace replace keep replace keep keep keep keep | <mask>
<mask> d.engineLock.Lock()
<mask> d.reset()
<mask> d.rulesStorage = rulesStorage
<mask> d.filteringEngine = filteringEngine
<mask> d.rulesStorageAllow = rulesStorageAllow
<mask> d.filteringEngineAllow = filteringEngineAllow
<mask> d.engineLock.Unlock()
<mask>
<mask> // Make sure that the OS reclaims memory as soon as possible
<mask> debug.FreeOSMemory()
<mask> log.Debug("initialized filtering engine")
<mask>
<mask> return nil
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> add d.engineLock.RLock()
// Keep in mind that this lock must be held no just when calling Match() but
// also while using the rules returned by it.
//
// TODO(e.burkov): Inspect if the above is true.
defer d.engineLock.RUnlock()
</s> add var fi fs.FileInfo
if fi, err = f.Stat(); err != nil {
return nil, true, err
}
if fi.IsDir() {
// Skip the directories.
return nil, true, nil
}
</s> remove // Ignore the error since LimitReader function returns error only if
// passed limit value is less than zero, but the constant used.
</s> add // Ignore the error since LimitReader function returns error only if passed
// limit value is less than zero, but the constant used. </s> remove d.engineLock.RLock()
// Keep in mind that this lock must be held no just when calling Match()
// but also while using the rules returned by it.
defer d.engineLock.RUnlock()
</s> add </s> remove clients clientsContainer // per-client-settings module
stats stats.Stats // statistics module
queryLog querylog.QueryLog // query log module
dnsServer *dnsforward.Server // DNS module
rdns *RDNS // rDNS module
whois *WHOIS // WHOIS module
dnsFilter *filtering.DNSFilter // DNS filtering module
dhcpServer *dhcpd.Server // DHCP module
auth *Auth // HTTP authentication module
filters Filtering // DNS filtering module
web *Web // Web (HTTP, HTTPS) module
tls *TLSMod // TLS module
etcHosts *aghnet.EtcHostsContainer // IP-hostname pairs taken from system configuration (e.g. /etc/hosts) files
updater *updater.Updater
</s> add clients clientsContainer // per-client-settings module
stats stats.Stats // statistics module
queryLog querylog.QueryLog // query log module
dnsServer *dnsforward.Server // DNS module
rdns *RDNS // rDNS module
whois *WHOIS // WHOIS module
dnsFilter *filtering.DNSFilter // DNS filtering module
dhcpServer *dhcpd.Server // DHCP module
auth *Auth // HTTP authentication module
filters Filtering // DNS filtering module
web *Web // Web (HTTP, HTTPS) module
tls *TLSMod // TLS module
// etcHosts is an IP-hostname pairs set taken from system configuration
// (e.g. /etc/hosts) files.
etcHosts *aghnet.HostsContainer
updater *updater.Updater | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> return res
<mask> }
<mask>
<mask> if dnsres.HostRulesV4 != nil || dnsres.HostRulesV6 != nil {
<mask> // Question type doesn't match the host rules. Return the first
<mask> // matched host rule, but without an IP address.
<mask> var matchedRules []rules.Rule
<mask> if dnsres.HostRulesV4 != nil {
<mask> matchedRules = []rules.Rule{dnsres.HostRulesV4[0]}
<mask> } else if dnsres.HostRulesV6 != nil {
<mask> matchedRules = []rules.Rule{dnsres.HostRulesV6[0]}
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove // A rewrite of a host to itself. Go on and try
// matching other things.
</s> add // A rewrite of a host to itself. Go on and try matching other
// things. </s> remove // checkEtcHosts compares the host against our /etc/hosts table. The err is
// always nil, it is only there to make this a valid hostChecker function.
func (d *DNSFilter) checkEtcHosts(
host string,
qtype uint16,
_ *Settings,
) (res Result, err error) {
if d.Config.EtcHosts == nil {
</s> add // matchSysHosts tries to match the host against the operating system's hosts
// database.
func (d *DNSFilter) matchSysHosts(host string, qtype uint16, setts *Settings) (res Result, err error) {
if d.EtcHosts == nil { </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} </s> remove return res, nil
</s> add dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil </s> remove Context.etcHosts = &aghnet.EtcHostsContainer{}
Context.etcHosts.Init("")
</s> add var osWritesWatcher aghos.FSWatcher
osWritesWatcher, err = aghos.NewOSWritesWatcher()
if err != nil {
return fmt.Errorf("initing os watcher: %w", err)
}
Context.etcHosts, err = aghnet.NewHostsContainer(
aghos.RootDirFS(),
osWritesWatcher,
aghnet.DefaultHostsPaths()...,
)
if err != nil {
return fmt.Errorf("initing hosts container: %w", err)
} | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace replace replace replace replace keep keep keep keep keep | <mask> if !setts.FilteringEnabled {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> d.engineLock.RLock()
<mask> // Keep in mind that this lock must be held no just when calling Match()
<mask> // but also while using the rules returned by it.
<mask> defer d.engineLock.RUnlock()
<mask>
<mask> ureq := urlfilter.DNSRequest{
<mask> Hostname: host,
<mask> SortedClientTags: setts.ClientTags,
<mask> // TODO(e.burkov): Wait for urlfilter update to pass net.IP.
<mask> ClientIP: setts.ClientIP.String(),
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> add d.engineLock.RLock()
// Keep in mind that this lock must be held no just when calling Match() but
// also while using the rules returned by it.
//
// TODO(e.burkov): Inspect if the above is true.
defer d.engineLock.RUnlock()
</s> remove ips := d.Config.EtcHosts.Process(host, qtype)
if ips != nil {
res = Result{
Reason: RewrittenAutoHosts,
IPList: ips,
}
</s> add dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
Hostname: host,
SortedClientTags: setts.ClientTags,
// TODO(e.burkov): Wait for urlfilter update to pass net.IP.
ClientIP: setts.ClientIP.String(),
ClientName: setts.ClientName,
DNSType: qtype,
}) </s> remove // handlePatterns parses the patterns and ignores duplicates using srcSet.
// srcSet must be non-nil.
func handlePatterns(srcSet *stringutil.Set, patterns ...string) (sub []string, err error) {
</s> add // handlePatterns parses the patterns in fsys and ignores duplicates using
// srcSet. srcSet must be non-nil.
func handlePatterns(
fsys fs.FS,
srcSet *stringutil.Set,
patterns ...string,
) (sub []string, err error) { </s> remove // should be valid for filepath.Glob. If cont is false, the walking terminates.
// Each opened file is also limited for reading to MaxWalkedFileSize.
</s> add // should be valid for fs.Glob. If cont is false, the walking terminates. Each
// opened file is also limited for reading to MaxWalkedFileSize. </s> remove // TODO(e.burkov): Consider moving to the separate package like pathutil.
</s> add // TODO(e.burkov, a.garipov): Move into another package like aghfs. </s> remove // Rewritten is returned when there was a rewrite by a legacy DNS
// rewrite rule.
</s> add // Rewritten is returned when there was a rewrite by a legacy DNS rewrite
// rule. | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep add keep keep keep keep keep keep | <mask> }
<mask>
<mask> if d.filteringEngineAllow != nil {
<mask> dnsres, ok := d.filteringEngineAllow.MatchRequest(ureq)
<mask> if ok {
<mask> return d.matchHostProcessAllowList(host, dnsres)
<mask> }
<mask> }
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove ips := d.Config.EtcHosts.Process(host, qtype)
if ips != nil {
res = Result{
Reason: RewrittenAutoHosts,
IPList: ips,
}
</s> add dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
Hostname: host,
SortedClientTags: setts.ClientTags,
// TODO(e.burkov): Wait for urlfilter update to pass net.IP.
ClientIP: setts.ClientIP.String(),
ClientName: setts.ClientName,
DNSType: qtype,
}) </s> remove }).Walk("/etc/*release*")
</s> add }).Walk(RootDirFS(), etcReleasePattern) </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} </s> remove if err := Context.dnsFilter.SetFilters(filters, whiteFilters, async); err != nil {
</s> add if err := Context.dnsFilter.SetFilters(filters, allowFilters, async); err != nil { </s> remove return aghos.FileWalker(hostnameIfStaticConfig).Walk(filename)
</s> add return aghos.FileWalker(hostnameIfStaticConfig).Walk(aghos.RootDirFS(), filename) | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> // Check DNS rewrites first, because the API there is a bit awkward.
<mask> if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
<mask> res = d.processDNSRewrites(dnsr)
<mask> if res.Reason == RewrittenRule && res.CanonName == host {
<mask> // A rewrite of a host to itself. Go on and try
<mask> // matching other things.
<mask> } else {
<mask> return res, nil
<mask> }
<mask> } else if !ok {
<mask> return Result{}, nil
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove return res, nil
</s> add dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil </s> remove // checkEtcHosts compares the host against our /etc/hosts table. The err is
// always nil, it is only there to make this a valid hostChecker function.
func (d *DNSFilter) checkEtcHosts(
host string,
qtype uint16,
_ *Settings,
) (res Result, err error) {
if d.Config.EtcHosts == nil {
</s> add // matchSysHosts tries to match the host against the operating system's hosts
// database.
func (d *DNSFilter) matchSysHosts(host string, qtype uint16, setts *Settings) (res Result, err error) {
if d.EtcHosts == nil { </s> remove // TODO(a.garipov): Optimize this with a buffer.
res.ReverseHosts = make([]string, len(revHosts))
for i := range revHosts {
res.ReverseHosts[i] = revHosts[i] + "."
</s> add for _, nr := range dnsr {
dr := nr.DNSRewrite
if dr == nil {
continue </s> remove // Question type doesn't match the host rules. Return the first
// matched host rule, but without an IP address.
</s> add // Question type doesn't match the host rules. Return the first matched
// host rule, but without an IP address. </s> remove // processDNSRewrites processes DNS rewrite rules in dnsr. It returns
// an empty result if dnsr is empty. Otherwise, the result will have
// either CanonName or DNSRewriteResult set.
</s> add // processDNSRewrites processes DNS rewrite rules in dnsr. It returns an empty
// result if dnsr is empty. Otherwise, the result will have either CanonName or
// DNSRewriteResult set. </s> remove // Rewritten is returned when there was a rewrite by a legacy DNS
// rewrite rule.
</s> add // Rewritten is returned when there was a rewrite by a legacy DNS rewrite
// rule. | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> resolver: resolver,
<mask> }
<mask>
<mask> d.hostCheckers = []hostChecker{{
<mask> check: d.checkEtcHosts,
<mask> name: "etchosts",
<mask> }, {
<mask> check: d.matchHost,
<mask> name: "filtering",
<mask> }, {
<mask> check: matchBlockedServicesRules,
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove testFS: testFSGen{
"no_0001.txt": []byte(nl),
"no_0002.txt": []byte(nl),
"no_0003.txt": []byte(nl),
</s> add testFS: fstest.MapFS{
"no_0001.txt": &fstest.MapFile{Data: []byte(nl)},
"no_0002.txt": &fstest.MapFile{Data: []byte(nl)},
"no_0003.txt": &fstest.MapFile{Data: []byte(nl)}, </s> remove testFS: testFSGen{
"simple_0001.txt": []byte(attribute + nl),
</s> add testFS: fstest.MapFS{
"simple_0001.txt": &fstest.MapFile{Data: []byte(attribute + nl)}, </s> remove testFS: testFSGen{
"chain_0001.txt": []byte(`chain_0002.txt` + nl),
"chain_0002.txt": []byte(`chain_0003.txt` + nl),
"chain_0003.txt": []byte(attribute + nl),
</s> add testFS: fstest.MapFS{
"chain_0001.txt": &fstest.MapFile{Data: []byte(`chain_0002.txt` + nl)},
"chain_0002.txt": &fstest.MapFile{Data: []byte(`chain_0003.txt` + nl)},
"chain_0003.txt": &fstest.MapFile{Data: []byte(attribute + nl)}, </s> remove testFS: testFSGen{
"several_0001.txt": []byte(`several_*` + nl),
"several_0002.txt": []byte(`several_0001.txt` + nl),
"several_0003.txt": []byte(attribute + nl),
</s> add testFS: fstest.MapFS{
"several_0001.txt": &fstest.MapFile{Data: []byte(`several_*` + nl)},
"several_0002.txt": &fstest.MapFile{Data: []byte(`several_0001.txt` + nl)},
"several_0003.txt": &fstest.MapFile{Data: []byte(attribute + nl)}, </s> remove want: false,
</s> add want: assert.False, </s> remove want: true,
</s> add want: assert.True, | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/filtering/filtering.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // dnsServer is used for checking clients IP status access list status
<mask> dnsServer *dnsforward.Server
<mask>
<mask> etcHosts *aghnet.EtcHostsContainer // get entries from system hosts-files
<mask>
<mask> testing bool // if TRUE, this object is used for internal tests
<mask> }
<mask>
<mask> // Init initializes clients container
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove clients clientsContainer // per-client-settings module
stats stats.Stats // statistics module
queryLog querylog.QueryLog // query log module
dnsServer *dnsforward.Server // DNS module
rdns *RDNS // rDNS module
whois *WHOIS // WHOIS module
dnsFilter *filtering.DNSFilter // DNS filtering module
dhcpServer *dhcpd.Server // DHCP module
auth *Auth // HTTP authentication module
filters Filtering // DNS filtering module
web *Web // Web (HTTP, HTTPS) module
tls *TLSMod // TLS module
etcHosts *aghnet.EtcHostsContainer // IP-hostname pairs taken from system configuration (e.g. /etc/hosts) files
updater *updater.Updater
</s> add clients clientsContainer // per-client-settings module
stats stats.Stats // statistics module
queryLog querylog.QueryLog // query log module
dnsServer *dnsforward.Server // DNS module
rdns *RDNS // rDNS module
whois *WHOIS // WHOIS module
dnsFilter *filtering.DNSFilter // DNS filtering module
dhcpServer *dhcpd.Server // DHCP module
auth *Auth // HTTP authentication module
filters Filtering // DNS filtering module
web *Web // Web (HTTP, HTTPS) module
tls *TLSMod // TLS module
// etcHosts is an IP-hostname pairs set taken from system configuration
// (e.g. /etc/hosts) files.
etcHosts *aghnet.HostsContainer
updater *updater.Updater </s> remove EtcHosts *aghnet.EtcHostsContainer `yaml:"-"`
</s> add EtcHosts *aghnet.HostsContainer `yaml:"-"` </s> remove // testFSDir maps entries' names to entries which should either be a testFSDir
// or byte slice.
type testFSDir map[string]interface{}
// testFSGen is used to generate a temporary filesystem consisting of
// directories and plain text files from itself.
type testFSGen testFSDir
// gen returns the name of top directory of the generated filesystem.
func (g testFSGen) gen(t *testing.T) (dirName string) {
t.Helper()
dirName = t.TempDir()
g.rangeThrough(t, dirName)
return dirName
}
func (g testFSGen) rangeThrough(t *testing.T, dirName string) {
const perm fs.FileMode = 0o777
for k, e := range g {
switch e := e.(type) {
case []byte:
require.NoError(t, os.WriteFile(filepath.Join(dirName, k), e, perm))
case testFSDir:
newDir := filepath.Join(dirName, k)
require.NoError(t, os.Mkdir(newDir, perm))
testFSGen(e).rangeThrough(t, newDir)
default:
t.Fatalf("unexpected entry type %T", e)
}
}
}
</s> add </s> remove etcHosts *aghnet.EtcHostsContainer,
</s> add etcHosts *aghnet.HostsContainer, </s> remove func (clients *clientsContainer) onHostsChanged() {
clients.addFromHostsFile()
}
</s> add </s> remove return Result{}, nil
</s> add return Result{
Reason: RewrittenAutoHosts,
IPList: ips,
ReverseHosts: revHosts,
}, nil | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/clients.go |
keep keep keep keep replace keep keep keep keep keep | <mask> // Note: this function must be called only once
<mask> func (clients *clientsContainer) Init(
<mask> objects []clientObject,
<mask> dhcpServer *dhcpd.Server,
<mask> etcHosts *aghnet.EtcHostsContainer,
<mask> ) {
<mask> if clients.list != nil {
<mask> log.Fatal("clients.list != nil")
<mask> }
<mask> clients.list = make(map[string]*Client)
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove func (clients *clientsContainer) onHostsChanged() {
clients.addFromHostsFile()
}
</s> add </s> remove func (clients *clientsContainer) addFromHostsFile() {
if clients.etcHosts == nil {
return
}
hosts := clients.etcHosts.List()
</s> add func (clients *clientsContainer) addFromHostsFile(hosts *netutil.IPMap) { </s> remove // handlePatterns parses the patterns and ignores duplicates using srcSet.
// srcSet must be non-nil.
func handlePatterns(srcSet *stringutil.Set, patterns ...string) (sub []string, err error) {
</s> add // handlePatterns parses the patterns in fsys and ignores duplicates using
// srcSet. srcSet must be non-nil.
func handlePatterns(
fsys fs.FS,
srcSet *stringutil.Set,
patterns ...string,
) (sub []string, err error) { </s> add d.engineLock.RLock()
// Keep in mind that this lock must be held no just when calling Match() but
// also while using the rules returned by it.
//
// TODO(e.burkov): Inspect if the above is true.
defer d.engineLock.RUnlock()
</s> remove if errors.Is(err, os.ErrNotExist) {
// Ignore non-existing files since this may only happen
// when the file was removed after filepath.Glob matched
// it.
</s> add if errors.Is(err, fs.ErrNotExist) {
// Ignore non-existing files since this may only happen when the
// file was removed after filepath.Glob matched it. | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/clients.go |
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep | <mask> clients.dhcpServer = dhcpServer
<mask> clients.etcHosts = etcHosts
<mask> clients.addFromConfig(objects)
<mask>
<mask> if !clients.testing {
<mask> clients.updateFromDHCP(true)
<mask> if clients.dhcpServer != nil {
<mask> clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
<mask> }
<mask> if clients.etcHosts != nil {
<mask> clients.etcHosts.SetOnChanged(clients.onHostsChanged)
<mask> }
<mask> }
<mask> }
<mask>
<mask> // Start - start the module
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove etcHosts *aghnet.EtcHostsContainer,
</s> add etcHosts *aghnet.HostsContainer, </s> remove func (clients *clientsContainer) addFromHostsFile() {
if clients.etcHosts == nil {
return
}
hosts := clients.etcHosts.List()
</s> add func (clients *clientsContainer) addFromHostsFile(hosts *netutil.IPMap) { </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} </s> remove if err := Context.dnsFilter.SetFilters(filters, whiteFilters, async); err != nil {
</s> add if err := Context.dnsFilter.SetFilters(filters, allowFilters, async); err != nil { </s> remove Context.etcHosts = &aghnet.EtcHostsContainer{}
Context.etcHosts.Init("")
</s> add var osWritesWatcher aghos.FSWatcher
osWritesWatcher, err = aghos.NewOSWritesWatcher()
if err != nil {
return fmt.Errorf("initing os watcher: %w", err)
}
Context.etcHosts, err = aghnet.NewHostsContainer(
aghos.RootDirFS(),
osWritesWatcher,
aghnet.DefaultHostsPaths()...,
)
if err != nil {
return fmt.Errorf("initing hosts container: %w", err)
} </s> remove // Question type doesn't match the host rules. Return the first
// matched host rule, but without an IP address.
</s> add // Question type doesn't match the host rules. Return the first matched
// host rule, but without an IP address. | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/clients.go |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> clients.updateFromDHCP(false)
<mask> }
<mask> }
<mask>
<mask> func (clients *clientsContainer) onHostsChanged() {
<mask> clients.addFromHostsFile()
<mask> }
<mask>
<mask> // Exists checks if client with this IP address already exists.
<mask> func (clients *clientsContainer) Exists(ip net.IP, source clientSource) (ok bool) {
<mask> clients.lock.Lock()
<mask> defer clients.lock.Unlock()
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove func (clients *clientsContainer) addFromHostsFile() {
if clients.etcHosts == nil {
return
}
hosts := clients.etcHosts.List()
</s> add func (clients *clientsContainer) addFromHostsFile(hosts *netutil.IPMap) { </s> remove // AddHost adds a new IP-hostname pairing. The priorities of the sources is
</s> add // AddHost adds a new IP-hostname pairing. The priorities of the sources are </s> remove etcHosts *aghnet.EtcHostsContainer,
</s> add etcHosts *aghnet.HostsContainer, </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove filename := fmt.Sprintf("/etc/hostname.%s", ifaceName)
</s> add filename := fmt.Sprintf("etc/hostname.%s", ifaceName) </s> remove const filename = "/etc/rc.conf"
</s> add const rcConfFilename = "etc/rc.conf" | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/clients.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> log.Debug("clients: set whois info for runtime client with ip %s: %+v", ip, wi)
<mask> }
<mask>
<mask> // AddHost adds a new IP-hostname pairing. The priorities of the sources is
<mask> // taken into account. ok is true if the pairing was added.
<mask> func (clients *clientsContainer) AddHost(ip net.IP, host string, src clientSource) (ok bool, err error) {
<mask> clients.lock.Lock()
<mask> defer clients.lock.Unlock()
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove func (clients *clientsContainer) onHostsChanged() {
clients.addFromHostsFile()
}
</s> add </s> remove func (clients *clientsContainer) addFromHostsFile() {
if clients.etcHosts == nil {
return
}
hosts := clients.etcHosts.List()
</s> add func (clients *clientsContainer) addFromHostsFile(hosts *netutil.IPMap) { </s> remove // Walk starts walking the files defined by initPattern. It only returns true
// if c signed to stop walking.
func (c FileWalker) Walk(initPattern string) (ok bool, err error) {
// The slice of sources keeps the order in which the files are walked
// since srcSet.Values() returns strings in undefined order.
</s> add // Walk starts walking the files in fsys defined by patterns from initial.
// It only returns true if fw signed to stop walking.
func (fw FileWalker) Walk(fsys fs.FS, initial ...string) (ok bool, err error) {
// The slice of sources keeps the order in which the files are walked since
// srcSet.Values() returns strings in undefined order. </s> remove // checkEtcHosts compares the host against our /etc/hosts table. The err is
// always nil, it is only there to make this a valid hostChecker function.
func (d *DNSFilter) checkEtcHosts(
host string,
qtype uint16,
_ *Settings,
) (res Result, err error) {
if d.Config.EtcHosts == nil {
</s> add // matchSysHosts tries to match the host against the operating system's hosts
// database.
func (d *DNSFilter) matchSysHosts(host string, qtype uint16, setts *Settings) (res Result, err error) {
if d.EtcHosts == nil { </s> remove return aghos.FileWalker(hostnameIfStaticConfig).Walk(filename)
</s> add return aghos.FileWalker(hostnameIfStaticConfig).Walk(aghos.RootDirFS(), filename) </s> remove // checkFile tries to open and process a single file located on sourcePath.
func checkFile(c FileWalker, sourcePath string) (patterns []string, cont bool, err error) {
var f *os.File
f, err = os.Open(sourcePath)
</s> add // checkFile tries to open and process a single file located on sourcePath in
// the specified fsys. The path is skipped if it's a directory.
func checkFile(
fsys fs.FS,
c FileWalker,
sourcePath string,
) (patterns []string, cont bool, err error) {
var f fs.File
f, err = fsys.Open(sourcePath) | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/clients.go |
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep | <mask> }
<mask>
<mask> // addFromHostsFile fills the client-hostname pairing index from the system's
<mask> // hosts files.
<mask> func (clients *clientsContainer) addFromHostsFile() {
<mask> if clients.etcHosts == nil {
<mask> return
<mask> }
<mask>
<mask> hosts := clients.etcHosts.List()
<mask>
<mask> clients.lock.Lock()
<mask> defer clients.lock.Unlock()
<mask>
<mask> clients.rmHostsBySrc(ClientSourceHostsFile)
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove func (clients *clientsContainer) onHostsChanged() {
clients.addFromHostsFile()
}
</s> add </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove // AddHost adds a new IP-hostname pairing. The priorities of the sources is
</s> add // AddHost adds a new IP-hostname pairing. The priorities of the sources are </s> remove // checkEtcHosts compares the host against our /etc/hosts table. The err is
// always nil, it is only there to make this a valid hostChecker function.
func (d *DNSFilter) checkEtcHosts(
host string,
qtype uint16,
_ *Settings,
) (res Result, err error) {
if d.Config.EtcHosts == nil {
</s> add // matchSysHosts tries to match the host against the operating system's hosts
// database.
func (d *DNSFilter) matchSysHosts(host string, qtype uint16, setts *Settings) (res Result, err error) {
if d.EtcHosts == nil { </s> remove Context.etcHosts = &aghnet.EtcHostsContainer{}
Context.etcHosts.Init("")
</s> add var osWritesWatcher aghos.FSWatcher
osWritesWatcher, err = aghos.NewOSWritesWatcher()
if err != nil {
return fmt.Errorf("initing os watcher: %w", err)
}
Context.etcHosts, err = aghnet.NewHostsContainer(
aghos.RootDirFS(),
osWritesWatcher,
aghnet.DefaultHostsPaths()...,
)
if err != nil {
return fmt.Errorf("initing hosts container: %w", err)
} </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/clients.go |
keep keep keep keep replace keep keep keep keep keep | <mask> enableFiltersLocked(async)
<mask> }
<mask>
<mask> func enableFiltersLocked(async bool) {
<mask> var whiteFilters []filtering.Filter
<mask> filters := []filtering.Filter{{
<mask> Data: []byte(strings.Join(config.UserRules, "\n")),
<mask> }}
<mask>
<mask> for _, filter := range config.Filters {
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> add var allowFilters []filtering.Filter </s> remove testDir := tc.testFS.gen(t)
fw := makeFileWalker(testDir)
</s> add fw := makeFileWalker("") </s> remove want: true,
</s> add want: assert.True, </s> add func TestMain(m *testing.M) {
aghtest.DiscardLogOutput(m)
}
</s> remove // TODO(a.garipov): Optimize this with a buffer.
res.ReverseHosts = make([]string, len(revHosts))
for i := range revHosts {
res.ReverseHosts[i] = revHosts[i] + "."
</s> add for _, nr := range dnsr {
dr := nr.DNSRewrite
if dr == nil {
continue </s> remove for _, pair := range []struct {
</s> add for _, pair := range [...]struct { | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/filter.go |
keep keep add keep keep keep keep keep | <mask> FilePath: filter.Path(),
<mask> })
<mask> }
<mask> for _, filter := range config.WhitelistFilters {
<mask> if !filter.Enabled {
<mask> continue
<mask> }
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove whiteFilters = append(whiteFilters, filtering.Filter{
</s> add allowFilters = append(allowFilters, filtering.Filter{ </s> remove if err := Context.dnsFilter.SetFilters(filters, whiteFilters, async); err != nil {
</s> add if err := Context.dnsFilter.SetFilters(filters, allowFilters, async); err != nil { </s> remove // TODO(a.garipov): Optimize this with a buffer.
res.ReverseHosts = make([]string, len(revHosts))
for i := range revHosts {
res.ReverseHosts[i] = revHosts[i] + "."
</s> add for _, nr := range dnsr {
dr := nr.DNSRewrite
if dr == nil {
continue </s> remove var whiteFilters []filtering.Filter
</s> add </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove for _, pair := range []struct {
</s> add for _, pair := range [...]struct { | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/filter.go |
keep keep keep keep replace keep keep keep keep keep | <mask> if !filter.Enabled {
<mask> continue
<mask> }
<mask>
<mask> whiteFilters = append(whiteFilters, filtering.Filter{
<mask> ID: filter.ID,
<mask> FilePath: filter.Path(),
<mask> })
<mask> }
<mask>
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> add var allowFilters []filtering.Filter </s> remove if err := Context.dnsFilter.SetFilters(filters, whiteFilters, async); err != nil {
</s> add if err := Context.dnsFilter.SetFilters(filters, allowFilters, async); err != nil { </s> remove var whiteFilters []filtering.Filter
</s> add </s> remove // TODO(a.garipov): Optimize this with a buffer.
res.ReverseHosts = make([]string, len(revHosts))
for i := range revHosts {
res.ReverseHosts[i] = revHosts[i] + "."
</s> add for _, nr := range dnsr {
dr := nr.DNSRewrite
if dr == nil {
continue </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove Context.etcHosts = &aghnet.EtcHostsContainer{}
Context.etcHosts.Init("")
</s> add var osWritesWatcher aghos.FSWatcher
osWritesWatcher, err = aghos.NewOSWritesWatcher()
if err != nil {
return fmt.Errorf("initing os watcher: %w", err)
}
Context.etcHosts, err = aghnet.NewHostsContainer(
aghos.RootDirFS(),
osWritesWatcher,
aghnet.DefaultHostsPaths()...,
)
if err != nil {
return fmt.Errorf("initing hosts container: %w", err)
} | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/filter.go |
keep keep keep keep replace keep keep keep keep keep | <mask> FilePath: filter.Path(),
<mask> })
<mask> }
<mask>
<mask> if err := Context.dnsFilter.SetFilters(filters, whiteFilters, async); err != nil {
<mask> log.Debug("enabling filters: %s", err)
<mask> }
<mask>
<mask> Context.dnsFilter.SetEnabled(config.DNS.FilteringEnabled)
<mask> }
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} </s> add var allowFilters []filtering.Filter </s> remove whiteFilters = append(whiteFilters, filtering.Filter{
</s> add allowFilters = append(allowFilters, filtering.Filter{ </s> remove Context.etcHosts = &aghnet.EtcHostsContainer{}
Context.etcHosts.Init("")
</s> add var osWritesWatcher aghos.FSWatcher
osWritesWatcher, err = aghos.NewOSWritesWatcher()
if err != nil {
return fmt.Errorf("initing os watcher: %w", err)
}
Context.etcHosts, err = aghnet.NewHostsContainer(
aghos.RootDirFS(),
osWritesWatcher,
aghnet.DefaultHostsPaths()...,
)
if err != nil {
return fmt.Errorf("initing hosts container: %w", err)
} </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove ips := d.Config.EtcHosts.Process(host, qtype)
if ips != nil {
res = Result{
Reason: RewrittenAutoHosts,
IPList: ips,
}
</s> add dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
Hostname: host,
SortedClientTags: setts.ClientTags,
// TODO(e.burkov): Wait for urlfilter update to pass net.IP.
ClientIP: setts.ClientIP.String(),
ClientName: setts.ClientName,
DNSType: qtype,
}) | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/filter.go |
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep | <mask> type homeContext struct {
<mask> // Modules
<mask> // --
<mask>
<mask> clients clientsContainer // per-client-settings module
<mask> stats stats.Stats // statistics module
<mask> queryLog querylog.QueryLog // query log module
<mask> dnsServer *dnsforward.Server // DNS module
<mask> rdns *RDNS // rDNS module
<mask> whois *WHOIS // WHOIS module
<mask> dnsFilter *filtering.DNSFilter // DNS filtering module
<mask> dhcpServer *dhcpd.Server // DHCP module
<mask> auth *Auth // HTTP authentication module
<mask> filters Filtering // DNS filtering module
<mask> web *Web // Web (HTTP, HTTPS) module
<mask> tls *TLSMod // TLS module
<mask> etcHosts *aghnet.EtcHostsContainer // IP-hostname pairs taken from system configuration (e.g. /etc/hosts) files
<mask> updater *updater.Updater
<mask>
<mask> subnetDetector *aghnet.SubnetDetector
<mask>
<mask> // mux is our custom http.ServeMux.
<mask> mux *http.ServeMux
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove EtcHosts *aghnet.EtcHostsContainer `yaml:"-"`
</s> add EtcHosts *aghnet.HostsContainer `yaml:"-"` </s> remove etcHosts *aghnet.EtcHostsContainer // get entries from system hosts-files
</s> add // etcHosts contains list of rewrite rules taken from the operating system's
// hosts databse.
etcHosts *aghnet.HostsContainer </s> remove // processDNSRewrites processes DNS rewrite rules in dnsr. It returns
// an empty result if dnsr is empty. Otherwise, the result will have
// either CanonName or DNSRewriteResult set.
</s> add // processDNSRewrites processes DNS rewrite rules in dnsr. It returns an empty
// result if dnsr is empty. Otherwise, the result will have either CanonName or
// DNSRewriteResult set. </s> remove // Rewritten is returned when there was a rewrite by a legacy DNS
// rewrite rule.
</s> add // Rewritten is returned when there was a rewrite by a legacy DNS rewrite
// rule. </s> remove // AddHost adds a new IP-hostname pairing. The priorities of the sources is
</s> add // AddHost adds a new IP-hostname pairing. The priorities of the sources are | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/home.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> ConfName: config.getConfigFilename(),
<mask> })
<mask>
<mask> if !args.noEtcHosts {
<mask> Context.etcHosts = &aghnet.EtcHostsContainer{}
<mask> Context.etcHosts.Init("")
<mask> }
<mask> Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts)
<mask> config.Clients = nil
<mask>
<mask> // override bind host/port from the console
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} </s> remove func (clients *clientsContainer) addFromHostsFile() {
if clients.etcHosts == nil {
return
}
hosts := clients.etcHosts.List()
</s> add func (clients *clientsContainer) addFromHostsFile(hosts *netutil.IPMap) { </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove if err := Context.dnsFilter.SetFilters(filters, whiteFilters, async); err != nil {
</s> add if err := Context.dnsFilter.SetFilters(filters, allowFilters, async); err != nil { </s> remove ips := d.Config.EtcHosts.Process(host, qtype)
if ips != nil {
res = Result{
Reason: RewrittenAutoHosts,
IPList: ips,
}
</s> add dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
Hostname: host,
SortedClientTags: setts.ClientTags,
// TODO(e.burkov): Wait for urlfilter update to pass net.IP.
ClientIP: setts.ClientIP.String(),
ClientName: setts.ClientName,
DNSType: qtype,
}) </s> remove whiteFilters = append(whiteFilters, filtering.Filter{
</s> add allowFilters = append(allowFilters, filtering.Filter{ | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/home.go |
keep keep keep keep replace keep keep keep keep keep | <mask> err = initDNSServer()
<mask> fatalOnError(err)
<mask>
<mask> Context.tls.Start()
<mask> Context.etcHosts.Start()
<mask>
<mask> go func() {
<mask> serr := startDNSServer()
<mask> if serr != nil {
<mask> closeDNSServer()
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove Context.etcHosts.Close()
</s> add if Context.etcHosts != nil {
if err = Context.etcHosts.Close(); err != nil {
log.Error("stopping hosts container: %s", err)
}
} </s> add var fi fs.FileInfo
if fi, err = f.Stat(); err != nil {
return nil, true, err
}
if fi.IsDir() {
// Skip the directories.
return nil, true, nil
}
</s> remove // Prepare test hosts file.
hf, err := os.CreateTemp("", "")
</s> add const closeCalled errors.Error = "close method called"
var eventsCalledCounter uint32
hc, err := aghnet.NewHostsContainer(testFS, &aghtest.FSWatcher{
OnEvents: func() (e <-chan struct{}) {
assert.Equal(t, uint32(1), atomic.AddUint32(&eventsCalledCounter, 1))
return nil
},
OnAdd: func(name string) (err error) {
assert.Equal(t, hostsFilename, name)
return nil
},
OnClose: func() (err error) { return closeCalled },
}, hostsFilename) </s> remove d.engineLock.Lock()
d.reset()
d.rulesStorage = rulesStorage
d.filteringEngine = filteringEngine
d.rulesStorageAllow = rulesStorageAllow
d.filteringEngineAllow = filteringEngineAllow
d.engineLock.Unlock()
</s> add func() {
d.engineLock.Lock()
defer d.engineLock.Unlock()
d.reset()
d.rulesStorage = rulesStorage
d.filteringEngine = filteringEngine
d.rulesStorageAllow = rulesStorageAllow
d.filteringEngineAllow = filteringEngineAllow
}() </s> remove has, err = pair.Walk(pair.filename)
</s> add has, err = pair.Walk(aghos.RootDirFS(), pair.filename) | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/home.go |
keep keep keep keep replace keep keep keep keep keep | <mask> log.Error("stopping dhcp server: %s", err)
<mask> }
<mask> }
<mask>
<mask> Context.etcHosts.Close()
<mask>
<mask> if Context.tls != nil {
<mask> Context.tls.Close()
<mask> Context.tls = nil
<mask> }
</s> Pull request: 2499 merge rewrites vol.1
Merge in DNS/adguard-home from 2499-merge-rewrites-vol.1 to master
Updates #2499.
Squashed commit of the following:
commit 6b308bc2b360cee8c22e506f31d62bacb4bf8fb3
Merge: f49e9186 2b635bf6
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 19:23:07 2021 +0300
Merge branch 'master' into 2499-merge-rewrites-vol.1
commit f49e9186ffc8b7074d03c6721ee56cdb09243684
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 18:50:49 2021 +0300
aghos: fix fs events filtering
commit 567dd646556606212af5dab60e3ecbb8fff22c25
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 14 16:50:37 2021 +0300
all: imp code, docs, fix windows
commit 140c8bf519345eb54d0e7500a996fcf465353d71
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:41:53 2021 +0300
aghnet: use const
commit bebf3f76bd394a498ccad812c57d4507c69529ba
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 19:32:37 2021 +0300
all: imp tests, docs
commit 9bfdbb6eb454833135d616e208e82699f98e2562
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 18:42:20 2021 +0300
all: imp path more, imp docs
commit ee9ea4c132a6b17787d150bf2bee703abaa57be3
Author: Eugene Burkov <[email protected]>
Date: Wed Oct 13 16:09:46 2021 +0300
all: fix windows, imp paths
commit 6fac8338a81e9ecfebfc23a1adcb964e89f6aee6
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 19:53:35 2021 +0300
all: imp code, docs
commit da1ce1a2a3dd2be3fdff2412a6dbd596859dc249
Author: Eugene Burkov <[email protected]>
Date: Mon Oct 11 18:22:50 2021 +0300
aghnet: fix windows tests
commit d29de359ed68118d71efb226a8433fac15ff5c66
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 21:02:14 2021 +0300
all: repl & imp
commit 1356c08944cdbb85ce5532d90fe5b077219ce5ff
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 8 01:41:19 2021 +0300
all: add tests, mv logic, added tmpfs
commit f4b11adf8998bc8d9d955c5ac9f386f671bd5213
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 7 14:26:30 2021 +0300
all: imp filewalker, refactor hosts container </s> remove if err := Context.dnsFilter.SetFilters(filters, whiteFilters, async); err != nil {
</s> add if err := Context.dnsFilter.SetFilters(filters, allowFilters, async); err != nil { </s> remove if !clients.testing {
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
if clients.etcHosts != nil {
clients.etcHosts.SetOnChanged(clients.onHostsChanged)
</s> add if clients.testing {
return
}
clients.updateFromDHCP(true)
if clients.dhcpServer != nil {
clients.dhcpServer.SetOnLeaseChanged(clients.onDHCPLeaseChanged)
}
go clients.handleHostsUpdates()
}
func (clients *clientsContainer) handleHostsUpdates() {
if clients.etcHosts != nil {
for upd := range clients.etcHosts.Upd() {
clients.addFromHostsFile(upd) </s> remove Context.etcHosts = &aghnet.EtcHostsContainer{}
Context.etcHosts.Init("")
</s> add var osWritesWatcher aghos.FSWatcher
osWritesWatcher, err = aghos.NewOSWritesWatcher()
if err != nil {
return fmt.Errorf("initing os watcher: %w", err)
}
Context.etcHosts, err = aghnet.NewHostsContainer(
aghos.RootDirFS(),
osWritesWatcher,
aghnet.DefaultHostsPaths()...,
)
if err != nil {
return fmt.Errorf("initing hosts container: %w", err)
} </s> remove patterns = append(patterns, filepath.Join(dirName, line))
</s> add patterns = append(patterns, path.Join(".", line)) </s> remove return res, nil
</s> add dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil </s> remove subsrc, err = handlePatterns(srcSet, patterns...)
</s> add subsrc, err = handlePatterns(fsys, srcSet, patterns...) | https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e | internal/home/home.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> require.NotNil(t, errPtr)
<mask>
<mask> err := *errPtr
<mask> require.NotNil(t, err)
<mask>
<mask> assert.Equal(t, wantMsg, err.Error())
<mask> })
<mask>
<mask> t.Run("defer", func(t *testing.T) {
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove require.NotNil(t, err)
</s> add require.Error(t, err) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> remove err: nil,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/agherr/agherr_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> return errTest
<mask> }
<mask>
<mask> err := f()
<mask> require.NotNil(t, err)
<mask>
<mask> assert.Equal(t, wantMsg, err.Error())
<mask> })
<mask> }
<mask>
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove require.NotNil(t, err)
</s> add require.Error(t, err) </s> remove assert.Nil(t, err, "after %s", time.Since(start))
</s> add assert.NoError(t, err, "after %s", time.Since(start)) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> remove require.NotEmptyf(t, iface.Addresses, "No addresses found for %s", iface.Name)
</s> add require.NotEmptyf(t, iface.Addresses, "no addresses found for %s", iface.Name) | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/agherr/agherr_test.go |
keep add keep keep keep keep | <mask> func TestLimitReadCloser(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> n int64
<mask> }{{
<mask> want: nil,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove want error
</s> add </s> add err error </s> remove limit int64
</s> add </s> add err error </s> remove err error
</s> add </s> add want: nil, | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> func TestLimitReadCloser(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> n int64
<mask> want error
<mask> }{{
<mask> name: "positive",
<mask> n: 1,
<mask> want: nil,
<mask> }, {
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add want error </s> add want: nil, </s> remove want: nil,
</s> add </s> remove limit int64
</s> add </s> add err error </s> add err error | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep add keep keep keep keep keep | <mask> name string
<mask> n int64
<mask> }{{
<mask> name: "positive",
<mask> n: 1,
<mask> }, {
<mask> want: nil,
<mask> name: "zero",
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove want error
</s> add </s> remove want: nil,
</s> add </s> add want: nil, </s> remove want: nil,
</s> add </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> add want error | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> want error
<mask> }{{
<mask> name: "positive",
<mask> n: 1,
<mask> want: nil,
<mask> }, {
<mask> name: "zero",
<mask> n: 0,
<mask> want: nil,
<mask> }, {
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add want: nil, </s> add want: nil, </s> remove want error
</s> add </s> remove want: nil,
</s> add </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> remove limit: 3,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep add keep keep keep keep keep keep | <mask> n: 1,
<mask> }, {
<mask> name: "zero",
<mask> n: 0,
<mask> }, {
<mask> want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
<mask> name: "negative",
<mask> n: -1,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove want: nil,
</s> add </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add </s> remove want: nil,
</s> add </s> add want: nil, </s> remove want error
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> want: nil,
<mask> }, {
<mask> name: "zero",
<mask> n: 0,
<mask> want: nil,
<mask> }, {
<mask> name: "negative",
<mask> n: -1,
<mask> want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
<mask> }}
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add want: nil, </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add </s> remove want: nil,
</s> add </s> add want: nil, </s> remove want error
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep add keep keep keep keep keep keep | <mask> name: "zero",
<mask> n: 0,
<mask> }, {
<mask> name: "negative",
<mask> n: -1,
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add </s> remove want: nil,
</s> add </s> add want: nil, </s> remove err: nil,
</s> add </s> add name: "simplest",
want: "attempted to read more than 0 bytes", </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
| https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> want: nil,
<mask> }, {
<mask> name: "negative",
<mask> n: -1,
<mask> want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> _, err := LimitReadCloser(nil, tc.n)
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> remove want: nil,
</s> add </s> add want: nil, </s> remove err: nil,
</s> add </s> add name: "simplest",
want: "attempted to read more than 0 bytes", </s> add limit: 2, | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep add keep keep keep keep keep | <mask> }
<mask>
<mask> func TestLimitedReadCloser_Read(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> rStr string
<mask> limit int64
<mask> want int
<mask> }{{
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove limit int64
</s> add </s> add limit int64 </s> add want error </s> remove err error
</s> add </s> remove want error
</s> add </s> add err error | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> func TestLimitedReadCloser_Read(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> limit int64
<mask> rStr string
<mask> want int
<mask> err error
<mask> }{{
<mask> name: "perfectly_match",
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add err error </s> add limit int64 </s> remove err error
</s> add </s> add want error </s> remove want error
</s> add </s> add err: nil, | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep add keep keep keep keep keep | <mask> name string
<mask> rStr string
<mask> want int
<mask> }{{
<mask> err: nil,
<mask> name: "perfectly_match",
<mask> rStr: "abc",
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove err error
</s> add </s> add err: nil, </s> remove limit int64
</s> add </s> add err error </s> remove limit: 3,
</s> add </s> remove name: "simplest",
want: "attempted to read more than 0 bytes",
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> name string
<mask> limit int64
<mask> rStr string
<mask> want int
<mask> err error
<mask> }{{
<mask> name: "perfectly_match",
<mask> limit: 3,
<mask> rStr: "abc",
<mask> want: 3,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add err: nil, </s> add limit int64 </s> remove limit int64
</s> add </s> add err error </s> remove limit: 3,
</s> add </s> remove err: nil,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep add keep keep keep keep | <mask> rStr string
<mask> limit int64
<mask> want int
<mask> }{{
<mask> name: "perfectly_match",
<mask> rStr: "abc",
<mask> limit: 3,
<mask> want: 3,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove err error
</s> add </s> add limit int64 </s> remove limit int64
</s> add </s> remove limit: 3,
</s> add </s> add err error </s> remove err: nil,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> want int
<mask> err error
<mask> }{{
<mask> name: "perfectly_match",
<mask> limit: 3,
<mask> rStr: "abc",
<mask> want: 3,
<mask> err: nil,
<mask> }, {
<mask> name: "eof",
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove err error
</s> add </s> add err: nil, </s> remove err: nil,
</s> add </s> add limit: 3, </s> add err: io.EOF, </s> remove limit: 3,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep add keep keep keep keep keep | <mask> name: "perfectly_match",
<mask> rStr: "abc",
<mask> want: 3,
<mask> }, {
<mask> err: io.EOF,
<mask> name: "eof",
<mask> rStr: "",
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add err: io.EOF, </s> remove err: nil,
</s> add </s> remove err: io.EOF,
</s> add </s> remove limit: 3,
</s> add </s> add limit: 3, </s> remove limit: 3,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> name: "perfectly_match",
<mask> limit: 3,
<mask> rStr: "abc",
<mask> want: 3,
<mask> err: nil,
<mask> }, {
<mask> name: "eof",
<mask> limit: 3,
<mask> rStr: "",
<mask> want: 0,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add limit: 3, </s> add err: io.EOF, </s> remove limit: 3,
</s> add </s> remove limit: 3,
</s> add </s> remove err: io.EOF,
</s> add </s> add limit: 3, | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep add keep keep keep keep | <mask> rStr: "abc",
<mask> limit: 3,
<mask> want: 3,
<mask> }, {
<mask> name: "eof",
<mask> rStr: "",
<mask> limit: 3,
<mask> want: 0,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove err: nil,
</s> add </s> add limit: 3, </s> remove limit: 3,
</s> add </s> remove err: io.EOF,
</s> add </s> add limit: 3, </s> remove limit: 3,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> want: 3,
<mask> err: nil,
<mask> }, {
<mask> name: "eof",
<mask> limit: 3,
<mask> rStr: "",
<mask> want: 0,
<mask> err: io.EOF,
<mask> }, {
<mask> name: "limit_reached",
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove err: io.EOF,
</s> add </s> add err: io.EOF, </s> add limit: 3, </s> remove err: nil,
</s> add </s> add limit: 3, </s> remove name: "limit_reached",
limit: 0,
rStr: "abc",
want: 0,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep add keep keep keep keep | <mask> err: io.EOF,
<mask> name: "eof",
<mask> rStr: "",
<mask> want: 0,
<mask> }, {
<mask> err: &LimitReachedError{
<mask> Limit: 0,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove name: "limit_reached",
limit: 0,
rStr: "abc",
want: 0,
</s> add </s> remove err: io.EOF,
</s> add </s> remove limit: 3,
</s> add </s> add err: io.EOF, </s> add limit: 3, </s> add name: "limit_reached",
rStr: "abc",
limit: 0,
want: 0, | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep replace replace replace replace keep | <mask> name: "eof",
<mask> limit: 3,
<mask> rStr: "",
<mask> want: 0,
<mask> err: io.EOF,
<mask> }, {
<mask> name: "limit_reached",
<mask> limit: 0,
<mask> rStr: "abc",
<mask> want: 0,
<mask> err: &LimitReachedError{
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove limit: 3,
</s> add </s> add limit: 3, </s> add err: io.EOF, </s> add limit: 3, </s> remove err: nil,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep add keep keep keep keep | <mask> err: &LimitReachedError{
<mask> Limit: 0,
<mask> },
<mask> }, {
<mask> err: nil,
<mask> name: "truncated",
<mask> rStr: "abc",
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove name: "limit_reached",
limit: 0,
rStr: "abc",
want: 0,
</s> add </s> remove limit: 2,
</s> add </s> add limit: 3, </s> add err: nil, </s> add limit: 2, </s> add err error | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep add keep keep keep keep | <mask> limit: 0,
<mask> want: 0,
<mask> }, {
<mask> name: "truncated",
<mask> rStr: "abc",
<mask> limit: 2,
<mask> want: 2,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove limit: 2,
</s> add </s> add limit: 2, </s> remove err: nil,
</s> add </s> remove name: "limit_reached",
limit: 0,
rStr: "abc",
want: 0,
</s> add </s> add name: "limit_reached",
rStr: "abc",
limit: 0,
want: 0, </s> remove err: io.EOF,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> Limit: 0,
<mask> },
<mask> }, {
<mask> name: "truncated",
<mask> limit: 2,
<mask> rStr: "abc",
<mask> want: 2,
<mask> err: nil,
<mask> }}
<mask>
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add err: nil, </s> add limit: 2, </s> remove err: nil,
</s> add </s> add name: "limit_reached",
rStr: "abc",
limit: 0,
want: 0, </s> remove name: "limit_reached",
limit: 0,
rStr: "abc",
want: 0,
</s> add </s> add limit: 3, | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep add keep keep keep keep | <mask> err: nil,
<mask> name: "truncated",
<mask> rStr: "abc",
<mask> want: 2,
<mask> }}
<mask>
<mask> for _, tc := range testCases {
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove err: nil,
</s> add </s> remove limit: 2,
</s> add </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add </s> add err: nil, </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> add name: "simplest",
want: "attempted to read more than 0 bytes", | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> name: "truncated",
<mask> limit: 2,
<mask> rStr: "abc",
<mask> want: 2,
<mask> err: nil,
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> readCloser := ioutil.NopCloser(strings.NewReader(tc.rStr))
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add limit: 2, </s> remove limit: 2,
</s> add </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add </s> add err: nil, </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> add name: "simplest",
want: "attempted to read more than 0 bytes", | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> readCloser := ioutil.NopCloser(strings.NewReader(tc.rStr))
<mask> buf := make([]byte, tc.limit+1)
<mask>
<mask> lreader, err := LimitReadCloser(readCloser, tc.limit)
<mask> require.Nil(t, err)
<mask>
<mask> n, err := lreader.Read(buf)
<mask> require.Equal(t, tc.err, err)
<mask> assert.Equal(t, tc.want, n)
<mask> })
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.NotNil(t, err)
</s> add require.Error(t, err) </s> remove require.NotNil(t, err)
</s> add require.Error(t, err) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep add keep keep keep keep keep | <mask>
<mask> func TestLimitedReadCloser_LimitReachedError(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> want string
<mask> }{{
<mask> err: &LimitReachedError{
<mask> Limit: 0,
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove err error
</s> add </s> add err error </s> add want error </s> remove limit int64
</s> add </s> remove want error
</s> add </s> remove name: "simplest",
want: "attempted to read more than 0 bytes",
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep replace keep replace replace keep | <mask> want string
<mask> err error
<mask> }{{
<mask> name: "simplest",
<mask> want: "attempted to read more than 0 bytes",
<mask> err: &LimitReachedError{
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> add name: "simplest",
want: "attempted to read more than 0 bytes", </s> add err error </s> remove err error
</s> add </s> remove limit int64
</s> add </s> remove limit: 3,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep add keep keep keep keep | <mask> }{{
<mask> err: &LimitReachedError{
<mask> Limit: 0,
<mask> },
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove err: nil,
</s> add </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> add limit: 2, | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghio/limitedreadcloser_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> var ipd *IPDetector
<mask> var err error
<mask>
<mask> ipd, err = NewIPDetector()
<mask> require.Nil(t, err)
<mask>
<mask> testCases := []struct {
<mask> name string
<mask> ip net.IP
<mask> want bool
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> add err error </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> add err error </s> remove limit int64
</s> add </s> add want error | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghnet/ipdetector_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> r := bytes.NewReader(tc.data)
<mask> has, err := dhcpcdStaticConfig(r, "wlan0")
<mask> require.Nil(t, err)
<mask> assert.Equal(t, tc.want, has)
<mask> })
<mask> }
<mask> }
<mask>
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.NotNil(t, err)
</s> add require.Error(t, err) </s> remove err: nil,
</s> add </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghnet/net_linux_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> r := bytes.NewReader(tc.data)
<mask> has, err := ifacesStaticConfig(r, "enp0s3")
<mask> require.Nil(t, err)
<mask> assert.Equal(t, tc.want, has)
<mask> })
<mask> }
<mask> }
<mask>
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.NotNil(t, err)
</s> add require.Error(t, err) </s> remove err: nil,
</s> add </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> add want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghnet/net_linux_test.go |
keep keep keep keep replace replace keep replace keep | <mask> )
<mask>
<mask> func TestGetValidNetInterfacesForWeb(t *testing.T) {
<mask> ifaces, err := GetValidNetInterfacesForWeb()
<mask> require.Nilf(t, err, "Cannot get net interfaces: %s", err)
<mask> require.NotEmpty(t, ifaces, "No net interfaces found")
<mask> for _, iface := range ifaces {
<mask> require.NotEmptyf(t, iface.Addresses, "No addresses found for %s", iface.Name)
<mask> }
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove assert.Nil(t, err, "after %s", time.Since(start))
</s> add assert.NoError(t, err, "after %s", time.Since(start)) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghnet/net_test.go |
keep keep keep keep replace keep keep replace | <mask>
<mask> t.Helper()
<mask>
<mask> wd, err := os.Getwd()
<mask> require.Nil(t, err)
<mask>
<mask> dir, err = ioutil.TempDir(wd, "agh-test")
<mask> require.Nil(t, err)
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.NotNil(t, err)
</s> add require.Error(t, err) | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghtest/os_windows.go |
keep keep keep keep replace keep keep keep keep | <mask>
<mask> time.Sleep(retryDur)
<mask> }
<mask>
<mask> assert.Nil(t, err, "after %s", time.Since(start))
<mask> })
<mask>
<mask> return dir
<mask> }
</s> Pull request: all: imp some tests
Merge in DNS/adguard-home from imp-tests to master
Squashed commit of the following:
commit 6171420068d66808f069f280a81e0c60e61e5ce3
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:43:36 2021 +0300
aghnet: imp test msgs
commit ed2880ff03ab0e41a77f07aad2caf13bf5f4bd9f
Author: Ainar Garipov <[email protected]>
Date: Thu Mar 25 17:39:44 2021 +0300
all: imp some tests </s> remove require.NotNil(t, err)
</s> add require.Error(t, err) </s> remove require.Nilf(t, err, "Cannot get net interfaces: %s", err)
require.NotEmpty(t, ifaces, "No net interfaces found")
</s> add require.NoErrorf(t, err, "cannot get net interfaces: %s", err)
require.NotEmpty(t, ifaces, "no net interfaces found") </s> remove require.NotEmptyf(t, iface.Addresses, "No addresses found for %s", iface.Name)
</s> add require.NotEmptyf(t, iface.Addresses, "no addresses found for %s", iface.Name) </s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> remove require.Nil(t, err)
</s> add require.NoError(t, err)
</s> add err error | https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8 | internal/aghtest/os_windows.go |
keep keep replace keep keep keep replace replace keep | <mask> schema:
<mask> $ref: '#/definitions/QueryLog'
<mask> /querylog_enable:
<mask> post:
<mask> tags:
<mask> - log
<mask> operationId: querylogEnable
<mask> summary: 'Enable querylog'
<mask> responses:
</s> + openapi: /querylog_info, /querylog_config, /querylog_clear </s> remove /querylog_disable:
</s> add /querylog_clear: </s> remove operationId: querylogDisable
summary: 'Disable filtering'
</s> add operationId: querylogClear
summary: 'Clear query log' </s> add description: OK </s> add QueryLogConfig:
type: "object"
description: "Query log configuration"
properties:
enabled:
type: "boolean"
description: "Is query log enabled"
interval:
type: "integer"
description: "Time period to keep data (1 | 7 | 30 | 90)"
| https://github.com/AdguardTeam/AdGuardHome/commit/27f895cf46278eb8b60432ac3b5e44ca73efe1f2 | openapi/openapi.yaml |
keep replace keep keep keep replace replace keep keep keep keep | <mask> description: OK
<mask> /querylog_disable:
<mask> post:
<mask> tags:
<mask> - log
<mask> operationId: querylogDisable
<mask> summary: 'Disable filtering'
<mask> responses:
<mask> 200:
<mask> description: OK
<mask>
</s> + openapi: /querylog_info, /querylog_config, /querylog_clear </s> remove /querylog_enable:
</s> add /querylog_info:
get:
tags:
- log
operationId: queryLogInfo
summary: 'Get query log parameters'
responses:
200:
description: OK
schema:
$ref: "#/definitions/QueryLogConfig"
/querylog_config: </s> remove operationId: querylogEnable
summary: 'Enable querylog'
</s> add operationId: queryLogConfig
summary: "Set query log parameters"
consumes:
- application/json
parameters:
- in: "body"
name: "body"
schema:
$ref: "#/definitions/QueryLogConfig" </s> add description: OK </s> add QueryLogConfig:
type: "object"
description: "Query log configuration"
properties:
enabled:
type: "boolean"
description: "Is query log enabled"
interval:
type: "integer"
description: "Time period to keep data (1 | 7 | 30 | 90)"
| https://github.com/AdguardTeam/AdGuardHome/commit/27f895cf46278eb8b60432ac3b5e44ca73efe1f2 | openapi/openapi.yaml |
keep keep add keep keep keep keep | <mask> summary: 'Get statistics parameters'
<mask> responses:
<mask> 200:
<mask> schema:
<mask> $ref: "#/definitions/StatsConfig"
<mask> description: OK
<mask>
</s> + openapi: /querylog_info, /querylog_config, /querylog_clear </s> remove /querylog_enable:
</s> add /querylog_info:
get:
tags:
- log
operationId: queryLogInfo
summary: 'Get query log parameters'
responses:
200:
description: OK
schema:
$ref: "#/definitions/QueryLogConfig"
/querylog_config: </s> remove /querylog_disable:
</s> add /querylog_clear: </s> remove operationId: querylogDisable
summary: 'Disable filtering'
</s> add operationId: querylogClear
summary: 'Clear query log' </s> remove operationId: querylogEnable
summary: 'Enable querylog'
</s> add operationId: queryLogConfig
summary: "Set query log parameters"
consumes:
- application/json
parameters:
- in: "body"
name: "body"
schema:
$ref: "#/definitions/QueryLogConfig" </s> add QueryLogConfig:
type: "object"
description: "Query log configuration"
properties:
enabled:
type: "boolean"
description: "Is query log enabled"
interval:
type: "integer"
description: "Time period to keep data (1 | 7 | 30 | 90)"
| https://github.com/AdguardTeam/AdGuardHome/commit/27f895cf46278eb8b60432ac3b5e44ca73efe1f2 | openapi/openapi.yaml |
keep add keep keep keep keep keep | <mask> items:
<mask> $ref: "#/definitions/QueryLogItem"
<mask> TlsConfig:
<mask> type: "object"
<mask> description: "TLS configuration settings and status"
<mask> properties:
<mask> # TLS configuration
</s> + openapi: /querylog_info, /querylog_config, /querylog_clear </s> remove operationId: querylogDisable
summary: 'Disable filtering'
</s> add operationId: querylogClear
summary: 'Clear query log' </s> add description: OK </s> remove /querylog_enable:
</s> add /querylog_info:
get:
tags:
- log
operationId: queryLogInfo
summary: 'Get query log parameters'
responses:
200:
description: OK
schema:
$ref: "#/definitions/QueryLogConfig"
/querylog_config: </s> remove operationId: querylogEnable
summary: 'Enable querylog'
</s> add operationId: queryLogConfig
summary: "Set query log parameters"
consumes:
- application/json
parameters:
- in: "body"
name: "body"
schema:
$ref: "#/definitions/QueryLogConfig" </s> remove /querylog_disable:
</s> add /querylog_clear: | https://github.com/AdguardTeam/AdGuardHome/commit/27f895cf46278eb8b60432ac3b5e44ca73efe1f2 | openapi/openapi.yaml |
keep keep keep keep replace replace replace replace keep keep keep keep replace replace keep keep keep | <mask> checksum := uint32(0)
<mask>
<mask> for {
<mask> line, err := r.ReadString('\n')
<mask> if err != nil {
<mask> break
<mask> }
<mask>
<mask> checksum = crc32.Update(checksum, crc32.IEEETable, []byte(line))
<mask>
<mask> line = strings.TrimSpace(line)
<mask> if len(line) == 0 {
<mask> continue
<mask> }
<mask>
<mask> if line[0] == '!' {
<mask> m := f.filterTitleRegexp.FindAllStringSubmatch(line, -1)
</s> - filter: fix rules count when data doesn't end with a newline </s> add if err != nil {
break
} </s> remove if line[0] == '!' {
</s> add } else if line[0] == '!' { </s> remove continue
</s> add //
| https://github.com/AdguardTeam/AdGuardHome/commit/286eb43c5622b2f35d7fe2b5f445da2ed2663658 | home/filter.go |
keep keep keep keep replace keep keep keep keep keep | <mask> if len(line) == 0 {
<mask> continue
<mask> }
<mask>
<mask> if line[0] == '!' {
<mask> m := f.filterTitleRegexp.FindAllStringSubmatch(line, -1)
<mask> if len(m) > 0 && len(m[0]) >= 2 && !seenTitle {
<mask> name = m[0][1]
<mask> seenTitle = true
<mask> }
</s> - filter: fix rules count when data doesn't end with a newline </s> remove continue
}
</s> add // </s> remove continue
</s> add //
</s> remove if err != nil {
break
}
</s> add </s> add if err != nil {
break
} | https://github.com/AdguardTeam/AdGuardHome/commit/286eb43c5622b2f35d7fe2b5f445da2ed2663658 | home/filter.go |
keep keep keep keep replace keep keep keep keep keep | <mask> name = m[0][1]
<mask> seenTitle = true
<mask> }
<mask> } else if line[0] == '#' {
<mask> continue
<mask> } else {
<mask> rulesCount++
<mask> }
<mask> }
<mask>
</s> - filter: fix rules count when data doesn't end with a newline </s> remove if line[0] == '!' {
</s> add } else if line[0] == '!' { </s> add if err != nil {
break
} </s> remove continue
}
</s> add // </s> remove if err != nil {
break
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/286eb43c5622b2f35d7fe2b5f445da2ed2663658 | home/filter.go |
keep add keep keep keep keep | <mask> rulesCount++
<mask> }
<mask> }
<mask>
<mask> return rulesCount, checksum, name
<mask> }
</s> - filter: fix rules count when data doesn't end with a newline </s> remove continue
</s> add //
</s> remove if line[0] == '!' {
</s> add } else if line[0] == '!' { </s> remove continue
}
</s> add // </s> remove if err != nil {
break
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/286eb43c5622b2f35d7fe2b5f445da2ed2663658 | home/filter.go |
keep keep keep replace keep replace replace | <mask> };
<mask> };
<mask>
<mask> getStats = (ip, stats) => {
<mask> if (stats) {
<mask> const statsForCurrentIP = stats.find(item => item.name === ip);
<mask> return statsForCurrentIP && statsForCurrentIP.count;
</s> - client: fix request count in clients table </s> remove const clientIP = row.original.ip;
const clientStats = clientIP && this.getStats(clientIP, this.props.topClients);
</s> add const { ids } = row.original;
const clientStats = this.getStats(ids, this.props.topClients); | https://github.com/AdguardTeam/AdGuardHome/commit/289c6f8c731f616c73eac2739b572c13eb245680 | client/src/components/Settings/Clients/ClientsTable.js |
keep keep keep keep replace replace keep keep keep keep keep | <mask> Header: this.props.t('requests_count'),
<mask> accessor: 'statistics',
<mask> minWidth: 120,
<mask> Cell: (row) => {
<mask> const clientIP = row.original.ip;
<mask> const clientStats = clientIP && this.getStats(clientIP, this.props.topClients);
<mask>
<mask> if (clientStats) {
<mask> return (
<mask> <div className="logs__row">
<mask> <div className="logs__text" title={clientStats}>
</s> - client: fix request count in clients table </s> remove getStats = (ip, stats) => {
</s> add getStats = (ids, stats) => { </s> remove const statsForCurrentIP = stats.find(item => item.name === ip);
return statsForCurrentIP && statsForCurrentIP.count;
</s> add const currentStats = stats.find(item => ids.includes(item.name));
return currentStats && currentStats.count; | https://github.com/AdguardTeam/AdGuardHome/commit/289c6f8c731f616c73eac2739b572c13eb245680 | client/src/components/Settings/Clients/ClientsTable.js |
keep keep keep keep replace replace keep keep keep keep keep | <mask> }
<mask>
<mask> var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"}
<mask>
<mask> // field ordering is important -- yaml fields will mirror ordering from here
<mask> type tlsConfig struct {
<mask> ServerName string `yaml:"server_name" json:"server_name,omitempty"`
<mask> ForceHTTPS bool `yaml:"force_https" json:"force_https,omitempty"`
<mask> PortHTTPS int `yaml:"port_https" json:"port_https,omitempty"`
<mask> PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"`
<mask>
</s> /tls/configure -- restart HTTPS server if settings changed
Fixes not using new HTTPS certificate after submitting it. </s> add }
// field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
tlsConfigSettings `yaml:",inline" json:",inline"` </s> add // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
// until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
if restartHTTPS {
go func() {
httpsServer.cond.Broadcast()
httpsServer.server.Shutdown(context.TODO())
}()
} </s> add restartHTTPS := false
if !reflect.DeepEqual(config.TLS.tlsConfigSettings, data.tlsConfigSettings) {
log.Printf("tls config settings have changed, will restart HTTPS server")
restartHTTPS = true
} </s> remove httpsServer.cond.Broadcast()
</s> add </s> remove PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
</s> add tlsConfigSettings: tlsConfigSettings{
PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
}, </s> add "reflect" | https://github.com/AdguardTeam/AdGuardHome/commit/28df187012ccd456524614a6ee96ce65d396a97f | config.go |
keep keep add keep keep keep keep keep | <mask> PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"`
<mask>
<mask> dnsforward.TLSConfig `yaml:",inline" json:",inline"`
<mask>
<mask> // only for API, no need to be stored in config
<mask> StatusCertificate string `yaml:"status_cert" json:"status_cert,omitempty"`
<mask> StatusKey string `yaml:"status_key" json:"status_key,omitempty"`
<mask> Warning string `yaml:"warning" json:"warning,omitempty"`
</s> /tls/configure -- restart HTTPS server if settings changed
Fixes not using new HTTPS certificate after submitting it. </s> remove // field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
</s> add type tlsConfigSettings struct { </s> add restartHTTPS := false
if !reflect.DeepEqual(config.TLS.tlsConfigSettings, data.tlsConfigSettings) {
log.Printf("tls config settings have changed, will restart HTTPS server")
restartHTTPS = true
} </s> remove PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
</s> add tlsConfigSettings: tlsConfigSettings{
PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
}, </s> add // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
// until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
if restartHTTPS {
go func() {
httpsServer.cond.Broadcast()
httpsServer.server.Shutdown(context.TODO())
}()
} </s> remove httpsServer.cond.Broadcast()
</s> add </s> add "reflect" | https://github.com/AdguardTeam/AdGuardHome/commit/28df187012ccd456524614a6ee96ce65d396a97f | config.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> },
<mask> UpstreamDNS: defaultDNS,
<mask> },
<mask> TLS: tlsConfig{
<mask> PortHTTPS: 443,
<mask> PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
<mask> },
<mask> Filters: []filter{
<mask> {Filter: dnsfilter.Filter{ID: 1}, Enabled: true, URL: "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt", Name: "AdGuard Simplified Domain Names filter"},
<mask> {Filter: dnsfilter.Filter{ID: 2}, Enabled: false, URL: "https://adaway.org/hosts.txt", Name: "AdAway"},
<mask> {Filter: dnsfilter.Filter{ID: 3}, Enabled: false, URL: "https://hosts-file.net/ad_servers.txt", Name: "hpHosts - Ad and Tracking servers only"},
</s> /tls/configure -- restart HTTPS server if settings changed
Fixes not using new HTTPS certificate after submitting it. </s> add // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
// until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
if restartHTTPS {
go func() {
httpsServer.cond.Broadcast()
httpsServer.server.Shutdown(context.TODO())
}()
} </s> add restartHTTPS := false
if !reflect.DeepEqual(config.TLS.tlsConfigSettings, data.tlsConfigSettings) {
log.Printf("tls config settings have changed, will restart HTTPS server")
restartHTTPS = true
} </s> add }
// field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
tlsConfigSettings `yaml:",inline" json:",inline"` </s> remove // field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
</s> add type tlsConfigSettings struct { </s> remove httpsServer.cond.Broadcast()
</s> add </s> add "reflect" | https://github.com/AdguardTeam/AdGuardHome/commit/28df187012ccd456524614a6ee96ce65d396a97f | config.go |
keep keep keep add keep keep keep keep keep keep | <mask> "io/ioutil"
<mask> "net"
<mask> "net/http"
<mask> "os"
<mask> "sort"
<mask> "strconv"
<mask> "strings"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/dnsforward"
</s> /tls/configure -- restart HTTPS server if settings changed
Fixes not using new HTTPS certificate after submitting it. </s> add // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
// until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
if restartHTTPS {
go func() {
httpsServer.cond.Broadcast()
httpsServer.server.Shutdown(context.TODO())
}()
} </s> remove httpsServer.cond.Broadcast()
</s> add </s> add restartHTTPS := false
if !reflect.DeepEqual(config.TLS.tlsConfigSettings, data.tlsConfigSettings) {
log.Printf("tls config settings have changed, will restart HTTPS server")
restartHTTPS = true
} </s> remove PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
</s> add tlsConfigSettings: tlsConfigSettings{
PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
}, </s> add }
// field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
tlsConfigSettings `yaml:",inline" json:",inline"` </s> remove // field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
</s> add type tlsConfigSettings struct { | https://github.com/AdguardTeam/AdGuardHome/commit/28df187012ccd456524614a6ee96ce65d396a97f | control.go |
keep keep keep add keep keep keep keep | <mask> if err != nil {
<mask> httpError(w, http.StatusBadRequest, "New TLS configuration does not validate: %s", err)
<mask> return
<mask> }
<mask> config.TLS = data
<mask> httpUpdateConfigReloadDNSReturnOK(w, r)
<mask> // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
<mask> // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
</s> /tls/configure -- restart HTTPS server if settings changed
Fixes not using new HTTPS certificate after submitting it. </s> add // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
// until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
if restartHTTPS {
go func() {
httpsServer.cond.Broadcast()
httpsServer.server.Shutdown(context.TODO())
}()
} </s> remove httpsServer.cond.Broadcast()
</s> add </s> add }
// field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
tlsConfigSettings `yaml:",inline" json:",inline"` </s> remove // field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
</s> add type tlsConfigSettings struct { </s> remove PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
</s> add tlsConfigSettings: tlsConfigSettings{
PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
}, </s> add "reflect" | https://github.com/AdguardTeam/AdGuardHome/commit/28df187012ccd456524614a6ee96ce65d396a97f | control.go |
keep keep keep keep replace keep keep keep keep keep | <mask> httpError(w, http.StatusBadRequest, "New TLS configuration does not validate: %s", err)
<mask> return
<mask> }
<mask> config.TLS = data
<mask> httpsServer.cond.Broadcast()
<mask> httpUpdateConfigReloadDNSReturnOK(w, r)
<mask> }
<mask>
<mask> func validateCertificates(data tlsConfig) (tlsConfig, error) {
<mask> var err error
</s> /tls/configure -- restart HTTPS server if settings changed
Fixes not using new HTTPS certificate after submitting it. </s> add restartHTTPS := false
if !reflect.DeepEqual(config.TLS.tlsConfigSettings, data.tlsConfigSettings) {
log.Printf("tls config settings have changed, will restart HTTPS server")
restartHTTPS = true
} </s> add // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
// until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
if restartHTTPS {
go func() {
httpsServer.cond.Broadcast()
httpsServer.server.Shutdown(context.TODO())
}()
} </s> remove // field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
</s> add type tlsConfigSettings struct { </s> add }
// field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
tlsConfigSettings `yaml:",inline" json:",inline"` </s> add "reflect" </s> remove PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
</s> add tlsConfigSettings: tlsConfigSettings{
PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
}, | https://github.com/AdguardTeam/AdGuardHome/commit/28df187012ccd456524614a6ee96ce65d396a97f | control.go |
keep keep add keep keep keep keep keep keep | <mask> }
<mask> config.TLS = data
<mask> httpUpdateConfigReloadDNSReturnOK(w, r)
<mask> }
<mask>
<mask> func validateCertificates(data tlsConfig) (tlsConfig, error) {
<mask> var err error
<mask>
<mask> if data.CertificateChain != "" {
</s> /tls/configure -- restart HTTPS server if settings changed
Fixes not using new HTTPS certificate after submitting it. </s> remove httpsServer.cond.Broadcast()
</s> add </s> add restartHTTPS := false
if !reflect.DeepEqual(config.TLS.tlsConfigSettings, data.tlsConfigSettings) {
log.Printf("tls config settings have changed, will restart HTTPS server")
restartHTTPS = true
} </s> remove // field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
</s> add type tlsConfigSettings struct { </s> add }
// field ordering is important -- yaml fields will mirror ordering from here
type tlsConfig struct {
tlsConfigSettings `yaml:",inline" json:",inline"` </s> add "reflect" </s> remove PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
</s> add tlsConfigSettings: tlsConfigSettings{
PortHTTPS: 443,
PortDNSOverTLS: 853, // needs to be passed through to dnsproxy
}, | https://github.com/AdguardTeam/AdGuardHome/commit/28df187012ccd456524614a6ee96ce65d396a97f | control.go |
keep keep keep replace keep keep keep keep keep | <mask> 'name': 'build'
<mask>
<mask> 'env':
<mask> 'GO_VERSION': '1.16'
<mask> 'NODE_VERSION': '14'
<mask>
<mask> 'on':
<mask> 'push':
<mask> 'branches':
</s> Pull request: all: upd go, tools, deps
Updates #2275.
Updates #3057.
Squashed commit of the following:
commit da22ad203cec1ef2a5d0a218933ddc3ac03c2ad3
Merge: dbd7e202 779fbe79
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 16:26:46 2021 +0300
Merge branch 'master' into 2275-upd-go
commit dbd7e20209ddc04198e89698b7e3c2750c4d9902
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 15:04:17 2021 +0300
all: upd docker img
commit 269796e3a00f60120a6327d6501f2dde031435c4
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 21 21:04:25 2021 +0300
all: upd go, tools, deps </s> remove 'GO_VERSION': '1.16'
</s> add 'GO_VERSION': '1.17' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> add github.com/marten-seemann/qtls-go1-17 v0.1.0 h1:P9ggrs5xtwiqXv/FHNwntmuLMNq3KaSIG93AtAZ48xk=
github.com/marten-seemann/qtls-go1-17 v0.1.0/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= </s> remove github.com/mdlayher/raw v0.0.0-20210412142147-51b895745faf h1:InctQoB89TIkmgIFQeIL4KXNvWc1iebQXdZggqPSwL8=
github.com/mdlayher/raw v0.0.0-20210412142147-51b895745faf/go.mod h1:7EpbotpCmVZcu+KCX4g9WaRNuu11uyhiW7+Le1dKawg=
</s> add github.com/mdlayher/raw v0.0.0-20211126142749-4eae47f3d54b h1:MHcTarUMC4sFA7eiyR8IEJ6j2PgmgXR+B9X2IIMjh7A=
github.com/mdlayher/raw v0.0.0-20211126142749-4eae47f3d54b/go.mod h1:7EpbotpCmVZcu+KCX4g9WaRNuu11uyhiW7+Le1dKawg=
github.com/mdlayher/socket v0.0.0-20210307095302-262dc9984e00/go.mod h1:GAFlyu4/XV68LkQKYzKhIo/WW7j3Zi0YRAz/BOoanUc=
github.com/mdlayher/socket v0.0.0-20211007213009-516dcbdf0267/go.mod h1:nFZ1EtZYK8Gi/k6QNu7z7CgO20i/4ExeQswwWuPmG/g=
github.com/mdlayher/socket v0.1.0/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs=
github.com/mdlayher/socket v0.1.1 h1:q3uOGirUPfAV2MUoaC7BavjQ154J7+JOkTWyiV+intI=
github.com/mdlayher/socket v0.1.1/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs= </s> add github.com/mdlayher/netlink v1.4.1/go.mod h1:e4/KuJ+s8UhfUpO9z00/fDZZmhSrs+oxyqAS9cNgn6Q=
github.com/mdlayher/netlink v1.5.0 h1:r4fa439+SsMarM0rMONU3iSshSV3ArVqJl6H/zjrhh4=
github.com/mdlayher/netlink v1.5.0/go.mod h1:1Kr8BBFxGyUyNmztC9WLOayqYVAd2wsgOZm18nqGuzQ= | https://github.com/AdguardTeam/AdGuardHome/commit/2968a65f14551f7c2990df32d4c96782936be566 | .github/workflows/build.yml |
keep keep keep replace keep keep keep keep keep | <mask> 'name': 'lint'
<mask>
<mask> 'env':
<mask> 'GO_VERSION': '1.16'
<mask>
<mask> 'on':
<mask> 'push':
<mask> 'tags':
<mask> - 'v*'
</s> Pull request: all: upd go, tools, deps
Updates #2275.
Updates #3057.
Squashed commit of the following:
commit da22ad203cec1ef2a5d0a218933ddc3ac03c2ad3
Merge: dbd7e202 779fbe79
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 16:26:46 2021 +0300
Merge branch 'master' into 2275-upd-go
commit dbd7e20209ddc04198e89698b7e3c2750c4d9902
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 15:04:17 2021 +0300
all: upd docker img
commit 269796e3a00f60120a6327d6501f2dde031435c4
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 21 21:04:25 2021 +0300
all: upd go, tools, deps </s> remove 'GO_VERSION': '1.16'
</s> add 'GO_VERSION': '1.17' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove github.com/mdlayher/ethtool v0.0.0-20210210192532-2b88debcdd43 h1:WgyLFv10Ov49JAQI/ZLUkCZ7VJS3r74hwFIGXJsgZlY=
</s> add </s> remove github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/2968a65f14551f7c2990df32d4c96782936be566 | .github/workflows/lint.yml |
keep keep keep keep replace keep keep keep keep keep | <mask> 'name': 'AdGuard Home - Build and publish release'
<mask> # Make sure to sync any changes with the branch overrides below.
<mask> 'variables':
<mask> 'channel': 'edge'
<mask> 'dockerGo': 'adguard/golang-ubuntu:3.8'
<mask>
<mask> 'stages':
<mask> - 'Make release':
<mask> 'manual': false
<mask> 'final': false
</s> Pull request: all: upd go, tools, deps
Updates #2275.
Updates #3057.
Squashed commit of the following:
commit da22ad203cec1ef2a5d0a218933ddc3ac03c2ad3
Merge: dbd7e202 779fbe79
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 16:26:46 2021 +0300
Merge branch 'master' into 2275-upd-go
commit dbd7e20209ddc04198e89698b7e3c2750c4d9902
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 15:04:17 2021 +0300
all: upd docker img
commit 269796e3a00f60120a6327d6501f2dde031435c4
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 21 21:04:25 2021 +0300
all: upd go, tools, deps </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove 'GO_VERSION': '1.16'
</s> add 'GO_VERSION': '1.17' </s> remove // Set default values for host configuration parameters listed
// in Appendix A of RFC-2131. Those parameters, if requested by
// client, should be returned with values defined by Host
// Requirements Document.
//
// See https://datatracker.ietf.org/doc/html/rfc2131#appendix-A.
//
// See also https://datatracker.ietf.org/doc/html/rfc1122,
// https://datatracker.ietf.org/doc/html/rfc1123, and
// https://datatracker.ietf.org/doc/html/rfc2132.
</s> add </s> add // Set default values for host configuration parameters listed in Appendix
// A of RFC-2131. Those parameters, if requested by client, should be
// returned with values defined by Host Requirements Document.
//
// See https://datatracker.ietf.org/doc/html/rfc2131#appendix-A.
//
// See also https://datatracker.ietf.org/doc/html/rfc1122,
// https://datatracker.ietf.org/doc/html/rfc1123, and
// https://datatracker.ietf.org/doc/html/rfc2132. | https://github.com/AdguardTeam/AdGuardHome/commit/2968a65f14551f7c2990df32d4c96782936be566 | bamboo-specs/release.yaml |
keep keep keep keep replace keep keep keep keep keep | <mask> # Set the default release channel on the release branch to beta, as we may
<mask> # need to build a few of these.
<mask> 'variables':
<mask> 'channel': 'beta'
<mask> 'dockerGo': 'adguard/golang-ubuntu:3.8'
<mask> # release-vX.Y.Z branches are the branches from which the actual final release
<mask> # is built.
<mask> - '^release-v[0-9]+\.[0-9]+\.[0-9]+':
<mask> # Build final releases on release branches manually.
<mask> 'triggers': []
</s> Pull request: all: upd go, tools, deps
Updates #2275.
Updates #3057.
Squashed commit of the following:
commit da22ad203cec1ef2a5d0a218933ddc3ac03c2ad3
Merge: dbd7e202 779fbe79
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 16:26:46 2021 +0300
Merge branch 'master' into 2275-upd-go
commit dbd7e20209ddc04198e89698b7e3c2750c4d9902
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 15:04:17 2021 +0300
all: upd docker img
commit 269796e3a00f60120a6327d6501f2dde031435c4
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 21 21:04:25 2021 +0300
all: upd go, tools, deps </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove // Set default values for host configuration parameters listed
// in Appendix A of RFC-2131. Those parameters, if requested by
// client, should be returned with values defined by Host
// Requirements Document.
//
// See https://datatracker.ietf.org/doc/html/rfc2131#appendix-A.
//
// See also https://datatracker.ietf.org/doc/html/rfc1122,
// https://datatracker.ietf.org/doc/html/rfc1123, and
// https://datatracker.ietf.org/doc/html/rfc2132.
</s> add </s> add // Set default values for host configuration parameters listed in Appendix
// A of RFC-2131. Those parameters, if requested by client, should be
// returned with values defined by Host Requirements Document.
//
// See https://datatracker.ietf.org/doc/html/rfc2131#appendix-A.
//
// See also https://datatracker.ietf.org/doc/html/rfc1122,
// https://datatracker.ietf.org/doc/html/rfc1123, and
// https://datatracker.ietf.org/doc/html/rfc2132. </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove howett.net/plist v0.0.0-20201203080718-1454fab16a06
</s> add howett.net/plist v1.0.0 | https://github.com/AdguardTeam/AdGuardHome/commit/2968a65f14551f7c2990df32d4c96782936be566 | bamboo-specs/release.yaml |
keep keep keep keep replace | <mask> # Set the default release channel on the final branch to release, as these
<mask> # are the ones that actually get released.
<mask> 'variables':
<mask> 'channel': 'release'
<mask> 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> Pull request: all: upd go, tools, deps
Updates #2275.
Updates #3057.
Squashed commit of the following:
commit da22ad203cec1ef2a5d0a218933ddc3ac03c2ad3
Merge: dbd7e202 779fbe79
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 16:26:46 2021 +0300
Merge branch 'master' into 2275-upd-go
commit dbd7e20209ddc04198e89698b7e3c2750c4d9902
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 22 15:04:17 2021 +0300
all: upd docker img
commit 269796e3a00f60120a6327d6501f2dde031435c4
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 21 21:04:25 2021 +0300
all: upd go, tools, deps </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove // Set default values for host configuration parameters listed
// in Appendix A of RFC-2131. Those parameters, if requested by
// client, should be returned with values defined by Host
// Requirements Document.
//
// See https://datatracker.ietf.org/doc/html/rfc2131#appendix-A.
//
// See also https://datatracker.ietf.org/doc/html/rfc1122,
// https://datatracker.ietf.org/doc/html/rfc1123, and
// https://datatracker.ietf.org/doc/html/rfc2132.
</s> add </s> add // Set default values for host configuration parameters listed in Appendix
// A of RFC-2131. Those parameters, if requested by client, should be
// returned with values defined by Host Requirements Document.
//
// See https://datatracker.ietf.org/doc/html/rfc2131#appendix-A.
//
// See also https://datatracker.ietf.org/doc/html/rfc1122,
// https://datatracker.ietf.org/doc/html/rfc1123, and
// https://datatracker.ietf.org/doc/html/rfc2132. </s> remove 'dockerGo': 'adguard/golang-ubuntu:3.8'
</s> add 'dockerGo': 'adguard/golang-ubuntu:4.0' </s> remove howett.net/plist v0.0.0-20201203080718-1454fab16a06
</s> add howett.net/plist v1.0.0 | https://github.com/AdguardTeam/AdGuardHome/commit/2968a65f14551f7c2990df32d4c96782936be566 | bamboo-specs/release.yaml |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.