mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
cmd/cli: fix wrong generated config for nextdns resolver
Generating nextdns config must happen after stopping current ctrld process. Otherwise, config processing may pick wrong IP+Port. While at it, also making logging better when updating listener config: - Change warn to info, prevent confusing that "something is wrong". - Do not emit info when generating working default config, which may cause duplicated messages printed.
This commit is contained in:
committed by
Cuong Manh Le
parent
4614b98e94
commit
09188bedf7
+3
-3
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
const nextdnsURL = "https://dns.nextdns.io"
|
||||
|
||||
func generateNextDNSConfig() {
|
||||
if nextdns == "" {
|
||||
func generateNextDNSConfig(uid string) {
|
||||
if uid == "" {
|
||||
return
|
||||
}
|
||||
mainLog.Load().Info().Msg("generating ctrld config for NextDNS resolver")
|
||||
@@ -23,7 +23,7 @@ func generateNextDNSConfig() {
|
||||
Upstream: map[string]*ctrld.UpstreamConfig{
|
||||
"0": {
|
||||
Type: ctrld.ResolverTypeDOH3,
|
||||
Endpoint: fmt.Sprintf("%s/%s", nextdnsURL, nextdns),
|
||||
Endpoint: fmt.Sprintf("%s/%s", nextdnsURL, uid),
|
||||
Timeout: 5000,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user