docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
sequencelengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
patterns = append(patterns, path.Join(".", line))
<mask> return nil, false, nil <mask> } <mask> <mask> if len(line) != 0 { <mask> patterns = append(patterns, filepath.Join(dirName, line)) <mask> } <mask> } <mask> <mask> return patterns, true, s.Err() <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 }) ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) </s> add }).Walk(f, filename) </s> remove patterns, cont, err = checkFile(c, src[i]) </s> add patterns, cont, err = checkFile(fsys, fw, src[i]) </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...) </s> remove }).Walk("/etc/*release*") </s> add }).Walk(RootDirFS(), etcReleasePattern)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
testFS fstest.MapFS want assert.BoolAssertionFunc
<mask> <mask> const nl = "\n" <mask> <mask> testCases := []struct { <mask> name string <mask> testFS testFSGen <mask> initPattern string <mask> want bool <mask> }{{ <mask> name: "simple", <mask> testFS: testFSGen{ </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 want bool </s> add name string </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 const nl = "\n" </s> add </s> remove for _, pair := range []struct { </s> add for _, pair := range [...]struct { </s> remove filename: "/etc/dhcpcd.conf", </s> add filename: "etc/dhcpcd.conf",
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
name string
<mask> testCases := []struct { <mask> name string <mask> testFS testFSGen <mask> initPattern string <mask> want bool <mask> }{{ <mask> name: "simple", <mask> testFS: testFSGen{ <mask> "simple_0001.txt": []byte(attribute + nl), <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 name string testFS testFSGen </s> add testFS fstest.MapFS want assert.BoolAssertionFunc </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 want: true, </s> add want: assert.True, </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 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)},
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
testFS: fstest.MapFS{ "simple_0001.txt": &fstest.MapFile{Data: []byte(attribute + nl)},
<mask> initPattern string <mask> want bool <mask> }{{ <mask> name: "simple", <mask> testFS: testFSGen{ <mask> "simple_0001.txt": []byte(attribute + nl), <mask> }, <mask> initPattern: "simple_0001.txt", <mask> want: true, <mask> }, { <mask> name: "chain", </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 want bool </s> add name string </s> remove want: true, </s> add want: assert.True, </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 name string testFS testFSGen </s> add testFS fstest.MapFS want assert.BoolAssertionFunc </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)},
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
want: assert.True,
<mask> testFS: testFSGen{ <mask> "simple_0001.txt": []byte(attribute + nl), <mask> }, <mask> initPattern: "simple_0001.txt", <mask> want: true, <mask> }, { <mask> name: "chain", <mask> testFS: testFSGen{ <mask> "chain_0001.txt": []byte(`chain_0002.txt` + nl), <mask> "chain_0002.txt": []byte(`chain_0003.txt` + nl), </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{ "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{ "simple_0001.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ "simple_0001.txt": &fstest.MapFile{Data: []byte(attribute + nl)}, </s> remove want: true, </s> add want: assert.True, </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 testFS: testFSGen{ "dir": testFSDir{ "subdir_0002.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.txt"): &fstest.MapFile{ Data: []byte(attribute + nl),
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
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)},
<mask> initPattern: "simple_0001.txt", <mask> want: true, <mask> }, { <mask> name: "chain", <mask> testFS: testFSGen{ <mask> "chain_0001.txt": []byte(`chain_0002.txt` + nl), <mask> "chain_0002.txt": []byte(`chain_0003.txt` + nl), <mask> "chain_0003.txt": []byte(attribute + nl), <mask> }, <mask> initPattern: "chain_0001.txt", <mask> want: true, <mask> }, { <mask> name: "several", </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 want: true, </s> add want: assert.True, </s> remove want: true, </s> add want: assert.True, </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 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{ "dir": testFSDir{ "subdir_0002.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.txt"): &fstest.MapFile{ Data: []byte(attribute + nl),
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
want: assert.True,
<mask> "chain_0002.txt": []byte(`chain_0003.txt` + nl), <mask> "chain_0003.txt": []byte(attribute + nl), <mask> }, <mask> initPattern: "chain_0001.txt", <mask> want: true, <mask> }, { <mask> name: "several", <mask> testFS: testFSGen{ <mask> "several_0001.txt": []byte(`several_*` + nl), <mask> "several_0002.txt": []byte(`several_0001.txt` + nl), </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{ "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 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 want: true, </s> add want: assert.True, </s> remove want: true, </s> add want: assert.True, </s> remove testFS: testFSGen{ "dir": testFSDir{ "subdir_0002.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.txt"): &fstest.MapFile{ Data: []byte(attribute + nl),
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
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)},
<mask> initPattern: "chain_0001.txt", <mask> want: true, <mask> }, { <mask> name: "several", <mask> testFS: testFSGen{ <mask> "several_0001.txt": []byte(`several_*` + nl), <mask> "several_0002.txt": []byte(`several_0001.txt` + nl), <mask> "several_0003.txt": []byte(attribute + nl), <mask> }, <mask> initPattern: "several_0001.txt", <mask> want: true, <mask> }, { <mask> name: "no", </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 want: true, </s> add want: assert.True, </s> remove want: true, </s> add want: assert.True, </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 want: true, </s> add want: assert.True, </s> remove testFS: testFSGen{ "dir": testFSDir{ "subdir_0002.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.txt"): &fstest.MapFile{ Data: []byte(attribute + nl),
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
want: assert.True,
<mask> "several_0002.txt": []byte(`several_0001.txt` + nl), <mask> "several_0003.txt": []byte(attribute + nl), <mask> }, <mask> initPattern: "several_0001.txt", <mask> want: true, <mask> }, { <mask> name: "no", <mask> testFS: testFSGen{ <mask> "no_0001.txt": []byte(nl), <mask> "no_0002.txt": []byte(nl), </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{ "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 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 want: false, </s> add want: assert.False, </s> remove want: true, </s> add want: assert.True, </s> remove want: true, </s> add want: assert.True,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
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)},
<mask> initPattern: "several_0001.txt", <mask> want: true, <mask> }, { <mask> name: "no", <mask> testFS: testFSGen{ <mask> "no_0001.txt": []byte(nl), <mask> "no_0002.txt": []byte(nl), <mask> "no_0003.txt": []byte(nl), <mask> }, <mask> initPattern: "no_*", <mask> want: false, <mask> }, { <mask> name: "subdirectory", </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 want: false, </s> add want: assert.False, </s> remove want: true, </s> add want: assert.True, </s> remove testFS: testFSGen{ "dir": testFSDir{ "subdir_0002.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.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: true, </s> add want: assert.True,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
want: assert.False,
<mask> "no_0002.txt": []byte(nl), <mask> "no_0003.txt": []byte(nl), <mask> }, <mask> initPattern: "no_*", <mask> want: false, <mask> }, { <mask> name: "subdirectory", <mask> testFS: testFSGen{ <mask> "dir": testFSDir{ <mask> "subdir_0002.txt": []byte(attribute + nl), </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{ "dir": testFSDir{ "subdir_0002.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.txt"): &fstest.MapFile{ Data: []byte(attribute + nl), </s> remove want: true, </s> add want: assert.True, </s> remove "subdir_0001.txt": []byte(`dir/*`), </s> add "subdir_0001.txt": &fstest.MapFile{Data: []byte(`dir/*`)}, </s> remove want: true, </s> add want: assert.True,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.txt"): &fstest.MapFile{ Data: []byte(attribute + nl),
<mask> initPattern: "no_*", <mask> want: false, <mask> }, { <mask> name: "subdirectory", <mask> testFS: testFSGen{ <mask> "dir": testFSDir{ <mask> "subdir_0002.txt": []byte(attribute + nl), <mask> }, <mask> "subdir_0001.txt": []byte(`dir/*`), <mask> }, <mask> initPattern: "subdir_0001.txt", <mask> want: true, </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 "subdir_0001.txt": []byte(`dir/*`), </s> add "subdir_0001.txt": &fstest.MapFile{Data: []byte(`dir/*`)}, </s> remove want: false, </s> add want: assert.False, </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 want: true, </s> add want: assert.True, </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)},
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
"subdir_0001.txt": &fstest.MapFile{Data: []byte(`dir/*`)},
<mask> testFS: testFSGen{ <mask> "dir": testFSDir{ <mask> "subdir_0002.txt": []byte(attribute + nl), <mask> }, <mask> "subdir_0001.txt": []byte(`dir/*`), <mask> }, <mask> initPattern: "subdir_0001.txt", <mask> want: true, <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 testFS: testFSGen{ "dir": testFSDir{ "subdir_0002.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.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, </s> remove want: true, </s> add want: assert.True, </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)},
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
want: assert.True,
<mask> }, <mask> "subdir_0001.txt": []byte(`dir/*`), <mask> }, <mask> initPattern: "subdir_0001.txt", <mask> want: true, <mask> }} <mask> <mask> for _, tc := range testCases { <mask> testDir := tc.testFS.gen(t) <mask> fw := makeFileWalker(testDir) </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 testDir := tc.testFS.gen(t) fw := makeFileWalker(testDir) </s> add fw := makeFileWalker("") </s> remove "subdir_0001.txt": []byte(`dir/*`), </s> add "subdir_0001.txt": &fstest.MapFile{Data: []byte(`dir/*`)}, </s> remove testFS: testFSGen{ "dir": testFSDir{ "subdir_0002.txt": []byte(attribute + nl), </s> add testFS: fstest.MapFS{ path.Join("dir", "subdir_0002.txt"): &fstest.MapFile{ Data: []byte(attribute + nl), </s> remove ok, err := fw.Walk(filepath.Join(testDir, tc.initPattern)) </s> add ok, err := fw.Walk(tc.testFS, tc.initPattern) </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)},
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
fw := makeFileWalker("")
<mask> want: true, <mask> }} <mask> <mask> for _, tc := range testCases { <mask> testDir := tc.testFS.gen(t) <mask> fw := makeFileWalker(testDir) <mask> <mask> t.Run(tc.name, func(t *testing.T) { <mask> ok, err := fw.Walk(filepath.Join(testDir, tc.initPattern)) <mask> require.NoError(t, err) <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 want: true, </s> add want: assert.True, </s> remove ok, err := fw.Walk(filepath.Join(testDir, tc.initPattern)) </s> add ok, err := fw.Walk(tc.testFS, tc.initPattern) </s> remove assert.Equal(t, tc.want, ok) </s> add tc.want(t, ok) </s> remove _, ok, err := checkFile(nil, "lol") </s> add _, ok, err := checkFile(emptyFS, nil, "lol")
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
ok, err := fw.Walk(tc.testFS, tc.initPattern)
<mask> testDir := tc.testFS.gen(t) <mask> fw := makeFileWalker(testDir) <mask> <mask> t.Run(tc.name, func(t *testing.T) { <mask> ok, err := fw.Walk(filepath.Join(testDir, tc.initPattern)) <mask> require.NoError(t, err) <mask> <mask> assert.Equal(t, tc.want, ok) <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 assert.Equal(t, tc.want, ok) </s> add tc.want(t, ok) </s> remove testDir := tc.testFS.gen(t) fw := makeFileWalker(testDir) </s> add fw := makeFileWalker("") </s> remove _, ok, err := checkFile(nil, "lol") </s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> remove want: true, </s> add want: assert.True, </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)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
tc.want(t, ok)
<mask> t.Run(tc.name, func(t *testing.T) { <mask> ok, err := fw.Walk(filepath.Join(testDir, tc.initPattern)) <mask> require.NoError(t, err) <mask> <mask> assert.Equal(t, tc.want, ok) <mask> }) <mask> } <mask> <mask> t.Run("pattern_malformed", func(t *testing.T) { <mask> ok, err := makeFileWalker("").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 ok, err := fw.Walk(filepath.Join(testDir, tc.initPattern)) </s> add ok, err := fw.Walk(tc.testFS, tc.initPattern) </s> remove ok, err := makeFileWalker("").Walk("[]") </s> add f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]") </s> remove testDir := tc.testFS.gen(t) fw := makeFileWalker(testDir) </s> add fw := makeFileWalker("") </s> remove _, ok, err := checkFile(nil, "lol") </s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]")
<mask> }) <mask> } <mask> <mask> t.Run("pattern_malformed", func(t *testing.T) { <mask> ok, err := makeFileWalker("").Walk("[]") <mask> require.Error(t, err) <mask> <mask> assert.False(t, ok) <mask> assert.ErrorIs(t, err, filepath.ErrBadPattern) <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 assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </s> remove assert.Equal(t, tc.want, ok) </s> add tc.want(t, ok) </s> remove }) ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) </s> add }).Walk(f, filename)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
assert.ErrorIs(t, err, path.ErrBadPattern)
<mask> ok, err := makeFileWalker("").Walk("[]") <mask> require.Error(t, err) <mask> <mask> assert.False(t, ok) <mask> assert.ErrorIs(t, err, filepath.ErrBadPattern) <mask> }) <mask> <mask> t.Run("bad_filename", func(t *testing.T) { <mask> dir := testFSGen{ <mask> "bad_filename.txt": []byte("[]"), </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 ok, err := makeFileWalker("").Walk("[]") </s> add f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]") </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </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 assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </s> remove }) ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) </s> add }).Walk(f, filename)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
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) {
<mask> assert.ErrorIs(t, err, filepath.ErrBadPattern) <mask> }) <mask> <mask> t.Run("bad_filename", func(t *testing.T) { <mask> dir := testFSGen{ <mask> "bad_filename.txt": []byte("[]"), <mask> }.gen(t) <mask> fw := FileWalker(func(r io.Reader) (patterns []string, cont bool, err error) { <mask> s := bufio.NewScanner(r) <mask> for s.Scan() { <mask> patterns = append(patterns, s.Text()) <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 assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove makeFileWalker := func(dirName string) (fw FileWalker) { </s> add makeFileWalker := func(_ string) (fw FileWalker) { </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 dir := testFSGen{ "mockfile.txt": []byte(`mockdata`), }.gen(t) </s> add f := fstest.MapFS{ "mockfile.txt": &fstest.MapFile{Data: []byte(`mockdata`)}, } </s> remove }) ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) </s> add }).Walk(f, filename)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
}).Walk(f, filename)
<mask> patterns = append(patterns, s.Text()) <mask> } <mask> <mask> return patterns, true, s.Err() <mask> }) <mask> <mask> ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) <mask> require.Error(t, err) <mask> <mask> assert.False(t, ok) <mask> assert.ErrorIs(t, err, filepath.ErrBadPattern) <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 assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove ok, err := makeFileWalker("").Walk("[]") </s> add f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]") </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </s> remove patterns = append(patterns, filepath.Join(dirName, line)) </s> add patterns = append(patterns, path.Join(".", line))
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
assert.ErrorIs(t, err, path.ErrBadPattern)
<mask> ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) <mask> require.Error(t, err) <mask> <mask> assert.False(t, ok) <mask> assert.ErrorIs(t, err, filepath.ErrBadPattern) <mask> }) <mask> <mask> t.Run("itself_error", func(t *testing.T) { <mask> const rerr errors.Error = "returned error" <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 }) ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) </s> add }).Walk(f, 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 assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove ok, err := makeFileWalker("").Walk("[]") </s> add f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]") </s> remove assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
f := fstest.MapFS{ "mockfile.txt": &fstest.MapFile{Data: []byte(`mockdata`)}, }
<mask> <mask> t.Run("itself_error", func(t *testing.T) { <mask> const rerr errors.Error = "returned error" <mask> <mask> dir := testFSGen{ <mask> "mockfile.txt": []byte(`mockdata`), <mask> }.gen(t) <mask> <mask> ok, err := FileWalker(func(r io.Reader) (patterns []string, ok bool, err error) { <mask> return nil, true, rerr <mask> }).Walk(filepath.Join(dir, "*")) <mask> require.Error(t, err) </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 }).Walk(filepath.Join(dir, "*")) require.Error(t, err) require.False(t, ok) </s> add }).Walk(f, "*") require.ErrorIs(t, err, rerr) </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </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 assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
}).Walk(f, "*") require.ErrorIs(t, err, rerr)
<mask> }.gen(t) <mask> <mask> ok, err := FileWalker(func(r io.Reader) (patterns []string, ok bool, err error) { <mask> return nil, true, rerr <mask> }).Walk(filepath.Join(dir, "*")) <mask> require.Error(t, err) <mask> require.False(t, ok) <mask> <mask> assert.ErrorIs(t, err, rerr) <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> remove dir := testFSGen{ "mockfile.txt": []byte(`mockdata`), }.gen(t) </s> add f := fstest.MapFS{ "mockfile.txt": &fstest.MapFile{Data: []byte(`mockdata`)}, } </s> remove assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </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 assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove }) ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) </s> add }).Walk(f, filename)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
assert.False(t, ok)
<mask> }).Walk(filepath.Join(dir, "*")) <mask> require.Error(t, err) <mask> require.False(t, ok) <mask> <mask> assert.ErrorIs(t, err, rerr) <mask> }) <mask> } <mask> <mask> func TestWalkerFunc_CheckFile(t *testing.T) { <mask> t.Run("non-existing", func(t *testing.T) { </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 }).Walk(filepath.Join(dir, "*")) require.Error(t, err) require.False(t, ok) </s> add }).Walk(f, "*") require.ErrorIs(t, err, rerr) </s> remove _, ok, err := checkFile(nil, "lol") </s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove ok, err := makeFileWalker("").Walk("[]") </s> add f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]")
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
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 }
<mask> } <mask> <mask> func TestWalkerFunc_CheckFile(t *testing.T) { <mask> emptyFS := fstest.MapFS{} <mask> <mask> t.Run("non-existing", func(t *testing.T) { <mask> _, ok, err := checkFile(emptyFS, nil, "lol") <mask> require.NoError(t, err) </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 _, ok, err := checkFile(nil, "lol") </s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> remove assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </s> remove assert.Equal(t, tc.want, ok) </s> add tc.want(t, ok) </s> remove ok, err := makeFileWalker("").Walk("[]") </s> add f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]")
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
emptyFS := fstest.MapFS{}
<mask> return nil, errErrFSOpen <mask> } <mask> <mask> func TestWalkerFunc_CheckFile(t *testing.T) { <mask> t.Run("non-existing", func(t *testing.T) { <mask> _, ok, err := checkFile(emptyFS, nil, "lol") <mask> require.NoError(t, err) <mask> <mask> assert.True(t, ok) </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 _, ok, err := checkFile(nil, "lol") </s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> remove assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </s> remove assert.Equal(t, tc.want, ok) </s> add tc.want(t, ok) </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)
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
_, ok, err := checkFile(emptyFS, nil, "lol")
<mask> } <mask> <mask> func TestWalkerFunc_CheckFile(t *testing.T) { <mask> t.Run("non-existing", func(t *testing.T) { <mask> _, ok, err := checkFile(nil, "lol") <mask> require.NoError(t, err) <mask> <mask> assert.True(t, ok) <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 assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </s> remove assert.Equal(t, tc.want, ok) </s> add tc.want(t, ok) </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)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
_, ok, err := checkFile(&errFS{}, nil, "") require.ErrorIs(t, err, errErrFSOpen)
<mask> assert.True(t, ok) <mask> }) <mask> <mask> t.Run("invalid_argument", func(t *testing.T) { <mask> const badPath = "\x00" <mask> <mask> _, ok, err := checkFile(nil, badPath) <mask> require.Error(t, err) <mask> <mask> assert.False(t, ok) <mask> // TODO(e.burkov): Use assert.ErrorsIs within the error from <mask> // less platform-dependent package instead of syscall.EINVAL. <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 // 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 _, ok, err := checkFile(nil, "lol") </s> add _, ok, err := checkFile(emptyFS, nil, "lol") </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove assert.ErrorIs(t, err, rerr) </s> add assert.False(t, ok) </s> remove ok, err := makeFileWalker("").Walk("[]") </s> add f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]")
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
}) 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)
<mask> _, ok, err := checkFile(nil, badPath) <mask> require.Error(t, err) <mask> <mask> assert.False(t, ok) <mask> // TODO(e.burkov): Use assert.ErrorsIs within the error from <mask> // less platform-dependent package instead of syscall.EINVAL. <mask> // <mask> // See https://github.com/golang/go/issues/46849 and <mask> // https://github.com/golang/go/issues/30322. <mask> pathErr := &os.PathError{} <mask> require.ErrorAs(t, err, &pathErr) <mask> assert.Equal(t, "open", pathErr.Op) <mask> assert.Equal(t, badPath, pathErr.Path) <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 const badPath = "\x00" _, ok, err := checkFile(nil, badPath) require.Error(t, err) </s> add _, ok, err := checkFile(&errFS{}, nil, "") require.ErrorIs(t, err, errErrFSOpen) </s> remove ok, err := makeFileWalker("").Walk("[]") </s> add f := fstest.MapFS{} ok, err := makeFileWalker("").Walk(f, "[]") </s> remove }) ok, err := fw.Walk(filepath.Join(dir, "bad_filename.txt")) </s> add }).Walk(f, filename) </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern) </s> remove assert.ErrorIs(t, err, filepath.ErrBadPattern) </s> add assert.ErrorIs(t, err, path.ErrBadPattern)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/filewalker_test.go
"io/fs" "os"
<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> remove "os" </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/os.go
const etcReleasePattern = "etc/*release*"
<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)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/os_linux.go
}).Walk(RootDirFS(), etcReleasePattern)
<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 {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/aghos/os_linux.go
<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> remove "os" "path/filepath" </s> add "io/fs"
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
"sync/atomic"
<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
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
"testing/fstest"
<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> remove "os" </s> add </s> remove "os" "path/filepath" </s> add "path"
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
// Prepare test hosts file. const hostsFilename = "hosts" testFS := fstest.MapFS{ hostsFilename: &fstest.MapFile{Data: []byte(` 127.0.0.1 host # comment ::1 localhost#comment `)},
<mask> assert.Equal(t, "myhost.", ptr.Ptr) <mask> } <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) </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 // 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 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> 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)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
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)
<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()) <mask> assert.NoError(t, os.Remove(hf.Name())) <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 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 _, _ = 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 c.EtcHosts.Init(hf.Name()) t.Cleanup(c.EtcHosts.Close) </s> add c := filtering.Config{ EtcHosts: hc, } </s> remove assert.Equal(t, tc.want, ok) </s> add tc.want(t, ok)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
assert.Equal(t, uint32(1), atomic.LoadUint32(&eventsCalledCounter))
<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> <mask> c.EtcHosts.Init(hf.Name()) </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 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")
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
require.ErrorIs(t, hc.Close(), closeCalled) })
<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> <mask> c.EtcHosts.Init(hf.Name()) <mask> t.Cleanup(c.EtcHosts.Close) <mask> <mask> var snd *aghnet.SubnetDetector </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> 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)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
c := filtering.Config{ EtcHosts: hc, }
<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")
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
require.Lenf(t, resp.Answer, 1, "%#v", resp)
<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)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/dnsforward/dnsforward_test.go
// 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.
<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 {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/dnsrewrite.go
EtcHosts *aghnet.HostsContainer `yaml:"-"`
<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.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// Rewritten is returned when there was a rewrite by a legacy DNS rewrite // rule.
<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:"-"`
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// TODO(a.garipov): Remove Rewritten and RewrittenAutoHosts by merging their // functionality into RewrittenRule.
<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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// Rules are applied rules. If Rules are not empty, each rule is not nil.
<mask> <mask> // Reason is the reason for blocking or unblocking the request. <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. <mask> ReverseHosts []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 // 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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// ReverseHosts is the reverse lookup rewrite result. It is empty unless // Reason is set to RewrittenAutoHosts.
<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. <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"` </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 // 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 // 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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// IPList is the lookup rewrite result. It is empty unless Reason is set to // RewrittenAutoHosts or Rewritten.
<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 // 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 // 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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// CanonName is the CNAME value from the lookup rewrite result. It is empty // unless Reason is set to Rewritten or RewrittenRule.
<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"` <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"` </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 // 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 // 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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// ServiceName is the name of the blocked service. It is empty unless // Reason is set to FilteredBlockedService.
<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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// 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 {
<mask> <mask> return Result{}, nil <mask> } <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 { </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 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 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 revHosts := d.Config.EtcHosts.ProcessReverse(host, qtype) if len(revHosts) != 0 { res = Result{ Reason: RewrittenAutoHosts, } </s> add var ips []net.IP var revHosts []string
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
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, })
<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> } <mask> <mask> return res, nil <mask> } <mask> <mask> revHosts := d.Config.EtcHosts.ProcessReverse(host, qtype) </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 // 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 return res, nil </s> add switch val := nr.DNSRewrite.Value.(type) { case net.IP: ips = append(ips, val) case string: revHosts = append(revHosts, val) }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
dnsr := dnsres.DNSRewrites() if len(dnsr) == 0 { return Result{}, nil
<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) }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
var ips []net.IP var revHosts []string
<mask> <mask> return res, nil <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] + "." </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): 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 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
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
for _, nr := range dnsr { dr := nr.DNSRewrite if dr == nil { continue
<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> <mask> return res, nil <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 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 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 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 return Result{}, nil </s> add return Result{ Reason: RewrittenAutoHosts, IPList: ips, ReverseHosts: revHosts, }, nil
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
switch val := nr.DNSRewrite.Value.(type) { case net.IP: ips = append(ips, val) case string: revHosts = append(revHosts, val) }
<mask> for i := range revHosts { <mask> res.ReverseHosts[i] = revHosts[i] + "." <mask> } <mask> <mask> return res, nil <mask> } <mask> <mask> return Result{}, nil <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 // 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 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 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 return Result{}, nil </s> add return Result{ Reason: RewrittenAutoHosts, IPList: ips, ReverseHosts: revHosts, }, nil
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
return Result{ Reason: RewrittenAutoHosts, IPList: ips, ReverseHosts: revHosts, }, nil
<mask> <mask> return res, nil <mask> } <mask> <mask> return Result{}, nil <mask> } <mask> <mask> // Process rewrites table <mask> // . Find CNAME for a domain name (exact match or by wildcard) <mask> // . if found and CNAME equals to domain name - this is an exception; exit </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 // 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 // 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 // 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
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
func() { d.engineLock.Lock() defer d.engineLock.Unlock() d.reset() d.rulesStorage = rulesStorage d.filteringEngine = filteringEngine d.rulesStorageAllow = rulesStorageAllow d.filteringEngineAllow = filteringEngineAllow }()
<mask> if err != nil { <mask> return err <mask> } <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> </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 // Make sure that the OS reclaims memory as soon as possible </s> add // Make sure that the OS reclaims memory as soon as possible. </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) } }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// Make sure that the OS reclaims memory as soon as possible.
<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 <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 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 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 // 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.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// Question type doesn't match the host rules. Return the first matched // host rule, but without an IP address.
<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
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
<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> 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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
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()
<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 {
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// A rewrite of a host to itself. Go on and try matching other // things.
<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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
check: d.matchSysHosts, name: "hosts container",
<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,
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/filtering/filtering.go
// etcHosts contains list of rewrite rules taken from the operating system's // hosts databse. etcHosts *aghnet.HostsContainer
<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
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/clients.go
etcHosts *aghnet.HostsContainer,
<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) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/clients.go
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)
<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) }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/clients.go
<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)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/clients.go
// AddHost adds a new IP-hostname pairing. The priorities of the sources are
<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)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/clients.go
func (clients *clientsContainer) addFromHostsFile(hosts *netutil.IPMap) {
<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) }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/clients.go
<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> remove testDir := tc.testFS.gen(t) fw := makeFileWalker(testDir) </s> add fw := makeFileWalker("") </s> remove want: true, </s> add want: assert.True, </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
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/filter.go
var allowFilters []filtering.Filter
<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)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/filter.go
allowFilters = append(allowFilters, filtering.Filter{
<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> 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)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/filter.go
if err := Context.dnsFilter.SetFilters(filters, allowFilters, async); err != nil {
<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> 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)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/filter.go
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
<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.
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/home.go
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) }
<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, })
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/home.go
<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> 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 }()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/home.go
if Context.etcHosts != nil { if err = Context.etcHosts.Close(); err != nil { log.Error("stopping hosts container: %s", err) } }
<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
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/2796e65468a87c7e556087fdec1c8663eedfe90e
internal/home/home.go
require.Error(t, err)
<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)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/agherr/agherr_test.go
require.Error(t, err)
<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)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/agherr/agherr_test.go
want error
<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> remove limit int64 </s> add </s> remove err error </s> add
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove want: nil, </s> add </s> remove limit int64 </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
want: nil,
<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> remove want: nil, </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove want error </s> add </s> remove want: nil, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
want: nil,
<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> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> add </s> remove want: nil, </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"), </s> add </s> remove want: nil, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
want: fmt.Errorf("aghio: invalid n in LimitReadCloser: -1"),
<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> remove err: nil, </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove want: nil, </s> add </s> remove err: nil, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
err error
<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> remove err error </s> add </s> remove want error </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove err error </s> add </s> remove want error </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
limit int64
<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> remove limit int64 </s> add </s> remove limit: 3, </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove limit int64 </s> add </s> remove limit: 3, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
err: nil,
<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> remove limit int64 </s> add </s> remove limit: 3, </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove err: nil, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
limit: 3,
<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> remove err: nil, </s> add </s> remove err: io.EOF, </s> add </s> remove limit: 3, </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove limit: 3, </s> add </s> remove limit: 3, </s> add </s> remove err: io.EOF, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
err: io.EOF,
<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> remove limit: 3, </s> add </s> remove err: io.EOF, </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
<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> remove err: nil, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go
limit: 3,
<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
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/27f4f0527331ad5fa85bcec843cd13cc97c696a8
internal/aghio/limitedreadcloser_test.go