Avoid tailscale.com/tsd dependency

Since it brings gvisor.dev/gvisor to the dependency graph, causing the
binary size bloating on *nix (except darwin).
This commit is contained in:
Cuong Manh Le
2024-11-01 17:13:59 +07:00
committed by Cuong Manh Le
parent 5b9ccc5065
commit 84e06c363c
6 changed files with 15 additions and 105 deletions
+3 -3
View File
@@ -7,16 +7,16 @@ import (
"os"
"os/exec"
"strings"
"tailscale.com/tsd"
"github.com/kardianos/service"
"tailscale.com/control/controlknobs"
"tailscale.com/health"
"github.com/Control-D-Inc/ctrld/internal/dns"
)
func init() {
sys := new(tsd.System)
if r, err := dns.NewOSConfigurator(func(format string, args ...any) {}, sys.HealthTracker(), sys.ControlKnobs(), "lo"); err == nil {
if r, err := dns.NewOSConfigurator(func(format string, args ...any) {}, &health.Tracker{}, &controlknobs.Knobs{}, "lo"); err == nil {
useSystemdResolved = r.Mode() == "systemd-resolved"
}
// Disable quic-go's ECN support by default, see https://github.com/quic-go/quic-go/issues/3911