@akshar5/cohall 0.4.4 → 0.4.5
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/CHANGELOG.md +7 -0
- package/README.md +7 -0
- package/bin/cohall.js +100 -14
- package/bin/cohall.js.map +8 -8
- package/deploy/systemd/cohall-relay.service +3 -1
- package/deploy/systemd/cohall-relay.socket +11 -0
- package/docs/services.md +12 -3
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
[Unit]
|
|
2
2
|
Description=Cohall relay
|
|
3
|
-
After=network-online.target
|
|
3
|
+
After=network-online.target cohall-relay.socket
|
|
4
4
|
Wants=network-online.target
|
|
5
|
+
Requires=cohall-relay.socket
|
|
5
6
|
|
|
6
7
|
[Service]
|
|
7
8
|
Type=simple
|
|
@@ -9,6 +10,7 @@ User=cohall
|
|
|
9
10
|
Group=cohall
|
|
10
11
|
EnvironmentFile=/etc/cohall/relay.env
|
|
11
12
|
ExecStart=/usr/local/bin/cohall relay
|
|
13
|
+
Sockets=cohall-relay.socket
|
|
12
14
|
Restart=on-failure
|
|
13
15
|
RestartSec=3
|
|
14
16
|
UMask=0077
|
package/docs/services.md
CHANGED
|
@@ -41,16 +41,23 @@ COHALL_TOKEN=replace-with-a-random-owner-token
|
|
|
41
41
|
COHALL_DATA_DIR=/var/lib/cohall
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Install `deploy/systemd/cohall-relay.service
|
|
44
|
+
Install `deploy/systemd/cohall-relay.service` and
|
|
45
|
+
`deploy/systemd/cohall-relay.socket`. The packaged socket listens on loopback;
|
|
46
|
+
change `ListenStream` to the relay's private Tailscale address when devices
|
|
47
|
+
connect directly over Tailscale. Then:
|
|
45
48
|
|
|
46
49
|
```bash
|
|
47
50
|
systemctl daemon-reload
|
|
51
|
+
systemctl enable --now cohall-relay.socket
|
|
48
52
|
systemctl enable --now cohall-relay
|
|
49
53
|
journalctl -u cohall-relay -f
|
|
50
54
|
```
|
|
51
55
|
|
|
52
56
|
Expose the relay only through a private network such as Tailscale or an HTTPS
|
|
53
|
-
reverse proxy. Device connections are outbound WebSockets.
|
|
57
|
+
reverse proxy. Device connections are outbound WebSockets. The socket unit keeps
|
|
58
|
+
the listener available across relay service restarts: new connections wait for
|
|
59
|
+
the replacement process instead of failing. Existing WebSockets reconnect, and
|
|
60
|
+
durable tasks resume after the replacement relay starts.
|
|
54
61
|
|
|
55
62
|
## macOS
|
|
56
63
|
|
|
@@ -89,7 +96,9 @@ logon and restarts it after failures.
|
|
|
89
96
|
Run `cohall upgrade` from a global npm, Bun, or pnpm installation. It updates
|
|
90
97
|
that installation and restarts only active managed Cohall services, with relays
|
|
91
98
|
restarted before device daemons. Active services restart even when the installed
|
|
92
|
-
files already match the requested version. A
|
|
99
|
+
files already match the requested version. A systemd relay installed with the
|
|
100
|
+
packaged socket unit keeps accepting new connections while its process restarts.
|
|
101
|
+
A delegated upgrade can finish after
|
|
93
102
|
restarting its own device daemon: a durable receipt records the restart attempt,
|
|
94
103
|
and a delegated caller leaves that marker for the replacement task to consume
|
|
95
104
|
after reconnecting, even when a service manager returns before ending the old process.
|