Compare commits

...

9 Commits

Author SHA1 Message Date
Ainar Garipov
fb332dfc2a Pull request 2011: upd-chlog
Squashed commit of the following:

commit 7df4e845a5766a3ba221aa198cf937c7a9929899
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Sep 11 18:27:31 2023 +0300

    all: upd chlog, deps
2023-09-11 18:40:51 +03:00
Ainar Garipov
15e229620b Pull request 2010: upd-i18n
Squashed commit of the following:

commit 6d842069f67a37688375a5d52e8a3b3a20f73717
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Sep 11 17:27:05 2023 +0300

    client: upd i18n
2023-09-11 17:39:35 +03:00
Stanislav Chzhen
d18219395a Pull request 2004: 6176-conf-check-output
Squashed commit of the following:

commit bc2c99c77ef4899872d7cc628fdfd04a2190dd89
Merge: d2bd0c95a 2bb04094e
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Sep 11 16:36:47 2023 +0300

    Merge branch 'master' into 6176-conf-check-output

commit d2bd0c95a79567eebfada170cfcca8bdafad03cd
Merge: d2bb7b1a6 8b8ae8ffa
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Sep 11 14:10:09 2023 +0300

    Merge branch 'master' into 6176-conf-check-output

commit d2bb7b1a6e7812402ff5fbf2e4d2abf3f0effb54
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Sep 11 14:05:03 2023 +0300

    all: imp code

commit 160aa94b59e4dfd00cb1b09eb8d99d9eaf8d0892
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Sep 8 13:30:39 2023 +0300

    all: add conf check output
2023-09-11 16:42:41 +03:00
Ainar Garipov
2bb04094e1 Pull request 2008: 6198-fix-chlog
Closes #6198.

Squashed commit of the following:

commit 165cffb06b080c9ed27a14686d35284742c83958
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Sep 11 14:19:04 2023 +0300

    all: fix chlog
2023-09-11 14:34:42 +03:00
Ainar Garipov
8b8ae8ffad Pull request 2007: 6183-orig-resp
Closes #6183.

Squashed commit of the following:

commit a99b935d7a152f2cf2d003057cfb8e3c7c3579c5
Merge: 3534f663f 36517fc21
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Sep 8 17:46:51 2023 +0300

    Merge branch 'master' into 6183-orig-resp

commit 3534f663ff4aaacc4a1044b018802bd23cd8f7ec
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Sep 8 17:00:54 2023 +0300

    dnsforward: fix orig resp
2023-09-08 17:55:13 +03:00
Stanislav Chzhen
36517fc21b Pull request 2006: 6182-fix-fallback-dns
Updates #6182.

Squashed commit of the following:

commit 7467bf851932a878af0eda01c140056a4261b597
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Sep 8 17:29:44 2023 +0300

    dnsforward: imp test

commit b807123d6030012bf9e9a4a0e454983a2e012a96
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Sep 8 17:22:49 2023 +0300

    dnsforward: add test

commit 698fc69e441e9f1e0e4c2878c81309967c058cab
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Sep 8 16:50:39 2023 +0300

    dnsforward: fix more

commit 444ae2870cd78ef736df744d80438b4dae5133ce
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Sep 8 16:32:49 2023 +0300

    all: upd chlog

commit 114ff58c7010528249f27bdc0b2f9bcc537f74c1
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Sep 8 15:59:13 2023 +0300

    dnsforward: fix fallback dns
2023-09-08 17:37:28 +03:00
Ainar Garipov
5f696da9dc Pull request 2005: 6181-safebrowsing-default
Updates #6181.

Squashed commit of the following:

commit 3c4d0fe0750823c81548c2e81988ec27c718028f
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Sep 8 14:23:13 2023 +0300

    home: fix default safe browsing, parental
2023-09-08 15:04:25 +03:00
Ildar Kamalov
62da8f4974 Pull request: merge schedule
Updates #6177

Squashed commit of the following:

commit 2f8e4164d40af338d9e4664d5c9ea0aab7113e26
Author: Ildar Kamalov <ik@adguard.com>
Date:   Fri Sep 8 10:09:32 2023 +0300

    client: merge schedule
2023-09-08 13:23:00 +03:00
Ainar Garipov
acf539b11d Pull request 2002: fix-typo
Squashed commit of the following:

commit 29c749d1773dc7d14a2696b3dea8cf4fec2ed9fc
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Sep 7 20:06:42 2023 +0300

    all: fix some typos
2023-09-07 20:37:24 +03:00
43 changed files with 220 additions and 144 deletions

View File

