@hydra-acp/cli 0.1.195 → 0.1.196

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 CHANGED
@@ -213,12 +213,40 @@ hydra-acp session share # most-recent session for this cwd
213
213
  hydra-acp --session hydra://box:55514/hydra_session_abc123
214
214
  ```
215
215
 
216
- This only reaches past your own machine if the daemon is listening past it, and
217
- the daemon refuses to bind to a non-loopback address without TLS. So sharing
218
- means setting `daemon.host`, pointing `daemon.tls.cert`/`key` at a certificate,
219
- and setting `daemon.publicHost` to the name the URL should carry. See
220
- [Security](#security). Without that, `share` still prints a URL and warns you
221
- that it's loopback-only.
216
+ This only reaches past your own machine if the daemon is listening past it.
217
+ See [Accepting remote clients](#accepting-remote-clients). Without that,
218
+ `share` still prints a URL and warns you that it's loopback-only.
219
+
220
+ ### Accepting remote clients
221
+
222
+ By default the daemon only listens on loopback. `hydra-acp daemon listen`
223
+ opens it up and handles the certificate, the master password and the restart:
224
+
225
+ ```sh
226
+ hydra-acp daemon listen tailnet # tailnet IP only, CA-signed cert from `tailscale cert`
227
+ hydra-acp daemon listen all # every interface, self-signed cert
228
+ hydra-acp daemon listen local # back to loopback, no TLS (the default)
229
+ hydra-acp daemon listen # show scope, cert, fingerprint and expiry
230
+ ```
231
+
232
+ `tailnet` is the one to reach for: nothing outside your tailnet can connect,
233
+ and the cert is valid for browsers and phones as well as hydra clients. It
234
+ needs HTTPS certificates enabled for the tailnet, and `tailscale cert` needs
235
+ either sudo or `sudo tailscale set --operator=$(whoami)` once. Tailscale certs
236
+ last about 90 days; re-run `daemon listen tailnet` to renew, and plain
237
+ `daemon listen` warns when fewer than 14 days are left.
238
+
239
+ `all` binds `0.0.0.0` behind a self-signed cert, which hydra clients pin on
240
+ first use. It prints the cert's fingerprint so you can check it against the
241
+ one `remote add` shows you. Re-running it keeps the existing cert, so pinned
242
+ clients keep working.
243
+
244
+ Both print the `remote add` line to run on the other machine. On a tailnet,
245
+ use the MagicDNS name it prints rather than the IP: the cert is only valid for
246
+ the name, and a cert added by IP gets pinned and breaks at the next renewal.
247
+
248
+ The [browser extension](#extensions) serves with the daemon's cert unless its
249
+ own `BROWSER_TLS_CERT`/`BROWSER_TLS_KEY` are set.
222
250
 
223
251
  ### Linking machines
224
252
 
@@ -230,20 +258,25 @@ attached with `--session <name>:<localId>`, as well as showing up in hydra
230
258
  session lists in TUI:
231
259
 
232
260
  ```sh
233
- hydra-acp remote add box peer.local
261
+ # on the peer, once: accept remote clients (sets up TLS and a master password)
262
+ hydra-acp daemon listen tailnet
263
+
264
+ # on your machine
265
+ hydra-acp remote add box.tail1234.ts.net
234
266
  hydra-acp session list --host=box
235
267
  hydra-acp --session box:hydra_session_abc123
236
268
  ```
237
269
 
238
- The host arg is `host[:port]`; the port defaults to the daemon's usual
239
- `55514` when omitted. Two things have to be true on the peer (`peer.local`)
240
- before this works:
241
-
242
- - It has a master password set — `hydra-acp auth password` on that machine.
243
- `remote add` prompts you for it once, exchanges it for a long-lived token,
244
- and stores that token.
245
- - If it's not loopback, it needs TLS configured as in [Security](#security).
246
- `remote add` does a TOFU handshake first.
270
+ `daemon listen` prints the exact `remote add` line to run; see
271
+ [Accepting remote clients](#accepting-remote-clients) for the scopes. The host
272
+ arg is `host[:port]`; the port defaults to the daemon's usual `55514` when
273
+ omitted. With no name, the remote takes the peer's own machine name (its
274
+ hostname), the same name its exported sessions carry once imported here, so
275
+ the picker files both under one name. `remote add <name> <host>` picks the
276
+ name yourself, which you'll need when two peers share a hostname. `remote add` checks the peer's cert first (a self-signed one asks you
277
+ to confirm its fingerprint), then prompts for the peer's master password once,
278
+ exchanges it for a long-lived token, and stores that token. `hydra-acp auth
279
+ password` on the peer changes the password later.
247
280
 
248
281
  The exchanged token expires; `remote list` shows when. Re-run `remote add`
249
282
  with the same name before then to refresh it. `remote remove` un-federates
@@ -320,6 +353,8 @@ hydra-acp daemon start [--foreground] # detached by default; --foreground
320
353
  hydra-acp daemon stop # stop running daemon
321
354
  hydra-acp daemon restart # stop then start the daemon
322
355
  hydra-acp daemon log [-f] [-n N] # tail (default 50) or follow the daemon log
356
+ hydra-acp daemon listen [local|tailnet|all] [--public-host <name>] [--yes] [--no-restart]
357
+ # accept remote clients; sets up TLS. No scope: status
323
358
 
324
359
  hydra-acp session [list] [--all] [--json] [--host <h>] [--columns <list>]
325
360
  # list sessions (live + 20 most-recent cold).
@@ -442,13 +477,15 @@ hydra-acp agent log <id> [-f] [-n N] # tail or follow an agent's spawn/std
442
477
  hydra-acp registry pin | unpin # freeze the daemon on its cached registry, or
443
478
  # resume normal TTL fetching
444
479
 
445
- hydra-acp remote add <name> <host[:port]> [--label <text>]
480
+ hydra-acp remote add [<name>] <host[:port]> [--label <text>]
446
481
  # federate with a peer daemon under a local name
447
482
  # (prompts for its password; matches `git remote add`).
483
+ # Without <name>, uses the peer's machine name.
448
484
  # TOFU-pins the peer's TLS cert on first trust; re-running
449
485
  # this before the token expires refreshes it without
450
486
  # re-prompting for the cert
451
- hydra-acp remote [list] # list federated peer daemons
487
+ hydra-acp remote [list] # list federated peer daemons with their status,
488
+ # hydra version and OS
452
489
  hydra-acp remote remove <name> # un-federate a peer daemon and revoke its token
453
490
 
454
491
  hydra-acp config [list] [<dotted.key>] # print effective config (or one subtree) as JSON
@@ -996,7 +1033,9 @@ For remote access (binding to a non-loopback address), enable TLS via:
996
1033
  }
997
1034
  ```
998
1035
 
999
- The daemon refuses to bind to non-loopback hosts without TLS configured. A
1036
+ The daemon refuses to bind to non-loopback hosts without TLS configured.
1037
+ `hydra-acp daemon listen` writes all of this for you (see
1038
+ [Accepting remote clients](#accepting-remote-clients)). To do it by hand, a
1000
1039
  self-signed cert is enough, since `remote add`'s TOFU handshake only needs a
1001
1040
  key pair to pin, not a CA-signed one:
1002
1041