docstring_tokens
stringlengths 0
76.5k
| code_tokens
stringlengths 75
1.81M
| label_window
sequencelengths 4
2.12k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|
<mask> "use_adguard_browsing_sec_hint": "AdGuard Home controleert of het domein in de blokkeerlijst voorkomt dmv Browsing Security web service. Dit gebeurt dmv een privacy vriendelijk API verzoek:een korte prefix van de domein naam met SHA256 hash wordt verzonden naar de server.",
<mask> "use_adguard_parental": "Gebruik AdGuard Ouderlijk toezicht web service",
<mask> "use_adguard_parental_hint": "AdGuard Home controleert of het domein 18+ content bevat. Dit gebeurt dmv dezelfde privacy vriendelijke API als de Browsing Security web service.",
<mask> "enforce_safe_search": "Forceer Veilig Zoeken",
<mask> "enforce_save_search_hint": "AdGuard Home kan veilig zoeken forceren voor de volgende zoekmachines: Google, Youtube, Bing, en Yandex.",
<mask> "no_servers_specified": "Geen servers gespecificeerd",
<mask> "general_settings": "Generieke instellingen",
<mask> "dns_settings": "DNS Instellingen",
<mask> "encryption_settings": "Encryptie Instellingen",
<mask> "dhcp_settings": "DHCP Instellingen",
</s> - client: allow add ip-v6 to exceptions </s> remove "enforce_save_search_hint": "AdGuard Home dapat memaksa penelusuran aman pada mesin pencari berikut: Google, Youtube, Bing, dan Yandex.",
</s> add </s> remove "example_regex_meaning": "blokkeer de toegang tot de domeinen die overeenkomen met de opgegeven reguliere expressie",
</s> add </s> remove "example_regex_meaning": "blokir akses ke domain yang cocok dengan ekspresi reguler yang ditentukan",
</s> add </s> remove "form_error_ip_format": "Ongeldig IPv4 formaat",
</s> add </s> remove "form_error_ip_format": "Invalid IPv4 format",
</s> add "form_error_ip4_format": "Invalid IPv4 format",
"form_error_ip6_format": "Invalid IPv6 format",
"form_error_ip_format": "Invalid IP format", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/49e800727b2e866fa1f9d429bd1c0c17ce8466b3 | client/src/__locales/nl.json |
|
<mask> "example_meaning_host_block": "AdGuard Home zal nu het adres 127.0.0.1 voor het domein example.org retourneren (maar niet de subdomeinen).",
<mask> "example_comment": "! Hier komt een opmerking",
<mask> "example_comment_meaning": "zomaar een opmerking",
<mask> "example_comment_hash": "# Nog een opmerking",
<mask> "example_regex_meaning": "blokkeer de toegang tot de domeinen die overeenkomen met de opgegeven reguliere expressie",
<mask> "example_upstream_regular": "standaard DNS (over UDP)",
<mask> "example_upstream_dot": "versleutelde<a href='https://en.wikipedia.org/wiki/DNS_over_TLS' target='_blank'>DNS-over-TLS</a>",
<mask> "example_upstream_doh": "versleutelde<a href='https://en.wikipedia.org/wiki/DNS_over_HTTPS' target='_blank'>DNS-over-HTTPS</a>",
<mask> "example_upstream_sdns": "je kunt <a href='https://dnscrypt.info/stamps/' target='_blank'>DNS Stamps</a> voor <a href='https://dnscrypt.info/' target='_blank'>DNSCrypt</a> of <a href='https://en.wikipedia.org/wiki/DNS_over_HTTPS' target='_blank'>DNS-over-HTTPS</a> resolvers",
<mask> "example_upstream_tcp": "standaard DNS (over TCP)",
</s> - client: allow add ip-v6 to exceptions </s> remove "example_regex_meaning": "blokir akses ke domain yang cocok dengan ekspresi reguler yang ditentukan",
</s> add </s> remove "enforce_save_search_hint": "AdGuard Home kan veilig zoeken forceren voor de volgende zoekmachines: Google, Youtube, Bing, en Yandex.",
</s> add </s> remove "enforce_save_search_hint": "AdGuard Home dapat memaksa penelusuran aman pada mesin pencari berikut: Google, Youtube, Bing, dan Yandex.",
</s> add </s> remove "form_error_ip_format": "Invalid IPv4 format",
</s> add "form_error_ip4_format": "Invalid IPv4 format",
"form_error_ip6_format": "Invalid IPv6 format",
"form_error_ip_format": "Invalid IP format", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/49e800727b2e866fa1f9d429bd1c0c17ce8466b3 | client/src/__locales/nl.json |
|
import { renderField, renderRadioField, renderSelectField, renderServiceField, ip, mac, required } from '../../../helpers/form'; | <mask> import flow from 'lodash/flow';
<mask>
<mask> import Tabs from '../../ui/Tabs';
<mask> import { toggleAllServices } from '../../../helpers/helpers';
<mask> import { renderField, renderRadioField, renderSelectField, renderServiceField, ipv4, mac, required } from '../../../helpers/form';
<mask> import { CLIENT_ID, SERVICES } from '../../../helpers/constants';
<mask> import './Service.css';
<mask>
<mask> const settingsCheckboxes = [
<mask> {
</s> - client: allow add ip-v6 to exceptions </s> remove validate={[ipv4, required]}
</s> add validate={[ip, required]} </s> remove "example_regex_meaning": "blokkeer de toegang tot de domeinen die overeenkomen met de opgegeven reguliere expressie",
</s> add </s> remove "enforce_save_search_hint": "AdGuard Home kan veilig zoeken forceren voor de volgende zoekmachines: Google, Youtube, Bing, en Yandex.",
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/49e800727b2e866fa1f9d429bd1c0c17ce8466b3 | client/src/components/Settings/Clients/Form.js |
validate={[ip, required]} | <mask> component={renderField}
<mask> type="text"
<mask> className="form-control"
<mask> placeholder={t('form_enter_ip')}
<mask> validate={[ipv4, required]}
<mask> />
<mask> </div>
<mask> )}
<mask> {clientIdentifier === CLIENT_ID.MAC && (
<mask> <div className="form__group">
</s> - client: allow add ip-v6 to exceptions </s> remove import { renderField, renderRadioField, renderSelectField, renderServiceField, ipv4, mac, required } from '../../../helpers/form';
</s> add import { renderField, renderRadioField, renderSelectField, renderServiceField, ip, mac, required } from '../../../helpers/form'; </s> remove "example_regex_meaning": "blokkeer de toegang tot de domeinen die overeenkomen met de opgegeven reguliere expressie",
</s> add </s> remove "enforce_save_search_hint": "AdGuard Home kan veilig zoeken forceren voor de volgende zoekmachines: Google, Youtube, Bing, en Yandex.",
</s> add </s> remove "form_error_ip_format": "Ongeldig IPv4 formaat",
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/49e800727b2e866fa1f9d429bd1c0c17ce8466b3 | client/src/components/Settings/Clients/Form.js |
return <Trans>form_error_ip4_format</Trans>;
}
return false;
};
export const ipv6 = (value) => {
if (value && !new RegExp(R_IPV6).test(value)) {
return <Trans>form_error_ip6_format</Trans>;
}
return false;
};
export const ip = (value) => {
if (value && !new RegExp(R_IPV4).test(value) && !new RegExp(R_IPV6).test(value)) { | <mask> export const ipv4 = (value) => {
<mask> if (value && !new RegExp(R_IPV4).test(value)) {
<mask> return <Trans>form_error_ip_format</Trans>;
<mask> }
<mask> return false;
<mask> };
</s> - client: allow add ip-v6 to exceptions </s> remove import { renderField, renderRadioField, renderSelectField, renderServiceField, ipv4, mac, required } from '../../../helpers/form';
</s> add import { renderField, renderRadioField, renderSelectField, renderServiceField, ip, mac, required } from '../../../helpers/form'; </s> remove validate={[ipv4, required]}
</s> add validate={[ip, required]} </s> remove "example_regex_meaning": "blokkeer de toegang tot de domeinen die overeenkomen met de opgegeven reguliere expressie",
</s> add </s> remove "enforce_save_search_hint": "AdGuard Home kan veilig zoeken forceren voor de volgende zoekmachines: Google, Youtube, Bing, en Yandex.",
</s> add </s> remove "form_error_ip_format": "Ongeldig IPv4 formaat",
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/49e800727b2e866fa1f9d429bd1c0c17ce8466b3 | client/src/helpers/form.js |
"github.com/AdguardTeam/urlfilter/rules" | <mask> "github.com/AdguardTeam/golibs/stringutil"
<mask> "github.com/AdguardTeam/urlfilter"
<mask> "github.com/AdguardTeam/urlfilter/filterlist"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
<mask> // DefaultHostsPaths returns the slice of paths default for the operating system
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // is intended to use within fs.FS so the initial slash is omitted.
</s> add // is intended to be used within fs.FS so the initial slash is omitted. </s> remove // Updates is the channel for receiving updated hosts. The receivable map's
// values has a type of slice of strings.
</s> add // updates is the channel for receiving updated hosts. </s> remove // Upd returns the channel into which the updates are sent.
</s> add // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *stringutil.Set. | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
// is intended to be used within fs.FS so the initial slash is omitted. | <mask> )
<mask>
<mask> // DefaultHostsPaths returns the slice of paths default for the operating system
<mask> // to files and directories which are containing the hosts database. The result
<mask> // is intended to use within fs.FS so the initial slash is omitted.
<mask> func DefaultHostsPaths() (paths []string) {
<mask> return defaultHostsPaths()
<mask> }
<mask>
<mask> // hostsContainerPref is a prefix for logging and wrapping errors in
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // Updates is the channel for receiving updated hosts. The receivable map's
// values has a type of slice of strings.
</s> add // updates is the channel for receiving updated hosts. </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. </s> remove // Upd returns the channel into which the updates are sent.
</s> add // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *stringutil.Set. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
// updates is the channel for receiving updated hosts. | <mask> rulesStrg *filterlist.RuleStorage
<mask> // engine serves rulesStrg.
<mask> engine *urlfilter.DNSEngine
<mask>
<mask> // Updates is the channel for receiving updated hosts. The receivable map's
<mask> // values has a type of slice of strings.
<mask> updates chan *netutil.IPMap
<mask>
<mask> // fsys is the working file system to read hosts files from.
<mask> fsys fs.FS
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // Upd returns the channel into which the updates are sent.
</s> add // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *stringutil.Set. </s> remove // is intended to use within fs.FS so the initial slash is omitted.
</s> add // is intended to be used within fs.FS so the initial slash is omitted. </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
// last is the set of hosts that was cached within last detected change.
last *netutil.IPMap | <mask> // updates is the channel for receiving updated hosts.
<mask> updates chan *netutil.IPMap
<mask>
<mask> // fsys is the working file system to read hosts files from.
<mask> fsys fs.FS
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // Updates is the channel for receiving updated hosts. The receivable map's
// values has a type of slice of strings.
</s> add // updates is the channel for receiving updated hosts. </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. </s> remove // is intended to use within fs.FS so the initial slash is omitted.
</s> add // is intended to be used within fs.FS so the initial slash is omitted. </s> remove // Upd returns the channel into which the updates are sent.
</s> add // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *stringutil.Set. </s> remove log.Debug("%s: closing hosts container", hostsContainerPref)
</s> add log.Debug("%s: closing", hostsContainerPref) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
last: &netutil.IPMap{}, | <mask> engLock: &sync.RWMutex{},
<mask> updates: make(chan *netutil.IPMap, 1),
<mask> fsys: fsys,
<mask> w: w,
<mask> patterns: patterns,
<mask> }
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove eventsCh := make(chan struct{}, 1)
</s> add // event is a convenient alias for an empty struct{} to emit test events.
type event = struct{}
eventsCh := make(chan event, 1) </s> remove checkRefresh := func(t *testing.T, wantHosts []string) {
</s> add checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { </s> remove OnEvents: func() (e <-chan struct{}) { return eventsCh },
</s> add OnEvents: func() (e <-chan event) { return eventsCh }, </s> remove case res.Reason == filtering.RewrittenRule:
</s> add case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
res, ok = hc.engine.MatchRequest(req)
return res, ok | <mask>
<mask> hc.engLock.RLock()
<mask> defer hc.engLock.RUnlock()
<mask>
<mask> return hc.engine.MatchRequest(req)
<mask> }
<mask>
<mask> // Close implements the io.Closer interface for *HostsContainer.
<mask> func (hc *HostsContainer) Close() (err error) {
<mask> log.Debug("%s: closing hosts container", hostsContainerPref)
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove log.Debug("%s: closing hosts container", hostsContainerPref)
</s> add log.Debug("%s: closing", hostsContainerPref) </s> remove // refresh gets the data from specified files and propagates the updates.
</s> add // refresh gets the data from specified files and propagates the updates if
// needed. </s> remove hp := hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(0),
</s> add hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
log.Debug("%s: closing", hostsContainerPref) | <mask> }
<mask>
<mask> // Close implements the io.Closer interface for *HostsContainer.
<mask> func (hc *HostsContainer) Close() (err error) {
<mask> log.Debug("%s: closing hosts container", hostsContainerPref)
<mask>
<mask> return errors.Annotate(hc.w.Close(), "%s: closing: %w", hostsContainerPref)
<mask> }
<mask>
<mask> // Upd returns the channel into which the updates are sent.
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove return hc.engine.MatchRequest(req)
</s> add res, ok = hc.engine.MatchRequest(req)
return res, ok </s> remove // Upd returns the channel into which the updates are sent.
</s> add // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *stringutil.Set. </s> remove // refresh gets the data from specified files and propagates the updates.
</s> add // refresh gets the data from specified files and propagates the updates if
// needed. </s> remove hp := hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(0),
</s> add hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
// Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *stringutil.Set. | <mask>
<mask> return errors.Annotate(hc.w.Close(), "%s: closing: %w", hostsContainerPref)
<mask> }
<mask>
<mask> // Upd returns the channel into which the updates are sent.
<mask> func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
<mask> return hc.updates
<mask> }
<mask>
<mask> // pathsToPatterns converts paths into patterns compatible with fs.Glob.
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove log.Debug("%s: closing hosts container", hostsContainerPref)
</s> add log.Debug("%s: closing", hostsContainerPref) </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. </s> remove // refresh gets the data from specified files and propagates the updates.
</s> add // refresh gets the data from specified files and propagates the updates if
// needed. </s> remove hp := hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(0),
</s> add hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) </s> remove // is intended to use within fs.FS so the initial slash is omitted.
</s> add // is intended to be used within fs.FS so the initial slash is omitted. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. | <mask> // updates channel afterwards.
<mask> table *netutil.IPMap
<mask> }
<mask>
<mask> // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
<mask> // syntax. It never signs to stop the walking.
<mask> //
<mask> // See man hosts(5).
<mask> func (hp hostsParser) parseHostsFile(
<mask> r io.Reader,
<mask> ) (patterns []string, cont bool, err error) {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove func (hp hostsParser) parseHostsFile(
</s> add func (hp *hostsParser) parseFile( </s> remove // Updates is the channel for receiving updated hosts. The receivable map's
// values has a type of slice of strings.
</s> add // updates is the channel for receiving updated hosts. </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) </s> remove // is intended to use within fs.FS so the initial slash is omitted.
</s> add // is intended to be used within fs.FS so the initial slash is omitted. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
func (hp *hostsParser) parseFile( | <mask> // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
<mask> // syntax. It never signs to stop the walking.
<mask> //
<mask> // See man hosts(5).
<mask> func (hp hostsParser) parseHostsFile(
<mask> r io.Reader,
<mask> ) (patterns []string, cont bool, err error) {
<mask> s := bufio.NewScanner(r)
<mask> for s.Scan() {
<mask> ip, hosts := hp.parseLine(s.Text())
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. </s> remove // is intended to use within fs.FS so the initial slash is omitted.
</s> add // is intended to be used within fs.FS so the initial slash is omitted. </s> remove // database.
</s> add // database. err is always nil. </s> remove // Updates is the channel for receiving updated hosts. The receivable map's
// values has a type of slice of strings.
</s> add // updates is the channel for receiving updated hosts. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) { | <mask> return nil, true, s.Err()
<mask> }
<mask>
<mask> // parseLine parses the line having the hosts syntax ignoring invalid ones.
<mask> func (hp hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
<mask> line = strings.TrimSpace(line)
<mask> fields := strings.Fields(line)
<mask> if len(fields) < 2 {
<mask> return nil, nil
<mask> }
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove case res.Reason == filtering.RewrittenRule:
</s> add case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): </s> remove hp.table.Set(ip, append(hosts, host))
</s> add </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
func (hp *hostsParser) add(ip net.IP, host string) (added bool) { | <mask> return ip, hosts
<mask> }
<mask>
<mask> // add returns true if the pair of ip and host wasn't added to the hp before.
<mask> func (hp hostsParser) add(ip net.IP, host string) (added bool) {
<mask> v, ok := hp.table.Get(ip)
<mask> hosts, _ := v.([]string)
<mask> if ok && stringutil.InSlice(hosts, host) {
<mask> return false
<mask> }
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): </s> remove hp.table.Set(ip, append(hosts, host))
</s> add </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { </s> remove for _, name := range names {
ok = clients.addHostLocked(ip, name, ClientSourceHostsFile)
if ok {
</s> add names.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): | <mask>
<mask> // add returns true if the pair of ip and host wasn't added to the hp before.
<mask> func (hp hostsParser) add(ip net.IP, host string) (added bool) {
<mask> v, ok := hp.table.Get(ip)
<mask> hosts, _ := v.([]string)
<mask> if ok && stringutil.InSlice(hosts, host) {
<mask> return false
<mask> }
<mask>
<mask> hp.table.Set(ip, append(hosts, host))
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove hp.table.Set(ip, append(hosts, host))
</s> add </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { </s> remove for _, name := range names {
ok = clients.addHostLocked(ip, name, ClientSourceHostsFile)
if ok {
</s> add names.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
case hosts == nil:
hosts = stringutil.NewSet(host)
hp.table.Set(ip, hosts)
default:
hosts.Add(host) | <mask> hosts, _ := v.(*stringutil.Set)
<mask> switch {
<mask> case ok && hosts.Has(host):
<mask> return false
<mask> }
<mask>
<mask> return true
<mask> }
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove hp.table.Set(ip, append(hosts, host))
</s> add </s> remove var hosts []string
hosts, ok = v.([]string)
</s> add var hosts *stringutil.Set
hosts, ok = v.(*stringutil.Set) </s> remove }
</s> add return true
}) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
<mask> if ok && stringutil.InSlice(hosts, host) {
<mask> return false
<mask> }
<mask>
<mask> hp.table.Set(ip, append(hosts, host))
<mask>
<mask> return true
<mask> }
<mask>
<mask> // addPair puts the pair of ip and host to the rules builder if needed.
<mask> func (hp hostsParser) addPair(ip net.IP, host string) {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove func (hp hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
|
func (hp *hostsParser) addPair(ip net.IP, host string) { | <mask> return true
<mask> }
<mask>
<mask> // addPair puts the pair of ip and host to the rules builder if needed.
<mask> func (hp hostsParser) addPair(ip net.IP, host string) {
<mask> arpa, err := netutil.IPToReversedAddr(ip)
<mask> if err != nil {
<mask> return
<mask> }
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove hp.table.Set(ip, append(hosts, host))
</s> add </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): </s> remove func (hp hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) { </s> remove // database.
</s> add // database. err is always nil. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
const (
nl = "\n"
sc = ";"
rewriteSuccess = "$dnsrewrite=NOERROR" + sc
rewriteSuccessPTR = rewriteSuccess + "PTR" + sc
)
ipStr := ip.String()
fqdn := dns.Fqdn(host)
for _, ruleData := range [...][]string{{
// A/AAAA.
rules.MaskStartURL, | <mask> // Assume the validation of the IP address is performed already.
<mask> qtype = "A"
<mask> }
<mask>
<mask> stringutil.WriteToBuilder(
<mask> hp.rules,
<mask> "||",
<mask> host,
<mask> "^$dnsrewrite=NOERROR;",
<mask> qtype,
<mask> ";",
<mask> ip.String(),
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove "^$dnsrewrite=NOERROR;",
</s> add rules.MaskSeparator,
rewriteSuccess, </s> remove ";",
ip.String(),
"\n",
"||",
</s> add sc,
ipStr,
nl,
}, {
// PTR.
rules.MaskStartURL, </s> remove "^$dnsrewrite=NOERROR;PTR;",
dns.Fqdn(host),
"\n",
)
</s> add rules.MaskSeparator,
rewriteSuccessPTR,
fqdn,
nl,
}} {
stringutil.WriteToBuilder(hp.rules, ruleData...)
} </s> remove return Result{}, nil
</s> add return res, nil </s> remove // database.
</s> add // database. err is always nil. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
rules.MaskSeparator,
rewriteSuccess, | <mask> stringutil.WriteToBuilder(
<mask> hp.rules,
<mask> "||",
<mask> host,
<mask> "^$dnsrewrite=NOERROR;",
<mask> qtype,
<mask> ";",
<mask> ip.String(),
<mask> "\n",
<mask> "||",
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove ";",
ip.String(),
"\n",
"||",
</s> add sc,
ipStr,
nl,
}, {
// PTR.
rules.MaskStartURL, </s> remove stringutil.WriteToBuilder(
hp.rules,
"||",
</s> add const (
nl = "\n"
sc = ";"
rewriteSuccess = "$dnsrewrite=NOERROR" + sc
rewriteSuccessPTR = rewriteSuccess + "PTR" + sc
)
ipStr := ip.String()
fqdn := dns.Fqdn(host)
for _, ruleData := range [...][]string{{
// A/AAAA.
rules.MaskStartURL, </s> remove "^$dnsrewrite=NOERROR;PTR;",
dns.Fqdn(host),
"\n",
)
</s> add rules.MaskSeparator,
rewriteSuccessPTR,
fqdn,
nl,
}} {
stringutil.WriteToBuilder(hp.rules, ruleData...)
} </s> remove // TODO(e.burkov): Wait for urlfilter update to pass net.IP.
</s> add // TODO(e.burkov): Wait for urlfilter update to pass net.IP. </s> remove return Result{}, nil
</s> add return res, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
sc,
ipStr,
nl,
}, {
// PTR.
rules.MaskStartURL, | <mask> "||",
<mask> host,
<mask> "^$dnsrewrite=NOERROR;",
<mask> qtype,
<mask> ";",
<mask> ip.String(),
<mask> "\n",
<mask> "||",
<mask> arpa,
<mask> "^$dnsrewrite=NOERROR;PTR;",
<mask> dns.Fqdn(host),
<mask> "\n",
<mask> )
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove "^$dnsrewrite=NOERROR;",
</s> add rules.MaskSeparator,
rewriteSuccess, </s> remove "^$dnsrewrite=NOERROR;PTR;",
dns.Fqdn(host),
"\n",
)
</s> add rules.MaskSeparator,
rewriteSuccessPTR,
fqdn,
nl,
}} {
stringutil.WriteToBuilder(hp.rules, ruleData...)
} </s> remove stringutil.WriteToBuilder(
hp.rules,
"||",
</s> add const (
nl = "\n"
sc = ";"
rewriteSuccess = "$dnsrewrite=NOERROR" + sc
rewriteSuccessPTR = rewriteSuccess + "PTR" + sc
)
ipStr := ip.String()
fqdn := dns.Fqdn(host)
for _, ruleData := range [...][]string{{
// A/AAAA.
rules.MaskStartURL, </s> remove // TODO(e.burkov): Wait for urlfilter update to pass net.IP.
</s> add // TODO(e.burkov): Wait for urlfilter update to pass net.IP. </s> remove return Result{}, nil
</s> add return res, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
rules.MaskSeparator,
rewriteSuccessPTR,
fqdn,
nl,
}} {
stringutil.WriteToBuilder(hp.rules, ruleData...)
} | <mask> ip.String(),
<mask> "\n",
<mask> "||",
<mask> arpa,
<mask> "^$dnsrewrite=NOERROR;PTR;",
<mask> dns.Fqdn(host),
<mask> "\n",
<mask> )
<mask>
<mask> log.Debug("%s: added ip-host pair %q/%q", hostsContainerPref, ip, host)
<mask> }
<mask>
<mask> // sendUpd tries to send the parsed data to the ch.
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove func (hp hostsParser) sendUpd(ch chan *netutil.IPMap) {
</s> add func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) { </s> remove ";",
ip.String(),
"\n",
"||",
</s> add sc,
ipStr,
nl,
}, {
// PTR.
rules.MaskStartURL, </s> remove case ch <- hp.table:
</s> add case ch <- upd: </s> remove "^$dnsrewrite=NOERROR;",
</s> add rules.MaskSeparator,
rewriteSuccess, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) { | <mask> log.Debug("%s: added ip-host pair %q/%q", hostsContainerPref, ip, host)
<mask> }
<mask>
<mask> // sendUpd tries to send the parsed data to the ch.
<mask> func (hp hostsParser) sendUpd(ch chan *netutil.IPMap) {
<mask> log.Debug("%s: sending upd", hostsContainerPref)
<mask> select {
<mask> case ch <- hp.table:
<mask> // Updates are delivered. Go on.
<mask> default:
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove case ch <- hp.table:
</s> add case ch <- upd: </s> remove "^$dnsrewrite=NOERROR;PTR;",
dns.Fqdn(host),
"\n",
)
</s> add rules.MaskSeparator,
rewriteSuccessPTR,
fqdn,
nl,
}} {
stringutil.WriteToBuilder(hp.rules, ruleData...)
} </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
upd := hp.table | <mask> // sendUpd tries to send the parsed data to the ch.
<mask> func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) {
<mask> log.Debug("%s: sending upd", hostsContainerPref)
<mask> select {
<mask> case ch <- upd:
<mask> // Updates are delivered. Go on.
<mask> case <-ch:
<mask> ch <- upd
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove case ch <- hp.table:
</s> add case ch <- upd: </s> remove func (hp hostsParser) sendUpd(ch chan *netutil.IPMap) {
</s> add func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) { </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) </s> remove "^$dnsrewrite=NOERROR;PTR;",
dns.Fqdn(host),
"\n",
)
</s> add rules.MaskSeparator,
rewriteSuccessPTR,
fqdn,
nl,
}} {
stringutil.WriteToBuilder(hp.rules, ruleData...)
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
case ch <- upd: | <mask> // sendUpd tries to send the parsed data to the ch.
<mask> func (hp hostsParser) sendUpd(ch chan *netutil.IPMap) {
<mask> log.Debug("%s: sending upd", hostsContainerPref)
<mask> select {
<mask> case ch <- hp.table:
<mask> // Updates are delivered. Go on.
<mask> default:
<mask> log.Debug("%s: the buffer is full", hostsContainerPref)
<mask> }
<mask> }
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove func (hp hostsParser) sendUpd(ch chan *netutil.IPMap) {
</s> add func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) { </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) </s> remove "^$dnsrewrite=NOERROR;PTR;",
dns.Fqdn(host),
"\n",
)
</s> add rules.MaskSeparator,
rewriteSuccessPTR,
fqdn,
nl,
}} {
stringutil.WriteToBuilder(hp.rules, ruleData...)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
case <-ch:
ch <- upd
log.Debug("%s: replaced the last update", hostsContainerPref)
case ch <- upd:
// The previous update was just read and the next one pushed. Go on. | <mask> case ch <- upd:
<mask> // Updates are delivered. Go on.
<mask> default:
<mask> log.Debug("%s: the channel is broken", hostsContainerPref)
<mask> }
<mask> }
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) </s> remove case ch <- hp.table:
</s> add case ch <- upd: </s> remove func (hp hostsParser) sendUpd(ch chan *netutil.IPMap) {
</s> add func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) { </s> remove log.Debug("%s: closing hosts container", hostsContainerPref)
</s> add log.Debug("%s: closing", hostsContainerPref) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
log.Debug("%s: the channel is broken", hostsContainerPref) | <mask> select {
<mask> case ch <- hp.table:
<mask> // Updates are delivered. Go on.
<mask> default:
<mask> log.Debug("%s: the buffer is full", hostsContainerPref)
<mask> }
<mask> }
<mask>
<mask> // newStrg creates a new rules storage from parsed data.
<mask> func (hp hostsParser) newStrg() (s *filterlist.RuleStorage, err error) {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove case ch <- hp.table:
</s> add case ch <- upd: </s> remove func (hp hostsParser) newStrg() (s *filterlist.RuleStorage, err error) {
</s> add func (hp *hostsParser) newStrg() (s *filterlist.RuleStorage, err error) { </s> remove ID: 1,
</s> add ID: -1, </s> remove func (hp hostsParser) sendUpd(ch chan *netutil.IPMap) {
</s> add func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
func (hp *hostsParser) newStrg() (s *filterlist.RuleStorage, err error) { | <mask> }
<mask> }
<mask>
<mask> // newStrg creates a new rules storage from parsed data.
<mask> func (hp hostsParser) newStrg() (s *filterlist.RuleStorage, err error) {
<mask> return filterlist.NewRuleStorage([]filterlist.RuleList{&filterlist.StringRuleList{
<mask> ID: 1,
<mask> RulesText: hp.rules.String(),
<mask> IgnoreCosmetic: true,
<mask> }})
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove ID: 1,
</s> add ID: -1, </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) </s> remove // refresh gets the data from specified files and propagates the updates.
</s> add // refresh gets the data from specified files and propagates the updates if
// needed. </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
ID: -1, | <mask>
<mask> // newStrg creates a new rules storage from parsed data.
<mask> func (hp hostsParser) newStrg() (s *filterlist.RuleStorage, err error) {
<mask> return filterlist.NewRuleStorage([]filterlist.RuleList{&filterlist.StringRuleList{
<mask> ID: 1,
<mask> RulesText: hp.rules.String(),
<mask> IgnoreCosmetic: true,
<mask> }})
<mask> }
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove func (hp hostsParser) newStrg() (s *filterlist.RuleStorage, err error) {
</s> add func (hp *hostsParser) newStrg() (s *filterlist.RuleStorage, err error) { </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) </s> remove // refresh gets the data from specified files and propagates the updates.
</s> add // refresh gets the data from specified files and propagates the updates if
// needed. </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
// refresh gets the data from specified files and propagates the updates if
// needed. | <mask> IgnoreCosmetic: true,
<mask> }})
<mask> }
<mask>
<mask> // refresh gets the data from specified files and propagates the updates.
<mask> func (hc *HostsContainer) refresh() (err error) {
<mask> log.Debug("%s: refreshing", hostsContainerPref)
<mask>
<mask> hp := hostsParser{
<mask> rules: &strings.Builder{},
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove hp := hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(0),
</s> add hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) </s> remove ID: 1,
</s> add ID: -1, </s> remove func (hp hostsParser) newStrg() (s *filterlist.RuleStorage, err error) {
</s> add func (hp *hostsParser) newStrg() (s *filterlist.RuleStorage, err error) { </s> remove log.Debug("%s: closing hosts container", hostsContainerPref)
</s> add log.Debug("%s: closing", hostsContainerPref) </s> remove return hc.engine.MatchRequest(req)
</s> add res, ok = hc.engine.MatchRequest(req)
return res, ok | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) | <mask> // refresh gets the data from specified files and propagates the updates.
<mask> func (hc *HostsContainer) refresh() (err error) {
<mask> log.Debug("%s: refreshing", hostsContainerPref)
<mask>
<mask> hp := hostsParser{
<mask> rules: &strings.Builder{},
<mask> table: netutil.NewIPMap(0),
<mask> }
<mask>
<mask> _, err = aghos.FileWalker(hp.parseHostsFile).Walk(hc.fsys, hc.patterns...)
<mask> if err != nil {
<mask> return fmt.Errorf("updating: %w", err)
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // refresh gets the data from specified files and propagates the updates.
</s> add // refresh gets the data from specified files and propagates the updates if
// needed. </s> remove _, err = aghos.FileWalker(hp.parseHostsFile).Walk(hc.fsys, hc.patterns...)
if err != nil {
return fmt.Errorf("updating: %w", err)
}
</s> add if hp.equalSet(hc.last) {
log.Debug("%s: no updates detected", hostsContainerPref) </s> remove log.Debug("%s: closing hosts container", hostsContainerPref)
</s> add log.Debug("%s: closing", hostsContainerPref) </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
if hp.equalSet(hc.last) {
log.Debug("%s: no updates detected", hostsContainerPref) | <mask> rules: &strings.Builder{},
<mask> table: netutil.NewIPMap(0),
<mask> }
<mask>
<mask> _, err = aghos.FileWalker(hp.parseHostsFile).Walk(hc.fsys, hc.patterns...)
<mask> if err != nil {
<mask> return fmt.Errorf("updating: %w", err)
<mask> }
<mask>
<mask> defer hp.sendUpd(hc.updates)
<mask>
<mask> var rulesStrg *filterlist.RuleStorage
<mask> if rulesStrg, err = hp.newStrg(); err != nil {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove hp := hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(0),
</s> add hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) </s> remove case res.Reason == filtering.RewrittenRule:
</s> add case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
return nil
} | <mask> log.Debug("%s: no updates detected", hostsContainerPref)
<mask>
<mask> defer hp.sendUpd(hc.updates)
<mask>
<mask> hc.last = hp.table.ShallowClone()
<mask>
<mask> var rulesStrg *filterlist.RuleStorage
<mask> if rulesStrg, err = hp.newStrg(); err != nil {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove _, err = aghos.FileWalker(hp.parseHostsFile).Walk(hc.fsys, hc.patterns...)
if err != nil {
return fmt.Errorf("updating: %w", err)
}
</s> add if hp.equalSet(hc.last) {
log.Debug("%s: no updates detected", hostsContainerPref) </s> remove hp := hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(0),
</s> add hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) </s> remove case res.Reason == filtering.RewrittenRule:
</s> add case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
hc.last = hp.table.ShallowClone()
| <mask> defer hp.sendUpd(hc.updates)
<mask>
<mask> var rulesStrg *filterlist.RuleStorage
<mask> if rulesStrg, err = hp.newStrg(); err != nil {
<mask> return fmt.Errorf("initializing rules storage: %w", err)
<mask> }
<mask>
<mask> hc.resetEng(rulesStrg)
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove _, err = aghos.FileWalker(hp.parseHostsFile).Walk(hc.fsys, hc.patterns...)
if err != nil {
return fmt.Errorf("updating: %w", err)
}
</s> add if hp.equalSet(hc.last) {
log.Debug("%s: no updates detected", hostsContainerPref) </s> remove hp := hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(0),
</s> add hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) </s> remove case res.Reason == filtering.RewrittenRule:
</s> add case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer.go |
"github.com/AdguardTeam/golibs/stringutil" | <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/netutil"
<mask> "github.com/AdguardTeam/urlfilter"
<mask> "github.com/miekg/dns"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove hp := hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(0),
</s> add hp := hc.newHostsParser()
if _, err = aghos.FileWalker(hp.parseFile).Walk(hc.fsys, hc.patterns...); err != nil {
return fmt.Errorf("refreshing : %w", err) </s> remove // refresh gets the data from specified files and propagates the updates.
</s> add // refresh gets the data from specified files and propagates the updates if
// needed. </s> remove ID: 1,
</s> add ID: -1, | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
// event is a convenient alias for an empty struct{} to emit test events.
type event = struct{}
eventsCh := make(chan event, 1) | <mask> Data: []byte(strings.Join([]string{knownIP.String(), knownHost}, sp) + nl),
<mask> },
<mask> }
<mask>
<mask> eventsCh := make(chan struct{}, 1)
<mask> t.Cleanup(func() { close(eventsCh) })
<mask>
<mask> w := &aghtest.FSWatcher{
<mask> OnEvents: func() (e <-chan struct{}) { return eventsCh },
<mask> OnAdd: func(name string) (err error) {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove OnEvents: func() (e <-chan struct{}) { return eventsCh },
</s> add OnEvents: func() (e <-chan event) { return eventsCh }, </s> remove
eventsCh <- struct{}{}
</s> add eventsCh <- event{} </s> remove strings.Join([]string{ip4.String(), hostname4, hostname4a}, sp) + nl +
strings.Join([]string{ip6.String(), hostname6}, sp) + nl +
strings.Join([]string{"256.256.256.256", "fakebroadcast"}, sp) + nl,
</s> add ip4.String() + " " + hostname4 + " " + hostname4a + nl +
ip6.String() + " " + hostname6 + nl +
`256.256.256.256 fakebroadcast` + nl, </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) </s> remove checkRefresh(t, []string{knownHost, knownAlias})
</s> add checkRefresh(t, stringutil.NewSet(knownHost, knownAlias))
})
eventsCh <- event{}
t.Run("no_changes_refresh", func(t *testing.T) {
assert.Empty(t, hc.Upd()) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
OnEvents: func() (e <-chan event) { return eventsCh }, | <mask> eventsCh := make(chan struct{}, 1)
<mask> t.Cleanup(func() { close(eventsCh) })
<mask>
<mask> w := &aghtest.FSWatcher{
<mask> OnEvents: func() (e <-chan struct{}) { return eventsCh },
<mask> OnAdd: func(name string) (err error) {
<mask> assert.Equal(t, dirname, name)
<mask>
<mask> return nil
<mask> },
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove eventsCh := make(chan struct{}, 1)
</s> add // event is a convenient alias for an empty struct{} to emit test events.
type event = struct{}
eventsCh := make(chan event, 1) </s> remove strings.Join([]string{ip4.String(), hostname4, hostname4a}, sp) + nl +
strings.Join([]string{ip6.String(), hostname6}, sp) + nl +
strings.Join([]string{"256.256.256.256", "fakebroadcast"}, sp) + nl,
</s> add ip4.String() + " " + hostname4 + " " + hostname4a + nl +
ip6.String() + " " + hostname6 + nl +
`256.256.256.256 fakebroadcast` + nl, </s> remove checkRefresh(t, []string{knownHost, knownAlias})
</s> add checkRefresh(t, stringutil.NewSet(knownHost, knownAlias))
})
eventsCh <- event{}
t.Run("no_changes_refresh", func(t *testing.T) {
assert.Empty(t, hc.Upd()) </s> remove
eventsCh <- struct{}{}
</s> add eventsCh <- event{} </s> remove checkRefresh := func(t *testing.T, wantHosts []string) {
</s> add checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { | <mask> hc, err := NewHostsContainer(testFS, w, dirname)
<mask> require.NoError(t, err)
<mask> t.Cleanup(func() { require.ErrorIs(t, hc.Close(), closeCalled) })
<mask>
<mask> checkRefresh := func(t *testing.T, wantHosts []string) {
<mask> upd, ok := <-hc.Upd()
<mask> require.True(t, ok)
<mask> require.NotNil(t, upd)
<mask>
<mask> assert.Equal(t, 1, upd.Len())
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove assert.Equal(t, wantHosts, hosts)
</s> add assert.True(t, hosts.Equal(wantHosts)) </s> remove require.Len(t, hosts, len(wantHosts))
</s> add </s> remove var hosts []string
hosts, ok = v.([]string)
</s> add var hosts *stringutil.Set
hosts, ok = v.(*stringutil.Set) </s> remove OnEvents: func() (e <-chan struct{}) { return eventsCh },
</s> add OnEvents: func() (e <-chan event) { return eventsCh }, </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
var hosts *stringutil.Set
hosts, ok = v.(*stringutil.Set) | <mask>
<mask> v, ok := upd.Get(knownIP)
<mask> require.True(t, ok)
<mask>
<mask> var hosts []string
<mask> hosts, ok = v.([]string)
<mask> require.True(t, ok)
<mask> require.Len(t, hosts, len(wantHosts))
<mask>
<mask> assert.Equal(t, wantHosts, hosts)
<mask> }
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove require.Len(t, hosts, len(wantHosts))
</s> add </s> remove assert.Equal(t, wantHosts, hosts)
</s> add assert.True(t, hosts.Equal(wantHosts)) </s> remove checkRefresh := func(t *testing.T, wantHosts []string) {
</s> add checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
<mask>
<mask> var hosts []string
<mask> hosts, ok = v.([]string)
<mask> require.True(t, ok)
<mask> require.Len(t, hosts, len(wantHosts))
<mask>
<mask> assert.Equal(t, wantHosts, hosts)
<mask> }
<mask>
<mask> t.Run("initial_refresh", func(t *testing.T) {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove assert.Equal(t, wantHosts, hosts)
</s> add assert.True(t, hosts.Equal(wantHosts)) </s> remove var hosts []string
hosts, ok = v.([]string)
</s> add var hosts *stringutil.Set
hosts, ok = v.(*stringutil.Set) </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) </s> remove checkRefresh := func(t *testing.T, wantHosts []string) {
</s> add checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
|
assert.True(t, hosts.Equal(wantHosts)) | <mask> hosts, ok = v.([]string)
<mask> require.True(t, ok)
<mask> require.Len(t, hosts, len(wantHosts))
<mask>
<mask> assert.Equal(t, wantHosts, hosts)
<mask> }
<mask>
<mask> t.Run("initial_refresh", func(t *testing.T) {
<mask> checkRefresh(t, []string{knownHost})
<mask> })
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove require.Len(t, hosts, len(wantHosts))
</s> add </s> remove var hosts []string
hosts, ok = v.([]string)
</s> add var hosts *stringutil.Set
hosts, ok = v.(*stringutil.Set) </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) </s> remove checkRefresh(t, []string{knownHost, knownAlias})
</s> add checkRefresh(t, stringutil.NewSet(knownHost, knownAlias))
})
eventsCh <- event{}
t.Run("no_changes_refresh", func(t *testing.T) {
assert.Empty(t, hc.Upd()) </s> remove checkRefresh := func(t *testing.T, wantHosts []string) {
</s> add checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
checkRefresh(t, stringutil.NewSet(knownHost)) | <mask> assert.Equal(t, wantHosts, hosts)
<mask> }
<mask>
<mask> t.Run("initial_refresh", func(t *testing.T) {
<mask> checkRefresh(t, []string{knownHost})
<mask> })
<mask>
<mask> testFS[p2] = &fstest.MapFile{
<mask> Data: []byte(strings.Join([]string{knownIP.String(), knownAlias}, sp) + nl),
<mask> }
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove
eventsCh <- struct{}{}
</s> add eventsCh <- event{} </s> remove assert.Equal(t, wantHosts, hosts)
</s> add assert.True(t, hosts.Equal(wantHosts)) </s> remove require.Len(t, hosts, len(wantHosts))
</s> add </s> remove checkRefresh(t, []string{knownHost, knownAlias})
</s> add checkRefresh(t, stringutil.NewSet(knownHost, knownAlias))
})
eventsCh <- event{}
t.Run("no_changes_refresh", func(t *testing.T) {
assert.Empty(t, hc.Upd()) </s> remove eventsCh := make(chan struct{}, 1)
</s> add // event is a convenient alias for an empty struct{} to emit test events.
type event = struct{}
eventsCh := make(chan event, 1) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
eventsCh <- event{} | <mask>
<mask> testFS[p2] = &fstest.MapFile{
<mask> Data: []byte(strings.Join([]string{knownIP.String(), knownAlias}, sp) + nl),
<mask> }
<mask>
<mask> eventsCh <- struct{}{}
<mask>
<mask> t.Run("second_refresh", func(t *testing.T) {
<mask> checkRefresh(t, []string{knownHost, knownAlias})
<mask> })
<mask> }
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) </s> remove checkRefresh(t, []string{knownHost, knownAlias})
</s> add checkRefresh(t, stringutil.NewSet(knownHost, knownAlias))
})
eventsCh <- event{}
t.Run("no_changes_refresh", func(t *testing.T) {
assert.Empty(t, hc.Upd()) </s> remove eventsCh := make(chan struct{}, 1)
</s> add // event is a convenient alias for an empty struct{} to emit test events.
type event = struct{}
eventsCh := make(chan event, 1) </s> remove assert.Equal(t, wantHosts, hosts)
</s> add assert.True(t, hosts.Equal(wantHosts)) </s> remove strings.Join([]string{ip4.String(), hostname4, hostname4a}, sp) + nl +
strings.Join([]string{ip6.String(), hostname6}, sp) + nl +
strings.Join([]string{"256.256.256.256", "fakebroadcast"}, sp) + nl,
</s> add ip4.String() + " " + hostname4 + " " + hostname4a + nl +
ip6.String() + " " + hostname6 + nl +
`256.256.256.256 fakebroadcast` + nl, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
checkRefresh(t, stringutil.NewSet(knownHost, knownAlias))
})
eventsCh <- event{}
t.Run("no_changes_refresh", func(t *testing.T) {
assert.Empty(t, hc.Upd()) | <mask>
<mask> eventsCh <- struct{}{}
<mask>
<mask> t.Run("second_refresh", func(t *testing.T) {
<mask> checkRefresh(t, []string{knownHost, knownAlias})
<mask> })
<mask> }
<mask>
<mask> func TestHostsContainer_MatchRequest(t *testing.T) {
<mask> var (
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove
eventsCh <- struct{}{}
</s> add eventsCh <- event{} </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) </s> remove assert.Equal(t, wantHosts, hosts)
</s> add assert.True(t, hosts.Equal(wantHosts)) </s> remove 0, 0, 0, 0,
</s> add 128, 0, 0, 0, </s> remove require.Len(t, hosts, len(wantHosts))
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
128, 0, 0, 0, | <mask> func TestHostsContainer_MatchRequest(t *testing.T) {
<mask> var (
<mask> ip4 = net.IP{127, 0, 0, 1}
<mask> ip6 = net.IP{
<mask> 0, 0, 0, 0,
<mask> 0, 0, 0, 0,
<mask> 0, 0, 0, 0,
<mask> 0, 0, 0, 1,
<mask> }
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove checkRefresh(t, []string{knownHost, knownAlias})
</s> add checkRefresh(t, stringutil.NewSet(knownHost, knownAlias))
})
eventsCh <- event{}
t.Run("no_changes_refresh", func(t *testing.T) {
assert.Empty(t, hc.Upd()) </s> remove require.Len(t, hosts, len(wantHosts))
</s> add </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) </s> remove
eventsCh <- struct{}{}
</s> add eventsCh <- event{} </s> remove assert.Equal(t, wantHosts, hosts)
</s> add assert.True(t, hosts.Equal(wantHosts)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
ip4.String() + " " + hostname4 + " " + hostname4a + nl +
ip6.String() + " " + hostname6 + nl +
`256.256.256.256 fakebroadcast` + nl, | <mask> const filename = "file1"
<mask>
<mask> gsfs := fstest.MapFS{
<mask> filename: &fstest.MapFile{Data: []byte(
<mask> strings.Join([]string{ip4.String(), hostname4, hostname4a}, sp) + nl +
<mask> strings.Join([]string{ip6.String(), hostname6}, sp) + nl +
<mask> strings.Join([]string{"256.256.256.256", "fakebroadcast"}, sp) + nl,
<mask> )},
<mask> }
<mask>
<mask> hc, err := NewHostsContainer(gsfs, &aghtest.FSWatcher{
<mask> OnEvents: func() (e <-chan struct{}) { panic("not implemented") },
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove eventsCh := make(chan struct{}, 1)
</s> add // event is a convenient alias for an empty struct{} to emit test events.
type event = struct{}
eventsCh := make(chan event, 1) </s> remove OnEvents: func() (e <-chan struct{}) { return eventsCh },
</s> add OnEvents: func() (e <-chan event) { return eventsCh }, </s> remove stringutil.WriteToBuilder(
hp.rules,
"||",
</s> add const (
nl = "\n"
sc = ";"
rewriteSuccess = "$dnsrewrite=NOERROR" + sc
rewriteSuccessPTR = rewriteSuccess + "PTR" + sc
)
ipStr := ip.String()
fqdn := dns.Fqdn(host)
for _, ruleData := range [...][]string{{
// A/AAAA.
rules.MaskStartURL, </s> remove name: "existing_one",
host: knownHost,
wantRules: "",
ip: knownIP,
</s> add name: "existing_one",
host: knownHost,
wantRules: "||" + knownHost + "^$dnsrewrite=NOERROR;A;1.2.3.4\n" +
"||4.3.2.1.in-addr.arpa^$dnsrewrite=NOERROR;PTR;host1.\n",
ip: knownIP, </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
}, {
name: "a_for_aaaa",
want: []interface{}{
ip4.To16(),
},
req: urlfilter.DNSRequest{
Hostname: hostname4,
DNSType: dns.TypeAAAA,
}, | <mask> Hostname: hostname4,
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> name: "aaaa",
<mask> want: []interface{}{ip6},
<mask> req: urlfilter.DNSRequest{
<mask> Hostname: hostname6,
<mask> DNSType: dns.TypeAAAA,
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // TODO(e.burkov): Wait for urlfilter update to pass net.IP.
</s> add // TODO(e.burkov): Wait for urlfilter update to pass net.IP. </s> remove name: "existing_one",
host: knownHost,
wantRules: "",
ip: knownIP,
</s> add name: "existing_one",
host: knownHost,
wantRules: "||" + knownHost + "^$dnsrewrite=NOERROR;A;1.2.3.4\n" +
"||4.3.2.1.in-addr.arpa^$dnsrewrite=NOERROR;PTR;host1.\n",
ip: knownIP, </s> remove OnEvents: func() (e <-chan struct{}) { return eventsCh },
</s> add OnEvents: func() (e <-chan event) { return eventsCh }, </s> remove return Result{}, nil
</s> add return res, nil </s> remove return Result{}, nil
</s> add return res, nil | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
ipToHost.Set(knownIP, *stringutil.NewSet(knownHost)) | <mask>
<mask> const knownHost = "host1"
<mask>
<mask> ipToHost := netutil.NewIPMap(0)
<mask> ipToHost.Set(knownIP, []string{knownHost})
<mask>
<mask> testCases := []struct {
<mask> name string
<mask> host string
<mask> wantRules string
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove case res.Reason == filtering.RewrittenAutoHosts && len(res.ReverseHosts) != 0:
resp := s.makeResponse(req)
hdr := dns.RR_Header{
Name: q.Name,
Rrtype: dns.TypePTR,
Ttl: s.conf.BlockedResponseTTL,
Class: dns.ClassINET,
}
for _, h := range res.ReverseHosts {
ptr := &dns.PTR{
Hdr: hdr,
Ptr: h,
}
resp.Answer = append(resp.Answer, ptr)
}
d.Res = resp
case res.Reason.In(filtering.Rewritten, filtering.RewrittenAutoHosts):
</s> add case res.Reason == filtering.Rewritten: </s> remove name: "existing_one",
host: knownHost,
wantRules: "",
ip: knownIP,
</s> add name: "existing_one",
host: knownHost,
wantRules: "||" + knownHost + "^$dnsrewrite=NOERROR;A;1.2.3.4\n" +
"||4.3.2.1.in-addr.arpa^$dnsrewrite=NOERROR;PTR;host1.\n",
ip: knownIP, </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove names, ok := v.([]string)
</s> add names, ok := v.(*stringutil.Set) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
name: "existing_one",
host: knownHost,
wantRules: "||" + knownHost + "^$dnsrewrite=NOERROR;A;1.2.3.4\n" +
"||4.3.2.1.in-addr.arpa^$dnsrewrite=NOERROR;PTR;host1.\n",
ip: knownIP, | <mask> wantRules: "||host2^$dnsrewrite=NOERROR;A;1.2.3.4\n" +
<mask> "||4.3.2.1.in-addr.arpa^$dnsrewrite=NOERROR;PTR;host2.\n",
<mask> ip: knownIP,
<mask> }, {
<mask> name: "existing_one",
<mask> host: knownHost,
<mask> wantRules: "",
<mask> ip: knownIP,
<mask> }, {
<mask> name: "new_ip",
<mask> host: knownHost,
<mask> wantRules: "||" + knownHost + "^$dnsrewrite=NOERROR;A;1.2.3.5\n" +
<mask> "||5.3.2.1.in-addr.arpa^$dnsrewrite=NOERROR;PTR;" + knownHost + ".\n",
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove strings.Join([]string{ip4.String(), hostname4, hostname4a}, sp) + nl +
strings.Join([]string{ip6.String(), hostname6}, sp) + nl +
strings.Join([]string{"256.256.256.256", "fakebroadcast"}, sp) + nl,
</s> add ip4.String() + " " + hostname4 + " " + hostname4a + nl +
ip6.String() + " " + hostname6 + nl +
`256.256.256.256 fakebroadcast` + nl, </s> remove stringutil.WriteToBuilder(
hp.rules,
"||",
</s> add const (
nl = "\n"
sc = ";"
rewriteSuccess = "$dnsrewrite=NOERROR" + sc
rewriteSuccessPTR = rewriteSuccess + "PTR" + sc
)
ipStr := ip.String()
fqdn := dns.Fqdn(host)
for _, ruleData := range [...][]string{{
// A/AAAA.
rules.MaskStartURL, </s> remove eventsCh := make(chan struct{}, 1)
</s> add // event is a convenient alias for an empty struct{} to emit test events.
type event = struct{}
eventsCh := make(chan event, 1) </s> remove checkRefresh(t, []string{knownHost})
</s> add checkRefresh(t, stringutil.NewSet(knownHost)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/aghnet/hostscontainer_test.go |
case res.Reason == filtering.Rewritten: | <mask> // Resolve the new canonical name, not the original host name. The
<mask> // original question is readded in processFilteringAfterResponse.
<mask> ctx.origQuestion = q
<mask> req.Question[0].Name = dns.Fqdn(res.CanonName)
<mask> case res.Reason == filtering.RewrittenAutoHosts && len(res.ReverseHosts) != 0:
<mask> resp := s.makeResponse(req)
<mask> hdr := dns.RR_Header{
<mask> Name: q.Name,
<mask> Rrtype: dns.TypePTR,
<mask> Ttl: s.conf.BlockedResponseTTL,
<mask> Class: dns.ClassINET,
<mask> }
<mask> for _, h := range res.ReverseHosts {
<mask> ptr := &dns.PTR{
<mask> Hdr: hdr,
<mask> Ptr: h,
<mask> }
<mask>
<mask> resp.Answer = append(resp.Answer, ptr)
<mask> }
<mask>
<mask> d.Res = resp
<mask> case res.Reason.In(filtering.Rewritten, filtering.RewrittenAutoHosts):
<mask> resp := s.makeResponse(req)
<mask>
<mask> name := host
<mask> if len(res.CanonName) != 0 {
<mask> resp.Answer = append(resp.Answer, s.genAnswerCNAME(req, res.CanonName))
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove case res.Reason == filtering.RewrittenRule:
</s> add case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil </s> remove for _, name := range names {
ok = clients.addHostLocked(ip, name, ClientSourceHostsFile)
if ok {
</s> add names.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) { </s> remove names, ok := v.([]string)
</s> add names, ok := v.(*stringutil.Set) </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/dnsforward/filter.go |
case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): | <mask> }
<mask> }
<mask>
<mask> d.Res = resp
<mask> case res.Reason == filtering.RewrittenRule:
<mask> if err = s.filterDNSRewrite(req, res, d); err != nil {
<mask> return nil, err
<mask> }
<mask> }
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove case res.Reason == filtering.RewrittenAutoHosts && len(res.ReverseHosts) != 0:
resp := s.makeResponse(req)
hdr := dns.RR_Header{
Name: q.Name,
Rrtype: dns.TypePTR,
Ttl: s.conf.BlockedResponseTTL,
Class: dns.ClassINET,
}
for _, h := range res.ReverseHosts {
ptr := &dns.PTR{
Hdr: hdr,
Ptr: h,
}
resp.Answer = append(resp.Answer, ptr)
}
d.Res = resp
case res.Reason.In(filtering.Rewritten, filtering.RewrittenAutoHosts):
</s> add case res.Reason == filtering.Rewritten: </s> remove _, err = aghos.FileWalker(hp.parseHostsFile).Walk(hc.fsys, hc.patterns...)
if err != nil {
return fmt.Errorf("updating: %w", err)
}
</s> add if hp.equalSet(hc.last) {
log.Debug("%s: no updates detected", hostsContainerPref) </s> remove return Result{}, nil
</s> add return res, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/dnsforward/filter.go |
// DNSRewriteResult set. dnsr is expected to be non-empty. | <mask> type DNSRewriteResultResponse map[rules.RRType][]rules.RRValue
<mask>
<mask> // processDNSRewrites processes DNS rewrite rules in dnsr. It returns an empty
<mask> // result if dnsr is empty. Otherwise, the result will have either CanonName or
<mask> // DNSRewriteResult set.
<mask> func (d *DNSFilter) processDNSRewrites(dnsr []*rules.NetworkRule) (res Result) {
<mask> if len(dnsr) == 0 {
<mask> return Result{}
<mask> }
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove if len(dnsr) == 0 {
return Result{}
}
</s> add </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil </s> remove // database.
</s> add // database. err is always nil. </s> remove return Result{}, nil
</s> add return res, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/dnsrewrite.go |
<mask> // processDNSRewrites processes DNS rewrite rules in dnsr. It returns an empty
<mask> // result if dnsr is empty. Otherwise, the result will have either CanonName or
<mask> // DNSRewriteResult set.
<mask> func (d *DNSFilter) processDNSRewrites(dnsr []*rules.NetworkRule) (res Result) {
<mask> if len(dnsr) == 0 {
<mask> return Result{}
<mask> }
<mask>
<mask> var rules []*ResultRule
<mask> dnsrr := &DNSRewriteResult{
<mask> Response: DNSRewriteResultResponse{},
<mask> }
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // DNSRewriteResult set.
</s> add // DNSRewriteResult set. dnsr is expected to be non-empty. </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil </s> remove // NewCNAME rules have a higher priority than
// the other rules.
</s> add // NewCNAME rules have a higher priority than the other rules. </s> remove return Result{}, nil
</s> add return res, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/dnsrewrite.go |
|
// NewCNAME rules have a higher priority than the other rules. | <mask>
<mask> for _, nr := range dnsr {
<mask> dr := nr.DNSRewrite
<mask> if dr.NewCNAME != "" {
<mask> // NewCNAME rules have a higher priority than
<mask> // the other rules.
<mask> rules = []*ResultRule{{
<mask> FilterListID: int64(nr.GetFilterListID()),
<mask> Text: nr.RuleText,
<mask> }}
<mask>
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // RcodeRefused and other such codes have higher
// priority. Return immediately.
</s> add // RcodeRefused and other such codes have higher priority. Return
// immediately. </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil </s> remove if len(dnsr) == 0 {
return Result{}
}
</s> add </s> remove // DNSRewriteResult set.
</s> add // DNSRewriteResult set. dnsr is expected to be non-empty. </s> remove case res.Reason == filtering.RewrittenAutoHosts && len(res.ReverseHosts) != 0:
resp := s.makeResponse(req)
hdr := dns.RR_Header{
Name: q.Name,
Rrtype: dns.TypePTR,
Ttl: s.conf.BlockedResponseTTL,
Class: dns.ClassINET,
}
for _, h := range res.ReverseHosts {
ptr := &dns.PTR{
Hdr: hdr,
Ptr: h,
}
resp.Answer = append(resp.Answer, ptr)
}
d.Res = resp
case res.Reason.In(filtering.Rewritten, filtering.RewrittenAutoHosts):
</s> add case res.Reason == filtering.Rewritten: | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/dnsrewrite.go |
// RcodeRefused and other such codes have higher priority. Return
// immediately. | <mask> FilterListID: int64(nr.GetFilterListID()),
<mask> Text: nr.RuleText,
<mask> })
<mask> default:
<mask> // RcodeRefused and other such codes have higher
<mask> // priority. Return immediately.
<mask> rules = []*ResultRule{{
<mask> FilterListID: int64(nr.GetFilterListID()),
<mask> Text: nr.RuleText,
<mask> }}
<mask> dnsrr = &DNSRewriteResult{
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // NewCNAME rules have a higher priority than
// the other rules.
</s> add // NewCNAME rules have a higher priority than the other rules. </s> remove if len(dnsr) == 0 {
return Result{}
}
</s> add </s> remove // DNSRewriteResult set.
</s> add // DNSRewriteResult set. dnsr is expected to be non-empty. </s> remove log.Debug("%s: the buffer is full", hostsContainerPref)
</s> add log.Debug("%s: the channel is broken", hostsContainerPref) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/dnsrewrite.go |
//
// TODO(e.burkov): There is no need for AutoHosts-related fields any more
// since the hosts container now uses $dnsrewrite rules. These fields are
// only used in query log to decode old format. | <mask>
<mask> // ReverseHosts is the reverse lookup rewrite result. It is empty unless
<mask> // Reason is set to RewrittenAutoHosts.
<mask> ReverseHosts []string `json:",omitempty"`
<mask>
<mask> // IPList is the lookup rewrite result. It is empty unless Reason is set to
<mask> // RewrittenAutoHosts or Rewritten.
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // DNSRewriteResult set.
</s> add // DNSRewriteResult set. dnsr is expected to be non-empty. </s> remove if len(dnsr) == 0 {
return Result{}
}
</s> add </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. </s> remove // is intended to use within fs.FS so the initial slash is omitted.
</s> add // is intended to be used within fs.FS so the initial slash is omitted. | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/filtering.go |
// database. err is always nil. | <mask> return Result{}, nil
<mask> }
<mask>
<mask> // matchSysHosts tries to match the host against the operating system's hosts
<mask> // database.
<mask> func (d *DNSFilter) matchSysHosts(
<mask> host string,
<mask> qtype uint16,
<mask> setts *Settings,
<mask> ) (res Result, err error) {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove return Result{}, nil
</s> add return res, nil </s> remove func (hp hostsParser) addPair(ip net.IP, host string) {
</s> add func (hp *hostsParser) addPair(ip net.IP, host string) { </s> remove // DNSRewriteResult set.
</s> add // DNSRewriteResult set. dnsr is expected to be non-empty. </s> remove if len(dnsr) == 0 {
return Result{}
}
</s> add </s> remove // is intended to use within fs.FS so the initial slash is omitted.
</s> add // is intended to be used within fs.FS so the initial slash is omitted. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/filtering.go |
return res, nil | <mask> qtype uint16,
<mask> setts *Settings,
<mask> ) (res Result, err error) {
<mask> if !setts.FilteringEnabled || d.EtcHosts == nil {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
<mask> Hostname: host,
<mask> SortedClientTags: setts.ClientTags,
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove // database.
</s> add // database. err is always nil. </s> remove // TODO(e.burkov): Wait for urlfilter update to pass net.IP.
</s> add // TODO(e.burkov): Wait for urlfilter update to pass net.IP. </s> remove return Result{}, nil
</s> add return res, nil </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil </s> remove case res.Reason == filtering.RewrittenRule:
</s> add case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/filtering.go |
// TODO(e.burkov): Wait for urlfilter update to pass net.IP. | <mask>
<mask> dnsres, _ := d.EtcHosts.MatchRequest(urlfilter.DNSRequest{
<mask> Hostname: host,
<mask> SortedClientTags: setts.ClientTags,
<mask> // TODO(e.burkov): Wait for urlfilter update to pass net.IP.
<mask> ClientIP: setts.ClientIP.String(),
<mask> ClientName: setts.ClientName,
<mask> DNSType: qtype,
<mask> })
<mask> if dnsres == nil {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove return Result{}, nil
</s> add return res, nil </s> remove return Result{}, nil
</s> add return res, nil </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil </s> remove ";",
ip.String(),
"\n",
"||",
</s> add sc,
ipStr,
nl,
}, {
// PTR.
rules.MaskStartURL, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/filtering.go |
return res, nil | <mask> ClientName: setts.ClientName,
<mask> DNSType: qtype,
<mask> })
<mask> if dnsres == nil {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> dnsr := dnsres.DNSRewrites()
<mask> if len(dnsr) == 0 {
<mask> return Result{}, nil
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil </s> remove // TODO(e.burkov): Wait for urlfilter update to pass net.IP.
</s> add // TODO(e.burkov): Wait for urlfilter update to pass net.IP. </s> remove return Result{}, nil
</s> add return res, nil </s> remove if len(dnsr) == 0 {
return Result{}
}
</s> add </s> remove // DNSRewriteResult set.
</s> add // DNSRewriteResult set. dnsr is expected to be non-empty. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/filtering.go |
if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil | <mask> if dnsres == nil {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> dnsr := dnsres.DNSRewrites()
<mask> if len(dnsr) == 0 {
<mask> return Result{}, nil
<mask> }
<mask>
<mask> var ips []net.IP
<mask> var revHosts []string
<mask> for _, nr := range dnsr {
<mask> if nr.DNSRewrite == nil {
<mask> continue
<mask> }
<mask>
<mask> switch val := nr.DNSRewrite.Value.(type) {
<mask> case net.IP:
<mask> ips = append(ips, val)
<mask> case string:
<mask> revHosts = append(revHosts, val)
<mask> }
<mask> }
<mask>
<mask> return Result{
<mask> Reason: RewrittenAutoHosts,
<mask> IPList: ips,
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove return Result{}, nil
</s> add return res, nil </s> remove return Result{
Reason: RewrittenAutoHosts,
IPList: ips,
ReverseHosts: revHosts,
}, nil
</s> add return res, nil </s> remove return Result{}, nil
</s> add return res, nil </s> remove case res.Reason == filtering.RewrittenRule:
</s> add case res.Reason.In(filtering.RewrittenRule, filtering.RewrittenAutoHosts): </s> remove if len(dnsr) == 0 {
return Result{}
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/filtering.go |
return res, nil | <mask> revHosts = append(revHosts, val)
<mask> }
<mask> }
<mask>
<mask> return Result{
<mask> Reason: RewrittenAutoHosts,
<mask> IPList: ips,
<mask> ReverseHosts: revHosts,
<mask> }, nil
<mask> }
<mask>
<mask> // Process rewrites table
<mask> // . Find CNAME for a domain name (exact match or by wildcard)
<mask> // . if found and CNAME equals to domain name - this is an exception; exit
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil </s> remove // parseHostsFile is a aghtest.FileWalker for parsing the files with hosts
// syntax. It never signs to stop the walking.
</s> add func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rules: &strings.Builder{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never signs to stop walking and never returns any additional patterns. </s> remove // DNSRewriteResult set.
</s> add // DNSRewriteResult set. dnsr is expected to be non-empty. </s> remove if len(dnsr) == 0 {
return Result{}
}
</s> add </s> remove // database.
</s> add // database. err is always nil. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/filtering/filtering.go |
names, ok := v.(*stringutil.Set) | <mask> clients.rmHostsBySrc(ClientSourceHostsFile)
<mask>
<mask> n := 0
<mask> hosts.Range(func(ip net.IP, v interface{}) (cont bool) {
<mask> names, ok := v.([]string)
<mask> if !ok {
<mask> log.Error("dns: bad type %T in ipToRC for %s", v, ip)
<mask> }
<mask>
<mask> for _, name := range names {
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove for _, name := range names {
ok = clients.addHostLocked(ip, name, ClientSourceHostsFile)
if ok {
</s> add names.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) { </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): </s> remove case res.Reason == filtering.RewrittenAutoHosts && len(res.ReverseHosts) != 0:
resp := s.makeResponse(req)
hdr := dns.RR_Header{
Name: q.Name,
Rrtype: dns.TypePTR,
Ttl: s.conf.BlockedResponseTTL,
Class: dns.ClassINET,
}
for _, h := range res.ReverseHosts {
ptr := &dns.PTR{
Hdr: hdr,
Ptr: h,
}
resp.Answer = append(resp.Answer, ptr)
}
d.Res = resp
case res.Reason.In(filtering.Rewritten, filtering.RewrittenAutoHosts):
</s> add case res.Reason == filtering.Rewritten: </s> remove dnsr := dnsres.DNSRewrites()
if len(dnsr) == 0 {
return Result{}, nil
}
var ips []net.IP
var revHosts []string
for _, nr := range dnsr {
if nr.DNSRewrite == nil {
continue
}
switch val := nr.DNSRewrite.Value.(type) {
case net.IP:
ips = append(ips, val)
case string:
revHosts = append(revHosts, val)
}
</s> add if dnsr := dnsres.DNSRewrites(); len(dnsr) > 0 {
// Check DNS rewrites first, because the API there is a bit awkward.
res = d.processDNSRewrites(dnsr)
res.Reason = RewrittenAutoHosts
// TODO(e.burkov): Put real hosts-syntax rules.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3846.
res.Rules = nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/home/clients.go |
names.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) { | <mask> if !ok {
<mask> log.Error("dns: bad type %T in ipToRC for %s", v, ip)
<mask> }
<mask>
<mask> for _, name := range names {
<mask> ok = clients.addHostLocked(ip, name, ClientSourceHostsFile)
<mask> if ok {
<mask> n++
<mask> }
<mask> }
<mask>
<mask> return true
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove names, ok := v.([]string)
</s> add names, ok := v.(*stringutil.Set) </s> remove }
</s> add return true
}) </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): </s> remove case res.Reason == filtering.RewrittenAutoHosts && len(res.ReverseHosts) != 0:
resp := s.makeResponse(req)
hdr := dns.RR_Header{
Name: q.Name,
Rrtype: dns.TypePTR,
Ttl: s.conf.BlockedResponseTTL,
Class: dns.ClassINET,
}
for _, h := range res.ReverseHosts {
ptr := &dns.PTR{
Hdr: hdr,
Ptr: h,
}
resp.Answer = append(resp.Answer, ptr)
}
d.Res = resp
case res.Reason.In(filtering.Rewritten, filtering.RewrittenAutoHosts):
</s> add case res.Reason == filtering.Rewritten: | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/home/clients.go |
return true
}) | <mask> ok = clients.addHostLocked(ip, name, ClientSourceHostsFile)
<mask> if ok {
<mask> n++
<mask> }
<mask> }
<mask>
<mask> return true
<mask> })
<mask>
<mask> log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> Pull request: 3815 fix hosts container rewrites
Merge in DNS/adguard-home from 3815-weird-rewrites to master
Updates #3815.
Squashed commit of the following:
commit d217db9f5632a3fba5a37fc6ac7b90b8d97fe1cf
Merge: 006b67b9 9c8e0875
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 16:08:41 2021 +0300
Merge branch 'master' into 3815-weird-rewrites
commit 006b67b93199f3818396ad782d90aba32da74092
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 15:49:50 2021 +0300
filtering: fix doc
commit 7ffafcedc7275b007977a539bd63ab20a758eecc
Author: Eugene Burkov <[email protected]>
Date: Tue Nov 16 14:17:41 2021 +0300
all: imp hosts container more
commit b60deddec988762c61060cabad1340a37b154dbb
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 19:06:16 2021 +0300
all: log changes
commit 37c76f478e0db90b3840a931d79465eefeea7945
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 18:14:21 2021 +0300
aghnet: imp hosts container
commit 187251c364f6d23ba7166906b5394a0299657b76
Author: Eugene Burkov <[email protected]>
Date: Sun Nov 14 16:16:41 2021 +0300
all: merge hosts container more </s> remove for _, name := range names {
ok = clients.addHostLocked(ip, name, ClientSourceHostsFile)
if ok {
</s> add names.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) { </s> remove hosts, _ := v.([]string)
if ok && stringutil.InSlice(hosts, host) {
</s> add hosts, _ := v.(*stringutil.Set)
switch {
case ok && hosts.Has(host): </s> remove func (hp hostsParser) add(ip net.IP, host string) (added bool) {
</s> add func (hp *hostsParser) add(ip net.IP, host string) (added bool) { </s> remove hp.table.Set(ip, append(hosts, host))
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a4b4715ca3b028c3efc9169f949f9a65bf5364c | internal/home/clients.go |
"github.com/AdguardTeam/AdGuardHome/stats" | <mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/joomcode/errorx"
<mask> "github.com/miekg/dns"
<mask> )
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | dnsforward/dnsforward.go |
stats stats.Stats | <mask> dnsProxy *proxy.Proxy // DNS proxy instance
<mask> dnsFilter *dnsfilter.Dnsfilter // DNS filter instance
<mask> queryLog *queryLog // Query log instance
<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
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove func NewServer(baseDir string) *Server {
</s> add func NewServer(baseDir string, stats stats.Stats) *Server { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | dnsforward/dnsforward.go |
func NewServer(baseDir string, stats stats.Stats) *Server { | <mask>
<mask> // NewServer creates a new instance of the dnsforward.Server
<mask> // baseDir is the base directory for query logs
<mask> // Note: this function must be called only once
<mask> func NewServer(baseDir string) *Server {
<mask> s := &Server{
<mask> queryLog: newQueryLog(baseDir),
<mask> }
<mask>
<mask> log.Printf("Start DNS server periodic jobs")
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove s := NewServer(createDataDir(t))
</s> add s := NewServer(createDataDir(t), nil) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | dnsforward/dnsforward.go |
s.stats = stats | <mask> s := &Server{
<mask> queryLog: newQueryLog(baseDir),
<mask> }
<mask>
<mask> log.Printf("Start DNS server periodic jobs")
<mask> go s.queryLog.periodicQueryLogRotate()
<mask> return s
<mask> }
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove func NewServer(baseDir string) *Server {
</s> add func NewServer(baseDir string, stats stats.Stats) *Server { </s> remove s := NewServer(createDataDir(t))
</s> add s := NewServer(createDataDir(t), nil) </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | dnsforward/dnsforward.go |
elapsed := time.Since(start) | <mask> shouldLog = false
<mask> }
<mask>
<mask> if s.conf.QueryLogEnabled && shouldLog {
<mask> upstreamAddr := ""
<mask> if d.Upstream != nil {
<mask> upstreamAddr = d.Upstream.Address()
<mask> }
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove elapsed := time.Since(start)
</s> add </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | dnsforward/dnsforward.go |
<mask> shouldLog = false
<mask> }
<mask>
<mask> if s.conf.QueryLogEnabled && shouldLog {
<mask> elapsed := time.Since(start)
<mask> upstreamAddr := ""
<mask> if d.Upstream != nil {
<mask> upstreamAddr = d.Upstream.Address()
<mask> }
<mask> _ = s.queryLog.logRequest(msg, d.Res, res, elapsed, d.Addr, upstreamAddr)
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) </s> remove s := NewServer(createDataDir(t))
</s> add s := NewServer(createDataDir(t), nil) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | dnsforward/dnsforward.go |
|
s.updateStats(d, elapsed, *res)
| <mask> }
<mask> _ = s.queryLog.logRequest(msg, d.Res, res, elapsed, d.Addr, upstreamAddr)
<mask> }
<mask>
<mask> return nil
<mask> }
<mask>
<mask> func (s *Server) updateStats(d *proxy.DNSContext, elapsed time.Duration, res dnsfilter.Result) {
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove elapsed := time.Since(start)
</s> add </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | dnsforward/dnsforward.go |
s := NewServer(createDataDir(t), nil) | <mask> }
<mask> }
<mask>
<mask> func createTestServer(t *testing.T) *Server {
<mask> s := NewServer(createDataDir(t))
<mask> s.conf.UDPListenAddr = &net.UDPAddr{Port: 0}
<mask> s.conf.TCPListenAddr = &net.TCPAddr{Port: 0}
<mask>
<mask> s.conf.QueryLogEnabled = true
<mask> s.conf.FilteringConfig.FilteringEnabled = true
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove elapsed := time.Since(start)
</s> add </s> remove func NewServer(baseDir string) *Server {
</s> add func NewServer(baseDir string, stats stats.Stats) *Server { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | dnsforward/dnsforward_test.go |
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf | <mask> github.com/AdguardTeam/dnsproxy v0.19.1
<mask> github.com/AdguardTeam/golibs v0.2.1
<mask> github.com/AdguardTeam/urlfilter v0.5.0
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833
<mask> github.com/etcd-io/bbolt v1.3.3
<mask> github.com/go-test/deep v1.0.1
<mask> github.com/gobuffalo/packr v1.19.0
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | go.mod |
github.com/etcd-io/bbolt v1.3.3 | <mask> github.com/AdguardTeam/urlfilter v0.5.0
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf
<mask> github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833
<mask> github.com/go-test/deep v1.0.1
<mask> github.com/gobuffalo/packr v1.19.0
<mask> github.com/joomcode/errorx v0.8.0
<mask> github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 // indirect
<mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove func NewServer(baseDir string) *Server {
</s> add func NewServer(baseDir string, stats stats.Stats) *Server { | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | go.mod |
go.etcd.io/bbolt v1.3.3 // indirect | <mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414
<mask> github.com/miekg/dns v1.1.8
<mask> github.com/sparrc/go-ping v0.0.0-20181106165434-ef3ab45e41b0
<mask> github.com/stretchr/testify v1.4.0
<mask> golang.org/x/net v0.0.0-20190620200207-3b0461eec859
<mask> golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0
<mask> gopkg.in/yaml.v2 v2.2.2
<mask> )
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477
</s> add </s> remove gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477 h1:5xUJw+lg4zao9W4HIDzlFbMYgSgtvNVHh00MEHvbGpQ=
gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477/go.mod h1:QDV1vrFSrowdoOba0UM8VJPUZONT7dnfdLsM+GG53Z8=
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | go.mod |
<mask> github.com/sparrc/go-ping v0.0.0-20181106165434-ef3ab45e41b0
<mask> github.com/stretchr/testify v1.4.0
<mask> golang.org/x/net v0.0.0-20190620200207-3b0461eec859
<mask> golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0
<mask> gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477
<mask> gopkg.in/yaml.v2 v2.2.2
<mask> )
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477 h1:5xUJw+lg4zao9W4HIDzlFbMYgSgtvNVHh00MEHvbGpQ=
gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477/go.mod h1:QDV1vrFSrowdoOba0UM8VJPUZONT7dnfdLsM+GG53Z8=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | go.mod |
|
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= | <mask> github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
<mask> github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
<mask> github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
<mask> github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
<mask> github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
<mask> github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg=
<mask> github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
<mask> github.com/gobuffalo/envy v1.6.7 h1:XMZGuFqTupAXhZTriQ+qO38QvNOSU/0rl3hEPCFci/4=
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) </s> remove func NewServer(baseDir string) *Server {
</s> add func NewServer(baseDir string, stats stats.Stats) *Server { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | go.sum |
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= | <mask> github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
<mask> github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
<mask> github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
<mask> golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU=
<mask> golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477
</s> add </s> remove func NewServer(baseDir string) *Server {
</s> add func NewServer(baseDir string, stats stats.Stats) *Server { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | go.sum |
<mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
<mask> golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
<mask> golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
<mask> golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
<mask> gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477 h1:5xUJw+lg4zao9W4HIDzlFbMYgSgtvNVHh00MEHvbGpQ=
<mask> gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477/go.mod h1:QDV1vrFSrowdoOba0UM8VJPUZONT7dnfdLsM+GG53Z8=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477
</s> add </s> remove func NewServer(baseDir string) *Server {
</s> add func NewServer(baseDir string, stats stats.Stats) *Server { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | go.sum |
|
"github.com/AdguardTeam/AdGuardHome/stats" | <mask>
<mask> "github.com/AdguardTeam/AdGuardHome/dhcpd"
<mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter"
<mask> "github.com/AdguardTeam/AdGuardHome/dnsforward"
<mask> "github.com/AdguardTeam/golibs/file"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> yaml "gopkg.in/yaml.v2"
<mask> )
<mask>
<mask> const (
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/config.go |
stats stats.Stats | <mask> transport *http.Transport
<mask> client *http.Client
<mask>
<mask> // cached version.json to avoid hammering github.io for each page reload
<mask> versionCheckJSON []byte
<mask> versionCheckLastTime time.Time
<mask>
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove func NewServer(baseDir string) *Server {
</s> add func NewServer(baseDir string, stats stats.Stats) *Server { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/config.go |
"github.com/AdguardTeam/AdGuardHome/stats" | <mask> "encoding/json"
<mask> "net/http"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
<mask>
<mask> type statsConfig struct {
<mask> Interval uint `json:"interval"`
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/control_stats.go |
// Get stats configuration | <mask> }
<mask>
<mask> func handleStatsInfo(w http.ResponseWriter, r *http.Request) {
<mask> resp := statsConfig{}
<mask> resp.Interval = config.DNS.StatsInterval
<mask>
<mask> jsonVal, err := json.Marshal(resp)
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove s := NewServer(createDataDir(t))
</s> add s := NewServer(createDataDir(t), nil) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/control_stats.go |
<mask> Interval uint `json:"interval"`
<mask> }
<mask>
<mask> func handleStatsInfo(w http.ResponseWriter, r *http.Request) {
<mask> log.Tracef("%s %v", r.Method, r.URL)
<mask>
<mask> resp := statsConfig{}
<mask> resp.Interval = config.DNS.StatsInterval
<mask>
<mask> jsonVal, err := json.Marshal(resp)
<mask> if err != nil {
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/control_stats.go |
|
// Set stats configuration | <mask> }
<mask>
<mask> func handleStatsConfig(w http.ResponseWriter, r *http.Request) {
<mask> reqData := statsConfig{}
<mask> err := json.NewDecoder(r.Body).Decode(&reqData)
<mask> if err != nil {
<mask> httpError(w, http.StatusBadRequest, "json decode: %s", err)
<mask> return
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/control_stats.go |
<mask> }
<mask> }
<mask>
<mask> func handleStatsConfig(w http.ResponseWriter, r *http.Request) {
<mask> log.Tracef("%s %v", r.Method, r.URL)
<mask>
<mask> reqData := statsConfig{}
<mask> err := json.NewDecoder(r.Body).Decode(&reqData)
<mask> if err != nil {
<mask> httpError(w, http.StatusBadRequest, "json decode: %s", err)
<mask> return
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/control_stats.go |
|
// RegisterStatsHandlers - register handlers
func RegisterStatsHandlers() {
httpRegister(http.MethodGet, "/control/stats", handleStats)
httpRegister(http.MethodPost, "/control/stats_reset", handleStatsReset)
httpRegister(http.MethodPost, "/control/stats_config", handleStatsConfig)
httpRegister(http.MethodGet, "/control/stats_info", handleStatsInfo) | <mask> }
<mask>
<mask> config.DNS.StatsInterval = reqData.Interval
<mask>
<mask> httpUpdateConfigReloadDNSReturnOK(w, r)
<mask> }
<mask>
<mask> func checkStatsInterval(i uint) bool {
<mask> return i == 1 || i == 7 || i == 30 || i == 90
<mask> }
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/control_stats.go |
"github.com/AdguardTeam/AdGuardHome/stats" | <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter"
<mask> "github.com/AdguardTeam/AdGuardHome/dnsforward"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/joomcode/errorx"
<mask> "github.com/miekg/dns"
</s> + statistics: store in separate file
+ GET /control/stats handler | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/dns.go |
config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) | <mask> if err != nil {
<mask> log.Fatalf("Cannot create DNS data dir at %s: %s", baseDir, err)
<mask> }
<mask>
<mask> config.dnsServer = dnsforward.NewServer(baseDir)
<mask>
<mask> initRDNS()
<mask> }
<mask>
<mask> func isRunning() bool {
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove elapsed := time.Since(start)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/dns.go |
config.stats.Close()
| <mask> return errorx.Decorate(err, "Couldn't stop forwarding DNS server")
<mask> }
<mask>
<mask> return nil
<mask> }
</s> + statistics: store in separate file
+ GET /control/stats handler </s> remove log.Tracef("%s %v", r.Method, r.URL)
</s> add </s> remove config.dnsServer = dnsforward.NewServer(baseDir)
</s> add config.stats = stats.New("./data/stats.db", int(config.DNS.StatsInterval), nil)
if config.stats == nil {
log.Fatal("config.stats == nil")
}
config.dnsServer = dnsforward.NewServer(baseDir, config.stats) | [
"keep",
"keep",
"add",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a58266ba37a0c34ff9b0d22a1c4f5442cef2d4b | home/dns.go |
yobj = map[string]any | <mask>
<mask> // These aliases are provided for convenience.
<mask> type (
<mask> yarr = []any
<mask> yobj = map[any]any
<mask> )
<mask>
<mask> // Performs necessary upgrade operations if needed
<mask> func upgradeConfig() error {
<mask> // read a config file into an interface map, so we can manipulate values without losing any
</s> Pull request: 4846-migration-fix
Updates #4846.
Squashed commit of the following:
commit 22e2e89e5390c7b1486fb69064c55da40fc5c7e7
Author: Ainar Garipov <[email protected]>
Date: Thu Aug 18 16:25:07 2022 +0300
home: fix yaml object type </s> remove case map[any]any:
</s> add case yobj: </s> remove return fmt.Errorf("dns configuration is not a map")
</s> add return fmt.Errorf("unexpected type of dns: %T", dnsConfig) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a7b4d03a1d81062bb6e708b51c42e64ee23618a | internal/home/upgrade.go |
case yobj: | <mask> // Convert any to yobj
<mask> newDNSConfig := make(yobj)
<mask>
<mask> switch v := dnsConfig.(type) {
<mask> case map[any]any:
<mask> for k, v := range v {
<mask> newDNSConfig[fmt.Sprint(k)] = v
<mask> }
<mask> default:
<mask> return fmt.Errorf("dns configuration is not a map")
</s> Pull request: 4846-migration-fix
Updates #4846.
Squashed commit of the following:
commit 22e2e89e5390c7b1486fb69064c55da40fc5c7e7
Author: Ainar Garipov <[email protected]>
Date: Thu Aug 18 16:25:07 2022 +0300
home: fix yaml object type </s> remove return fmt.Errorf("dns configuration is not a map")
</s> add return fmt.Errorf("unexpected type of dns: %T", dnsConfig) </s> remove yobj = map[any]any
</s> add yobj = map[string]any | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a7b4d03a1d81062bb6e708b51c42e64ee23618a | internal/home/upgrade.go |
return fmt.Errorf("unexpected type of dns: %T", dnsConfig) | <mask> for k, v := range v {
<mask> newDNSConfig[fmt.Sprint(k)] = v
<mask> }
<mask> default:
<mask> return fmt.Errorf("dns configuration is not a map")
<mask> }
<mask>
<mask> // Replace bootstrap_dns value filed with new array contains old bootstrap_dns inside
<mask> bootstrapDNS, ok := newDNSConfig["bootstrap_dns"]
<mask> if !ok {
</s> Pull request: 4846-migration-fix
Updates #4846.
Squashed commit of the following:
commit 22e2e89e5390c7b1486fb69064c55da40fc5c7e7
Author: Ainar Garipov <[email protected]>
Date: Thu Aug 18 16:25:07 2022 +0300
home: fix yaml object type </s> remove case map[any]any:
</s> add case yobj: </s> remove yobj = map[any]any
</s> add yobj = map[string]any | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4a7b4d03a1d81062bb6e708b51c42e64ee23618a | internal/home/upgrade.go |
github.com/AdguardTeam/dnsproxy v0.38.2 | <mask>
<mask> go 1.16
<mask>
<mask> require (
<mask> github.com/AdguardTeam/dnsproxy v0.38.0
<mask> github.com/AdguardTeam/golibs v0.8.0
<mask> github.com/AdguardTeam/urlfilter v0.14.6
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/ameshkov/dnscrypt/v2 v2.1.3
<mask> github.com/digineo/go-ipset/v2 v2.2.1
</s> Pull request #1237: all: upd dnsproxy
Updates #3315.
Squashed commit of the following:
commit f91b979b4b9eb8141e7320a54992786a699aa437
Author: Ainar Garipov <[email protected]>
Date: Tue Jul 6 13:48:29 2021 +0300
all: upd dnsproxy </s> remove github.com/AdguardTeam/golibs v0.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
</s> add </s> remove github.com/AdguardTeam/dnsproxy v0.38.0 h1:7GyyNJOieIVOgdnhu47exqWjHPQro7wQhqzvQjaZt6M=
github.com/AdguardTeam/dnsproxy v0.38.0/go.mod h1:xMfevPAwpK1ULoLO0CARg/OiUsPH92kfyliXhPTc62M=
</s> add github.com/AdguardTeam/dnsproxy v0.38.2 h1:QHxvShAm4GwH0PyRN60xf18+5nAzmbvhPoEvhfVycSA=
github.com/AdguardTeam/dnsproxy v0.38.2/go.mod h1:aNXKNdTyKfgAG2OS712SYSaGIM9AasZsZxfiY4YiR/0= | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4b5a66ee617cc364c26a3d4293ae4dba378c3f26 | go.mod |
github.com/AdguardTeam/dnsproxy v0.38.2 h1:QHxvShAm4GwH0PyRN60xf18+5nAzmbvhPoEvhfVycSA=
github.com/AdguardTeam/dnsproxy v0.38.2/go.mod h1:aNXKNdTyKfgAG2OS712SYSaGIM9AasZsZxfiY4YiR/0= | <mask> dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
<mask> git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
<mask> github.com/AdguardTeam/dhcp v0.0.0-20210519141215-51808c73c0bf h1:gc042VRSIRSUzZ+Px6xQCRWNJZTaPkomisDfUZmoFNk=
<mask> github.com/AdguardTeam/dhcp v0.0.0-20210519141215-51808c73c0bf/go.mod h1:TKl4jN3Voofo4UJIicyNhWGp/nlQqQkFxmwIFTvBkKI=
<mask> github.com/AdguardTeam/dnsproxy v0.38.0 h1:7GyyNJOieIVOgdnhu47exqWjHPQro7wQhqzvQjaZt6M=
<mask> github.com/AdguardTeam/dnsproxy v0.38.0/go.mod h1:xMfevPAwpK1ULoLO0CARg/OiUsPH92kfyliXhPTc62M=
<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.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/golibs v0.8.0 h1:rHo+yIgT2fivFG0yW2Cwk/DPc2+t/Aw6QvzPpiIFre0=
<mask> github.com/AdguardTeam/golibs v0.8.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
</s> Pull request #1237: all: upd dnsproxy
Updates #3315.
Squashed commit of the following:
commit f91b979b4b9eb8141e7320a54992786a699aa437
Author: Ainar Garipov <[email protected]>
Date: Tue Jul 6 13:48:29 2021 +0300
all: upd dnsproxy </s> remove github.com/AdguardTeam/golibs v0.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
</s> add </s> remove github.com/AdguardTeam/dnsproxy v0.38.0
</s> add github.com/AdguardTeam/dnsproxy v0.38.2 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4b5a66ee617cc364c26a3d4293ae4dba378c3f26 | go.sum |
<mask> github.com/AdguardTeam/dnsproxy v0.38.0 h1:7GyyNJOieIVOgdnhu47exqWjHPQro7wQhqzvQjaZt6M=
<mask> github.com/AdguardTeam/dnsproxy v0.38.0/go.mod h1:xMfevPAwpK1ULoLO0CARg/OiUsPH92kfyliXhPTc62M=
<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.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/golibs v0.8.0 h1:rHo+yIgT2fivFG0yW2Cwk/DPc2+t/Aw6QvzPpiIFre0=
<mask> github.com/AdguardTeam/golibs v0.8.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
<mask> github.com/AdguardTeam/urlfilter v0.14.6 h1:emqoKZElooHACYehRBYENeKVN1a/rspxiqTIMYLuoIo=
<mask> github.com/AdguardTeam/urlfilter v0.14.6/go.mod h1:klx4JbOfc4EaNb5lWLqOwfg+pVcyRukmoJRvO55lL5U=
</s> Pull request #1237: all: upd dnsproxy
Updates #3315.
Squashed commit of the following:
commit f91b979b4b9eb8141e7320a54992786a699aa437
Author: Ainar Garipov <[email protected]>
Date: Tue Jul 6 13:48:29 2021 +0300
all: upd dnsproxy </s> remove github.com/AdguardTeam/dnsproxy v0.38.0 h1:7GyyNJOieIVOgdnhu47exqWjHPQro7wQhqzvQjaZt6M=
github.com/AdguardTeam/dnsproxy v0.38.0/go.mod h1:xMfevPAwpK1ULoLO0CARg/OiUsPH92kfyliXhPTc62M=
</s> add github.com/AdguardTeam/dnsproxy v0.38.2 h1:QHxvShAm4GwH0PyRN60xf18+5nAzmbvhPoEvhfVycSA=
github.com/AdguardTeam/dnsproxy v0.38.2/go.mod h1:aNXKNdTyKfgAG2OS712SYSaGIM9AasZsZxfiY4YiR/0= </s> remove github.com/AdguardTeam/dnsproxy v0.38.0
</s> add github.com/AdguardTeam/dnsproxy v0.38.2 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4b5a66ee617cc364c26a3d4293ae4dba378c3f26 | go.sum |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.