Skip to content

Commit c998353

Browse files
authored
fix: avoid interference with Tailscale on Windows (#69)
* fix: do not touch hosts file on windows * fix: avoid conflict with Tailscale DNS in registry * fix: use hosts file with different section
1 parent 8086c87 commit c998353

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

net/dns/manager_windows.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ func setTailscaleHosts(prevHostsFile []byte, hosts []*HostEntry) ([]byte, error)
110110
b := bytes.ReplaceAll(prevHostsFile, []byte("\r\n"), []byte("\n"))
111111
sc := bufio.NewScanner(bytes.NewReader(b))
112112
const (
113-
header = "# TailscaleHostsSectionStart"
114-
footer = "# TailscaleHostsSectionEnd"
113+
header = "# CoderHostsSectionStart"
114+
footer = "# CoderHostsSectionEnd"
115115
)
116116
var comments = []string{
117-
"# This section contains MagicDNS entries for Tailscale.",
117+
"# This section contains DNS entries for Coder workspaces.",
118118
"# Do not edit this section manually.",
119119
}
120120
var out bytes.Buffer

net/dns/nrpt_windows.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const (
2929
// This is the legacy rule ID that previous versions used when we supported
3030
// only a single rule. Now that we support multiple rules are required, we
3131
// generate their GUIDs and store them under the Tailscale registry key.
32-
nrptSingleRuleID = `{5abe529b-675b-4486-8459-25a634dacc23}`
32+
//
33+
// Coder: this value was changed to avoid messing with Tailscale.
34+
nrptSingleRuleID = `{09040707-2be9-491d-9d7b-62a454e774d2}`
3335

3436
// This is the name of the registry value we use to save Rule IDs under
3537
// the Tailscale registry key.

util/winutil/winutil_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
)
2121

2222
const (
23-
regBase = `SOFTWARE\Tailscale IPN`
24-
regPolicyBase = `SOFTWARE\Policies\Tailscale`
23+
regBase = `SOFTWARE\Coder VPN`
24+
regPolicyBase = `SOFTWARE\Policies\Coder`
2525
)
2626

2727
// ErrNoShell is returned when the shell process is not found.

0 commit comments

Comments
 (0)