ruimte 0.13.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -3
- package/bin/ruimte.js +15 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,12 +4,14 @@ Ruimte for a machine without the app. It runs the machine that terminals, agents
|
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
npx ruimte # start the machine on 127.0.0.1:4210
|
|
7
|
-
npx ruimte pair # print a pairing link for the app on another computer
|
|
8
7
|
npx ruimte login # add this machine to your Ruimte account with a code
|
|
8
|
+
npx ruimte status # how the app on other devices reaches this machine
|
|
9
9
|
npx ruimte logout # take this machine off its account
|
|
10
10
|
npx ruimte service install # keep it running in the background for this user
|
|
11
11
|
npx ruimte service status
|
|
12
12
|
npx ruimte service uninstall
|
|
13
|
+
npx ruimte closed-lid install # on a Mac: let keep awake hold with the lid closed
|
|
14
|
+
npx ruimte closed-lid remove
|
|
13
15
|
npx ruimte --version
|
|
14
16
|
```
|
|
15
17
|
|
|
@@ -17,9 +19,13 @@ npx ruimte --version
|
|
|
17
19
|
|
|
18
20
|
It runs on macOS and Linux, on arm64 and x64. Windows is not supported yet.
|
|
19
21
|
|
|
22
|
+
## Reaching it
|
|
23
|
+
|
|
24
|
+
`npx ruimte login` puts the machine on your Ruimte account; the Ruimte app on any device signed in to that account then lists it. On the same network, or the same tailnet, the app connects to it directly through the door the machine keeps open on port 4220 (the daemon's port plus 10, `--lan-port` to move it, `--no-lan` to close it). From anywhere else it connects through the broker. `npx ruimte status` says which of those are open.
|
|
25
|
+
|
|
20
26
|
## The background service
|
|
21
27
|
|
|
22
|
-
`ruimte service install` copies the binary to `~/.ruimte/bin` and runs that copy, never the one in the npx cache. On macOS it is a LaunchAgent (`~/Library/LaunchAgents/app.ruimte.daemon.plist`, logs in `~/Library/Logs/Ruimte/daemon.log`); on Linux a systemd user unit (`~/.config/systemd/user/ruimte-daemon.service`, logs in `journalctl --user -u ruimte-daemon`). Flags after `install` are the flags the service runs with, such as `npx ruimte service install --
|
|
28
|
+
`ruimte service install` copies the binary to `~/.ruimte/bin` and runs that copy, never the one in the npx cache. On macOS it is a LaunchAgent (`~/Library/LaunchAgents/app.ruimte.daemon.plist`, logs in `~/Library/Logs/Ruimte/daemon.log`); on Linux a systemd user unit (`~/.config/systemd/user/ruimte-daemon.service`, logs in `journalctl --user -u ruimte-daemon`). Flags after `install` are the flags the service runs with, such as `npx ruimte service install --no-lan`.
|
|
23
29
|
|
|
24
30
|
On Linux, systemd stops a user's services when that user logs out. To keep the machine running while nobody is logged in, allow lingering yourself; the command never does it for you:
|
|
25
31
|
|
|
@@ -29,7 +35,19 @@ loginctl enable-linger "$USER"
|
|
|
29
35
|
|
|
30
36
|
Running `npx ruimte@latest service install` again installs the newer binary. A daemon that is running switches to it as soon as no agent or shell is busy on it.
|
|
31
37
|
|
|
32
|
-
`RUIMTE_HOME` (default `~/.ruimte`) is where the machine keeps its identity,
|
|
38
|
+
`RUIMTE_HOME` (default `~/.ruimte`) is where the machine keeps its identity, the devices it let in and its projects.
|
|
39
|
+
|
|
40
|
+
## Awake with the lid closed
|
|
41
|
+
|
|
42
|
+
Keep awake keeps a Mac from sleeping while agents work, but a closed lid still sleeps it unless an external display and the power adapter are connected. Only root can turn that off, so a person installs one rule, once:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
npx ruimte closed-lid install
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
It prints the rule before sudo asks for your password. The rule goes in `/etc/sudoers.d/ruimte-closed-lid-<uid>` and lets you run exactly `/usr/bin/pmset -a disablesleep 1` and `/usr/bin/pmset -a disablesleep 0` without a password, nothing else. Then turn on "Also with the lid closed" under keep awake, from Ruimte on your phone or in the app on the Mac.
|
|
49
|
+
|
|
50
|
+
Sleep stays off only while keep awake holds: on the power adapter, or on battery when keep awake may hold there and the battery is at 20% or more. It comes back on when keep awake lets go, when the machine stops, and through a small watchdog when the machine is killed. `npx ruimte status` says whether keep awake and the closed lid hold right now. `npx ruimte closed-lid remove` turns sleep back on and removes the rule. Removing Ruimte leaves the rule in place, so remove it first.
|
|
33
51
|
|
|
34
52
|
## License
|
|
35
53
|
|
package/bin/ruimte.js
CHANGED
|
@@ -15,8 +15,12 @@ var TARGETS = [
|
|
|
15
15
|
{ os: "linux", cpu: "x64" },
|
|
16
16
|
{ os: "linux", cpu: "arm64" }
|
|
17
17
|
];
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
function targetId(target) {
|
|
19
|
+
return `${target.os}-${target.cpu}`;
|
|
20
|
+
}
|
|
21
|
+
function packageNameOf(target) {
|
|
22
|
+
return `@ruimte/${targetId(target)}`;
|
|
23
|
+
}
|
|
20
24
|
|
|
21
25
|
// packages/npm/src/launcher.ts
|
|
22
26
|
class LauncherError extends Error {
|
|
@@ -24,7 +28,7 @@ class LauncherError extends Error {
|
|
|
24
28
|
var WINDOWS_REFUSAL = "Ruimte does not run on Windows yet. It runs on Macs with Apple silicon and on Linux, on arm64 and x64.";
|
|
25
29
|
var INTEL_NODE_REFUSAL = "This Node is built for Intel Macs, and Ruimte runs on Macs with Apple silicon only. On a Mac with Apple silicon this Node runs under Rosetta: install the arm64 build of Node and run Ruimte with that.";
|
|
26
30
|
var MUSL_REFUSAL = "Ruimte runs on Linux with glibc, and this system uses musl (as Alpine does), so npm left its binary out. Run it on a distribution with glibc, such as Debian or Ubuntu, or in a container of one.";
|
|
27
|
-
|
|
31
|
+
function platformPackageOf(host) {
|
|
28
32
|
if (host.platform === "win32") {
|
|
29
33
|
throw new LauncherError(WINDOWS_REFUSAL);
|
|
30
34
|
}
|
|
@@ -36,8 +40,8 @@ var platformPackageOf = (host) => {
|
|
|
36
40
|
throw new LauncherError(`Ruimte has no build for ${host.platform} on ${host.arch}. It runs on Macs with Apple silicon and on Linux, on arm64 and x64.`);
|
|
37
41
|
}
|
|
38
42
|
return packageNameOf(target);
|
|
39
|
-
}
|
|
40
|
-
|
|
43
|
+
}
|
|
44
|
+
function binaryPathOf(host, resolve, libc = () => null) {
|
|
41
45
|
const name = platformPackageOf(host);
|
|
42
46
|
let manifest;
|
|
43
47
|
try {
|
|
@@ -49,23 +53,23 @@ var binaryPathOf = (host, resolve, libc = () => null) => {
|
|
|
49
53
|
throw new LauncherError(`The package ${name} is missing. It holds the Ruimte binary for this machine and npm installs it as an optional dependency, ` + "so an install with --omit=optional or --no-optional leaves it out. Install ruimte again without that flag.");
|
|
50
54
|
}
|
|
51
55
|
return join(dirname(manifest), "bin", "ruimte");
|
|
52
|
-
}
|
|
53
|
-
|
|
56
|
+
}
|
|
57
|
+
function exitCodeOf(code, signalNumber) {
|
|
54
58
|
if (code !== null) {
|
|
55
59
|
return code;
|
|
56
60
|
}
|
|
57
61
|
return signalNumber === null ? 1 : 128 + signalNumber;
|
|
58
|
-
}
|
|
62
|
+
}
|
|
59
63
|
|
|
60
64
|
// packages/npm/src/bin.ts
|
|
61
65
|
var require2 = createRequire(import.meta.url);
|
|
62
|
-
|
|
66
|
+
function libc() {
|
|
63
67
|
if (process.platform !== "linux") {
|
|
64
68
|
return null;
|
|
65
69
|
}
|
|
66
70
|
const report = process.report?.getReport();
|
|
67
71
|
return report?.header?.glibcVersionRuntime ? "glibc" : "musl";
|
|
68
|
-
}
|
|
72
|
+
}
|
|
69
73
|
var binary;
|
|
70
74
|
try {
|
|
71
75
|
binary = binaryPathOf({ platform: process.platform, arch: process.arch }, (request) => require2.resolve(request), libc);
|
|
@@ -89,7 +93,7 @@ if (typeof execve === "function") {
|
|
|
89
93
|
}
|
|
90
94
|
var child = spawn(binary, args, { stdio: "inherit" });
|
|
91
95
|
var FORWARDED = ["SIGTERM", "SIGHUP", "SIGQUIT"];
|
|
92
|
-
|
|
96
|
+
function ignoreInterrupt() {}
|
|
93
97
|
process.on("SIGINT", ignoreInterrupt);
|
|
94
98
|
var forwarders = FORWARDED.map((signal) => {
|
|
95
99
|
const forward = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ruimte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Ruimte for a machine without the app: the machine that terminals, agents and browsers run on, reachable from the Ruimte app and station.ruimte.app.",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"author": "Bas Milius",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@ruimte/darwin-arm64": "0.
|
|
25
|
-
"@ruimte/linux-x64": "0.
|
|
26
|
-
"@ruimte/linux-arm64": "0.
|
|
24
|
+
"@ruimte/darwin-arm64": "0.14.1",
|
|
25
|
+
"@ruimte/linux-x64": "0.14.1",
|
|
26
|
+
"@ruimte/linux-arm64": "0.14.1"
|
|
27
27
|
}
|
|
28
28
|
}
|