History

feat(connect): keep macOS hosts reachable after reboot

Theo Browne committed 3 months ago

Commit ec3c5f61 parent 90f391312 files · +690 −91Browse files

Showing the changes to packages (2 of 12 files). Show all

Unified · Split

2 files
  1. packages/contracts/src/environment.ts +2 −2
  2. packages/shared/src/hostProcess.ts +7 −0
packages/contracts/src/environment.ts+2−2
@@ -21,8 +21,8 @@ export const ExecutionEnvironmentPlatform = Schema.Struct({ · 20 unmodified lines
21export type ExecutionEnvironmentPlatform = typeof ExecutionEnvironmentPlatform.Type;21export type ExecutionEnvironmentPlatform = typeof ExecutionEnvironmentPlatform.Type;
22 22
23/** How a server can replace itself with another version when asked over RPC:23/** How a server can replace itself with another version when asked over RPC:
24 "boot-service" rewrites the systemd user unit and restarts it; "respawn"24 "boot-service" hands off through its systemd unit or macOS LaunchAgent;
25 installs the target version and respawns the foreground process. */25 "respawn" installs the target version and replaces the foreground process. */
26export const ServerSelfUpdateMethod = Schema.Literals(["boot-service", "respawn"]);26export const ServerSelfUpdateMethod = Schema.Literals(["boot-service", "respawn"]);
27export type ServerSelfUpdateMethod = typeof ServerSelfUpdateMethod.Type;27export type ServerSelfUpdateMethod = typeof ServerSelfUpdateMethod.Type;
28 28
packages/shared/src/hostProcess.ts+7−0
@@ -51,4 +51,11 @@ export const HostProcessArguments = Context.Reference<ReadonlyArray<string>>( · 50 unmodified lines
51 },51 },
52);52);
53 53
54export const HostProcessUserId = Context.Reference<number | null>(
55 "@t3tools/shared/hostProcess/HostProcessUserId",
56 {
57 defaultValue: () => (typeof process.getuid === "function" ? process.getuid() : null),
58 },
59);
60
54export const isHostWindows = Effect.map(HostProcessPlatform, (platform) => platform === "win32");61export const isHostWindows = Effect.map(HostProcessPlatform, (platform) => platform === "win32");