docs: put hc on PATH for non-desktop Herdr clients

hc connect speaks the protocol over stdin/stdout, so clients attach with
ssh <box> hc connect. That failed with "hc: command not found": the binary
installs to /root/.local/bin/herdr-core, which is neither on PATH in a
non-interactive shell nor named hc. The desktop app was unaffected since it
calls the absolute path it installed.

Symlinks both names into /usr/local/bin, restored by the go script, and
records the connection details a mobile client or app builder needs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kaloyan DanchevandClaude Opus 5 committed 2026-11-03 23:56:04 +02:00
1 parent 1613f7f458
commit 4d5ce8e915
2 files changed
+39 -3

No files matched your search

+38 -3
View File
@@ -106,6 +106,7 @@ on reboot and is restored by `/boot/config/go`:
| Path | Lost on reboot | Restored by |
|------|----------------|-------------|
| `/root/.local/bin/herdr-core` | yes | `install -m 755` from `/boot/config/herdr/herdr-core` |
| `/usr/local/bin/hc`, `/usr/local/bin/herdr-core` | yes | `ln -sf` to the restored binary |
| `/var/lib/elogind/linger/root` | yes | `loginctl enable-linger root` |
| `/run/user/0` | yes | recreated by pam_elogind at first login, then held open by linger |
@@ -117,6 +118,12 @@ The `go` block:
mkdir -p /root/.local/bin
install -m 755 /boot/config/herdr/herdr-core /root/.local/bin/herdr-core 2>/dev/null
# Put it on PATH under both names. ~/.local/bin is not on PATH in a
# non-interactive shell, and clients speak the protocol with `ssh box hc connect`,
# so without this they get "hc: command not found".
ln -sf /root/.local/bin/herdr-core /usr/local/bin/hc
ln -sf /root/.local/bin/herdr-core /usr/local/bin/herdr-core
# Keep /run/user/0 alive across logouts. pam_elogind creates and destroys it per
# login session, and the hc core's socket lives there, so without linger the
# socket disappears with the session that started the core and every later
@@ -135,10 +142,38 @@ hand: it came back `-rwxr-xr-x` reporting `hc 0.1.17`.
## Notes
- `~/.local/bin` is not on `PATH` in a non-interactive shell on Unraid, so
`herdr-core` resolves only by absolute path there. Herdr itself always uses
the absolute path, so this does not affect normal use.
- The binary installs to `/root/.local/bin/herdr-core`, which is not on `PATH`
in a non-interactive shell and is not named `hc`. The desktop app works
regardless because it uses the absolute path it installed, but any other
client fails. Symlinks in `/usr/local/bin` fix that (restored by the go
script above).
- Adding a machine that `hc` already knows is refused as a duplicate — it keys
on the core id (`3d4a2397fcb6…`), not the address. Re-pointing an existing
machine means `machine rm` then `machine add`, since there is no command to
change a target in place.
## Other clients (mobile, app builders)
`hc connect` speaks the protocol over stdin/stdout, so any client attaches with
`ssh <box> hc connect`. `hc schema` prints the API as JSON Schema. What a client
needs for this server:
| Field | Value |
|-------|-------|
| Host | `100.100.208.69`, or `xtrm-unraid.tailf789e1.ts.net` |
| Port | **22** — not 422; sshd binds only 192.168.10.20 and 192.168.31.250, so 422 is closed on the Tailscale address |
| User | `root` |
| Password / key | none — Tailscale SSH authenticates by tailnet identity |
| Command | `hc connect` |
The client device must itself be an active node in the tailnet
(`tailf789e1.ts.net`), because Tailscale SSH authorises by source node. The ACL
is `accept` for `autogroup:member` -> `autogroup:self`, so the owner's own
devices are covered once they are online and logged in.
Before the `/usr/local/bin` symlinks existed, this failed at the first hurdle:
```
ssh root@100.100.208.69 'hc connect'
-> /bin/bash: line 1: hc: command not found
```