@@ -14,11 +14,11 @@ and this project adheres to
<!--
## [v0.108.0] - TBA
## [v0.107.38] - 2023-09-20 (APPROX.)
## [v0.107.39] - 2023-09-27 (APPROX.)
See also the [v0.107.38 GitHub milestone][ms-v0.107.38].
See also the [v0.107.39 GitHub milestone][ms-v0.107.39].
[ms-v0.107.38]: https://github.com/AdguardTeam/AdGuardHome/milestone/73?closed=1
[ms-v0.107.39]: https://github.com/AdguardTeam/AdGuardHome/milestone/74?closed=1
NOTE: Add new changes BELOW THIS COMMENT.
-->
@@ -29,6 +29,25 @@ NOTE: Add new changes ABOVE THIS COMMENT.
## [v0.107.38] - 2023-09-11
See also the [v0.107.38 GitHub milestone][ms-v0.107.38].
### Fixed
- Incorrect original answer when a response is filtered ([#6183]).
- Comments in the *Fallback DNS servers* field in the UI ([#6182]).
- Empty or default Safe Browsing and Parental Control settings ([#6181]).
- Various UI issues.
[#6181]: https://github.com/AdguardTeam/AdGuardHome/issues/6181
[#6182]: https://github.com/AdguardTeam/AdGuardHome/issues/6182
[#6183]: https://github.com/AdguardTeam/AdGuardHome/issues/6183
[ms-v0.107.38]: https://github.com/AdguardTeam/AdGuardHome/milestone/73?closed=1
## [v0.107.37] - 2023-09-07
See also the [v0.107.37 GitHub milestone][ms-v0.107.37].
@@ -219,6 +238,10 @@ See also the [v0.107.36 GitHub milestone][ms-v0.107.36].
- Client hostnames not resolving when upstream server responds with zero-TTL
records ([#6046]).
### Removed
- Go 1.19 support, as it has reached end of life.
[#6046]: https://github.com/AdguardTeam/AdGuardHome/issues/6046
[#6049]: https://github.com/AdguardTeam/AdGuardHome/issues/6049
@@ -2464,11 +2487,12 @@ See also the [v0.104.2 GitHub milestone][ms-v0.104.2].
<!--
[Unreleased]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.38...HEAD
[v0.107.38]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.37...v0.107.38
[Unreleased]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.39...HEAD
[v0.107.39]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.38...v0.107.39
-->
[Unreleased]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.37...HEAD
[Unreleased]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.38...HEAD
[v0.107.38]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.37...v0.107.38
[v0.107.37]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.36...v0.107.37
[v0.107.36]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.35...v0.107.36
[v0.107.35]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.34...v0.107.35

View File

@@ -532,6 +532,8 @@
"statistics_retention_confirm": "Вы ўпэўнены, што хочаце змяніць тэрмін захоўвання статыстыкі? Пры памяншэнні інтэрвалу, некаторыя даныя могуць быць страчаны",
"statistics_cleared": "Статыстыка паспяхова вычышчана",
"statistics_enable": "Уключыць статыстыку",
"ignore_domains_desc_stats": "Запыты, якія адпавядаюць гэтым правілам, не запісваюцца ў статыстыку",
"ignore_domains_desc_query": "Запыты, якія адпавядаюць гэтым правілам, не запісваюцца ў часопіс запытаў",
"interval_hours": "{{count}} гадзіна",
"interval_hours_plural": "{{count}} гадзін",
"filters_configuration": "Налада фільтраў",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Povolit statistiky",
"ignore_domains": "Ignorované domény (oddělené novým řádkem)",
"ignore_domains_title": "Ignorované domény",
"ignore_domains_desc_stats": "Dotazy pro tyto domény se do statistik nezapisují",
"ignore_domains_desc_query": "Dotazy pro tyto domény se do záznamu dotazů nezapisují",
"ignore_domains_desc_stats": "Dotazy odpovídající těmto pravidlům se do statistik nezapisují",
"ignore_domains_desc_query": "Dotazy odpovídající těmto pravidlům se do protokolu dotazů nezapisují",
"interval_hours": "Hodiny: {{count}}",
"interval_hours_plural": "Hodiny: {{count}}",
"filters_configuration": "Konfigurace filtrů",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Aktivér statistikker",
"ignore_domains": "Ignorerede domæner (adskilt af ny linje)",
"ignore_domains_title": "Ignorerede domæner",
"ignore_domains_desc_stats": "Forespørgsler til disse domæner opføres ikke i statistikken",
"ignore_domains_desc_query": "Forespørgsler til disse domæner opføres ikke i forespørgselsloggen",
"ignore_domains_desc_stats": "Forespørgsler, der matcher disse regler, skrives ikke til statistikken",
"ignore_domains_desc_query": "Forespørgsler, der matcher disse regler, skrives ikke til forespørgselsloggen",
"interval_hours": "{{count}} time",
"interval_hours_plural": "{{count}} timer",
"filters_configuration": "Filteropsætninger",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Statistiken aktivieren",
"ignore_domains": "Ignorierte Domains (durch Zeilenumbruch getrennt)",
"ignore_domains_title": "Ignorierte Domains",
"ignore_domains_desc_stats": "Abfragen für diese Domains werden nicht in die Statistik aufgenommen",
"ignore_domains_desc_query": "Abfragen für diese Domains werden nicht in das Abfrageprotokoll aufgenommen",
"ignore_domains_desc_stats": "Anfragen, die diesen Regeln entsprechen, werden nicht in die Statistik aufgenommen",
"ignore_domains_desc_query": "Anfragen, die diesen Regeln entsprechen, werden nicht in das Anfragenprotokoll aufgenommen",
"interval_hours": "{{count}} Stunde",
"interval_hours_plural": "{{count}} Stunden",
"filters_configuration": "Filterkonfiguration",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Habilitar estadísticas",
"ignore_domains": "Dominios ignorados (separados por una nueva línea)",
"ignore_domains_title": "Dominios ignorados",
"ignore_domains_desc_stats": "Las consultas para estos dominios no aparecen en las estadísticas",
"ignore_domains_desc_query": "Las consultas para estos dominios no aparecen en el registro de consultas",
"ignore_domains_desc_stats": "Las consultas que coinciden con estas reglas no aparecen en las estadísticas",
"ignore_domains_desc_query": "Las consultas que coinciden con estas reglas no aparecen en el registro de consultas",
"interval_hours": "{{count}} hora",
"interval_hours_plural": "{{count}} horas",
"filters_configuration": "Configuración de filtros",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Ota tilastointi käyttöön",
"ignore_domains": "Ohitettavat verkkotunnukset (erotettu rivinvaihdolla)",
"ignore_domains_title": "Ohitettavat verkkotunnukset",
"ignore_domains_desc_stats": "Näihin verkkotunnuksiin lähetettyjä pyyntöjä ei tallenneta tilastoihin.",
"ignore_domains_desc_query": "Näihin verkkotunnuksiin lähetettyjä pyyntöjä ei tallenneta pyyntöhistoriaan.",
"ignore_domains_desc_stats": "Sääntöihin sopivat kyselyt eivät kirjoitu tilastoihin",
"ignore_domains_desc_query": "Sääntöihin sopivat kyselyt eivät tallennu kyselylokiin",
"interval_hours": "{{count}} tunti",
"interval_hours_plural": "{{count}} tuntia",
"filters_configuration": "Suodatinten määritys",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Omogući statistiku",
"ignore_domains": "Zanemarene domene (odvojene novim retkom)",
"ignore_domains_title": "Zanemarene domene",
"ignore_domains_desc_stats": "Upiti za ove domene ne upisuju se u statistiku",
"ignore_domains_desc_query": "Upiti za te domene nisu zapisani u zapisnik upita",
"ignore_domains_desc_stats": "Upiti koji odgovaraju ovim pravilima ne upisuju se u statistiku",
"ignore_domains_desc_query": "Upiti koji odgovaraju ovim pravilima ne upisuju se u zapisnik upita",
"interval_hours": "{{count}} sata/i",
"interval_hours_plural": "{{count}} sata/i",
"filters_configuration": "Postavke filtara",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Statisztikák engedélyezése",
"ignore_domains": "Figyelmen kívül hagyott domainek (újsorral elválasztva)",
"ignore_domains_title": "Figyelmen kívül hagyott domainek",
"ignore_domains_desc_stats": "Az ezekre a tartományokra vonatkozó lekérdezések nem kerülnek a statisztikákba",
"ignore_domains_desc_query": "Az ezekhez a tartományokhoz tartozó lekérdezések nem kerülnek a lekérdezési naplóba",
"ignore_domains_desc_stats": "Az ezeknek a szabályoknak megfelelő lekérdezések nem kerülnek be a statisztikákba",
"ignore_domains_desc_query": "Az ezeknek a szabályoknak megfelelő lekérdezések nem kerülnek a lekérdezési naplóba",
"interval_hours": "{{count}} óra",
"interval_hours_plural": "{{count}} óra",
"filters_configuration": "Szűrők beállításai",

View File

@@ -527,6 +527,8 @@
"statistics_retention_confirm": "Apakah Anda yakin ingin mengubah retensi statistik? Jika Anda menurunkan nilai interval, beberapa data akan hilang",
"statistics_cleared": "Statistik berhasil dihapus",
"statistics_enable": "Aktifkan statistik",
"ignore_domains_desc_stats": "Kueri yang cocok dengan aturan ini tidak ditulis ke statistik",
"ignore_domains_desc_query": "Kueri yang cocok dengan aturan ini tidak ditulis ke log kueri",
"interval_hours": "{{count}} jam",
"interval_hours_plural": "{{count}} jam",
"filters_configuration": "Konfigurasi filter",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "統計を有効にする",
"ignore_domains": "無視するドメイン(それぞれ改行で区切ってください)",
"ignore_domains_title": "無視するドメイン",
"ignore_domains_desc_stats": "これらのドメインへのクエリは統計に書き込まれません。",
"ignore_domains_desc_query": "これらのドメインへのクエリはクエリログに書き込まれません。",
"ignore_domains_desc_stats": "これらのルールに一致するクエリは統計に書き込まれません。",
"ignore_domains_desc_query": "これらのルールに一致するクエリはクエリログに書き込まれません。",
"interval_hours": "{{count}}時間",
"interval_hours_plural": "{{count}}時間",
"filters_configuration": "フィルタ設定",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "통계 활성화",
"ignore_domains": "무시된 도메인(줄 바꿈으로 구분)",
"ignore_domains_title": "무시된 도메인",
"ignore_domains_desc_stats": "이러한 도메인에 대한 쿼리는 통계에 기록되지 않습니다.",
"ignore_domains_desc_query": "이러한 도메인에 대한 쿼리는 쿼리 로그에 기록되지 않습니다.",
"ignore_domains_desc_stats": "이러한 규칙과 일치하는 쿼리는 통계에 기록되지 않습니다.",
"ignore_domains_desc_query": "이러한 규칙과 일치하는 쿼리는 쿼리 로그에 기록되지 않습니다.",
"interval_hours": "{{count}} 시간",
"interval_hours_plural": "{{count}} 시간",
"filters_configuration": "필터 구성",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Statistieken inschakelen",
"ignore_domains": "Genegeerde domeinen (gescheiden door nieuwe regel)",
"ignore_domains_title": "Genegeerde domeinen",
"ignore_domains_desc_stats": "Zoekopdrachten voor deze domeinen worden niet naar de statistieken geschreven",
"ignore_domains_desc_query": "Zoekopdrachten voor deze domeinen worden niet naar het zoeklogboek geschreven",
"ignore_domains_desc_stats": "Zoekopdrachten die aan deze regels voldoen, worden niet naar de statistieken geschreven",
"ignore_domains_desc_query": "Zoekopdrachten die aan deze regels voldoen, worden niet naar het zoeklogboek geschreven",
"interval_hours": "{{count}} uur",
"interval_hours_plural": "{{count}} uren",
"filters_configuration": "Filters instellingen",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Włącz statystyki",
"ignore_domains": "Ignorowane domeny (każda w nowym wierszu)",
"ignore_domains_title": "Ignorowane domeny",
"ignore_domains_desc_stats": "Zapytania dla tych domen nie są zapisywane do statystyk",
"ignore_domains_desc_query": "Zapytania dla tych domen nie są zapisywane do dziennika",
"ignore_domains_desc_stats": "Zapytania pasujące do tych reguł nie są zapisywane w statystykach",
"ignore_domains_desc_query": "Zapytania pasujące do tych reguł nie są zapisywane w dzienniku zapytań",
"interval_hours": "{{count}} godzina",
"interval_hours_plural": "{{count}} godziny",
"filters_configuration": "Konfiguracja filtrów",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Ativar estatísticas",
"ignore_domains": "Domínios ignorados (separados por nova linha)",
"ignore_domains_title": "Domínios ignorados",
"ignore_domains_desc_stats": "As consultas para esses domínios não são gravadas nas estatísticas",
"ignore_domains_desc_query": "As consultas para esses domínios não são gravadas no registro de consulta",
"ignore_domains_desc_stats": "As consultas que correspondem a essas regras não são gravadas nas estatísticas",
"ignore_domains_desc_query": "As consultas que correspondem a essas regras não são gravadas no registro de consultas",
"interval_hours": "{{count}} hora",
"interval_hours_plural": "{{count}} horas",
"filters_configuration": "Configuração de filtros",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Ativar estatísticas",
"ignore_domains": "Domínios ignorados (separados por nova linha)",
"ignore_domains_title": "Domínios ignorados",
"ignore_domains_desc_stats": "As consultas para estes domínios não aparecem nas estatísticas",
"ignore_domains_desc_query": "As consultas para estes domínios não aparecem no registo de consultas",
"ignore_domains_desc_stats": "As consultas que correspondem a essas regras não são gravadas nas estatísticas",
"ignore_domains_desc_query": "As consultas que correspondem a essas regras não são gravadas no registo de consultas",
"interval_hours": "{{count}} hora",
"interval_hours_plural": "{{count}} horas",
"filters_configuration": "Definição dos filtros",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Activați statisticile",
"ignore_domains": "Domenii ignorate (separate prin linie nouă)",
"ignore_domains_title": "Domenii ignorate",
"ignore_domains_desc_stats": "Interogările pentru aceste domenii nu sunt scrise în statistici",
"ignore_domains_desc_query": "Interogările pentru aceste domenii nu sunt scrise în jurnalul de interogări",
"ignore_domains_desc_stats": "Interogările care corespund acestor reguli nu sunt scrise în statistici",
"ignore_domains_desc_query": "Interogările care corespund acestor reguli nu sunt scrise în jurnalul de interogări",
"interval_hours": "{{count}} oră",
"interval_hours_plural": "{{count}} ore",
"filters_configuration": "Configurația filtrelor",

View File

@@ -17,7 +17,7 @@
"local_ptr_no_default_resolver": "AdGuard Home не смог определить подходящие приватные обратные DNS-резолверы для этой системы.",
"local_ptr_placeholder": "Введите по одному адресу на строчку",
"resolve_clients_title": "Включить запрашивание доменных имён для IP-адресов клиентов",
"resolve_clients_desc": "Определять доменные имена клиентов через PTR-запросы к соответствующим серверам (приватные DNS-серверы для локальных клиентов, upstream-сервер для клиентов с публичным IP-адресом).",
"resolve_clients_desc": "Определять доменные имена клиентов через PTR-запросы к соответствующим серверам (приватные DNS-серверы для локальных клиентов, upstream-серверы для клиентов с публичным IP-адресом).",
"use_private_ptr_resolvers_title": "Использовать приватные обратные DNS-резолверы",
"use_private_ptr_resolvers_desc": "Посылать обратные DNS-запросы для локально обслуживаемых адресов на указанные серверы. Если отключено, AdGuard Home будет отвечать NXDOMAIN на все подобные PTR-запросы, кроме запросов о клиентах, уже известных по DHCP, /etc/hosts и так далее.",
"check_dhcp_servers": "Проверить DHCP-серверы",
@@ -537,8 +537,8 @@
"statistics_enable": "Включить статистику",
"ignore_domains": "Игнорируемые домены (построчно)",
"ignore_domains_title": "Игнорируемые домены",
"ignore_domains_desc_stats": "Запросы для этих доменов не записываются в статистику",
"ignore_domains_desc_query": "Запросы для этих доменов не записываются в журнал запросов",
"ignore_domains_desc_stats": "Запросы, соответствующие этим правилам, не записываются в статистику",
"ignore_domains_desc_query": "Запросы, соответствующие этим правилам, не записываются в журнал запросов",
"interval_hours": "{{count}} час",
"interval_hours_plural": "{{count}} часов",
"filters_configuration": "Настройка фильтров",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Zapnúť štatistiku",
"ignore_domains": "Ignorované domény (oddelené novým riadkom)",
"ignore_domains_title": "Ignorované domény",
"ignore_domains_desc_stats": "Dopyty pre tieto domény sa nezapisujú do štatistík",
"ignore_domains_desc_query": "Dopyty pre tieto domény sa nezapisujú do denníka dopytov",
"ignore_domains_desc_stats": "Dopyty zodpovedajúce týmto pravidlám sa nezapisujú do štatistík",
"ignore_domains_desc_query": "Dopyty zodpovedajúce týmto pravidlám sa nezapisujú do denníka dopytov",
"interval_hours": "{{count}} hodina",
"interval_hours_plural": "{{count}} hodín",
"filters_configuration": "Konfigurácia filtrov",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Omogoči statistiko",
"ignore_domains": "Prezrte domene (ločene z novo vrstico)",
"ignore_domains_title": "Prezrte domene",
"ignore_domains_desc_stats": "Poizvedbe za te domene niso zapisane v statistiko",
"ignore_domains_desc_query": "Poizvedbe za te domene niso zapisane v dnevnik poizvedb",
"ignore_domains_desc_stats": "Poizvedbe, ki ustrezajo tem pravilom, se ne zapišejo v statistiko",
"ignore_domains_desc_query": "Poizvedbe, ki ustrezajo tem pravilom, se ne zapišejo v dnevnik poizvedb",
"interval_hours": "{{count}} ur",
"interval_hours_plural": "{{count}} ur",
"filters_configuration": "Nastavitve filtrov",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Uključi statistiku",
"ignore_domains": "Zanemari domene (razdvojene novom linijom)",
"ignore_domains_title": "Zanemareni domeni",
"ignore_domains_desc_stats": "Upiti za ove domene nisu upisani u statistiku",
"ignore_domains_desc_query": "Upiti za ove domene nisu upisani u evidenciju upita",
"ignore_domains_desc_stats": "Upiti koji se podudaraju sa ovim pravilima nisu upisani u statistiku",
"ignore_domains_desc_query": "Upiti koji se podudaraju sa ovim pravilima nisu upisani u evidenciju upita",
"interval_hours": "{{count}} čas",
"interval_hours_plural": "{{count}} časova",
"filters_configuration": "Konfiguracija filtera",

View File

@@ -536,8 +536,8 @@
"statistics_enable": "Aktivera statistik",
"ignore_domains": "Ignorerade domäner (avgränsade med ny rad)",
"ignore_domains_title": "Ignorerade domäner",
"ignore_domains_desc_stats": "Förfrågningar r dessa domäner skrivs inte till statistiken",
"ignore_domains_desc_query": "Förfrågningar r dessa domäner skrivs inte till frågeloggningen",
"ignore_domains_desc_stats": "Förfrågningar som matchar dessa regler skrivs inte till statistiken",
"ignore_domains_desc_query": "Förfrågningar som matchar dessa regler skrivs inte till förfrågningsloggen",
"interval_hours": "{{count}} timme",
"interval_hours_plural": "{{count}} timmar",
"filters_configuration": "Filterinställningar",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "İstatistikleri etkinleştir",
"ignore_domains": "Yok sayılan alan adları (yeni satırla ayrılmış)",
"ignore_domains_title": "Yok sayılan alan adları",
"ignore_domains_desc_stats": "Bu alan adları için yapılan sorgular istatistiklere yazılmaz",
"ignore_domains_desc_query": "Bu alan adları için yapılan sorgular sorgu günlüğüne yazılmaz",
"ignore_domains_desc_stats": "Bu kurallarla eşleşen sorgular istatistiklere yazılmaz",
"ignore_domains_desc_query": "Bu kurallarla eşleşen sorgular sorgu günlüğüne yazılmaz",
"interval_hours": "{{count}} saat",
"interval_hours_plural": "{{count}} saat",
"filters_configuration": "Filtre yapılandırması",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Увімкнути статистику",
"ignore_domains": "Ігноровані домени (по одному на рядок)",
"ignore_domains_title": "Ігноровані домени",
"ignore_domains_desc_stats": "Запити для цих доменів в статистику не пишуться",
"ignore_domains_desc_query": "Запити для цих доменів не записуються до журналу запитів",
"ignore_domains_desc_stats": "Запити, які відповідають цим правилам, в статистику не пишуться",
"ignore_domains_desc_query": "Запити, які відповідають цим правилам, не записуються до журналу запитів",
"interval_hours": "{{count}} година",
"interval_hours_plural": "{{count}} годин(и)",
"filters_configuration": "Конфігурація фільтрів",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "Bật thống kê",
"ignore_domains": "Các miền bị bỏ qua (cách nhau bởi dòng mới)",
"ignore_domains_title": "Các miền bị bỏ qua",
"ignore_domains_desc_stats": "Các truy vấn cho các miền này sẽ không được ghi vào thống kê",
"ignore_domains_desc_query": "Các truy vấn cho các miền này sẽ không được ghi vào nhật ký truy vấn",
"ignore_domains_desc_stats": "Các truy vấn phù hợp với các quy tắc này không được ghi vào số liệu thống kê",
"ignore_domains_desc_query": "Các truy vấn khớp với các quy tắc này không được ghi vào nhật ký truy vấn",
"interval_hours": "{{count}} giờ",
"interval_hours_plural": "{{count}} giờ",
"filters_configuration": "Cấu hình bộ lọc",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "启用统计数据",
"ignore_domains": "忽略的网域(以换行符分隔)",
"ignore_domains_title": "被忽略的网域",
"ignore_domains_desc_stats": "这些网域的查询不在统计信息",
"ignore_domains_desc_query": "这些网域的查询不在查询日志记录",
"ignore_domains_desc_stats": "匹配这些规则的查询不在统计信息",
"ignore_domains_desc_query": "匹配这些规则的查询不在查询日志",
"interval_hours": "{{count}} 小时",
"interval_hours_plural": "{{count}} 小时",
"filters_configuration": "过滤器配置",

View File

@@ -537,8 +537,8 @@
"statistics_enable": "啟用統計資料",
"ignore_domains": "忽略的網域(以換行符分隔)",
"ignore_domains_title": "被忽略的網域",
"ignore_domains_desc_stats": "這些網域的查詢不在統計資料",
"ignore_domains_desc_query": "這些網域的查詢不在查詢記錄",
"ignore_domains_desc_stats": "符合這些規則的查詢不會被記錄在統計資料",
"ignore_domains_desc_query": "符合這些規則的查詢不會被寫入查詢記錄",
"interval_hours": "{{count}} 小時",
"interval_hours_plural": "{{count}} 小時",
"filters_configuration": "過濾器配置",

View File

@@ -72,31 +72,16 @@ export const Modal = ({
const onFormSubmit = (e) => {
e.preventDefault();
if (currentDay) {
const newSchedule = schedule;
const newSchedule = schedule;
Array.from(days).forEach((day) => {
newSchedule[day] = {
start: startTime,
end: endTime,
};
});
onSubmit(newSchedule);
} else {
const newSchedule = {
time_zone: timezone,
Array.from(days).forEach((day) => {
newSchedule[day] = {
start: startTime,
end: endTime,
};
});
Array.from(days).forEach((day) => {
newSchedule[day] = {
start: startTime,
end: endTime,
};
});
onSubmit(newSchedule);
}
onSubmit(newSchedule);
};
return (
@@ -133,7 +118,7 @@ export const Modal = ({
>
{getShortDayName(t, day)}
</button>
)) }
))}
</div>
<div className="schedule__time-wrap">

4
go.mod
View File

@@ -17,7 +17,7 @@ require (
github.com/google/gopacket v1.1.19
github.com/google/renameio/v2 v2.0.0
github.com/google/uuid v1.3.1
github.com/insomniacslk/dhcp v0.0.0-20230906122924-c71a6be05968
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86
github.com/kardianos/service v1.2.2
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118
@@ -48,7 +48,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/google/pprof v0.0.0-20230906154834-20cde9067b3b // indirect
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect
github.com/mdlayher/socket v0.5.0 // indirect
github.com/onsi/ginkgo/v2 v2.12.0 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect

8
go.sum
View File

@@ -43,16 +43,16 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
github.com/google/pprof v0.0.0-20230906154834-20cde9067b3b h1:AIwVPxYWRaz7GetyrRj3ShUL5hr7WeuqF52G0g8Hne8=
github.com/google/pprof v0.0.0-20230906154834-20cde9067b3b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb h1:LCMfzVg3sflxTs4UvuP4D8CkoZnfHLe2qzqgDn/4OHs=
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg=
github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 h1:/jC7qQFrv8CrSJVmaolDVOxTfS9kc36uB6H40kdbQq8=
github.com/insomniacslk/dhcp v0.0.0-20230906122924-c71a6be05968 h1:uBiv5/8x42J7myumCdFuDOc5HnEXRK6eOtefwvE6+TQ=
github.com/insomniacslk/dhcp v0.0.0-20230906122924-c71a6be05968/go.mod h1:zmdm3sTSDP3vOOX3CEWRkkRHtKr1DxBx+J1OQFoDQQs=
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a h1:S33o3djA1nPRd+d/bf7jbbXytXuK/EoXow7+aa76grQ=
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a/go.mod h1:zmdm3sTSDP3vOOX3CEWRkkRHtKr1DxBx+J1OQFoDQQs=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
github.com/josharian/native v1.0.1-0.20221213033349-c1e37c09b531/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=

View File

@@ -54,7 +54,7 @@ func TestServer_handleDHCPStatus(t *testing.T) {
assert.JSONEq(t, b.String(), w.Body.String())
}
// defaultResponse is a helper that returs the response with default
// defaultResponse is a helper that returns the response with default
// configuration.
defaultResponse := func() *dhcpStatusResponse {
conf4 := defaultV4ServerConf()

View File

@@ -614,6 +614,7 @@ func (s *Server) Prepare(conf *ServerConfig) (err error) {
// setupFallbackDNS initializes the fallback DNS servers.
func (s *Server) setupFallbackDNS() (err error) {
fallbacks := s.conf.FallbackDNS
fallbacks = stringutil.FilterOut(fallbacks, IsCommentOrEmpty)
if len(fallbacks) == 0 {
return nil
}

View File

@@ -372,6 +372,27 @@ func TestServer_timeout(t *testing.T) {
})
}
func TestServer_Prepare_fallbacks(t *testing.T) {
srvConf := &ServerConfig{
Config: Config{
FallbackDNS: []string{
"#tls://1.1.1.1",
"8.8.8.8",
},
EDNSClientSubnet: &EDNSClientSubnet{Enabled: false},
},
}
s, err := NewServer(DNSCreateParams{})
require.NoError(t, err)
err = s.Prepare(srvConf)
require.NoError(t, err)
require.NotNil(t, s.dnsProxy.Fallbacks)
assert.Len(t, s.dnsProxy.Fallbacks.Upstreams, 1)
}
func TestServerWithProtectionDisabled(t *testing.T) {
s := createTestServer(t, &filtering.Config{
BlockingMode: filtering.BlockingModeDefault,

View File

@@ -11,6 +11,7 @@ import (
"github.com/AdguardTeam/dnsproxy/proxy"
"github.com/AdguardTeam/golibs/log"
"github.com/AdguardTeam/golibs/netutil"
"github.com/AdguardTeam/urlfilter/rules"
"github.com/miekg/dns"
"golang.org/x/exp/slices"
)
@@ -140,15 +141,15 @@ func (s *Server) filterRewritten(
// checkHostRules checks the host against filters. It is safe for concurrent
// use.
func (s *Server) checkHostRules(host string, rrtype uint16, setts *filtering.Settings) (
r *filtering.Result,
err error,
) {
func (s *Server) checkHostRules(
host string,
rrtype rules.RRType,
setts *filtering.Settings,
) (r *filtering.Result, err error) {
s.serverLock.RLock()
defer s.serverLock.RUnlock()
var res filtering.Result
res, err = s.dnsFilter.CheckHostRules(host, rrtype, setts)
res, err := s.dnsFilter.CheckHostRules(host, rrtype, setts)
if err != nil {
return nil, err
}
@@ -156,20 +157,21 @@ func (s *Server) checkHostRules(host string, rrtype uint16, setts *filtering.Set
return &res, err
}
// filterDNSResponse checks each resource record of the response's answer
// section from pctx and returns a non-nil res if at least one of canonical
// names or IP addresses in it matches the filtering rules.
func (s *Server) filterDNSResponse(
pctx *proxy.DNSContext,
setts *filtering.Settings,
) (res *filtering.Result, err error) {
// filterDNSResponse checks each resource record of answer section of
// dctx.proxyCtx.Res. It sets dctx.result and dctx.origResp if at least one of
// canonical names, IP addresses, or HTTPS RR hints in it matches the filtering
// rules, as well as sets dctx.proxyCtx.Res to the filtered response.
func (s *Server) filterDNSResponse(dctx *dnsContext) (err error) {
setts := dctx.setts
if !setts.FilteringEnabled {
return nil, nil
return nil
}
for _, a := range pctx.Res.Answer {
var res *filtering.Result
pctx := dctx.proxyCtx
for i, a := range pctx.Res.Answer {
host := ""
var rrtype uint16
var rrtype rules.RRType
switch a := a.(type) {
case *dns.CNAME:
host = strings.TrimSuffix(a.Target, ".")
@@ -195,18 +197,19 @@ func (s *Server) filterDNSResponse(
log.Debug("dnsforward: checked %s %s for %s", dns.Type(rrtype), host, a.Header().Name)
if err != nil {
return nil, err
} else if res == nil {
continue
} else if res.IsFiltered {
return fmt.Errorf("filtering answer at index %d: %w", i, err)
} else if res != nil && res.IsFiltered {
dctx.result = res
dctx.origResp = pctx.Res
pctx.Res = s.genDNSFilterMessage(pctx, res)
log.Debug("dnsforward: matched %q by response: %q", pctx.Req.Question[0].Name, host)
return res, nil
break
}
}
return nil, nil
return nil
}
// removeIPv6Hints deletes IPv6 hints from RR values.

View File

@@ -328,26 +328,34 @@ func TestHandleDNSRequest_filterDNSResponse(t *testing.T) {
Addr: &net.UDPAddr{IP: net.IP{127, 0, 0, 1}, Port: 1},
}
res, rErr := s.filterDNSResponse(pctx, &filtering.Settings{
ProtectionEnabled: true,
FilteringEnabled: true,
})
require.NoError(t, rErr)
dctx := &dnsContext{
proxyCtx: pctx,
setts: &filtering.Settings{
ProtectionEnabled: true,
FilteringEnabled: true,
},
}
fltErr := s.filterDNSResponse(dctx)
require.NoError(t, fltErr)
res := dctx.result
if tc.wantRule == "" {
assert.Nil(t, res)
return
}
want := &filtering.Result{
wantResult := &filtering.Result{
IsFiltered: true,
Reason: filtering.FilteredBlockList,
Rules: []*filtering.ResultRule{{
Text: tc.wantRule,
}},
}
assert.Equal(t, want, res)
assert.Equal(t, wantResult, res)
assert.Equal(t, resp, dctx.origResp)
})
}
}

View File

@@ -749,6 +749,7 @@ func (s *Server) handleTestUpstreamDNS(w http.ResponseWriter, r *http.Request) {
}
req.Upstreams = stringutil.FilterOut(req.Upstreams, IsCommentOrEmpty)
req.FallbackDNS = stringutil.FilterOut(req.FallbackDNS, IsCommentOrEmpty)
req.PrivateUpstreams = stringutil.FilterOut(req.PrivateUpstreams, IsCommentOrEmpty)
upsNum := len(req.Upstreams) + len(req.FallbackDNS) + len(req.PrivateUpstreams)

View File

@@ -577,6 +577,14 @@ func TestServer_HandleTestUpstreamDNS(t *testing.T) {
badUps + ` over tcp: dns: id mismatch`,
},
name: "fallback_broken",
}, {
body: map[string]any{
"fallback_dns": []string{goodUps, "#this.is.comment"},
},
wantResp: map[string]any{
goodUps: "OK",
},
name: "fallback_comment_mix",
}}
for _, tc := range testCases {

View File

@@ -671,11 +671,11 @@ func (s *Server) processLocalPTR(dctx *dnsContext) (rc resultCode) {
}
// Apply filtering logic
func (s *Server) processFilteringBeforeRequest(ctx *dnsContext) (rc resultCode) {
func (s *Server) processFilteringBeforeRequest(dctx *dnsContext) (rc resultCode) {
log.Debug("dnsforward: started processing filtering before req")
defer log.Debug("dnsforward: finished processing filtering before req")
if ctx.proxyCtx.Res != nil {
if dctx.proxyCtx.Res != nil {
// Go on since the response is already set.
return resultCodeSuccess
}
@@ -684,8 +684,8 @@ func (s *Server) processFilteringBeforeRequest(ctx *dnsContext) (rc resultCode)
defer s.serverLock.RUnlock()
var err error
if ctx.result, err = s.filterDNSRequest(ctx); err != nil {
ctx.err = err
if dctx.result, err = s.filterDNSRequest(dctx); err != nil {
dctx.err = err
return resultCodeError
}
@@ -857,7 +857,6 @@ func (s *Server) processFilteringAfterResponse(dctx *dnsContext) (rc resultCode)
log.Debug("dnsforward: started processing filtering after resp")
defer log.Debug("dnsforward: finished processing filtering after resp")
pctx := dctx.proxyCtx
switch res := dctx.result; res.Reason {
case filtering.NotFilteredAllowList:
return resultCodeSuccess
@@ -871,6 +870,7 @@ func (s *Server) processFilteringAfterResponse(dctx *dnsContext) (rc resultCode)
return resultCodeSuccess
}
pctx := dctx.proxyCtx
pctx.Req.Question[0], pctx.Res.Question[0] = dctx.origQuestion, dctx.origQuestion
if len(pctx.Res.Answer) > 0 {
rr := s.genAnswerCNAME(pctx.Req, res.CanonName)
@@ -880,13 +880,13 @@ func (s *Server) processFilteringAfterResponse(dctx *dnsContext) (rc resultCode)
return resultCodeSuccess
default:
return s.filterAfterResponse(dctx, pctx)
return s.filterAfterResponse(dctx)
}
}
// filterAfterResponse returns the result of filtering the response that wasn't
// explicitly allowed or rewritten.
func (s *Server) filterAfterResponse(dctx *dnsContext, pctx *proxy.DNSContext) (res resultCode) {
func (s *Server) filterAfterResponse(dctx *dnsContext) (res resultCode) {
// Check the response only if it's from an upstream. Don't check the
// response if the protection is disabled since dnsrewrite rules aren't
// applied to it anyway.
@@ -894,17 +894,12 @@ func (s *Server) filterAfterResponse(dctx *dnsContext, pctx *proxy.DNSContext) (
return resultCodeSuccess
}
result, err := s.filterDNSResponse(pctx, dctx.setts)
err := s.filterDNSResponse(dctx)
if err != nil {
dctx.err = err
return resultCodeError
}
if result != nil {
dctx.result = result
dctx.origResp = pctx.Res
}
return resultCodeSuccess
}

View File

@@ -282,6 +282,12 @@ type statsConfig struct {
Enabled bool `yaml:"enabled"`
}
// Default block host constants.
const (
defaultSafeBrowsingBlockHost = "standard-block.dns.adguard.com"
defaultParentalBlockHost = "family-block.dns.adguard.com"
)
// config is the global configuration structure.
//
// TODO(a.garipov, e.burkov): This global is awful and must be removed.
@@ -389,6 +395,9 @@ var config = &configuration{
Schedule: schedule.EmptyWeekly(),
IDs: []string{},
},
ParentalBlockHost: defaultParentalBlockHost,
SafeBrowsingBlockHost: defaultSafeBrowsingBlockHost,
},
DHCP: &dhcpd.ServerConfig{
LocalDomainName: "lan",

View File

@@ -359,9 +359,6 @@ func setupDNSFilteringConf(conf *filtering.Config) (err error) {
pcService = "parental control"
defaultParentalServer = `https://family.adguard-dns.com/dns-query`
pcTXTSuffix = `pc.dns.adguard.com.`
defaultSafeBrowsingBlockHost = "standard-block.dns.adguard.com"
defaultParentalBlockHost = "family-block.dns.adguard.com"
)
conf.EtcHosts = Context.etcHosts
@@ -398,8 +395,15 @@ func setupDNSFilteringConf(conf *filtering.Config) (err error) {
CacheSize: conf.SafeBrowsingCacheSize,
})
if conf.SafeBrowsingBlockHost != "" {
conf.SafeBrowsingBlockHost = defaultSafeBrowsingBlockHost
// Protect against invalid configuration, see #6181.
//
// TODO(a.garipov): Validate against an empty host instead of setting it to
// default.
if conf.SafeBrowsingBlockHost == "" {
host := defaultSafeBrowsingBlockHost
log.Info("%s: warning: empty blocking host; using default: %q", sbService, host)
conf.SafeBrowsingBlockHost = host
}
parUps, err := upstream.AddressToUpstream(defaultParentalServer, upsOpts)
@@ -415,8 +419,15 @@ func setupDNSFilteringConf(conf *filtering.Config) (err error) {
CacheSize: conf.ParentalCacheSize,
})
if conf.ParentalBlockHost != "" {
conf.ParentalBlockHost = defaultParentalBlockHost
// Protect against invalid configuration, see #6181.
//
// TODO(a.garipov): Validate against an empty host instead of setting it to
// default.
if conf.ParentalBlockHost == "" {
host := defaultParentalBlockHost
log.Info("%s: warning: empty blocking host; using default: %q", pcService, host)
conf.ParentalBlockHost = host
}
conf.SafeSearchConf.CustomResolver = safeSearchResolver{}

View File

@@ -72,7 +72,7 @@ type Entry struct {
Time time.Duration
}
// validate returs an error if entry is not valid.
// validate returns an error if entry is not valid.
func (e *Entry) validate() (err error) {
switch {
case e.Result == 0:
@@ -295,7 +295,7 @@ func loadUnitFromDB(tx *bbolt.Tx, id uint32) (udb *unitDB) {
return udb
}
// deserealize assigns the appropriate values from udb to u. u must not be nil.
// deserialize assigns the appropriate values from udb to u. u must not be nil.
// It's safe for concurrent use.
func (u *unit) deserialize(udb *unitDB) {
if udb == nil {

View File

@@ -113,9 +113,9 @@ func (u *Updater) Update(firstRun bool) (err error) {
log.Info("updater: updating")
defer func() {
if err != nil {
log.Error("updater: failed: %v", err)
log.Info("updater: failed")
} else {
log.Info("updater: finished")
log.Info("updater: finished successfully")
}
}()
@@ -240,18 +240,24 @@ func (u *Updater) unpack() error {
// check returns an error if the configuration file couldn't be used with the
// version of AdGuard Home just downloaded.
func (u *Updater) check() error {
func (u *Updater) check() (err error) {
log.Debug("updater: checking configuration")
err := copyFile(u.confName, filepath.Join(u.updateDir, "AdGuardHome.yaml"))
err = copyFile(u.confName, filepath.Join(u.updateDir, "AdGuardHome.yaml"))
if err != nil {
return fmt.Errorf("copyFile() failed: %w", err)
}
const format = "executing configuration check command: %w %d:\n" +
"below is the output of configuration check:\n" +
"%s" +
"end of the output"
cmd := exec.Command(u.updateExeName, "--check-config")
err = cmd.Run()
if err != nil || cmd.ProcessState.ExitCode() != 0 {
return fmt.Errorf("exec.Command(): %s %d", err, cmd.ProcessState.ExitCode())
out, err := cmd.CombinedOutput()
code := cmd.ProcessState.ExitCode()
if err != nil || code != 0 {
return fmt.Errorf(format, err, code, out)
}
return nil

View File

@@ -30,7 +30,7 @@ const (
twoskyURI = "https://twosky.int.agrd.dev/api/v1"
readLimit = 1 * 1024 * 1024
uploadTimeout = 10 * time.Second
uploadTimeout = 20 * time.Second
)
// blockerLangCodes is the codes of languages which need to be fully translated.