mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
cmd/ctrld: do not change DNS for tailscale0
Let user decide which option is prefer.
This commit is contained in:
@@ -26,16 +26,10 @@ import (
|
|||||||
"github.com/Control-D-Inc/ctrld/internal/controld"
|
"github.com/Control-D-Inc/ctrld/internal/controld"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
tailscaleDevName = "tailscale0"
|
|
||||||
tailscaleDNS = "100.100.100.100"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
v = viper.NewWithOptions(viper.KeyDelimiter("::"))
|
v = viper.NewWithOptions(viper.KeyDelimiter("::"))
|
||||||
defaultConfigWritten = false
|
defaultConfigWritten = false
|
||||||
defaultConfigFile = "ctrld.toml"
|
defaultConfigFile = "ctrld.toml"
|
||||||
tailscaleIface *net.Interface
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var basicModeFlags = []string{"listen", "primary_upstream", "secondary_upstream", "domains", "log", "cache_size"}
|
var basicModeFlags = []string{"listen", "primary_upstream", "secondary_upstream", "domains", "log", "cache_size"}
|
||||||
@@ -612,9 +606,6 @@ func netIfaceFromName(ifaceName string) (*net.Interface, error) {
|
|||||||
if i.Name == ifaceName {
|
if i.Name == ifaceName {
|
||||||
iface = i.Interface
|
iface = i.Interface
|
||||||
}
|
}
|
||||||
if i.Name == tailscaleDevName {
|
|
||||||
tailscaleIface = i.Interface
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
if iface == nil {
|
if iface == nil {
|
||||||
return nil, errors.New("interface not found")
|
return nil, errors.New("interface not found")
|
||||||
|
|||||||
@@ -46,12 +46,6 @@ func (p *prog) run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Sorry, tailscale!
|
|
||||||
if tailscaleIface != nil {
|
|
||||||
if err := setDNS(tailscaleIface, []string{cfg.Listener["0"].IP}); err != nil {
|
|
||||||
mainLog.Warn().Err(err).Msg("could not set DNS for tailscale interface")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if p.cfg.Service.CacheEnable {
|
if p.cfg.Service.CacheEnable {
|
||||||
cacher, err := dnscache.NewLRUCache(p.cfg.Service.CacheSize)
|
cacher, err := dnscache.NewLRUCache(p.cfg.Service.CacheSize)
|
||||||
|
|||||||
Reference in New Issue
Block a user