diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fcc514df..38638980 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ 'name': 'build' 'env': - 'GO_VERSION': '1.22.3' + 'GO_VERSION': '1.22.4' 'NODE_VERSION': '16' 'on': diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2fe919d6..89d2fada 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,7 +1,7 @@ 'name': 'lint' 'env': - 'GO_VERSION': '1.22.3' + 'GO_VERSION': '1.22.4' 'on': 'push': diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ec869f..e5c394e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,11 +14,11 @@ and this project adheres to @@ -29,6 +29,28 @@ NOTE: Add new changes ABOVE THIS COMMENT. +## [v0.107.51] - 2024-06-05 + +See also the [v0.107.51 GitHub milestone][ms-v0.107.51]. + +### Security + +- Go version has been updated to prevent the possibility of exploiting the Go + vulnerabilities fixed in [Go 1.22.4][go-1.22.4]. + +### Changed + +- The HTTP server's write timeout has been increased from 1 minute to 5 minutes + to match the one used by AdGuard Home's HTTP client to fetch filtering-list + data ([#7041]). + +[#7041]: https://github.com/AdguardTeam/AdGuardHome/issues/7041 + +[go-1.22.4]: https://groups.google.com/g/golang-announce/c/XbxouI9gY7k/ +[ms-v0.107.51]: https://github.com/AdguardTeam/AdGuardHome/milestone/86?closed=1 + + + ## [v0.107.50] - 2024-05-23 See also the [v0.107.50 GitHub milestone][ms-v0.107.50]. @@ -2986,11 +3008,12 @@ See also the [v0.104.2 GitHub milestone][ms-v0.104.2]. -[Unreleased]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.50...HEAD +[Unreleased]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.51...HEAD +[v0.107.51]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.50...v0.107.51 [v0.107.50]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.49...v0.107.50 [v0.107.49]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.48...v0.107.49 [v0.107.48]: https://github.com/AdguardTeam/AdGuardHome/compare/v0.107.47...v0.107.48 diff --git a/Makefile b/Makefile index 66c387ea..a9250b26 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ DIST_DIR = dist GOAMD64 = v1 GOPROXY = https://goproxy.cn|https://proxy.golang.org|direct GOSUMDB = sum.golang.google.cn -GOTOOLCHAIN = go1.22.3 +GOTOOLCHAIN = go1.22.4 GPG_KEY = devteam@adguard.com GPG_KEY_PASSPHRASE = not-a-real-password NPM = npm diff --git a/bamboo-specs/release.yaml b/bamboo-specs/release.yaml index f6313c0a..174b5312 100644 --- a/bamboo-specs/release.yaml +++ b/bamboo-specs/release.yaml @@ -8,7 +8,7 @@ 'variables': 'channel': 'edge' 'dockerFrontend': 'adguard/home-js-builder:1.1' - 'dockerGo': 'adguard/go-builder:1.22.3--1' + 'dockerGo': '${bamboo.adguardRegistryBasePath}/go-builder:1.22.4--1' 'stages': - 'Build frontend': @@ -266,7 +266,7 @@ 'variables': 'channel': 'beta' 'dockerFrontend': 'adguard/home-js-builder:1.1' - 'dockerGo': 'adguard/go-builder:1.22.3--1' + 'dockerGo': '${bamboo.adguardRegistryBasePath}/go-builder:1.22.4--1' # release-vX.Y.Z branches are the branches from which the actual final # release is built. - '^release-v[0-9]+\.[0-9]+\.[0-9]+': @@ -282,4 +282,4 @@ 'variables': 'channel': 'release' 'dockerFrontend': 'adguard/home-js-builder:1.1' - 'dockerGo': 'adguard/go-builder:1.22.3--1' + 'dockerGo': '${bamboo.adguardRegistryBasePath}/go-builder:1.22.4--1' diff --git a/bamboo-specs/test.yaml b/bamboo-specs/test.yaml index b58fdcd6..fd3a1c4b 100644 --- a/bamboo-specs/test.yaml +++ b/bamboo-specs/test.yaml @@ -6,7 +6,7 @@ 'name': 'AdGuard Home - Build and run tests' 'variables': 'dockerFrontend': 'adguard/home-js-builder:1.1' - 'dockerGo': 'adguard/go-builder:1.22.3--1' + 'dockerGo': '${bamboo.adguardRegistryBasePath}/go-builder:1.22.4--1' 'channel': 'development' 'stages': @@ -195,5 +195,5 @@ # may need to build a few of these. 'variables': 'dockerFrontend': 'adguard/home-js-builder:1.1' - 'dockerGo': 'adguard/go-builder:1.22.3--1' + 'dockerGo': '${bamboo.adguardRegistryBasePath}/go-builder:1.22.4--1' 'channel': 'candidate' diff --git a/client/src/__locales/fi.json b/client/src/__locales/fi.json index 753104f4..fdf21417 100644 --- a/client/src/__locales/fi.json +++ b/client/src/__locales/fi.json @@ -13,14 +13,14 @@ "fallback_dns_desc": "Listaus DNS-varapalvelimista, joita käytetään kun lähtevät DNS-palvelimet eivät vastaa. Syntaksi on sama kuin yllä olevassa pääylävirrat-kentässä.", "fallback_dns_placeholder": "Syötä yksi DNS-varapalvelin per rivi", "local_ptr_title": "Yksityiset käänteis-DNS-palvelimet", - "local_ptr_desc": "DNS-palvelimet, joita AdGuard Home käyttää paikallisille PTR-pyynnöille. Näitä palvelimia käytetään yksityistä IP-osoitetta käyttävien PTR-pyyntöjen osoitteiden, kuten \"192.168.12.34\", selvitykseen käänteis-DNS:n avulla. Jos ei käytössä, AdGuard Home käyttää käyttöjärjestelmän oletusarvoisia DNS-resolvereita, poislukien AdGuard Homen omat osoitteet.", + "local_ptr_desc": "AdGuard Homen yksityisille PTR-, SOA- ja NS-pyynnöille käyttämät DNS-palvelimet. Pyyntöä luokitellaan yksityiseksi, jos se pyytää yksityistä IP-aluetta (kuten \"192.168.12.34\") käyttävän aliverkon sisältävää ARPA-verkkotunnusta ja on lähtöisin päätteeltä, jolla on yksityinen IP-osoite. Jos tätä ei ole määritetty, käytetään käyttöjärjestelmän oletusarvoisia DNS-resolvereita (AdGuard Homen IP-osoitteet pois lukien).", "local_ptr_default_resolver": "Oletusarvoisesti AdGuard Home käyttää seuraavia käänteis-DNS-resolvereita: {{ip}}.", "local_ptr_no_default_resolver": "AdGuard Home ei voinut määrittää tälle järjestelmälle sopivaa yksityistä käänteis-DNS-resolveria.", "local_ptr_placeholder": "Syötä yksi IP-osoite per rivi", "resolve_clients_title": "Käytä päätelaitteiden IP-osoitteille käänteistä selvitystä", "resolve_clients_desc": "Selvitä päätelaitteiden IP-osoitteiden isäntänimet käänteisesti lähettämällä PTR-pyynnöt sopiville resolvereille (yksityiset DNS-palvelimet paikallisille päätelaitteille, ylävirtapalvelimet päätelaitteille, joilla on julkiset IP-osoitteet).", "use_private_ptr_resolvers_title": "Käytä yksityisiä käänteis-DNS-resolvereita", - "use_private_ptr_resolvers_desc": "Suorita käänteis-DNS-selvitykset paikallisesti tarjotuille osoitteille käyttäen näitä ylävirtapalvelimia. Jos ei käytössä, vastaa AdGuard Home kaikkiin sen tyyppisiin PTR-pyyntöihin NXDOMAIN-arvolla, pois lukien DHCP, /etc/hosts, yms. -tiedoista tunnistettut päätelaitteet.", + "use_private_ptr_resolvers_desc": "Selvitä yksityisiä IP-osoitteita sisältävien ARPA-verkkotunnusten PTR-, SOA- ja NS-pyynnöt käyttäen yksityisiä ylävirtapalvelimia, DHCP:tä, /etc/hosts-määrityksiä, yms. Jos tämä ei ole käytössä, AdGuard Home vastaa tällaisiin pyyntöihin NXDOMAIN-tiedolla.", "check_dhcp_servers": "Etsi DHCP-palvelimia", "save_config": "Tallenna asetukset", "enabled_dhcp": "DHCP-palvelin otettiin käyttöön", @@ -326,7 +326,7 @@ "blocking_ipv6_desc": "Estettyyn AAAA-pyyntöön palautettava IP-osoite", "blocking_mode_default": "Oletus: Vastaa IP-nollaosoitteella (0.0.0.0 korvaa A; :: korvaa AAAA) kun estetään mainoseston säännöllä; vastaa säännön määrittämällä IP-osoitteella kun estetään /etc/hosts-tyyppisellä säännöllä", "blocking_mode_refused": "REFUSED: Vastaa REFUSED-koodilla", - "blocking_mode_nxdomain": "NXDOMAIN: Vastaa NXDOMAIN-koodilla", + "blocking_mode_nxdomain": "NXDOMAIN: Vastaa NXDOMAIN-tiedolla", "blocking_mode_null_ip": "Tyhjä IP: Vastaa IP-nollaosoitteella (0.0.0.0 korvaa A; :: korvaa AAAA)", "blocking_mode_custom_ip": "Mukautettu IP: Vastaa manuaalisesti määritetyllä IP-osoitteella", "theme_auto": "Automaattinen", @@ -501,8 +501,8 @@ "setup_dns_privacy_ios_1": "<0>DNSCloak tukee <1>DNS-over-HTTPS, mutta oman palvelimen käyttö' varten sille on luotava <2>DNS Stamp -merkintä.", "setup_dns_privacy_ios_2": "<0>AdGuard iOS:lle tukee <1>DNS-over-HTTPS ja <1>DNS-over-TLS -toteutuksia.", "setup_dns_privacy_other_title": "Muita toteutuksia", - "setup_dns_privacy_other_1": "AdGuard Home voi itse olla turvallinen DNS-päätelaite millä tahansa alustalla.", - "setup_dns_privacy_other_2": "<0>dnsproxy tukee kaikkia tunnettuja turvallisia DNS-protokollia.", + "setup_dns_privacy_other_1": "AdGuard Home voi itse olla suojattu DNS -pääte millä tahansa alustalla.", + "setup_dns_privacy_other_2": "<0>dnsproxy tukee kaikkia tunnettuja suojattuja DNS-protokollia.", "setup_dns_privacy_other_3": "<0>dnscrypt-proxy tukee <1>DNS-over-HTTPS -protokollaa.", "setup_dns_privacy_other_4": "<0>Mozilla Firefox tukee <1>DNS-over-HTTPS-toteutusta.", "setup_dns_privacy_other_5": "Löydät lisää toteutuksia <0>täältä ja <1>täältä.", diff --git a/client/src/__locales/ja.json b/client/src/__locales/ja.json index e9aca0a3..2772eaf7 100644 --- a/client/src/__locales/ja.json +++ b/client/src/__locales/ja.json @@ -13,14 +13,14 @@ "fallback_dns_desc": "アップストリームDNSサーバーが応答しない場合に使用されるフォールバックDNSサーバーのリストです。構文は上記のmain upstreamsフィールドと同じです。", "fallback_dns_placeholder": "フォールバックDNSサーバーを1行に1つずつ入力してください。", "local_ptr_title": "プライベートリバースDNSサーバー", - "local_ptr_desc": "AdGuard HomeがローカルPTRクエリに使用するDNSサーバーです。これらのサーバーは、rDNSを使ってプライベートIPアドレス(例えば\"192.168.12.34\")を持つクライアントのホスト名を解決するために使用されます。設定されていない場合、AdGuard HomeはOSのデフォルトDNSリゾルバーのアドレス(AdGuard Home自体のアドレスを除く)を自動的に使用します。", + "local_ptr_desc": "AdGuard Home がプライベート PTR、SOA、および NS リクエストに使用する DNS サーバー。プライベート IP 範囲内のサブネット (「192.168.12.34」など) を含む ARPA ドメインを要求し、プライベート IP アドレスを持つクライアントから来たリクエストが、プライベートリクエストとみなされます。本設定が特に指定されていない場合、OS のデフォルト DNS リゾルバ(AdGuard Home の IP アドレスを除く)が使用されます。", "local_ptr_default_resolver": "デフォルトでは、AdGuard Homeは次のリバースDNSリゾルバを使用します: {{ip}}", "local_ptr_no_default_resolver": "AdGuard Homeは、このシステムに適したプライベートリバースDNSリゾルバを特定できませんでした。", "local_ptr_placeholder": "IPアドレスを1行に1つずづ入力してください。", "resolve_clients_title": "クライアントのIPアドレスの逆解決を有効にする", "resolve_clients_desc": "対応するリゾルバー(ローカルクライアントの場合はプライベートDNSサーバ、パブリックIPを持つクライアントの場合はアップストリームサーバー)にPTRクエリを送信することにより、クライアントのIPアドレスをホストネームに逆解決します。", "use_private_ptr_resolvers_title": "プライベートリバースDNSリゾルバを使用", - "use_private_ptr_resolvers_desc": "これらのアップストリームサーバーを使用して、ローカルで提供されるアドレスのリバースDNSルックアップを実行します。無効にすると、AdGuard Homeは、DHCP, /etc/hosts などから認識されるクライアントを除き、すべてのこのようなPTR要求にNXDOMAINで応答します。", + "use_private_ptr_resolvers_desc": "プライベートアップストリームサーバー、DHCP、/etc/hosts などを通じて、プライベート IP アドレスを含む ARPA ドメインの PTR、SOA、および NS リクエストを解決します。無効にした場合、AdGuard Home はこのようなリクエストのすべてに NXDOMAIN で応答します。", "check_dhcp_servers": "DHCPサーバをチェックする", "save_config": "構成を保存する", "enabled_dhcp": "DHCPサーバを有効にしました", diff --git a/client/src/__locales/sv.json b/client/src/__locales/sv.json index 8d5dbb5d..3a094022 100644 --- a/client/src/__locales/sv.json +++ b/client/src/__locales/sv.json @@ -9,7 +9,7 @@ "load_balancing_desc": "Fråga en uppströmsserver åt gången. AdGuard Home använder sin viktade slumpmässiga algoritm för att välja server så att den snabbaste servern används oftare.", "bootstrap_dns": "Bootstrap-DNS-servrar", "bootstrap_dns_desc": "IP-adresser för DNS-servrar som används för att lösa IP-adresser för de DoH/DoT-resolvers som du anger som uppströms. Kommentarer är inte tillåtna.", - "fallback_dns_title": "Reserv-DNS-servrar", + "fallback_dns_title": "Reserv DNS-servrar", "fallback_dns_desc": "Lista över reserv-DNS-servrar som används när uppströms DNS-servrar inte svarar. Syntaxen är densamma som i huvuduppströmsfältet ovan.", "fallback_dns_placeholder": "Ange en reserv-DNS-server per rad", "local_ptr_title": "Privata omvända DNS-servrar", @@ -141,8 +141,8 @@ "number_of_dns_query_blocked_24_hours": "Antalet DNS-förfrågningar som blockerades av annonsfilter och värdens blockeringsklistor", "number_of_dns_query_blocked_24_hours_by_sec": "Antalet DNS-förfrågningar som blockerades av AdGuards modul för surfsäkerhet", "number_of_dns_query_blocked_24_hours_adult": "Antalet vuxensajter som blockerats", - "enforced_save_search": "Aktivering av Säker surf", - "number_of_dns_query_to_safe_search": "Antalet DNS-förfrågningar mot sökmotorer där Säker surf tvingats", + "enforced_save_search": "Genomdrev SafeSearch", + "number_of_dns_query_to_safe_search": "Antalet DNS-förfrågningar till sökmotorer för vilka SafeSearch genomdrevs", "average_processing_time": "Genomsnittlig processtid", "average_upstream_response_time": "Genomsnittlig svarstid uppströmsserver", "response_time": "Svarstid", @@ -153,7 +153,7 @@ "use_adguard_browsing_sec_hint": "AdGuard Home kommer att kontrollera om en domän är blockerad av webbservicen surfsäkerhet. Med en integritetsvänlig metod görs en API-lookup för att kontrollera: endast ett kort prefix i domännamnet SHA256 hash skickas till servern.", "use_adguard_parental": "Använda AdGuards webbservice för föräldrakontroll", "use_adguard_parental_hint": "AdGuard Home kommer att kontrollera domäner för innehåll av vuxenmaterial . Samma integritetsvänliga metod för API-lookup som tillämpas i webbservicens surfsäkerhet används.", - "enforce_safe_search": "Använd säker webbsökning", + "enforce_safe_search": "Använd SafeSearch", "enforce_save_search_hint": "AdGuard Home kommer tvinga säker surf på följande sökmotorer: Google, Youtube, Bing, DuckDuckGo, Yandex, Pixabay.", "no_servers_specified": "Inga servrar angivna", "general_settings": "Allmänna inställningar", @@ -657,7 +657,7 @@ "cache_optimistic": "Optimistisk cachning", "cache_optimistic_desc": "Få AdGuard Home att svara från cachen även när posterna har gått ut och försök även uppdatera dem.", "filter_category_general": "Allmänt", - "filter_category_security": "säkerhet", + "filter_category_security": "Säkerhet", "filter_category_regional": "Regional", "filter_category_other": "Övrigt", "filter_category_general_desc": "Listor som blockerar spårning och reklam på de flesta enheterna", diff --git a/client/src/helpers/trackers/trackers.json b/client/src/helpers/trackers/trackers.json index 25a899ad..8b4ca547 100644 --- a/client/src/helpers/trackers/trackers.json +++ b/client/src/helpers/trackers/trackers.json @@ -1,5 +1,5 @@ { - "timeUpdated": "2024-03-01T00:10:14.031Z", + "timeUpdated": "2024-05-27T12:08:27.431Z", "categories": { "0": "audio_video_player", "1": "comments", @@ -12869,6 +12869,13 @@ "url": "http://opensharecount.com/", "companyId": "open_share_count" }, + "openai": { + "name": "OpenAI", + "categoryId": 8, + "url": "https://openai.com/", + "companyId": "openai", + "source": "AdGuard" + }, "openload": { "name": "Openload", "categoryId": 9, @@ -23473,6 +23480,10 @@ "realmedia.com": "open_adstream", "realmediadigital.com": "open_adstream", "opensharecount.com": "open_share_count", + "chatgpt.com": "openai", + "oaistatic.com": "openai", + "oaiusercontent.com": "openai", + "openai.com": "openai", "oloadcdn.net": "openload", "openload.co": "openload", "openstat.net": "openstat", @@ -24356,6 +24367,10 @@ "spoteffects.net": "spoteffect", "scdn.co": "spotify", "spotify.com": "spotify", + "pscdn.co": "spotify", + "spotifycdn.com": "spotify", + "spotifycdn.net": "spotify", + "spotilocal.com": "spotify", "embed.spotify.com": "spotify_embed", "spotscenered.info": "spotscenered.info", "spotx.tv": "spotxchange", @@ -24675,6 +24690,8 @@ "t.co": "twitter", "twimg.com": "twitter", "twitter.com": "twitter", + "twttr.com": "twitter", + "x.com": "twitter", "ads-twitter.com": "twitter_ads", "analytics.twitter.com": "twitter_analytics", "tellapart.com": "twitter_for_business", diff --git a/go.mod b/go.mod index 9f4fa550..dcfb3284 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/AdguardTeam/AdGuardHome -go 1.22.3 +go 1.22.4 require ( - github.com/AdguardTeam/dnsproxy v0.71.1 + github.com/AdguardTeam/dnsproxy v0.71.2 github.com/AdguardTeam/golibs v0.23.2 github.com/AdguardTeam/urlfilter v0.18.0 github.com/NYTimes/gziphandler v1.1.1 @@ -28,7 +28,7 @@ require ( // own code for that. Perhaps, use gopacket. github.com/mdlayher/raw v0.1.0 github.com/miekg/dns v1.1.59 - github.com/quic-go/quic-go v0.43.1 + github.com/quic-go/quic-go v0.44.0 github.com/stretchr/testify v1.9.0 github.com/ti-mo/netfilter v0.5.2 go.etcd.io/bbolt v1.3.10 diff --git a/go.sum b/go.sum index ba6092b7..332ddd62 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/AdguardTeam/dnsproxy v0.71.1 h1:R8jKmoE9HwqdTt7bm8irpvrQEOSmD+iGdNXbOg/uM8Y= -github.com/AdguardTeam/dnsproxy v0.71.1/go.mod h1:rCaCL4m4n63sgwTOyUVdc7MC42PlUYBt11Fz/UjD+kM= +github.com/AdguardTeam/dnsproxy v0.71.2 h1:dFG2wga4GDdj1eI3rU2wqjQ6QGQm9MjLRb5ZzyH3Vgg= +github.com/AdguardTeam/dnsproxy v0.71.2/go.mod h1:huI5zyWhlimHBhg0jt2CMinXzsEHymI+WlvxIfmfEGA= github.com/AdguardTeam/golibs v0.23.2 h1:rMjYantwtQ39e8G4zBQ6ZLlm4s3XH30Bc9VxhoOHwao= github.com/AdguardTeam/golibs v0.23.2/go.mod h1:o9i55Sx6v7qogRQeqaBfmLbC/pZqeMBWi015U5PTDY0= github.com/AdguardTeam/urlfilter v0.18.0 h1:ZZzwODC/ADpjJSODxySrrUnt/fvOCfGFaCW6j+wsGfQ= @@ -99,8 +99,8 @@ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.43.1 h1:fLiMNfQVe9q2JvSsiXo4fXOEguXHGGl9+6gLp4RPeZQ= -github.com/quic-go/quic-go v0.43.1/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= +github.com/quic-go/quic-go v0.44.0 h1:So5wOr7jyO4vzL2sd8/pD9Kesciv91zSk8BoFngItQ0= +github.com/quic-go/quic-go v0.44.0/go.mod h1:z4cx/9Ny9UtGITIPzmPTXh1ULfOyWh4qGQlpnPcWmek= github.com/shirou/gopsutil/v3 v3.23.7 h1:C+fHO8hfIppoJ1WdsVm1RoI0RwXoNdfTK7yWXV0wVj4= github.com/shirou/gopsutil/v3 v3.23.7/go.mod h1:c4gnmoRC0hQuaLqvxnx1//VXQ0Ms/X9UnJF8pddY5z4= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= diff --git a/internal/dnsforward/dnsforward.go b/internal/dnsforward/dnsforward.go index fda29f0a..ac8807ab 100644 --- a/internal/dnsforward/dnsforward.go +++ b/internal/dnsforward/dnsforward.go @@ -734,19 +734,21 @@ func (s *Server) Stop() error { s.serverLock.Lock() defer s.serverLock.Unlock() - return s.stopLocked() + s.stopLocked() + + return nil } // stopLocked stops the DNS server without locking. s.serverLock is expected to // be locked. -func (s *Server) stopLocked() (err error) { +func (s *Server) stopLocked() { // TODO(e.burkov, a.garipov): Return critical errors, not just log them. // This will require filtering all the non-critical errors in // [upstream.Upstream] implementations. if s.dnsProxy != nil { // TODO(e.burkov): Use context properly. - err = s.dnsProxy.Shutdown(context.Background()) + err := s.dnsProxy.Shutdown(context.Background()) if err != nil { log.Error("dnsforward: closing primary resolvers: %s", err) } @@ -757,8 +759,6 @@ func (s *Server) stopLocked() (err error) { } s.isRunning = false - - return nil } // logCloserErr logs the error returned by c, if any. @@ -804,10 +804,7 @@ func (s *Server) Reconfigure(conf *ServerConfig) error { log.Info("dnsforward: starting reconfiguring server") defer log.Info("dnsforward: finished reconfiguring server") - err := s.stopLocked() - if err != nil { - return fmt.Errorf("could not reconfigure the server: %w", err) - } + s.stopLocked() // It seems that net.Listener.Close() doesn't close file descriptors right away. // We wait for some time and hope that this fd will be closed. @@ -825,7 +822,7 @@ 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) + err := s.Prepare(conf) if err != nil { return fmt.Errorf("could not reconfigure the server: %w", err) } diff --git a/internal/home/httpclient.go b/internal/home/httpclient.go index ae41d6ac..cfcb1bc6 100644 --- a/internal/home/httpclient.go +++ b/internal/home/httpclient.go @@ -6,7 +6,6 @@ import ( "net" "net/http" "net/url" - "time" ) // httpClient returns a new HTTP client that uses the AdGuard Home's own DNS @@ -23,7 +22,7 @@ func httpClient() (c *http.Client) { return &http.Client{ // TODO(a.garipov): Make configurable. - Timeout: time.Minute * 5, + Timeout: writeTimeout, Transport: &http.Transport{ DialContext: dialContext, Proxy: httpProxy, diff --git a/internal/home/web.go b/internal/home/web.go index da327c70..f1997b05 100644 --- a/internal/home/web.go +++ b/internal/home/web.go @@ -23,6 +23,7 @@ import ( "golang.org/x/net/http2/h2c" ) +// TODO(a.garipov): Make configurable. const ( // readTimeout is the maximum duration for reading the entire request, // including the body. @@ -31,7 +32,7 @@ const ( readHdrTimeout = 60 * time.Second // writeTimeout is the maximum duration before timing out writes of the // response. - writeTimeout = 60 * time.Second + writeTimeout = 5 * time.Minute ) type webConfig struct { diff --git a/internal/tools/go.mod b/internal/tools/go.mod index c3eb0aae..bfc03be2 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -1,6 +1,6 @@ module github.com/AdguardTeam/AdGuardHome/internal/tools -go 1.22.3 +go 1.22.4 require ( github.com/fzipp/gocyclo v0.6.0 @@ -10,15 +10,15 @@ require ( github.com/kyoh86/looppointer v0.2.1 github.com/securego/gosec/v2 v2.20.0 github.com/uudashr/gocognit v1.1.2 - golang.org/x/tools v0.21.0 - golang.org/x/vuln v1.1.0 + golang.org/x/tools v0.22.0 + golang.org/x/vuln v1.1.1 honnef.co/go/tools v0.4.7 mvdan.cc/gofumpt v0.6.0 - mvdan.cc/unparam v0.0.0-20240427195214-063aff900ca1 + mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f ) require ( - github.com/BurntSushi/toml v1.3.2 // indirect + github.com/BurntSushi/toml v1.4.0 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect @@ -26,9 +26,9 @@ require ( github.com/kyoh86/nolint v0.0.1 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect - golang.org/x/exp/typeparams v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/mod v0.17.0 // indirect + golang.org/x/exp/typeparams v0.0.0-20240604190554-fc45aab8b7f8 // indirect + golang.org/x/mod v0.18.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.21.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 550825ff..9c9e9388 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -1,5 +1,5 @@ -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -63,21 +63,21 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp/typeparams v0.0.0-20240506185415-9bf2ced13842 h1:S62OJe0/hUkTgveY1HXZMHWBOy21DVrobMYz2cMCO64= -golang.org/x/exp/typeparams v0.0.0-20240506185415-9bf2ced13842/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20240604190554-fc45aab8b7f8 h1:WKP3FgLqWfVutBnw/dr+LNg4fzjyTQP5o+ELTIyoBrs= +golang.org/x/exp/typeparams v0.0.0-20240604190554-fc45aab8b7f8/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -93,8 +93,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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= @@ -107,10 +107,10 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20201007032633-0806396f153e/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/vuln v1.1.0 h1:ECEdI+aEtjpF90eqEcDL5Q11DWSZAw5PJQWlp0+gWqc= -golang.org/x/vuln v1.1.0/go.mod h1:HT/Ar8fE34tbxWG2s7PYjVl+iIE4Er36/940Z+K540Y= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/vuln v1.1.1 h1:4nYQg4OSr7uYQMtjuuYqLAEVuTjY4k/CPMYqvv5OPcI= +golang.org/x/vuln v1.1.1/go.mod h1:hNgE+SKMSp2wHVUpW0Ow2ejgKpNJePdML+4YjxrVxik= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -122,5 +122,5 @@ honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs= honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA= -mvdan.cc/unparam v0.0.0-20240427195214-063aff900ca1 h1:Nykk7fggxChwLK4rUPYESzeIwqsuxXXlFEAh5YhaMRo= -mvdan.cc/unparam v0.0.0-20240427195214-063aff900ca1/go.mod h1:ZzZjEpJDOmx8TdVU6umamY3Xy0UAQUI2DHbf05USVbI= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ=