Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): link machines over their numeric Tailscale address #43338

Openjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/43338/headopened View on GitHub

Showing 5 changed files with 119 additions and 22 deletions (loading 2).

x
0 of 5 viewed, 5 left
28 additions and 0 deletionsapps/server/src/peer/PeerLinks.test.tsModified
View file
@@ -39,6 +39,7 @@
layerLinkingEnvironment,
servePeer,
type ServedPeer,
+ TAILNET_PEER_ADDRESS,
} from "./PeerLinks.testkit.ts";
import * as PeerMcpClient from "./PeerMcpClient.ts";
​
@@ -856,6 +857,33 @@
).pipe(Effect.provide(NodeHttpServer.layerTest)),
​
+it.effect("linking a machine at its numeric Tailscale address is not refused as plain http", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const b = yield* serveB(box);
+ const a = yield* makeA(laptop);
+ const failed = yield* a.links
+ .link({
+ url: `http://${TAILNET_PEER_ADDRESS}:${new URL(b.url).port}`,
+ pairingCode: "unused",
+ access: "auto",
+ expectedEnvironmentId: box.environmentId,
+ expectedLabel: "Box",
+ })
+ .pipe(Effect.flip);
+ expect(failed.message).not.toContain("plain http");
+ // It reached the peer, which refused the code.
+ expect(failed.reason).toBe("pairing_rejected");