Skip to content

Commit 1360d10

Browse files
committed
Experimenting with macOS MagicDNS
Signed-off-by: Percy Wegmann <percy@tailscale.com>
1 parent 2ee2add commit 1360d10

3 files changed

Lines changed: 93 additions & 45 deletions

File tree

.github/workflows/test.yml

Lines changed: 53 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,61 +16,69 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
include:
19-
# Linux tests (AMD64)
20-
- os: ubuntu-latest
21-
runner-os: Linux
19+
# # Linux tests (AMD64)
20+
# - os: ubuntu-latest
21+
# runner-os: Linux
22+
# arch: amd64
23+
# version: latest
24+
# ping: 100.99.0.2,lax-pve.pineapplefish.ts.net,lax-pve
25+
26+
# # Try unstable too
27+
# - os: ubuntu-latest
28+
# runner-os: Linux
29+
# arch: amd64
30+
# version: unstable
31+
32+
# # Try a pinned version
33+
# - os: ubuntu-latest
34+
# runner-os: Linux
35+
# arch: amd64
36+
# # leave version blank to fall back to default
37+
38+
# # Linux tests (ARM64)
39+
# - os: ubuntu-24.04-arm
40+
# runner-os: Linux
41+
# arch: arm64
42+
# version: latest
43+
44+
# # Windows tests (AMD64)
45+
# - os: windows-latest
46+
# runner-os: Windows
47+
# arch: amd64
48+
# version: latest
49+
# ping: 100.99.0.2,lax-pve.pineapplefish.ts.net,lax-pve
50+
51+
# - os: windows-latest
52+
# runner-os: Windows
53+
# arch: amd64
54+
# version: unstable
55+
56+
# # Windows tests (ARM64)
57+
# - os: windows-11-arm
58+
# runner-os: Windows
59+
# arch: arm64
60+
# version: latest
61+
62+
# macOS 13 intel
63+
- os: macos-13
64+
runner-os: macOS
2265
arch: amd64
2366
version: latest
2467
ping: 100.99.0.2,lax-pve.pineapplefish.ts.net,lax-pve
2568

26-
# Try unstable too
27-
- os: ubuntu-latest
28-
runner-os: Linux
29-
arch: amd64
30-
version: unstable
31-
32-
# Try a pinned version
33-
- os: ubuntu-latest
34-
runner-os: Linux
35-
arch: amd64
36-
# leave version blank to fall back to default
37-
38-
# Linux tests (ARM64)
39-
- os: ubuntu-24.04-arm
40-
runner-os: Linux
69+
# macOS 14 ARM
70+
- os: macos-14
71+
runner-os: macOS
4172
arch: arm64
4273
version: latest
43-
44-
# Windows tests (AMD64)
45-
- os: windows-latest
46-
runner-os: Windows
47-
arch: amd64
48-
version: latest
4974
ping: 100.99.0.2,lax-pve.pineapplefish.ts.net,lax-pve
5075

51-
- os: windows-latest
52-
runner-os: Windows
53-
arch: amd64
54-
version: unstable
55-
56-
# Windows tests (ARM64)
57-
- os: windows-11-arm
58-
runner-os: Windows
59-
arch: arm64
60-
version: latest
61-
62-
# macOS intel
63-
- os: macos-13
64-
runner-os: macOS
65-
arch: amd64
66-
version: latest
67-
ping: 100.99.0.2 # hostnames aren't resolving on MacOS, just ping IP lax-pve.pineapplefish.ts.net,lax-pve
68-
69-
# macOS ARM
70-
- os: macos-14
76+
# macOS 15 ARM
77+
- os: macos-15
7178
runner-os: macOS
7279
arch: arm64
7380
version: latest
81+
ping: 100.99.0.2,lax-pve.pineapplefish.ts.net,lax-pve
7482

7583
runs-on: ${{ matrix.os }}
7684

@@ -83,7 +91,7 @@ jobs:
8391
with:
8492
node-version: "24"
8593
cache: "npm"
86-
94+
8795
- name: Install Dependencies
8896
run: npm ci
8997

dist/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41232,6 +41232,8 @@ async function run() {
4123241232
config.arch = getTailscaleArch(runnerOS);
4123341233
// Install Tailscale
4123441234
await installTailscale(config, runnerOS);
41235+
// Set DNS server to quad 100 if necessary
41236+
await setDNSServerIfNecessary(runnerOS);
4123541237
// Start daemon (non-Windows only)
4123641238
if (runnerOS !== runnerWindows) {
4123741239
await startTailscaleDaemon(config);
@@ -41750,6 +41752,22 @@ async function installCachedBinaries(toolPath, runnerOS) {
4175041752
}
4175141753
}
4175241754
}
41755+
async function setDNSServerIfNecessary(runnerOS) {
41756+
if (runnerOS !== runnerMacOS) {
41757+
return;
41758+
}
41759+
core.info("Setting system DNS server to 100.100.100.100");
41760+
try {
41761+
await exec.exec("networksetup", [
41762+
"-setdnsservers",
41763+
"Ethernet",
41764+
"100.100.100.100",
41765+
]);
41766+
}
41767+
catch (e) {
41768+
core.warning(`Failed to set DNS server to 100.100.100.100, continuing: ${e}`);
41769+
}
41770+
}
4175341771
run();
4175441772

4175541773

src/main.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ async function run(): Promise<void> {
157157
// Install Tailscale
158158
await installTailscale(config, runnerOS);
159159

160+
// Set DNS server to quad 100 if necessary
161+
await setDNSServerIfNecessary(runnerOS);
162+
160163
// Start daemon (non-Windows only)
161164
if (runnerOS !== runnerWindows) {
162165
await startTailscaleDaemon(config);
@@ -799,4 +802,23 @@ async function installCachedBinaries(
799802
}
800803
}
801804

805+
async function setDNSServerIfNecessary(runnerOS: string): Promise<void> {
806+
if (runnerOS !== runnerMacOS) {
807+
return;
808+
}
809+
810+
core.info("Setting system DNS server to 100.100.100.100");
811+
try {
812+
await exec.exec("networksetup", [
813+
"-setdnsservers",
814+
"Ethernet",
815+
"100.100.100.100",
816+
]);
817+
} catch (e) {
818+
core.warning(
819+
`Failed to set DNS server to 100.100.100.100, continuing: ${e}`
820+
);
821+
}
822+
}
823+
802824
run();

0 commit comments

Comments
 (0)