From ce9bb588ed7b8f5f63ca707d9ca1a0bd039afca1 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Tue, 19 Mar 2024 16:20:32 +0300 Subject: [PATCH] all: sync with master --- CHANGELOG.md | 37 ++++++++++++++++------ client/src/__locales/cs.json | 2 +- client/src/__locales/da.json | 2 +- client/src/__locales/de.json | 2 +- client/src/__locales/es.json | 2 +- client/src/__locales/fr.json | 2 +- client/src/__locales/it.json | 2 +- client/src/__locales/ja.json | 2 +- client/src/__locales/ko.json | 2 +- client/src/__locales/nl.json | 2 +- client/src/__locales/pt-br.json | 2 +- client/src/__locales/pt-pt.json | 2 +- client/src/__locales/ru.json | 2 +- client/src/__locales/sk.json | 2 +- client/src/__locales/sl.json | 2 +- client/src/__locales/tr.json | 2 +- client/src/__locales/uk.json | 2 +- client/src/__locales/zh-cn.json | 2 +- client/src/__locales/zh-tw.json | 2 +- go.mod | 24 +++++++------- go.sum | 52 +++++++++++++++---------------- internal/dnsforward/dnsforward.go | 35 +++++++++++++++++++-- internal/filtering/servicelist.go | 15 +++++++++ internal/home/dns.go | 12 +++++++ 24 files changed, 143 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cef99c10..a5967b8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,15 +14,25 @@ and this project adheres to + + + + +## [v0.107.46] - 2024-03-20 + +See also the [v0.107.46 GitHub milestone][ms-v0.107.46]. + ### Added - Ability to disable the use of system hosts file information for query @@ -30,6 +40,15 @@ NOTE: Add new changes BELOW THIS COMMENT. - Ability to define custom directories for storage of query log files and statistics ([#5992]). +### Changed + +- Private RDNS resolution (`dns.use_private_ptr_resolvers` in YAML + configuration) now requires a valid "Private reverse DNS servers", when + enabled ([#6820]). + + **NOTE:** Disabling private RDNS resolution behaves effectively the same as if + no private reverse DNS servers provided by user and by the OS. + ### Fixed - Statistics for 7 days displayed by day on the dashboard graph ([#6712]). @@ -41,10 +60,9 @@ NOTE: Add new changes BELOW THIS COMMENT. [#6711]: https://github.com/AdguardTeam/AdGuardHome/issues/6711 [#6712]: https://github.com/AdguardTeam/AdGuardHome/issues/6712 [#6740]: https://github.com/AdguardTeam/AdGuardHome/issues/6740 +[#6820]: https://github.com/AdguardTeam/AdGuardHome/issues/6820 - +[ms-v0.107.46]: https://github.com/AdguardTeam/AdGuardHome/milestone/81?closed=1 @@ -2835,11 +2853,12 @@ See also the [v0.104.2 GitHub milestone][ms-v0.104.2]. -[Unreleased]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.45...HEAD +[Unreleased]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.46...HEAD +[v0.107.46]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.45...v0.107.46 [v0.107.45]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.44...v0.107.45 [v0.107.44]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.43...v0.107.44 [v0.107.43]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.42...v0.107.43 diff --git a/client/src/__locales/cs.json b/client/src/__locales/cs.json index f8f64dcb..de792d0a 100644 --- a/client/src/__locales/cs.json +++ b/client/src/__locales/cs.json @@ -678,7 +678,7 @@ "use_saved_key": "Použít dříve uložený klíče", "parental_control": "Rodičovská ochrana", "safe_browsing": "Bezpečné prohlížení", - "served_from_cache": "{{value}} (převzato z mezipaměti)", + "served_from_cache_label": "Převzato z mezipaměti", "form_error_password_length": "Heslo musí obsahovat od {{min}} do {{max}} znaků", "anonymizer_notification": "<0>Poznámka: Anonymizace IP je zapnuta. Můžete ji vypnout v <1>Obecných nastaveních.", "confirm_dns_cache_clear": "Opravdu chcete vymazat mezipaměť DNS?", diff --git a/client/src/__locales/da.json b/client/src/__locales/da.json index 272ee813..47d689c8 100644 --- a/client/src/__locales/da.json +++ b/client/src/__locales/da.json @@ -678,7 +678,7 @@ "use_saved_key": "Brug den tidligere gemte nøgle", "parental_control": "Forældrekontrol", "safe_browsing": "Sikker Browsing", - "served_from_cache": "{{value}} (leveret fra cache)", + "served_from_cache_label": "Leveret fra cache", "form_error_password_length": "Adgangskode skal udgøre fra {{min}} til {{max}} tegn", "anonymizer_notification": "<0>Bemærk: IP-anonymisering er aktiveret. Det kan deaktiveres via <1>Generelle indstillinger.", "confirm_dns_cache_clear": "Sikker på, at DNS-cache skal ryddes?", diff --git a/client/src/__locales/de.json b/client/src/__locales/de.json index bdf1da7d..9ea333bd 100644 --- a/client/src/__locales/de.json +++ b/client/src/__locales/de.json @@ -678,7 +678,7 @@ "use_saved_key": "Zuvor gespeicherten Schlüssel verwenden", "parental_control": "Kindersicherung", "safe_browsing": "Internetsicherheit", - "served_from_cache": "{{value}} (aus dem Cache abgerufen)", + "served_from_cache_label": "Aus dem Cache abgerufen", "form_error_password_length": "Das Passwort muss zwischen {{min}} und {{max}} Zeichen enthalten", "anonymizer_notification": "<0>Hinweis: Die IP-Anonymisierung ist aktiviert. Sie können sie in den <1>Allgemeinen Einstellungen deaktivieren.", "confirm_dns_cache_clear": "Möchten Sie den DNS-Cache wirklich leeren?", diff --git a/client/src/__locales/es.json b/client/src/__locales/es.json index be20a424..8346cd56 100644 --- a/client/src/__locales/es.json +++ b/client/src/__locales/es.json @@ -678,7 +678,7 @@ "use_saved_key": "Usar la clave guardada previamente", "parental_control": "Control parental", "safe_browsing": "Navegación segura", - "served_from_cache": "{{value}} (servido desde la caché)", + "served_from_cache_label": "Servido desde la caché", "form_error_password_length": "La contraseña debe tener entre {{min}} y {{max}} caracteres", "anonymizer_notification": "<0>Nota: La anonimización de IP está habilitada. Puedes deshabilitarla en <1>Configuración general.", "confirm_dns_cache_clear": "¿Estás seguro de que deseas borrar la caché DNS?", diff --git a/client/src/__locales/fr.json b/client/src/__locales/fr.json index 6bc2d8cf..c985208d 100644 --- a/client/src/__locales/fr.json +++ b/client/src/__locales/fr.json @@ -678,7 +678,7 @@ "use_saved_key": "Utiliser la clef précédemment enregistrée", "parental_control": "Contrôle parental", "safe_browsing": "Navigation sécurisée", - "served_from_cache": "{{value}} (depuis le cache)", + "served_from_cache_label": "Servi depuis le cache", "form_error_password_length": "Le mot de passe doit comporter entre {{min}} et {{max}}  caractères", "anonymizer_notification": "<0>Note : L'anonymisation IP est activée. Vous pouvez la désactiver dans les <1>paramètres généraux.", "confirm_dns_cache_clear": "Voulez-vous vraiment vider le cache DNS ?", diff --git a/client/src/__locales/it.json b/client/src/__locales/it.json index 88e4e053..892cbdcb 100644 --- a/client/src/__locales/it.json +++ b/client/src/__locales/it.json @@ -678,7 +678,7 @@ "use_saved_key": "Utilizza la chiave salvata in precedenza", "parental_control": "Controllo Parentale", "safe_browsing": "Navigazione Sicura", - "served_from_cache": "{{value}} (fornito dalla cache)", + "served_from_cache_label": "Servito dalla cache", "form_error_password_length": "La password deve contenere da {{min}} a {{max}} caratteri", "anonymizer_notification": "<0>Attenzione: L'anonimizzazione dell'IP è abilitata. Puoi disabilitarla in <1>Impostazioni generali.", "confirm_dns_cache_clear": "Sei sicuro di voler cancellare la cache DNS?", diff --git a/client/src/__locales/ja.json b/client/src/__locales/ja.json index 06cbc108..e9aca0a3 100644 --- a/client/src/__locales/ja.json +++ b/client/src/__locales/ja.json @@ -678,7 +678,7 @@ "use_saved_key": "以前に保存したキーを使用する", "parental_control": "ペアレンタルコントロール", "safe_browsing": "セーフブラウジング", - "served_from_cache": "{{value}} (キャッシュから応答)", + "served_from_cache_label": "キャッシュからの配信:", "form_error_password_length": "パスワードの長さは{{min}}〜{{max}}文字にしてください。", "anonymizer_notification": "【<0>注意】IPの匿名化が有効になっています。 <1>一般設定で無効にできます。", "confirm_dns_cache_clear": "DNS キャッシュをクリアしてもよろしいですか?", diff --git a/client/src/__locales/ko.json b/client/src/__locales/ko.json index bbab696a..42d5b599 100644 --- a/client/src/__locales/ko.json +++ b/client/src/__locales/ko.json @@ -678,7 +678,7 @@ "use_saved_key": "이전에 저장했던 키 사용하기", "parental_control": "자녀 보호", "safe_browsing": "세이프 브라우징", - "served_from_cache": "{{value}} (캐시에서 제공)", + "served_from_cache_label": "캐시에서 가져옴", "form_error_password_length": "비밀번호는 {{min}}~{{max}}자 길이여야 합니다.", "anonymizer_notification": "<0>참고: IP 익명화가 활성화되었습니다. <1>일반 설정에서 비활성화할 수 있습니다.", "confirm_dns_cache_clear": "정말로 DNS 캐시를 지우시겠습니까?", diff --git a/client/src/__locales/nl.json b/client/src/__locales/nl.json index 2ff6c752..be956f02 100644 --- a/client/src/__locales/nl.json +++ b/client/src/__locales/nl.json @@ -678,7 +678,7 @@ "use_saved_key": "De eerder opgeslagen sleutel gebruiken", "parental_control": "Ouderlijk toezicht", "safe_browsing": "Veilig browsen", - "served_from_cache": "{{value}} (geleverd vanuit cache)", + "served_from_cache_label": "Geleverd vanuit cache", "form_error_password_length": "Wachtwoord moet {{min}} tot {{max}} tekens lang zijn", "anonymizer_notification": "<0>Opmerking: IP-anonimisering is ingeschakeld. Je kunt het uitschakelen in <1>Algemene instellingen.", "confirm_dns_cache_clear": "Weet je zeker dat je de DNS-cache wilt wissen?", diff --git a/client/src/__locales/pt-br.json b/client/src/__locales/pt-br.json index caf1be0a..4fdfb6e1 100644 --- a/client/src/__locales/pt-br.json +++ b/client/src/__locales/pt-br.json @@ -678,7 +678,7 @@ "use_saved_key": "Use a chave salva anteriormente", "parental_control": "Controle parental", "safe_browsing": "Navegação segura", - "served_from_cache": "{{value}} (servido do cache)", + "served_from_cache_label": "Servido a partir do cache", "form_error_password_length": "A senha deve ter entre {{min}} e {{max}} caracteres", "anonymizer_notification": "<0>Observação: A anonimização de IP está ativada. Você pode desativá-lo em <1>Configurações gerais.", "confirm_dns_cache_clear": "Tem certeza de que deseja limpar o cache DNS?", diff --git a/client/src/__locales/pt-pt.json b/client/src/__locales/pt-pt.json index fe5d1263..0c706a3d 100644 --- a/client/src/__locales/pt-pt.json +++ b/client/src/__locales/pt-pt.json @@ -678,7 +678,7 @@ "use_saved_key": "Use a chave guardada anteriormente", "parental_control": "Controlo parental", "safe_browsing": "Navegação segura", - "served_from_cache": "{{value}} (servido do cache)", + "served_from_cache_label": "Servido a partir do cache", "form_error_password_length": "A palavra-passe deve ter {{min}} a {{max}} caracteres", "anonymizer_notification": "<0>Observação: A anonimização de IP está ativada. Você pode desativá-la em <1>Definições gerais.", "confirm_dns_cache_clear": "Tem certeza de que quer limpar a cache DNS?", diff --git a/client/src/__locales/ru.json b/client/src/__locales/ru.json index ba9dee82..ad60a38b 100644 --- a/client/src/__locales/ru.json +++ b/client/src/__locales/ru.json @@ -678,7 +678,7 @@ "use_saved_key": "Использовать сохранённый ранее ключ", "parental_control": "Родительский контроль", "safe_browsing": "Безопасный интернет", - "served_from_cache": "{{value}} (получено из кеша)", + "served_from_cache_label": "Получено из кеша", "form_error_password_length": "Пароль должен содержать от {{min}} до {{max}} символов", "anonymizer_notification": "<0>Внимание: включена анонимизация IP-адресов. Вы можете отключить её в разделе <1>Основные настройки.", "confirm_dns_cache_clear": "Вы уверены, что хотите очистить кеш DNS?", diff --git a/client/src/__locales/sk.json b/client/src/__locales/sk.json index 614ff3ec..4ba1fae6 100644 --- a/client/src/__locales/sk.json +++ b/client/src/__locales/sk.json @@ -678,7 +678,7 @@ "use_saved_key": "Použiť predtým uložený kľúč", "parental_control": "Rodičovská kontrola", "safe_browsing": "Bezpečné prehliadanie", - "served_from_cache": "{{value}} (prevzatá z cache pamäte)", + "served_from_cache_label": "Prevzaté z cache pamäte", "form_error_password_length": "Heslo musí mať od {{min}} do {{max}} znakov", "anonymizer_notification": "<0>Poznámka: Anonymizácia IP je zapnutá. Môžete ju vypnúť vo <1>Všeobecných nastaveniach.", "confirm_dns_cache_clear": "Naozaj chcete vymazať vyrovnávaciu pamäť DNS?", diff --git a/client/src/__locales/sl.json b/client/src/__locales/sl.json index 99be87c6..de1fcb9f 100644 --- a/client/src/__locales/sl.json +++ b/client/src/__locales/sl.json @@ -678,7 +678,7 @@ "use_saved_key": "Uporabi prej shranjeni ključ", "parental_control": "Starševski nadzor", "safe_browsing": "Varno brskanje", - "served_from_cache": "{{value}} (postreženo iz predpomnilnika)", + "served_from_cache_label": "Dostavljeno iz predpomnilnika", "form_error_password_length": "Geslo mora vsebovati od {{min}} do {{max}} znakov", "anonymizer_notification": "<0>Opomba: Anonimizacija IP je omogočena. Onemogočite ga lahko v <1>Splošnih nastavitvah.", "confirm_dns_cache_clear": "Ali ste prepričani, da želite počistiti predpomnilnik DNS?", diff --git a/client/src/__locales/tr.json b/client/src/__locales/tr.json index e43cb20e..c8223b36 100644 --- a/client/src/__locales/tr.json +++ b/client/src/__locales/tr.json @@ -678,7 +678,7 @@ "use_saved_key": "Önceden kaydedilmiş anahtarı kullan", "parental_control": "Ebeveyn Denetimi", "safe_browsing": "Güvenli Gezinti", - "served_from_cache": "{{value}} (önbellekten kullanıldı)", + "served_from_cache_label": "Önbellekten kullanıldı", "form_error_password_length": "Parola {{min}} ila {{max}} karakter uzunluğunda olmalıdır", "anonymizer_notification": "<0>Not: IP anonimleştirme etkinleştirildi. Bunu <1>Genel ayarlardan devre dışı bırakabilirsiniz.", "confirm_dns_cache_clear": "DNS önbelleğini temizlemek istediğinizden emin misiniz?", diff --git a/client/src/__locales/uk.json b/client/src/__locales/uk.json index 87300a2f..51a16347 100644 --- a/client/src/__locales/uk.json +++ b/client/src/__locales/uk.json @@ -678,7 +678,7 @@ "use_saved_key": "Використати раніше збережений ключ", "parental_control": "Батьківський контроль", "safe_browsing": "Безпечний перегляд", - "served_from_cache": "{{value}} (отримано з кешу)", + "served_from_cache_label": "Отримано з кешу", "form_error_password_length": "Пароль має містити від {{min}} до {{max}} символів", "anonymizer_notification": "<0>Примітка: IP-анонімізацію ввімкнено. Ви можете вимкнути його в <1>Загальні налаштування .", "confirm_dns_cache_clear": "Ви впевнені, що бажаєте очистити кеш DNS?", diff --git a/client/src/__locales/zh-cn.json b/client/src/__locales/zh-cn.json index d93d0731..bf8855c5 100644 --- a/client/src/__locales/zh-cn.json +++ b/client/src/__locales/zh-cn.json @@ -678,7 +678,7 @@ "use_saved_key": "使用之前保存的密钥", "parental_control": "家长控制", "safe_browsing": "安全浏览", - "served_from_cache": "{{value}}(由缓存提供)", + "served_from_cache_label": "从缓存中", "form_error_password_length": "密码长度必须为 {{min}} 到 {{max}} 个字符", "anonymizer_notification": "<0>注意: IP 匿名化已启用。您可以在<1>常规设置中禁用它。", "confirm_dns_cache_clear": "您确定要清除 DNS 缓存吗?", diff --git a/client/src/__locales/zh-tw.json b/client/src/__locales/zh-tw.json index 0028fed1..d34e049b 100644 --- a/client/src/__locales/zh-tw.json +++ b/client/src/__locales/zh-tw.json @@ -678,7 +678,7 @@ "use_saved_key": "使用該先前已儲存的金鑰", "parental_control": "家長控制", "safe_browsing": "安全瀏覽", - "served_from_cache": "{{value}} (由快取提供)", + "served_from_cache_label": "從快取中", "form_error_password_length": "密碼長度必須為 {{min}} 到 {{max}} 個字符", "anonymizer_notification": "<0>注意:IP 匿名化被啟用。您可在<1>一般設定中禁用它。", "confirm_dns_cache_clear": "您確定您想要清除 DNS 快取嗎?", diff --git a/go.mod b/go.mod index 1b9f67d7..a46adc4a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.8 require ( github.com/AdguardTeam/dnsproxy v0.66.0 - github.com/AdguardTeam/golibs v0.20.1 + github.com/AdguardTeam/golibs v0.20.2 github.com/AdguardTeam/urlfilter v0.18.0 github.com/NYTimes/gziphandler v1.1.1 github.com/ameshkov/dnscrypt/v2 v2.2.7 @@ -18,7 +18,7 @@ require ( github.com/google/gopacket v1.1.19 github.com/google/renameio/v2 v2.0.0 github.com/google/uuid v1.6.0 - github.com/insomniacslk/dhcp v0.0.0-20240204152450-ca2dc33955c1 + github.com/insomniacslk/dhcp v0.0.0-20240227161007-c728f5dd21c8 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 @@ -31,11 +31,11 @@ require ( github.com/quic-go/quic-go v0.41.0 github.com/stretchr/testify v1.8.4 github.com/ti-mo/netfilter v0.5.1 - go.etcd.io/bbolt v1.3.8 - golang.org/x/crypto v0.19.0 - golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 - golang.org/x/net v0.21.0 - golang.org/x/sys v0.17.0 + go.etcd.io/bbolt v1.3.9 + golang.org/x/crypto v0.21.0 + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 + golang.org/x/net v0.22.0 + golang.org/x/sys v0.18.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v3 v3.0.1 howett.net/plist v1.0.1 @@ -48,19 +48,19 @@ require ( github.com/beefsack/go-rate v0.0.0-20220214233405-116f4ca011a0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect + github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect github.com/mdlayher/socket v0.5.0 // indirect - github.com/onsi/ginkgo/v2 v2.15.0 // indirect + github.com/onsi/ginkgo/v2 v2.16.0 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/u-root/uio v0.0.0-20240207234124-abbebccef0fd // indirect + github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect go.uber.org/mock v0.4.0 // indirect - golang.org/x/mod v0.15.0 // indirect + golang.org/x/mod v0.16.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.19.0 // indirect gonum.org/v1/gonum v0.14.0 // indirect ) diff --git a/go.sum b/go.sum index 557c6cbb..78696a26 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/AdguardTeam/dnsproxy v0.66.0 h1:RyUbyDxRSXBFjVG1l2/4HV3I98DtfIgpnZkgXkgHKnc= github.com/AdguardTeam/dnsproxy v0.66.0/go.mod h1:ZThEXbMUlP1RxfwtNW30ItPAHE6OF4YFygK8qjU/cvY= -github.com/AdguardTeam/golibs v0.20.1 h1:ol8qLjWGZhU9paMMwN+OLWVTUigGsXa29iVTyd62VKY= -github.com/AdguardTeam/golibs v0.20.1/go.mod h1:bgcMgRviCKyU6mkrX+RtT/OsKPFzyppelfRsksMG3KU= +github.com/AdguardTeam/golibs v0.20.2 h1:9gThBFyuELf2ohRnUNeQGQsVBYI7YslaRLUFwVaUj8E= +github.com/AdguardTeam/golibs v0.20.2/go.mod h1:/votX6WK1PdcZ3T2kBOPjPCGmfhlKixhI6ljYrFRPvI= github.com/AdguardTeam/urlfilter v0.18.0 h1:ZZzwODC/ADpjJSODxySrrUnt/fvOCfGFaCW6j+wsGfQ= github.com/AdguardTeam/urlfilter v0.18.0/go.mod h1:IXxBwedLiZA2viyHkaFxY/8mjub0li2PXRg8a3d9Z1s= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= @@ -29,8 +29,8 @@ github.com/dimfeld/httptreemux/v5 v5.5.0 h1:p8jkiMrCuZ0CmhwYLcbNbl7DDo21fozhKHQ2 github.com/dimfeld/httptreemux/v5 v5.5.0/go.mod h1:QeEylH57C0v3VO0tkKraVz9oD3Uu93CKPnTLbsidvSw= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ping/ping v1.1.0 h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw= @@ -46,8 +46,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/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-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo= -github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/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= @@ -55,8 +55,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 h1:/jC7qQFrv8CrSJVmaolDVOxTfS9kc36uB6H40kdbQq8= github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714/go.mod h1:2Goc3h8EklBH5mspfHFxBnEoURQCGzQQH1ga9Myjvis= -github.com/insomniacslk/dhcp v0.0.0-20240204152450-ca2dc33955c1 h1:L3pm9Kf2G6gJVYawz2SrI5QnV1wzHYbqmKnSHHXJAb8= -github.com/insomniacslk/dhcp v0.0.0-20240204152450-ca2dc33955c1/go.mod h1:izxuNQZeFrbx2nK2fAyN5iNUB34Fe9j0nK4PwLzAkKw= +github.com/insomniacslk/dhcp v0.0.0-20240227161007-c728f5dd21c8 h1:V3plQrMHRWOB5zMm3yNqvBxDQVW1+/wHBSok5uPdmVs= +github.com/insomniacslk/dhcp v0.0.0-20240227161007-c728f5dd21c8/go.mod h1:izxuNQZeFrbx2nK2fAyN5iNUB34Fe9j0nK4PwLzAkKw= 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.1.1-0.20230202152459-5c7d0dd6ab86 h1:elKwZS1OcdQ0WwEDBeqxKwb7WB62QX8bvZ/FJnVXIfk= @@ -84,8 +84,8 @@ github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= +github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= @@ -121,32 +121,32 @@ github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+Kd github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= -github.com/u-root/uio v0.0.0-20240207234124-abbebccef0fd h1:BQJh5fdHsPa/YuMVrbcSxQKuowGCHYh0GD7hvLaHBK0= -github.com/u-root/uio v0.0.0-20240207234124-abbebccef0fd/go.mod h1:P3a5rG4X7tI17Nn3aOIAYr5HbIMukwXG0urG0WuL8OA= +github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 h1:pyC9PaHYZFgEKFdlp3G8RaCKgVpHZnecvArXvPXcFkM= +github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701/go.mod h1:P3a5rG4X7tI17Nn3aOIAYr5HbIMukwXG0urG0WuL8OA= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= -golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= @@ -161,8 +161,8 @@ golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.1-0.20230131160137-e7d7f63158de/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -170,8 +170,8 @@ golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= diff --git a/internal/dnsforward/dnsforward.go b/internal/dnsforward/dnsforward.go index 0380d004..5c99e0ed 100644 --- a/internal/dnsforward/dnsforward.go +++ b/internal/dnsforward/dnsforward.go @@ -518,6 +518,29 @@ func (s *Server) prepareLocalResolvers( return uc, nil } +// LocalResolversError is an error type for errors during local resolvers setup. +// This is only needed to distinguish these errors from errors returned by +// creating the proxy. +type LocalResolversError struct { + Err error +} + +// type check +var _ error = (*LocalResolversError)(nil) + +// Error implements the error interface for *LocalResolversError. +func (err *LocalResolversError) Error() (s string) { + return fmt.Sprintf("creating local resolvers: %s", err.Err) +} + +// type check +var _ errors.Wrapper = (*LocalResolversError)(nil) + +// Unwrap implements the [errors.Wrapper] interface for *LocalResolversError. +func (err *LocalResolversError) Unwrap() error { + return err.Err +} + // setupLocalResolvers initializes and sets the resolvers for local addresses. // It assumes s.serverLock is locked or s not running. It returns the upstream // configuration used for private PTR resolving, or nil if it's disabled. Note, @@ -534,13 +557,15 @@ func (s *Server) setupLocalResolvers(boot upstream.Resolver) (uc *proxy.Upstream return nil, err } - s.localResolvers, err = proxy.New(&proxy.Config{ + localResolvers, err := proxy.New(&proxy.Config{ UpstreamConfig: uc, }) if err != nil { - return nil, fmt.Errorf("creating local resolvers: %w", err) + return nil, &LocalResolversError{Err: err} } + s.localResolvers = localResolvers + // TODO(e.burkov): Should we also consider the DNS64 usage? return uc, nil } @@ -594,11 +619,13 @@ func (s *Server) Prepare(conf *ServerConfig) (err error) { return fmt.Errorf("setting up fallback dns servers: %w", err) } - s.dnsProxy, err = proxy.New(proxyConfig) + dnsProxy, err := proxy.New(proxyConfig) if err != nil { return fmt.Errorf("creating proxy: %w", err) } + s.dnsProxy = dnsProxy + s.recDetector.clear() s.setupAddrProc() @@ -831,6 +858,8 @@ func (s *Server) Reconfigure(conf *ServerConfig) error { } } + // TODO(e.burkov): It seems an error here brings the server down, which is + // not reliable enough. err = s.Prepare(conf) if err != nil { return fmt.Errorf("could not reconfigure the server: %w", err) diff --git a/internal/filtering/servicelist.go b/internal/filtering/servicelist.go index c66aa504..10b639f4 100644 --- a/internal/filtering/servicelist.go +++ b/internal/filtering/servicelist.go @@ -1698,6 +1698,14 @@ var blockedServices = []blockedService{{ Rules: []string{ "||kik.com^", }, +}, { + ID: "kook", + Name: "KOOK", + IconSVG: []byte(""), + Rules: []string{ + "||kaiheila.cn^", + "||kookapp.cn^", + }, }, { ID: "lazada", Name: "Lazada", @@ -2864,6 +2872,13 @@ var blockedServices = []blockedService{{ "||yt.be^", "||ytimg.com^", }, +}, { + ID: "yy", + Name: "YY", + IconSVG: []byte(""), + Rules: []string{ + "||yy.com^", + }, }, { ID: "zhihu", Name: "Zhihu", diff --git a/internal/home/dns.go b/internal/home/dns.go index a1f841b7..8cab8156 100644 --- a/internal/home/dns.go +++ b/internal/home/dns.go @@ -18,6 +18,7 @@ import ( "github.com/AdguardTeam/AdGuardHome/internal/filtering" "github.com/AdguardTeam/AdGuardHome/internal/querylog" "github.com/AdguardTeam/AdGuardHome/internal/stats" + "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" @@ -157,6 +158,17 @@ func initDNSServer( } err = Context.dnsServer.Prepare(dnsConf) + + // TODO(e.burkov): Recreate the server with private RDNS disabled. This + // should go away once the private RDNS resolution is moved to the proxy. + var locResErr *dnsforward.LocalResolversError + if errors.As(err, &locResErr) && errors.Is(locResErr.Err, upstream.ErrNoUpstreams) { + log.Info("WARNING: no local resolvers configured while private RDNS " + + "resolution enabled, trying to disable") + dnsConf.UsePrivateRDNS = false + err = Context.dnsServer.Prepare(dnsConf) + } + if err != nil { return fmt.Errorf("dnsServer.Prepare: %w", err) }