Skip to content

Commit

Permalink
fix warning errs from beta2 (#2075)
Browse files Browse the repository at this point in the history
* remove default false for use usernames causing warning

Fixes #2065

Signed-off-by: Kristoffer Dalby <[email protected]>

* Ensure DoH warnings are only emitted if err

Fixes #2064

Signed-off-by: Kristoffer Dalby <[email protected]>

---------

Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby authored Aug 23, 2024
1 parent a68854a commit 9c4c286
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hscontrol/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ func LoadConfig(path string, isFile bool) error {
viper.SetDefault("dns.nameservers.split", map[string]string{})
viper.SetDefault("dns.search_domains", []string{})
viper.SetDefault("dns.extra_records", []tailcfg.DNSRecord{})
viper.SetDefault("dns.use_username_in_magic_dns", false)

viper.SetDefault("derp.server.enabled", false)
viper.SetDefault("derp.server.stun.enabled", true)
Expand Down Expand Up @@ -600,6 +599,8 @@ func (d *DNSConfig) GlobalResolvers() []*dnstype.Resolver {
resolvers = append(resolvers, &dnstype.Resolver{
Addr: nsStr,
})

continue
} else {
warn = fmt.Sprintf("Invalid global nameserver %q. Parsing error: %s ignoring", nsStr, err)
}
Expand Down Expand Up @@ -636,6 +637,8 @@ func (d *DNSConfig) SplitResolvers() map[string][]*dnstype.Resolver {
resolvers = append(resolvers, &dnstype.Resolver{
Addr: nsStr,
})

continue
} else {
warn = fmt.Sprintf("Invalid split dns nameserver %q. Parsing error: %s ignoring", nsStr, err)
}
Expand Down

0 comments on commit 9c4c286

Please sign in to comment.