From a59fca2da324d5a296160e10b89acc1dbca0e7da Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Wed, 13 Sep 2023 13:58:12 +0300 Subject: [PATCH] Pull request 2009: 4569-blocked-response-ttl Updates #4569. Squashed commit of the following: commit cc5842fd9d19e6d8bc19f9f88a587c2dd102828d Merge: 2e1e59e1b 5c6b3ace4 Author: Stanislav Chzhen Date: Wed Sep 13 13:41:59 2023 +0300 Merge branch 'master' into 4569-blocked-response-ttl commit 2e1e59e1b787d461819d01a99ceb70d21e882dc1 Author: Ildar Kamalov Date: Tue Sep 12 20:28:34 2023 +0300 client: fix input length commit 05bfa8cff7bff020a5b655779513612bc353267f Author: Stanislav Chzhen Date: Tue Sep 12 12:16:35 2023 +0300 openapi: bump version commit f4f36111265aea8927b9a5154d74954ba05e5f10 Author: Stanislav Chzhen Date: Mon Sep 11 19:36:38 2023 +0300 all: upg chlog commit 09c1e6d75ee7a95a5286aed526521a0206026986 Merge: ff3e2dc9f fb332dfc2 Author: Stanislav Chzhen Date: Mon Sep 11 19:35:30 2023 +0300 Merge branch 'master' into 4569-blocked-response-ttl commit ff3e2dc9f1ed1aacf023821160c6973ee98506b7 Author: Stanislav Chzhen Date: Mon Sep 11 19:34:59 2023 +0300 client: add blocked response ttl commit 31064d160e361f9e88f545fa42d8eb824ecc5c86 Author: Stanislav Chzhen Date: Mon Sep 11 15:58:06 2023 +0300 all: add blocked response ttl --- CHANGELOG.md | 7 +++ client/src/__locales/en.json | 3 + .../components/Settings/Dns/Config/Form.js | 56 ++++++++++++------ .../components/Settings/Dns/Config/index.js | 2 + client/src/reducers/dnsConfig.js | 1 + internal/dnsforward/http.go | 9 +++ internal/dnsforward/http_test.go | 5 ++ .../TestDNSForwardHTTP_handleGetConfig.json | 3 + .../TestDNSForwardHTTP_handleSetConfig.json | 59 +++++++++++++++++++ internal/filtering/filtering.go | 11 ++++ openapi/CHANGELOG.md | 7 +++ openapi/openapi.yaml | 4 ++ 12 files changed, 150 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e958d00d..4aa471c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,13 @@ See also the [v0.107.39 GitHub milestone][ms-v0.107.39]. NOTE: Add new changes BELOW THIS COMMENT. --> +### Added + +- Ability to specify for how long clients should cache a filtered response, + using the *Blocked response TTL* field on the *DNS settings* page ([#4569]). + +[#4569]: https://github.com/AdguardTeam/AdGuardHome/issues/4569 + diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index d7ea54a2..7ff6e612 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -283,6 +283,9 @@ "custom_ip": "Custom IP", "blocking_ipv4": "Blocking IPv4", "blocking_ipv6": "Blocking IPv6", + "blocked_response_ttl": "Blocked response TTL", + "blocked_response_ttl_desc": "Specifies for how many seconds the clients should cache a filtered response", + "form_enter_blocked_response_ttl": "Enter blocked response TTL (seconds)", "dnscrypt": "DNSCrypt", "dns_over_https": "DNS-over-HTTPS", "dns_over_tls": "DNS-over-TLS", diff --git a/client/src/components/Settings/Dns/Config/Form.js b/client/src/components/Settings/Dns/Config/Form.js index 52d94741..18dc56fc 100644 --- a/client/src/components/Settings/Dns/Config/Form.js +++ b/client/src/components/Settings/Dns/Config/Form.js @@ -68,10 +68,10 @@ const Form = ({ return
-
+
@@ -160,24 +160,46 @@ const Form = ({ name, validateIp, }) =>
-
- -
- {description} +
+ +
+ {description} +
+
- -
-
)} +
)} )} +
+
+ +
+ blocked_response_ttl_desc +
+ +
+