Pull request 2720: AGDNS-4254-support-bootstrap-comments

Squashed commit of the following:

commit 91c992eb126dc2f447d60801895c35bc51634b3f
Merge: 83c721762 48b98bb5a
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date:   Mon Jul 20 14:21:06 2026 +0300

    Merge branch 'master' into AGDNS-4254-support-bootstrap-comments

commit 83c7217629
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date:   Fri Jul 17 12:34:48 2026 +0300

    all: imp ui text;

commit d15d6d19c6
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date:   Fri Jul 17 12:30:23 2026 +0300

    all: imp chlog and ui text;

commit 9e1074fabe
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date:   Thu Jul 16 18:57:24 2026 +0300

    all: imp chlog;

commit 25a864b343
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date:   Thu Jul 16 18:56:33 2026 +0300

    all: imp chlog and ui text;

commit bf6ad5108e
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date:   Thu Jul 16 17:18:55 2026 +0300

    all: upd chlog; openapi: upd openapi and api chlog; client_V2: upd ui text;

commit 13b595c36e
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date:   Thu Jul 16 12:50:53 2026 +0300

    dnsforward: add support of comments in bootstraps;
This commit is contained in:
Maksim Kazantsev 2026-07-20 11:26:41 +00:00
parent 48b98bb5a0
commit 5a3f84a2f4
7 changed files with 19 additions and 11 deletions

View file

@ -20,6 +20,8 @@ NOTE: Add new changes BELOW THIS COMMENT.
### Added
- Bootstrap servers configuration now supports comments.
- New property `"language"` in `POST /control/install/check_config` and `POST /control/install/configure` HTTP APIs.
- The user is able to remove the static lease's hostname via the HTTP API.

View file

@ -63,7 +63,7 @@
"blocking_mode_refused": "REFUSED: Respond with REFUSED code",
"blocklist": "Blocklist",
"bootstrap_dns": "Bootstrap DNS servers",
"bootstrap_dns_desc": "IP addresses of DNS servers used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams. Comments are not permitted.",
"bootstrap_dns_desc": "IP addresses of DNS servers used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams. Empty lines and comments, starting with '#', are ignored.",
"cache_cleared": "DNS cache successfully cleared",
"cache_enabled": "Enable cache",
"cache_enabled_desc": "Store DNS responses locally.",

View file

@ -329,7 +329,7 @@
"dns_blocking_mode_ttl_label": "Blocked response TTL, in seconds",
"dns_blocking_mode_ttl_placeholder": "Enter TTL",
"dns_bootstrap_dns_desc": "Sets the DNS servers used to resolve DoH/DoT upstream resolver hostnames",
"dns_bootstrap_dns_desc_2": "Enter IP addresses only. Comments are not allowed",
"dns_bootstrap_dns_desc_2": "Enter IP addresses and, optionally, comments. Comments must start with a hash (#) and be on exclusive lines",
"dns_bootstrap_dns_label": "Bootstrap DNS servers, one per line",
"dns_bootstrap_dns_placeholder": "IP addresses",
"dns_bootstrap_dns_title": "Bootstrap DNS servers",
@ -466,7 +466,7 @@
"upstream_fallback_title_faq": "Fallback DNS servers to use when upstream DNS servers are unavailable. Use the same syntax as for the upstream DNS servers",
"ip_addresses_placeholder": "Enter IP addresses, one per line",
"upstream_bootstrap_dns_title": "Bootstrap DNS servers, one per line",
"upstream_bootstrap_dns_faq": "IP addresses of DNS servers used to resolve the IP addresses of DoH/DoT upstream resolvers. Comments are not allowed",
"upstream_bootstrap_dns_faq": "IP addresses of DNS servers used to resolve the IP addresses of DoH/DoT upstream resolvers. Empty lines and comments, starting with '#', are ignored.",
"upstream_ptr": "Private reverse DNS servers, one per line",
"upstream_ptr_faq_1": "AdGuard Home uses these DNS servers for private PTR, SOA, and NS requests. Private requests come from clients with a private IP address and ask for an ARPA domain that contains a subnet from a private IP address range, such as %value%",
"upstream_ptr_faq_2": "If this field is empty, the default DNS resolvers of your OS will be used, except for the AdGuard Home IP addresses",

View file

@ -342,8 +342,8 @@ func (req *jsonDNSConfig) checkBootstrap() (err error) {
defer func() { err = errors.Annotate(err, "checking bootstrap %s: %w", b) }()
for _, b = range *req.Bootstraps {
if b == "" {
return errors.Error("empty")
if aghnet.IsCommentOrEmpty(b) {
continue
}
var resolver *upstream.UpstreamResolver
@ -730,8 +730,6 @@ func (s *Server) handleTestUpstreamDNS(w http.ResponseWriter, r *http.Request) {
return
}
req.BootstrapDNS = stringutil.FilterOut(req.BootstrapDNS, aghnet.IsCommentOrEmpty)
opts := &upstream.Options{
Logger: aghslog.NewForUpstream(s.baseLogger, aghslog.UpstreamTypeTest),
Timeout: s.conf.UpstreamTimeout,

View file

@ -29,6 +29,8 @@ func newBootstrap(
etcHosts upstream.Resolver,
opts *upstream.Options,
) (r upstream.Resolver, boots []*upstream.UpstreamResolver, err error) {
addrs = stringutil.FilterOut(addrs, aghnet.IsCommentOrEmpty)
if len(addrs) == 0 {
addrs = defaultBootstrap
}

View file

@ -4,6 +4,8 @@
## v0.107.79: API changes
- Field `bootstrap_dns` in `POST /control/dns_config` now accepts comments. A comment must start with the `#` symbol.
### Setting the UI language through the install API
- New property `"language"` in `POST /control/install/check_config` and `POST /control/install/configure` HTTP APIs defines the language to use once AdGuard Home is installed.

View file

@ -1557,7 +1557,8 @@
'type': 'array'
'description': >
Bootstrap servers, port is optional after colon. Empty value will
reset it to default values.
reset it to default values. Comments are allowed, a comment line
starts with a `#` symbol.
'items':
'type': 'string'
'example':
@ -1567,7 +1568,8 @@
'type': 'array'
'description': >
Upstream servers, port is optional after colon. Empty value will
reset it to default values.
reset it to default values. Comments are allowed, a comment line
starts with a `#` symbol.
'items':
'type': 'string'
'example':
@ -1577,7 +1579,8 @@
'type': 'array'
'description': >
List of fallback DNS servers used when upstream DNS servers are not
responding. Empty value will clear the list.
responding. Empty value will clear the list. Comments are allowed,
a comment line starts with a `#` symbol.
'items':
'type': 'string'
'example':
@ -1670,7 +1673,8 @@
'type': 'array'
'description': >
Upstream servers, port is optional after colon. Empty value will
reset it to default values.
reset it to default values. Comments are allowed, a comment line
starts with a `#` symbol.
'items':
'type': 'string'
'example':