LAN discovery: server advertises _pipelines._tcp over mDNS; app finds servers on the connect screen

Server: internal/discovery publishes a DNS-SD record (hashicorp/mdns) with
the port LAN clients dial (the web proxy via -mdns-port, which the
supervisor passes, or a non-loopback -addr) and TXT v, name, path, tls, auth.
On by default; -mdns=false or PIPELINES_MDNS=off disables it. Failures are
logged and never block startup; the advert is withdrawn on shutdown.

App: the Connect to Pipelines screen gets 'Find servers on this network'
behind a ServerDiscovery interface (Bonsoir: Android NSD with multicast lock,
iOS Bonjour with NSLocalNetworkUsageDescription and NSBonjourServices).
Tapping a server fills the address and connects; manual entry stays. Web has
no scan.
This commit is contained in:
2026-11-03 14:54:54 +00:00
parent 97509cb49f
commit 7ecc12b747
22 changed files with 1174 additions and 25 deletions
+9 -1
View File
@@ -94,6 +94,14 @@ Expose only the web proxy. A reinstall keeps the saved ports and bind
addresses unless you pass the flag again, so an installation set up with
`--web-port 8083` stays on 8083.
The server advertises itself on the LAN with mDNS/DNS-SD as `_pipelines._tcp`,
so the phone app's "Find servers on this network" lists it. The advertised port
is the web proxy's (when it listens beyond loopback; the supervisor passes
`-mdns-port`), or the server's own `-addr` port when that is a LAN address.
TXT records: `v` (version), `name` (host), `path=/connect`, `tls=0`,
`auth=password|none`. Set `PIPELINES_MDNS=off` (or `-mdns=false`) to disable
it; a failure to advertise is logged and never stops the server.
`PIPELINES_WEB_PUBLIC_URL` is the address phones and notification links use.
Set it once; reinstalls keep it:
@@ -253,7 +261,7 @@ go run ./cmd/pipelines --url ws://127.0.0.1:8081/connect tui
```
`go run ./cmd/pipelines-server -help` lists the server flags (`-addr`, `-db`,
`-allow-authoring`, `-opencode-endpoint`). Without `-db` it uses the standard
`-allow-authoring`, `-opencode-endpoint`, `-mdns`, `-mdns-port`). Without `-db` it uses the standard
per-user data directory (`XDG_DATA_HOME`, or Application Support on macOS).
## Troubleshooting