mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-03-22 18:33:52 +03:00
all: imp code
This commit is contained in:
parent
95c7369898
commit
64bac193fc
5 changed files with 7 additions and 12 deletions
client/src
internal
|
@ -601,7 +601,7 @@
|
|||
"disable_ipv6": "Disable resolving of IPv6 addresses",
|
||||
"disable_ipv6_desc": "Drop all DNS queries for IPv6 addresses (type AAAA) and remove IPv6 hints from HTTPS responses.",
|
||||
"fastest_addr": "Fastest IP address",
|
||||
"fastest_addr_desc": "Wait for responses from all DNS servers, measure TCP connection speed for each IP address, and return the IP address with the fastest connection speed. This can significantly slow down DNS queries if any of the upstream servers is not responding, so make sure that your upstream servers are stable and your upstream timeout is low.",
|
||||
"fastest_addr_desc": "Wait for responses from <b>all</b> DNS servers, measure TCP connection speed for each IP address, and return the IP address with the fastest connection speed. This can significantly slow down DNS queries if any of the upstream servers is not responding, so make sure that your upstream servers are stable and your upstream timeout is low.",
|
||||
"autofix_warning_text": "If you click \"Fix\", AdGuard Home will configure your system to use AdGuard Home DNS server.",
|
||||
"autofix_warning_list": "It will perform these tasks: <0>Deactivate system DNSStubListener</0> <0>Set DNS server address to 127.0.0.1</0> <0>Replace symbolic link target of /etc/resolv.conf with /run/systemd/resolve/resolv.conf</0> <0>Stop DNSStubListener (reload systemd-resolved service)</0>",
|
||||
"autofix_warning_result": "As a result all DNS requests from your system will be processed by AdGuard Home by default.",
|
||||
|
|
|
@ -313,7 +313,7 @@ const Form = ({ handleSubmit, submitting, invalid, processing }: ConfigFormProps
|
|||
normalize={toNumber}
|
||||
validate={validateRequiredValue}
|
||||
min={1}
|
||||
max={100}
|
||||
max={UINT32_RANGE.MAX}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -32,7 +32,6 @@ import (
|
|||
"github.com/AdguardTeam/golibs/netutil"
|
||||
"github.com/AdguardTeam/golibs/netutil/sysresolv"
|
||||
"github.com/AdguardTeam/golibs/stringutil"
|
||||
"github.com/AdguardTeam/golibs/timeutil"
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
|
@ -331,11 +330,11 @@ func (s *Server) AddrProcConfig() (c *client.DefaultAddrProcConfig) {
|
|||
}
|
||||
|
||||
// UpstreamTimeout returns the current upstream timeout configuration.
|
||||
func (s *Server) UpstreamTimeout() (t timeutil.Duration) {
|
||||
func (s *Server) UpstreamTimeout() (t time.Duration) {
|
||||
s.serverLock.RLock()
|
||||
defer s.serverLock.RUnlock()
|
||||
|
||||
return timeutil.Duration(s.conf.UpstreamTimeout)
|
||||
return s.conf.UpstreamTimeout
|
||||
}
|
||||
|
||||
// Resolve gets IP addresses by host name from an upstream server. No
|
||||
|
|
|
@ -18,6 +18,7 @@ import (
|
|||
"github.com/AdguardTeam/golibs/log"
|
||||
"github.com/AdguardTeam/golibs/netutil"
|
||||
"github.com/AdguardTeam/golibs/stringutil"
|
||||
"github.com/AdguardTeam/golibs/validate"
|
||||
)
|
||||
|
||||
// jsonDNSConfig is the JSON representation of the DNS server configuration.
|
||||
|
@ -455,12 +456,7 @@ func (req *jsonDNSConfig) checkUpstreamTimeout() (err error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
t := *req.UpstreamTimeout
|
||||
if t <= 1 || t >= 100 {
|
||||
return fmt.Errorf("upstream_timeout: %w", errors.ErrOutOfRange)
|
||||
}
|
||||
|
||||
return nil
|
||||
return validate.NoLessThan("upstream_timeout", *req.UpstreamTimeout, 1)
|
||||
}
|
||||
|
||||
// checkInclusion returns an error if a ptr is not nil and points to value,
|
||||
|
|
|
@ -692,7 +692,7 @@ func (c *configuration) write() (err error) {
|
|||
config.Clients.Sources.RDNS = addrProcConf.UseRDNS
|
||||
config.Clients.Sources.WHOIS = addrProcConf.UseWHOIS
|
||||
dns.UsePrivateRDNS = addrProcConf.UsePrivateRDNS
|
||||
dns.UpstreamTimeout = s.UpstreamTimeout()
|
||||
dns.UpstreamTimeout = timeutil.Duration(s.UpstreamTimeout())
|
||||
}
|
||||
|
||||
if Context.dhcpServer != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue