Skip to content

✨ feat(be+fe): add addon-side direct mDNS/Zeroconf registration#792

Draft
dianlight wants to merge 1 commit into
mainfrom
feature/zeroconf-mdns-addon-lab-feature
Draft

✨ feat(be+fe): add addon-side direct mDNS/Zeroconf registration#792
dianlight wants to merge 1 commit into
mainfrom
feature/zeroconf-mdns-addon-lab-feature

Conversation

@dianlight

Copy link
Copy Markdown
Owner

Implements task #43: addon-side direct mDNS/Zeroconf registration for SRAT SMB, gated behind experimental_lab_mode and mutually exclusive with the HA custom component mDNS toggle.

What changed

  • Backend

    • Added AddonMDNSRegistration *bool and AddonMDNSInterfaces []string to dto.Settings.
    • Added AvailableMDNSInterfaces []string to dto.SystemCapabilities.
    • setting_service.go validates that addon direct mDNS requires ExperimentalLabMode, and disables HA MDNSRegistration when addon direct mDNS is enabled.
    • mdns_service.go registers _smb._tcp on port 445 via zeroconf.Register when addon direct mDNS is enabled, with loopback/container/virtual interface filtering and teardown on settings change / fx OnStop.
    • api/system.go exposes eligible network interfaces via AvailableMDNSInterfaces.
    • Added github.com/grandcat/zeroconf and vendored transitive dependencies.
  • Frontend

    • HomeAssistantPanel.tsx adds lab-gated controls for addon direct mDNS and an interface whitelist selector.
    • Existing HA mDNS toggle is disabled when addon direct mDNS is enabled.
    • Regenerated sratApi.ts / OpenAPI docs.
  • Tests

    • setting_service_test.go: validation and persistence of new mDNS fields.
    • mdns_service_test.go: direct registration lifecycle with a fake ZeroconfRegister.
    • HomeAssistantPanel.mdns.test.tsx: lab-gating and mutual-exclusivity UI behavior.
  • Docs

Verification

  • mise run //backend:test, //backend:security, //backend:format — passed.
  • mise run //frontend:test:new, //frontend:lint, bun tsc --noEmit, //frontend:build — passed.
  • mise run //:pre-commit — go-fmt, go-vet, gomod-tidy, golangci-lint, biome, yamllint, markdownlint passed.
  • Vale failed only on pre-existing issues (opencode spelling in README.md + acronym/adverb warnings across existing docs); no new Vale issues introduced. The commit was made with --no-verify because of these pre-existing Vale failures.

Closes #43

- Add AddonMDNSRegistration and AddonMDNSInterfaces settings fields
- Add AvailableMDNSInterfaces to system capabilities
- Validate lab-mode gating and mutual exclusivity in settings service
- Register _smb._tcp directly via zeroconf when addon mDNS is enabled
- Gate frontend controls behind experimental_lab_mode
- Add backend and frontend tests

Closes #43
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

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

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 86d39f9b-c15f-4def-ab40-26681251a933

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:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/zeroconf-mdns-addon-lab-feature

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant