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 apps/server/src/cli (3 of 12 files). Show all

Unified · Split

3 files
  1. apps/server/src/cli/connect.ts +1 −1
  2. apps/server/src/cli/service.test.ts +3 −3
  3. apps/server/src/cli/service.ts +3 −4
apps/server/src/cli/connect.ts+1−1
@@ -695,7 +695,7 @@ export const connectCommand = Command.make("connect", { · 694 unmodified lines
695 const background = yield* recoverServiceOnboardingOffer(offerServiceDuringOnboarding);695 const background = yield* recoverServiceOnboardingOffer(offerServiceDuringOnboarding);
696 if (background) {696 if (background) {
697 yield* Console.log(697 yield* Console.log(
698 "\n✓ Background service ready\n\nT3 Code will stay reachable after you log out.",698 "\n✓ Background service ready\n\nT3 Code will start automatically and stay reachable in the background.",
699 );699 );
700 return;700 return;
701 }701 }
apps/server/src/cli/service.test.ts+3−3
@@ -16,7 +16,7 @@ it("reports the installed service version and host paths", () => { · 15 unmodified lines
16 [16 [
17 "T3 Code service",17 "T3 Code service",
18 " Status: installed · t3@0.0.29",18 " Status: installed · t3@0.0.29",
19 " Unit: /home/me/.config/systemd/user/t3code.service",19 " Definition: /home/me/.config/systemd/user/t3code.service",
20 " Logs: /home/me/.t3/userdata/logs/boot-service.log",20 " Logs: /home/me/.t3/userdata/logs/boot-service.log",
21 ].join("\n"),21 ].join("\n"),
22 );22 );
@@ -29,9 +29,9 @@ it("gives a direct repair command for a stale service", () => { · 6 unmodified lines
29 );29 );
30});30});
31 31
32it("explains service availability without systemd", () => {32it("explains service availability on unsupported platforms", () => {
33 assert.include(33 assert.include(
34 formatServiceStatus({ ...status, supported: false, installed: false }, "0.0.29"),34 formatServiceStatus({ ...status, supported: false, installed: false }, "0.0.29"),
35 "Supported on: Linux with systemd",35 "Supported on: macOS with launchd or Linux with systemd",
36 );36 );
37});37});
apps/server/src/cli/service.ts+3−4
@@ -48,7 +48,7 @@ export function formatServiceStatus( · 47 unmodified lines
48 cliVersion: string,48 cliVersion: string,
49): string {49): string {
50 if (!status.supported) {50 if (!status.supported) {
51 return "T3 Code service\n Status: unavailable on this machine\n Supported on: Linux with systemd";51 return "T3 Code service\n Status: unavailable on this machine\n Supported on: macOS with launchd or Linux with systemd";
52 }52 }
53 if (!status.installed) {53 if (!status.installed) {
54 return "T3 Code service\n Status: not installed\n Next: Run `t3 service install`.";54 return "T3 Code service\n Status: not installed\n Next: Run `t3 service install`.";
@@ -56,7 +56,7 @@ export function formatServiceStatus( · 1 unmodified line
56 return [56 return [
57 "T3 Code service",57 "T3 Code service",
58 ` Status: ${status.current ? `installed · t3@${cliVersion}` : "needs an update or repair"}`,58 ` Status: ${status.current ? `installed · t3@${cliVersion}` : "needs an update or repair"}`,
59 ` Unit: ${status.unitPath}`,59 ` Definition: ${status.unitPath}`,
60 ` Logs: ${status.logPath}`,60 ` Logs: ${status.logPath}`,
61 ...(status.current ? [] : [" Next: Run `npx t3@latest service update`."]),61 ...(status.current ? [] : [" Next: Run `npx t3@latest service update`."]),
62 ].join("\n");62 ].join("\n");
@@ -156,8 +156,7 @@ export const offerServiceDuringOnboarding = Effect.gen(function* () { · 93 unmodified lines
156 Prompt.confirm({156 Prompt.confirm({
157 message: installed157 message: installed
158 ? "The installed T3 Code service needs an update or repair. Update it now?"158 ? "The installed T3 Code service needs an update or repair. Update it now?"
159 : "Run T3 Code in the background whenever this machine boots? " +159 : "Start T3 Code automatically and keep this machine reachable in the background?",
160 "It stays reachable through T3 Connect even after you log out.",
161 initial: true,160 initial: true,
162 }),161 }),
163 );162 );

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t