diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf51c4ee..5614b10d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,8 +24,40 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Added +- New DNS rewrite settings endpoints `GET /control/rewrite/settings` and `PUT /control/rewrite/settings/update`. See `openapi/openapi.yaml` for details. - New fields `"groups"` and `"group_id"` added to the HTTP API (`GET /control/blocked_services/all`). See `openapi/openapi.yaml` for the full description. +### Changed + +- `POST /control/rewrite/add` and `PUT /control/rewrite/update` now accept the optional field "enabled". See `openapi/openapi.yaml` for details. + +#### Configuration changes + +In this release, the schema version has changed from 30 to 31. + +- Added a new boolean field `filtering.rewrites_enabled` to globally enable/disable DNS rewrites. +- Added a new boolean field `enabled` for each entry in `filtering.rewrites` to toggle individual rewrites. + + ```yaml + # BEFORE: + 'filtering': + 'rewrites': + - 'domain': test.example + 'answer': 192.0.2.0 + # … + + # AFTER: + 'filtering': + 'rewrites_enabled': true + 'rewrites': + - 'domain': test.example + 'answer': 192.0.2.0 + 'enabled': true + # … + ``` + + To roll back this change, set `schema_version` back to `30`. + [go-1.25.3]: https://groups.google.com/g/golang-announce/c/YEyj6FUNbik -## v0.107.67: API changes +## v0.107.68: API changes + +### New HTTP APIs 'GET /control/rewrite/settings' and 'PUT /control/rewrite/settings/update' + +- New HTTP APIs to manage global DNS rewrites. + + ```json + { + "enabled": true + } + ``` + +### New `"enabled"` field in 'POST /control/rewrite/add' and 'PUT /control/rewrite/update' + +- New optional field `"enabled"` indicates whether the rewrite is active. + +### The blocked services groups - The new field `"groups"` in `GET /control/blocked_services/all` is a list of service group. Groups make it possible to block multiple services with equal `"group_id"` at once. diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index aa252a5c2..a5df03c2b 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -16,6 +16,8 @@ - 'basicAuth': [] 'tags': +- 'name': 'blocked_services' + 'description': 'Blocked services controls' - 'name': 'clients' 'description': 'Clients list operations' - 'name': 'dhcp' @@ -34,6 +36,8 @@ 'description': 'Apple .mobileconfig' - 'name': 'parental' 'description': 'Blocking adult and explicit materials' +- 'name': 'rewrite' + 'description': 'DNS rewrites' - 'name': 'safebrowsing' 'description': 'Blocking malware/phishing sites' - 'name': 'safesearch' @@ -1153,6 +1157,30 @@ 'responses': '200': 'description': 'OK.' + '/rewrite/settings': + 'get': + 'tags': + - 'rewrite' + 'operationId': 'rewriteSettingsGet' + 'summary': 'Get rewrite settings' + 'responses': + '200': + 'description': 'OK.' + 'content': + 'application/json': + 'schema': + '$ref': '#/components/schemas/RewriteSettings' + '/rewrite/settings/update': + 'put': + 'tags': + - 'rewrite' + 'operationId': 'rewriteSettingsUpdate' + 'summary': 'Update rewrite settings' + 'requestBody': + '$ref': '#/components/requestBodies/RewriteSettings' + 'responses': + '200': + 'description': 'OK.' '/rewrite/update': 'put': 'tags': @@ -1414,6 +1442,12 @@ 'schema': '$ref': '#/components/schemas/RewriteEntry' 'required': true + 'RewriteSettings': + 'content': + 'application/json': + 'schema': + '$ref': '#/components/schemas/RewriteSettings' + 'required': true 'RewriteUpdate': 'content': 'application/json': @@ -3002,6 +3036,23 @@ 'type': 'string' 'description': 'value of A, AAAA or CNAME DNS record' 'example': '127.0.0.1' + 'enabled': + 'type': 'boolean' + 'description': > + Optional. If omitted on add, defaults to `true`. On update, omitted + preserves previous value. + 'example': true + 'default': true + 'RewriteSettings': + 'type': 'object' + 'description': 'DNS rewrite settings' + 'required': + - 'enabled' + 'properties': + 'enabled': + 'type': 'boolean' + 'description': 'indicates whether rewrites are applied' + 'example': true 'BlockedServicesArray': 'type': 'array' 'items': diff --git a/scripts/hooks/pre-commit b/scripts/hooks/pre-commit index e3ad58d14..b7def04bd 100755 --- a/scripts/hooks/pre-commit +++ b/scripts/hooks/pre-commit @@ -89,7 +89,7 @@ if [ "$(git diff --cached --name-only -- '*.sh' || :)" != '' ]; then make VERBOSE="$verbose" sh-lint fi -if [ "$(git diff --cached --name-only -- '*.md' '*.txt' '*.yaml' '*.yml' || :)" != '' ]; then +if [ "$(git diff --cached --name-only -- '*.md' '*.json' '*.txt' '*.yaml' '*.yml' || :)" != '' ]; then make VERBOSE="$verbose" txt-lint fi