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
View File
@@ -144,6 +144,15 @@ class ManageNativeTests(unittest.TestCase):
"-db", str(root / "data/pipelines.db")])
self.assertEqual("-allow-authoring" in command, role is True)
def test_mdns_advertises_the_lan_web_proxy_port(self):
with tempfile.TemporaryDirectory() as directory:
config = self.config(Path(directory))
self.assertEqual(manage.mdns_args(config), [])
config["web"]["host"] = "0.0.0.0"
self.assertEqual(manage.mdns_args(config), ["-mdns-port", "8082"])
config.pop("web")
self.assertEqual(manage.mdns_args(config), [])
def config(self, root, mode="native"):
(root / "lib/app-web").mkdir(parents=True, exist_ok=True)
(root / "lib/app-web/index.html").write_text("app")