docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep add keep keep keep keep
<mask> <mask> class Dns extends Component { <mask> componentDidMount() { <mask> this.props.getAccessList(); <mask> this.props.getRewritesList(); <mask> } <mask> </s> - client: fix upstream DNS servers form Closes #1000 </s> remove import { handleUpstreamChange, setUpstream, testUpstream } from '../actions'; </s> add import { handleUpstreamChange, setUpstream, testUpstream, getDnsSettings } from '../actions'; </s> add transition: 0.3s ease-in-out background-color; } .form-control--textarea-small { min-height: 90px; </s> remove const { processing, processingSet, ...values } = access; </s> add const { processing, processingSet, ...values } = access; </s> remove const { handleSubmit, submitting, invalid } = props; </s> add const { handleSubmit, submitting, invalid, processingSet, } = props; </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> add [actions.getDnsSettingsRequest]: state => ({ ...state, processingDnsSettings: true }), [actions.getDnsSettingsFailure]: state => ({ ...state, processingDnsSettings: false }), [actions.getDnsSettingsSuccess]: (state, { payload }) => { const { upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, } = payload;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/index.js
keep keep add keep keep keep keep keep keep
<mask> toggleRewritesModal, <mask> } = this.props; <mask> <mask> return ( <mask> <Fragment> <mask> <PageTitle title={t('dns_settings')} /> <mask> {isDataLoading && <Loading />} <mask> {isDataReady && ( <mask> <Fragment> </s> - client: fix upstream DNS servers form Closes #1000 </s> remove {(dashboard.processing || access.processing) && <Loading />} {!dashboard.processing && !access.processing && ( </s> add {isDataLoading && <Loading />} {isDataReady && ( </s> remove const { processing, processingSet, ...values } = access; </s> add const { processing, processingSet, ...values } = access; </s> remove const { handleSubmit, submitting, invalid } = props; </s> add const { handleSubmit, submitting, invalid, processingSet, } = props; </s> remove [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), [actions.getClientsSuccess]: (state, { payload }) => { const newState = { ...state, clients: payload.clients, autoClients: payload.autoClients, processingClients: false, }; return newState; </s> add return { ...state, allServers, upstreamDns: (upstreamDns && upstreamDns.join('\n')) || '', bootstrapDns: (bootstrapDns && bootstrapDns.join('\n')) || '', processingDnsSettings: false, }; }, </s> remove announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, </s> add version, running, dns_port: dnsPort, dns_addresses: dnsAddresses, upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, protection_enabled: protectionEnabled, language, http_port: httpPort, </s> remove [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { </s> add const dashboard = handleActions( { [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => {
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/index.js
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> return ( <mask> <Fragment> <mask> <PageTitle title={t('dns_settings')} /> <mask> {(dashboard.processing || access.processing) && <Loading />} <mask> {!dashboard.processing && !access.processing && ( <mask> <Fragment> <mask> <Upstream <mask> upstreamDns={dashboard.upstreamDns} <mask> bootstrapDns={dashboard.bootstrapDns} <mask> allServers={dashboard.allServers} </s> - client: fix upstream DNS servers form Closes #1000 </s> add const isDataLoading = dashboard.processingDnsSettings || access.processing || rewrites.processing; const isDataReady = !dashboard.processingDnsSettings && !access.processing && !rewrites.processing; </s> remove [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), [actions.getClientsSuccess]: (state, { payload }) => { const newState = { ...state, clients: payload.clients, autoClients: payload.autoClients, processingClients: false, }; return newState; </s> add return { ...state, allServers, upstreamDns: (upstreamDns && upstreamDns.join('\n')) || '', bootstrapDns: (bootstrapDns && bootstrapDns.join('\n')) || '', processingDnsSettings: false, }; }, </s> remove const { processing, processingSet, ...values } = access; </s> add const { processing, processingSet, ...values } = access; </s> remove announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, </s> add version, running, dns_port: dnsPort, dns_addresses: dnsAddresses, upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, protection_enabled: protectionEnabled, language, http_port: httpPort, </s> remove const { handleSubmit, submitting, invalid } = props; </s> add const { handleSubmit, submitting, invalid, processingSet, } = props; </s> remove [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { </s> add const dashboard = handleActions( { [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => {
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/index.js
keep keep add keep keep keep keep
<mask> addRewrite: PropTypes.func.isRequired, <mask> deleteRewrite: PropTypes.func.isRequired, <mask> toggleRewritesModal: PropTypes.func.isRequired, <mask> t: PropTypes.func.isRequired, <mask> }; <mask> <mask> export default withNamespaces()(Dns); </s> - client: fix upstream DNS servers form Closes #1000 </s> remove handleSubmit: PropTypes.func, submitting: PropTypes.bool, invalid: PropTypes.bool, initialValues: PropTypes.object, t: PropTypes.func, </s> add handleSubmit: PropTypes.func.isRequired, submitting: PropTypes.bool.isRequired, invalid: PropTypes.bool.isRequired, initialValues: PropTypes.object.isRequired, processingSet: PropTypes.bool.isRequired, t: PropTypes.func.isRequired, </s> add getDnsSettings, </s> remove check: null, leases: [], staticLeases: [], isModalOpen: false, }); </s> add ); </s> remove dispatch(initSettingsFailure()); </s> add dispatch(dnsStatusFailure()); } }; export const getDnsSettingsRequest = createAction('GET_DNS_SETTINGS_REQUEST'); export const getDnsSettingsFailure = createAction('GET_DNS_SETTINGS_FAILURE'); export const getDnsSettingsSuccess = createAction('GET_DNS_SETTINGS_SUCCESS'); export const getDnsSettings = () => async (dispatch) => { dispatch(getDnsSettingsRequest()); try { const dnsStatus = await apiClient.getGlobalStatus(); dispatch(getDnsSettingsSuccess(dnsStatus)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getDnsSettingsFailure()); </s> remove } </s> add }, </s> remove return { ...state, processingVersion: false, }; }, </s> add [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), [actions.toggleProtectionSuccess]: (state) => { const newState = { ...state, protectionEnabled: !state.protectionEnabled, processingProtection: false, }; return newState; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/index.js
keep keep add keep keep keep keep keep keep
<mask> <mask> .form-control--textarea { <mask> min-height: 110px; <mask> } <mask> <mask> .form-control--textarea-large { <mask> min-height: 240px; <mask> } <mask> </s> - client: fix upstream DNS servers form Closes #1000 </s> remove import { handleUpstreamChange, setUpstream, testUpstream } from '../actions'; </s> add import { handleUpstreamChange, setUpstream, testUpstream, getDnsSettings } from '../actions'; </s> remove const { processing, processingSet, ...values } = access; </s> add const { processing, processingSet, ...values } = access; </s> remove const { handleSubmit, submitting, invalid } = props; </s> add const { handleSubmit, submitting, invalid, processingSet, } = props; </s> remove dispatch(initSettingsFailure()); </s> add dispatch(dnsStatusFailure()); } }; export const getDnsSettingsRequest = createAction('GET_DNS_SETTINGS_REQUEST'); export const getDnsSettingsFailure = createAction('GET_DNS_SETTINGS_FAILURE'); export const getDnsSettingsSuccess = createAction('GET_DNS_SETTINGS_SUCCESS'); export const getDnsSettings = () => async (dispatch) => { dispatch(getDnsSettingsRequest()); try { const dnsStatus = await apiClient.getGlobalStatus(); dispatch(getDnsSettingsSuccess(dnsStatus)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getDnsSettingsFailure()); </s> add this.props.getDnsSettings(); </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Settings.css
keep replace keep keep keep keep keep
<mask> import { connect } from 'react-redux'; <mask> import { handleUpstreamChange, setUpstream, testUpstream } from '../actions'; <mask> import { getAccessList, setAccessList } from '../actions/access'; <mask> import { <mask> getRewritesList, <mask> addRewrite, <mask> deleteRewrite, </s> - client: fix upstream DNS servers form Closes #1000 </s> remove const { handleSubmit, submitting, invalid } = props; </s> add const { handleSubmit, submitting, invalid, processingSet, } = props; </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> add getDnsSettings, </s> add transition: 0.3s ease-in-out background-color; } .form-control--textarea-small { min-height: 90px; </s> remove const { processing, processingSet, ...values } = access; </s> add const { processing, processingSet, ...values } = access; </s> add this.props.getDnsSettings();
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/containers/Dns.js
keep keep keep add keep keep keep keep keep keep
<mask> getRewritesList, <mask> addRewrite, <mask> deleteRewrite, <mask> toggleRewritesModal, <mask> }; <mask> <mask> export default connect( <mask> mapStateToProps, <mask> mapDispatchToProps, <mask> )(Dns); </s> - client: fix upstream DNS servers form Closes #1000 </s> remove import { handleUpstreamChange, setUpstream, testUpstream } from '../actions'; </s> add import { handleUpstreamChange, setUpstream, testUpstream, getDnsSettings } from '../actions'; </s> add getDnsSettings: PropTypes.func.isRequired, </s> remove handleSubmit: PropTypes.func, submitting: PropTypes.bool, invalid: PropTypes.bool, initialValues: PropTypes.object, t: PropTypes.func, </s> add handleSubmit: PropTypes.func.isRequired, submitting: PropTypes.bool.isRequired, invalid: PropTypes.bool.isRequired, initialValues: PropTypes.object.isRequired, processingSet: PropTypes.bool.isRequired, t: PropTypes.func.isRequired, </s> remove check: null, leases: [], staticLeases: [], isModalOpen: false, }); </s> add ); </s> remove dispatch(initSettingsFailure()); </s> add dispatch(dnsStatusFailure()); } }; export const getDnsSettingsRequest = createAction('GET_DNS_SETTINGS_REQUEST'); export const getDnsSettingsFailure = createAction('GET_DNS_SETTINGS_FAILURE'); export const getDnsSettingsSuccess = createAction('GET_DNS_SETTINGS_SUCCESS'); export const getDnsSettings = () => async (dispatch) => { dispatch(getDnsSettingsRequest()); try { const dnsStatus = await apiClient.getGlobalStatus(); dispatch(getDnsSettingsSuccess(dnsStatus)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getDnsSettingsFailure()); </s> add const isDataLoading = dashboard.processingDnsSettings || access.processing || rewrites.processing; const isDataReady = !dashboard.processingDnsSettings && !access.processing && !rewrites.processing;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/containers/Dns.js
keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep
<mask> <mask> const settings = handleActions({ <mask> [actions.initSettingsRequest]: state => ({ ...state, processing: true }), <mask> [actions.initSettingsFailure]: state => ({ ...state, processing: false }), <mask> [actions.initSettingsSuccess]: (state, { payload }) => { <mask> const { settingsList } = payload; <mask> const newState = { ...state, settingsList, processing: false }; <mask> return newState; <mask> }, <mask> [actions.toggleSettingStatus]: (state, { payload }) => { <mask> const { settingsList } = state; <mask> const { settingKey } = payload; <mask> <mask> const setting = settingsList[settingKey]; <mask> <mask> const newSetting = { ...setting, enabled: !setting.enabled }; <mask> const newSettingsList = { ...settingsList, [settingKey]: newSetting }; <mask> return { ...state, settingsList: newSettingsList }; <mask> }, <mask> [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), <mask> [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), <mask> [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), <mask> <mask> [actions.testUpstreamRequest]: state => ({ ...state, processingTestUpstream: true }), <mask> [actions.testUpstreamFailure]: state => ({ ...state, processingTestUpstream: false }), <mask> [actions.testUpstreamSuccess]: state => ({ ...state, processingTestUpstream: false }), <mask> }, { <mask> processing: true, <mask> processingTestUpstream: false, <mask> processingSetUpstream: false, <mask> processingDhcpStatus: false, <mask> settingsList: {}, <mask> }); <mask> <mask> const dashboard = handleActions({ <mask> [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), <mask> [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), </s> - client: fix upstream DNS servers form Closes #1000 </s> remove const dashboard = handleActions({ [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => { const { version, running, dns_port: dnsPort, dns_addresses: dnsAddresses, upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, protection_enabled: protectionEnabled, language, http_port: httpPort, } = payload; const newState = { </s> add const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingSetUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingSetUpstream: false }), [actions.setUpstreamSuccess]: (state, { payload }) => ({ </s> remove [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {}, </s> remove [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add [actions.testUpstreamRequest]: state => ({ ...state, processingTestUpstream: true }), [actions.testUpstreamFailure]: state => ({ ...state, processingTestUpstream: false }), [actions.testUpstreamSuccess]: state => ({ ...state, processingTestUpstream: false }), </s> remove const dhcp = handleActions({ [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload; </s> add const dhcp = handleActions( { [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload; </s> add );
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep
<mask> processingDhcpStatus: false, <mask> settingsList: {}, <mask> }); <mask> <mask> const dashboard = handleActions({ <mask> [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), <mask> [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), <mask> [actions.dnsStatusSuccess]: (state, { payload }) => { <mask> const { <mask> version, <mask> running, <mask> dns_port: dnsPort, <mask> dns_addresses: dnsAddresses, <mask> upstream_dns: upstreamDns, <mask> bootstrap_dns: bootstrapDns, <mask> all_servers: allServers, <mask> protection_enabled: protectionEnabled, <mask> language, <mask> http_port: httpPort, <mask> } = payload; <mask> const newState = { <mask> ...state, <mask> isCoreRunning: running, <mask> processing: false, <mask> dnsVersion: version, <mask> dnsPort, <mask> dnsAddresses, <mask> upstreamDns: upstreamDns.join('\n'), <mask> bootstrapDns: bootstrapDns.join('\n'), <mask> allServers, <mask> protectionEnabled, <mask> language, <mask> httpPort, <mask> }; <mask> return newState; <mask> }, <mask> <mask> [actions.enableDnsRequest]: state => ({ ...state, processing: true }), <mask> [actions.enableDnsFailure]: state => ({ ...state, processing: false }), </s> - client: fix upstream DNS servers form Closes #1000 </s> remove announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, </s> add isCoreRunning: running, processing: false, dnsVersion: version, dnsPort, dnsAddresses, upstreamDns: upstreamDns.join('\n'), bootstrapDns: bootstrapDns.join('\n'), allServers, protectionEnabled, language, httpPort, }; return newState; }, [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { const { announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, } = payload; const newState = { ...state, announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, processingVersion: false, }; return newState; } return { ...state, </s> remove announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, </s> add version, running, dns_port: dnsPort, dns_addresses: dnsAddresses, upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, protection_enabled: protectionEnabled, language, http_port: httpPort, </s> remove [actions.testUpstreamRequest]: state => ({ ...state, processingTestUpstream: true }), [actions.testUpstreamFailure]: state => ({ ...state, processingTestUpstream: false }), [actions.testUpstreamSuccess]: state => ({ ...state, processingTestUpstream: false }), }, { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {}, }); </s> add const setting = settingsList[settingKey]; </s> add ); </s> remove [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> add [actions.getDnsSettingsRequest]: state => ({ ...state, processingDnsSettings: true }), [actions.getDnsSettingsFailure]: state => ({ ...state, processingDnsSettings: false }), [actions.getDnsSettingsSuccess]: (state, { payload }) => { const { upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, } = payload;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep replace replace replace replace replace keep replace replace replace replace replace replace keep keep
<mask> <mask> [actions.enableDnsRequest]: state => ({ ...state, processing: true }), <mask> [actions.enableDnsFailure]: state => ({ ...state, processing: false }), <mask> [actions.enableDnsSuccess]: (state) => { <mask> const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; <mask> return newState; <mask> }, <mask> <mask> [actions.disableDnsRequest]: state => ({ ...state, processing: true }), <mask> [actions.disableDnsFailure]: state => ({ ...state, processing: false }), <mask> [actions.disableDnsSuccess]: (state) => { <mask> const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; <mask> return newState; <mask> }, <mask> </s> - client: fix upstream DNS servers form Closes #1000 </s> remove announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, </s> add isCoreRunning: running, processing: false, dnsVersion: version, dnsPort, dnsAddresses, upstreamDns: upstreamDns.join('\n'), bootstrapDns: bootstrapDns.join('\n'), allServers, protectionEnabled, language, httpPort, }; return newState; }, [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { const { announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, } = payload; const newState = { ...state, announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, processingVersion: false, }; return newState; } return { ...state, </s> remove isCoreRunning: running, processing: false, dnsVersion: version, dnsPort, dnsAddresses, upstreamDns: upstreamDns.join('\n'), bootstrapDns: bootstrapDns.join('\n'), allServers, protectionEnabled, language, httpPort, }; return newState; }, </s> add ...payload, processingSetUpstream: false, }), </s> remove [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { </s> add const dashboard = handleActions( { [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => { </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove const dashboard = handleActions({ [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => { const { version, running, dns_port: dnsPort, dns_addresses: dnsAddresses, upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, protection_enabled: protectionEnabled, language, http_port: httpPort, } = payload; const newState = { </s> add const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingSetUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingSetUpstream: false }), [actions.setUpstreamSuccess]: (state, { payload }) => ({
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep add keep keep keep keep keep
<mask> processingSetUpstream: false, <mask> processingDhcpStatus: false, <mask> settingsList: {}, <mask> }, <mask> <mask> const dashboard = handleActions( <mask> { <mask> [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), <mask> [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), </s> - client: fix upstream DNS servers form Closes #1000 </s> remove [actions.testUpstreamRequest]: state => ({ ...state, processingTestUpstream: true }), [actions.testUpstreamFailure]: state => ({ ...state, processingTestUpstream: false }), [actions.testUpstreamSuccess]: state => ({ ...state, processingTestUpstream: false }), }, { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {}, }); </s> add const setting = settingsList[settingKey]; </s> remove const dashboard = handleActions({ [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => { const { version, running, dns_port: dnsPort, dns_addresses: dnsAddresses, upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, protection_enabled: protectionEnabled, language, http_port: httpPort, } = payload; const newState = { </s> add const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingSetUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingSetUpstream: false }), [actions.setUpstreamSuccess]: (state, { payload }) => ({ </s> remove [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {}, </s> remove [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { </s> add const dashboard = handleActions( { [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => { </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove const dhcp = handleActions({ [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload; </s> add const dhcp = handleActions( { [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep replace replace replace replace replace replace keep replace replace replace keep keep keep
<mask> <mask> [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), <mask> [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), <mask> [actions.getVersionSuccess]: (state, { payload }) => { <mask> const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; <mask> <mask> if (payload && versionCompare(currentVersion, payload.new_version) === -1) { <mask> const { <mask> announcement_url: announcementUrl, <mask> new_version: newVersion, <mask> can_autoupdate: canAutoUpdate, <mask> } = payload; <mask> <mask> const newState = { </s> - client: fix upstream DNS servers form Closes #1000 </s> remove announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, </s> add isCoreRunning: running, processing: false, dnsVersion: version, dnsPort, dnsAddresses, upstreamDns: upstreamDns.join('\n'), bootstrapDns: bootstrapDns.join('\n'), allServers, protectionEnabled, language, httpPort, }; return newState; }, [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { const { announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, } = payload; const newState = { ...state, announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, processingVersion: false, }; return newState; } return { ...state, </s> remove [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {}, </s> remove [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; return newState; }, </s> add [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; }, </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove const dhcp = handleActions({ [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload; </s> add const dhcp = handleActions( { [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> } = payload; <mask> <mask> const newState = { <mask> ...state, <mask> announcementUrl, <mask> newVersion, <mask> canAutoUpdate, <mask> isUpdateAvailable: true, <mask> processingVersion: false, <mask> }; <mask> return newState; <mask> } <mask> </s> - client: fix upstream DNS servers form Closes #1000 </s> remove announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, </s> add version, running, dns_port: dnsPort, dns_addresses: dnsAddresses, upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, protection_enabled: protectionEnabled, language, http_port: httpPort, </s> remove [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { </s> add const dashboard = handleActions( { [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => { </s> remove } </s> add }, </s> remove [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; return newState; }, </s> add [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; }, </s> remove const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> add const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> remove [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), [actions.getClientsSuccess]: (state, { payload }) => { const newState = { ...state, clients: payload.clients, autoClients: payload.autoClients, processingClients: false, }; return newState; </s> add return { ...state, allServers, upstreamDns: (upstreamDns && upstreamDns.join('\n')) || '', bootstrapDns: (bootstrapDns && bootstrapDns.join('\n')) || '', processingDnsSettings: false, }; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep add keep keep keep keep keep keep
<mask> processingVersion: false, <mask> }; <mask> return newState; <mask> }, <mask> <mask> [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), <mask> [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), <mask> [actions.toggleProtectionSuccess]: (state) => { </s> - client: fix upstream DNS servers form Closes #1000 </s> remove return { ...state, processingVersion: false, }; }, </s> add [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), [actions.toggleProtectionSuccess]: (state) => { const newState = { ...state, protectionEnabled: !state.protectionEnabled, processingProtection: false, }; return newState; }, </s> remove [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; return newState; }, </s> add [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; }, </s> remove [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), [actions.toggleProtectionSuccess]: (state) => { const newState = { ...state, protectionEnabled: !state.protectionEnabled, processingProtection: false, }; return newState; }, </s> add [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> remove [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {}, </s> remove [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add [actions.testUpstreamRequest]: state => ({ ...state, processingTestUpstream: true }), [actions.testUpstreamFailure]: state => ({ ...state, processingTestUpstream: false }), [actions.testUpstreamSuccess]: state => ({ ...state, processingTestUpstream: false }), </s> remove announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, </s> add isCoreRunning: running, processing: false, dnsVersion: version, dnsPort, dnsAddresses, upstreamDns: upstreamDns.join('\n'), bootstrapDns: bootstrapDns.join('\n'), allServers, protectionEnabled, language, httpPort, }; return newState; }, [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { const { announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, } = payload; const newState = { ...state, announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, processingVersion: false, }; return newState; } return { ...state,
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep keep replace keep replace replace replace replace replace keep keep keep
<mask> isUpdateAvailable: true, <mask> processingVersion: false, <mask> }; <mask> return newState; <mask> } <mask> <mask> return { <mask> ...state, <mask> processingVersion: false, <mask> }; <mask> }, <mask> <mask> [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), <mask> [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), </s> - client: fix upstream DNS servers form Closes #1000 </s> add }, [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; </s> remove [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; return newState; }, </s> add [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; }, </s> remove announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, </s> add isCoreRunning: running, processing: false, dnsVersion: version, dnsPort, dnsAddresses, upstreamDns: upstreamDns.join('\n'), bootstrapDns: bootstrapDns.join('\n'), allServers, protectionEnabled, language, httpPort, }; return newState; }, [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { const { announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, } = payload; const newState = { ...state, announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, processingVersion: false, }; return newState; } return { ...state, </s> remove [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {}, </s> remove }, { processing: true, isCoreRunning: false, processingVersion: true, processingFiltering: true, processingClients: true, processingUpdate: false, upstreamDns: '', bootstrapDns: '', allServers: false, protectionEnabled: false, processingProtection: false, httpPort: 80, dnsPort: 53, dnsAddresses: [], dnsVersion: '', clients: [], autoClients: [], }); </s> add { processing: true, isCoreRunning: false, processingVersion: true, processingFiltering: true, processingClients: true, processingUpdate: false, processingDnsSettings: true, upstreamDns: '', bootstrapDns: '', allServers: false, protectionEnabled: false, processingProtection: false, httpPort: 80, dnsPort: 53, dnsAddresses: [], dnsVersion: '', clients: [], autoClients: [], }, );
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace keep keep keep
<mask> <mask> [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), <mask> [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), <mask> [actions.getUpdateSuccess]: (state) => { <mask> const newState = { ...state, processingUpdate: false }; <mask> return newState; <mask> }, <mask> <mask> [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), <mask> [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), <mask> [actions.toggleProtectionSuccess]: (state) => { <mask> const newState = { <mask> ...state, <mask> protectionEnabled: !state.protectionEnabled, <mask> processingProtection: false, <mask> }; <mask> return newState; <mask> }, <mask> <mask> [actions.handleUpstreamChange]: (state, { payload }) => { <mask> const { upstreamDns } = payload; </s> - client: fix upstream DNS servers form Closes #1000 </s> remove return { ...state, processingVersion: false, }; }, </s> add [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), [actions.toggleProtectionSuccess]: (state) => { const newState = { ...state, protectionEnabled: !state.protectionEnabled, processingProtection: false, }; return newState; }, </s> add }, [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; </s> remove [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> add [actions.getDnsSettingsRequest]: state => ({ ...state, processingDnsSettings: true }), [actions.getDnsSettingsFailure]: state => ({ ...state, processingDnsSettings: false }), [actions.getDnsSettingsSuccess]: (state, { payload }) => { const { upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, } = payload; </s> remove [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; }, </s> add [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), [actions.getClientsSuccess]: (state, { payload }) => { const newState = { ...state, clients: payload.clients, autoClients: payload.autoClients, processingClients: false, }; return newState; }, </s> remove [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), [actions.toggleDhcpSuccess]: (state) => { const { config } = state; const newConfig = { ...config, enabled: !config.enabled }; const newState = { ...state, config: newConfig, check: null, processingDhcp: false, }; return newState; }, </s> add [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), [actions.toggleDhcpSuccess]: (state) => { const { config } = state; const newConfig = { ...config, enabled: !config.enabled }; const newState = { ...state, config: newConfig, check: null, processingDhcp: false, }; return newState; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep replace replace replace replace keep replace replace replace replace keep keep keep
<mask> return newState; <mask> }, <mask> <mask> [actions.handleUpstreamChange]: (state, { payload }) => { <mask> const { upstreamDns } = payload; <mask> return { ...state, upstreamDns }; <mask> }, <mask> <mask> [actions.getLanguageSuccess]: (state, { payload }) => { <mask> const newState = { ...state, language: payload }; <mask> return newState; <mask> }, <mask> <mask> [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), <mask> [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), </s> - client: fix upstream DNS servers form Closes #1000 </s> remove [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), [actions.toggleProtectionSuccess]: (state) => { const newState = { ...state, protectionEnabled: !state.protectionEnabled, processingProtection: false, }; return newState; }, </s> add [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> remove [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), [actions.getClientsSuccess]: (state, { payload }) => { const newState = { ...state, clients: payload.clients, autoClients: payload.autoClients, processingClients: false, }; return newState; </s> add return { ...state, allServers, upstreamDns: (upstreamDns && upstreamDns.join('\n')) || '', bootstrapDns: (bootstrapDns && bootstrapDns.join('\n')) || '', processingDnsSettings: false, }; }, </s> remove [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; return newState; }, </s> add [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; }, </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove [actions.getDhcpInterfacesRequest]: state => ({ ...state, processingInterfaces: true }), [actions.getDhcpInterfacesFailure]: state => ({ ...state, processingInterfaces: false }), [actions.getDhcpInterfacesSuccess]: (state, { payload }) => { const newState = { ...state, interfaces: payload, processingInterfaces: false, }; return newState; }, </s> add [actions.getDhcpInterfacesRequest]: state => ({ ...state, processingInterfaces: true }), [actions.getDhcpInterfacesFailure]: state => ({ ...state, processingInterfaces: false }), [actions.getDhcpInterfacesSuccess]: (state, { payload }) => { const newState = { ...state, interfaces: payload, processingInterfaces: false, }; return newState; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
<mask> return newState; <mask> }, <mask> <mask> [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), <mask> [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), <mask> [actions.getClientsSuccess]: (state, { payload }) => { <mask> const newState = { <mask> ...state, <mask> clients: payload.clients, <mask> autoClients: payload.autoClients, <mask> processingClients: false, <mask> }; <mask> return newState; <mask> }, <mask> }, { <mask> processing: true, <mask> isCoreRunning: false, <mask> processingVersion: true, <mask> processingFiltering: true, <mask> processingClients: true, <mask> processingUpdate: false, <mask> upstreamDns: '', <mask> bootstrapDns: '', <mask> allServers: false, <mask> protectionEnabled: false, <mask> processingProtection: false, <mask> httpPort: 80, <mask> dnsPort: 53, <mask> dnsAddresses: [], <mask> dnsVersion: '', <mask> clients: [], <mask> autoClients: [], <mask> }); <mask> <mask> const dhcp = handleActions({ <mask> [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), <mask> [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), </s> - client: fix upstream DNS servers form Closes #1000 </s> remove [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; }, </s> add [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), [actions.getClientsSuccess]: (state, { payload }) => { const newState = { ...state, clients: payload.clients, autoClients: payload.autoClients, processingClients: false, }; return newState; }, </s> remove const dhcp = handleActions({ [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload; </s> add const dhcp = handleActions( { [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload; </s> remove [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> add [actions.getDnsSettingsRequest]: state => ({ ...state, processingDnsSettings: true }), [actions.getDnsSettingsFailure]: state => ({ ...state, processingDnsSettings: false }), [actions.getDnsSettingsSuccess]: (state, { payload }) => { const { upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, } = payload; </s> remove announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, </s> add isCoreRunning: running, processing: false, dnsVersion: version, dnsPort, dnsAddresses, upstreamDns: upstreamDns.join('\n'), bootstrapDns: bootstrapDns.join('\n'), allServers, protectionEnabled, language, httpPort, }; return newState; }, [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { const { announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, } = payload; const newState = { ...state, announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, processingVersion: false, }; return newState; } return { ...state, </s> remove [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {},
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace keep keep keep
<mask> }); <mask> <mask> const dhcp = handleActions({ <mask> [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), <mask> [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), <mask> [actions.getDhcpStatusSuccess]: (state, { payload }) => { <mask> const { <mask> static_leases: staticLeases, <mask> ...values <mask> } = payload; <mask> <mask> const newState = { <mask> ...state, <mask> staticLeases, <mask> processing: false, <mask> ...values, <mask> }; <mask> <mask> return newState; <mask> }, </s> - client: fix upstream DNS servers form Closes #1000 </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove const dashboard = handleActions({ [actions.dnsStatusRequest]: state => ({ ...state, processing: true }), [actions.dnsStatusFailure]: state => ({ ...state, processing: false }), [actions.dnsStatusSuccess]: (state, { payload }) => { const { version, running, dns_port: dnsPort, dns_addresses: dnsAddresses, upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, protection_enabled: protectionEnabled, language, http_port: httpPort, } = payload; const newState = { </s> add const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingSetUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingSetUpstream: false }), [actions.setUpstreamSuccess]: (state, { payload }) => ({ </s> remove return newState; }, </s> add return newState; }, </s> remove announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, </s> add isCoreRunning: running, processing: false, dnsVersion: version, dnsPort, dnsAddresses, upstreamDns: upstreamDns.join('\n'), bootstrapDns: bootstrapDns.join('\n'), allServers, protectionEnabled, language, httpPort, }; return newState; }, [actions.enableDnsRequest]: state => ({ ...state, processing: true }), [actions.enableDnsFailure]: state => ({ ...state, processing: false }), [actions.enableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; }, [actions.getVersionRequest]: state => ({ ...state, processingVersion: true }), [actions.getVersionFailure]: state => ({ ...state, processingVersion: false }), [actions.getVersionSuccess]: (state, { payload }) => { const currentVersion = state.dnsVersion === 'undefined' ? 0 : state.dnsVersion; if (payload && versionCompare(currentVersion, payload.new_version) === -1) { const { announcement_url: announcementUrl, new_version: newVersion, can_autoupdate: canAutoUpdate, } = payload; const newState = { ...state, announcementUrl, newVersion, canAutoUpdate, isUpdateAvailable: true, processingVersion: false, }; return newState; } return { ...state, </s> remove }, { processing: true, isCoreRunning: false, processingVersion: true, processingFiltering: true, processingClients: true, processingUpdate: false, upstreamDns: '', bootstrapDns: '', allServers: false, protectionEnabled: false, processingProtection: false, httpPort: 80, dnsPort: 53, dnsAddresses: [], dnsVersion: '', clients: [], autoClients: [], }); </s> add { processing: true, isCoreRunning: false, processingVersion: true, processingFiltering: true, processingClients: true, processingUpdate: false, processingDnsSettings: true, upstreamDns: '', bootstrapDns: '', allServers: false, protectionEnabled: false, processingProtection: false, httpPort: 80, dnsPort: 53, dnsAddresses: [], dnsVersion: '', clients: [], autoClients: [], }, );
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep keep replace replace keep keep keep keep keep
<mask> processing: false, <mask> ...values, <mask> }; <mask> <mask> return newState; <mask> }, <mask> <mask> [actions.getDhcpInterfacesRequest]: state => ({ ...state, processingInterfaces: true }), <mask> [actions.getDhcpInterfacesFailure]: state => ({ ...state, processingInterfaces: false }), <mask> [actions.getDhcpInterfacesSuccess]: (state, { payload }) => { <mask> const newState = { </s> - client: fix upstream DNS servers form Closes #1000 </s> remove [actions.getDhcpInterfacesRequest]: state => ({ ...state, processingInterfaces: true }), [actions.getDhcpInterfacesFailure]: state => ({ ...state, processingInterfaces: false }), [actions.getDhcpInterfacesSuccess]: (state, { payload }) => { const newState = { ...state, interfaces: payload, processingInterfaces: false, }; return newState; }, </s> add [actions.getDhcpInterfacesRequest]: state => ({ ...state, processingInterfaces: true }), [actions.getDhcpInterfacesFailure]: state => ({ ...state, processingInterfaces: false }), [actions.getDhcpInterfacesSuccess]: (state, { payload }) => { const newState = { ...state, interfaces: payload, processingInterfaces: false, }; return newState; }, </s> remove const newState = { ...state, staticLeases, processing: false, ...values, }; </s> add const newState = { ...state, staticLeases, processing: false, ...values, }; </s> remove [actions.removeStaticLeaseRequest]: state => ({ ...state, processingDeleting: true }), [actions.removeStaticLeaseFailure]: state => ({ ...state, processingDeleting: false }), [actions.removeStaticLeaseSuccess]: (state, { payload }) => { const leaseToRemove = payload.ip; const leases = state.staticLeases.filter(item => item.ip !== leaseToRemove); const newState = { ...state, staticLeases: leases, processingDeleting: false, }; return newState; </s> add [actions.removeStaticLeaseRequest]: state => ({ ...state, processingDeleting: true }), [actions.removeStaticLeaseFailure]: state => ({ ...state, processingDeleting: false }), [actions.removeStaticLeaseSuccess]: (state, { payload }) => { const leaseToRemove = payload.ip; const leases = state.staticLeases.filter(item => item.ip !== leaseToRemove); const newState = { ...state, staticLeases: leases, processingDeleting: false, }; return newState; }, </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove [actions.disableDnsRequest]: state => ({ ...state, processing: true }), [actions.disableDnsFailure]: state => ({ ...state, processing: false }), [actions.disableDnsSuccess]: (state) => { const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false }; return newState; </s> add { processing: true, processingTestUpstream: false, processingSetUpstream: false, processingDhcpStatus: false, settingsList: {}, </s> remove [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; return newState; }, </s> add [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace keep keep keep
<mask> }, <mask> <mask> [actions.getDhcpInterfacesRequest]: state => ({ ...state, processingInterfaces: true }), <mask> [actions.getDhcpInterfacesFailure]: state => ({ ...state, processingInterfaces: false }), <mask> [actions.getDhcpInterfacesSuccess]: (state, { payload }) => { <mask> const newState = { <mask> ...state, <mask> interfaces: payload, <mask> processingInterfaces: false, <mask> }; <mask> return newState; <mask> }, <mask> <mask> [actions.findActiveDhcpRequest]: state => ({ ...state, processingStatus: true }), <mask> [actions.findActiveDhcpFailure]: state => ({ ...state, processingStatus: false }), <mask> [actions.findActiveDhcpSuccess]: (state, { payload }) => { <mask> const { <mask> other_server: otherServer, <mask> static_ip: staticIP, <mask> } = payload; <mask> <mask> const newState = { <mask> ...state, </s> - client: fix upstream DNS servers form Closes #1000 </s> remove return newState; }, </s> add return newState; }, </s> remove const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> add const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> remove [actions.removeStaticLeaseRequest]: state => ({ ...state, processingDeleting: true }), [actions.removeStaticLeaseFailure]: state => ({ ...state, processingDeleting: false }), [actions.removeStaticLeaseSuccess]: (state, { payload }) => { const leaseToRemove = payload.ip; const leases = state.staticLeases.filter(item => item.ip !== leaseToRemove); const newState = { ...state, staticLeases: leases, processingDeleting: false, }; return newState; </s> add [actions.removeStaticLeaseRequest]: state => ({ ...state, processingDeleting: true }), [actions.removeStaticLeaseFailure]: state => ({ ...state, processingDeleting: false }), [actions.removeStaticLeaseSuccess]: (state, { payload }) => { const leaseToRemove = payload.ip; const leases = state.staticLeases.filter(item => item.ip !== leaseToRemove); const newState = { ...state, staticLeases: leases, processingDeleting: false, }; return newState; }, </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> add [actions.getDnsSettingsRequest]: state => ({ ...state, processingDnsSettings: true }), [actions.getDnsSettingsFailure]: state => ({ ...state, processingDnsSettings: false }), [actions.getDnsSettingsSuccess]: (state, { payload }) => { const { upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, } = payload;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace
<mask> <mask> const newState = { <mask> ...state, <mask> check: { <mask> otherServer, <mask> staticIP, <mask> }, <mask> processingStatus: false, <mask> }; <mask> return newState; <mask> }, <mask> <mask> [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), <mask> [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), <mask> [actions.toggleDhcpSuccess]: (state) => { <mask> const { config } = state; <mask> const newConfig = { ...config, enabled: !config.enabled }; <mask> const newState = { <mask> ...state, config: newConfig, check: null, processingDhcp: false, <mask> }; <mask> return newState; <mask> }, </s> - client: fix upstream DNS servers form Closes #1000 </s> remove [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), [actions.setDhcpConfigSuccess]: (state, { payload }) => { const { config } = state; const newConfig = { ...config, ...payload }; const newState = { ...state, config: newConfig, processingConfig: false }; return newState; }, </s> add [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), [actions.setDhcpConfigSuccess]: (state, { payload }) => { const { config } = state; const newConfig = { ...config, ...payload }; const newState = { ...state, config: newConfig, processingConfig: false }; return newState; }, </s> remove [actions.findActiveDhcpRequest]: state => ({ ...state, processingStatus: true }), [actions.findActiveDhcpFailure]: state => ({ ...state, processingStatus: false }), [actions.findActiveDhcpSuccess]: (state, { payload }) => { const { other_server: otherServer, static_ip: staticIP, } = payload; </s> add [actions.findActiveDhcpRequest]: state => ({ ...state, processingStatus: true }), [actions.findActiveDhcpFailure]: state => ({ ...state, processingStatus: false }), [actions.findActiveDhcpSuccess]: (state, { payload }) => { const { other_server: otherServer, static_ip: staticIP } = payload; </s> remove [actions.toggleLeaseModal]: (state) => { const newState = { ...state, isModalOpen: !state.isModalOpen, }; return newState; }, </s> add [actions.toggleLeaseModal]: (state) => { const newState = { ...state, isModalOpen: !state.isModalOpen, }; return newState; }, </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; return newState; }, </s> add [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep keep replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace
<mask> }; <mask> return newState; <mask> }, <mask> <mask> [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), <mask> [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), <mask> [actions.setDhcpConfigSuccess]: (state, { payload }) => { <mask> const { config } = state; <mask> const newConfig = { ...config, ...payload }; <mask> const newState = { ...state, config: newConfig, processingConfig: false }; <mask> return newState; <mask> }, <mask> <mask> [actions.toggleLeaseModal]: (state) => { <mask> const newState = { <mask> ...state, <mask> isModalOpen: !state.isModalOpen, <mask> }; <mask> return newState; <mask> }, </s> - client: fix upstream DNS servers form Closes #1000 </s> remove [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), [actions.toggleDhcpSuccess]: (state) => { const { config } = state; const newConfig = { ...config, enabled: !config.enabled }; const newState = { ...state, config: newConfig, check: null, processingDhcp: false, }; return newState; }, </s> add [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), [actions.toggleDhcpSuccess]: (state) => { const { config } = state; const newConfig = { ...config, enabled: !config.enabled }; const newState = { ...state, config: newConfig, check: null, processingDhcp: false, }; return newState; }, </s> remove const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> add const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> remove [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), [actions.toggleProtectionSuccess]: (state) => { const newState = { ...state, protectionEnabled: !state.protectionEnabled, processingProtection: false, }; return newState; }, </s> add [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove [actions.getUpdateRequest]: state => ({ ...state, processingUpdate: true }), [actions.getUpdateFailure]: state => ({ ...state, processingUpdate: false }), [actions.getUpdateSuccess]: (state) => { const newState = { ...state, processingUpdate: false }; return newState; }, </s> add [actions.handleUpstreamChange]: (state, { payload }) => { const { upstreamDns } = payload; return { ...state, upstreamDns }; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
<mask> return newState; <mask> }, <mask> <mask> [actions.addStaticLeaseRequest]: state => ({ ...state, processingAdding: true }), <mask> [actions.addStaticLeaseFailure]: state => ({ ...state, processingAdding: false }), <mask> [actions.addStaticLeaseSuccess]: (state, { payload }) => { <mask> const { <mask> ip, mac, hostname, <mask> } = payload; <mask> const newLease = { <mask> ip, <mask> mac, <mask> hostname: hostname || '', <mask> }; <mask> const leases = [...state.staticLeases, newLease]; <mask> const newState = { <mask> ...state, <mask> staticLeases: leases, <mask> processingAdding: false, <mask> }; <mask> return newState; <mask> }, <mask> <mask> [actions.removeStaticLeaseRequest]: state => ({ ...state, processingDeleting: true }), <mask> [actions.removeStaticLeaseFailure]: state => ({ ...state, processingDeleting: false }), <mask> [actions.removeStaticLeaseSuccess]: (state, { payload }) => { <mask> const leaseToRemove = payload.ip; <mask> const leases = state.staticLeases.filter(item => item.ip !== leaseToRemove); <mask> const newState = { <mask> ...state, <mask> staticLeases: leases, <mask> processingDeleting: false, <mask> }; <mask> return newState; <mask> }, <mask> }, { <mask> processing: true, <mask> processingStatus: false, </s> - client: fix upstream DNS servers form Closes #1000 </s> remove [actions.toggleLeaseModal]: (state) => { const newState = { ...state, isModalOpen: !state.isModalOpen, }; return newState; }, </s> add [actions.toggleLeaseModal]: (state) => { const newState = { ...state, isModalOpen: !state.isModalOpen, }; return newState; }, </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove [actions.getDhcpInterfacesRequest]: state => ({ ...state, processingInterfaces: true }), [actions.getDhcpInterfacesFailure]: state => ({ ...state, processingInterfaces: false }), [actions.getDhcpInterfacesSuccess]: (state, { payload }) => { const newState = { ...state, interfaces: payload, processingInterfaces: false, }; return newState; }, </s> add [actions.getDhcpInterfacesRequest]: state => ({ ...state, processingInterfaces: true }), [actions.getDhcpInterfacesFailure]: state => ({ ...state, processingInterfaces: false }), [actions.getDhcpInterfacesSuccess]: (state, { payload }) => { const newState = { ...state, interfaces: payload, processingInterfaces: false, }; return newState; }, </s> remove [actions.findActiveDhcpRequest]: state => ({ ...state, processingStatus: true }), [actions.findActiveDhcpFailure]: state => ({ ...state, processingStatus: false }), [actions.findActiveDhcpSuccess]: (state, { payload }) => { const { other_server: otherServer, static_ip: staticIP, } = payload; </s> add [actions.findActiveDhcpRequest]: state => ({ ...state, processingStatus: true }), [actions.findActiveDhcpFailure]: state => ({ ...state, processingStatus: false }), [actions.findActiveDhcpSuccess]: (state, { payload }) => { const { other_server: otherServer, static_ip: staticIP } = payload; </s> remove [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; }, </s> add [actions.getDnsSettingsRequest]: state => ({ ...state, processingDnsSettings: true }), [actions.getDnsSettingsFailure]: state => ({ ...state, processingDnsSettings: false }), [actions.getDnsSettingsSuccess]: (state, { payload }) => { const { upstream_dns: upstreamDns, bootstrap_dns: bootstrapDns, all_servers: allServers, } = payload;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace keep keep keep
<mask> }, <mask> }, { <mask> processing: true, <mask> processingStatus: false, <mask> processingInterfaces: false, <mask> processingDhcp: false, <mask> processingConfig: false, <mask> processingAdding: false, <mask> processingDeleting: false, <mask> config: { <mask> enabled: false, <mask> }, <mask> check: null, <mask> leases: [], <mask> staticLeases: [], <mask> isModalOpen: false, <mask> }); <mask> <mask> export default combineReducers({ <mask> settings, </s> - client: fix upstream DNS servers form Closes #1000 </s> remove [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), [actions.toggleDhcpSuccess]: (state) => { const { config } = state; const newConfig = { ...config, enabled: !config.enabled }; const newState = { ...state, config: newConfig, check: null, processingDhcp: false, }; return newState; }, </s> add [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), [actions.toggleDhcpSuccess]: (state) => { const { config } = state; const newConfig = { ...config, enabled: !config.enabled }; const newState = { ...state, config: newConfig, check: null, processingDhcp: false, }; return newState; }, </s> remove }, { processing: true, isCoreRunning: false, processingVersion: true, processingFiltering: true, processingClients: true, processingUpdate: false, upstreamDns: '', bootstrapDns: '', allServers: false, protectionEnabled: false, processingProtection: false, httpPort: 80, dnsPort: 53, dnsAddresses: [], dnsVersion: '', clients: [], autoClients: [], }); </s> add { processing: true, isCoreRunning: false, processingVersion: true, processingFiltering: true, processingClients: true, processingUpdate: false, processingDnsSettings: true, upstreamDns: '', bootstrapDns: '', allServers: false, protectionEnabled: false, processingProtection: false, httpPort: 80, dnsPort: 53, dnsAddresses: [], dnsVersion: '', clients: [], autoClients: [], }, ); </s> remove [actions.removeStaticLeaseRequest]: state => ({ ...state, processingDeleting: true }), [actions.removeStaticLeaseFailure]: state => ({ ...state, processingDeleting: false }), [actions.removeStaticLeaseSuccess]: (state, { payload }) => { const leaseToRemove = payload.ip; const leases = state.staticLeases.filter(item => item.ip !== leaseToRemove); const newState = { ...state, staticLeases: leases, processingDeleting: false, }; return newState; </s> add [actions.removeStaticLeaseRequest]: state => ({ ...state, processingDeleting: true }), [actions.removeStaticLeaseFailure]: state => ({ ...state, processingDeleting: false }), [actions.removeStaticLeaseSuccess]: (state, { payload }) => { const leaseToRemove = payload.ip; const leases = state.staticLeases.filter(item => item.ip !== leaseToRemove); const newState = { ...state, staticLeases: leases, processingDeleting: false, }; return newState; }, </s> remove const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> add const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> remove [actions.toggleLeaseModal]: (state) => { const newState = { ...state, isModalOpen: !state.isModalOpen, }; return newState; }, </s> add [actions.toggleLeaseModal]: (state) => { const newState = { ...state, isModalOpen: !state.isModalOpen, }; return newState; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/reducers/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> package dnsforward <mask> <mask> import ( <mask> "crypto/tls" <mask> "errors" <mask> "fmt" <mask> "net" <mask> "net/http" <mask> "runtime" <mask> "strings" </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove "fmt" </s> add </s> remove "github.com/AdguardTeam/dnsproxy/upstream" </s> add "github.com/AdguardTeam/AdGuardHome/dnsforward" </s> remove "github.com/AdguardTeam/dnsproxy/upstream" </s> add </s> remove github.com/AdguardTeam/dnsproxy v0.22.0 </s> add github.com/AdguardTeam/dnsproxy v0.23.0 </s> remove const ( rdnsTimeout = 3 * time.Second // max time to wait for rDNS response ) </s> add </s> remove stats stats.Stats // statistics module queryLog querylog.QueryLog // query log module auth *Auth // HTTP authentication module </s> add auth *Auth // HTTP authentication module
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep add keep keep keep keep keep
<mask> stats stats.Stats <mask> access *accessCtx <mask> <mask> webRegistered bool <mask> isRunning bool <mask> <mask> sync.RWMutex <mask> conf ServerConfig </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> add isRunning bool </s> remove clients clientsContainer // per-client-settings module </s> add </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> remove return config.dnsServer != nil && config.dnsServer.IsRunning() </s> add return Context.dnsServer != nil && Context.dnsServer.IsRunning() </s> add // HTTPSServer - HTTPS Server </s> add return nil
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep add keep keep keep keep keep
<mask> internalProxy *proxy.Proxy <mask> <mask> webRegistered bool <mask> <mask> sync.RWMutex <mask> conf ServerConfig <mask> } <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> add // DNS proxy instance for internal usage // We don't Start() it and so no listen port is required. internalProxy *proxy.Proxy </s> remove s.limit = conf.LimitDays * 24 s.conf = conf </s> add s.conf = &Config{} *s.conf = conf s.conf.limit = conf.LimitDays * 24 </s> remove return config.dnsServer != nil && config.dnsServer.IsRunning() </s> add return Context.dnsServer != nil && Context.dnsServer.IsRunning() </s> add s.isRunning = false </s> remove limit uint32 // maximum time we need to keep data for (in hours) db *bolt.DB conf Config </s> add db *bolt.DB conf *Config </s> remove config.stats, err = stats.New(statsConf) </s> add Context.stats, err = stats.New(statsConf)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep keep add keep keep keep keep keep keep
<mask> s.Lock() <mask> s.dnsFilter = nil <mask> s.stats = nil <mask> s.queryLog = nil <mask> s.Unlock() <mask> } <mask> <mask> // WriteDiskConfig - write configuration <mask> func (s *Server) WriteDiskConfig(c *FilteringConfig) { <mask> s.Lock() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.prepare(nil) </s> add err := s.Prepare(nil) </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> remove func (s *Server) Start(config *ServerConfig) error { </s> add func (s *Server) Start() error { </s> remove return s.startInternal(config) </s> add return s.startInternal() </s> remove func (s *Server) prepare(config *ServerConfig) error { if s.dnsProxy != nil { return errors.New("DNS server is already started") } </s> add func (s *Server) Prepare(config *ServerConfig) error { </s> add s.isRunning = false
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep replace keep keep replace
<mask> // Start starts the DNS server <mask> func (s *Server) Start(config *ServerConfig) error { <mask> s.Lock() <mask> defer s.Unlock() <mask> return s.startInternal(config) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove func (s *Server) startInternal(config *ServerConfig) error { err := s.prepare(config) if err != nil { return err </s> add func (s *Server) startInternal() error { err := s.dnsProxy.Start() if err == nil { s.isRunning = true </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> remove err := s.prepare(nil) </s> add err := s.Prepare(nil) </s> remove func (s *Server) prepare(config *ServerConfig) error { if s.dnsProxy != nil { return errors.New("DNS server is already started") } </s> add func (s *Server) Prepare(config *ServerConfig) error { </s> add s.dnsProxy = nil
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep replace replace replace replace keep replace keep keep
<mask> <mask> // startInternal starts without locking <mask> func (s *Server) startInternal(config *ServerConfig) error { <mask> err := s.prepare(config) <mask> if err != nil { <mask> return err <mask> } <mask> return s.dnsProxy.Start() <mask> } <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove return s.startInternal(config) </s> add return s.startInternal() </s> remove s.dnsProxy = nil </s> add </s> remove func (s *Server) prepare(config *ServerConfig) error { if s.dnsProxy != nil { return errors.New("DNS server is already started") } </s> add func (s *Server) Prepare(config *ServerConfig) error { </s> remove err := s.prepare(nil) </s> add err := s.Prepare(nil) </s> remove func (s *Server) Start(config *ServerConfig) error { </s> add func (s *Server) Start() error {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> return s.dnsProxy.Start() <mask> } <mask> <mask> // Prepare the object <mask> func (s *Server) prepare(config *ServerConfig) error { <mask> if s.dnsProxy != nil { <mask> return errors.New("DNS server is already started") <mask> } <mask> <mask> if config != nil { <mask> s.conf = *config <mask> } <mask> <mask> if len(s.conf.UpstreamDNS) == 0 { </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove return s.dnsProxy.Start() </s> add return err </s> remove func (s *Server) startInternal(config *ServerConfig) error { err := s.prepare(config) if err != nil { return err </s> add func (s *Server) startInternal() error { err := s.dnsProxy.Start() if err == nil { s.isRunning = true </s> remove s.dnsProxy = nil </s> add </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> add s.isRunning = false </s> remove func (s *Server) Start(config *ServerConfig) error { </s> add func (s *Server) Start() error {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep add keep keep keep keep
<mask> } <mask> <mask> s.access = &accessCtx{} <mask> err = s.access.Init(s.conf.AllowedClients, s.conf.DisallowedClients, s.conf.BlockedHosts) <mask> if err != nil { <mask> return err </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start() </s> remove err = s.startInternal(config) </s> add err = s.Prepare(config) if err != nil { return errorx.Decorate(err, "could not reconfigure the server") } err = s.startInternal() </s> remove initDNSServer() </s> add err = initDNSServer() if err != nil { log.Fatalf("%s", err) } </s> remove err = s.startInternal(nil) </s> add err = s.startInternal() </s> remove initDNSServer() err = startDNSServer() if err != nil { </s> add err = initDNSServer() var err2 error if err == nil { err2 = startDNSServer() } if err != nil || err2 != nil { </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> // stopInternal stops without locking <mask> func (s *Server) stopInternal() error { <mask> if s.dnsProxy != nil { <mask> err := s.dnsProxy.Stop() <mask> s.dnsProxy = nil <mask> if err != nil { <mask> return errorx.Decorate(err, "could not stop the DNS server properly") <mask> } <mask> } <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove func (s *Server) startInternal(config *ServerConfig) error { err := s.prepare(config) if err != nil { return err </s> add func (s *Server) startInternal() error { err := s.dnsProxy.Start() if err == nil { s.isRunning = true </s> remove return s.dnsProxy.Start() </s> add return err </s> remove err = s.startInternal(nil) </s> add err = s.startInternal() </s> remove func (s *Server) prepare(config *ServerConfig) error { if s.dnsProxy != nil { return errors.New("DNS server is already started") } </s> add func (s *Server) Prepare(config *ServerConfig) error { </s> remove err = s.startInternal(config) </s> add err = s.Prepare(config) if err != nil { return errorx.Decorate(err, "could not reconfigure the server") } err = s.startInternal() </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep add keep keep keep keep keep
<mask> } <mask> } <mask> <mask> return nil <mask> } <mask> <mask> // IsRunning returns true if the DNS server is running <mask> func (s *Server) IsRunning() bool { </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> remove func (s *Server) prepare(config *ServerConfig) error { if s.dnsProxy != nil { return errors.New("DNS server is already started") } </s> add func (s *Server) Prepare(config *ServerConfig) error { </s> remove func (s *Server) Start(config *ServerConfig) error { </s> add func (s *Server) Start() error { </s> remove s.dnsProxy = nil </s> add </s> remove func (s *Server) startInternal(config *ServerConfig) error { err := s.prepare(config) if err != nil { return err </s> add func (s *Server) startInternal() error { err := s.dnsProxy.Start() if err == nil { s.isRunning = true </s> remove return s.startInternal(config) </s> add return s.startInternal()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> <mask> // IsRunning returns true if the DNS server is running <mask> func (s *Server) IsRunning() bool { <mask> s.RLock() <mask> isRunning := true <mask> if s.dnsProxy == nil { <mask> isRunning = false <mask> } <mask> s.RUnlock() <mask> return isRunning <mask> } <mask> <mask> // Restart - restart server <mask> func (s *Server) Restart() error { <mask> s.Lock() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> add s.isRunning = false </s> remove func (s *Server) prepare(config *ServerConfig) error { if s.dnsProxy != nil { return errors.New("DNS server is already started") } </s> add func (s *Server) Prepare(config *ServerConfig) error { </s> remove s.dnsProxy = nil </s> add </s> remove func (s *Server) Start(config *ServerConfig) error { </s> add func (s *Server) Start() error { </s> remove func (s *Server) startInternal(config *ServerConfig) error { err := s.prepare(config) if err != nil { return err </s> add func (s *Server) startInternal() error { err := s.dnsProxy.Start() if err == nil { s.isRunning = true </s> remove return s.startInternal(config) </s> add return s.startInternal()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> err := s.stopInternal() <mask> if err != nil { <mask> return errorx.Decorate(err, "could not reconfigure the server") <mask> } <mask> err = s.startInternal(nil) <mask> if err != nil { <mask> return errorx.Decorate(err, "could not reconfigure the server") <mask> } <mask> <mask> return nil </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err = s.startInternal(config) </s> add err = s.Prepare(config) if err != nil { return errorx.Decorate(err, "could not reconfigure the server") } err = s.startInternal() </s> remove s.dnsProxy = nil </s> add </s> remove err := config.dhcpServer.Init(config.DHCP) </s> add err := Context.dhcpServer.Init(config.DHCP) </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start() </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> if runtime.GOOS == "windows" { <mask> time.Sleep(1 * time.Second) <mask> } <mask> <mask> err = s.startInternal(config) <mask> if err != nil { <mask> return errorx.Decorate(err, "could not reconfigure the server") <mask> } <mask> <mask> return nil </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err = s.startInternal(nil) </s> add err = s.startInternal() </s> remove s.dnsProxy = nil </s> add </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start() </s> remove err := config.dhcpServer.Init(config.DHCP) </s> add err := Context.dhcpServer.Init(config.DHCP) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward.go
keep keep keep keep replace keep keep keep keep keep
<mask> ) <mask> <mask> func TestServer(t *testing.T) { <mask> s := createTestServer(t) <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> <mask> // message over UDP </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> func TestServerWithProtectionDisabled(t *testing.T) { <mask> s := createTestServer(t) <mask> s.conf.ProtectionEnabled = false <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> <mask> // message over UDP </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep add keep keep keep keep
<mask> } <mask> <mask> // Starting the server <mask> err := s.Start() <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> PrivateKeyData: keyPem, <mask> } <mask> <mask> // Starting the server <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> <mask> // Add our self-signed generated config to roots </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> add _ = s.Prepare(nil) </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> func TestServerRace(t *testing.T) { <mask> s := createTestServer(t) <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> <mask> // message over UDP </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> func TestSafeSearch(t *testing.T) { <mask> s := createTestServer(t) <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> <mask> // Test safe search for yandex. We already know safe search ip </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> func TestInvalidRequest(t *testing.T) { <mask> s := createTestServer(t) <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> <mask> // server is running, send a message </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> func TestBlockedRequest(t *testing.T) { <mask> s := createTestServer(t) <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP) <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> func (s *Server) startWithUpstream(u upstream.Upstream) error { <mask> s.Lock() <mask> defer s.Unlock() <mask> err := s.prepare(nil) <mask> if err != nil { <mask> return err <mask> } <mask> s.dnsProxy.Upstreams = []upstream.Upstream{u} <mask> return s.dnsProxy.Start() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove func (s *Server) startInternal(config *ServerConfig) error { err := s.prepare(config) if err != nil { return err </s> add func (s *Server) startInternal() error { err := s.dnsProxy.Start() if err == nil { s.isRunning = true </s> remove return s.startInternal(config) </s> add return s.startInternal() </s> remove func (s *Server) Start(config *ServerConfig) error { </s> add func (s *Server) Start() error { </s> remove return s.dnsProxy.Start() </s> add return err </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> remove func (s *Server) prepare(config *ServerConfig) error { if s.dnsProxy != nil { return errors.New("DNS server is already started") } </s> add func (s *Server) Prepare(config *ServerConfig) error {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> func TestNullBlockedRequest(t *testing.T) { <mask> s := createTestServer(t) <mask> s.conf.FilteringConfig.BlockingMode = "null_ip" <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP) <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> func TestBlockedByHosts(t *testing.T) { <mask> s := createTestServer(t) <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP) <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> func TestBlockedBySafeBrowsing(t *testing.T) { <mask> s := createTestServer(t) <mask> err := s.Start(nil) <mask> if err != nil { <mask> t.Fatalf("Failed to start server: %s", err) <mask> } <mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP) <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep add keep keep keep keep keep
<mask> s.conf.UpstreamDNS = []string{"8.8.8.8:53", "8.8.4.4:53"} <mask> s.conf.FilteringConfig.ProtectionEnabled = true <mask> return s <mask> } <mask> <mask> func createServerTLSConfig(t *testing.T) (*tls.Config, []byte, []byte) { <mask> privateKey, err := rsa.GenerateKey(rand.Reader, 2048) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start() </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> go 1.13 <mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.22.0 <mask> github.com/AdguardTeam/golibs v0.3.0 <mask> github.com/AdguardTeam/urlfilter v0.7.0 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/etcd-io/bbolt v1.3.3 <mask> github.com/go-test/deep v1.0.4 // indirect </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove github.com/AdguardTeam/dnsproxy v0.22.0 h1:8mpPu+KN0puFTHNhGy7XQ13fe3+3DGFaiwnqhNMWl+M= github.com/AdguardTeam/dnsproxy v0.22.0/go.mod h1:2qy8rpdfBzKgMPxkHmPdaNK4XZJ322v4KtVGI8s8Bn0= </s> add github.com/AdguardTeam/dnsproxy v0.23.0 h1:GrOUapcWjf19MF8NznZUbcYujBbl7QXapBWTFKqkJQg= github.com/AdguardTeam/dnsproxy v0.23.0/go.mod h1:2qy8rpdfBzKgMPxkHmPdaNK4XZJ322v4KtVGI8s8Bn0= </s> remove "fmt" </s> add </s> remove "errors" </s> add </s> remove config.httpsServer.cond = sync.NewCond(&config.httpsServer.Mutex) </s> add Context.httpsServer.cond = sync.NewCond(&Context.httpsServer.Mutex) </s> remove const ( rdnsTimeout = 3 * time.Second // max time to wait for rDNS response ) </s> add </s> remove initDNSServer() </s> add err = initDNSServer() if err != nil { log.Fatalf("%s", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
go.mod
replace replace keep keep keep keep keep
<mask> github.com/AdguardTeam/dnsproxy v0.22.0 h1:8mpPu+KN0puFTHNhGy7XQ13fe3+3DGFaiwnqhNMWl+M= <mask> github.com/AdguardTeam/dnsproxy v0.22.0/go.mod h1:2qy8rpdfBzKgMPxkHmPdaNK4XZJ322v4KtVGI8s8Bn0= <mask> github.com/AdguardTeam/golibs v0.2.4 h1:GUssokegKxKF13K67Pgl0ZGwqHjNN6X7sep5ik6ORdY= <mask> github.com/AdguardTeam/golibs v0.2.4/go.mod h1:R3M+mAg3nWG4X4Hsag5eef/TckHFH12ZYhK7AzJc8+U= <mask> github.com/AdguardTeam/golibs v0.3.0 h1:1zO8ulGEOdXDDM++Ap4sYfTsT/Z4tZBZtiWSA4ykcOU= <mask> github.com/AdguardTeam/golibs v0.3.0/go.mod h1:R3M+mAg3nWG4X4Hsag5eef/TckHFH12ZYhK7AzJc8+U= <mask> github.com/AdguardTeam/gomitmproxy v0.1.2/go.mod h1:Mrt/3EfiXIYY2aZ7KsLuCUJzUARD/fWJ119IfzOB13M= </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove github.com/AdguardTeam/dnsproxy v0.22.0 </s> add github.com/AdguardTeam/dnsproxy v0.23.0 </s> remove a := convertMapToArray(m, int(limit)) </s> add a := convertMapToArray(m, int(maxCount)) </s> remove config.queryLog.WriteDiskConfig(&dc) </s> add Context.queryLog.WriteDiskConfig(&dc) </s> remove config.dhcpServer.WriteDiskConfig(&c) </s> add Context.dhcpServer.WriteDiskConfig(&c) </s> remove if config.dhcpServer != nil { </s> add if Context.dhcpServer != nil { </s> remove config.dnsServer.WriteDiskConfig(&c) </s> add Context.dnsServer.WriteDiskConfig(&c)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
go.sum
keep keep replace replace keep replace replace replace replace replace replace replace replace keep keep keep
<mask> // WriteDiskConfig - write configuration <mask> func (clients *clientsContainer) WriteDiskConfig(objects *[]clientObject) { <mask> clientsList := clients.GetList() <mask> for _, cli := range clientsList { <mask> cy := clientObject{ <mask> Name: cli.Name, <mask> IDs: cli.IDs, <mask> UseGlobalSettings: !cli.UseOwnSettings, <mask> FilteringEnabled: cli.FilteringEnabled, <mask> ParentalEnabled: cli.ParentalEnabled, <mask> SafeSearchEnabled: cli.SafeSearchEnabled, <mask> SafeBrowsingEnabled: cli.SafeBrowsingEnabled, <mask> <mask> UseGlobalBlockedServices: !cli.UseOwnBlockedServices, <mask> BlockedServices: cli.BlockedServices, <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove BlockedServices: cli.BlockedServices, Upstreams: cli.Upstreams, </s> add </s> remove a := convertMapToArray(m, int(limit)) </s> add a := convertMapToArray(m, int(maxCount)) </s> add s.dnsProxy = nil </s> remove config.dnsctx.rdns.Begin(ip) </s> add Context.rdns.Begin(ip) </s> remove topClients := config.stats.GetTopClientsIP(topClientsNumber) </s> add topClients := Context.stats.GetTopClientsIP(topClientsNumber)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/clients.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> SafeSearchEnabled: cli.SafeSearchEnabled, <mask> SafeBrowsingEnabled: cli.SafeBrowsingEnabled, <mask> <mask> UseGlobalBlockedServices: !cli.UseOwnBlockedServices, <mask> BlockedServices: cli.BlockedServices, <mask> <mask> Upstreams: cli.Upstreams, <mask> } <mask> *objects = append(*objects, cy) <mask> } <mask> } <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove Name: cli.Name, IDs: cli.IDs, UseGlobalSettings: !cli.UseOwnSettings, FilteringEnabled: cli.FilteringEnabled, ParentalEnabled: cli.ParentalEnabled, SafeSearchEnabled: cli.SafeSearchEnabled, SafeBrowsingEnabled: cli.SafeBrowsingEnabled, </s> add Name: cli.Name, UseGlobalSettings: !cli.UseOwnSettings, FilteringEnabled: cli.FilteringEnabled, ParentalEnabled: cli.ParentalEnabled, SafeSearchEnabled: cli.SafeSearchEnabled, SafeBrowsingEnabled: cli.SafeBrowsingEnabled, </s> add cy.IDs = make([]string, len(cli.IDs)) copy(cy.IDs, cli.IDs) cy.BlockedServices = make([]string, len(cli.BlockedServices)) copy(cy.BlockedServices, cli.BlockedServices) cy.Upstreams = make([]string, len(cli.Upstreams)) copy(cy.Upstreams, cli.Upstreams) </s> add clients.lock.Unlock() </s> add intlProxyConfig := proxy.Config{ CacheEnabled: true, CacheSizeBytes: 4096, Upstreams: s.conf.Upstreams, DomainsReservedUpstreams: s.conf.DomainsReservedUpstreams, } s.internalProxy = &proxy.Proxy{Config: intlProxyConfig} </s> remove _ = config.dnsFilter.SetFilters(filters, async) </s> add _ = Context.dnsFilter.SetFilters(filters, async) </s> remove err = config.httpsServer.server.ListenAndServeTLS("", "") </s> add err = Context.httpsServer.server.ListenAndServeTLS("", "")
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/clients.go
keep keep add keep keep keep keep keep
<mask> SafeBrowsingEnabled: cli.SafeBrowsingEnabled, <mask> UseGlobalBlockedServices: !cli.UseOwnBlockedServices, <mask> } <mask> *objects = append(*objects, cy) <mask> } <mask> clients.lock.Unlock() <mask> } <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove BlockedServices: cli.BlockedServices, Upstreams: cli.Upstreams, </s> add </s> add clients.lock.Unlock() </s> remove Name: cli.Name, IDs: cli.IDs, UseGlobalSettings: !cli.UseOwnSettings, FilteringEnabled: cli.FilteringEnabled, ParentalEnabled: cli.ParentalEnabled, SafeSearchEnabled: cli.SafeSearchEnabled, SafeBrowsingEnabled: cli.SafeBrowsingEnabled, </s> add Name: cli.Name, UseGlobalSettings: !cli.UseOwnSettings, FilteringEnabled: cli.FilteringEnabled, ParentalEnabled: cli.ParentalEnabled, SafeSearchEnabled: cli.SafeSearchEnabled, SafeBrowsingEnabled: cli.SafeBrowsingEnabled, </s> remove // GetList returns the pointer to clients list func (clients *clientsContainer) GetList() map[string]*Client { return clients.list } </s> add </s> remove _ = config.dnsFilter.SetFilters(filters, async) </s> add _ = Context.dnsFilter.SetFilters(filters, async) </s> remove err = config.httpsServer.server.ListenAndServeTLS("", "") </s> add err = Context.httpsServer.server.ListenAndServeTLS("", "")
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/clients.go
keep add keep keep keep keep keep keep
<mask> *objects = append(*objects, cy) <mask> } <mask> } <mask> <mask> func (clients *clientsContainer) periodicUpdate() { <mask> for { <mask> clients.addFromHostsFile() <mask> clients.addFromSystemARP() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove BlockedServices: cli.BlockedServices, Upstreams: cli.Upstreams, </s> add </s> add cy.IDs = make([]string, len(cli.IDs)) copy(cy.IDs, cli.IDs) cy.BlockedServices = make([]string, len(cli.BlockedServices)) copy(cy.BlockedServices, cli.BlockedServices) cy.Upstreams = make([]string, len(cli.Upstreams)) copy(cy.Upstreams, cli.Upstreams) </s> remove // GetList returns the pointer to clients list func (clients *clientsContainer) GetList() map[string]*Client { return clients.list } </s> add </s> remove clientsList := clients.GetList() for _, cli := range clientsList { </s> add clients.lock.Lock() for _, cli := range clients.list { </s> remove func InitRDNS(clients *clientsContainer) *RDNS { </s> add func InitRDNS(dnsServer *dnsforward.Server, clients *clientsContainer) *RDNS { </s> remove Name: cli.Name, IDs: cli.IDs, UseGlobalSettings: !cli.UseOwnSettings, FilteringEnabled: cli.FilteringEnabled, ParentalEnabled: cli.ParentalEnabled, SafeSearchEnabled: cli.SafeSearchEnabled, SafeBrowsingEnabled: cli.SafeBrowsingEnabled, </s> add Name: cli.Name, UseGlobalSettings: !cli.UseOwnSettings, FilteringEnabled: cli.FilteringEnabled, ParentalEnabled: cli.ParentalEnabled, SafeSearchEnabled: cli.SafeSearchEnabled, SafeBrowsingEnabled: cli.SafeBrowsingEnabled,
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/clients.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> time.Sleep(clientsUpdatePeriod) <mask> } <mask> } <mask> <mask> // GetList returns the pointer to clients list <mask> func (clients *clientsContainer) GetList() map[string]*Client { <mask> return clients.list <mask> } <mask> <mask> // Exists checks if client with this IP already exists <mask> func (clients *clientsContainer) Exists(ip string, source clientSource) bool { <mask> clients.lock.Lock() <mask> defer clients.lock.Unlock() <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> add clients.lock.Unlock() </s> remove clientsList := clients.GetList() for _, cli := range clientsList { </s> add clients.lock.Lock() for _, cli := range clients.list { </s> remove c, ok := config.clients.Find(clientAddr) </s> add c, ok := Context.clients.Find(clientAddr) </s> add s.isRunning = false </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> remove func InitRDNS(clients *clientsContainer) *RDNS { </s> add func InitRDNS(dnsServer *dnsforward.Server, clients *clientsContainer) *RDNS {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/clients.go
keep keep add keep keep keep keep keep
<mask> Verbose bool `yaml:"verbose"` // If true, verbose logging is enabled <mask> } <mask> <mask> type HTTPSServer struct { <mask> server *http.Server <mask> cond *sync.Cond // reacts to config.TLS.Enabled, PortHTTPS, CertificateChain and PrivateKey <mask> sync.Mutex // protects config.TLS <mask> shutdown bool // if TRUE, don't restart the server </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> remove clients clientsContainer // per-client-settings module </s> add </s> add s.isRunning = false </s> add // DNS proxy instance for internal usage // We don't Start() it and so no listen port is required. internalProxy *proxy.Proxy </s> remove dnsctx dnsContext dnsFilter *dnsfilter.Dnsfilter dnsServer *dnsforward.Server dhcpServer *dhcpd.Server httpServer *http.Server httpsServer HTTPSServer </s> add </s> remove limit uint32 // maximum time we need to keep data for (in hours) db *bolt.DB conf Config </s> add db *bolt.DB conf *Config
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep keep keep keep replace keep keep keep replace replace replace
<mask> // runningAsService flag is set to true when options are passed from the service runner <mask> runningAsService bool <mask> disableUpdate bool // If set, don't check for updates <mask> appSignalChannel chan os.Signal <mask> clients clientsContainer // per-client-settings module <mask> controlLock sync.Mutex <mask> transport *http.Transport <mask> client *http.Client <mask> stats stats.Stats // statistics module <mask> queryLog querylog.QueryLog // query log module <mask> auth *Auth // HTTP authentication module </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> add dnsServer *dnsforward.Server </s> remove ipChannel chan string // pass data from DNS request handling thread to rDNS thread upstream upstream.Upstream // Upstream object for our own DNS server </s> add ipChannel chan string // pass data from DNS request handling thread to rDNS thread </s> add // DNS proxy instance for internal usage // We don't Start() it and so no listen port is required. internalProxy *proxy.Proxy </s> add // HTTPSServer - HTTPS Server </s> remove const ( rdnsTimeout = 3 * time.Second // max time to wait for rDNS response ) </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
<mask> // cached version.json to avoid hammering github.io for each page reload <mask> versionCheckJSON []byte <mask> versionCheckLastTime time.Time <mask> <mask> dnsctx dnsContext <mask> dnsFilter *dnsfilter.Dnsfilter <mask> dnsServer *dnsforward.Server <mask> dhcpServer *dhcpd.Server <mask> httpServer *http.Server <mask> httpsServer HTTPSServer <mask> <mask> BindHost string `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to <mask> BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server <mask> Users []User `yaml:"users"` // Users that can access HTTP server <mask> Language string `yaml:"language"` // two-letter ISO 639-1 language code <mask> RlimitNoFile uint `yaml:"rlimit_nofile"` // Maximum number of opened fd's per process (0: default) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove stats stats.Stats // statistics module queryLog querylog.QueryLog // query log module auth *Auth // HTTP authentication module </s> add auth *Auth // HTTP authentication module </s> remove ipChannel chan string // pass data from DNS request handling thread to rDNS thread upstream upstream.Upstream // Upstream object for our own DNS server </s> add ipChannel chan string // pass data from DNS request handling thread to rDNS thread </s> add dnsServer *dnsforward.Server </s> add // HTTPSServer - HTTPS Server </s> remove err := config.httpServer.ListenAndServe() </s> add err := Context.httpServer.ListenAndServe() </s> remove func initDNSServer() { </s> add func initDNSServer() error {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> func (c *configuration) write() error { <mask> c.Lock() <mask> defer c.Unlock() <mask> <mask> config.clients.WriteDiskConfig(&config.Clients) <mask> <mask> if config.auth != nil { <mask> config.Users = config.auth.GetUsers() <mask> } <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove if config.stats != nil { </s> add if Context.stats != nil { </s> remove config.dnsctx.rdns = InitRDNS(&config.clients) config.dnsctx.whois = initWhois(&config.clients) </s> add Context.rdns = InitRDNS(Context.dnsServer, &Context.clients) Context.whois = initWhois(&Context.clients) </s> remove err := s.prepare(nil) </s> add err := s.Prepare(nil) </s> remove config.dnsServer = dnsforward.NewServer(config.dnsFilter, config.stats, config.queryLog) </s> add Context.dnsServer = dnsforward.NewServer(Context.dnsFilter, Context.stats, Context.queryLog) dnsConfig := generateServerConfig() err = Context.dnsServer.Prepare(&dnsConfig) if err != nil { return fmt.Errorf("dnsServer.Prepare: %s", err) } </s> remove func (s *Server) prepare(config *ServerConfig) error { if s.dnsProxy != nil { return errors.New("DNS server is already started") } </s> add func (s *Server) Prepare(config *ServerConfig) error { </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep replace keep keep keep keep keep keep keep replace keep keep
<mask> <mask> if config.stats != nil { <mask> sdc := stats.DiskConfig{} <mask> config.stats.WriteDiskConfig(&sdc) <mask> config.DNS.StatsInterval = sdc.Interval <mask> } <mask> <mask> if config.stats != nil { <mask> sdc := stats.DiskConfig{} <mask> config.stats.WriteDiskConfig(&sdc) <mask> config.DNS.StatsInterval = sdc.Interval <mask> } </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove if config.queryLog != nil { </s> add if Context.queryLog != nil { </s> remove if config.dnsFilter != nil { </s> add if Context.dnsFilter != nil { </s> remove if config.dhcpServer != nil { </s> add if Context.dhcpServer != nil { </s> remove if config.dnsServer != nil { </s> add if Context.dnsServer != nil { </s> remove config.dnsFilter.WriteDiskConfig(&c) </s> add Context.dnsFilter.WriteDiskConfig(&c)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep keep keep keep replace keep replace keep
<mask> config.stats.WriteDiskConfig(&sdc) <mask> config.DNS.StatsInterval = sdc.Interval <mask> } <mask> <mask> if config.queryLog != nil { <mask> dc := querylog.DiskConfig{} <mask> config.queryLog.WriteDiskConfig(&dc) <mask> config.DNS.QueryLogEnabled = dc.Enabled </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.stats.WriteDiskConfig(&sdc) </s> add Context.stats.WriteDiskConfig(&sdc) </s> remove if config.stats != nil { </s> add if Context.stats != nil { </s> remove config.queryLog = querylog.New(conf) </s> add Context.queryLog = querylog.New(conf) </s> remove if config.dnsFilter != nil { </s> add if Context.dnsFilter != nil { </s> remove config.queryLog.Close() config.queryLog = nil </s> add Context.queryLog.Close() Context.queryLog = nil
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep keep replace keep keep keep keep keep keep keep replace keep keep
<mask> } <mask> <mask> if config.dnsFilter != nil { <mask> c := dnsfilter.Config{} <mask> config.dnsFilter.WriteDiskConfig(&c) <mask> config.DNS.DnsfilterConf = c <mask> } <mask> <mask> if config.dnsFilter != nil { <mask> c := dnsfilter.Config{} <mask> config.dnsFilter.WriteDiskConfig(&c) <mask> config.DNS.DnsfilterConf = c <mask> } </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove if config.dnsServer != nil { </s> add if Context.dnsServer != nil { </s> remove config.dnsServer.WriteDiskConfig(&c) </s> add Context.dnsServer.WriteDiskConfig(&c) </s> remove if config.dhcpServer != nil { </s> add if Context.dhcpServer != nil { </s> remove config.dhcpServer.WriteDiskConfig(&c) </s> add Context.dhcpServer.WriteDiskConfig(&c) </s> remove if config.dnsServer != nil { config.dnsServer.WriteDiskConfig(&c) </s> add if Context.dnsServer != nil { Context.dnsServer.WriteDiskConfig(&c)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep keep replace keep keep keep keep keep keep keep replace
<mask> } <mask> <mask> if config.dnsServer != nil { <mask> c := dnsforward.FilteringConfig{} <mask> config.dnsServer.WriteDiskConfig(&c) <mask> config.DNS.FilteringConfig = c <mask> } <mask> <mask> if config.dnsServer != nil { <mask> c := dnsforward.FilteringConfig{} <mask> config.dnsServer.WriteDiskConfig(&c) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsFilter.WriteDiskConfig(&c) </s> add Context.dnsFilter.WriteDiskConfig(&c) </s> remove if config.dhcpServer != nil { </s> add if Context.dhcpServer != nil { </s> remove if config.dnsServer != nil { config.dnsServer.WriteDiskConfig(&c) </s> add if Context.dnsServer != nil { Context.dnsServer.WriteDiskConfig(&c) </s> remove if config.dnsFilter != nil { </s> add if Context.dnsFilter != nil { </s> remove config.dhcpServer.WriteDiskConfig(&c) </s> add Context.dhcpServer.WriteDiskConfig(&c)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep keep keep replace keep keep keep keep keep keep keep replace
<mask> config.DNS.FilteringConfig = c <mask> } <mask> <mask> if config.dhcpServer != nil { <mask> c := dhcpd.ServerConfig{} <mask> config.dhcpServer.WriteDiskConfig(&c) <mask> config.DHCP = c <mask> } <mask> <mask> if config.dhcpServer != nil { <mask> c := dhcpd.ServerConfig{} <mask> config.dhcpServer.WriteDiskConfig(&c) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsServer.WriteDiskConfig(&c) </s> add Context.dnsServer.WriteDiskConfig(&c) </s> remove if config.dnsServer != nil { </s> add if Context.dnsServer != nil { </s> remove config.dnsFilter.WriteDiskConfig(&c) </s> add Context.dnsFilter.WriteDiskConfig(&c) </s> remove if config.dnsFilter != nil { </s> add if Context.dnsFilter != nil { </s> remove if config.dnsServer != nil { config.dnsServer.WriteDiskConfig(&c) </s> add if Context.dnsServer != nil { Context.dnsServer.WriteDiskConfig(&c)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/config.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> } <mask> <mask> func handleStatus(w http.ResponseWriter, r *http.Request) { <mask> c := dnsforward.FilteringConfig{} <mask> if config.dnsServer != nil { <mask> config.dnsServer.WriteDiskConfig(&c) <mask> } <mask> data := map[string]interface{}{ <mask> "dns_addresses": getDNSAddresses(), <mask> "http_port": config.BindPort, <mask> "dns_port": config.DNS.Port, </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsServer.WriteDiskConfig(&c) </s> add Context.dnsServer.WriteDiskConfig(&c) </s> remove if config.dnsServer != nil { </s> add if Context.dnsServer != nil { </s> remove config.dnsFilter.WriteDiskConfig(&c) </s> add Context.dnsFilter.WriteDiskConfig(&c) </s> remove units := Hours if s.limit/24 > 7 { units = Days } </s> add </s> remove if config.dhcpServer != nil { </s> add if Context.dhcpServer != nil { </s> remove resp.IntervalDays = s.limit / 24 </s> add resp.IntervalDays = s.conf.limit / 24
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/control.go
keep keep keep keep replace keep keep keep keep keep
<mask> httpError(w, http.StatusInternalServerError, "DNS server is not running") <mask> return <mask> } <mask> <mask> config.dnsServer.ServeHTTP(w, r) <mask> } <mask> <mask> // ------------------------ <mask> // registration of handlers <mask> // ------------------------ </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove httpError(w, http.StatusInternalServerError, "Couldn't start DNS server: %s", err) </s> add if err != nil { httpError(w, http.StatusInternalServerError, "Couldn't initialize DNS server: %s", err) } else { httpError(w, http.StatusInternalServerError, "Couldn't start DNS server: %s", err2) } </s> add s.isRunning = false </s> remove s.dnsProxy = nil </s> add </s> remove initDNSServer() err = startDNSServer() if err != nil { </s> add err = initDNSServer() var err2 error if err == nil { err2 = startDNSServer() } if err != nil || err2 != nil { </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning </s> remove err = s.startInternal(nil) </s> add err = s.startInternal()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/control.go
keep replace replace replace replace keep keep replace keep keep keep keep
<mask> <mask> initDNSServer() <mask> <mask> err = startDNSServer() <mask> if err != nil { <mask> config.firstRun = true <mask> copyInstallSettings(&config, &curConfig) <mask> httpError(w, http.StatusInternalServerError, "Couldn't start DNS server: %s", err) <mask> return <mask> } <mask> <mask> u := User{} </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove initDNSServer() </s> add err = initDNSServer() if err != nil { log.Fatalf("%s", err) } </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start() </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> add _ = s.Prepare(nil) </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/control_install.go
keep keep keep keep replace keep keep keep keep keep
<mask> // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block <mask> // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely <mask> if restartHTTP { <mask> go func() { <mask> _ = config.httpServer.Shutdown(context.TODO()) <mask> }() <mask> } <mask> <mask> returnOK(w) <mask> } </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.httpsServer.cond.L.Lock() config.httpsServer.cond.Broadcast() if config.httpsServer.server != nil { config.httpsServer.server.Shutdown(context.TODO()) </s> add Context.httpsServer.cond.L.Lock() Context.httpsServer.cond.Broadcast() if Context.httpsServer.server != nil { Context.httpsServer.server.Shutdown(context.TODO()) </s> remove a := convertMapToArray(m, int(limit)) </s> add a := convertMapToArray(m, int(maxCount)) </s> remove for !config.httpsServer.shutdown { </s> add for !Context.httpsServer.shutdown { </s> remove config.httpsServer.cond = sync.NewCond(&config.httpsServer.Mutex) </s> add Context.httpsServer.cond = sync.NewCond(&Context.httpsServer.Mutex) </s> add dnsServer *dnsforward.Server </s> remove if len(a) != int(s.limit/24) { log.Fatalf("len(a) != s.limit: %d %d", len(a), s.limit) </s> add if len(a) != int(limit/24) { log.Fatalf("len(a) != limit: %d %d", len(a), limit)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/control_install.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // check if port is available <mask> // BUT: if we are already using this port, no need <mask> alreadyRunning := false <mask> if config.httpsServer.server != nil { <mask> alreadyRunning = true <mask> } <mask> if !alreadyRunning { <mask> err = checkPortAvailable(config.BindHost, data.PortHTTPS) <mask> if err != nil { </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove if config.httpsServer.server != nil { </s> add if Context.httpsServer.server != nil { </s> remove if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && config.httpsServer.server != nil { </s> add if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && Context.httpsServer.server != nil { </s> remove initDNSServer() </s> add err = initDNSServer() if err != nil { log.Fatalf("%s", err) } </s> remove initDNSServer() err = startDNSServer() if err != nil { </s> add err = initDNSServer() var err2 error if err == nil { err2 = startDNSServer() } if err != nil || err2 != nil { </s> remove config.httpsServer.shutdown = true if config.httpsServer.server != nil { config.httpsServer.server.Shutdown(context.TODO()) </s> add Context.httpsServer.shutdown = true if Context.httpsServer.server != nil { Context.httpsServer.server.Shutdown(context.TODO()) </s> add s.isRunning = false
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/control_tls.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // check if port is available <mask> // BUT: if we are already using this port, no need <mask> alreadyRunning := false <mask> if config.httpsServer.server != nil { <mask> alreadyRunning = true <mask> } <mask> if !alreadyRunning { <mask> err = checkPortAvailable(config.BindHost, data.PortHTTPS) <mask> if err != nil { </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/control_tls.go
keep keep keep replace replace replace replace keep replace
<mask> if restartHTTPS { <mask> go func() { <mask> time.Sleep(time.Second) // TODO: could not find a way to reliably know that data was fully sent to client by https server, so we wait a bit to let response through before closing the server <mask> config.httpsServer.cond.L.Lock() <mask> config.httpsServer.cond.Broadcast() <mask> if config.httpsServer.server != nil { <mask> config.httpsServer.server.Shutdown(context.TODO()) <mask> } <mask> config.httpsServer.cond.L.Unlock() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := config.httpServer.ListenAndServe() </s> add err := Context.httpServer.ListenAndServe() </s> remove _ = config.httpServer.Shutdown(context.TODO()) </s> add _ = Context.httpServer.Shutdown(context.TODO()) </s> remove func initDNSServer() { </s> add func initDNSServer() error { </s> remove config.httpsServer.shutdown = true if config.httpsServer.server != nil { config.httpsServer.server.Shutdown(context.TODO()) </s> add Context.httpsServer.shutdown = true if Context.httpsServer.server != nil { Context.httpsServer.server.Shutdown(context.TODO()) </s> remove for !config.httpsServer.shutdown { </s> add for !Context.httpsServer.shutdown {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/control_tls.go
keep replace keep keep keep keep replace keep keep
<mask> <mask> err := config.dhcpServer.Init(config.DHCP) <mask> if err != nil { <mask> return errorx.Decorate(err, "Couldn't init DHCP server") <mask> } <mask> <mask> err = config.dhcpServer.Start() <mask> if err != nil { <mask> return errorx.Decorate(err, "Couldn't start DHCP server") </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := config.dhcpServer.Stop() </s> add err := Context.dhcpServer.Stop() </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start() </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove err = s.startInternal(nil) </s> add err = s.startInternal() </s> remove err = s.startInternal(config) </s> add err = s.Prepare(config) if err != nil { return errorx.Decorate(err, "could not reconfigure the server") } err = s.startInternal()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dhcp.go
keep keep keep keep replace keep keep keep keep keep
<mask> if !config.DHCP.Enabled { <mask> return nil <mask> } <mask> <mask> err := config.dhcpServer.Stop() <mask> if err != nil { <mask> return errorx.Decorate(err, "Couldn't stop DHCP server") <mask> } <mask> <mask> return nil </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start() </s> remove err := config.dhcpServer.Init(config.DHCP) </s> add err := Context.dhcpServer.Init(config.DHCP) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start() </s> remove if !isRunning() { return nil } err := config.dnsServer.Stop() </s> add err := Context.dnsServer.Stop() </s> remove err = s.startInternal(nil) </s> add err = s.startInternal()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dhcp.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/joomcode/errorx" <mask> ) <mask> <mask> type dnsContext struct { <mask> rdns *RDNS <mask> whois *Whois <mask> } <mask> <mask> // Called by other modules when configuration is changed <mask> func onConfigModified() { <mask> _ = config.write() <mask> } <mask> </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove "github.com/AdguardTeam/dnsproxy/upstream" </s> add </s> remove const ( rdnsTimeout = 3 * time.Second // max time to wait for rDNS response ) </s> add </s> remove _, _ = config.clients.AddHost(ip, host, ClientSourceRDNS) </s> add _, _ = r.clients.AddHost(ip, host, ClientSourceRDNS) </s> remove limit uint32 // maximum time we need to keep data for (in hours) db *bolt.DB conf Config </s> add db *bolt.DB conf *Config </s> remove func InitRDNS(clients *clientsContainer) *RDNS { </s> add func InitRDNS(dnsServer *dnsforward.Server, clients *clientsContainer) *RDNS { </s> add s.dnsProxy = nil
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep replace keep keep keep keep replace keep
<mask> // Please note that we must do it even if we don't start it <mask> // so that we had access to the query log and the stats <mask> func initDNSServer() { <mask> baseDir := config.getDataDir() <mask> <mask> err := os.MkdirAll(baseDir, 0755) <mask> if err != nil { <mask> log.Fatalf("Cannot create DNS data dir at %s: %s", baseDir, err) <mask> } </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove err := config.httpServer.ListenAndServe() </s> add err := Context.httpServer.ListenAndServe() </s> remove config.httpsServer.cond.L.Lock() config.httpsServer.cond.Broadcast() if config.httpsServer.server != nil { config.httpsServer.server.Shutdown(context.TODO()) </s> add Context.httpsServer.cond.L.Lock() Context.httpsServer.cond.Broadcast() if Context.httpsServer.server != nil { Context.httpsServer.server.Shutdown(context.TODO()) </s> remove if !isRunning() { return nil } err := config.dnsServer.Stop() </s> add err := Context.dnsServer.Stop() </s> add // DNS proxy instance for internal usage // We don't Start() it and so no listen port is required. internalProxy *proxy.Proxy </s> add _ = s.Prepare(nil)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep replace keep replace keep
<mask> ConfigModified: onConfigModified, <mask> HTTPRegister: httpRegister, <mask> } <mask> config.stats, err = stats.New(statsConf) <mask> if err != nil { <mask> log.Fatal("Couldn't initialize statistics module") <mask> } </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.queryLog = querylog.New(conf) </s> add Context.queryLog = querylog.New(conf) </s> remove httpError(w, http.StatusInternalServerError, "Couldn't start DNS server: %s", err) </s> add if err != nil { httpError(w, http.StatusInternalServerError, "Couldn't initialize DNS server: %s", err) } else { httpError(w, http.StatusInternalServerError, "Couldn't start DNS server: %s", err2) } </s> remove initDNSServer() </s> add err = initDNSServer() if err != nil { log.Fatalf("%s", err) } </s> remove func generateServerConfig() (dnsforward.ServerConfig, error) { </s> add func generateServerConfig() dnsforward.ServerConfig { </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> MemSize: config.DNS.QueryLogMemSize, <mask> ConfigModified: onConfigModified, <mask> HTTPRegister: httpRegister, <mask> } <mask> config.queryLog = querylog.New(conf) <mask> <mask> filterConf := config.DNS.DnsfilterConf <mask> bindhost := config.DNS.BindHost <mask> if config.DNS.BindHost == "0.0.0.0" { <mask> bindhost = "127.0.0.1" </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove bindhost := config.DNS.BindHost if config.DNS.BindHost == "0.0.0.0" { bindhost = "127.0.0.1" } resolverAddr := fmt.Sprintf("%s:%d", bindhost, config.DNS.Port) r := upstream.NewResolver(resolverAddr, 30*time.Second) addrs, e := r.LookupIPAddr(ctx, host) log.Tracef("LookupIPAddr: %s: %v", host, addrs) </s> add addrs, e := Context.dnsServer.Resolve(host) log.Debug("dnsServer.Resolve: %s: %v", host, addrs) </s> remove var err error bindhost := config.DNS.BindHost if config.DNS.BindHost == "0.0.0.0" { bindhost = "127.0.0.1" } resolverAddress := fmt.Sprintf("%s:%d", bindhost, config.DNS.Port) opts := upstream.Options{ Timeout: rdnsTimeout, } r.upstream, err = upstream.AddressToUpstream(resolverAddress, opts) if err != nil { log.Error("upstream.AddressToUpstream: %s", err) return nil } </s> add </s> remove config.stats, err = stats.New(statsConf) </s> add Context.stats, err = stats.New(statsConf) </s> remove func InitRDNS(clients *clientsContainer) *RDNS { </s> add func InitRDNS(dnsServer *dnsforward.Server, clients *clientsContainer) *RDNS { </s> remove log.Fatal("Couldn't initialize statistics module") </s> add return fmt.Errorf("Couldn't initialize statistics module") </s> remove if config.dnsFilter != nil { </s> add if Context.dnsFilter != nil {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep replace keep replace
<mask> filterConf.HTTPRegister = httpRegister <mask> config.dnsFilter = dnsfilter.New(&filterConf, nil) <mask> <mask> config.dnsServer = dnsforward.NewServer(config.dnsFilter, config.stats, config.queryLog) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsFilter.WriteDiskConfig(&c) </s> add Context.dnsFilter.WriteDiskConfig(&c) </s> remove config.stats.Close() config.stats = nil </s> add Context.stats.Close() Context.stats = nil </s> remove config.dhcpServer = dhcpd.Create(config.DHCP) config.clients.Init(config.Clients, config.dhcpServer) </s> add Context.dhcpServer = dhcpd.Create(config.DHCP) Context.clients.Init(config.Clients, Context.dhcpServer) </s> remove if config.dnsFilter != nil { </s> add if Context.dnsFilter != nil { </s> add err := s.Prepare(nil) assert.True(t, err == nil)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> sessFilename := filepath.Join(baseDir, "sessions.db") <mask> config.auth = InitAuth(sessFilename, config.Users, config.WebSessionTTLHours*60*60) <mask> config.Users = nil <mask> <mask> config.dnsctx.rdns = InitRDNS(&config.clients) <mask> config.dnsctx.whois = initWhois(&config.clients) <mask> <mask> initFiltering() <mask> } <mask> <mask> func isRunning() bool { </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsServer = dnsforward.NewServer(config.dnsFilter, config.stats, config.queryLog) </s> add Context.dnsServer = dnsforward.NewServer(Context.dnsFilter, Context.stats, Context.queryLog) dnsConfig := generateServerConfig() err = Context.dnsServer.Prepare(&dnsConfig) if err != nil { return fmt.Errorf("dnsServer.Prepare: %s", err) } </s> remove config.dnsFilter = dnsfilter.New(&filterConf, nil) </s> add Context.dnsFilter = dnsfilter.New(&filterConf, nil) </s> add return nil </s> remove if config.stats != nil { </s> add if Context.stats != nil { </s> remove config.clients.WriteDiskConfig(&config.Clients) </s> add Context.clients.WriteDiskConfig(&config.Clients) </s> remove return config.dnsServer != nil && config.dnsServer.IsRunning() </s> add return Context.dnsServer != nil && Context.dnsServer.IsRunning()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep add keep keep keep keep
<mask> Context.rdns = InitRDNS(Context.dnsServer, &Context.clients) <mask> Context.whois = initWhois(&Context.clients) <mask> <mask> initFiltering() <mask> } <mask> <mask> func isRunning() bool { <mask> return Context.dnsServer != nil && Context.dnsServer.IsRunning() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsctx.rdns = InitRDNS(&config.clients) config.dnsctx.whois = initWhois(&config.clients) </s> add Context.rdns = InitRDNS(Context.dnsServer, &Context.clients) Context.whois = initWhois(&Context.clients) </s> remove return config.dnsServer != nil && config.dnsServer.IsRunning() </s> add return Context.dnsServer != nil && Context.dnsServer.IsRunning() </s> remove if config.dnsServer != nil { </s> add if Context.dnsServer != nil { </s> remove if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && config.httpsServer.server != nil { </s> add if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && Context.httpsServer.server != nil { </s> add s.isRunning = false </s> remove config.dnsServer = dnsforward.NewServer(config.dnsFilter, config.stats, config.queryLog) </s> add Context.dnsServer = dnsforward.NewServer(Context.dnsFilter, Context.stats, Context.queryLog) dnsConfig := generateServerConfig() err = Context.dnsServer.Prepare(&dnsConfig) if err != nil { return fmt.Errorf("dnsServer.Prepare: %s", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> initFiltering() <mask> } <mask> <mask> func isRunning() bool { <mask> return config.dnsServer != nil && config.dnsServer.IsRunning() <mask> } <mask> <mask> // nolint (gocyclo) <mask> // Return TRUE if IP is within public Internet IP range <mask> func isPublicIP(ip net.IP) bool { </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> add return nil </s> remove config.dnsctx.rdns = InitRDNS(&config.clients) config.dnsctx.whois = initWhois(&config.clients) </s> add Context.rdns = InitRDNS(Context.dnsServer, &Context.clients) Context.whois = initWhois(&Context.clients) </s> remove // GetList returns the pointer to clients list func (clients *clientsContainer) GetList() map[string]*Client { return clients.list } </s> add </s> add s.isRunning = false </s> remove units, firstID := s.loadUnits() </s> add units, firstID := s.loadUnits(limit) </s> remove isRunning := true if s.dnsProxy == nil { isRunning = false } s.RUnlock() return isRunning </s> add defer s.RUnlock() return s.isRunning
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep replace keep keep replace
<mask> ipAddr := net.ParseIP(ip) <mask> if !ipAddr.IsLoopback() { <mask> config.dnsctx.rdns.Begin(ip) <mask> } <mask> if isPublicIP(ipAddr) { <mask> config.dnsctx.whois.Begin(ip) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsctx.rdns.Begin(ip) </s> add Context.rdns.Begin(ip) </s> remove config.dnsctx.whois.Begin(ip) </s> add Context.whois.Begin(ip) </s> remove topClients := config.stats.GetTopClientsIP(topClientsNumber) </s> add topClients := Context.stats.GetTopClientsIP(topClientsNumber) </s> remove if config.stats != nil { </s> add if Context.stats != nil { </s> remove ok2 := s.deleteUnit(tx, id-s.limit) </s> add ok2 := s.deleteUnit(tx, id-s.conf.limit)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> config.dnsctx.whois.Begin(ip) <mask> } <mask> } <mask> <mask> func generateServerConfig() (dnsforward.ServerConfig, error) { <mask> newconfig := dnsforward.ServerConfig{ <mask> UDPListenAddr: &net.UDPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, <mask> TCPListenAddr: &net.TCPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, <mask> FilteringConfig: config.DNS.FilteringConfig, <mask> ConfigModified: onConfigModified, </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsctx.whois.Begin(ip) </s> add Context.whois.Begin(ip) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove config.queryLog = querylog.New(conf) </s> add Context.queryLog = querylog.New(conf) </s> remove config.stats, err = stats.New(statsConf) </s> add Context.stats, err = stats.New(statsConf) </s> remove config.dnsctx.rdns.Begin(ip) </s> add Context.rdns.Begin(ip) </s> remove config.dnsctx.rdns.Begin(ip) </s> add Context.rdns.Begin(ip)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace keep keep keep replace keep
<mask> } <mask> <mask> newconfig.FilterHandler = applyAdditionalFiltering <mask> newconfig.GetUpstreamsByClient = getUpstreamsByClient <mask> return newconfig, nil <mask> } <mask> <mask> func getUpstreamsByClient(clientAddr string) []string { <mask> c, ok := config.clients.Find(clientAddr) <mask> if !ok { </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove c, ok := config.clients.Find(clientAddr) </s> add c, ok := Context.clients.Find(clientAddr) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove func (s *statsCtx) GetTopClientsIP(limit uint) []string { units, _ := s.loadUnits() </s> add func (s *statsCtx) GetTopClientsIP(maxCount uint) []string { units, _ := s.loadUnits(s.conf.limit) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start() </s> remove if config.stats != nil { </s> add if Context.stats != nil {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> if len(clientAddr) == 0 { <mask> return <mask> } <mask> <mask> c, ok := config.clients.Find(clientAddr) <mask> if !ok { <mask> return <mask> } <mask> <mask> log.Debug("Using settings for client with IP %s", clientAddr) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove c, ok := config.clients.Find(clientAddr) </s> add c, ok := Context.clients.Find(clientAddr) </s> remove return newconfig, nil </s> add return newconfig </s> remove resp, err := r.upstream.Exchange(&req) </s> add resp, err := r.dnsServer.Exchange(&req) </s> remove // GetList returns the pointer to clients list func (clients *clientsContainer) GetList() map[string]*Client { return clients.list } </s> add </s> remove func (s *statsCtx) loadUnits() ([]*unitDB, uint32) { </s> add func (s *statsCtx) loadUnits(limit uint32) ([]*unitDB, uint32) { </s> remove bindhost := config.DNS.BindHost if config.DNS.BindHost == "0.0.0.0" { bindhost = "127.0.0.1" } resolverAddr := fmt.Sprintf("%s:%d", bindhost, config.DNS.Port) r := upstream.NewResolver(resolverAddr, 30*time.Second) addrs, e := r.LookupIPAddr(ctx, host) log.Tracef("LookupIPAddr: %s: %v", host, addrs) </s> add addrs, e := Context.dnsServer.Resolve(host) log.Debug("dnsServer.Resolve: %s: %v", host, addrs)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
<mask> } <mask> <mask> enableFilters(false) <mask> <mask> newconfig, err := generateServerConfig() <mask> if err != nil { <mask> return errorx.Decorate(err, "Couldn't start forwarding DNS server") <mask> } <mask> <mask> err = config.dnsServer.Start(&newconfig) <mask> if err != nil { <mask> return errorx.Decorate(err, "Couldn't start forwarding DNS server") <mask> } <mask> <mask> startFiltering() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start() </s> remove if !isRunning() { return nil } err := config.dnsServer.Stop() </s> add err := Context.dnsServer.Stop() </s> remove err := config.dhcpServer.Stop() </s> add err := Context.dhcpServer.Stop() </s> remove err := config.dhcpServer.Init(config.DHCP) </s> add err := Context.dhcpServer.Init(config.DHCP) </s> remove httpError(w, http.StatusInternalServerError, "Couldn't start DNS server: %s", err) </s> add if err != nil { httpError(w, http.StatusInternalServerError, "Couldn't initialize DNS server: %s", err) } else { httpError(w, http.StatusInternalServerError, "Couldn't start DNS server: %s", err2) }
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep replace keep keep keep replace
<mask> const topClientsNumber = 100 // the number of clients to get <mask> topClients := config.stats.GetTopClientsIP(topClientsNumber) <mask> for _, ip := range topClients { <mask> ipAddr := net.ParseIP(ip) <mask> if !ipAddr.IsLoopback() { <mask> config.dnsctx.rdns.Begin(ip) </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsctx.rdns.Begin(ip) </s> add Context.rdns.Begin(ip) </s> remove a := convertMapToArray(m, int(limit)) </s> add a := convertMapToArray(m, int(maxCount)) </s> remove clientsList := clients.GetList() for _, cli := range clientsList { </s> add clients.lock.Lock() for _, cli := range clients.list { </s> remove config.dnsctx.whois.Begin(ip) </s> add Context.whois.Begin(ip) </s> remove err := s.Start(nil) </s> add err := s.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> if !ipAddr.IsLoopback() { <mask> config.dnsctx.rdns.Begin(ip) <mask> } <mask> if isPublicIP(ipAddr) { <mask> config.dnsctx.whois.Begin(ip) <mask> } <mask> } <mask> <mask> return nil <mask> } </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsctx.rdns.Begin(ip) </s> add Context.rdns.Begin(ip) </s> remove config.dnsctx.whois.Begin(ip) </s> add Context.whois.Begin(ip) </s> remove config.dnsctx.rdns.Begin(ip) </s> add Context.rdns.Begin(ip) </s> remove initDNSServer() </s> add err = initDNSServer() if err != nil { log.Fatalf("%s", err) } </s> remove topClients := config.stats.GetTopClientsIP(topClientsNumber) </s> add topClients := Context.stats.GetTopClientsIP(topClientsNumber) </s> remove err := config.dhcpServer.Stop() </s> add err := Context.dhcpServer.Stop()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> return nil <mask> } <mask> <mask> func reconfigureDNSServer() error { <mask> newconfig, err := generateServerConfig() <mask> if err != nil { <mask> return errorx.Decorate(err, "Couldn't start forwarding DNS server") <mask> } <mask> err = config.dnsServer.Reconfigure(&newconfig) <mask> if err != nil { <mask> return errorx.Decorate(err, "Couldn't start forwarding DNS server") <mask> } <mask> <mask> return nil </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start() </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start() </s> remove if !isRunning() { return nil } err := config.dnsServer.Stop() </s> add err := Context.dnsServer.Stop() </s> remove err := config.dhcpServer.Stop() </s> add err := Context.dhcpServer.Stop() </s> remove err = s.startInternal(nil) </s> add err = s.startInternal() </s> remove err := config.dhcpServer.Init(config.DHCP) </s> add err := Context.dhcpServer.Init(config.DHCP)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> return nil <mask> } <mask> <mask> func stopDNSServer() error { <mask> if !isRunning() { <mask> return nil <mask> } <mask> <mask> err := config.dnsServer.Stop() <mask> if err != nil { <mask> return errorx.Decorate(err, "Couldn't stop forwarding DNS server") <mask> } <mask> <mask> // DNS forward module must be closed BEFORE stats or queryLog because it depends on them </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsServer.Close() </s> add Context.dnsServer.Close() </s> remove config.dnsFilter.Close() config.dnsFilter = nil </s> add Context.dnsFilter.Close() Context.dnsFilter = nil </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start() </s> remove err := config.dhcpServer.Stop() </s> add err := Context.dhcpServer.Stop() </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> return errorx.Decorate(err, "Couldn't stop forwarding DNS server") <mask> } <mask> <mask> // DNS forward module must be closed BEFORE stats or queryLog because it depends on them <mask> config.dnsServer.Close() <mask> <mask> config.dnsFilter.Close() <mask> config.dnsFilter = nil <mask> <mask> config.stats.Close() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsFilter.Close() config.dnsFilter = nil </s> add Context.dnsFilter.Close() Context.dnsFilter = nil </s> remove if !isRunning() { return nil } err := config.dnsServer.Stop() </s> add err := Context.dnsServer.Stop() </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Start(&newconfig) </s> add err := Context.dnsServer.Start() </s> remove newconfig, err := generateServerConfig() if err != nil { return errorx.Decorate(err, "Couldn't start forwarding DNS server") } err = config.dnsServer.Reconfigure(&newconfig) </s> add newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> remove config.stats.Close() config.stats = nil </s> add Context.stats.Close() Context.stats = nil </s> remove err = config.dhcpServer.Start() </s> add err = Context.dhcpServer.Start()
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> // DNS forward module must be closed BEFORE stats or queryLog because it depends on them <mask> config.dnsServer.Close() <mask> <mask> config.dnsFilter.Close() <mask> config.dnsFilter = nil <mask> <mask> config.stats.Close() <mask> config.stats = nil <mask> <mask> config.queryLog.Close() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.dnsServer.Close() </s> add Context.dnsServer.Close() </s> remove if !isRunning() { return nil } err := config.dnsServer.Stop() </s> add err := Context.dnsServer.Stop() </s> remove config.stats.Close() config.stats = nil </s> add Context.stats.Close() Context.stats = nil </s> remove config.queryLog.Close() config.queryLog = nil </s> add Context.queryLog.Close() Context.queryLog = nil </s> remove config.httpsServer.shutdown = true if config.httpsServer.server != nil { config.httpsServer.server.Shutdown(context.TODO()) </s> add Context.httpsServer.shutdown = true if Context.httpsServer.server != nil { Context.httpsServer.server.Shutdown(context.TODO()) </s> remove func initDNSServer() { </s> add func initDNSServer() error {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> config.dnsFilter.Close() <mask> config.dnsFilter = nil <mask> <mask> config.stats.Close() <mask> config.stats = nil <mask> <mask> config.queryLog.Close() <mask> config.queryLog = nil <mask> <mask> config.auth.Close() </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.queryLog.Close() config.queryLog = nil </s> add Context.queryLog.Close() Context.queryLog = nil </s> remove config.dnsFilter.Close() config.dnsFilter = nil </s> add Context.dnsFilter.Close() Context.dnsFilter = nil </s> remove config.dnsServer.Close() </s> add Context.dnsServer.Close() </s> remove config.stats.WriteDiskConfig(&sdc) </s> add Context.stats.WriteDiskConfig(&sdc) </s> remove if config.queryLog != nil { </s> add if Context.queryLog != nil { </s> remove if config.stats != nil { </s> add if Context.stats != nil {
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> config.stats.Close() <mask> config.stats = nil <mask> <mask> config.queryLog.Close() <mask> config.queryLog = nil <mask> <mask> config.auth.Close() <mask> config.auth = nil <mask> return nil <mask> } </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove config.stats.Close() config.stats = nil </s> add Context.stats.Close() Context.stats = nil </s> remove config.dnsFilter.Close() config.dnsFilter = nil </s> add Context.dnsFilter.Close() Context.dnsFilter = nil </s> remove if config.stats != nil { </s> add if Context.stats != nil { </s> remove config.stats.WriteDiskConfig(&sdc) </s> add Context.stats.WriteDiskConfig(&sdc) </s> remove if config.queryLog != nil { </s> add if Context.queryLog != nil { </s> remove config.queryLog.WriteDiskConfig(&dc) </s> add Context.queryLog.WriteDiskConfig(&dc)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/dns.go
keep keep keep keep replace keep
<mask> filters[int(filter.ID)] = filter.Path() <mask> } <mask> } <mask> <mask> _ = config.dnsFilter.SetFilters(filters, async) <mask> } </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove _, _ = config.clients.AddHost(ip, host, ClientSourceRDNS) </s> add _, _ = r.clients.AddHost(ip, host, ClientSourceRDNS) </s> remove ok2 := s.deleteUnit(tx, id-s.limit) </s> add ok2 := s.deleteUnit(tx, id-s.conf.limit) </s> remove if len(units) != int(s.limit) { log.Fatalf("len(units) != s.limit: %d %d", len(units), s.limit) </s> add if len(units) != int(limit) { log.Fatalf("len(units) != limit: %d %d", len(units), limit) </s> remove type dnsContext struct { rdns *RDNS whois *Whois } </s> add </s> remove _ = config.httpServer.Shutdown(context.TODO()) </s> add _ = Context.httpServer.Shutdown(context.TODO()) </s> add _ = s.Prepare(nil)
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/filter.go
keep keep keep keep replace keep keep keep keep keep
<mask> "strings" <mask> "syscall" <mask> "time" <mask> <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/joomcode/errorx" <mask> ) <mask> <mask> // ---------------------------------- </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove "github.com/AdguardTeam/dnsproxy/upstream" </s> add "github.com/AdguardTeam/AdGuardHome/dnsforward" </s> remove "fmt" </s> add </s> add "github.com/AdguardTeam/AdGuardHome/dnsfilter" "github.com/AdguardTeam/AdGuardHome/dnsforward" "github.com/AdguardTeam/AdGuardHome/querylog" "github.com/AdguardTeam/AdGuardHome/stats" </s> remove type dnsContext struct { rdns *RDNS whois *Whois } </s> add </s> remove const ( rdnsTimeout = 3 * time.Second // max time to wait for rDNS response ) </s> add </s> remove "errors" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/helpers.go
keep keep keep keep replace keep keep keep keep keep
<mask> http.Redirect(w, r, "/install.html", http.StatusSeeOther) // should not be cacheable <mask> return <mask> } <mask> // enforce https? <mask> if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && config.httpsServer.server != nil { <mask> // yes, and we want host from host:port <mask> host, _, err := net.SplitHostPort(r.Host) <mask> if err != nil { <mask> // no port in host <mask> host = r.Host </s> Merge: * use upstream servers directly for the internal DNS resolver Close #1212 * Server.Start(config *ServerConfig) -> Start() + Server.Prepare(config *ServerConfig) + Server.Resolve(host string) + Server.Exchange() * rDNS: use internal DNS resolver - clients: fix race in WriteDiskConfig() - fix race: move 'clients' object from 'configuration' to 'HomeContext' Go race detector didn't like our 'clients' object in 'configuration'. + add AGH startup test . Create a configuration file . Start AGH instance . Check Web server . Check DNS server . Wait until the filters are downloaded . Stop and cleanup * move module objects from config.* to Context.* * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning * ci.sh: 'make' and then run tests Squashed commit of the following: commit 86500c7f749307f37af4cc8c2a1066f679d0cfad Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:53 2019 +0300 minor commit 6e6abb9dca3cd250c458bec23aa30d2250a9eb40 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 18:08:31 2019 +0300 * ci.sh: 'make' and then run tests commit 114192eefea6800e565ba9ab238202c006516c27 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:50:04 2019 +0300 fix commit d426deea7f02cdfd4c7217a38c59e51251956a0f Author: Simon Zolin <[email protected]> Date: Tue Dec 10 17:46:33 2019 +0300 tests commit 7b350edf03027895b4e43dee908d0155a9b0ac9b Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:56:12 2019 +0300 fix test commit 2f5f116873bbbfdd4bb7f82a596f9e1f5c2bcfd8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:48:56 2019 +0300 fix tests commit 3fbdc77f9c34726e2295185279444983652d559e Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:45:00 2019 +0300 linter commit 9da0b6965a2b6863bcd552fa83a4de2866600bb8 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:33:23 2019 +0300 * config.dnsctx.whois -> Context.whois commit c71ebdbdf6efd88c877b2f243c69d3bc00a997d7 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:31:08 2019 +0300 * don't call log.SetLevel() if not necessary This helps to avoid Go race detector's warning commit 0f250220133cefdcb0843a50000cb932802b8324 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 15:28:19 2019 +0300 * rdns: refactor commit c460d8c9414940dac852e390b6c1b4d4fb38dff9 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 14:08:08 2019 +0300 Revert: * stats: serialize access to 'limit' Use 'conf *Config' and update it atomically, as in querylog module. (Note: Race detector still doesn't like it) commit 488bcb884971276de0d5629384b29e22c59ee7e6 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:50:23 2019 +0300 * config.dnsFilter -> Context.dnsFilter commit 86c0a6827a450414b50acec7ebfc5220d13b81e4 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:45:05 2019 +0300 * config.dnsServer -> Context.dnsServer commit ee35ef095ccaabc89e3de0ef52c9b5ed56b36873 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:42:10 2019 +0300 * config.dhcpServer -> Context.dhcpServer commit 1537001cd211099d5fad01696c0b806ae5d257b1 Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:39:45 2019 +0300 * config.queryLog -> Context.queryLog commit e5955fe4ff1ef6f41763461b37b502ea25a3d04c Author: Simon Zolin <[email protected]> Date: Tue Dec 10 13:03:18 2019 +0300 * config.httpsServer -> Context.httpsServer commit 6153c10a9ac173e159d1f05e0db1512579b9203c Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:12:24 2019 +0300 * config.httpServer -> Context.httpServer commit abd021fb94039015cd45c97614e8b78d4694f956 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 20:08:05 2019 +0300 * stats: serialize access to 'limit' commit 38c2decfd87c712100edcabe62a6d4518719cb53 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:57:04 2019 +0300 * config.stats -> Context.stats commit 6caf8965ad44db9dce9a7a5103aa8fa305ad9a06 Author: Simon Zolin <[email protected]> Date: Mon Dec 9 19:45:23 2019 +0300 fix Restart() ... and 6 more commits </s> remove return config.dnsServer != nil && config.dnsServer.IsRunning() </s> add return Context.dnsServer != nil && Context.dnsServer.IsRunning() </s> remove level = log.DEBUG </s> add log.SetLevel(log.DEBUG) </s> remove if config.httpsServer.server != nil { </s> add if Context.httpsServer.server != nil { </s> remove if config.httpsServer.server != nil { </s> add if Context.httpsServer.server != nil { </s> remove log.SetLevel(level) </s> add </s> add return nil
https://github.com/AdguardTeam/AdGuardHome/commit/0a66913b4d8b5f34310a263c6399875b900d465e
home/helpers.go