docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep add keep keep keep keep keep keep
<mask> Type: dns.TypeA, <mask> }, { <mask> Domain: "host.com", <mask> Answer: "AAAA", <mask> }, { <mask> Domain: "host2.com", <mask> Answer: "::1", <mask> Type: dns.TypeAAAA, <mask> }, { <mask> Domain: "host2.com", </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add Type: dns.TypeAAAA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA, </s> add }, { Domain: "*.hostboth.com", Answer: "1.2.3.6", }, { Domain: "*.hostboth.com", Answer: "1234::5678",
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep
<mask> Domain: "host2.com", <mask> Answer: "::1", <mask> }, { <mask> Domain: "host2.com", <mask> Answer: "A", <mask> Type: dns.TypeA, </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add Type: dns.TypeAAAA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep
<mask> Domain: "host2.com", <mask> Answer: "A", <mask> }, { <mask> Domain: "host3.com", <mask> Answer: "A", <mask> Type: dns.TypeA, </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add Type: dns.TypeAAAA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeAAAA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA, </s> add Type: dns.TypeA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep keep
<mask> Domain: "host3.com", <mask> Answer: "A", <mask> }} <mask> d.prepareRewrites() <mask> <mask> testCases := []struct { <mask> name string </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add Type: dns.TypeA, </s> add }, { Domain: "*.hostboth.com", Answer: "1.2.3.6", }, { Domain: "*.hostboth.com", Answer: "1234::5678", </s> add Type: dns.TypeA, </s> remove dtyp uint16 </s> add </s> remove dtyp uint16 </s> add </s> add Type: dns.TypeAAAA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> testCases := []struct { <mask> name string <mask> host string <mask> dtyp uint16 <mask> want []net.IP <mask> }{{ <mask> name: "match_A", <mask> host: "host.com", <mask> dtyp: dns.TypeA, </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add dtyp uint16 </s> remove dtyp uint16 </s> add </s> add dtyp uint16 </s> add Type: dns.TypeA, </s> remove dtyp: dns.TypeA, </s> add </s> remove name: "not_filtered_not_found", host: "hoost.com", dtyp: dns.TypeA, </s> add name: "not_filtered_not_found", host: "hoost.com", wantCName: "", wantVals: nil, dtyp: dns.TypeA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep keep add keep keep keep keep keep keep
<mask> name string <mask> host string <mask> want []net.IP <mask> }{{ <mask> name: "match_A", <mask> host: "host.com", <mask> want: []net.IP{{1, 2, 3, 4}}, <mask> dtyp: dns.TypeA, <mask> }, { </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> remove dtyp uint16 </s> add </s> remove dtyp: dns.TypeA, </s> add </s> remove dtyp uint16 </s> add </s> add dtyp: dns.TypeA, </s> add dtyp uint16 </s> add Type: dns.TypeA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> want []net.IP <mask> }{{ <mask> name: "match_A", <mask> host: "host.com", <mask> dtyp: dns.TypeA, <mask> want: []net.IP{{1, 2, 3, 4}}, <mask> }, { <mask> name: "exception_AAAA_host.com", <mask> host: "host.com", <mask> dtyp: dns.TypeAAAA, </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add dtyp uint16 </s> add dtyp: dns.TypeA, </s> remove dtyp uint16 </s> add </s> add want: nil, </s> remove dtyp: dns.TypeA, </s> add </s> remove name: "wildcard_override", host: "a.host.com", dtyp: dns.TypeA, wantVals: []net.IP{{1, 2, 3, 4}}, </s> add name: "wildcard_override", host: "a.host.com", wantCName: "", wantVals: []net.IP{{1, 2, 3, 4}}, dtyp: dns.TypeA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep keep keep
<mask> host: "host.com", <mask> want: []net.IP{{1, 2, 3, 4}}, <mask> }, { <mask> name: "exception_AAAA_host.com", <mask> host: "host.com", <mask> want: nil, <mask> dtyp: dns.TypeAAAA, <mask> }, { </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> remove dtyp: dns.TypeA, </s> add </s> add want: nil, </s> add dtyp uint16 </s> remove dtyp: dns.TypeA, </s> add </s> add dtyp: dns.TypeAAAA, </s> remove name: "wildcard_override", host: "a.host.com", dtyp: dns.TypeA, wantVals: []net.IP{{1, 2, 3, 4}}, </s> add name: "wildcard_override", host: "a.host.com", wantCName: "", wantVals: []net.IP{{1, 2, 3, 4}}, dtyp: dns.TypeA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep
<mask> name: "exception_AAAA_host.com", <mask> host: "host.com", <mask> dtyp: dns.TypeAAAA, <mask> }, { <mask> name: "exception_A_host2.com", <mask> host: "host2.com", </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add want: nil, </s> add dtyp: dns.TypeA, </s> remove dtyp: dns.TypeA, </s> add </s> add Type: dns.TypeAAAA, </s> add dtyp: dns.TypeAAAA, </s> remove dtyp: dns.TypeAAAA, </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep keep keep
<mask> name: "exception_A_host2.com", <mask> host: "host2.com", <mask> dtyp: dns.TypeA, <mask> }, { <mask> name: "match_AAAA_host2.com", <mask> host: "host2.com", <mask> want: []net.IP{net.ParseIP("::1")}, <mask> dtyp: dns.TypeAAAA, </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> remove dtyp: dns.TypeAAAA, </s> add </s> add want: nil, </s> add dtyp: dns.TypeAAAA, </s> add Type: dns.TypeAAAA, </s> add Type: dns.TypeAAAA, </s> add dtyp: dns.TypeA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> dtyp: dns.TypeA, <mask> }, { <mask> name: "match_AAAA_host2.com", <mask> host: "host2.com", <mask> dtyp: dns.TypeAAAA, <mask> want: []net.IP{net.ParseIP("::1")}, <mask> }, { <mask> name: "exception_A_host3.com", <mask> host: "host3.com", <mask> dtyp: dns.TypeA, </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add dtyp: dns.TypeAAAA, </s> add want: nil, </s> add want: nil, </s> add want: nil, </s> remove want: []net.IP{}, </s> add </s> add dtyp: dns.TypeA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep keep keep
<mask> host: "host2.com", <mask> want: []net.IP{net.ParseIP("::1")}, <mask> }, { <mask> name: "exception_A_host3.com", <mask> host: "host3.com", <mask> want: nil, <mask> dtyp: dns.TypeA, <mask> }, { </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> remove dtyp: dns.TypeAAAA, </s> add </s> add want: nil, </s> add want: nil, </s> add want: nil, </s> add dtyp: dns.TypeA, </s> add want: nil,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep keep
<mask> name: "exception_A_host3.com", <mask> host: "host3.com", <mask> dtyp: dns.TypeA, <mask> }, { <mask> name: "match_AAAA_host3.com", <mask> host: "host3.com", <mask> want: nil, </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add dtyp: dns.TypeAAAA, </s> remove dtyp: dns.TypeAAAA, </s> add </s> add want: nil, </s> remove want: []net.IP{}, </s> add </s> add dtyp: dns.TypeA, </s> add want: nil,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep keep keep
<mask> name: "match_AAAA_host3.com", <mask> host: "host3.com", <mask> dtyp: dns.TypeAAAA, <mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name+"_"+tc.host, func(t *testing.T) { <mask> r := d.processRewrites(tc.host, tc.dtyp) </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> remove want: []net.IP{}, </s> add </s> add dtyp: dns.TypeA, }, { name: "issue3343", host: "www.hostboth.com", wantCName: "", wantVals: []net.IP{net.ParseIP("1234::5678")}, dtyp: dns.TypeAAAA, </s> remove dtyp: dns.TypeA, </s> add </s> add Type: dns.TypeA, </s> add want: nil, </s> remove rr = findRewrites(d.Rewrites, host) </s> add rr = findRewrites(d.Rewrites, host, qtype)
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> }, { <mask> name: "match_AAAA_host3.com", <mask> host: "host3.com", <mask> dtyp: dns.TypeAAAA, <mask> want: []net.IP{}, <mask> }} <mask> <mask> for _, tc := range testCases { <mask> t.Run(tc.name+"_"+tc.host, func(t *testing.T) { <mask> r := d.processRewrites(tc.host, tc.dtyp) </s> Pull request: filtering: fix legacy rewrite wildcards Updates #3343. Squashed commit of the following: commit ab3c3e002a6d2a11bc3207fdaaeb292aaa194907 Author: Ainar Garipov <[email protected]> Date: Mon Jul 12 20:58:57 2021 +0300 filtering: fix legacy rewrite wildcards </s> add want: nil, </s> add dtyp: dns.TypeA, }, { name: "issue3343", host: "www.hostboth.com", wantCName: "", wantVals: []net.IP{net.ParseIP("1234::5678")}, dtyp: dns.TypeAAAA, </s> remove dtyp: dns.TypeA, </s> add </s> add want: nil, </s> add Type: dns.TypeA, </s> add dtyp: dns.TypeAAAA,
https://github.com/AdguardTeam/AdGuardHome/commit/194ea6ef9529e4d34ae764eaf4c5f60960aa3ed2
internal/filtering/rewrites_test.go
keep add keep keep keep keep keep keep
<mask> replacedSafebrowsing, <mask> replacedParental, <mask> }) => { <mask> const totalBlocked = ( <mask> blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch <mask> ); <mask> <mask> return ( </s> Pull request 1777: client: include safesearch to count percent Updates #5568. Squashed commit of the following: commit 3d3a8c187b27307b69b160283f3cd6f9c40cc68e Merge: 7f4b6357 c3edab43 Author: Vladislav Abdulmyanov <[email protected]> Date: Wed Mar 22 11:53:06 2023 +0200 Merge branch 'master' into 5568-save-search-percent commit 7f4b6357c6f7941eb37175a83972a9821dd08974 Author: Vladislav Abdulmyanov <[email protected]> Date: Tue Mar 21 13:36:14 2023 +0200 client: include safesearch to count percent </s> add replacedSafesearch={stats.numReplacedSafesearch} </s> add replacedSafesearch: PropTypes.number.isRequired, </s> remove const totalBlocked = blockedFiltering + replacedSafebrowsing + replacedParental; </s> add const totalBlocked = ( blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch );
https://github.com/AdguardTeam/AdGuardHome/commit/194ead3479a43a74d6232754fc1547ec153010bf
client/src/components/Dashboard/BlockedDomains.js
keep keep keep keep replace keep keep keep keep keep
<mask> blockedFiltering, <mask> replacedSafebrowsing, <mask> replacedParental, <mask> }) => { <mask> const totalBlocked = blockedFiltering + replacedSafebrowsing + replacedParental; <mask> <mask> return ( <mask> <Card <mask> title={t('top_blocked_domains')} <mask> subtitle={subtitle} </s> Pull request 1777: client: include safesearch to count percent Updates #5568. Squashed commit of the following: commit 3d3a8c187b27307b69b160283f3cd6f9c40cc68e Merge: 7f4b6357 c3edab43 Author: Vladislav Abdulmyanov <[email protected]> Date: Wed Mar 22 11:53:06 2023 +0200 Merge branch 'master' into 5568-save-search-percent commit 7f4b6357c6f7941eb37175a83972a9821dd08974 Author: Vladislav Abdulmyanov <[email protected]> Date: Tue Mar 21 13:36:14 2023 +0200 client: include safesearch to count percent </s> add replacedSafesearch={stats.numReplacedSafesearch} </s> add replacedSafesearch: PropTypes.number.isRequired, </s> add replacedSafesearch,
https://github.com/AdguardTeam/AdGuardHome/commit/194ead3479a43a74d6232754fc1547ec153010bf
client/src/components/Dashboard/BlockedDomains.js
keep add keep keep keep keep keep
<mask> blockedFiltering: PropTypes.number.isRequired, <mask> replacedSafebrowsing: PropTypes.number.isRequired, <mask> replacedParental: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> subtitle: PropTypes.string.isRequired, <mask> t: PropTypes.func.isRequired, <mask> }; </s> Pull request 1777: client: include safesearch to count percent Updates #5568. Squashed commit of the following: commit 3d3a8c187b27307b69b160283f3cd6f9c40cc68e Merge: 7f4b6357 c3edab43 Author: Vladislav Abdulmyanov <[email protected]> Date: Wed Mar 22 11:53:06 2023 +0200 Merge branch 'master' into 5568-save-search-percent commit 7f4b6357c6f7941eb37175a83972a9821dd08974 Author: Vladislav Abdulmyanov <[email protected]> Date: Tue Mar 21 13:36:14 2023 +0200 client: include safesearch to count percent </s> add replacedSafesearch={stats.numReplacedSafesearch} </s> remove const totalBlocked = blockedFiltering + replacedSafebrowsing + replacedParental; </s> add const totalBlocked = ( blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch ); </s> add replacedSafesearch,
https://github.com/AdguardTeam/AdGuardHome/commit/194ead3479a43a74d6232754fc1547ec153010bf
client/src/components/Dashboard/BlockedDomains.js
keep keep add keep keep keep keep keep
<mask> topBlockedDomains={stats.topBlockedDomains} <mask> blockedFiltering={stats.numBlockedFiltering} <mask> replacedSafebrowsing={stats.numReplacedSafebrowsing} <mask> replacedParental={stats.numReplacedParental} <mask> refreshButton={refreshButton} <mask> /> <mask> </div> <mask> </div>} </s> Pull request 1777: client: include safesearch to count percent Updates #5568. Squashed commit of the following: commit 3d3a8c187b27307b69b160283f3cd6f9c40cc68e Merge: 7f4b6357 c3edab43 Author: Vladislav Abdulmyanov <[email protected]> Date: Wed Mar 22 11:53:06 2023 +0200 Merge branch 'master' into 5568-save-search-percent commit 7f4b6357c6f7941eb37175a83972a9821dd08974 Author: Vladislav Abdulmyanov <[email protected]> Date: Tue Mar 21 13:36:14 2023 +0200 client: include safesearch to count percent </s> add replacedSafesearch: PropTypes.number.isRequired, </s> remove const totalBlocked = blockedFiltering + replacedSafebrowsing + replacedParental; </s> add const totalBlocked = ( blockedFiltering + replacedSafebrowsing + replacedParental + replacedSafesearch ); </s> add replacedSafesearch,
https://github.com/AdguardTeam/AdGuardHome/commit/194ead3479a43a74d6232754fc1547ec153010bf
client/src/components/Dashboard/index.js
keep keep add keep keep keep keep
<mask> "query_log_disabled": "The query log is disabled and can be configured in the <0>settings</0>", <mask> "query_log_strict_search": "Use double quotes for strict search", <mask> "query_log_retention_confirm": "Are you sure you want to change query log retention? If you decrease the interval value, some data will be lost", <mask> "source_label": "Source", <mask> "found_in_known_domain_db": "Found in the known domains database.", <mask> "category_label": "Category", <mask> "rule_label": "Rule", </s> + client: handle DNS config </s> add import dnsConfig from './dnsConfig'; </s> remove let successMessage = ''; </s> add </s> remove if (status) { successMessage = 'disabled_protection'; await apiClient.disableGlobalProtection(); } else { successMessage = 'enabled_protection'; await apiClient.enableGlobalProtection(); } </s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection'; await apiClient.setDnsConfig({ protection_enabled: !status }); </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add </s> add import DnsConfig from './DnsConfig';
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/__locales/en.json
keep keep replace replace keep replace replace replace replace replace replace replace replace keep keep
<mask> export const toggleProtection = status => async (dispatch) => { <mask> dispatch(toggleProtectionRequest()); <mask> let successMessage = ''; <mask> <mask> try { <mask> if (status) { <mask> successMessage = 'disabled_protection'; <mask> await apiClient.disableGlobalProtection(); <mask> } else { <mask> successMessage = 'enabled_protection'; <mask> await apiClient.enableGlobalProtection(); <mask> } <mask> <mask> dispatch(addSuccessToast(successMessage)); <mask> dispatch(toggleProtectionSuccess()); </s> + client: handle DNS config </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add this.props.getDnsConfig(); </s> add export const BLOCKING_MODES = { nxdomain: 'nxdomain', null_ip: 'null_ip', custom_ip: 'custom_ip', }; </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/actions/index.js
keep keep keep keep replace replace keep keep keep keep keep
<mask> GLOBAL_STOP = { path: 'stop', method: 'POST' }; <mask> GLOBAL_SET_UPSTREAM_DNS = { path: 'set_upstreams_config', method: 'POST' }; <mask> GLOBAL_TEST_UPSTREAM_DNS = { path: 'test_upstream_dns', method: 'POST' }; <mask> GLOBAL_VERSION = { path: 'version.json', method: 'POST' }; <mask> GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; <mask> GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; <mask> GLOBAL_UPDATE = { path: 'update', method: 'POST' }; <mask> <mask> startGlobalFiltering() { <mask> const { path, method } = this.GLOBAL_START; <mask> return this.makeRequest(path, method); </s> + client: handle DNS config </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add </s> add dnsConfig, </s> add export const BLOCKING_MODES = { nxdomain: 'nxdomain', null_ip: 'null_ip', custom_ip: 'custom_ip', }; </s> remove let successMessage = ''; </s> add </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove if (status) { successMessage = 'disabled_protection'; await apiClient.disableGlobalProtection(); } else { successMessage = 'enabled_protection'; await apiClient.enableGlobalProtection(); } </s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection'; await apiClient.setDnsConfig({ protection_enabled: !status });
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/api/Api.js
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> }; <mask> return this.makeRequest(path, method, config); <mask> } <mask> <mask> enableGlobalProtection() { <mask> const { path, method } = this.GLOBAL_ENABLE_PROTECTION; <mask> return this.makeRequest(path, method); <mask> } <mask> <mask> disableGlobalProtection() { <mask> const { path, method } = this.GLOBAL_DISABLE_PROTECTION; <mask> return this.makeRequest(path, method); <mask> } <mask> <mask> getUpdate() { <mask> const { path, method } = this.GLOBAL_UPDATE; <mask> return this.makeRequest(path, method); <mask> } <mask> </s> + client: handle DNS config </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add </s> add dnsConfig, </s> remove let successMessage = ''; </s> add </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> remove if (status) { successMessage = 'disabled_protection'; await apiClient.disableGlobalProtection(); } else { successMessage = 'enabled_protection'; await apiClient.enableGlobalProtection(); } </s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection'; await apiClient.setDnsConfig({ protection_enabled: !status });
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/api/Api.js
keep keep add keep keep keep keep keep keep
<mask> import StatsConfig from './StatsConfig'; <mask> import LogsConfig from './LogsConfig'; <mask> import FiltersConfig from './FiltersConfig'; <mask> import Checkbox from '../ui/Checkbox'; <mask> import Loading from '../ui/Loading'; <mask> import PageTitle from '../ui/PageTitle'; <mask> import Card from '../ui/Card'; <mask> <mask> import './Settings.css'; </s> + client: handle DNS config </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> add import dnsConfig from './dnsConfig'; </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add dnsConfig, </s> add this.props.getDnsConfig(); </s> remove let successMessage = ''; </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/components/Settings/index.js
keep keep keep add keep keep keep keep
<mask> this.props.getBlockedServices(); <mask> this.props.getStatsConfig(); <mask> this.props.getLogsConfig(); <mask> this.props.getFilteringStatus(); <mask> } <mask> <mask> renderSettings = (settings) => { <mask> const settingsKeys = Object.keys(settings); </s> + client: handle DNS config </s> remove let successMessage = ''; </s> add </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> remove if (status) { successMessage = 'disabled_protection'; await apiClient.disableGlobalProtection(); } else { successMessage = 'enabled_protection'; await apiClient.enableGlobalProtection(); } </s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection'; await apiClient.setDnsConfig({ protection_enabled: !status });
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/components/Settings/index.js
keep keep keep add keep keep keep keep keep keep
<mask> setStatsConfig, <mask> resetStats, <mask> stats, <mask> queryLogs, <mask> setLogsConfig, <mask> clearLogs, <mask> filtering, <mask> setFiltersConfig, <mask> setDnsConfig, <mask> t, </s> + client: handle DNS config </s> add setDnsConfig, </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add getDnsConfig, setDnsConfig, </s> add dnsConfig, </s> add dnsConfig,
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/components/Settings/index.js
keep keep add keep keep keep keep keep
<mask> clearLogs, <mask> filtering, <mask> setFiltersConfig, <mask> t, <mask> } = this.props; <mask> <mask> const isDataReady = <mask> !settings.processing && </s> + client: handle DNS config </s> add dnsConfig, </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> add dnsConfig, </s> remove let successMessage = ''; </s> add </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/components/Settings/index.js
keep keep add keep keep keep keep
<mask> </div> <mask> </Card> <mask> </div> <mask> <div className="col-md-12"> <mask> <LogsConfig <mask> enabled={queryLogs.enabled} <mask> interval={queryLogs.interval} </s> + client: handle DNS config </s> add dnsConfig, </s> add dnsConfig, </s> remove let successMessage = ''; </s> add </s> remove if (status) { successMessage = 'disabled_protection'; await apiClient.disableGlobalProtection(); } else { successMessage = 'enabled_protection'; await apiClient.enableGlobalProtection(); } </s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection'; await apiClient.setDnsConfig({ protection_enabled: !status }); </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/components/Settings/index.js
keep keep keep add keep keep keep keep
<mask> setStatsConfig: PropTypes.func.isRequired, <mask> resetStats: PropTypes.func.isRequired, <mask> setFiltersConfig: PropTypes.func.isRequired, <mask> getFilteringStatus: PropTypes.func.isRequired, <mask> t: PropTypes.func.isRequired, <mask> }; <mask> <mask> export default withNamespaces()(Settings); </s> + client: handle DNS config </s> add getDnsConfig, setDnsConfig, </s> add export const BLOCKING_MODES = { nxdomain: 'nxdomain', null_ip: 'null_ip', custom_ip: 'custom_ip', }; </s> remove let successMessage = ''; </s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add </s> add dnsConfig, </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/components/Settings/index.js
keep keep keep add keep keep keep keep keep
<mask> import { getBlockedServices, setBlockedServices } from '../actions/services'; <mask> import { getStatsConfig, setStatsConfig, resetStats } from '../actions/stats'; <mask> import { clearLogs, getLogsConfig, setLogsConfig } from '../actions/queryLogs'; <mask> import { getFilteringStatus, setFiltersConfig } from '../actions/filtering'; <mask> import Settings from '../components/Settings'; <mask> <mask> const mapStateToProps = (state) => { <mask> const { <mask> settings, services, stats, queryLogs, filtering, dnsConfig, </s> + client: handle DNS config </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add import dnsConfig from './dnsConfig'; </s> add import DnsConfig from './DnsConfig'; </s> add dnsConfig, </s> remove let successMessage = ''; </s> add </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/containers/Settings.js
keep keep keep keep replace keep keep keep keep keep
<mask> import Settings from '../components/Settings'; <mask> <mask> const mapStateToProps = (state) => { <mask> const { <mask> settings, services, stats, queryLogs, filtering, <mask> } = state; <mask> const props = { <mask> settings, <mask> services, <mask> stats, </s> + client: handle DNS config </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> add import dnsConfig from './dnsConfig'; </s> remove let successMessage = ''; </s> add </s> add dnsConfig, </s> add this.props.getDnsConfig(); </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/containers/Settings.js
keep add keep keep keep keep keep keep
<mask> queryLogs, <mask> filtering, <mask> }; <mask> return props; <mask> }; <mask> <mask> const mapDispatchToProps = { <mask> initSettings, </s> + client: handle DNS config </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add export const BLOCKING_MODES = { nxdomain: 'nxdomain', null_ip: 'null_ip', custom_ip: 'custom_ip', }; </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> add setDnsConfig,
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/containers/Settings.js
keep add keep keep keep keep
<mask> getFilteringStatus, <mask> setFiltersConfig, <mask> }; <mask> <mask> export default connect( <mask> mapStateToProps, </s> + client: handle DNS config </s> add getDnsConfig: PropTypes.func.isRequired, </s> add export const BLOCKING_MODES = { nxdomain: 'nxdomain', null_ip: 'null_ip', custom_ip: 'custom_ip', }; </s> add dnsConfig, </s> add setDnsConfig, </s> remove let successMessage = ''; </s> add </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig';
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/containers/Settings.js
keep keep add keep keep keep keep keep keep
<mask> <mask> export const FILTERS_INTERVALS_HOURS = [0, 1, 12, 24, 72, 168]; <mask> <mask> export const WHOIS_ICONS = { <mask> location: 'location', <mask> orgname: 'network', <mask> netname: 'network', <mask> descr: '', <mask> }; </s> + client: handle DNS config </s> remove let successMessage = ''; </s> add </s> add dnsConfig, </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add getDnsConfig, setDnsConfig,
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/helpers/constants.js
keep add keep keep keep keep keep keep
<mask> import stats from './stats'; <mask> import queryLogs from './queryLogs'; <mask> import filtering from './filtering'; <mask> <mask> const settings = handleActions( <mask> { <mask> [actions.initSettingsRequest]: state => ({ ...state, processing: true }), <mask> [actions.initSettingsFailure]: state => ({ ...state, processing: false }), </s> + client: handle DNS config </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> add import DnsConfig from './DnsConfig'; </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> remove let successMessage = ''; </s> add </s> add this.props.getDnsConfig(); </s> remove enableGlobalProtection() { const { path, method } = this.GLOBAL_ENABLE_PROTECTION; return this.makeRequest(path, method); } disableGlobalProtection() { const { path, method } = this.GLOBAL_DISABLE_PROTECTION; return this.makeRequest(path, method); } </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/reducers/index.js
keep keep add keep keep keep
<mask> rewrites, <mask> services, <mask> stats, <mask> loadingBar: loadingBarReducer, <mask> form: formReducer, <mask> }); </s> + client: handle DNS config </s> remove settings, services, stats, queryLogs, filtering, </s> add settings, services, stats, queryLogs, filtering, dnsConfig, </s> add import { getDnsConfig, setDnsConfig } from '../actions/dnsConfig'; </s> add dnsConfig, </s> remove if (status) { successMessage = 'disabled_protection'; await apiClient.disableGlobalProtection(); } else { successMessage = 'enabled_protection'; await apiClient.enableGlobalProtection(); } </s> add const successMessage = status ? 'disabled_protection' : 'enabled_protection'; await apiClient.setDnsConfig({ protection_enabled: !status }); </s> remove let successMessage = ''; </s> add </s> remove GLOBAL_ENABLE_PROTECTION = { path: 'enable_protection', method: 'POST' }; GLOBAL_DISABLE_PROTECTION = { path: 'disable_protection', method: 'POST' }; </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/197d07f32ba242e13939e01c6511231b0b6abc5a
client/src/reducers/index.js
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> dnsProxy *proxy.Proxy // DNS proxy instance <mask> dnsFilter *dnsfilter.Dnsfilter // DNS filter instance <mask> queryLog querylog.QueryLog // Query log instance <mask> stats stats.Stats <mask> <mask> AllowedClients map[string]bool // IP addresses of whitelist clients <mask> DisallowedClients map[string]bool // IP addresses of clients that should be blocked <mask> AllowedClientsIPNet []net.IPNet // CIDRs of whitelist clients <mask> DisallowedClientsIPNet []net.IPNet // CIDRs of clients that should be blocked <mask> BlockedHosts map[string]bool // hosts that should be blocked <mask> <mask> webRegistered bool <mask> <mask> sync.RWMutex <mask> conf ServerConfig </s> * dnsforward: move access settings and web handlers </s> remove // Return TRUE if this client should be blocked func (s *Server) isBlockedIP(ip string) bool { if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 { _, ok := s.AllowedClients[ip] if ok { return false } if len(s.AllowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.AllowedClientsIPNet { if ipnet.Contains(ipAddr) { return false } } } return true } _, ok := s.DisallowedClients[ip] if ok { return true } if len(s.DisallowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.DisallowedClientsIPNet { if ipnet.Contains(ipAddr) { return true } } } return false } // Return TRUE if this domain should be blocked func (s *Server) isBlockedDomain(host string) bool { _, ok := s.BlockedHosts[host] return ok } </s> add </s> remove func convertArrayToMap(dst *map[string]bool, src []string) { *dst = make(map[string]bool) for _, s := range src { (*dst)[s] = true } } // Split array of IP or CIDR into 2 containers for fast search func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error { *dst = make(map[string]bool) for _, s := range src { ip := net.ParseIP(s) if ip != nil { (*dst)[s] = true continue } _, ipnet, err := net.ParseCIDR(s) if err != nil { return err } *dstIPNet = append(*dstIPNet, *ipnet) } return nil } </s> add </s> remove if s.isBlockedIP(ip) { </s> add if s.access.IsBlockedIP(ip) { </s> remove if s.isBlockedDomain(host) { </s> add if s.access.IsBlockedDomain(host) { </s> remove httpRegister(http.MethodGet, "/control/access/list", handleAccessList) httpRegister(http.MethodPost, "/control/access/set", handleAccessSet) </s> add </s> add s.conf.HTTPRegister("GET", "/control/access/list", s.handleAccessList) s.conf.HTTPRegister("POST", "/control/access/set", s.handleAccessSet)
https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f
dnsforward/dnsforward.go
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> defer s.Unlock() <mask> return s.startInternal(config) <mask> } <mask> <mask> func convertArrayToMap(dst *map[string]bool, src []string) { <mask> *dst = make(map[string]bool) <mask> for _, s := range src { <mask> (*dst)[s] = true <mask> } <mask> } <mask> <mask> // Split array of IP or CIDR into 2 containers for fast search <mask> func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error { <mask> *dst = make(map[string]bool) <mask> <mask> for _, s := range src { <mask> ip := net.ParseIP(s) <mask> if ip != nil { <mask> (*dst)[s] = true <mask> continue <mask> } <mask> <mask> _, ipnet, err := net.ParseCIDR(s) <mask> if err != nil { <mask> return err <mask> } <mask> *dstIPNet = append(*dstIPNet, *ipnet) <mask> } <mask> <mask> return nil <mask> } <mask> <mask> // startInternal starts without locking <mask> func (s *Server) startInternal(config *ServerConfig) error { <mask> if s.dnsProxy != nil { <mask> return errors.New("DNS server is already started") <mask> } </s> * dnsforward: move access settings and web handlers </s> remove // Return TRUE if this client should be blocked func (s *Server) isBlockedIP(ip string) bool { if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 { _, ok := s.AllowedClients[ip] if ok { return false } if len(s.AllowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.AllowedClientsIPNet { if ipnet.Contains(ipAddr) { return false } } } return true } _, ok := s.DisallowedClients[ip] if ok { return true } if len(s.DisallowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.DisallowedClientsIPNet { if ipnet.Contains(ipAddr) { return true } } } return false } // Return TRUE if this domain should be blocked func (s *Server) isBlockedDomain(host string) bool { _, ok := s.BlockedHosts[host] return ok } </s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients) if err != nil { return err } err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients) </s> add s.access = &accessCtx{} err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts) </s> add </s> remove if s.isBlockedIP(ip) { </s> add if s.access.IsBlockedIP(ip) { </s> remove if s.isBlockedDomain(host) { </s> add if s.access.IsBlockedDomain(host) { </s> remove AllowedClients map[string]bool // IP addresses of whitelist clients DisallowedClients map[string]bool // IP addresses of clients that should be blocked AllowedClientsIPNet []net.IPNet // CIDRs of whitelist clients DisallowedClientsIPNet []net.IPNet // CIDRs of clients that should be blocked BlockedHosts map[string]bool // hosts that should be blocked </s> add access *accessCtx
https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f
dnsforward/dnsforward.go
keep keep replace replace replace replace replace replace keep keep keep keep replace replace keep
<mask> } <mask> <mask> err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients) <mask> if err != nil { <mask> return err <mask> } <mask> <mask> err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients) <mask> if err != nil { <mask> return err <mask> } <mask> <mask> convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts) <mask> <mask> if s.conf.TLSListenAddr != nil && len(s.conf.CertificateChainData) != 0 && len(s.conf.PrivateKeyData) != 0 { </s> * dnsforward: move access settings and web handlers </s> remove func convertArrayToMap(dst *map[string]bool, src []string) { *dst = make(map[string]bool) for _, s := range src { (*dst)[s] = true } } // Split array of IP or CIDR into 2 containers for fast search func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error { *dst = make(map[string]bool) for _, s := range src { ip := net.ParseIP(s) if ip != nil { (*dst)[s] = true continue } _, ipnet, err := net.ParseCIDR(s) if err != nil { return err } *dstIPNet = append(*dstIPNet, *ipnet) } return nil } </s> add </s> remove // Return TRUE if this client should be blocked func (s *Server) isBlockedIP(ip string) bool { if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 { _, ok := s.AllowedClients[ip] if ok { return false } if len(s.AllowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.AllowedClientsIPNet { if ipnet.Contains(ipAddr) { return false } } } return true } _, ok := s.DisallowedClients[ip] if ok { return true } if len(s.DisallowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.DisallowedClientsIPNet { if ipnet.Contains(ipAddr) { return true } } } return false } // Return TRUE if this domain should be blocked func (s *Server) isBlockedDomain(host string) bool { _, ok := s.BlockedHosts[host] return ok } </s> add </s> remove if s.isBlockedDomain(host) { </s> add if s.access.IsBlockedDomain(host) { </s> remove if s.isBlockedIP(ip) { </s> add if s.access.IsBlockedIP(ip) { </s> add s.conf.HTTPRegister("GET", "/control/access/list", s.handleAccessList) s.conf.HTTPRegister("POST", "/control/access/set", s.handleAccessSet)
https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f
dnsforward/dnsforward.go
keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep replace keep keep keep
<mask> s.RUnlock() <mask> } <mask> <mask> // Return TRUE if this client should be blocked <mask> func (s *Server) isBlockedIP(ip string) bool { <mask> if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 { <mask> _, ok := s.AllowedClients[ip] <mask> if ok { <mask> return false <mask> } <mask> <mask> if len(s.AllowedClientsIPNet) != 0 { <mask> ipAddr := net.ParseIP(ip) <mask> for _, ipnet := range s.AllowedClientsIPNet { <mask> if ipnet.Contains(ipAddr) { <mask> return false <mask> } <mask> } <mask> } <mask> <mask> return true <mask> } <mask> <mask> _, ok := s.DisallowedClients[ip] <mask> if ok { <mask> return true <mask> } <mask> <mask> if len(s.DisallowedClientsIPNet) != 0 { <mask> ipAddr := net.ParseIP(ip) <mask> for _, ipnet := range s.DisallowedClientsIPNet { <mask> if ipnet.Contains(ipAddr) { <mask> return true <mask> } <mask> } <mask> } <mask> <mask> return false <mask> } <mask> <mask> // Return TRUE if this domain should be blocked <mask> func (s *Server) isBlockedDomain(host string) bool { <mask> _, ok := s.BlockedHosts[host] <mask> return ok <mask> } <mask> <mask> func (s *Server) beforeRequestHandler(p *proxy.Proxy, d *proxy.DNSContext) (bool, error) { <mask> ip, _, _ := net.SplitHostPort(d.Addr.String()) <mask> if s.isBlockedIP(ip) { <mask> log.Tracef("Client IP %s is blocked by settings", ip) <mask> return false, nil <mask> } </s> * dnsforward: move access settings and web handlers </s> remove func convertArrayToMap(dst *map[string]bool, src []string) { *dst = make(map[string]bool) for _, s := range src { (*dst)[s] = true } } // Split array of IP or CIDR into 2 containers for fast search func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error { *dst = make(map[string]bool) for _, s := range src { ip := net.ParseIP(s) if ip != nil { (*dst)[s] = true continue } _, ipnet, err := net.ParseCIDR(s) if err != nil { return err } *dstIPNet = append(*dstIPNet, *ipnet) } return nil } </s> add </s> remove if s.isBlockedDomain(host) { </s> add if s.access.IsBlockedDomain(host) { </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts) </s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients) if err != nil { return err } err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients) </s> add s.access = &accessCtx{} err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove AllowedClients map[string]bool // IP addresses of whitelist clients DisallowedClients map[string]bool // IP addresses of clients that should be blocked AllowedClientsIPNet []net.IPNet // CIDRs of whitelist clients DisallowedClientsIPNet []net.IPNet // CIDRs of clients that should be blocked BlockedHosts map[string]bool // hosts that should be blocked </s> add access *accessCtx
https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f
dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> if len(d.Req.Question) == 1 { <mask> host := strings.TrimSuffix(d.Req.Question[0].Name, ".") <mask> if s.isBlockedDomain(host) { <mask> log.Tracef("Domain %s is blocked by settings", host) <mask> return false, nil <mask> } <mask> } <mask> </s> * dnsforward: move access settings and web handlers </s> remove if s.isBlockedIP(ip) { </s> add if s.access.IsBlockedIP(ip) { </s> remove // Return TRUE if this client should be blocked func (s *Server) isBlockedIP(ip string) bool { if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 { _, ok := s.AllowedClients[ip] if ok { return false } if len(s.AllowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.AllowedClientsIPNet { if ipnet.Contains(ipAddr) { return false } } } return true } _, ok := s.DisallowedClients[ip] if ok { return true } if len(s.DisallowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.DisallowedClientsIPNet { if ipnet.Contains(ipAddr) { return true } } } return false } // Return TRUE if this domain should be blocked func (s *Server) isBlockedDomain(host string) bool { _, ok := s.BlockedHosts[host] return ok } </s> add </s> remove func convertArrayToMap(dst *map[string]bool, src []string) { *dst = make(map[string]bool) for _, s := range src { (*dst)[s] = true } } // Split array of IP or CIDR into 2 containers for fast search func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error { *dst = make(map[string]bool) for _, s := range src { ip := net.ParseIP(s) if ip != nil { (*dst)[s] = true continue } _, ipnet, err := net.ParseCIDR(s) if err != nil { return err } *dstIPNet = append(*dstIPNet, *ipnet) } return nil } </s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients) if err != nil { return err } err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients) </s> add s.access = &accessCtx{} err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts) </s> add </s> add s.conf.HTTPRegister("GET", "/control/access/list", s.handleAccessList) s.conf.HTTPRegister("POST", "/control/access/set", s.handleAccessSet)
https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f
dnsforward/dnsforward.go
keep keep keep add keep
<mask> s.conf.HTTPRegister("POST", "/control/enable_protection", s.handleProtectionEnable) <mask> s.conf.HTTPRegister("POST", "/control/disable_protection", s.handleProtectionDisable) <mask> s.conf.HTTPRegister("POST", "/control/set_upstreams_config", s.handleSetUpstreamConfig) <mask> s.conf.HTTPRegister("POST", "/control/test_upstream_dns", s.handleTestUpstreamDNS) <mask> } </s> * dnsforward: move access settings and web handlers </s> remove // Return TRUE if this client should be blocked func (s *Server) isBlockedIP(ip string) bool { if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 { _, ok := s.AllowedClients[ip] if ok { return false } if len(s.AllowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.AllowedClientsIPNet { if ipnet.Contains(ipAddr) { return false } } } return true } _, ok := s.DisallowedClients[ip] if ok { return true } if len(s.DisallowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.DisallowedClientsIPNet { if ipnet.Contains(ipAddr) { return true } } } return false } // Return TRUE if this domain should be blocked func (s *Server) isBlockedDomain(host string) bool { _, ok := s.BlockedHosts[host] return ok } </s> add </s> remove if s.isBlockedDomain(host) { </s> add if s.access.IsBlockedDomain(host) { </s> remove func convertArrayToMap(dst *map[string]bool, src []string) { *dst = make(map[string]bool) for _, s := range src { (*dst)[s] = true } } // Split array of IP or CIDR into 2 containers for fast search func processIPCIDRArray(dst *map[string]bool, dstIPNet *[]net.IPNet, src []string) error { *dst = make(map[string]bool) for _, s := range src { ip := net.ParseIP(s) if ip != nil { (*dst)[s] = true continue } _, ipnet, err := net.ParseCIDR(s) if err != nil { return err } *dstIPNet = append(*dstIPNet, *ipnet) } return nil } </s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients) if err != nil { return err } err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients) </s> add s.access = &accessCtx{} err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) </s> remove if s.isBlockedIP(ip) { </s> add if s.access.IsBlockedIP(ip) { </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts) </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f
dnsforward/dnsforward_http.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> httpRegister(http.MethodGet, "/control/i18n/current_language", handleI18nCurrentLanguage) <mask> http.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON))) <mask> httpRegister(http.MethodPost, "/control/update", handleUpdate) <mask> <mask> httpRegister(http.MethodGet, "/control/access/list", handleAccessList) <mask> httpRegister(http.MethodPost, "/control/access/set", handleAccessSet) <mask> httpRegister("GET", "/control/profile", handleGetProfile) <mask> <mask> RegisterFilteringHandlers() <mask> RegisterTLSHandlers() <mask> RegisterBlockedServicesHandlers() </s> * dnsforward: move access settings and web handlers </s> add s.conf.HTTPRegister("GET", "/control/access/list", s.handleAccessList) s.conf.HTTPRegister("POST", "/control/access/set", s.handleAccessSet) </s> remove if s.isBlockedDomain(host) { </s> add if s.access.IsBlockedDomain(host) { </s> remove if s.isBlockedIP(ip) { </s> add if s.access.IsBlockedIP(ip) { </s> remove // Return TRUE if this client should be blocked func (s *Server) isBlockedIP(ip string) bool { if len(s.AllowedClients) != 0 || len(s.AllowedClientsIPNet) != 0 { _, ok := s.AllowedClients[ip] if ok { return false } if len(s.AllowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.AllowedClientsIPNet { if ipnet.Contains(ipAddr) { return false } } } return true } _, ok := s.DisallowedClients[ip] if ok { return true } if len(s.DisallowedClientsIPNet) != 0 { ipAddr := net.ParseIP(ip) for _, ipnet := range s.DisallowedClientsIPNet { if ipnet.Contains(ipAddr) { return true } } } return false } // Return TRUE if this domain should be blocked func (s *Server) isBlockedDomain(host string) bool { _, ok := s.BlockedHosts[host] return ok } </s> add </s> remove convertArrayToMap(&s.BlockedHosts, s.conf.BlockedHosts) </s> add </s> remove err := processIPCIDRArray(&s.AllowedClients, &s.AllowedClientsIPNet, s.conf.AllowedClients) if err != nil { return err } err = processIPCIDRArray(&s.DisallowedClients, &s.DisallowedClientsIPNet, s.conf.DisallowedClients) </s> add s.access = &accessCtx{} err := s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts)
https://github.com/AdguardTeam/AdGuardHome/commit/19a1c03d3b9e7f3b9b6d26da97b35cbba51ff74f
home/control.go
keep add keep keep keep keep
<mask> AllServers bool `yaml:"all_servers"` // if true, parallel queries to all configured upstream servers are enabled <mask> <mask> AllowedClients []string `yaml:"allowed_clients"` // IP addresses of whitelist clients <mask> DisallowedClients []string `yaml:"disallowed_clients"` // IP addresses of clients that should be blocked <mask> BlockedHosts []string `yaml:"blocked_hosts"` // hosts that should be blocked <mask> </s> + dns: add "edns_client_subnet" setting </s> add EDNSCSEnabled bool `json:"edns_cs_enabled"` </s> add if js.Exists("edns_cs_enabled") { s.conf.EnableEDNSClientSubnet = req.EDNSCSEnabled restart = true } </s> add EnableEDNSClientSubnet: s.conf.EnableEDNSClientSubnet, </s> add resp.EDNSCSEnabled = s.conf.EnableEDNSClientSubnet </s> add edns_cs_enabled: type: "boolean"
https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1
dnsforward/dnsforward.go
keep keep keep add keep keep keep keep keep
<mask> DomainsReservedUpstreams: s.conf.DomainsReservedUpstreams, <mask> BeforeRequestHandler: s.beforeRequestHandler, <mask> RequestHandler: s.handleDNSRequest, <mask> AllServers: s.conf.AllServers, <mask> } <mask> <mask> s.access = &accessCtx{} <mask> err = s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) <mask> if err != nil { </s> + dns: add "edns_client_subnet" setting </s> add resp.EDNSCSEnabled = s.conf.EnableEDNSClientSubnet </s> add if js.Exists("edns_cs_enabled") { s.conf.EnableEDNSClientSubnet = req.EDNSCSEnabled restart = true } </s> add EDNSCSEnabled bool `json:"edns_cs_enabled"` </s> add EnableEDNSClientSubnet bool `yaml:"edns_client_subnet"` // Enable EDNS Client Subnet option </s> add edns_cs_enabled: type: "boolean"
https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1
dnsforward/dnsforward.go
keep keep add keep keep keep keep keep keep
<mask> BlockingMode string `json:"blocking_mode"` <mask> BlockingIPv4 string `json:"blocking_ipv4"` <mask> BlockingIPv6 string `json:"blocking_ipv6"` <mask> } <mask> <mask> func (s *Server) handleGetConfig(w http.ResponseWriter, r *http.Request) { <mask> resp := dnsConfigJSON{} <mask> s.RLock() <mask> resp.ProtectionEnabled = s.conf.ProtectionEnabled </s> + dns: add "edns_client_subnet" setting </s> add resp.EDNSCSEnabled = s.conf.EnableEDNSClientSubnet </s> add if js.Exists("edns_cs_enabled") { s.conf.EnableEDNSClientSubnet = req.EDNSCSEnabled restart = true } </s> add EnableEDNSClientSubnet: s.conf.EnableEDNSClientSubnet, </s> add edns_cs_enabled: type: "boolean" </s> add EnableEDNSClientSubnet bool `yaml:"edns_client_subnet"` // Enable EDNS Client Subnet option
https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1
dnsforward/dnsforward_http.go
keep add keep keep keep keep keep
<mask> resp.BlockingIPv6 = s.conf.BlockingIPv6 <mask> resp.RateLimit = s.conf.Ratelimit <mask> s.RUnlock() <mask> <mask> js, err := json.Marshal(resp) <mask> if err != nil { <mask> httpError(r, w, http.StatusInternalServerError, "json.Marshal: %s", err) </s> + dns: add "edns_client_subnet" setting </s> add EnableEDNSClientSubnet: s.conf.EnableEDNSClientSubnet, </s> add if js.Exists("edns_cs_enabled") { s.conf.EnableEDNSClientSubnet = req.EDNSCSEnabled restart = true } </s> add EDNSCSEnabled bool `json:"edns_cs_enabled"` </s> add EnableEDNSClientSubnet bool `yaml:"edns_client_subnet"` // Enable EDNS Client Subnet option </s> add edns_cs_enabled: type: "boolean"
https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1
dnsforward/dnsforward_http.go
keep add keep keep keep keep
<mask> } <mask> <mask> s.Unlock() <mask> s.conf.ConfigModified() <mask> <mask> if restart { </s> + dns: add "edns_client_subnet" setting </s> add EnableEDNSClientSubnet: s.conf.EnableEDNSClientSubnet, </s> add resp.EDNSCSEnabled = s.conf.EnableEDNSClientSubnet </s> add EDNSCSEnabled bool `json:"edns_cs_enabled"` </s> add EnableEDNSClientSubnet bool `yaml:"edns_client_subnet"` // Enable EDNS Client Subnet option </s> add edns_cs_enabled: type: "boolean"
https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1
dnsforward/dnsforward_http.go
keep add keep keep keep keep
<mask> blocking_ipv6: <mask> type: "string" <mask> <mask> UpstreamsConfig: <mask> type: "object" <mask> description: "Upstreams configuration" </s> + dns: add "edns_client_subnet" setting </s> add if js.Exists("edns_cs_enabled") { s.conf.EnableEDNSClientSubnet = req.EDNSCSEnabled restart = true } </s> add resp.EDNSCSEnabled = s.conf.EnableEDNSClientSubnet </s> add EDNSCSEnabled bool `json:"edns_cs_enabled"` </s> add EnableEDNSClientSubnet: s.conf.EnableEDNSClientSubnet, </s> add EnableEDNSClientSubnet bool `yaml:"edns_client_subnet"` // Enable EDNS Client Subnet option
https://github.com/AdguardTeam/AdGuardHome/commit/19a94bf789bba6ab1b831e956600428998822de1
openapi/openapi.yaml
keep keep add keep keep keep keep keep keep
<mask> <mask> } <mask> <mask> func handleStatsTop(w http.ResponseWriter, r *http.Request) { <mask> resp, err := client.Get("http://127.0.0.1:8618/querylog") <mask> if err != nil { <mask> errortext := fmt.Sprintf("Couldn't get querylog from coredns: %T %s\n", err, err) <mask> log.Println(errortext) <mask> http.Error(w, errortext, http.StatusBadGateway) </s> Add API call to reset stats </s> remove func init() { </s> add func purgeStats() { </s> remove periodic.Entries = statsEntries{} </s> add *periodic = periodicStats{} </s> add http.HandleFunc("/control/stats_reset", optionalAuth(ensurePOST(handleStatsReset)))
https://github.com/AdguardTeam/AdGuardHome/commit/19e76b693803220dffcd0a1fb1fe1e654309a11a
control.go
keep add keep keep keep keep keep keep
<mask> http.HandleFunc("/control/stats_history", optionalAuth(ensureGET(handleStatsHistory))) <mask> http.HandleFunc("/control/stats_top", optionalAuth(ensureGET(handleStatsTop))) <mask> http.HandleFunc("/control/querylog", optionalAuth(ensureGET(handleQueryLog))) <mask> http.HandleFunc("/control/querylog_enable", optionalAuth(ensurePOST(handleQueryLogEnable))) <mask> http.HandleFunc("/control/querylog_disable", optionalAuth(ensurePOST(handleQueryLogDisable))) <mask> http.HandleFunc("/control/set_upstream_dns", optionalAuth(ensurePOST(handleSetUpstreamDNS))) <mask> http.HandleFunc("/control/test_upstream_dns", optionalAuth(ensurePOST(handleTestUpstreamDNS))) <mask> http.HandleFunc("/control/version.json", optionalAuth(handleGetVersionJSON)) </s> Add API call to reset stats </s> remove func init() { </s> add func purgeStats() { </s> remove periodic.Entries = statsEntries{} </s> add *periodic = periodicStats{} </s> add func handleStatsReset(w http.ResponseWriter, r *http.Request) { purgeStats() _, err := fmt.Fprintf(w, "OK\n") if err != nil { httpError(w, http.StatusInternalServerError, "Couldn't write body: %s", err) return } }
https://github.com/AdguardTeam/AdGuardHome/commit/19e76b693803220dffcd0a1fb1fe1e654309a11a
control.go
keep keep keep keep replace keep keep replace keep keep
<mask> <mask> var statistics stats <mask> <mask> func initPeriodicStats(periodic *periodicStats) { <mask> periodic.Entries = statsEntries{} <mask> } <mask> <mask> func init() { <mask> initPeriodicStats(&statistics.PerSecond) <mask> initPeriodicStats(&statistics.PerMinute) </s> Add API call to reset stats </s> add func handleStatsReset(w http.ResponseWriter, r *http.Request) { purgeStats() _, err := fmt.Fprintf(w, "OK\n") if err != nil { httpError(w, http.StatusInternalServerError, "Couldn't write body: %s", err) return } } </s> add http.HandleFunc("/control/stats_reset", optionalAuth(ensurePOST(handleStatsReset)))
https://github.com/AdguardTeam/AdGuardHome/commit/19e76b693803220dffcd0a1fb1fe1e654309a11a
stats.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.40.4 <mask> github.com/AdguardTeam/golibs v0.10.4 <mask> github.com/AdguardTeam/urlfilter v0.15.1 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/ameshkov/dnscrypt/v2 v2.2.3 <mask> github.com/digineo/go-ipset/v2 v2.2.1 <mask> github.com/fsnotify/fsnotify v1.5.1 <mask> github.com/go-ping/ping v0.0.0-20211130115550-779d1e919534 </s> Pull request: 4133 empty rewrite Merge in DNS/adguard-home from 4133-empty-rewrite to master Closes #4133. Squashed commit of the following: commit 4d2313c211c3955922d340c006b323c65e5e5ba4 Author: Eugene Burkov <[email protected]> Date: Tue Jan 18 21:36:21 2022 +0300 all: log changes commit 5b8e392a2225c215fc117223d3f6553f8bdf21cd Author: Eugene Burkov <[email protected]> Date: Tue Jan 18 21:32:57 2022 +0300 all: upd urlfilter </s> remove github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M= github.com/AdguardTeam/urlfilter v0.15.1/go.mod h1:EwXwrYhowP7bedqmOrmKKmQtpBYFyDNEBFQ+lxdUgQU= </s> add github.com/AdguardTeam/urlfilter v0.15.2 h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ= github.com/AdguardTeam/urlfilter v0.15.2/go.mod h1:46YZDOV1+qtdRDuhZKVPSSp7JWWes0KayqHrKAFBdEI= </s> remove github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY= </s> add </s> remove golang.org/x/net v0.0.0-20210908191846-a5e095526f91/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/1a3bf5ebda7310146486aeff23b5e3307860c6bc
go.mod
keep keep keep replace keep keep keep keep replace replace keep keep
<mask> github.com/AdguardTeam/dnsproxy v0.40.4/go.mod h1:PZ9l22h3Er+5mxFQB7oHZMTvx+aa9R6LbzA/ikXQlS0= <mask> github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY= <mask> github.com/AdguardTeam/golibs v0.10.3/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw= <mask> github.com/AdguardTeam/golibs v0.10.4 h1:TMBkablZC0IZOpRgg9fzAKlxxNhSN2YJq7qbgtuZ7PQ= <mask> github.com/AdguardTeam/golibs v0.10.4/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw= <mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU= <mask> github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M= <mask> github.com/AdguardTeam/urlfilter v0.15.1/go.mod h1:EwXwrYhowP7bedqmOrmKKmQtpBYFyDNEBFQ+lxdUgQU= <mask> github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= <mask> github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= </s> Pull request: 4133 empty rewrite Merge in DNS/adguard-home from 4133-empty-rewrite to master Closes #4133. Squashed commit of the following: commit 4d2313c211c3955922d340c006b323c65e5e5ba4 Author: Eugene Burkov <[email protected]> Date: Tue Jan 18 21:36:21 2022 +0300 all: log changes commit 5b8e392a2225c215fc117223d3f6553f8bdf21cd Author: Eugene Burkov <[email protected]> Date: Tue Jan 18 21:32:57 2022 +0300 all: upd urlfilter </s> remove github.com/AdguardTeam/urlfilter v0.15.1 </s> add github.com/AdguardTeam/urlfilter v0.15.2 </s> remove golang.org/x/net v0.0.0-20210908191846-a5e095526f91/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/1a3bf5ebda7310146486aeff23b5e3307860c6bc
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= <mask> golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20210908191846-a5e095526f91/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= </s> Pull request: 4133 empty rewrite Merge in DNS/adguard-home from 4133-empty-rewrite to master Closes #4133. Squashed commit of the following: commit 4d2313c211c3955922d340c006b323c65e5e5ba4 Author: Eugene Burkov <[email protected]> Date: Tue Jan 18 21:36:21 2022 +0300 all: log changes commit 5b8e392a2225c215fc117223d3f6553f8bdf21cd Author: Eugene Burkov <[email protected]> Date: Tue Jan 18 21:32:57 2022 +0300 all: upd urlfilter </s> remove github.com/AdguardTeam/urlfilter v0.15.1 h1:dP6S7J6eFAk8MN4IDpUq2fZoBo8K8fmc6pXpxNIv84M= github.com/AdguardTeam/urlfilter v0.15.1/go.mod h1:EwXwrYhowP7bedqmOrmKKmQtpBYFyDNEBFQ+lxdUgQU= </s> add github.com/AdguardTeam/urlfilter v0.15.2 h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ= github.com/AdguardTeam/urlfilter v0.15.2/go.mod h1:46YZDOV1+qtdRDuhZKVPSSp7JWWes0KayqHrKAFBdEI= </s> remove github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY= </s> add </s> remove github.com/AdguardTeam/urlfilter v0.15.1 </s> add github.com/AdguardTeam/urlfilter v0.15.2
https://github.com/AdguardTeam/AdGuardHome/commit/1a3bf5ebda7310146486aeff23b5e3307860c6bc
go.sum
keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep replace replace replace keep keep keep keep
<mask> }; <mask> <mask> const FILTERED_STATUS_TO_FIELDS_MAP = { <mask> [FILTERED_STATUS.NOT_FILTERED_NOT_FOUND]: { <mask> encryption_status: boldStatusLabel, <mask> install_settings_dns: upstream, <mask> elapsed: formattedElapsedMs, <mask> response_code: status, <mask> response_table_header: renderResponses(response), <mask> }, <mask> [FILTERED_STATUS.FILTERED_BLOCKED_SERVICE]: { <mask> encryption_status: boldStatusLabel, <mask> install_settings_dns: upstream, <mask> elapsed: formattedElapsedMs, <mask> filter, <mask> rule_label: rule, <mask> response_code: status, <mask> original_response: renderResponses(originalResponse), <mask> }, <mask> [FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: { <mask> encryption_status: boldStatusLabel, <mask> install_settings_dns: upstream, <mask> elapsed: formattedElapsedMs, <mask> filter, <mask> rule_label: rule, <mask> response_code: status, <mask> }, <mask> [FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: { <mask> encryption_status: boldStatusLabel, <mask> filter, <mask> rule_label: rule, <mask> response_code: status, <mask> }, <mask> [FILTERED_STATUS.FILTERED_SAFE_SEARCH]: { <mask> encryption_status: boldStatusLabel, <mask> install_settings_dns: upstream, <mask> elapsed: formattedElapsedMs, <mask> response_code: status, <mask> response_table_header: renderResponses(response), <mask> }, <mask> [FILTERED_STATUS.FILTERED_BLACK_LIST]: { <mask> encryption_status: boldStatusLabel, <mask> filter, <mask> rule_label: rule, <mask> install_settings_dns: upstream, <mask> elapsed: formattedElapsedMs, <mask> response_code: status, <mask> original_response: renderResponses(originalResponse), <mask> }, <mask> }; <mask> <mask> const content = FILTERED_STATUS_TO_FIELDS_MAP[reason] <mask> ? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason]) <mask> : Object.entries(FILTERED_STATUS_TO_FIELDS_MAP.NotFilteredNotFound); <mask> <mask> const detailedInfo = isBlocked ? filter : formattedElapsedMs; <mask> <mask> return ( </s> - client: show all available information in the response tooltip </s> add const content = getTooltipContent(reason);
https://github.com/AdguardTeam/AdGuardHome/commit/1ab650bb86f4b3103b8c650c6af862c6f1881694
client/src/components/Logs/Cells/getResponseCell.js
keep keep add keep keep keep keep keep
<mask> } <mask> }; <mask> <mask> const detailedInfo = isBlocked ? filter : formattedElapsedMs; <mask> <mask> return ( <mask> <div className="logs__row"> <mask> {getIconTooltip({ </s> - client: show all available information in the response tooltip </s> remove const FILTERED_STATUS_TO_FIELDS_MAP = { [FILTERED_STATUS.NOT_FILTERED_NOT_FOUND]: { encryption_status: boldStatusLabel, install_settings_dns: upstream, elapsed: formattedElapsedMs, response_code: status, response_table_header: renderResponses(response), }, [FILTERED_STATUS.FILTERED_BLOCKED_SERVICE]: { encryption_status: boldStatusLabel, install_settings_dns: upstream, elapsed: formattedElapsedMs, filter, rule_label: rule, response_code: status, original_response: renderResponses(originalResponse), }, [FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: { encryption_status: boldStatusLabel, install_settings_dns: upstream, elapsed: formattedElapsedMs, filter, rule_label: rule, response_code: status, }, [FILTERED_STATUS.NOT_FILTERED_WHITE_LIST]: { encryption_status: boldStatusLabel, filter, rule_label: rule, response_code: status, }, [FILTERED_STATUS.FILTERED_SAFE_SEARCH]: { encryption_status: boldStatusLabel, install_settings_dns: upstream, elapsed: formattedElapsedMs, response_code: status, response_table_header: renderResponses(response), }, [FILTERED_STATUS.FILTERED_BLACK_LIST]: { encryption_status: boldStatusLabel, filter, rule_label: rule, install_settings_dns: upstream, elapsed: formattedElapsedMs, response_code: status, original_response: renderResponses(originalResponse), }, </s> add const COMMON_CONTENT = { encryption_status: boldStatusLabel, install_settings_dns: upstream, elapsed: formattedElapsedMs, response_code: status, filter, rule_label: rule, response_table_header: renderResponses(response), original_response: renderResponses(originalResponse), </s> remove const content = FILTERED_STATUS_TO_FIELDS_MAP[reason] ? Object.entries(FILTERED_STATUS_TO_FIELDS_MAP[reason]) : Object.entries(FILTERED_STATUS_TO_FIELDS_MAP.NotFilteredNotFound); </s> add const getTooltipContent = (reason) => { switch (reason) { case FILTERED_STATUS.FILTERED_BLOCKED_SERVICE: case FILTERED_STATUS.NOT_FILTERED_WHITE_LIST: case FILTERED_STATUS.FILTERED_BLACK_LIST: { return Object.entries(COMMON_CONTENT); } default: { return Object.entries({ ...COMMON_CONTENT, filter: '' }); } } };
https://github.com/AdguardTeam/AdGuardHome/commit/1ab650bb86f4b3103b8c650c6af862c6f1881694
client/src/components/Logs/Cells/getResponseCell.js
keep add keep keep keep keep
<mask> "example_regex_meaning": "block access to domains matching the specified regular expression.", <mask> "example_upstream_regular": "regular DNS (over UDP);", <mask> "example_upstream_udp": "regular DNS (over UDP, hostname);", <mask> "example_upstream_dot": "encrypted <0>DNS-over-TLS</0>;", <mask> "example_upstream_doh": "encrypted <0>DNS-over-HTTPS</0>;", <mask> "example_upstream_doq": "encrypted <0>DNS-over-QUIC</0>;", </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> add "example_upstream_tcp_port": "regular DNS (over TCP, with port);", </s> remove 'default': 784 </s> add 'default': 853 </s> remove * `quic://unfiltered.adguard-dns.com:784`: encrypted DNS-over-QUIC (experimental). </s> add * `quic://unfiltered.adguard-dns.com`: encrypted DNS-over-QUIC. </s> remove <code>sdns://...</code>: <span> <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </span> </s> add <code>sdns://...</code>: <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </s> add # # TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for # DNS-over-QUIC in a future release. </s> remove export const DNS_OVER_QUIC_PORT = 784; </s> add export const DNS_OVER_QUIC_PORT = 853;
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
client/src/__locales/en.json
keep add keep keep keep keep keep
<mask> "example_upstream_sdns": "<0>DNS Stamps</0> for <1>DNSCrypt</1> or <2>DNS-over-HTTPS</2> resolvers;", <mask> "example_upstream_tcp": "regular DNS (over TCP);", <mask> "example_upstream_tcp_hostname": "regular DNS (over TCP, hostname);", <mask> "all_lists_up_to_date_toast": "All lists are already up-to-date", <mask> "updated_upstream_dns_toast": "Upstream servers successfully saved", <mask> "dns_test_ok_toast": "Specified DNS servers are working correctly", <mask> "dns_test_not_ok_toast": "Server \"{{key}}\": could not be used, please check that you've written it correctly", </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> add "example_upstream_regular_port": "regular DNS (over UDP, with port);", </s> remove * `quic://unfiltered.adguard-dns.com:784`: encrypted DNS-over-QUIC (experimental). </s> add * `quic://unfiltered.adguard-dns.com`: encrypted DNS-over-QUIC. </s> remove 'default': 784 </s> add 'default': 853 </s> remove <code>sdns://...</code>: <span> <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </span> </s> add <code>sdns://...</code>: <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </s> remove 'default': 784 </s> add 'default': 853 </s> add # # TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for # DNS-over-QUIC in a future release.
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
client/src/__locales/en.json
keep keep keep keep replace keep keep keep keep keep
<mask> <div className="list leading-loose"> <mask> <Trans>examples_title</Trans>: <mask> <ol className="leading-loose"> <mask> <li> <mask> <code>94.140.14.140</code>: {props.t('example_upstream_regular')} <mask> </li> <mask> <li> <mask> <code>udp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_udp</Trans> <mask> </li> <mask> <li> </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove <code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans> </s> add <code>tcp://94.140.14.140</code>, <code>tcp://[2a10:50c0::1:ff]</code>: <Trans>example_upstream_tcp</Trans> </li> <li> <code>tcp://94.140.14.140:53</code>, <code>tcp://[2a10:50c0::1:ff]:53</code>: <Trans>example_upstream_tcp_port</Trans> </s> remove <code>tls://unfiltered.adguard-dns.com</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </span> </s> add <code>tls://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </s> remove <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <span> <Trans>example_upstream_comment</Trans> </span> </s> add <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <Trans> example_upstream_comment </Trans> </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </span> </s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </s> remove <code>quic://unfiltered.adguard-dns.com:784</code>: <span> <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </span> </s> add <code>quic://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </s> remove <code>[/example.local/]94.140.14.140</code>: <span> <Trans components={[ <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" target="_blank" rel="noopener noreferrer" key="0" > Link </a>, ]} > example_upstream_reserved </Trans> </span> </s> add <code>[/example.local/]94.140.14.140</code>: <Trans components={[ <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" target="_blank" rel="noopener noreferrer" key="0" > Link </a>, ]} > example_upstream_reserved </Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
client/src/components/Settings/Dns/Upstream/Examples.js
keep keep keep keep replace keep keep keep keep keep
<mask> <li> <mask> <code>udp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_udp</Trans> <mask> </li> <mask> <li> <mask> <code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans> <mask> </li> <mask> <li> <mask> <code>tcp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_tcp_hostname</Trans> <mask> </li> <mask> <li> </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove <code>94.140.14.140</code>: {props.t('example_upstream_regular')} </s> add <code>94.140.14.140</code>, <code>2a10:50c0::1:ff</code>: {props.t('example_upstream_regular')} </li> <li> <code>94.140.14.140:53</code>, <code>[2a10:50c0::1:ff]:53</code>: {props.t('example_upstream_regular_port')} </s> remove <code>tls://unfiltered.adguard-dns.com</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </span> </s> add <code>tls://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </s> remove <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <span> <Trans>example_upstream_comment</Trans> </span> </s> add <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <Trans> example_upstream_comment </Trans> </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </span> </s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </s> remove <code>quic://unfiltered.adguard-dns.com:784</code>: <span> <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </span> </s> add <code>quic://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </s> remove <code>[/example.local/]94.140.14.140</code>: <span> <Trans components={[ <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" target="_blank" rel="noopener noreferrer" key="0" > Link </a>, ]} > example_upstream_reserved </Trans> </span> </s> add <code>[/example.local/]94.140.14.140</code>: <Trans components={[ <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" target="_blank" rel="noopener noreferrer" key="0" > Link </a>, ]} > example_upstream_reserved </Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
client/src/components/Settings/Dns/Upstream/Examples.js
keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
<mask> <code>tcp://unfiltered.adguard-dns.com</code>: <Trans>example_upstream_tcp_hostname</Trans> <mask> </li> <mask> <li> <mask> <code>tls://unfiltered.adguard-dns.com</code>: <mask> <span> <mask> <Trans <mask> components={[ <mask> <a <mask> href="https://en.wikipedia.org/wiki/DNS_over_TLS" <mask> target="_blank" <mask> rel="noopener noreferrer" <mask> key="0" <mask> > <mask> DNS-over-TLS <mask> </a>, <mask> ]} <mask> > <mask> example_upstream_dot <mask> </Trans> <mask> </span> <mask> </li> <mask> <li> <mask> <code>https://unfiltered.adguard-dns.com/dns-query</code>: <mask> <span> <mask> <Trans <mask> components={[ <mask> <a <mask> href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" <mask> target="_blank" <mask> rel="noopener noreferrer" <mask> key="0" <mask> > <mask> DNS-over-HTTPS <mask> </a>, <mask> ]} <mask> > <mask> example_upstream_doh <mask> </Trans> <mask> </span> </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove <code>sdns://...</code>: <span> <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </span> </s> add <code>sdns://...</code>: <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </s> remove <code>quic://unfiltered.adguard-dns.com:784</code>: <span> <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </span> </s> add <code>quic://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </s> remove <code>[/example.local/]94.140.14.140</code>: <span> <Trans components={[ <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" target="_blank" rel="noopener noreferrer" key="0" > Link </a>, ]} > example_upstream_reserved </Trans> </span> </s> add <code>[/example.local/]94.140.14.140</code>: <Trans components={[ <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" target="_blank" rel="noopener noreferrer" key="0" > Link </a>, ]} > example_upstream_reserved </Trans> </s> remove <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <span> <Trans>example_upstream_comment</Trans> </span> </s> add <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <Trans> example_upstream_comment </Trans> </s> remove <code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans> </s> add <code>tcp://94.140.14.140</code>, <code>tcp://[2a10:50c0::1:ff]</code>: <Trans>example_upstream_tcp</Trans> </li> <li> <code>tcp://94.140.14.140:53</code>, <code>tcp://[2a10:50c0::1:ff]:53</code>: <Trans>example_upstream_tcp_port</Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
client/src/components/Settings/Dns/Upstream/Examples.js
keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
<mask> </li> <mask> <li> <mask> <code>quic://unfiltered.adguard-dns.com:784</code>: <mask> <span> <mask> <Trans <mask> components={[ <mask> <a <mask> href="https://datatracker.ietf.org/doc/html/rfc9250" <mask> target="_blank" <mask> rel="noopener noreferrer" <mask> key="0" <mask> > <mask> DNS-over-QUIC <mask> </a>, <mask> ]} <mask> > <mask> example_upstream_doq <mask> </Trans> <mask> </span> <mask> </li> <mask> <li> <mask> <code>sdns://...</code>: <mask> <span> <mask> <Trans <mask> components={[ <mask> <a <mask> href="https://dnscrypt.info/stamps/" <mask> target="_blank" <mask> rel="noopener noreferrer" <mask> key="0" <mask> > <mask> DNS Stamps <mask> </a>, <mask> <a <mask> href="https://dnscrypt.info/" <mask> target="_blank" <mask> rel="noopener noreferrer" <mask> key="1" <mask> > <mask> DNSCrypt <mask> </a>, <mask> <a <mask> href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" <mask> target="_blank" <mask> rel="noopener noreferrer" <mask> key="2" <mask> > <mask> DNS-over-HTTPS <mask> </a>, <mask> ]} <mask> > <mask> example_upstream_sdns <mask> </Trans> <mask> </span> <mask> </li> <mask> <li> <mask> <code>[/example.local/]94.140.14.140</code>: <mask> <span> </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </span> </s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </s> remove <code>[/example.local/]94.140.14.140</code>: <span> <Trans components={[ <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" target="_blank" rel="noopener noreferrer" key="0" > Link </a>, ]} > example_upstream_reserved </Trans> </span> </s> add <code>[/example.local/]94.140.14.140</code>: <Trans components={[ <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" target="_blank" rel="noopener noreferrer" key="0" > Link </a>, ]} > example_upstream_reserved </Trans> </s> remove <code>tls://unfiltered.adguard-dns.com</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </span> </s> add <code>tls://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </s> remove * `quic://unfiltered.adguard-dns.com:784`: encrypted DNS-over-QUIC (experimental). </s> add * `quic://unfiltered.adguard-dns.com`: encrypted DNS-over-QUIC. </s> remove <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <span> <Trans>example_upstream_comment</Trans> </span> </s> add <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <Trans> example_upstream_comment </Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
client/src/components/Settings/Dns/Upstream/Examples.js
keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep replace replace replace replace
<mask> </li> <mask> <li> <mask> <code>[/example.local/]94.140.14.140</code>: <mask> <span> <mask> <Trans <mask> components={[ <mask> <a <mask> href="https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams-for-domains" <mask> target="_blank" <mask> rel="noopener noreferrer" <mask> key="0" <mask> > <mask> Link <mask> </a>, <mask> ]} <mask> > <mask> example_upstream_reserved <mask> </Trans> <mask> </span> <mask> </li> <mask> <li> <mask> <code>{COMMENT_LINE_DEFAULT_TOKEN} comment</code>: <mask> <span> <mask> <Trans>example_upstream_comment</Trans> <mask> </span> </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove <code>sdns://...</code>: <span> <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </span> </s> add <code>sdns://...</code>: <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </s> remove <code>quic://unfiltered.adguard-dns.com:784</code>: <span> <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </span> </s> add <code>quic://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </span> </s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </s> remove <code>tls://unfiltered.adguard-dns.com</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </span> </s> add <code>tls://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </s> remove <code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans> </s> add <code>tcp://94.140.14.140</code>, <code>tcp://[2a10:50c0::1:ff]</code>: <Trans>example_upstream_tcp</Trans> </li> <li> <code>tcp://94.140.14.140:53</code>, <code>tcp://[2a10:50c0::1:ff]:53</code>: <Trans>example_upstream_tcp_port</Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
client/src/components/Settings/Dns/Upstream/Examples.js
keep keep keep keep replace keep keep keep keep keep
<mask> export const STANDARD_DNS_PORT = 53; <mask> export const STANDARD_WEB_PORT = 80; <mask> export const STANDARD_HTTPS_PORT = 443; <mask> export const DNS_OVER_TLS_PORT = 853; <mask> export const DNS_OVER_QUIC_PORT = 784; <mask> export const MAX_PORT = 65535; <mask> <mask> export const EMPTY_DATE = '0001-01-01T00:00:00Z'; <mask> <mask> export const DEBOUNCE_TIMEOUT = 300; </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> add # # TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for # DNS-over-QUIC in a future release. </s> remove <code>sdns://...</code>: <span> <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </span> </s> add <code>sdns://...</code>: <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </s> add "example_upstream_tcp_port": "regular DNS (over TCP, with port);", </s> remove <code>94.140.14.140</code>: {props.t('example_upstream_regular')} </s> add <code>94.140.14.140</code>, <code>2a10:50c0::1:ff</code>: {props.t('example_upstream_regular')} </li> <li> <code>94.140.14.140:53</code>, <code>[2a10:50c0::1:ff]:53</code>: {props.t('example_upstream_regular_port')} </s> remove <code>tcp://94.140.14.140</code>: <Trans>example_upstream_tcp</Trans> </s> add <code>tcp://94.140.14.140</code>, <code>tcp://[2a10:50c0::1:ff]</code>: <Trans>example_upstream_tcp</Trans> </li> <li> <code>tcp://94.140.14.140:53</code>, <code>tcp://[2a10:50c0::1:ff]:53</code>: <Trans>example_upstream_tcp_port</Trans> </s> remove <code>tls://unfiltered.adguard-dns.com</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans> </span> </s> add <code>tls://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_TLS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-TLS </a>, ]} > example_upstream_dot </Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
client/src/helpers/constants.js
keep keep keep keep replace keep keep keep keep keep
<mask> 'description': > <mask> Validatable TLS settings. <mask> 'example': <mask> 'certificate_path': '/etc/ssl/example.com.cert' <mask> 'port_dns_over_quic': 784 <mask> 'port_dns_over_tls': 853 <mask> 'port_https': 443 <mask> 'private_key_path': '/etc/ssl/example.com.key' <mask> 'server_name': 'dns.example.com' <mask> 'properties': </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove 'port_dns_over_quic': 784 </s> add 'port_dns_over_quic': 853 </s> remove 'default': 784 </s> add 'default': 853 </s> remove 'default': 784 </s> add 'default': 853 </s> add # # TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for # DNS-over-QUIC in a future release. </s> remove <code>sdns://...</code>: <span> <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </span> </s> add <code>sdns://...</code>: <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </span> </s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
openapi/v1.yaml
keep keep keep keep replace keep keep keep keep keep
<mask> Should not be sent if `certificate` is sent. Otherwise, must be <mask> sent. <mask> 'type': 'string' <mask> 'port_dns_over_quic': <mask> 'default': 784 <mask> 'description': > <mask> The DNS-over-QUIC port. If `0`, DNS-over-QUIC is disabled. <mask> 'format': 'int64' <mask> 'maximum': 65535 <mask> 'minimum': 0 </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove 'default': 784 </s> add 'default': 853 </s> remove 'port_dns_over_quic': 784 </s> add 'port_dns_over_quic': 853 </s> add "example_upstream_tcp_port": "regular DNS (over TCP, with port);", </s> remove 'port_dns_over_quic': 784 </s> add 'port_dns_over_quic': 853 </s> add # # TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for # DNS-over-QUIC in a future release. </s> remove <code>quic://unfiltered.adguard-dns.com:784</code>: <span> <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </span> </s> add <code>quic://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans>
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
openapi/v1.yaml
keep keep keep keep replace keep keep keep keep keep
<mask> TLS and encryption settings. <mask> 'example': <mask> 'certificate_path': '/etc/ssl/example.com.cert' <mask> 'enabled': true <mask> 'port_dns_over_quic': 784 <mask> 'port_dns_over_tls': 853 <mask> 'port_https': 443 <mask> 'private_key_path': '/etc/ssl/example.com.key' <mask> 'server_name': 'dns.example.com' <mask> 'required': </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove 'port_dns_over_quic': 784 </s> add 'port_dns_over_quic': 853 </s> remove 'default': 784 </s> add 'default': 853 </s> remove 'default': 784 </s> add 'default': 853 </s> add # # TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for # DNS-over-QUIC in a future release. </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </span> </s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </s> add "example_upstream_tcp_port": "regular DNS (over TCP, with port);",
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
openapi/v1.yaml
keep keep keep keep replace keep keep keep keep keep
<mask> over HTTPS, and the DNS server will listen requests over <mask> DNS-over-TLS and other protocols. <mask> 'type': 'boolean' <mask> 'port_dns_over_quic': <mask> 'default': 784 <mask> 'description': > <mask> The DNS-over-QUIC port. If `0`, DNS-over-QUIC is disabled. <mask> 'format': 'int64' <mask> 'maximum': 65535 <mask> 'minimum': 0 </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove 'default': 784 </s> add 'default': 853 </s> add # # TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for # DNS-over-QUIC in a future release. </s> remove 'port_dns_over_quic': 784 </s> add 'port_dns_over_quic': 853 </s> remove 'port_dns_over_quic': 784 </s> add 'port_dns_over_quic': 853 </s> remove * `quic://unfiltered.adguard-dns.com:784`: encrypted DNS-over-QUIC (experimental). </s> add * `quic://unfiltered.adguard-dns.com`: encrypted DNS-over-QUIC. </s> add "example_upstream_regular_port": "regular DNS (over UDP, with port);",
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
openapi/v1.yaml
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> * `https://unfiltered.adguard-dns.com/dns-query`: encrypted <mask> DNS-over-HTTPS. <mask> <mask> * `quic://unfiltered.adguard-dns.com:784`: encrypted DNS-over-QUIC <mask> (experimental). <mask> <mask> * `tcp://94.140.14.140`: plain DNS-over-TCP. <mask> <mask> * `sdns://...`: DNS Stamps for DNSCrypt or DNS-over-HTTPS <mask> resolvers. </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove <code>sdns://...</code>: <span> <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </span> </s> add <code>sdns://...</code>: <Trans components={[ <a href="https://dnscrypt.info/stamps/" target="_blank" rel="noopener noreferrer" key="0" > DNS Stamps </a>, <a href="https://dnscrypt.info/" target="_blank" rel="noopener noreferrer" key="1" > DNSCrypt </a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="2" > DNS-over-HTTPS </a>, ]} > example_upstream_sdns </Trans> </s> add "example_upstream_tcp_port": "regular DNS (over TCP, with port);", </s> add # # TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for # DNS-over-QUIC in a future release. </s> remove 'default': 784 </s> add 'default': 853 </s> remove <code>https://unfiltered.adguard-dns.com/dns-query</code>: <span> <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </span> </s> add <code>https://unfiltered.adguard-dns.com/dns-query</code>: <Trans components={[ <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-HTTPS </a>, ]} > example_upstream_doh </Trans> </s> add "example_upstream_regular_port": "regular DNS (over UDP, with port);",
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
openapi/v1.yaml
keep add keep keep keep keep
<mask> # 6060 : TCP : HTTP (pprof) <mask> # 8853 : UDP : DNS-over-QUIC (experimental) <mask> EXPOSE 53/tcp 53/udp 67/udp 68/udp 80/tcp 443/tcp 443/udp 784/udp\ <mask> 853/tcp 853/udp 3000/tcp 3000/udp 3001/tcp 3001/udp 5443/tcp\ <mask> 5443/udp 6060/tcp 8853/udp <mask> </s> Pull request #1572: 4640-imp-upstream-doc Updates #4640. Squashed commit of the following: commit 764b024e7a5a5f6ea2b18b5e13fdc4fa38c49af2 Merge: 7bace870 6856a803 Author: Ainar Garipov <[email protected]> Date: Fri Aug 19 17:17:44 2022 +0300 Merge branch 'master' into 4640-imp-upstream-doc commit 7bace870102633a2b8323c5f448ed38b65f4b482 Author: Ainar Garipov <[email protected]> Date: Thu Aug 18 19:49:07 2022 +0300 all: imp upstream examples </s> remove 'default': 784 </s> add 'default': 853 </s> remove 'default': 784 </s> add 'default': 853 </s> remove <code>quic://unfiltered.adguard-dns.com:784</code>: <span> <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </span> </s> add <code>quic://unfiltered.adguard-dns.com</code>: <Trans components={[ <a href="https://datatracker.ietf.org/doc/html/rfc9250" target="_blank" rel="noopener noreferrer" key="0" > DNS-over-QUIC </a>, ]} > example_upstream_doq </Trans> </s> remove * `quic://unfiltered.adguard-dns.com:784`: encrypted DNS-over-QUIC (experimental). </s> add * `quic://unfiltered.adguard-dns.com`: encrypted DNS-over-QUIC. </s> add "example_upstream_tcp_port": "regular DNS (over TCP, with port);", </s> remove <code>94.140.14.140</code>: {props.t('example_upstream_regular')} </s> add <code>94.140.14.140</code>, <code>2a10:50c0::1:ff</code>: {props.t('example_upstream_regular')} </li> <li> <code>94.140.14.140:53</code>, <code>[2a10:50c0::1:ff]:53</code>: {props.t('example_upstream_regular_port')}
https://github.com/AdguardTeam/AdGuardHome/commit/1afd73ad0b50037bdb58130c7a21e080de88ea7d
scripts/make/Dockerfile
keep keep keep add keep keep keep keep keep keep
<mask> httpError(w, http.StatusBadRequest, "Failed to parse new upstreams config json: %s", err) <mask> return <mask> } <mask> <mask> config.DNS.UpstreamDNS = defaultDNS <mask> if len(newconfig.Upstreams) > 0 { <mask> config.DNS.UpstreamDNS = newconfig.Upstreams <mask> } <mask> <mask> // bootstrap servers are plain DNS only. </s> [change] control: add upstreams validation </s> remove // bootstrap servers are plain DNS only. We should return http error if there are tls:// https:// or sdns:// hosts in slice </s> add // bootstrap servers are plain DNS only. </s> remove err := checkPlainDNS(host) if err != nil { </s> add if err := checkPlainDNS(host); err != nil { </s> remove return fmt.Errorf("%s is not valid port: %s", port, err) </s> add return fmt.Errorf("%s is not a valid port: %s", port, err) </s> remove return fmt.Errorf("%s is not valid IP", ip) </s> add return fmt.Errorf("%s is not a valid IP", ip) </s> add func validateUpstream(upstream string) error { if strings.HasPrefix(upstream, "tls://") || strings.HasPrefix(upstream, "https://") || strings.HasPrefix(upstream, "sdns://") || strings.HasPrefix(upstream, "tcp://") { return nil } if strings.Contains(upstream, "://") { return fmt.Errorf("wrong protocol") } return checkPlainDNS(upstream) } </s> remove func checkPlainDNS(host string) error { </s> add func checkPlainDNS(upstream string) error {
https://github.com/AdguardTeam/AdGuardHome/commit/1b15bee2b09df5b2c31edf6d6d594aa53ac9124c
control.go
keep keep keep replace keep replace replace keep
<mask> config.DNS.UpstreamDNS = newconfig.Upstreams <mask> } <mask> <mask> // bootstrap servers are plain DNS only. We should return http error if there are tls:// https:// or sdns:// hosts in slice <mask> for _, host := range newconfig.BootstrapDNS { <mask> err := checkPlainDNS(host) <mask> if err != nil { <mask> httpError(w, http.StatusBadRequest, "%s can not be used as bootstrap dns cause: %s", host, err) </s> [change] control: add upstreams validation </s> add for _, u := range newconfig.Upstreams { if err = validateUpstream(u); err != nil { httpError(w, http.StatusBadRequest, "%s can not be used as upstream cause: %s", u, err) return } } </s> remove if net.ParseIP(host) != nil { </s> add if net.ParseIP(upstream) != nil { </s> remove ip, port, err := net.SplitHostPort(host) </s> add ip, port, err := net.SplitHostPort(upstream) </s> remove return fmt.Errorf("%s is not valid IP", ip) </s> add return fmt.Errorf("%s is not a valid IP", ip) </s> remove return fmt.Errorf("%s is not valid port: %s", port, err) </s> add return fmt.Errorf("%s is not a valid port: %s", port, err)
https://github.com/AdguardTeam/AdGuardHome/commit/1b15bee2b09df5b2c31edf6d6d594aa53ac9124c
control.go
keep add keep keep keep keep keep
<mask> } <mask> <mask> // checkPlainDNS checks if host is plain DNS <mask> func checkPlainDNS(upstream string) error { <mask> // Check if host is ip without port <mask> if net.ParseIP(upstream) != nil { <mask> return nil </s> [change] control: add upstreams validation </s> remove func checkPlainDNS(host string) error { </s> add func checkPlainDNS(upstream string) error { </s> remove if net.ParseIP(host) != nil { </s> add if net.ParseIP(upstream) != nil { </s> remove ip, port, err := net.SplitHostPort(host) </s> add ip, port, err := net.SplitHostPort(upstream) </s> remove err := checkPlainDNS(host) if err != nil { </s> add if err := checkPlainDNS(host); err != nil { </s> remove // bootstrap servers are plain DNS only. We should return http error if there are tls:// https:// or sdns:// hosts in slice </s> add // bootstrap servers are plain DNS only. </s> remove return fmt.Errorf("%s is not valid IP", ip) </s> add return fmt.Errorf("%s is not a valid IP", ip)
https://github.com/AdguardTeam/AdGuardHome/commit/1b15bee2b09df5b2c31edf6d6d594aa53ac9124c
control.go
keep keep keep replace keep keep keep keep keep keep keep keep replace keep keep
<mask> } <mask> <mask> // checkPlainDNS checks if host is plain DNS <mask> func checkPlainDNS(host string) error { <mask> // Check if host is ip without port <mask> if net.ParseIP(host) != nil { <mask> return nil <mask> } <mask> <mask> // checkPlainDNS checks if host is plain DNS <mask> func checkPlainDNS(host string) error { <mask> // Check if host is ip without port <mask> if net.ParseIP(host) != nil { <mask> return nil <mask> } </s> [change] control: add upstreams validation </s> add func validateUpstream(upstream string) error { if strings.HasPrefix(upstream, "tls://") || strings.HasPrefix(upstream, "https://") || strings.HasPrefix(upstream, "sdns://") || strings.HasPrefix(upstream, "tcp://") { return nil } if strings.Contains(upstream, "://") { return fmt.Errorf("wrong protocol") } return checkPlainDNS(upstream) } </s> remove ip, port, err := net.SplitHostPort(host) </s> add ip, port, err := net.SplitHostPort(upstream) </s> remove err := checkPlainDNS(host) if err != nil { </s> add if err := checkPlainDNS(host); err != nil { </s> remove // bootstrap servers are plain DNS only. We should return http error if there are tls:// https:// or sdns:// hosts in slice </s> add // bootstrap servers are plain DNS only. </s> remove return fmt.Errorf("%s is not valid IP", ip) </s> add return fmt.Errorf("%s is not a valid IP", ip)
https://github.com/AdguardTeam/AdGuardHome/commit/1b15bee2b09df5b2c31edf6d6d594aa53ac9124c
control.go
keep keep keep keep replace keep keep keep keep keep
<mask> return nil <mask> } <mask> <mask> // Check if host is ip with port <mask> ip, port, err := net.SplitHostPort(host) <mask> if err != nil { <mask> return err <mask> } <mask> <mask> if net.ParseIP(ip) == nil { </s> [change] control: add upstreams validation </s> remove if net.ParseIP(host) != nil { </s> add if net.ParseIP(upstream) != nil { </s> remove return fmt.Errorf("%s is not valid IP", ip) </s> add return fmt.Errorf("%s is not a valid IP", ip) </s> add func validateUpstream(upstream string) error { if strings.HasPrefix(upstream, "tls://") || strings.HasPrefix(upstream, "https://") || strings.HasPrefix(upstream, "sdns://") || strings.HasPrefix(upstream, "tcp://") { return nil } if strings.Contains(upstream, "://") { return fmt.Errorf("wrong protocol") } return checkPlainDNS(upstream) } </s> remove func checkPlainDNS(host string) error { </s> add func checkPlainDNS(upstream string) error { </s> remove err := checkPlainDNS(host) if err != nil { </s> add if err := checkPlainDNS(host); err != nil { </s> remove return fmt.Errorf("%s is not valid port: %s", port, err) </s> add return fmt.Errorf("%s is not a valid port: %s", port, err)
https://github.com/AdguardTeam/AdGuardHome/commit/1b15bee2b09df5b2c31edf6d6d594aa53ac9124c
control.go
keep keep keep keep replace keep keep keep keep replace keep keep keep keep
<mask> return err <mask> } <mask> <mask> if net.ParseIP(ip) == nil { <mask> return fmt.Errorf("%s is not valid IP", ip) <mask> } <mask> <mask> _, err = strconv.ParseInt(port, 0, 64) <mask> if err != nil { <mask> return fmt.Errorf("%s is not valid port: %s", port, err) <mask> } <mask> <mask> return nil <mask> } </s> [change] control: add upstreams validation </s> remove ip, port, err := net.SplitHostPort(host) </s> add ip, port, err := net.SplitHostPort(upstream) </s> remove err := checkPlainDNS(host) if err != nil { </s> add if err := checkPlainDNS(host); err != nil { </s> add for _, u := range newconfig.Upstreams { if err = validateUpstream(u); err != nil { httpError(w, http.StatusBadRequest, "%s can not be used as upstream cause: %s", u, err) return } } </s> add func validateUpstream(upstream string) error { if strings.HasPrefix(upstream, "tls://") || strings.HasPrefix(upstream, "https://") || strings.HasPrefix(upstream, "sdns://") || strings.HasPrefix(upstream, "tcp://") { return nil } if strings.Contains(upstream, "://") { return fmt.Errorf("wrong protocol") } return checkPlainDNS(upstream) } </s> remove if net.ParseIP(host) != nil { </s> add if net.ParseIP(upstream) != nil {
https://github.com/AdguardTeam/AdGuardHome/commit/1b15bee2b09df5b2c31edf6d6d594aa53ac9124c
control.go
keep keep keep keep replace keep keep keep keep keep
<mask> const defaultParentalURL = "%s://%s/check-parental-control-hash?prefixes=%s&sensitivity=%d" <mask> const defaultParentalSensitivity = 13 // use "TEEN" by default <mask> const maxDialCacheSize = 2 // the number of host names for safebrowsing and parental control <mask> <mask> // Custom filtering settings <mask> type RequestFilteringSettings struct { <mask> FilteringEnabled bool <mask> SafeSearchEnabled bool <mask> SafeBrowsingEnabled bool <mask> ParentalEnabled bool </s> + dnsforward: use Rewrites table </s> add // RewriteEntry is a rewrite array element type RewriteEntry struct { Domain string `yaml:"domain"` Answer string `yaml:"answer"` // IP address or canonical name } </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses </s> add Rewrites []RewriteEntry `yaml:"rewrites"` </s> add // ReasonRewrite - rewrite rule was applied ReasonRewrite </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) }
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep
<mask> } <mask> <mask> // Config allows you to configure DNS filtering with New() or just change variables directly. <mask> type Config struct { <mask> ParentalSensitivity int `yaml:"parental_sensitivity"` // must be either 3, 10, 13 or 17 <mask> ParentalEnabled bool `yaml:"parental_enabled"` <mask> UsePlainHTTP bool `yaml:"-"` // use plain HTTP for requests to parental and safe browsing servers </s> + dnsforward: use Rewrites table </s> remove // Custom filtering settings </s> add // RequestFilteringSettings is custom filtering settings </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses </s> add Rewrites []RewriteEntry `yaml:"rewrites"` </s> add // ReasonRewrite - rewrite rule was applied ReasonRewrite </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsfilter/dnsfilter.go
keep keep keep add keep keep keep keep keep keep
<mask> SafeBrowsingCacheSize int `yaml:"safebrowsing_cache_size"` <mask> SafeSearchCacheSize int `yaml:"safesearch_cache_size"` <mask> ParentalCacheSize int `yaml:"parental_cache_size"` <mask> <mask> // Filtering callback function <mask> FilterHandler func(clientAddr string, settings *RequestFilteringSettings) `yaml:"-"` <mask> } <mask> <mask> type privateConfig struct { <mask> parentalServer string // access via methods </s> + dnsforward: use Rewrites table </s> add // RewriteEntry is a rewrite array element type RewriteEntry struct { Domain string `yaml:"domain"` Answer string `yaml:"answer"` // IP address or canonical name } </s> remove // Custom filtering settings </s> add // RequestFilteringSettings is custom filtering settings </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses </s> add // ReasonRewrite - rewrite rule was applied ReasonRewrite </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> add if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { d.Req.Question[0] = originalQuestion d.Res.Question[0] = originalQuestion if len(d.Res.Answer) != 0 { answer = append(answer, d.Res.Answer...) // host -> IP d.Res.Answer = answer } }
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsfilter/dnsfilter.go
keep add keep keep keep keep
<mask> // FilteredSafeSearch - the host was replaced with safesearch variant <mask> FilteredSafeSearch <mask> ) <mask> <mask> func (i Reason) String() string { <mask> names := []string{ </s> + dnsforward: use Rewrites table </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses </s> add // RewriteEntry is a rewrite array element type RewriteEntry struct { Domain string `yaml:"domain"` Answer string `yaml:"answer"` // IP address or canonical name } </s> remove // Custom filtering settings </s> add // RequestFilteringSettings is custom filtering settings </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> add Rewrites []RewriteEntry `yaml:"rewrites"`
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsfilter/dnsfilter.go
keep keep keep add keep keep keep keep keep keep
<mask> "FilteredSafeBrowsing", <mask> "FilteredParental", <mask> "FilteredInvalid", <mask> "FilteredSafeSearch", <mask> } <mask> if uint(i) >= uint(len(names)) { <mask> return "" <mask> } <mask> return names[i] <mask> } </s> + dnsforward: use Rewrites table </s> remove var res dnsfilter.Result </s> add if host != origHost { log.Debug("Rewrite: not supported: CNAME for %s is %s", origHost, host) } </s> add if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { d.Req.Question[0] = originalQuestion d.Res.Question[0] = originalQuestion if len(d.Res.Answer) != 0 { answer = append(answer, d.Res.Answer...) // host -> IP d.Res.Answer = answer } } </s> add result = d.processRewrites(host, qtype) if result.Reason == ReasonRewrite { return result, nil } </s> add // Make a CNAME response func (s *Server) genCNAMEAnswer(req *dns.Msg, cname string) *dns.CNAME { answer := new(dns.CNAME) answer.Hdr = dns.RR_Header{ Name: req.Question[0].Name, Rrtype: dns.TypeCNAME, Ttl: s.conf.BlockedResponseTTL, Class: dns.ClassINET, } answer.Target = dns.Fqdn(cname) return answer } </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep
<mask> IP net.IP `json:",omitempty"` // Not nil only in the case of a hosts file syntax <mask> FilterID int64 `json:",omitempty"` // Filter ID the rule belongs to <mask> } <mask> <mask> // Matched can be used to see if any match at all was found, no matter filtered or not <mask> func (r Reason) Matched() bool { <mask> return r != NotFilteredNotFound </s> + dnsforward: use Rewrites table </s> add // RewriteEntry is a rewrite array element type RewriteEntry struct { Domain string `yaml:"domain"` Answer string `yaml:"answer"` // IP address or canonical name } </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> add // ReasonRewrite - rewrite rule was applied ReasonRewrite </s> remove // Custom filtering settings </s> add // RequestFilteringSettings is custom filtering settings </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host </s> add if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { d.Req.Question[0] = originalQuestion d.Res.Question[0] = originalQuestion if len(d.Res.Answer) != 0 { answer = append(answer, d.Res.Answer...) // host -> IP d.Res.Answer = answer } }
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsfilter/dnsfilter.go
keep keep add keep keep keep keep
<mask> <mask> var result Result <mask> var err error <mask> // try filter lists first <mask> if setts.FilteringEnabled { <mask> result, err = d.matchHost(host, qtype) <mask> if err != nil { </s> + dnsforward: use Rewrites table </s> remove var res dnsfilter.Result </s> add if host != origHost { log.Debug("Rewrite: not supported: CNAME for %s is %s", origHost, host) } </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> add if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { d.Req.Question[0] = originalQuestion d.Res.Question[0] = originalQuestion if len(d.Res.Answer) != 0 { answer = append(answer, d.Res.Answer...) // host -> IP d.Res.Answer = answer } } </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses </s> add "Rewrite",
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep
<mask> <mask> if d.Res == nil { <mask> // request was not filtered so let it be processed further <mask> err = p.Resolve(d) <mask> if err != nil { <mask> return err <mask> } </s> + dnsforward: use Rewrites table </s> add result = d.processRewrites(host, qtype) if result.Reason == ReasonRewrite { return result, nil } </s> remove var res dnsfilter.Result </s> add if host != origHost { log.Debug("Rewrite: not supported: CNAME for %s is %s", origHost, host) } </s> add if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { d.Req.Question[0] = originalQuestion d.Res.Question[0] = originalQuestion if len(d.Res.Answer) != 0 { answer = append(answer, d.Res.Answer...) // host -> IP d.Res.Answer = answer } } </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host </s> add "Rewrite",
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsforward/dnsforward.go
keep add keep keep keep keep keep
<mask> return err <mask> } <mask> } <mask> <mask> shouldLog := true <mask> msg := d.Req <mask> </s> + dnsforward: use Rewrites table </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host </s> add // Make a CNAME response func (s *Server) genCNAMEAnswer(req *dns.Msg, cname string) *dns.CNAME { answer := new(dns.CNAME) answer.Hdr = dns.RR_Header{ Name: req.Question[0].Name, Rrtype: dns.TypeCNAME, Ttl: s.conf.BlockedResponseTTL, Class: dns.ClassINET, } answer.Target = dns.Fqdn(cname) return answer } </s> add result = d.processRewrites(host, qtype) if result.Reason == ReasonRewrite { return result, nil } </s> add "Rewrite", </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> remove var res dnsfilter.Result </s> add if host != origHost { log.Debug("Rewrite: not supported: CNAME for %s is %s", origHost, host) }
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsforward/dnsforward.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> } <mask> <mask> // filterDNSRequest applies the dnsFilter and sets d.Res if the request was filtered <mask> func (s *Server) filterDNSRequest(d *proxy.DNSContext) (*dnsfilter.Result, error) { <mask> msg := d.Req <mask> host := strings.TrimSuffix(msg.Question[0].Name, ".") <mask> <mask> s.RLock() <mask> protectionEnabled := s.conf.ProtectionEnabled <mask> dnsFilter := s.dnsFilter <mask> s.RUnlock() </s> + dnsforward: use Rewrites table </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> add // Make a CNAME response func (s *Server) genCNAMEAnswer(req *dns.Msg, cname string) *dns.CNAME { answer := new(dns.CNAME) answer.Hdr = dns.RR_Header{ Name: req.Question[0].Name, Rrtype: dns.TypeCNAME, Ttl: s.conf.BlockedResponseTTL, Class: dns.ClassINET, } answer.Target = dns.Fqdn(cname) return answer } </s> add if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { d.Req.Question[0] = originalQuestion d.Res.Question[0] = originalQuestion if len(d.Res.Answer) != 0 { answer = append(answer, d.Res.Answer...) // host -> IP d.Res.Answer = answer } } </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses </s> add // ReasonRewrite - rewrite rule was applied ReasonRewrite </s> remove // Custom filtering settings </s> add // RequestFilteringSettings is custom filtering settings
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> if !protectionEnabled { <mask> return nil, nil <mask> } <mask> <mask> var res dnsfilter.Result <mask> var err error <mask> <mask> clientAddr := "" <mask> if d.Addr != nil { <mask> clientAddr, _, _ = net.SplitHostPort(d.Addr.String()) </s> + dnsforward: use Rewrites table </s> add result = d.processRewrites(host, qtype) if result.Reason == ReasonRewrite { return result, nil } </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) } </s> add "Rewrite", </s> add if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { d.Req.Question[0] = originalQuestion d.Res.Question[0] = originalQuestion if len(d.Res.Answer) != 0 { answer = append(answer, d.Res.Answer...) // host -> IP d.Res.Answer = answer } } </s> add // for ReasonRewrite: CanonName string `json:",omitempty"` // CNAME value IPList []net.IP `json:",omitempty"` // list of IP addresses
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsforward/dnsforward.go
keep keep keep add keep keep keep keep
<mask> <mask> return &resp <mask> } <mask> <mask> func (s *Server) genNXDomain(request *dns.Msg) *dns.Msg { <mask> resp := dns.Msg{} <mask> resp.SetRcode(request, dns.RcodeNameError) <mask> resp.RecursionAvailable = true </s> + dnsforward: use Rewrites table </s> remove msg := d.Req host := strings.TrimSuffix(msg.Question[0].Name, ".") </s> add var res dnsfilter.Result req := d.Req host := strings.TrimSuffix(req.Question[0].Name, ".") origHost := host </s> add if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { d.Req.Question[0] = originalQuestion d.Res.Question[0] = originalQuestion if len(d.Res.Answer) != 0 { answer = append(answer, d.Res.Answer...) // host -> IP d.Res.Answer = answer } } </s> add "Rewrite", </s> remove var res dnsfilter.Result </s> add if host != origHost { log.Debug("Rewrite: not supported: CNAME for %s is %s", origHost, host) } </s> add result = d.processRewrites(host, qtype) if result.Reason == ReasonRewrite { return result, nil } </s> add answer := []dns.RR{} originalQuestion := d.Req.Question[0] if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 { answer = append(answer, s.genCNAMEAnswer(d.Req, res.CanonName)) // resolve canonical name, not the original host name d.Req.Question[0].Name = dns.Fqdn(res.CanonName) }
https://github.com/AdguardTeam/AdGuardHome/commit/1bb6638db796bd733a4b3a0066e7d045579119ec
dnsforward/dnsforward.go
keep keep add keep keep keep keep
<mask> } <mask> } <mask> <mask> func TestParseService(t *testing.T) { <mask> if testParseOk(t).serviceControlAction != "" { <mask> t.Fatal("empty is no service command") <mask> } </s> * (home): added tests for no-mem-optimization flag </s> add func TestSerializeDisableMemoryOptimization(t *testing.T) { testSerialize(t, options{disableMemoryOptimization: true}, "--no-mem-optimization") } </s> remove serviceControlAction: "run", configFilename: "config", workDir: "work", pidFile: "pid", disableUpdate: true, }, "-c", "config", "-w", "work", "-s", "run", "--pidfile", "pid", "--no-check-update") </s> add serviceControlAction: "run", configFilename: "config", workDir: "work", pidFile: "pid", disableUpdate: true, disableMemoryOptimization: true, }, "-c", "config", "-w", "work", "-s", "run", "--pidfile", "pid", "--no-check-update", "--no-mem-optimization")
https://github.com/AdguardTeam/AdGuardHome/commit/1c88667306e7a52d36a6a1cbf3eca86fd612bd7f
home/options_test.go
keep keep keep add keep keep keep keep keep keep
<mask> func TestSerializeGLInet(t *testing.T) { <mask> testSerialize(t, options{glinetMode: true}, "--glinet") <mask> } <mask> <mask> func TestSerializeMultiple(t *testing.T) { <mask> testSerialize(t, options{ <mask> serviceControlAction: "run", <mask> configFilename: "config", <mask> workDir: "work", <mask> pidFile: "pid", </s> * (home): added tests for no-mem-optimization flag </s> remove serviceControlAction: "run", configFilename: "config", workDir: "work", pidFile: "pid", disableUpdate: true, }, "-c", "config", "-w", "work", "-s", "run", "--pidfile", "pid", "--no-check-update") </s> add serviceControlAction: "run", configFilename: "config", workDir: "work", pidFile: "pid", disableUpdate: true, disableMemoryOptimization: true, }, "-c", "config", "-w", "work", "-s", "run", "--pidfile", "pid", "--no-check-update", "--no-mem-optimization") </s> add func TestParseDisableMemoryOptimization(t *testing.T) { if testParseOk(t).disableMemoryOptimization { t.Fatal("empty is not disable update") } if !testParseOk(t, "--no-mem-optimization").disableMemoryOptimization { t.Fatal("--no-mem-optimization is disable update") } }
https://github.com/AdguardTeam/AdGuardHome/commit/1c88667306e7a52d36a6a1cbf3eca86fd612bd7f
home/options_test.go
keep keep keep keep replace replace replace replace replace replace keep
<mask> } <mask> <mask> func TestSerializeMultiple(t *testing.T) { <mask> testSerialize(t, options{ <mask> serviceControlAction: "run", <mask> configFilename: "config", <mask> workDir: "work", <mask> pidFile: "pid", <mask> disableUpdate: true, <mask> }, "-c", "config", "-w", "work", "-s", "run", "--pidfile", "pid", "--no-check-update") <mask> } </s> * (home): added tests for no-mem-optimization flag </s> add func TestSerializeDisableMemoryOptimization(t *testing.T) { testSerialize(t, options{disableMemoryOptimization: true}, "--no-mem-optimization") } </s> add func TestParseDisableMemoryOptimization(t *testing.T) { if testParseOk(t).disableMemoryOptimization { t.Fatal("empty is not disable update") } if !testParseOk(t, "--no-mem-optimization").disableMemoryOptimization { t.Fatal("--no-mem-optimization is disable update") } }
https://github.com/AdguardTeam/AdGuardHome/commit/1c88667306e7a52d36a6a1cbf3eca86fd612bd7f
home/options_test.go
keep keep keep add keep keep keep keep keep keep
<mask> sync.RWMutex <mask> ServerConfig <mask> } <mask> <mask> // uncomment this block to have tracing of locks <mask> /* <mask> func (s *Server) Lock() { <mask> pc := make([]uintptr, 10) // at least 1 entry needed <mask> runtime.Callers(2, pc) <mask> f := runtime.FuncForPC(pc[0]) </s> Resolve into a stub page when blocked by parental or safebrowsing. Closes #475. </s> remove upstream := s.chooseUpstream() </s> add </s> add // we need upstream to resolve A records upstream := s.chooseUpstream() </s> add switch res.Reason { case dnsfilter.FilteredSafeBrowsing: return s.genArecord(msg, safeBrowsingBlockHost, upstream), &res, nil, nil case dnsfilter.FilteredParental: return s.genArecord(msg, parentalBlockHost, upstream), &res, nil, nil }
https://github.com/AdguardTeam/AdGuardHome/commit/1c89e1df32d5fcb9d69156c9bfcc1680f733d1dd
dnsforward/dnsforward.go
keep keep add keep keep keep keep
<mask> return s.genNotImpl(msg), nil, nil, nil <mask> } <mask> <mask> host := strings.TrimSuffix(msg.Question[0].Name, ".") <mask> // use dnsfilter before cache -- changed settings or filters would require cache invalidation otherwise <mask> var res dnsfilter.Result <mask> var err error </s> Resolve into a stub page when blocked by parental or safebrowsing. Closes #475. </s> remove upstream := s.chooseUpstream() </s> add </s> add switch res.Reason { case dnsfilter.FilteredSafeBrowsing: return s.genArecord(msg, safeBrowsingBlockHost, upstream), &res, nil, nil case dnsfilter.FilteredParental: return s.genArecord(msg, parentalBlockHost, upstream), &res, nil, nil } </s> add const ( safeBrowsingBlockHost = "standard-block.dns.adguard.com" parentalBlockHost = "family-block.dns.adguard.com" )
https://github.com/AdguardTeam/AdGuardHome/commit/1c89e1df32d5fcb9d69156c9bfcc1680f733d1dd
dnsforward/dnsforward.go
keep keep keep add keep keep keep keep keep
<mask> log.Printf("dnsfilter failed to check host '%s': %s", host, err) <mask> return s.genServerFailure(msg), &res, nil, err <mask> } else if res.IsFiltered { <mask> log.Printf("Host %s is filtered, reason - '%s', matched rule: '%s'", host, res.Reason, res.Rule) <mask> return s.genNXDomain(msg), &res, nil, nil <mask> } <mask> } <mask> <mask> { </s> Resolve into a stub page when blocked by parental or safebrowsing. Closes #475. </s> remove upstream := s.chooseUpstream() </s> add </s> add // we need upstream to resolve A records upstream := s.chooseUpstream() </s> add const ( safeBrowsingBlockHost = "standard-block.dns.adguard.com" parentalBlockHost = "family-block.dns.adguard.com" )
https://github.com/AdguardTeam/AdGuardHome/commit/1c89e1df32d5fcb9d69156c9bfcc1680f733d1dd
dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> // TODO: replace with single-socket implementation <mask> upstream := s.chooseUpstream() <mask> reply, err := upstream.Exchange(msg) <mask> if err != nil { <mask> log.Printf("talking to upstream failed for host '%s': %s", host, err) <mask> return s.genServerFailure(msg), &res, upstream, err <mask> } </s> Resolve into a stub page when blocked by parental or safebrowsing. Closes #475. </s> add // we need upstream to resolve A records upstream := s.chooseUpstream() </s> add switch res.Reason { case dnsfilter.FilteredSafeBrowsing: return s.genArecord(msg, safeBrowsingBlockHost, upstream), &res, nil, nil case dnsfilter.FilteredParental: return s.genArecord(msg, parentalBlockHost, upstream), &res, nil, nil } </s> add const ( safeBrowsingBlockHost = "standard-block.dns.adguard.com" parentalBlockHost = "family-block.dns.adguard.com" )
https://github.com/AdguardTeam/AdGuardHome/commit/1c89e1df32d5fcb9d69156c9bfcc1680f733d1dd
dnsforward/dnsforward.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> // these variables need to survive coredns reload <mask> var ( <mask> stats Stats <mask> safebrowsingCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() <mask> parentalCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() <mask> ) <mask> <mask> // Result holds state of hostname check <mask> type Result struct { <mask> IsFiltered bool </s> dnsfilter -- lazily initialize safebrowsing and parental lookup cache </s> add if parentalCache == nil { parentalCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() } </s> add if safebrowsingCache == nil { safebrowsingCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() } </s> remove d.transport.CloseIdleConnections() </s> add if d != nil && d.transport != nil { d.transport.CloseIdleConnections() }
https://github.com/AdguardTeam/AdGuardHome/commit/1cc1e3749df6ccefb741232d7949fd5893d84f66
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep keep
<mask> return result, nil <mask> } <mask> result, err := d.lookupCommon(host, &stats.Safebrowsing, safebrowsingCache, true, format, handleBody) <mask> return result, err <mask> } <mask> <mask> func (d *Dnsfilter) checkParental(host string) (Result, error) { <mask> // prevent recursion -- checking the host of parental safety server makes no sense </s> dnsfilter -- lazily initialize safebrowsing and parental lookup cache </s> add if parentalCache == nil { parentalCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() } </s> remove d.transport.CloseIdleConnections() </s> add if d != nil && d.transport != nil { d.transport.CloseIdleConnections() } </s> remove safebrowsingCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() parentalCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> add safebrowsingCache gcache.Cache parentalCache gcache.Cache
https://github.com/AdguardTeam/AdGuardHome/commit/1cc1e3749df6ccefb741232d7949fd5893d84f66
dnsfilter/dnsfilter.go
keep add keep keep keep keep keep
<mask> return result, nil <mask> } <mask> result, err := d.lookupCommon(host, &stats.Parental, parentalCache, false, format, handleBody) <mask> return result, err <mask> } <mask> <mask> // real implementation of lookup/check </s> dnsfilter -- lazily initialize safebrowsing and parental lookup cache </s> add if safebrowsingCache == nil { safebrowsingCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() } </s> remove d.transport.CloseIdleConnections() </s> add if d != nil && d.transport != nil { d.transport.CloseIdleConnections() } </s> remove safebrowsingCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() parentalCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> add safebrowsingCache gcache.Cache parentalCache gcache.Cache
https://github.com/AdguardTeam/AdGuardHome/commit/1cc1e3749df6ccefb741232d7949fd5893d84f66
dnsfilter/dnsfilter.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // Destroy is optional if you want to tidy up goroutines without waiting for them to die off <mask> // right now it closes idle HTTP connections if there are any <mask> func (d *Dnsfilter) Destroy() { <mask> d.transport.CloseIdleConnections() <mask> } <mask> <mask> // <mask> // config manipulation helpers <mask> // </s> dnsfilter -- lazily initialize safebrowsing and parental lookup cache </s> add if parentalCache == nil { parentalCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() } </s> add if safebrowsingCache == nil { safebrowsingCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() } </s> remove safebrowsingCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() parentalCache = gcache.New(defaultCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> add safebrowsingCache gcache.Cache parentalCache gcache.Cache
https://github.com/AdguardTeam/AdGuardHome/commit/1cc1e3749df6ccefb741232d7949fd5893d84f66
dnsfilter/dnsfilter.go