From 97af23b0af6eed1a97f8b4754221493b3fb1f699 Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Fri, 23 Dec 2022 17:11:11 +0300 Subject: [PATCH 1/2] Pull request: 5290-rules-count Merge in DNS/adguard-home from 5290-rules-count to master Closes #5290. Squashed commit of the following: commit c29fd668dd8f25dbfe978fb95f850acbbd632b8b Author: Eugene Burkov Date: Fri Dec 23 14:42:57 2022 +0400 all: log changes commit fba4fe7cc046578f17cdf72dff93523558b8aa1f Author: Eugene Burkov Date: Fri Dec 23 14:33:57 2022 +0400 filtering: fix rules count on err --- CHANGELOG.md | 2 ++ internal/filtering/filter.go | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44474ab0..cf970fd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ See also the [v0.107.21 GitHub milestone][ms-v0.107.21]. ### Fixed +- Zeroing rules counter of erroneusly edited filtering rule lists ([#5290]). - Filters updating strategy, which could sometimes lead to use of broken or incompletely downloaded lists ([#5258]). - Errors popping up during updates of settings, which could sometimes cause the @@ -50,6 +51,7 @@ See also the [v0.107.21 GitHub milestone][ms-v0.107.21]. [#5238]: https://github.com/AdguardTeam/AdGuardHome/issues/5238 [#5251]: https://github.com/AdguardTeam/AdGuardHome/issues/5251 [#5258]: https://github.com/AdguardTeam/AdGuardHome/issues/5258 +[#5290]: https://github.com/AdguardTeam/AdGuardHome/issues/5290 [ms-v0.107.21]: https://github.com/AdguardTeam/AdGuardHome/milestone/57?closed=1 diff --git a/internal/filtering/filter.go b/internal/filtering/filter.go index 953d105b..e64c2f12 100644 --- a/internal/filtering/filter.go +++ b/internal/filtering/filter.go @@ -99,14 +99,15 @@ func (d *DNSFilter) filterSetProperties( filt.URL, ) - defer func(oldURL, oldName string, oldEnabled bool, oldUpdated time.Time) { + defer func(oldURL, oldName string, oldEnabled bool, oldUpdated time.Time, oldRulesCount int) { if err != nil { filt.URL = oldURL filt.Name = oldName filt.Enabled = oldEnabled filt.LastUpdated = oldUpdated + filt.RulesCount = oldRulesCount } - }(filt.URL, filt.Name, filt.Enabled, filt.LastUpdated) + }(filt.URL, filt.Name, filt.Enabled, filt.LastUpdated, filt.RulesCount) filt.Name = newList.Name From e7fc61a997a6f702be70603b232467b50d4a50d0 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Mon, 26 Dec 2022 17:19:51 +0300 Subject: [PATCH 2/2] Pull request: 4898 reload page on tls settings save Merge in DNS/adguard-home from 4898-reload-page to master Closes #4898. Squashed commit of the following: commit c2d78804d96d00b5ff10e23c0f275a6c73455b93 Author: Eugene Burkov Date: Mon Dec 26 18:03:31 2022 +0400 all: fix changelog commit e55db6a620e4aa74eb3562a4eb35bbd3d13c8712 Author: Eugene Burkov Date: Mon Dec 26 18:02:37 2022 +0400 all: log changes commit 3985dc4a42d1dc717def3011d7dfd24dd49da0da Author: Ildar Kamalov Date: Mon Dec 26 15:20:38 2022 +0300 client: reload page on tls settings save --- CHANGELOG.md | 2 ++ client/src/actions/encryption.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf970fd9..fc312aba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,12 +42,14 @@ See also the [v0.107.21 GitHub milestone][ms-v0.107.21]. ### Fixed +- Failing HTTPS redirection on saving the encryption settings ([#4898]). - Zeroing rules counter of erroneusly edited filtering rule lists ([#5290]). - Filters updating strategy, which could sometimes lead to use of broken or incompletely downloaded lists ([#5258]). - Errors popping up during updates of settings, which could sometimes cause the server to stop responding ([#5251]). +[#4898]: https://github.com/AdguardTeam/AdGuardHome/issues/4898 [#5238]: https://github.com/AdguardTeam/AdGuardHome/issues/5238 [#5251]: https://github.com/AdguardTeam/AdGuardHome/issues/5251 [#5258]: https://github.com/AdguardTeam/AdGuardHome/issues/5258 diff --git a/client/src/actions/encryption.js b/client/src/actions/encryption.js index 670a9f4e..5db97607 100644 --- a/client/src/actions/encryption.js +++ b/client/src/actions/encryption.js @@ -41,6 +41,10 @@ export const setTlsConfig = (config) => async (dispatch, getState) => { response.certificate_chain = atob(response.certificate_chain); response.private_key = atob(response.private_key); + if (values.enabled && values.force_https && window.location.protocol === 'http:') { + window.location.reload(); + return; + } redirectToCurrentProtocol(response, httpPort); const dnsStatus = await apiClient.getGlobalStatus();