Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/host/src/tailnet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** The tailnet is the team: it says who a peer is and which machines can host channels. */
import { existsSync } from "node:fs";
import { existsSync, realpathSync } from "node:fs";
import { isIP } from "node:net";
import { homedir } from "node:os";
import { join } from "node:path";
Expand Down Expand Up @@ -27,7 +27,8 @@ export type Machine = { name: string; login: string; address: string; dns: strin

function executable(): string | undefined {
const path = Bun.which("tailscale", { PATH: process.env.PATH });
if (path) return path;
// Tailscale.app's binary crashes when run through a symlink such as /usr/local/bin/tailscale.
if (path) return realpathSync(path);
if (process.platform !== "darwin") return;
return ["/Applications", join(homedir(), "Applications")]
.map((dir) => join(dir, "Tailscale.app", "Contents", "MacOS", "Tailscale"))
Expand Down