diff --git a/CHANGELOG.md b/CHANGELOG.md index 61f8706a..39f44fc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,12 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Added +- Two new HTTP APIs, `PUT /control/stats/config/update` and `GET + control/stats/config`, which can be used to set and receive the query log + configuration. See openapi/openapi.yaml for the full description. +- Two new HTTP APIs, `PUT /control/querylog/config/update` and `GET + control/querylog/config`, which can be used to set and receive the statistics + configuration. See openapi/openapi.yaml for the full description. - The ability to set custom IP for EDNS Client Subnet by using the DNS-server configuration section on the DNS settings page in the UI ([#1472]). - The ability to manage safesearch for each service by using the new @@ -37,8 +43,26 @@ NOTE: Add new changes BELOW THIS COMMENT. #### Configuration Changes -In this release, the schema version has changed from 17 to 19. +In this release, the schema version has changed from 17 to 20. +- Property `statistics.interval`, which in schema versions 19 and earlier used + to be an integer number of days, is now a string with a human-readable + duration: + + ```yaml + # BEFORE: + 'statistics': + # … + 'interval': 1 + + # AFTER: + 'statistics': + # … + 'interval': '24h' + ``` + + To rollback this change, convert the property back into days and change the + `schema_version` back to `19`. - The `dns.safesearch_enabled` field has been replaced with `safe_search` object containing per-service settings. - The `clients.persistent.safesearch_enabled` field has been replaced with @@ -64,6 +88,23 @@ In this release, the schema version has changed from 17 to 19. client's specific `clients.persistent.safesearch` and then change the `schema_version` back to `17`. +### Deprecated + +- The `GET /control/stats_info` HTTP API; use the new `GET + /control/stats/config` API instead. + + **NOTE:** If interval is custom then it will be equal to `90` days for + compatibility reasons. See openapi/openapi.yaml and `openapi/CHANGELOG.md`. +- The `POST /control/stats_config` HTTP API; use the new `PUT + /control/stats/config/update` API instead. +- The `GET /control/querylog_info` HTTP API; use the new `GET + /control/querylog/config` API instead. + + **NOTE:** If interval is custom then it will be equal to `90` days for + compatibility reasons. See openapi/openapi.yaml and `openapi/CHANGELOG.md`. +- The `POST /control/querylog_config` HTTP API; use the new `PUT + /control/querylog/config/update` API instead. + ### Fixed - Panic caused by empty top-level domain name label in `/etc/hosts` files @@ -103,8 +144,6 @@ See also the [v0.107.26 GitHub milestone][ms-v0.107.26]. #### Configuration Changes -In this release, the schema version has changed from 16 to 17. - - Property `edns_client_subnet`, which in schema versions 16 and earlier used to be a part of the `dns` object, is now part of the `dns.edns_client_subnet` object: diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index 5ccd771b..902fc4d3 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -525,6 +525,10 @@ "statistics_retention_confirm": "Are you sure you want to change statistics retention? If you decrease the interval value, some data will be lost", "statistics_cleared": "Statistics successfully cleared", "statistics_enable": "Enable statistics", + "ignore_domains": "Ignored domains (separated by newline)", + "ignore_domains_title": "Ignored domains", + "ignore_domains_desc_stats": "Queries for these domains are not written to the statistics", + "ignore_domains_desc_query": "Queries for these domains are not written to the query log", "interval_hours": "{{count}} hour", "interval_hours_plural": "{{count}} hours", "filters_configuration": "Filters configuration", diff --git a/client/src/actions/queryLogs.js b/client/src/actions/queryLogs.js index 99da2cb0..e07c6fae 100644 --- a/client/src/actions/queryLogs.js +++ b/client/src/actions/queryLogs.js @@ -177,7 +177,7 @@ export const getLogsConfigSuccess = createAction('GET_LOGS_CONFIG_SUCCESS'); export const getLogsConfig = () => async (dispatch) => { dispatch(getLogsConfigRequest()); try { - const data = await apiClient.getQueryLogInfo(); + const data = await apiClient.getQueryLogConfig(); dispatch(getLogsConfigSuccess(data)); } catch (error) { dispatch(addErrorToast({ error })); diff --git a/client/src/actions/stats.js b/client/src/actions/stats.js index d3948efa..0e5b416e 100644 --- a/client/src/actions/stats.js +++ b/client/src/actions/stats.js @@ -13,7 +13,7 @@ export const getStatsConfigSuccess = createAction('GET_STATS_CONFIG_SUCCESS'); export const getStatsConfig = () => async (dispatch) => { dispatch(getStatsConfigRequest()); try { - const data = await apiClient.getStatsInfo(); + const data = await apiClient.getStatsConfig(); dispatch(getStatsConfigSuccess(data)); } catch (error) { dispatch(addErrorToast({ error })); diff --git a/client/src/api/Api.js b/client/src/api/Api.js index d984bbb8..60f1faad 100644 --- a/client/src/api/Api.js +++ b/client/src/api/Api.js @@ -497,9 +497,9 @@ class Api { // Settings for statistics GET_STATS = { path: 'stats', method: 'GET' }; - STATS_INFO = { path: 'stats_info', method: 'GET' }; + GET_STATS_CONFIG = { path: 'stats/config', method: 'GET' }; - STATS_CONFIG = { path: 'stats_config', method: 'POST' }; + UPDATE_STATS_CONFIG = { path: 'stats/config/update', method: 'PUT' }; STATS_RESET = { path: 'stats_reset', method: 'POST' }; @@ -508,13 +508,13 @@ class Api { return this.makeRequest(path, method); } - getStatsInfo() { - const { path, method } = this.STATS_INFO; + getStatsConfig() { + const { path, method } = this.GET_STATS_CONFIG; return this.makeRequest(path, method); } setStatsConfig(data) { - const { path, method } = this.STATS_CONFIG; + const { path, method } = this.UPDATE_STATS_CONFIG; const config = { data, }; @@ -529,9 +529,9 @@ class Api { // Query log GET_QUERY_LOG = { path: 'querylog', method: 'GET' }; - QUERY_LOG_CONFIG = { path: 'querylog_config', method: 'POST' }; + UPDATE_QUERY_LOG_CONFIG = { path: 'querylog/config/update', method: 'PUT' }; - QUERY_LOG_INFO = { path: 'querylog_info', method: 'GET' }; + GET_QUERY_LOG_CONFIG = { path: 'querylog/config', method: 'GET' }; QUERY_LOG_CLEAR = { path: 'querylog_clear', method: 'POST' }; @@ -543,13 +543,13 @@ class Api { return this.makeRequest(url, method); } - getQueryLogInfo() { - const { path, method } = this.QUERY_LOG_INFO; + getQueryLogConfig() { + const { path, method } = this.GET_QUERY_LOG_CONFIG; return this.makeRequest(path, method); } setQueryLogConfig(data) { - const { path, method } = this.QUERY_LOG_CONFIG; + const { path, method } = this.UPDATE_QUERY_LOG_CONFIG; const config = { data, }; diff --git a/client/src/components/Settings/LogsConfig/Form.js b/client/src/components/Settings/LogsConfig/Form.js index 8db3f18d..b29b974e 100644 --- a/client/src/components/Settings/LogsConfig/Form.js +++ b/client/src/components/Settings/LogsConfig/Form.js @@ -4,18 +4,28 @@ import { Field, reduxForm } from 'redux-form'; import { Trans, withTranslation } from 'react-i18next'; import flow from 'lodash/flow'; -import { CheckboxField, renderRadioField, toFloatNumber } from '../../../helpers/form'; -import { FORM_NAME, QUERY_LOG_INTERVALS_DAYS } from '../../../helpers/constants'; +import { + CheckboxField, + renderRadioField, + toFloatNumber, + renderTextareaField, +} from '../../../helpers/form'; +import { + FORM_NAME, + QUERY_LOG_INTERVALS_DAYS, + HOUR, + DAY, +} from '../../../helpers/constants'; import '../FormButton.css'; const getIntervalTitle = (interval, t) => { switch (interval) { - case 0.25: + case 6 * HOUR: return t('interval_6_hour'); - case 1: + case DAY: return t('interval_24_hour'); default: - return t('interval_days', { count: interval }); + return t('interval_days', { count: interval / DAY }); } }; @@ -66,6 +76,22 @@ const Form = (props) => { {getIntervalFields(processing, t, toFloatNumber)} + +
+ ignore_domains_desc_query +
+
+ +