Forráskód Böngészése

paths, cmd/tailscaled: on Windows, don't try to migrate from legacy relay.conf

Avoids confusing logspam on Windows.
Brad Fitzpatrick 5 éve
szülő
commit
f98706bdb3
2 módosított fájl, 10 hozzáadás és 4 törlés
  1. 1 1
      cmd/tailscaled/tailscaled.go
  2. 9 3
      paths/paths.go

+ 1 - 1
cmd/tailscaled/tailscaled.go

@@ -126,7 +126,7 @@ func main() {
 		Port:               41112,
 		StatePath:          *statepath,
 		AutostartStateKey:  globalStateKey,
-		LegacyConfigPath:   paths.LegacyConfigPath,
+		LegacyConfigPath:   paths.LegacyConfigPath(),
 		SurviveDisconnects: true,
 		DebugMux:           debugMux,
 	}

+ 9 - 3
paths/paths.go

@@ -11,9 +11,15 @@ import (
 	"runtime"
 )
 
-// LegacyConfigPath is the path used by the pre-tailscaled "relaynode"
-// daemon's config file.
-const LegacyConfigPath = "/var/lib/tailscale/relay.conf"
+// LegacyConfigPath returns the path used by the pre-tailscaled
+// "relaynode" daemon's config file. It returns the empty string for
+// platforms where relaynode never ran.
+func LegacyConfigPath() string {
+	if runtime.GOOS == "windows" {
+		return ""
+	}
+	return "/var/lib/tailscale/relay.conf"
+}
 
 // DefaultTailscaledSocket returns the path to the tailscaled Unix socket
 // or the empty string if there's no reasonable default.