Skip to content

feat(network): advertise core over Bonjour as _seedypod._tcp - #75

Merged
ng merged 1 commit into
devfrom
feat/mdns-advertise
Nov 2, 2026
Merged

ng merged 1 commit into
devfrom
feat/mdns-advertise

Conversation

@ng

@ng ng commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Core-side prerequisite from ADR-0017: advertise core over Bonjour so the iOS app (NWBrowser) finds units without a typed-in address.

  • src/network/mdns.ts: CoreAdvertiser publishes _seedypod._tcp on core's HTTP port (PORT, default 3000) via @homebridge/ciao (already pulled in by hap-nodejs at 1.4.0; now a direct dep so the bundled server can import it). Instance name is the unit name, hostname <unit-id>-core.local.
  • TXT: id (hald's system.unitId, then HAL_UNIT_ID, then hostname), v (core version), auth (1 when settings.apiKey is set, else 0). TXT updates live on settings mutations and hald system events.
  • Off with SEEDYPOD_MDNS=0 (also false/off), under Vitest / NODE_ENV=test, and when HOST is loopback. The Vercel demo is web-only, so nothing runs there. Failures are logged and core carries on; SIGINT/SIGTERM sends goodbyes before shutdown.
  • Docs: ADR-0017 prerequisite marked done, INSTALLATION.md notes the TXT keys and the off switch.

Test plan

  • pnpm lint, pnpm tsc, pnpm test (new src/network/tests/mdns.test.ts covers enable rules, TXT derivation, hostname label, ciao wiring with a fake responder, live TXT updates, failure and stop paths)
  • Local smoke on macOS: PORT=3999 tsx server/index.ts, then dns-sd -L Gardyn _seedypod._tcp local resolved sim-0001-core.local.:3999 with id=sim-0001 v=dev auth=0; SIGINT exited cleanly
  • On a unit: avahi-browse -rt _seedypod._tcp shows the unit; setting an API key in Settings flips auth to 1

🤖 Generated with Claude Code

…its without an address

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 169880ad-32ed-4fa5-b864-9e5b1c9c2566

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 6 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/index.ts 0.00% 3 Missing ⚠️
src/network/mdns.ts 94.73% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@ng
ng added this pull request to the merge queue Nov 2, 2026
Merged via the queue into dev with commit 14725df Nov 2, 2026
12 checks passed
@ng
ng deleted the feat/mdns-advertise branch November 2, 2026 06:20
@ng ng mentioned this pull request Nov 2, 2026
1 of 3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant