docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
"adg_will_drop_dns_queries": "AdGuard Home will be dropping all DNS queries from this client.", "configured_in": "Configured in {{path}}", "please_read_wiki": "Please read the wiki"
<mask> "setup_config_to_enable_dhcp_server": "Setup config to enable DHCP server", <mask> "original_response": "Original response", <mask> "click_to_view_queries": "Click to view queries", <mask> "port_53_faq_link": "Port 53 is often occupied by \"DNSStubListener\" or \"systemd-resolved\" services. Please read <0>this instruction</0> on how to resolve this.", <mask> "adg_will_drop_dns_queries": "AdGuard Home will be dropping all DNS queries from this client." <mask> } </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove import { DNS_REQUEST_OPTIONS, FORM_NAME } from '../../../../helpers/constants'; </s> add import { DNS_REQUEST_OPTIONS, FORM_NAME, UPSTREAM_CONFIGURATION_WIKI_LINK } from '../../../../helpers/constants'; </s> remove const getInputFields = () => [{ // eslint-disable-next-line react/display-name getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <Trans>upstream_dns</Trans> </label>, name: 'upstream_dns', type: 'text', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }]; </s> add const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ];
[ "keep", "keep", "keep", "keep", "replace", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/__locales/en.json
import i18next from 'i18next';
<mask> import classnames from 'classnames'; <mask> <mask> import Examples from './Examples'; <mask> import { renderRadioField, renderTextareaField } from '../../../../helpers/form'; <mask> import { DNS_REQUEST_OPTIONS, FORM_NAME, UPSTREAM_CONFIGURATION_WIKI_LINK } from '../../../../helpers/constants'; <mask> import { testUpstream } from '../../../../actions'; </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove import { DNS_REQUEST_OPTIONS, FORM_NAME } from '../../../../helpers/constants'; </s> add import { DNS_REQUEST_OPTIONS, FORM_NAME, UPSTREAM_CONFIGURATION_WIKI_LINK } from '../../../../helpers/constants'; </s> remove const getInputFields = () => [{ // eslint-disable-next-line react/display-name getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <Trans>upstream_dns</Trans> </label>, name: 'upstream_dns', type: 'text', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }]; </s> add const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ]; </s> remove "adg_will_drop_dns_queries": "AdGuard Home will be dropping all DNS queries from this client." </s> add "adg_will_drop_dns_queries": "AdGuard Home will be dropping all DNS queries from this client.", "configured_in": "Configured in {{path}}", "please_read_wiki": "Please read the wiki" </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove processingSetConfig, </s> add
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/Form.js
import { DNS_REQUEST_OPTIONS, FORM_NAME, UPSTREAM_CONFIGURATION_WIKI_LINK } from '../../../../helpers/constants';
<mask> import classnames from 'classnames'; <mask> <mask> import Examples from './Examples'; <mask> import { renderRadioField, renderTextareaField } from '../../../../helpers/form'; <mask> import { DNS_REQUEST_OPTIONS, FORM_NAME } from '../../../../helpers/constants'; <mask> import { testUpstream } from '../../../../actions'; <mask> import { removeEmptyLines } from '../../../../helpers/helpers'; <mask> <mask> const getInputFields = () => [{ <mask> // eslint-disable-next-line react/display-name </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove const getInputFields = () => [{ // eslint-disable-next-line react/display-name getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <Trans>upstream_dns</Trans> </label>, name: 'upstream_dns', type: 'text', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }]; </s> add const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ]; </s> remove "adg_will_drop_dns_queries": "AdGuard Home will be dropping all DNS queries from this client." </s> add "adg_will_drop_dns_queries": "AdGuard Home will be dropping all DNS queries from this client.", "configured_in": "Configured in {{path}}", "please_read_wiki": "Please read the wiki" </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove processingSetConfig, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/Form.js
const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ];
<mask> import { DNS_REQUEST_OPTIONS, FORM_NAME } from '../../../../helpers/constants'; <mask> import { testUpstream } from '../../../../actions'; <mask> import { removeEmptyLines } from '../../../../helpers/helpers'; <mask> <mask> const getInputFields = () => [{ <mask> // eslint-disable-next-line react/display-name <mask> getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <mask> <Trans>upstream_dns</Trans> <mask> </label>, <mask> name: 'upstream_dns', <mask> type: 'text', <mask> component: renderTextareaField, <mask> className: 'form-control form-control--textarea font-monospace', <mask> placeholder: 'upstream_dns', <mask> normalizeOnBlur: removeEmptyLines, <mask> }, <mask> { <mask> name: 'upstream_mode', <mask> type: 'radio', <mask> value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, <mask> component: renderRadioField, <mask> subtitle: 'load_balancing_desc', <mask> placeholder: 'load_balancing', <mask> }, <mask> { <mask> name: 'upstream_mode', <mask> type: 'radio', <mask> value: DNS_REQUEST_OPTIONS.PARALLEL, <mask> component: renderRadioField, <mask> subtitle: 'upstream_parallel', <mask> placeholder: 'parallel_requests', <mask> }, <mask> { <mask> name: 'upstream_mode', <mask> type: 'radio', <mask> value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, <mask> component: renderRadioField, <mask> subtitle: 'fastest_addr_desc', <mask> placeholder: 'fastest_addr', <mask> }]; <mask> <mask> const Form = ({ <mask> submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, <mask> }) => { <mask> const dispatch = useDispatch(); </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove import { DNS_REQUEST_OPTIONS, FORM_NAME } from '../../../../helpers/constants'; </s> add import { DNS_REQUEST_OPTIONS, FORM_NAME, UPSTREAM_CONFIGURATION_WIKI_LINK } from '../../../../helpers/constants'; </s> remove submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, </s> add submitting, invalid, handleSubmit, </s> remove processingSetConfig, </s> add </s> remove const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); </s> add const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/Form.js
submitting, invalid, handleSubmit,
<mask> placeholder: 'fastest_addr', <mask> }]; <mask> <mask> const Form = ({ <mask> submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, <mask> }) => { <mask> const dispatch = useDispatch(); <mask> const { t } = useTranslation(); <mask> const upstream_dns = useSelector((store) => store.form[FORM_NAME.UPSTREAM].values.upstream_dns); <mask> const bootstrap_dns = useSelector( </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove const getInputFields = () => [{ // eslint-disable-next-line react/display-name getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <Trans>upstream_dns</Trans> </label>, name: 'upstream_dns', type: 'text', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }]; </s> add const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ]; </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove processingSetConfig, </s> add </s> remove const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); </s> add const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/Form.js
const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file); const processingTestUpstream = useSelector((state) => state.settings.processingTestUpstream); const processingSetConfig = useSelector((state) => state.dnsConfig.processingSetConfig);
<mask> const bootstrap_dns = useSelector( <mask> (store) => store.form[FORM_NAME.UPSTREAM].values.bootstrap_dns, <mask> ); <mask> <mask> const handleUpstreamTest = () => dispatch(testUpstream({ <mask> upstream_dns, <mask> bootstrap_dns, </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, </s> add submitting, invalid, handleSubmit, </s> remove processingSetConfig, </s> add </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); </s> add const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file);
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/Form.js
const INPUT_FIELDS = getInputFields(upstream_dns_file);
<mask> const testButtonClass = classnames('btn btn-primary btn-standard mr-2', { <mask> 'btn-loading': processingTestUpstream, <mask> }); <mask> <mask> const INPUT_FIELDS = getInputFields(); <mask> <mask> return <form onSubmit={handleSubmit}> <mask> <div className="row"> <mask> {INPUT_FIELDS.map(({ <mask> name, component, type, className, placeholder, </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, </s> add submitting, invalid, handleSubmit, </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove upstream_dns, </s> add upstream_dns: upstreamDns, </s> remove processingSetConfig, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/Form.js
<mask> invalid: PropTypes.bool, <mask> initialValues: PropTypes.object, <mask> upstream_dns: PropTypes.string, <mask> bootstrap_dns: PropTypes.string, <mask> processingTestUpstream: PropTypes.bool, <mask> processingSetConfig: PropTypes.bool, <mask> }; <mask> <mask> export default reduxForm({ form: FORM_NAME.UPSTREAM })(Form); </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove upstream_dns, </s> add upstream_dns: upstreamDns, </s> remove processingTestUpstream={processingTestUpstream} processingSetConfig={processingSetConfig} </s> add </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig));
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/Form.js
<mask> const { <mask> upstream_dns, <mask> bootstrap_dns, <mask> upstream_mode, <mask> processingSetConfig, <mask> } = useSelector((state) => state.dnsConfig, shallowEqual); <mask> <mask> const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); <mask> <mask> const handleSubmit = (values) => { </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); </s> add const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file); </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, </s> add submitting, invalid, handleSubmit, </s> remove const getInputFields = () => [{ // eslint-disable-next-line react/display-name getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <Trans>upstream_dns</Trans> </label>, name: 'upstream_dns', type: 'text', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }]; </s> add const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ];
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/index.js
const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file);
<mask> upstream_mode, <mask> processingSetConfig, <mask> } = useSelector((state) => state.dnsConfig, shallowEqual); <mask> <mask> const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); <mask> <mask> const handleSubmit = (values) => { <mask> dispatch(setDnsConfig(values)); <mask> }; <mask> </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove processingSetConfig, </s> add </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, </s> add submitting, invalid, handleSubmit, </s> remove const getInputFields = () => [{ // eslint-disable-next-line react/display-name getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <Trans>upstream_dns</Trans> </label>, name: 'upstream_dns', type: 'text', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }]; </s> add const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ];
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/index.js
const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig));
<mask> <mask> const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); <mask> <mask> const handleSubmit = (values) => { <mask> dispatch(setDnsConfig(values)); <mask> }; <mask> <mask> return <Card <mask> title={t('upstream_dns')} <mask> subtitle={t('upstream_dns_hint')} </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); </s> add const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file); </s> remove processingSetConfig, </s> add </s> remove const INPUT_FIELDS = getInputFields(); </s> add const INPUT_FIELDS = getInputFields(upstream_dns_file);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/index.js
const upstreamDns = upstream_dns_file ? t('configured_in', { path: upstream_dns_file }) : upstream_dns;
<mask> dispatch(setDnsConfig(dnsConfig)); <mask> }; <mask> <mask> return <Card <mask> title={t('upstream_dns')} <mask> subtitle={t('upstream_dns_hint')} <mask> bodyType="card-body box-body--settings" </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove const INPUT_FIELDS = getInputFields(); </s> add const INPUT_FIELDS = getInputFields(upstream_dns_file); </s> remove processingTestUpstream={processingTestUpstream} processingSetConfig={processingSetConfig} </s> add </s> remove processingTestUpstream: PropTypes.bool, processingSetConfig: PropTypes.bool, </s> add </s> remove const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); </s> add const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file);
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/index.js
upstream_dns: upstreamDns,
<mask> <div className="row"> <mask> <div className="col"> <mask> <Form <mask> initialValues={{ <mask> upstream_dns, <mask> bootstrap_dns, <mask> upstream_mode, <mask> }} <mask> onSubmit={handleSubmit} <mask> processingTestUpstream={processingTestUpstream} </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove processingTestUpstream={processingTestUpstream} processingSetConfig={processingSetConfig} </s> add </s> remove const INPUT_FIELDS = getInputFields(); </s> add const INPUT_FIELDS = getInputFields(upstream_dns_file); </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove processingSetConfig, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/index.js
<mask> bootstrap_dns, <mask> upstream_mode, <mask> }} <mask> onSubmit={handleSubmit} <mask> processingTestUpstream={processingTestUpstream} <mask> processingSetConfig={processingSetConfig} <mask> /> <mask> </div> <mask> </div> <mask> </Card>; <mask> }; </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove upstream_dns, </s> add upstream_dns: upstreamDns, </s> remove dispatch(setDnsConfig(values)); </s> add const { bootstrap_dns, upstream_dns, upstream_mode, } = values; const dnsConfig = { bootstrap_dns, upstream_mode, ...(upstream_dns_file ? null : { upstream_dns }), }; dispatch(setDnsConfig(dnsConfig)); </s> remove processingSetConfig, </s> add </s> remove const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); </s> add const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file); </s> remove const getInputFields = () => [{ // eslint-disable-next-line react/display-name getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <Trans>upstream_dns</Trans> </label>, name: 'upstream_dns', type: 'text', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }]; </s> add const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ];
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/components/Settings/Dns/Upstream/index.js
export const UPSTREAM_CONFIGURATION_WIKI_LINK = 'https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#upstreams';
<mask> <mask> export const PRIVACY_POLICY_LINK = 'https://adguard.com/privacy/home.html'; <mask> export const PORT_53_FAQ_LINK = 'https://github.com/AdguardTeam/AdGuardHome/wiki/FAQ#bindinuse'; <mask> <mask> export const ADDRESS_IN_USE_TEXT = 'address already in use'; <mask> <mask> export const INSTALL_FIRST_STEP = 1; <mask> export const INSTALL_TOTAL_STEPS = 5; </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, </s> add submitting, invalid, handleSubmit, </s> remove const { processingTestUpstream } = useSelector((state) => state.settings, shallowEqual); </s> add const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file); </s> remove processingSetConfig, </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/helpers/constants.js
upstream_dns_file: '',
<mask> disable_ipv6: false, <mask> dnssec_enabled: false, <mask> }, <mask> ); <mask> <mask> export default dnsConfig; </s> + client: Display upstreams list loaded from a file Squashed commit of the following: commit b5abc9115806f345c8d0dd5ea00b8552d27813f9 Merge: 92708411 c1c8abdd Author: ArtemBaskal <a.baskal@adguard.com> Date: Mon Sep 7 14:38:06 2020 +0300 Merge branch '1680-upstreams-file' into feature/1680 commit 92708411f07638c037e049ee8012d15bdeda77e4 Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Sep 4 13:54:24 2020 +0300 + client: Display upstreams list loaded from a file </s> remove processingTestUpstream: PropTypes.bool, processingSetConfig: PropTypes.bool, </s> add </s> remove const getInputFields = () => [{ // eslint-disable-next-line react/display-name getTitle: () => <label className="form__label" htmlFor="upstream_dns"> <Trans>upstream_dns</Trans> </label>, name: 'upstream_dns', type: 'text', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }]; </s> add const Title = () => <label className="form__label" htmlFor="upstream_dns"> {i18next.t('upstream_dns')} <div> <a href={UPSTREAM_CONFIGURATION_WIKI_LINK} target="_blank" rel="noopener noreferrer">{i18next.t('please_read_wiki')}</a> </div> </label>; const getInputFields = (upstream_dns_file) => [ { getTitle: Title, name: 'upstream_dns', type: 'text', value: 'test', component: renderTextareaField, className: 'form-control form-control--textarea font-monospace', placeholder: 'upstream_dns', normalizeOnBlur: removeEmptyLines, disabled: !!upstream_dns_file, }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.LOAD_BALANCING, component: renderRadioField, subtitle: 'load_balancing_desc', placeholder: 'load_balancing', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.PARALLEL, component: renderRadioField, subtitle: 'upstream_parallel', placeholder: 'parallel_requests', }, { name: 'upstream_mode', type: 'radio', value: DNS_REQUEST_OPTIONS.FASTEST_ADDR, component: renderRadioField, subtitle: 'fastest_addr_desc', placeholder: 'fastest_addr', }, ]; </s> remove processingTestUpstream={processingTestUpstream} processingSetConfig={processingSetConfig} </s> add
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b04e12e189b5949cdc8f60aede950dedf574d839
client/src/reducers/dnsConfig.js
// Allows printable UTF-8 text with CR, LF, TAB characters func isPrintableText(data []byte) bool { for _, c := range data { if (c >= ' ' && c != 0x7f) || c == '\n' || c == '\r' || c == '\t' { continue } return false } return true }
<mask> } <mask> <mask> // A helper function that parses filter contents and returns a number of rules and a filter name (if there's any) <mask> func parseFilterContents(contents []byte) (int, string) { <mask> lines := strings.Split(string(contents), "\n") <mask> rulesCount := 0 <mask> name := "" </s> * filter update: ensure filter data is text (but not html) stop checking Content-Type HTTP header </s> remove contentType := strings.ToLower(resp.Header.Get("content-type")) if !strings.HasPrefix(contentType, "text/plain") { log.Printf("Non-text response %s from %s, skipping", contentType, filter.URL) return false, fmt.Errorf("non-text response %s", contentType) } </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b078b82a89940bd96c7e9157c2f5c758224a72ae
home/filter.go
<mask> log.Printf("Got status code %d from URL %s, skipping", resp.StatusCode, filter.URL) <mask> return false, fmt.Errorf("got status code != 200: %d", resp.StatusCode) <mask> } <mask> <mask> contentType := strings.ToLower(resp.Header.Get("content-type")) <mask> if !strings.HasPrefix(contentType, "text/plain") { <mask> log.Printf("Non-text response %s from %s, skipping", contentType, filter.URL) <mask> return false, fmt.Errorf("non-text response %s", contentType) <mask> } <mask> <mask> body, err := ioutil.ReadAll(resp.Body) <mask> if err != nil { <mask> log.Printf("Couldn't fetch filter contents from URL %s, skipping: %s", filter.URL, err) <mask> return false, err <mask> } </s> * filter update: ensure filter data is text (but not html) stop checking Content-Type HTTP header
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b078b82a89940bd96c7e9157c2f5c758224a72ae
home/filter.go
if !isPrintableText(body[:4096]) { return false, fmt.Errorf("Data contains non-printable characters") } s := strings.ToLower(string(body[:4096])) if strings.Index(s, "<html") >= 0 || strings.Index(s, "<!doctype") >= 0 { return false, fmt.Errorf("Data is HTML, not plain text") }
<mask> return false, nil <mask> } <mask> <mask> // Extract filter name and count number of rules <mask> rulesCount, filterName := parseFilterContents(body) <mask> log.Printf("Filter %d has been updated: %d bytes, %d rules", filter.ID, len(body), rulesCount) <mask> if filterName != "" { <mask> filter.Name = filterName </s> * filter update: ensure filter data is text (but not html) stop checking Content-Type HTTP header </s> remove contentType := strings.ToLower(resp.Header.Get("content-type")) if !strings.HasPrefix(contentType, "text/plain") { log.Printf("Non-text response %s from %s, skipping", contentType, filter.URL) return false, fmt.Errorf("non-text response %s", contentType) } </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b078b82a89940bd96c7e9157c2f5c758224a72ae
home/filter.go
"copy-webpack-plugin": "^4.6.0",
<mask> "babel-preset-stage-2": "^6.24.1", <mask> "babel-runtime": "6.26.0", <mask> "clean-webpack-plugin": "^0.1.19", <mask> "compression-webpack-plugin": "^1.1.11", <mask> "css-loader": "^0.28.11", <mask> "eslint": "^4.19.1", <mask> "eslint-config-airbnb-base": "^12.1.0", <mask> "eslint-config-react-app": "^2.1.0", <mask> "eslint-loader": "1.9.0", </s> - client: load favicon from local server Closes #625
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b1f707d18cf6ce63fe1ed56efbd18d4f614d0543
client/package.json
const CopyPlugin = require('copy-webpack-plugin');
<mask> const flexBugsFixes = require('postcss-flexbugs-fixes'); <mask> const CleanWebpackPlugin = require('clean-webpack-plugin'); <mask> <mask> const RESOURCES_PATH = path.resolve(__dirname); <mask> const ENTRY_REACT = path.resolve(RESOURCES_PATH, 'src/index.js'); <mask> const ENTRY_INSTALL = path.resolve(RESOURCES_PATH, 'src/install/index.js'); </s> - client: load favicon from local server Closes #625
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b1f707d18cf6ce63fe1ed56efbd18d4f614d0543
client/webpack.common.js
const FAVICON_PATH = path.resolve(RESOURCES_PATH, 'public/favicon.ico');
<mask> const ENTRY_INSTALL = path.resolve(RESOURCES_PATH, 'src/install/index.js'); <mask> const HTML_PATH = path.resolve(RESOURCES_PATH, 'public/index.html'); <mask> const HTML_INSTALL_PATH = path.resolve(RESOURCES_PATH, 'public/install.html'); <mask> <mask> const PUBLIC_PATH = path.resolve(__dirname, '../build/static'); <mask> <mask> const config = { <mask> target: 'web', <mask> context: RESOURCES_PATH, </s> - client: load favicon from local server Closes #625
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b1f707d18cf6ce63fe1ed56efbd18d4f614d0543
client/webpack.common.js
new CopyPlugin([ { from: FAVICON_PATH, to: PUBLIC_PATH }, ]),
<mask> new ExtractTextPlugin({ <mask> filename: '[name].[contenthash].css', <mask> }), <mask> ], <mask> }; <mask> <mask> module.exports = config; </s> - client: load favicon from local server Closes #625
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b1f707d18cf6ce63fe1ed56efbd18d4f614d0543
client/webpack.common.js
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86
<mask> github.com/google/renameio v1.0.1 <mask> github.com/google/uuid v1.3.0 <mask> github.com/insomniacslk/dhcp v0.0.0-20221215072855-de60144f33f8 <mask> github.com/kardianos/service v1.2.2 <mask> github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 <mask> github.com/mdlayher/netlink v1.7.1 <mask> github.com/mdlayher/packet v1.1.1 <mask> github.com/miekg/dns v1.1.53 </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= </s> add github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 h1:elKwZS1OcdQ0WwEDBeqxKwb7WB62QX8bvZ/FJnVXIfk= github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86/go.mod h1:aFAMtuldEgx/4q7iSGazk22+IcgvtiC+HIimFO9XlS8= </s> remove github.com/josharian/native v1.1.0 // indirect </s> add </s> remove aghos.NativeEndian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> add native.Endian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> remove aghos.NativeEndian.PutUint32(data, 1) </s> add native.Endian.PutUint32(data, 1) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native"
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
go.mod
golang.org/x/sys v0.7.0
<mask> go.etcd.io/bbolt v1.3.7 <mask> golang.org/x/crypto v0.7.0 <mask> golang.org/x/exp v0.0.0-20230321023759-10a507213a29 <mask> golang.org/x/net v0.8.0 <mask> golang.org/x/sys v0.6.0 <mask> gopkg.in/natefinch/lumberjack.v2 v2.2.1 <mask> gopkg.in/yaml.v3 v3.0.1 <mask> howett.net/plist v1.0.0 <mask> ) <mask> </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> add golang.org/x/sys v0.4.1-0.20230131160137-e7d7f63158de/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add </s> remove aghos.NativeEndian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> add native.Endian.PutUint32(data, uint32(time.Now().UTC().Unix()+60))
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
go.mod
<mask> github.com/davecgh/go-spew v1.1.1 // indirect <mask> github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect <mask> github.com/golang/mock v1.6.0 // indirect <mask> github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect <mask> github.com/josharian/native v1.1.0 // indirect <mask> github.com/mdlayher/raw v0.1.0 // indirect <mask> github.com/mdlayher/socket v0.4.0 // indirect <mask> github.com/onsi/ginkgo/v2 v2.9.2 // indirect <mask> github.com/patrickmn/go-cache v2.1.0+incompatible // indirect <mask> github.com/pierrec/lz4/v4 v4.1.17 // indirect </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add </s> remove github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= </s> add github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 h1:elKwZS1OcdQ0WwEDBeqxKwb7WB62QX8bvZ/FJnVXIfk= github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86/go.mod h1:aFAMtuldEgx/4q7iSGazk22+IcgvtiC+HIimFO9XlS8= </s> remove aghos.NativeEndian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> add native.Endian.PutUint32(data, uint32(time.Now().UTC().Unix()+60))
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
go.mod
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 h1:elKwZS1OcdQ0WwEDBeqxKwb7WB62QX8bvZ/FJnVXIfk= github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86/go.mod h1:aFAMtuldEgx/4q7iSGazk22+IcgvtiC+HIimFO9XlS8=
<mask> github.com/insomniacslk/dhcp v0.0.0-20221215072855-de60144f33f8/go.mod h1:m5WMe03WCvWcXjRnhvaAbAAXdCnu20J5P+mmH44ZzpE= <mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= <mask> github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= <mask> github.com/josharian/native v1.0.1-0.20221213033349-c1e37c09b531/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= <mask> github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= <mask> github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= <mask> github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= <mask> github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= <mask> github.com/jsimonetti/rtnetlink v0.0.0-20201009170750-9c6f07d100c1/go.mod h1:hqoO/u39cqLeBLebZ8fWdE96O7FxrAsRYhnVOdgHxok= <mask> github.com/jsimonetti/rtnetlink v0.0.0-20201110080708-d2c240429e6c/go.mod h1:huN4d1phzjhlOsNIjFsw2SVRbwIHj3fJDMEU2SDPTmg= <mask> github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove github.com/josharian/native v1.1.0 // indirect </s> add </s> remove aghos.NativeEndian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> add native.Endian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> remove aghos.NativeEndian.PutUint32(data, 1) </s> add native.Endian.PutUint32(data, 1) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native"
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
go.sum
golang.org/x/sys v0.4.1-0.20230131160137-e7d7f63158de/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
<mask> golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= <mask> golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= <mask> golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= <mask> golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= <mask> golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= <mask> golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= <mask> golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= <mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= <mask> golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= <mask> golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= <mask> golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove golang.org/x/sys v0.6.0 </s> add golang.org/x/sys v0.7.0 </s> remove aghos.NativeEndian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> add native.Endian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> remove aghos.NativeEndian.PutUint32(data, 1) </s> add native.Endian.PutUint32(data, 1) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native" </s> remove err = binary.Read(buf, aghos.NativeEndian, &dateToken) </s> add err = binary.Read(buf, native.Endian, &dateToken)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
go.sum
<mask> "os" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghio" <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos" <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> // GLMode - enable GL-Inet compatibility mode <mask> var GLMode bool </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native" </s> remove github.com/josharian/native v1.1.0 // indirect </s> add </s> remove aghos.NativeEndian.PutUint32(data, 1) </s> add native.Endian.PutUint32(data, 1) </s> remove golang.org/x/sys v0.6.0 </s> add golang.org/x/sys v0.7.0
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
internal/home/authglinet.go
"github.com/josharian/native"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghio" <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> // GLMode - enable GL-Inet compatibility mode <mask> var GLMode bool <mask> </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add </s> remove github.com/josharian/native v1.1.0 // indirect </s> add </s> remove aghos.NativeEndian.PutUint32(data, 1) </s> add native.Endian.PutUint32(data, 1) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native" </s> remove golang.org/x/sys v0.6.0 </s> add golang.org/x/sys v0.7.0
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
internal/home/authglinet.go
err = binary.Read(buf, native.Endian, &dateToken)
<mask> } <mask> <mask> buf := bytes.NewBuffer(bs) <mask> <mask> err = binary.Read(buf, aghos.NativeEndian, &dateToken) <mask> if err != nil { <mask> log.Error("decoding token: %s", err) <mask> <mask> return 0 <mask> } </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove aghos.NativeEndian.PutUint32(data, 1) </s> add native.Endian.PutUint32(data, 1) </s> remove aghos.NativeEndian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> add native.Endian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
internal/home/authglinet.go
"github.com/josharian/native"
<mask> "os" <mask> "testing" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestAuthGL(t *testing.T) { </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add </s> remove err = binary.Read(buf, aghos.NativeEndian, &dateToken) </s> add err = binary.Read(buf, native.Endian, &dateToken) </s> remove aghos.NativeEndian.PutUint32(data, 1) </s> add native.Endian.PutUint32(data, 1) </s> remove golang.org/x/sys v0.6.0 </s> add golang.org/x/sys v0.7.0
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
internal/home/authglinet_test.go
native.Endian.PutUint32(data, 1)
<mask> t.Cleanup(func() { GLMode = false }) <mask> glFilePrefix = dir + "/gl_token_" <mask> <mask> data := make([]byte, 4) <mask> aghos.NativeEndian.PutUint32(data, 1) <mask> <mask> require.NoError(t, os.WriteFile(glFilePrefix+"test", data, 0o644)) <mask> assert.False(t, glCheckToken("test")) <mask> <mask> data = make([]byte, 4) </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove aghos.NativeEndian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> add native.Endian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) </s> remove err = binary.Read(buf, aghos.NativeEndian, &dateToken) </s> add err = binary.Read(buf, native.Endian, &dateToken) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native"
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
internal/home/authglinet_test.go
native.Endian.PutUint32(data, uint32(time.Now().UTC().Unix()+60))
<mask> require.NoError(t, os.WriteFile(glFilePrefix+"test", data, 0o644)) <mask> assert.False(t, glCheckToken("test")) <mask> <mask> data = make([]byte, 4) <mask> aghos.NativeEndian.PutUint32(data, uint32(time.Now().UTC().Unix()+60)) <mask> <mask> require.NoError(t, os.WriteFile(glFilePrefix+"test", data, 0o644)) <mask> r, _ := http.NewRequest(http.MethodGet, "http://localhost/", nil) <mask> r.AddCookie(&http.Cookie{Name: glCookieName, Value: "test"}) <mask> assert.True(t, glProcessCookie(r)) </s> Pull request 1816: 5704-rm-endian Updates #5704. Squashed commit of the following: commit 927faf8c3ae0a5deea651ea4249a90ffc80a21c9 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 11 20:02:52 2023 +0300 all: rm our copy of endian </s> remove aghos.NativeEndian.PutUint32(data, 1) </s> add native.Endian.PutUint32(data, 1) </s> remove err = binary.Read(buf, aghos.NativeEndian, &dateToken) </s> add err = binary.Read(buf, native.Endian, &dateToken) </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add "github.com/josharian/native" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b23ea0a690e8f5b892e34ac38111efae732e77d3
internal/home/authglinet_test.go
github.com/AdguardTeam/golibs v0.5.0
<mask> go 1.15 <mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.37.4 <mask> github.com/AdguardTeam/golibs v0.4.5 <mask> github.com/AdguardTeam/urlfilter v0.14.5 <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 <mask> github.com/fsnotify/fsnotify v1.4.9 </s> Pull request: all: add us to logs Merge in DNS/adguard-home from imp-logs to master Squashed commit of the following: commit b463825196625f59b19977920f828f57e4b87f0d Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue May 18 14:08:24 2021 +0300 all: add us to logs </s> remove github.com/AdguardTeam/golibs v0.4.5 h1:RRA9ZsmbJEN4OllAx0BcfvSbRBxxpWluJijBYmtp13U= github.com/AdguardTeam/golibs v0.4.5/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= </s> add github.com/AdguardTeam/golibs v0.5.0 h1:qwhEKjDrT0UcwDnHrNU2Yg/DLR9b/GsUncnXYW6VzAU= github.com/AdguardTeam/golibs v0.5.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b2e3e4d0886c58dddad2251e9352d704043d3910
go.mod
github.com/AdguardTeam/golibs v0.5.0 h1:qwhEKjDrT0UcwDnHrNU2Yg/DLR9b/GsUncnXYW6VzAU= github.com/AdguardTeam/golibs v0.5.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/dnsproxy v0.37.4/go.mod h1:xkJWEuTr550gPDmB9azsciKZzSXjf9wMn+Ji54PQ4gE= <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.4.5 h1:RRA9ZsmbJEN4OllAx0BcfvSbRBxxpWluJijBYmtp13U= <mask> github.com/AdguardTeam/golibs v0.4.5/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU= <mask> github.com/AdguardTeam/urlfilter v0.14.5 h1:WyF0hg0MwKevsqNPkoaZFH8f5WRi/yuy/7qePtYt5Ts= <mask> github.com/AdguardTeam/urlfilter v0.14.5/go.mod h1:klx4JbOfc4EaNb5lWLqOwfg+pVcyRukmoJRvO55lL5U= <mask> github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= <mask> github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= </s> Pull request: all: add us to logs Merge in DNS/adguard-home from imp-logs to master Squashed commit of the following: commit b463825196625f59b19977920f828f57e4b87f0d Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue May 18 14:08:24 2021 +0300 all: add us to logs </s> remove github.com/AdguardTeam/golibs v0.4.5 </s> add github.com/AdguardTeam/golibs v0.5.0
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b2e3e4d0886c58dddad2251e9352d704043d3910
go.sum
// Make sure that we see the microseconds in logs, as networking stuff // can happen pretty quickly. log.SetFlags(log.LstdFlags | log.Lmicroseconds)
<mask> } <mask> <mask> if args.runningAsService && ls.LogFile == "" && runtime.GOOS == "windows" { <mask> // When running as a Windows service, use eventlog by default if nothing else is configured <mask> // Otherwise, we'll simply loose the log output <mask> ls.LogFile = configSyslog <mask> } </s> Pull request: all: add us to logs Merge in DNS/adguard-home from imp-logs to master Squashed commit of the following: commit b463825196625f59b19977920f828f57e4b87f0d Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue May 18 14:08:24 2021 +0300 all: add us to logs </s> remove github.com/AdguardTeam/golibs v0.4.5 h1:RRA9ZsmbJEN4OllAx0BcfvSbRBxxpWluJijBYmtp13U= github.com/AdguardTeam/golibs v0.4.5/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= </s> add github.com/AdguardTeam/golibs v0.5.0 h1:qwhEKjDrT0UcwDnHrNU2Yg/DLR9b/GsUncnXYW6VzAU= github.com/AdguardTeam/golibs v0.5.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= </s> remove github.com/AdguardTeam/golibs v0.4.5 </s> add github.com/AdguardTeam/golibs v0.5.0
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b2e3e4d0886c58dddad2251e9352d704043d3910
internal/home/home.go
"example_upstream_sdns": "you can use <a href='https:\/\/dnscrypt.info\/stamps\/' target='_blank'>DNS Stamps</a> for <a href='https:\/\/dnscrypt.info\/' target='_blank'>DNSCrypt</a> or <a href='https:\/\/en.wikipedia.org\/wiki\/DNS_over_HTTPS' target='_blank'>DNS-over-HTTPS</a> resolvers",
<mask> "example_comment_hash": "# Also a comment", <mask> "example_upstream_regular": "regular DNS (over UDP)", <mask> "example_upstream_dot": "encrypted <a href='https:\/\/en.wikipedia.org\/wiki\/DNS_over_TLS' target='_blank'>DNS-over-TLS<\/a>", <mask> "example_upstream_doh": "encrypted <a href='https:\/\/en.wikipedia.org\/wiki\/DNS_over_HTTPS' target='_blank'>DNS-over-HTTPS<\/a>", <mask> "example_upstream_tcp": "regular DNS (over TCP)", <mask> "all_filters_up_to_date_toast": "All filters are already up-to-date", <mask> "updated_upstream_dns_toast": "Updated the upstream DNS servers", <mask> "dns_test_ok_toast": "Specified DNS servers are working correctly", <mask> "dns_test_not_ok_toast": "Server \"{{key}}\": could not be used, please check that you've written it correctly", </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> remove golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> add golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
client/src/__locales/en.json
<li> <code>sdns://...</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_sdns') }} /> </li>
<mask> <code>tcp://1.1.1.1</code> - { t('example_upstream_tcp') } <mask> </li> <mask> </ol> <mask> </div> <mask> </div> <mask> </div> <mask> </Card> <mask> ); </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> remove golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> add golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
client/src/components/Settings/Upstream.js
"github.com/jedisct1/go-dnsstamps" "github.com/ameshkov/dnscrypt"
<mask> "strings" <mask> "sync" <mask> "time" <mask> <mask> "github.com/joomcode/errorx" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> const defaultTimeout = time.Second * 10 <mask> </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd golang.org/x/net v0.0.0-20181108082009-03003ca0c849 golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> remove golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> add golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
dnsforward/upstream.go
case "sdns": stamp, err := dnsstamps.NewServerStampFromString(address) if err != nil { return nil, errorx.Decorate(err, "Failed to parse %s", address) } switch stamp.Proto { case dnsstamps.StampProtoTypeDNSCrypt: return &dnsCrypt{boot: toBoot(url.String(), bootstrap)}, nil case dnsstamps.StampProtoTypeDoH: return AddressToUpstream(fmt.Sprintf("https://%s%s", stamp.ProviderName, stamp.Path), bootstrap) } return nil, fmt.Errorf("Unsupported protocol %v in %s", stamp.Proto, address)
<mask> return nil, errorx.Decorate(err, "Failed to parse %s", address) <mask> } <mask> switch url.Scheme { <mask> case "dns": <mask> if url.Port() == "" { <mask> url.Host += ":53" <mask> } <mask> return &plainDNS{boot: toBoot(url.Host, bootstrap)}, nil </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> remove golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> add golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
dnsforward/upstream.go
github.com/ameshkov/dnscrypt v0.0.0-20181217090431-1215bb8b150f
<mask> <mask> require ( <mask> github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f // indirect <mask> github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6 <mask> github.com/bluele/gcache v0.0.0-20171010155617-472614239ac7 <mask> github.com/go-ole/go-ole v1.2.1 // indirect <mask> github.com/go-test/deep v1.0.1 <mask> github.com/gobuffalo/packr v1.19.0 </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove github.com/miekg/dns v1.0.15 </s> add github.com/miekg/dns v1.1.1 </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd golang.org/x/net v0.0.0-20181108082009-03003ca0c849 golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.mod
github.com/jedisct1/go-dnsstamps v0.0.0-20180418170050-1e4999280f86
<mask> github.com/go-ole/go-ole v1.2.1 // indirect <mask> github.com/go-test/deep v1.0.1 <mask> github.com/gobuffalo/packr v1.19.0 <mask> github.com/joomcode/errorx v0.1.0 <mask> github.com/miekg/dns v1.1.1 <mask> github.com/patrickmn/go-cache v2.1.0+incompatible <mask> github.com/shirou/gopsutil v2.18.10+incompatible </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove github.com/miekg/dns v1.0.15 </s> add github.com/miekg/dns v1.1.1 </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd golang.org/x/net v0.0.0-20181108082009-03003ca0c849 golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.mod
github.com/miekg/dns v1.1.1
<mask> github.com/go-ole/go-ole v1.2.1 // indirect <mask> github.com/go-test/deep v1.0.1 <mask> github.com/gobuffalo/packr v1.19.0 <mask> github.com/joomcode/errorx v0.1.0 <mask> github.com/miekg/dns v1.0.15 <mask> github.com/patrickmn/go-cache v2.1.0+incompatible <mask> github.com/shirou/gopsutil v2.18.10+incompatible <mask> github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect <mask> go.uber.org/goleak v0.10.0 <mask> golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd golang.org/x/net v0.0.0-20181108082009-03003ca0c849 golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.mod
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6
<mask> github.com/patrickmn/go-cache v2.1.0+incompatible <mask> github.com/shirou/gopsutil v2.18.10+incompatible <mask> github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect <mask> go.uber.org/goleak v0.10.0 <mask> golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd <mask> golang.org/x/net v0.0.0-20181108082009-03003ca0c849 <mask> golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect <mask> gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477 <mask> gopkg.in/yaml.v2 v2.2.1 <mask> ) </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove github.com/miekg/dns v1.0.15 </s> add github.com/miekg/dns v1.1.1 </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> remove golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> add golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.mod
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw= github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us= github.com/ameshkov/dnscrypt v0.0.0-20181217090431-1215bb8b150f h1:vOaSvI9B3wqzV1g8raDeVzRJnq5RHQxsz0MVXudxdNU= github.com/ameshkov/dnscrypt v0.0.0-20181217090431-1215bb8b150f/go.mod h1:EC7Z1GguyEEwhuLXrcgkRTE3GdyPDSWq2OXefhydGWo=
<mask> github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f h1:5ZfJxyXo8KyX8DgGXC5B7ILL8y51fci/qYz2B4j8iLY= <mask> github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= <mask> github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6 h1:KXlsf+qt/X5ttPGEjR0tPH1xaWWoKBEg9Q1THAj2h3I= <mask> github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA= <mask> github.com/bluele/gcache v0.0.0-20171010155617-472614239ac7 h1:NpQ+gkFOH27AyDypSCJ/LdsIi/b4rdnEb1N5+IpFfYs= <mask> github.com/bluele/gcache v0.0.0-20171010155617-472614239ac7/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk= </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> remove golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> add golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.sum
github.com/jedisct1/go-dnsstamps v0.0.0-20180418170050-1e4999280f86 h1:Olj4M6T1omUfx7yTTcnhLf4xo6gYMmRHSJIfeA1NZy0= github.com/jedisct1/go-dnsstamps v0.0.0-20180418170050-1e4999280f86/go.mod h1:j/ONpSHHmPgDwmFKXg9vhQvIjADe/ft1X4a3TVOmp9g= github.com/jedisct1/xsecretbox v0.0.0-20180508184500-7a679c0bcd9a h1:2nyBWKszM41RO/gt5ElUXigAFiRgJ9KifHDlWOlw0lc= github.com/jedisct1/xsecretbox v0.0.0-20180508184500-7a679c0bcd9a/go.mod h1:YlN58h704uRFD0BwsEGTq+7Wx+WG2i7P49bc+HwHyAY=
<mask> github.com/gobuffalo/packd v0.0.0-20181031195726-c82734870264/go.mod h1:Yf2toFaISlyQrr5TfO3h6DB9pl9mZRmyvBGQb/aQ/pI= <mask> github.com/gobuffalo/packr v1.19.0 h1:3UDmBDxesCOPF8iZdMDBBWKfkBoYujIMIZePnobqIUI= <mask> github.com/gobuffalo/packr v1.19.0/go.mod h1:MstrNkfCQhd5o+Ct4IJ0skWlxN8emOq8DsoT1G98VIU= <mask> github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= <mask> github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= <mask> github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= <mask> github.com/joomcode/errorx v0.1.0 h1:QmJMiI1DE1UFje2aI1ZWO/VMT5a32qBoXUclGOt8vsc= <mask> github.com/joomcode/errorx v0.1.0/go.mod h1:kgco15ekB6cs+4Xjzo7SPeXzx38PbJzBwbnu9qfVNHQ= <mask> github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4 h1:Mlji5gkcpzkqTROyE4ZxZ8hN7osunMb2RuGVrbvMvCc= <mask> github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> remove github.com/miekg/dns v1.0.15 </s> add github.com/miekg/dns v1.1.1 </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.sum
github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
<mask> github.com/joomcode/errorx v0.1.0 h1:QmJMiI1DE1UFje2aI1ZWO/VMT5a32qBoXUclGOt8vsc= <mask> github.com/joomcode/errorx v0.1.0/go.mod h1:kgco15ekB6cs+4Xjzo7SPeXzx38PbJzBwbnu9qfVNHQ= <mask> github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4 h1:Mlji5gkcpzkqTROyE4ZxZ8hN7osunMb2RuGVrbvMvCc= <mask> github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= <mask> github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= <mask> github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= <mask> github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= <mask> github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= <mask> github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= <mask> github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= <mask> github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove github.com/miekg/dns v1.0.15 </s> add github.com/miekg/dns v1.1.1 </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd golang.org/x/net v0.0.0-20181108082009-03003ca0c849 golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.sum
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
<mask> github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= <mask> github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= <mask> go.uber.org/goleak v0.10.0 h1:G3eWbSNIskeRqtsN/1uI5B+eP73y3JUuBsv9AZjehb4= <mask> go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI= <mask> golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= <mask> golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= <mask> golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= <mask> golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= <mask> golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= <mask> golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= <mask> golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> add golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd golang.org/x/net v0.0.0-20181108082009-03003ca0c849 golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 </s> remove github.com/miekg/dns v1.0.15 </s> add github.com/miekg/dns v1.1.1 </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.sum
golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
<mask> go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI= <mask> golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= <mask> golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= <mask> golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= <mask> golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= <mask> golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= <mask> golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= <mask> golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= <mask> golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= <mask> golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> gopkg.in/asaskevich/govalidator.v4 v4.0.0-20160518190739-766470278477 h1:5xUJw+lg4zao9W4HIDzlFbMYgSgtvNVHh00MEHvbGpQ= </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> remove golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> add golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd golang.org/x/net v0.0.0-20181108082009-03003ca0c849 golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 </s> remove github.com/miekg/dns v1.0.15 </s> add github.com/miekg/dns v1.1.1 </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.sum
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
<mask> golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= <mask> golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= <mask> golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= <mask> golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= <mask> golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU= <mask> golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <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.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= </s> Fix #284 Added DNSCrypt upstreams support Added DNS Stamps support </s> remove golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> add golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 h1:gT0Y6H7hbVPUtvtk0YGxMXPgN+p8fYlqWkgJeUCZcaQ= golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= </s> remove golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd golang.org/x/net v0.0.0-20181108082009-03003ca0c849 golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect </s> add golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 golang.org/x/net v0.0.0-20181213202711-891ebc4b82d6 </s> remove github.com/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= </s> add github.com/miekg/dns v1.1.1 h1:DVkblRdiScEnEr0LR9nTnEQqHYycjkXW9bOjd+2EL2o= github.com/miekg/dns v1.1.1/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b30b6b1d66c69f37cd97725f18d797a7ff2395d2
go.sum
<mask> r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts) <mask> assert.True(t, r.IsFiltered && r.Reason == FilteredBlockedService) <mask> } <mask> <mask> func TestRewrites(t *testing.T) { <mask> d := Dnsfilter{} <mask> // CNAME, A, AAAA <mask> d.Rewrites = []RewriteEntry{ <mask> RewriteEntry{"somecname", "somehost.com", 0, nil}, <mask> RewriteEntry{"somehost.com", "0.0.0.0", 0, nil}, <mask> <mask> RewriteEntry{"host.com", "1.2.3.4", 0, nil}, <mask> RewriteEntry{"host.com", "1.2.3.5", 0, nil}, <mask> RewriteEntry{"host.com", "1:2:3::4", 0, nil}, <mask> RewriteEntry{"www.host.com", "host.com", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r := d.processRewrites("host2.com") <mask> assert.Equal(t, NotFilteredNotFound, r.Reason) <mask> <mask> r = d.processRewrites("www.host.com") <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "host.com", r.CanonName) <mask> assert.True(t, len(r.IPList) == 3) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> assert.True(t, r.IPList[1].Equal(net.ParseIP("1.2.3.5"))) <mask> assert.True(t, r.IPList[2].Equal(net.ParseIP("1:2:3::4"))) <mask> <mask> // wildcard <mask> d.Rewrites = []RewriteEntry{ <mask> RewriteEntry{"host.com", "1.2.3.4", 0, nil}, <mask> RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("host.com") <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> <mask> r = d.processRewrites("www.host.com") <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.5"))) <mask> <mask> r = d.processRewrites("www.host2.com") <mask> assert.Equal(t, NotFilteredNotFound, r.Reason) <mask> <mask> // override a wildcard <mask> d.Rewrites = []RewriteEntry{ <mask> RewriteEntry{"a.host.com", "1.2.3.4", 0, nil}, <mask> RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("a.host.com") <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.True(t, len(r.IPList) == 1) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> <mask> // wildcard + CNAME <mask> d.Rewrites = []RewriteEntry{ <mask> RewriteEntry{"host.com", "1.2.3.4", 0, nil}, <mask> RewriteEntry{"*.host.com", "host.com", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("www.host.com") <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "host.com", r.CanonName) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> <mask> // 2 CNAMEs <mask> d.Rewrites = []RewriteEntry{ <mask> RewriteEntry{"b.host.com", "a.host.com", 0, nil}, <mask> RewriteEntry{"a.host.com", "host.com", 0, nil}, <mask> RewriteEntry{"host.com", "1.2.3.4", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("b.host.com") <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "host.com", r.CanonName) <mask> assert.True(t, len(r.IPList) == 1) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> <mask> // 2 CNAMEs + wildcard <mask> d.Rewrites = []RewriteEntry{ <mask> RewriteEntry{"b.host.com", "a.host.com", 0, nil}, <mask> RewriteEntry{"a.host.com", "x.somehost.com", 0, nil}, <mask> RewriteEntry{"*.somehost.com", "1.2.3.4", 0, nil}, <mask> } <mask> d.prepareRewrites() <mask> r = d.processRewrites("b.host.com") <mask> assert.Equal(t, ReasonRewrite, r.Reason) <mask> assert.Equal(t, "x.somehost.com", r.CanonName) <mask> assert.True(t, len(r.IPList) == 1) <mask> assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) <mask> } <mask> <mask> func prepareTestDir() string { <mask> const dir = "./agh-test" <mask> _ = os.RemoveAll(dir) <mask> _ = os.MkdirAll(dir, 0755) <mask> return dir </s> + rewrites: support deeper level wildcards - select the more specific one </s> remove // Priority: CNAME, A/AAAA; exact, wildcard. </s> add // Priority: // . CNAME > A/AAAA; // . exact > wildcard; // . higher level wildcard > lower level wildcard </s> remove return i < j </s> add // both are wildcards return len(a[i].Domain) > len(a[j].Domain) </s> remove if isWildcard(a[i].Domain) && !isWildcard(a[j].Domain) { return false } else if !isWildcard(a[i].Domain) && isWildcard(a[j].Domain) { return true </s> add if isWildcard(a[i].Domain) { if !isWildcard(a[j].Domain) { return false } } else { if isWildcard(a[j].Domain) { return true }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/b33653ec48a613df24d1768aab56a5c505affd33
dnsfilter/dnsfilter_test.go
// Priority: // . CNAME > A/AAAA; // . exact > wildcard; // . higher level wildcard > lower level wildcard
<mask> func (a rewritesArray) Len() int { return len(a) } <mask> <mask> func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] } <mask> <mask> // Priority: CNAME, A/AAAA; exact, wildcard. <mask> func (a rewritesArray) Less(i, j int) bool { <mask> if a[i].Type == dns.TypeCNAME && a[j].Type != dns.TypeCNAME { <mask> return false <mask> } else if a[i].Type != dns.TypeCNAME && a[j].Type == dns.TypeCNAME { <mask> return true </s> + rewrites: support deeper level wildcards - select the more specific one </s> remove if isWildcard(a[i].Domain) && !isWildcard(a[j].Domain) { return false } else if !isWildcard(a[i].Domain) && isWildcard(a[j].Domain) { return true </s> add if isWildcard(a[i].Domain) { if !isWildcard(a[j].Domain) { return false } } else { if isWildcard(a[j].Domain) { return true } </s> remove return i < j </s> add // both are wildcards return len(a[i].Domain) > len(a[j].Domain) </s> remove func TestRewrites(t *testing.T) { d := Dnsfilter{} // CNAME, A, AAAA d.Rewrites = []RewriteEntry{ RewriteEntry{"somecname", "somehost.com", 0, nil}, RewriteEntry{"somehost.com", "0.0.0.0", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"host.com", "1.2.3.5", 0, nil}, RewriteEntry{"host.com", "1:2:3::4", 0, nil}, RewriteEntry{"www.host.com", "host.com", 0, nil}, } d.prepareRewrites() r := d.processRewrites("host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 3) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) assert.True(t, r.IPList[1].Equal(net.ParseIP("1.2.3.5"))) assert.True(t, r.IPList[2].Equal(net.ParseIP("1:2:3::4"))) // wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.5"))) r = d.processRewrites("www.host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) // override a wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"a.host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("a.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // wildcard + CNAME d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "host.com", 0, nil}, } d.prepareRewrites() r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "host.com", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs + wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "x.somehost.com", 0, nil}, RewriteEntry{"*.somehost.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "x.somehost.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b33653ec48a613df24d1768aab56a5c505affd33
dnsfilter/rewrites.go
if isWildcard(a[i].Domain) { if !isWildcard(a[j].Domain) { return false } } else { if isWildcard(a[j].Domain) { return true }
<mask> } else if a[i].Type != dns.TypeCNAME && a[j].Type == dns.TypeCNAME { <mask> return true <mask> } <mask> <mask> if isWildcard(a[i].Domain) && !isWildcard(a[j].Domain) { <mask> return false <mask> } else if !isWildcard(a[i].Domain) && isWildcard(a[j].Domain) { <mask> return true <mask> } <mask> <mask> return i < j <mask> } <mask> </s> + rewrites: support deeper level wildcards - select the more specific one </s> remove // Priority: CNAME, A/AAAA; exact, wildcard. </s> add // Priority: // . CNAME > A/AAAA; // . exact > wildcard; // . higher level wildcard > lower level wildcard </s> remove return i < j </s> add // both are wildcards return len(a[i].Domain) > len(a[j].Domain) </s> remove func TestRewrites(t *testing.T) { d := Dnsfilter{} // CNAME, A, AAAA d.Rewrites = []RewriteEntry{ RewriteEntry{"somecname", "somehost.com", 0, nil}, RewriteEntry{"somehost.com", "0.0.0.0", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"host.com", "1.2.3.5", 0, nil}, RewriteEntry{"host.com", "1:2:3::4", 0, nil}, RewriteEntry{"www.host.com", "host.com", 0, nil}, } d.prepareRewrites() r := d.processRewrites("host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 3) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) assert.True(t, r.IPList[1].Equal(net.ParseIP("1.2.3.5"))) assert.True(t, r.IPList[2].Equal(net.ParseIP("1:2:3::4"))) // wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.5"))) r = d.processRewrites("www.host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) // override a wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"a.host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("a.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // wildcard + CNAME d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "host.com", 0, nil}, } d.prepareRewrites() r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "host.com", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs + wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "x.somehost.com", 0, nil}, RewriteEntry{"*.somehost.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "x.somehost.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b33653ec48a613df24d1768aab56a5c505affd33
dnsfilter/rewrites.go
// both are wildcards return len(a[i].Domain) > len(a[j].Domain)
<mask> } else if !isWildcard(a[i].Domain) && isWildcard(a[j].Domain) { <mask> return true <mask> } <mask> <mask> return i < j <mask> } <mask> <mask> // Prepare entry for use <mask> func (r *RewriteEntry) prepare() { <mask> ip := net.ParseIP(r.Answer) </s> + rewrites: support deeper level wildcards - select the more specific one </s> remove if isWildcard(a[i].Domain) && !isWildcard(a[j].Domain) { return false } else if !isWildcard(a[i].Domain) && isWildcard(a[j].Domain) { return true </s> add if isWildcard(a[i].Domain) { if !isWildcard(a[j].Domain) { return false } } else { if isWildcard(a[j].Domain) { return true } </s> remove // Priority: CNAME, A/AAAA; exact, wildcard. </s> add // Priority: // . CNAME > A/AAAA; // . exact > wildcard; // . higher level wildcard > lower level wildcard </s> remove func TestRewrites(t *testing.T) { d := Dnsfilter{} // CNAME, A, AAAA d.Rewrites = []RewriteEntry{ RewriteEntry{"somecname", "somehost.com", 0, nil}, RewriteEntry{"somehost.com", "0.0.0.0", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"host.com", "1.2.3.5", 0, nil}, RewriteEntry{"host.com", "1:2:3::4", 0, nil}, RewriteEntry{"www.host.com", "host.com", 0, nil}, } d.prepareRewrites() r := d.processRewrites("host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 3) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) assert.True(t, r.IPList[1].Equal(net.ParseIP("1.2.3.5"))) assert.True(t, r.IPList[2].Equal(net.ParseIP("1:2:3::4"))) // wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.5"))) r = d.processRewrites("www.host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) // override a wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"a.host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("a.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // wildcard + CNAME d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "host.com", 0, nil}, } d.prepareRewrites() r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "host.com", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs + wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "x.somehost.com", 0, nil}, RewriteEntry{"*.somehost.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "x.somehost.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b33653ec48a613df24d1768aab56a5c505affd33
dnsfilter/rewrites.go
// If matched by several wildcards, select the more specific one
<mask> // Get the list of matched rewrite entries. <mask> // Priority: CNAME, A/AAAA; exact, wildcard. <mask> // If matched exactly, don't return wildcard entries. <mask> func findRewrites(a []RewriteEntry, host string) []RewriteEntry { <mask> rr := rewritesArray{} <mask> for _, r := range a { <mask> if r.Domain != host { <mask> if !matchDomainWildcard(host, r.Domain) { <mask> continue </s> + rewrites: support deeper level wildcards - select the more specific one </s> remove // Priority: CNAME, A/AAAA; exact, wildcard. </s> add // Priority: // . CNAME > A/AAAA; // . exact > wildcard; // . higher level wildcard > lower level wildcard </s> remove return i < j </s> add // both are wildcards return len(a[i].Domain) > len(a[j].Domain) </s> remove if isWildcard(a[i].Domain) && !isWildcard(a[j].Domain) { return false } else if !isWildcard(a[i].Domain) && isWildcard(a[j].Domain) { return true </s> add if isWildcard(a[i].Domain) { if !isWildcard(a[j].Domain) { return false } } else { if isWildcard(a[j].Domain) { return true } </s> remove func TestRewrites(t *testing.T) { d := Dnsfilter{} // CNAME, A, AAAA d.Rewrites = []RewriteEntry{ RewriteEntry{"somecname", "somehost.com", 0, nil}, RewriteEntry{"somehost.com", "0.0.0.0", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"host.com", "1.2.3.5", 0, nil}, RewriteEntry{"host.com", "1:2:3::4", 0, nil}, RewriteEntry{"www.host.com", "host.com", 0, nil}, } d.prepareRewrites() r := d.processRewrites("host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 3) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) assert.True(t, r.IPList[1].Equal(net.ParseIP("1.2.3.5"))) assert.True(t, r.IPList[2].Equal(net.ParseIP("1:2:3::4"))) // wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.5"))) r = d.processRewrites("www.host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) // override a wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"a.host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("a.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // wildcard + CNAME d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "host.com", 0, nil}, } d.prepareRewrites() r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "host.com", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs + wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "x.somehost.com", 0, nil}, RewriteEntry{"*.somehost.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "x.somehost.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) } </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b33653ec48a613df24d1768aab56a5c505affd33
dnsfilter/rewrites.go
} else { rr = rr[:1]
<mask> break <mask> } <mask> } <mask> } <mask> <mask> return rr <mask> } <mask> </s> + rewrites: support deeper level wildcards - select the more specific one </s> remove if isWildcard(a[i].Domain) && !isWildcard(a[j].Domain) { return false } else if !isWildcard(a[i].Domain) && isWildcard(a[j].Domain) { return true </s> add if isWildcard(a[i].Domain) { if !isWildcard(a[j].Domain) { return false } } else { if isWildcard(a[j].Domain) { return true } </s> remove return i < j </s> add // both are wildcards return len(a[i].Domain) > len(a[j].Domain) </s> remove // Priority: CNAME, A/AAAA; exact, wildcard. </s> add // Priority: // . CNAME > A/AAAA; // . exact > wildcard; // . higher level wildcard > lower level wildcard </s> remove func TestRewrites(t *testing.T) { d := Dnsfilter{} // CNAME, A, AAAA d.Rewrites = []RewriteEntry{ RewriteEntry{"somecname", "somehost.com", 0, nil}, RewriteEntry{"somehost.com", "0.0.0.0", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"host.com", "1.2.3.5", 0, nil}, RewriteEntry{"host.com", "1:2:3::4", 0, nil}, RewriteEntry{"www.host.com", "host.com", 0, nil}, } d.prepareRewrites() r := d.processRewrites("host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 3) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) assert.True(t, r.IPList[1].Equal(net.ParseIP("1.2.3.5"))) assert.True(t, r.IPList[2].Equal(net.ParseIP("1:2:3::4"))) // wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.5"))) r = d.processRewrites("www.host2.com") assert.Equal(t, NotFilteredNotFound, r.Reason) // override a wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"a.host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "1.2.3.5", 0, nil}, } d.prepareRewrites() r = d.processRewrites("a.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // wildcard + CNAME d.Rewrites = []RewriteEntry{ RewriteEntry{"host.com", "1.2.3.4", 0, nil}, RewriteEntry{"*.host.com", "host.com", 0, nil}, } d.prepareRewrites() r = d.processRewrites("www.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "host.com", 0, nil}, RewriteEntry{"host.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "host.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) // 2 CNAMEs + wildcard d.Rewrites = []RewriteEntry{ RewriteEntry{"b.host.com", "a.host.com", 0, nil}, RewriteEntry{"a.host.com", "x.somehost.com", 0, nil}, RewriteEntry{"*.somehost.com", "1.2.3.4", 0, nil}, } d.prepareRewrites() r = d.processRewrites("b.host.com") assert.Equal(t, ReasonRewrite, r.Reason) assert.Equal(t, "x.somehost.com", r.CanonName) assert.True(t, len(r.IPList) == 1) assert.True(t, r.IPList[0].Equal(net.ParseIP("1.2.3.4"))) } </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b33653ec48a613df24d1768aab56a5c505affd33
dnsfilter/rewrites.go
// Go memory hacks memoryUsage(args)
<mask> <mask> // configure log level and output <mask> configureLogger(args) <mask> <mask> // print the first message after logger is configured <mask> log.Println(version()) <mask> log.Debug("Current working directory is %s", Context.workDir) <mask> if args.runningAsService { </s> * (global): added --no-mem-optimization flag This commit adds a new command-line argument that disables memory optimizations AGH is using. These memory optimizations might be necessary on low-memory devices, but they aren't free and there's a performance hit (see #2044). Now they can be disabled - just pass --no-mem-optimization when you run AGH or when you install the service -- ./AdGuardHome -s install --no-mem-optimization Closes: #2044 </s> remove // memoryUsage implements a couple of not really beautiful hacks which purpose is to // make OS reclaim the memory freed by AdGuard Home as soon as possible. func memoryUsage() { debug.SetGCPercent(10) // madvdontneed: setting madvdontneed=1 will use MADV_DONTNEED // instead of MADV_FREE on Linux when returning memory to the // kernel. This is less efficient, but causes RSS numbers to drop // more quickly. _ = os.Setenv("GODEBUG", "madvdontneed=1") // periodically call "debug.FreeOSMemory" so // that the OS could reclaim the free memory go func() { ticker := time.NewTicker(15 * time.Second) for { select { case t := <-ticker.C: t.Second() debug.FreeOSMemory() } } }() } </s> add </s> remove memoryUsage() </s> add </s> remove glinetMode bool // Activate GL-Inet mode </s> add // disableMemoryOptimization - disables memory optimization hacks // see memoryUsage() function for the details disableMemoryOptimization bool glinetMode bool // Activate GL-Inet compatibility mode </s> remove "os" "runtime/debug" "time" </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3a68bb806dd16228398a64e66ef08b891cb3f30
home/home.go
// disableMemoryOptimization - disables memory optimization hacks // see memoryUsage() function for the details disableMemoryOptimization bool glinetMode bool // Activate GL-Inet compatibility mode
<mask> <mask> // runningAsService flag is set to true when options are passed from the service runner <mask> runningAsService bool <mask> <mask> glinetMode bool // Activate GL-Inet mode <mask> } <mask> <mask> // functions used for their side-effects <mask> type effect func() error <mask> </s> * (global): added --no-mem-optimization flag This commit adds a new command-line argument that disables memory optimizations AGH is using. These memory optimizations might be necessary on low-memory devices, but they aren't free and there's a performance hit (see #2044). Now they can be disabled - just pass --no-mem-optimization when you run AGH or when you install the service -- ./AdGuardHome -s install --no-mem-optimization Closes: #2044 </s> remove // memoryUsage implements a couple of not really beautiful hacks which purpose is to // make OS reclaim the memory freed by AdGuard Home as soon as possible. func memoryUsage() { debug.SetGCPercent(10) // madvdontneed: setting madvdontneed=1 will use MADV_DONTNEED // instead of MADV_FREE on Linux when returning memory to the // kernel. This is less efficient, but causes RSS numbers to drop // more quickly. _ = os.Setenv("GODEBUG", "madvdontneed=1") // periodically call "debug.FreeOSMemory" so // that the OS could reclaim the free memory go func() { ticker := time.NewTicker(15 * time.Second) for { select { case t := <-ticker.C: t.Second() debug.FreeOSMemory() } } }() } </s> add </s> remove memoryUsage() </s> add </s> remove "os" "runtime/debug" "time" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3a68bb806dd16228398a64e66ef08b891cb3f30
home/options.go
var disableMemoryOptimizationArg = arg{ "Disable memory optimization", "no-mem-optimization", "", nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil, func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) }, }
<mask> } <mask> <mask> var verboseArg = arg{ <mask> "Enable verbose output", <mask> "verbose", "v", <mask> nil, func(o options) (options, error) { o.verbose = true; return o, nil }, nil, </s> * (global): added --no-mem-optimization flag This commit adds a new command-line argument that disables memory optimizations AGH is using. These memory optimizations might be necessary on low-memory devices, but they aren't free and there's a performance hit (see #2044). Now they can be disabled - just pass --no-mem-optimization when you run AGH or when you install the service -- ./AdGuardHome -s install --no-mem-optimization Closes: #2044 </s> remove memoryUsage() </s> add </s> remove // memoryUsage implements a couple of not really beautiful hacks which purpose is to // make OS reclaim the memory freed by AdGuard Home as soon as possible. func memoryUsage() { debug.SetGCPercent(10) // madvdontneed: setting madvdontneed=1 will use MADV_DONTNEED // instead of MADV_FREE on Linux when returning memory to the // kernel. This is less efficient, but causes RSS numbers to drop // more quickly. _ = os.Setenv("GODEBUG", "madvdontneed=1") // periodically call "debug.FreeOSMemory" so // that the OS could reclaim the free memory go func() { ticker := time.NewTicker(15 * time.Second) for { select { case t := <-ticker.C: t.Second() debug.FreeOSMemory() } } }() } </s> add </s> remove "os" "runtime/debug" "time" </s> add
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3a68bb806dd16228398a64e66ef08b891cb3f30
home/options.go
disableMemoryOptimizationArg,
<mask> logfileArg, <mask> pidfileArg, <mask> checkConfigArg, <mask> noCheckUpdateArg, <mask> verboseArg, <mask> glinetArg, <mask> versionArg, <mask> helpArg, <mask> } <mask> } </s> * (global): added --no-mem-optimization flag This commit adds a new command-line argument that disables memory optimizations AGH is using. These memory optimizations might be necessary on low-memory devices, but they aren't free and there's a performance hit (see #2044). Now they can be disabled - just pass --no-mem-optimization when you run AGH or when you install the service -- ./AdGuardHome -s install --no-mem-optimization Closes: #2044 </s> remove // memoryUsage implements a couple of not really beautiful hacks which purpose is to // make OS reclaim the memory freed by AdGuard Home as soon as possible. func memoryUsage() { debug.SetGCPercent(10) // madvdontneed: setting madvdontneed=1 will use MADV_DONTNEED // instead of MADV_FREE on Linux when returning memory to the // kernel. This is less efficient, but causes RSS numbers to drop // more quickly. _ = os.Setenv("GODEBUG", "madvdontneed=1") // periodically call "debug.FreeOSMemory" so // that the OS could reclaim the free memory go func() { ticker := time.NewTicker(15 * time.Second) for { select { case t := <-ticker.C: t.Second() debug.FreeOSMemory() } } }() } </s> add </s> remove memoryUsage() </s> add </s> remove glinetMode bool // Activate GL-Inet mode </s> add // disableMemoryOptimization - disables memory optimization hacks // see memoryUsage() function for the details disableMemoryOptimization bool glinetMode bool // Activate GL-Inet compatibility mode </s> remove "os" "runtime/debug" "time" </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3a68bb806dd16228398a64e66ef08b891cb3f30
home/options.go
<mask> //go:generate packr -z <mask> package main <mask> <mask> import ( <mask> "os" <mask> "runtime/debug" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/home" <mask> ) <mask> <mask> // version will be set through ldflags, contains current version <mask> var version = "undefined" </s> * (global): added --no-mem-optimization flag This commit adds a new command-line argument that disables memory optimizations AGH is using. These memory optimizations might be necessary on low-memory devices, but they aren't free and there's a performance hit (see #2044). Now they can be disabled - just pass --no-mem-optimization when you run AGH or when you install the service -- ./AdGuardHome -s install --no-mem-optimization Closes: #2044 </s> remove memoryUsage() </s> add </s> remove // memoryUsage implements a couple of not really beautiful hacks which purpose is to // make OS reclaim the memory freed by AdGuard Home as soon as possible. func memoryUsage() { debug.SetGCPercent(10) // madvdontneed: setting madvdontneed=1 will use MADV_DONTNEED // instead of MADV_FREE on Linux when returning memory to the // kernel. This is less efficient, but causes RSS numbers to drop // more quickly. _ = os.Setenv("GODEBUG", "madvdontneed=1") // periodically call "debug.FreeOSMemory" so // that the OS could reclaim the free memory go func() { ticker := time.NewTicker(15 * time.Second) for { select { case t := <-ticker.C: t.Second() debug.FreeOSMemory() } } }() } </s> add </s> remove glinetMode bool // Activate GL-Inet mode </s> add // disableMemoryOptimization - disables memory optimization hacks // see memoryUsage() function for the details disableMemoryOptimization bool glinetMode bool // Activate GL-Inet compatibility mode
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3a68bb806dd16228398a64e66ef08b891cb3f30
main.go
<mask> // GOARM value - set via ldflags <mask> var goarm = "" <mask> <mask> func main() { <mask> memoryUsage() <mask> <mask> home.Main(version, channel, goarm) <mask> } <mask> <mask> // memoryUsage implements a couple of not really beautiful hacks which purpose is to <mask> // make OS reclaim the memory freed by AdGuard Home as soon as possible. </s> * (global): added --no-mem-optimization flag This commit adds a new command-line argument that disables memory optimizations AGH is using. These memory optimizations might be necessary on low-memory devices, but they aren't free and there's a performance hit (see #2044). Now they can be disabled - just pass --no-mem-optimization when you run AGH or when you install the service -- ./AdGuardHome -s install --no-mem-optimization Closes: #2044 </s> remove // memoryUsage implements a couple of not really beautiful hacks which purpose is to // make OS reclaim the memory freed by AdGuard Home as soon as possible. func memoryUsage() { debug.SetGCPercent(10) // madvdontneed: setting madvdontneed=1 will use MADV_DONTNEED // instead of MADV_FREE on Linux when returning memory to the // kernel. This is less efficient, but causes RSS numbers to drop // more quickly. _ = os.Setenv("GODEBUG", "madvdontneed=1") // periodically call "debug.FreeOSMemory" so // that the OS could reclaim the free memory go func() { ticker := time.NewTicker(15 * time.Second) for { select { case t := <-ticker.C: t.Second() debug.FreeOSMemory() } } }() } </s> add </s> remove glinetMode bool // Activate GL-Inet mode </s> add // disableMemoryOptimization - disables memory optimization hacks // see memoryUsage() function for the details disableMemoryOptimization bool glinetMode bool // Activate GL-Inet compatibility mode </s> remove "os" "runtime/debug" "time" </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3a68bb806dd16228398a64e66ef08b891cb3f30
main.go
<mask> memoryUsage() <mask> <mask> home.Main(version, channel, goarm) <mask> } <mask> <mask> // memoryUsage implements a couple of not really beautiful hacks which purpose is to <mask> // make OS reclaim the memory freed by AdGuard Home as soon as possible. <mask> func memoryUsage() { <mask> debug.SetGCPercent(10) <mask> <mask> // madvdontneed: setting madvdontneed=1 will use MADV_DONTNEED <mask> // instead of MADV_FREE on Linux when returning memory to the <mask> // kernel. This is less efficient, but causes RSS numbers to drop <mask> // more quickly. <mask> _ = os.Setenv("GODEBUG", "madvdontneed=1") <mask> <mask> // periodically call "debug.FreeOSMemory" so <mask> // that the OS could reclaim the free memory <mask> go func() { <mask> ticker := time.NewTicker(15 * time.Second) <mask> for { <mask> select { <mask> case t := <-ticker.C: <mask> t.Second() <mask> debug.FreeOSMemory() <mask> } <mask> } <mask> }() <mask> } </s> * (global): added --no-mem-optimization flag This commit adds a new command-line argument that disables memory optimizations AGH is using. These memory optimizations might be necessary on low-memory devices, but they aren't free and there's a performance hit (see #2044). Now they can be disabled - just pass --no-mem-optimization when you run AGH or when you install the service -- ./AdGuardHome -s install --no-mem-optimization Closes: #2044 </s> remove memoryUsage() </s> add </s> remove glinetMode bool // Activate GL-Inet mode </s> add // disableMemoryOptimization - disables memory optimization hacks // see memoryUsage() function for the details disableMemoryOptimization bool glinetMode bool // Activate GL-Inet compatibility mode </s> remove "os" "runtime/debug" "time" </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/b3a68bb806dd16228398a64e66ef08b891cb3f30
main.go
import { getTlsStatus } from './encryption';
<mask> <mask> import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; <mask> import { SETTINGS_NAMES, CHECK_TIMEOUT } from '../helpers/constants'; <mask> import Api from '../api/Api'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const addErrorToast = createAction('ADD_ERROR_TOAST'); <mask> export const addSuccessToast = createAction('ADD_SUCCESS_TOAST'); </s> - client: request tls status on app load </s> remove const { getTlsStatus, validateTlsConfig, encryption } = this.props; getTlsStatus(); </s> add const { validateTlsConfig, encryption } = this.props;
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3c2b3a21bc79025bfdf2d829e371d5283815c71
client/src/actions/index.js
dispatch(getTlsStatus());
<mask> dispatch(getClients()); <mask> dispatch(getTopStats()); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(initSettingsFailure()); <mask> } <mask> }; </s> - client: request tls status on app load </s> remove const { getTlsStatus, validateTlsConfig, encryption } = this.props; getTlsStatus(); </s> add const { validateTlsConfig, encryption } = this.props;
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3c2b3a21bc79025bfdf2d829e371d5283815c71
client/src/actions/index.js
const { validateTlsConfig, encryption } = this.props;
<mask> import Loading from '../../ui/Loading'; <mask> <mask> class Encryption extends Component { <mask> componentDidMount() { <mask> const { getTlsStatus, validateTlsConfig, encryption } = this.props; <mask> <mask> getTlsStatus(); <mask> <mask> if (encryption.enabled) { <mask> validateTlsConfig(encryption); <mask> } <mask> } </s> - client: request tls status on app load
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3c2b3a21bc79025bfdf2d829e371d5283815c71
client/src/components/Settings/Encryption/index.js
<mask> func (clients *clientsContainer) AddHost(ip, host string, source clientSource) (bool, error) { <mask> clients.lock.Lock() <mask> defer clients.lock.Unlock() <mask> <mask> // check existing clients first <mask> _, ok := clients.findByIP(ip) <mask> if ok { <mask> return false, nil <mask> } <mask> <mask> // check auto-clients index <mask> ch, ok := clients.ipHost[ip] <mask> if ok && ch.Source > source { <mask> return false, nil <mask> } else if ok { </s> * clients: manual clients don't exclude auto-clients anymore </s> remove func TestClientsAddExistingHost(t *testing.T) { </s> add func TestClientsAddExisting(t *testing.T) { </s> remove assert.False(t, ok) </s> add assert.True(t, ok) </s> remove // try adding a duplicate by IP </s> add // add an auto-client with the same IP - it's allowed </s> remove // don't allow duplicates by CIDR ok, err = clients.AddHost("2.2.2.2", "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the IP from the client1's IP range c = Client{ IDs: []string{"2.2.2.2"}, Name: "client3", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove // try adding a duplicate IP which for a Mac-based client ok, err = clients.AddHost(testIP, "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the same IP as for a client with MAC c = Client{ IDs: []string{testIP}, Name: "client2", } ok, err = clients.Add(c) assert.True(t, ok)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3ddae7f856ec4e798e7a0595ba1644b4b96e873
home/clients.go
func TestClientsAddExisting(t *testing.T) {
<mask> assert.True(t, clients.ipHost["1.1.1.2"] == nil) <mask> _ = clients.Del("client1") <mask> } <mask> <mask> func TestClientsAddExistingHost(t *testing.T) { <mask> var c Client <mask> clients := clientsContainer{} <mask> clients.testing = true <mask> clients.Init(nil, nil) <mask> </s> * clients: manual clients don't exclude auto-clients anymore </s> remove // check existing clients first _, ok := clients.findByIP(ip) if ok { return false, nil } </s> add </s> remove // don't allow duplicates by CIDR ok, err = clients.AddHost("2.2.2.2", "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the IP from the client1's IP range c = Client{ IDs: []string{"2.2.2.2"}, Name: "client3", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove // try adding a duplicate IP which for a Mac-based client ok, err = clients.AddHost(testIP, "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the same IP as for a client with MAC c = Client{ IDs: []string{testIP}, Name: "client2", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove assert.False(t, ok) </s> add assert.True(t, ok) </s> remove // try adding a duplicate by IP </s> add // add an auto-client with the same IP - it's allowed
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3ddae7f856ec4e798e7a0595ba1644b4b96e873
home/clients_test.go
// add an auto-client with the same IP - it's allowed
<mask> ok, err := clients.Add(c) <mask> assert.True(t, ok) <mask> assert.Nil(t, err) <mask> <mask> // try adding a duplicate by IP <mask> ok, err = clients.AddHost("1.1.1.1", "test", ClientSourceRDNS) <mask> assert.False(t, ok) <mask> assert.Nil(t, err) <mask> <mask> // now some more complicated stuff </s> * clients: manual clients don't exclude auto-clients anymore </s> remove assert.False(t, ok) </s> add assert.True(t, ok) </s> remove // don't allow duplicates by CIDR ok, err = clients.AddHost("2.2.2.2", "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the IP from the client1's IP range c = Client{ IDs: []string{"2.2.2.2"}, Name: "client3", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove // try adding a duplicate IP which for a Mac-based client ok, err = clients.AddHost(testIP, "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the same IP as for a client with MAC c = Client{ IDs: []string{testIP}, Name: "client2", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove func TestClientsAddExistingHost(t *testing.T) { </s> add func TestClientsAddExisting(t *testing.T) { </s> remove // check existing clients first _, ok := clients.findByIP(ip) if ok { return false, nil } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3ddae7f856ec4e798e7a0595ba1644b4b96e873
home/clients_test.go
assert.True(t, ok)
<mask> assert.Nil(t, err) <mask> <mask> // try adding a duplicate by IP <mask> ok, err = clients.AddHost("1.1.1.1", "test", ClientSourceRDNS) <mask> assert.False(t, ok) <mask> assert.Nil(t, err) <mask> <mask> // now some more complicated stuff <mask> // first, init a DHCP server with a single static lease <mask> config := dhcpd.ServerConfig{ </s> * clients: manual clients don't exclude auto-clients anymore </s> remove // try adding a duplicate by IP </s> add // add an auto-client with the same IP - it's allowed </s> remove // try adding a duplicate IP which for a Mac-based client ok, err = clients.AddHost(testIP, "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the same IP as for a client with MAC c = Client{ IDs: []string{testIP}, Name: "client2", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove // don't allow duplicates by CIDR ok, err = clients.AddHost("2.2.2.2", "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the IP from the client1's IP range c = Client{ IDs: []string{"2.2.2.2"}, Name: "client3", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove // check existing clients first _, ok := clients.findByIP(ip) if ok { return false, nil } </s> add </s> remove func TestClientsAddExistingHost(t *testing.T) { </s> add func TestClientsAddExisting(t *testing.T) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3ddae7f856ec4e798e7a0595ba1644b4b96e873
home/clients_test.go
// add a new client with the same IP as for a client with MAC c = Client{ IDs: []string{testIP}, Name: "client2", } ok, err = clients.Add(c) assert.True(t, ok)
<mask> Expiry: time.Now().Add(time.Hour), <mask> }) <mask> assert.Nil(t, err) <mask> <mask> // try adding a duplicate IP which for a Mac-based client <mask> ok, err = clients.AddHost(testIP, "test", ClientSourceRDNS) <mask> assert.False(t, ok) <mask> assert.Nil(t, err) <mask> <mask> // don't allow duplicates by CIDR <mask> ok, err = clients.AddHost("2.2.2.2", "test", ClientSourceRDNS) <mask> assert.False(t, ok) </s> * clients: manual clients don't exclude auto-clients anymore </s> remove // don't allow duplicates by CIDR ok, err = clients.AddHost("2.2.2.2", "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the IP from the client1's IP range c = Client{ IDs: []string{"2.2.2.2"}, Name: "client3", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove // try adding a duplicate by IP </s> add // add an auto-client with the same IP - it's allowed </s> remove assert.False(t, ok) </s> add assert.True(t, ok) </s> remove func TestClientsAddExistingHost(t *testing.T) { </s> add func TestClientsAddExisting(t *testing.T) { </s> remove // check existing clients first _, ok := clients.findByIP(ip) if ok { return false, nil } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3ddae7f856ec4e798e7a0595ba1644b4b96e873
home/clients_test.go
// add a new client with the IP from the client1's IP range c = Client{ IDs: []string{"2.2.2.2"}, Name: "client3", } ok, err = clients.Add(c) assert.True(t, ok)
<mask> ok, err = clients.AddHost(testIP, "test", ClientSourceRDNS) <mask> assert.False(t, ok) <mask> assert.Nil(t, err) <mask> <mask> // don't allow duplicates by CIDR <mask> ok, err = clients.AddHost("2.2.2.2", "test", ClientSourceRDNS) <mask> assert.False(t, ok) <mask> assert.Nil(t, err) <mask> } </s> * clients: manual clients don't exclude auto-clients anymore </s> remove // try adding a duplicate IP which for a Mac-based client ok, err = clients.AddHost(testIP, "test", ClientSourceRDNS) assert.False(t, ok) </s> add // add a new client with the same IP as for a client with MAC c = Client{ IDs: []string{testIP}, Name: "client2", } ok, err = clients.Add(c) assert.True(t, ok) </s> remove // try adding a duplicate by IP </s> add // add an auto-client with the same IP - it's allowed </s> remove assert.False(t, ok) </s> add assert.True(t, ok) </s> remove func TestClientsAddExistingHost(t *testing.T) { </s> add func TestClientsAddExisting(t *testing.T) { </s> remove // check existing clients first _, ok := clients.findByIP(ip) if ok { return false, nil } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b3ddae7f856ec4e798e7a0595ba1644b4b96e873
home/clients_test.go
<mask> package home <mask> <mask> import ( <mask> "bufio" <mask> "context" <mask> "crypto/tls" <mask> "crypto/x509" <mask> "fmt" <mask> "io" </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove "io" </s> add </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } } </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return } </s> remove } else { log.Error("This is the first launch of AdGuard Home. You must run it as root.") </s> add // We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53)
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
<mask> "context" <mask> "crypto/tls" <mask> "crypto/x509" <mask> "fmt" <mask> "io" <mask> "io/ioutil" <mask> "net" <mask> "net/http" <mask> "net/url" <mask> "os" </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove "bufio" </s> add </s> remove "os/exec" </s> add </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } } </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
<mask> "net" <mask> "net/http" <mask> "net/url" <mask> "os" <mask> "os/exec" <mask> "os/signal" <mask> "path/filepath" <mask> "runtime" <mask> "strconv" <mask> "strings" </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove "strings" </s> add </s> remove "io" </s> add </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } } </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
<mask> "os/signal" <mask> "path/filepath" <mask> "runtime" <mask> "strconv" <mask> "strings" <mask> "sync" <mask> "syscall" <mask> "time" <mask> <mask> "gopkg.in/natefinch/lumberjack.v2" </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove "os/exec" </s> add </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } } </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return } </s> remove } else { log.Error("This is the first launch of AdGuard Home. You must run it as root.") </s> add // We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
checkPermissions()
<mask> <mask> Context.firstRun = detectFirstRun() <mask> if Context.firstRun { <mask> log.Info("This is the first time AdGuard Home is launched") <mask> requireAdminRights() <mask> } <mask> <mask> initConfig() <mask> <mask> Context.tlsRoots = util.LoadSystemRootCAs() </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return } </s> remove } else { log.Error("This is the first launch of AdGuard Home. You must run it as root.") </s> add // We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53) </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } } </s> remove func requireAdminRights() { admin, _ := util.HaveAdminRights() if //noinspection ALL admin || isdelve.Enabled { // Don't forget that for this to work you need to add "delve" tag explicitly // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program return } </s> add func checkPermissions() { log.Info("Checking if AdGuard Home has necessary permissions")
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
func checkPermissions() { log.Info("Checking if AdGuard Home has necessary permissions")
<mask> } <mask> <mask> // Check if the current user has root (administrator) rights <mask> // and if not, ask and try to run as root <mask> func requireAdminRights() { <mask> admin, _ := util.HaveAdminRights() <mask> if //noinspection ALL <mask> admin || isdelve.Enabled { <mask> // Don't forget that for this to work you need to add "delve" tag explicitly <mask> // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program <mask> return <mask> } <mask> <mask> if runtime.GOOS == "windows" { <mask> log.Fatal("This is the first launch of AdGuard Home. You must run it as Administrator.") <mask> <mask> } else { </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove } else { log.Error("This is the first launch of AdGuard Home. You must run it as root.") </s> add // We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53) </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return } </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
// On Windows we need to have admin rights to run properly admin, _ := util.HaveAdminRights() if //noinspection ALL admin || isdelve.Enabled { // Don't forget that for this to work you need to add "delve" tag explicitly // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program return }
<mask> <mask> if runtime.GOOS == "windows" { <mask> log.Fatal("This is the first launch of AdGuard Home. You must run it as Administrator.") <mask> } <mask> <mask> // We should check if AdGuard Home is able to bind to port 53 </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove } else { log.Error("This is the first launch of AdGuard Home. You must run it as root.") </s> add // We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53) </s> remove func requireAdminRights() { admin, _ := util.HaveAdminRights() if //noinspection ALL admin || isdelve.Enabled { // Don't forget that for this to work you need to add "delve" tag explicitly // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program return } </s> add func checkPermissions() { log.Info("Checking if AdGuard Home has necessary permissions") </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return } </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } }
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
}
<mask> return <mask> } <mask> <mask> log.Fatal("This is the first launch of AdGuard Home. You must run it as Administrator.") <mask> <mask> // We should check if AdGuard Home is able to bind to port 53 <mask> ok, err := util.CanBindPort(53) <mask> <mask> if ok { </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove } else { log.Error("This is the first launch of AdGuard Home. You must run it as root.") </s> add // We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53) </s> remove func requireAdminRights() { admin, _ := util.HaveAdminRights() if //noinspection ALL admin || isdelve.Enabled { // Don't forget that for this to work you need to add "delve" tag explicitly // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program return } </s> add func checkPermissions() { log.Info("Checking if AdGuard Home has necessary permissions") </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return } </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } }
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
// We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53)
<mask> <mask> if runtime.GOOS == "windows" { <mask> log.Fatal("This is the first launch of AdGuard Home. You must run it as Administrator.") <mask> <mask> } else { <mask> log.Error("This is the first launch of AdGuard Home. You must run it as root.") <mask> <mask> _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") <mask> stdin := bufio.NewReader(os.Stdin) <mask> buf, _ := stdin.ReadString('\n') <mask> buf = strings.TrimSpace(buf) </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return } </s> remove func requireAdminRights() { admin, _ := util.HaveAdminRights() if //noinspection ALL admin || isdelve.Enabled { // Don't forget that for this to work you need to add "delve" tag explicitly // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program return } </s> add func checkPermissions() { log.Info("Checking if AdGuard Home has necessary permissions") </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
if ok { log.Info("AdGuard Home can bind to port 53") return }
<mask> <mask> } else { <mask> log.Error("This is the first launch of AdGuard Home. You must run it as root.") <mask> <mask> _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") <mask> stdin := bufio.NewReader(os.Stdin) <mask> buf, _ := stdin.ReadString('\n') <mask> buf = strings.TrimSpace(buf) <mask> if buf != "y" { <mask> os.Exit(1) <mask> } <mask> <mask> cmd := exec.Command("sudo", os.Args...) <mask> cmd.Stdin = os.Stdin <mask> cmd.Stdout = os.Stdout <mask> cmd.Stderr = os.Stderr </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove } else { log.Error("This is the first launch of AdGuard Home. You must run it as root.") </s> add // We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53) </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } } </s> remove requireAdminRights() </s> add checkPermissions() </s> remove func requireAdminRights() { admin, _ := util.HaveAdminRights() if //noinspection ALL admin || isdelve.Enabled { // Don't forget that for this to work you need to add "delve" tag explicitly // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program return } </s> add func checkPermissions() { log.Info("Checking if AdGuard Home has necessary permissions")
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } }
<mask> if buf != "y" { <mask> os.Exit(1) <mask> } <mask> <mask> cmd := exec.Command("sudo", os.Args...) <mask> cmd.Stdin = os.Stdin <mask> cmd.Stdout = os.Stdout <mask> cmd.Stderr = os.Stderr <mask> _ = cmd.Run() <mask> os.Exit(1) <mask> } <mask> } <mask> <mask> // Write PID to a file <mask> func writePIDFile(fn string) bool { </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return } </s> remove } else { log.Error("This is the first launch of AdGuard Home. You must run it as root.") </s> add // We should check if AdGuard Home is able to bind to port 53 ok, err := util.CanBindPort(53) </s> remove requireAdminRights() </s> add checkPermissions() </s> remove func requireAdminRights() { admin, _ := util.HaveAdminRights() if //noinspection ALL admin || isdelve.Enabled { // Don't forget that for this to work you need to add "delve" tag explicitly // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program return } </s> add func checkPermissions() { log.Info("Checking if AdGuard Home has necessary permissions")
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
msg := fmt.Sprintf(`AdGuard failed to bind to port 53 due to %v Please note, that this is crucial for a DNS server to be able to use that port.`, err) log.Info(msg)
<mask> log.Fatal(msg) <mask> } <mask> } <mask> } <mask> } <mask> <mask> // Write PID to a file <mask> func writePIDFile(fn string) bool { </s> *(home): do not require root privileges on the first run Instead of requiring root privileges, we now check if AdGuard Home can bind to privileged ports. If it cannot, we suggest either running it with root privileges or grant CAP_NET_BIND_SERVICE capability. Please note, that on Windows we still require root access. Closes: #1699 </s> remove cmd := exec.Command("sudo", os.Args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr _ = cmd.Run() os.Exit(1) </s> add if opErr, ok := err.(*net.OpError); ok { if sysErr, ok := opErr.Err.(*os.SyscallError); ok { if errno, ok := sysErr.Err.(syscall.Errno); ok && errno == syscall.EACCES { msg := `Permission check failed. AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). Please note, that this is crucial for a server to be able to use privileged ports. You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } } </s> remove func requireAdminRights() { admin, _ := util.HaveAdminRights() if //noinspection ALL admin || isdelve.Enabled { // Don't forget that for this to work you need to add "delve" tag explicitly // https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program return } </s> add func checkPermissions() { log.Info("Checking if AdGuard Home has necessary permissions") </s> remove _, _ = io.WriteString(os.Stdout, "Do you want to start AdGuard Home as root user? [y/n] ") stdin := bufio.NewReader(os.Stdin) buf, _ := stdin.ReadString('\n') buf = strings.TrimSpace(buf) if buf != "y" { os.Exit(1) } </s> add if ok { log.Info("AdGuard Home can bind to port 53") return }
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b43223d30226f70b4616c71429f93a38e89cb163
home/home.go
Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin)))
<mask> } <mask> <mask> // RegisterAuthHandlers - register handlers <mask> func RegisterAuthHandlers() { <mask> http.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) <mask> httpRegister("GET", "/control/logout", handleLogout) <mask> } <mask> <mask> func parseCookie(cookie string) string { <mask> pairs := strings.Split(cookie, ";") </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) http.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> add Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> remove go func() { _ = http.Serve(listener, nil) }() </s> add go func() { _ = http.Serve(listener, mux) }() </s> remove // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPProf(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add </s> remove http.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> add Context.mux.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> remove http.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) </s> add Context.mux.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler)))))
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/auth.go
Context.mux.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON)))
<mask> func registerControlHandlers() { <mask> httpRegister(http.MethodGet, "/control/status", handleStatus) <mask> httpRegister(http.MethodPost, "/control/i18n/change_language", handleI18nChangeLanguage) <mask> httpRegister(http.MethodGet, "/control/i18n/current_language", handleI18nCurrentLanguage) <mask> http.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON))) <mask> httpRegister(http.MethodPost, "/control/update", handleUpdate) <mask> httpRegister(http.MethodGet, "/control/profile", handleGetProfile) <mask> <mask> // No auth is necessary for DOH/DOT configurations <mask> http.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) http.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> add Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> remove http.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> add Context.mux.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> remove // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPProf(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/control.go
Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot))
<mask> httpRegister(http.MethodPost, "/control/update", handleUpdate) <mask> httpRegister(http.MethodGet, "/control/profile", handleGetProfile) <mask> <mask> // No auth is necessary for DOH/DOT configurations <mask> http.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) <mask> http.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) <mask> RegisterAuthHandlers() <mask> } <mask> <mask> func httpRegister(method string, url string, handler func(http.ResponseWriter, *http.Request)) { <mask> if len(method) == 0 { </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON))) </s> add Context.mux.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON))) </s> remove http.HandleFunc(url, postInstall(handler)) </s> add Context.mux.HandleFunc(url, postInstall(handler)) </s> remove http.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> add Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> remove // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPProf(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/control.go
Context.mux.HandleFunc(url, postInstall(handler))
<mask> <mask> func httpRegister(method string, url string, handler func(http.ResponseWriter, *http.Request)) { <mask> if len(method) == 0 { <mask> // "/dns-query" handler doesn't need auth, gzip and isn't restricted by 1 HTTP method <mask> http.HandleFunc(url, postInstall(handler)) <mask> return <mask> } <mask> <mask> http.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) <mask> } </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) http.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> add Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> remove http.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) </s> add Context.mux.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) </s> remove // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPProf(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add </s> remove go func() { _ = http.Serve(listener, nil) }() </s> add go func() { _ = http.Serve(listener, mux) }()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/control.go
Context.mux.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler)))))
<mask> http.HandleFunc(url, postInstall(handler)) <mask> return <mask> } <mask> <mask> http.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) <mask> } <mask> <mask> // ---------------------------------- <mask> // helper functions for HTTP handlers <mask> // ---------------------------------- </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.HandleFunc(url, postInstall(handler)) </s> add Context.mux.HandleFunc(url, postInstall(handler)) </s> remove // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPProf(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add </s> remove http.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> add Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> remove http.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> add Context.mux.Handle("/install.html", preInstallHandler(http.FileServer(box)))
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/control.go
Context.mux.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(web.handleInstallGetAddresses))) Context.mux.HandleFunc("/control/install/check_config", preInstall(ensurePOST(web.handleInstallCheckConfig))) Context.mux.HandleFunc("/control/install/configure", preInstall(ensurePOST(web.handleInstallConfigure)))
<mask> } <mask> } <mask> <mask> func (web *Web) registerInstallHandlers() { <mask> http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(web.handleInstallGetAddresses))) <mask> http.HandleFunc("/control/install/check_config", preInstall(ensurePOST(web.handleInstallCheckConfig))) <mask> http.HandleFunc("/control/install/configure", preInstall(ensurePOST(web.handleInstallConfigure))) <mask> } </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> add Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> remove go func() { _ = http.Serve(listener, nil) }() </s> add go func() { _ = http.Serve(listener, mux) }() </s> remove http.HandleFunc(url, postInstall(handler)) </s> add Context.mux.HandleFunc(url, postInstall(handler))
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/control_install.go
mux := http.NewServeMux() mux.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) {
<mask> "github.com/stretchr/testify/assert" <mask> ) <mask> <mask> func testStartFilterListener() net.Listener { <mask> http.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) { <mask> content := `||example.org^$third-party <mask> # Inline comment example <mask> ||example.com^$third-party <mask> 0.0.0.0 example.com <mask> ` </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPProf(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add </s> remove go func() { _ = http.Serve(listener, nil) }() </s> add go func() { _ = http.Serve(listener, mux) }() </s> remove http.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> add Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> remove "strings" </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/filter_test.go
go func() { _ = http.Serve(listener, mux) }()
<mask> if err != nil { <mask> panic(err) <mask> } <mask> <mask> go func() { _ = http.Serve(listener, nil) }() <mask> return listener <mask> } <mask> <mask> func TestFilters(t *testing.T) { <mask> l := testStartFilterListener() </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove ErrorLog: web.errLogger, Addr: address, Handler: withMiddlewares(http.DefaultServeMux, filterPProf, limitRequestBody), </s> add ErrorLog: web.errLogger, Addr: address, Handler: withMiddlewares(Context.mux, limitRequestBody), ReadTimeout: web.conf.ReadTimeout, ReadHeaderTimeout: web.conf.ReadHeaderTimeout, WriteTimeout: web.conf.WriteTimeout, </s> remove http.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) { </s> add mux := http.NewServeMux() mux.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/filter_test.go
// mux is our custom http.ServeMux. mux *http.ServeMux
<mask> <mask> ipDetector *ipDetector <mask> <mask> // Runtime properties <mask> // -- <mask> <mask> configFilename string // Config filename (can be overridden via the command line arguments) </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> add Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> remove // TODO(a.garipov): We currently have to use this, because everything registers // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP // API initialization process and stop using the gosh darn http.DefaultServeMux // for anything at all. Gosh darn global variables. func filterPProf(h http.Handler) (filtered http.Handler) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/debug/pprof") { http.NotFound(w, r) return } h.ServeHTTP(w, r) }) } </s> add </s> remove http.Handle("/", postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(http.FileServer(box))))) </s> add Context.mux.Handle("/", postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(http.FileServer(box))))) </s> remove http.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) </s> add Context.mux.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler)))))
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/home.go
Context.mux = http.NewServeMux()
<mask> log.Info("Configuration file is OK") <mask> os.Exit(0) <mask> } <mask> } <mask> } <mask> <mask> func setupConfig(args options) { <mask> config.DHCP.WorkDir = Context.workDir </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove go func() { _ = http.Serve(listener, nil) }() </s> add go func() { _ = http.Serve(listener, mux) }() </s> remove http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(web.handleInstallGetAddresses))) http.HandleFunc("/control/install/check_config", preInstall(ensurePOST(web.handleInstallCheckConfig))) http.HandleFunc("/control/install/configure", preInstall(ensurePOST(web.handleInstallConfigure))) </s> add Context.mux.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(web.handleInstallGetAddresses))) Context.mux.HandleFunc("/control/install/check_config", preInstall(ensurePOST(web.handleInstallCheckConfig))) Context.mux.HandleFunc("/control/install/configure", preInstall(ensurePOST(web.handleInstallConfigure))) </s> remove http.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> add Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> remove http.HandleFunc(url, postInstall(handler)) </s> add Context.mux.HandleFunc(url, postInstall(handler))
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/home.go
ReadTimeout: ReadTimeout, ReadHeaderTimeout: ReadHeaderTimeout, WriteTimeout: WriteTimeout,
<mask> firstRun: Context.firstRun, <mask> BindHost: config.BindHost, <mask> BindPort: config.BindPort, <mask> } <mask> Context.web = CreateWeb(&webConf) <mask> if Context.web == nil { <mask> log.Fatalf("Can't initialize Web module") <mask> } </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove go func() { _ = http.Serve(listener, nil) }() </s> add go func() { _ = http.Serve(listener, mux) }() </s> remove http.HandleFunc(url, postInstall(handler)) </s> add Context.mux.HandleFunc(url, postInstall(handler)) </s> remove http.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) http.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> add Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> remove http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(web.handleInstallGetAddresses))) http.HandleFunc("/control/install/check_config", preInstall(ensurePOST(web.handleInstallCheckConfig))) http.HandleFunc("/control/install/configure", preInstall(ensurePOST(web.handleInstallConfigure))) </s> add Context.mux.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(web.handleInstallGetAddresses))) Context.mux.HandleFunc("/control/install/check_config", preInstall(ensurePOST(web.handleInstallCheckConfig))) Context.mux.HandleFunc("/control/install/configure", preInstall(ensurePOST(web.handleInstallConfigure)))
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/home.go
<mask> package home <mask> <mask> import ( <mask> "net/http" <mask> "strings" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghio" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> ) </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) { </s> add mux := http.NewServeMux() mux.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) { </s> remove go func() { _ = http.Serve(listener, nil) }() </s> add go func() { _ = http.Serve(listener, mux) }()
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/middlewares.go
<mask> <mask> h.ServeHTTP(w, r) <mask> }) <mask> } <mask> <mask> // TODO(a.garipov): We currently have to use this, because everything registers <mask> // its HTTP handlers in http.DefaultServeMux. In the future, refactor our HTTP <mask> // API initialization process and stop using the gosh darn http.DefaultServeMux <mask> // for anything at all. Gosh darn global variables. <mask> func filterPProf(h http.Handler) (filtered http.Handler) { <mask> return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { <mask> if strings.HasPrefix(r.URL.Path, "/debug/pprof") { <mask> http.NotFound(w, r) <mask> <mask> return <mask> } <mask> <mask> h.ServeHTTP(w, r) <mask> }) <mask> } </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) </s> add Context.mux.Handle(url, postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(ensureHandler(method, handler))))) </s> remove http.HandleFunc(url, postInstall(handler)) </s> add Context.mux.HandleFunc(url, postInstall(handler)) </s> remove http.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> add Context.mux.Handle("/install.html", preInstallHandler(http.FileServer(box))) </s> remove http.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) { </s> add mux := http.NewServeMux() mux.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) { </s> remove http.Handle("/", postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(http.FileServer(box))))) </s> add Context.mux.Handle("/", postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(http.FileServer(box)))))
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/middlewares.go
"time"
<mask> "net/http" <mask> "strconv" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/util" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/NYTimes/gziphandler" </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove "strings" </s> add </s> remove http.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON))) </s> add Context.mux.HandleFunc("/control/version.json", postInstall(optionalAuth(handleGetVersionJSON))) </s> remove http.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) http.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot)) </s> add Context.mux.HandleFunc("/apple/doh.mobileconfig", postInstall(handleMobileConfigDoh)) Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDot))
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/web.go
const ( // ReadTimeout is the maximum duration for reading the entire request, // including the body. ReadTimeout = 10 * time.Second // ReadHeaderTimeout is the amount of time allowed to read request // headers. ReadHeaderTimeout = 10 * time.Second // WriteTimeout is the maximum duration before timing out writes of the // response. WriteTimeout = 10 * time.Second )
<mask> ) <mask> <mask> type WebConfig struct { <mask> firstRun bool <mask> BindHost string <mask> BindPort int <mask> PortHTTPS int </s> Pull request: 2343 http server Merge in DNS/adguard-home from 2343-http-server to master Closes #2343. Squashed commit of the following: commit f4ebfc129484fc3489409069b3580eb70d71cc74 Merge: b13ec7002 36c7735b8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:37:27 2020 +0300 Merge branch 'master' into 2343-http-server commit b13ec70024f24f6b68b13a1ec6f27c89535feaf8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 15:31:36 2020 +0300 all: record changes commit ce44aac9d43e32db3f68746dec7a4f21b0a9dea4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Nov 25 14:00:45 2020 +0300 home: set http servers timeouts commit 7f3e7385d1df39b39713b8ec443da5d9374d0bc8 Author: Eugene Burkov <e.burkov@adguard.com> Date: Tue Nov 24 19:58:56 2020 +0300 home: replace default ServeMux with custom one. </s> remove http.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) { </s> add mux := http.NewServeMux() mux.HandleFunc("/filters/1.txt", func(w http.ResponseWriter, r *http.Request) { </s> remove http.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> add Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin))) </s> remove "strings" </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/b4a35fa887737e737145edd5ce42dd7fdfea2ee4
internal/home/web.go