Skip to content

Commit

Permalink
all: fix private conf fail on start
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Mar 13, 2024
1 parent c11fc3e commit c6cce96
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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]).
Expand All @@ -41,6 +50,7 @@ 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

<!--
NOTE: Add new changes ABOVE THIS COMMENT.
Expand Down
10 changes: 8 additions & 2 deletions internal/dnsforward/dnsforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,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, &LocalResolversError{Err: err}
}

s.localResolvers = localResolvers

// TODO(e.burkov): Should we also consider the DNS64 usage?
return uc, nil
}
Expand Down Expand Up @@ -617,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()
Expand Down Expand Up @@ -854,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)
Expand Down

0 comments on commit c6cce96

Please sign in to comment.