Pull request 2404: 7801-fix-cmd-update
Closes #7801.
Squashed commit of the following:
commit f6e924e939eb9487e2c7743f04bb217e758ef253
Merge: 9caa54933 8c8323ae6
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Wed May 7 16:22:09 2025 +0300
Merge branch 'master' into 7801-fix-cmd-update
commit 9caa5493302af11b8d522feb2cf6e6f0facaec53
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Tue Apr 29 20:52:09 2025 +0300
home: imp code
commit 765ea0023972e326c54f0c17ba79f3feca8ff803
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Tue Apr 29 20:16:55 2025 +0300
all: fix cmd update
This commit is contained in:
@@ -20,10 +20,14 @@ NOTE: Add new changes BELOW THIS COMMENT.
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Command line option `--update` when the `dns.serve_plain_dns` configuration property was disabled ([7801]).
|
||||||
|
|
||||||
- DNS cache not working for custom upstream configurations.
|
- DNS cache not working for custom upstream configurations.
|
||||||
|
|
||||||
- Validation process for the DNS-over-TLS, DNS-over-QUIC, and HTTPS ports on the *Encryption Settings* page.
|
- Validation process for the DNS-over-TLS, DNS-over-QUIC, and HTTPS ports on the *Encryption Settings* page.
|
||||||
|
|
||||||
|
[#7801]: https://github.com/AdguardTeam/AdGuardHome/issues/7801
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
NOTE: Add new changes ABOVE THIS COMMENT.
|
NOTE: Add new changes ABOVE THIS COMMENT.
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -119,16 +119,15 @@ func initDNS(
|
|||||||
globalContext.dhcpServer,
|
globalContext.dhcpServer,
|
||||||
anonymizer,
|
anonymizer,
|
||||||
httpRegister,
|
httpRegister,
|
||||||
tlsMgr.config(),
|
|
||||||
tlsMgr,
|
tlsMgr,
|
||||||
baseLogger,
|
baseLogger,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// initDNSServer initializes the [context.dnsServer]. To only use the internal
|
// initDNSServer initializes the [context.dnsServer]. To only use the internal
|
||||||
// proxy, none of the arguments are required, but tlsConf, tlsMgr and l still
|
// proxy, none of the arguments are required, but tlsMgr and l still must not be
|
||||||
// must not be nil, in other cases all the arguments also must not be nil. It
|
// nil, in other cases all the arguments also must not be nil. It also must not
|
||||||
// also must not be called unless [config] and [globalContext] are initialized.
|
// be called unless [config] and [globalContext] are initialized.
|
||||||
//
|
//
|
||||||
// TODO(e.burkov): Use [dnsforward.DNSCreateParams] as a parameter.
|
// TODO(e.burkov): Use [dnsforward.DNSCreateParams] as a parameter.
|
||||||
func initDNSServer(
|
func initDNSServer(
|
||||||
@@ -138,7 +137,6 @@ func initDNSServer(
|
|||||||
dhcpSrv dnsforward.DHCP,
|
dhcpSrv dnsforward.DHCP,
|
||||||
anonymizer *aghnet.IPMut,
|
anonymizer *aghnet.IPMut,
|
||||||
httpReg aghhttp.RegisterFunc,
|
httpReg aghhttp.RegisterFunc,
|
||||||
tlsConf *tlsConfigSettings,
|
|
||||||
tlsMgr *tlsManager,
|
tlsMgr *tlsManager,
|
||||||
l *slog.Logger,
|
l *slog.Logger,
|
||||||
) (err error) {
|
) (err error) {
|
||||||
@@ -167,7 +165,7 @@ func initDNSServer(
|
|||||||
dnsConf, err := newServerConfig(
|
dnsConf, err := newServerConfig(
|
||||||
&config.DNS,
|
&config.DNS,
|
||||||
config.Clients.Sources,
|
config.Clients.Sources,
|
||||||
tlsConf,
|
tlsMgr.config(),
|
||||||
tlsMgr,
|
tlsMgr,
|
||||||
httpReg,
|
httpReg,
|
||||||
globalContext.clients.storage,
|
globalContext.clients.storage,
|
||||||
|
|||||||
@@ -1078,7 +1078,7 @@ func cmdlineUpdate(
|
|||||||
//
|
//
|
||||||
// TODO(e.burkov): We could probably initialize the internal resolver
|
// TODO(e.burkov): We could probably initialize the internal resolver
|
||||||
// separately.
|
// separately.
|
||||||
err := initDNSServer(nil, nil, nil, nil, nil, nil, &tlsConfigSettings{}, tlsMgr, l)
|
err := initDNSServer(nil, nil, nil, nil, nil, nil, tlsMgr, l)
|
||||||
fatalOnError(err)
|
fatalOnError(err)
|
||||||
|
|
||||||
l.InfoContext(ctx, "performing update via cli")
|
l.InfoContext(ctx, "performing update via cli")
|
||||||
|
|||||||
@@ -193,7 +193,10 @@ func (m *tlsManager) start(_ context.Context) {
|
|||||||
m.web.tlsConfigChanged(context.Background(), m.conf)
|
m.web.tlsConfigChanged(context.Background(), m.conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
// reload updates the configuration and restarts the TLS manager.
|
// reload updates the configuration and restarts the TLS manager. It logs any
|
||||||
|
// encountered errors.
|
||||||
|
//
|
||||||
|
// TODO(s.chzhen): Consider returning an error.
|
||||||
func (m *tlsManager) reload(ctx context.Context) {
|
func (m *tlsManager) reload(ctx context.Context) {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
|
|||||||
Reference in New Issue
Block a user