Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): open in editor works over Tailscale SSH without a local sshd #19402

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/19402/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 4 changed files with 100 additions and 22 deletions (loading 1).

x
0 of 4 viewed, 4 left
54 additions and 12 deletionsapps/server/src/environment/RemoteOpenTargets.test.tsModified
View file
@@ -5,6 +5,7 @@
import * as Layer from "effect/Layer";
import * as Sink from "effect/Sink";
import * as Stream from "effect/Stream";
+import * as ChildProcess from "effect/process/ChildProcess";
import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
import { describe, expect } from "vite-plus/test";
​
@@ -16,27 +17,34 @@
Self: { DNSName: "bb-1.tail1234.ts.net.", TailscaleIPs: ["100.64.1.2"] },
});
​
-/** Spawner whose `tailscale status --json` exits with the given output. */
-const layerSpawner = (input: { readonly exitCode: number; readonly stdout: string }) =>
+interface CommandResult {
+ readonly exitCode: number;
+ readonly stdout: string;
+}
+​
+/** Spawner answering `tailscale status --json` and `tailscale debug prefs`. */
+const layerSpawner = (input: { readonly status: CommandResult; readonly prefs: CommandResult }) =>
Layer.succeed(
ChildProcessSpawner.ChildProcessSpawner,
- ChildProcessSpawner.make(() =>
- Effect.succeed(
+ ChildProcessSpawner.make((command) => {
+ const args = ChildProcess.isStandardCommand(command) ? command.args : [];
+ const result = args[0] === "debug" ? input.prefs : input.status;
+ return Effect.succeed(