Skip to content

Samba: Add configuration option to disable WSDD - #4738

Merged
agners merged 9 commits into
home-assistant:masterfrom
clowncracker:samba-wsdd-toggle
Jul 28, 2026
Merged

Samba: Add configuration option to disable WSDD#4738
agners merged 9 commits into
home-assistant:masterfrom
clowncracker:samba-wsdd-toggle

Conversation

@clowncracker

@clowncracker clowncracker commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #4722

WSDD has run unconditionally since 12.7.0, so the host is advertised in the
Windows Network view with no way to opt out. compatibility_mode: false and
netbios: false have no effect on it, since enable-check.sh only gates
nmbd.

This adds a wsdd boolean option following the exact pattern of the
netbios option added in 12.8.0: the flag is checked in enable-check.sh
and the service file is removed from user/contents.d when disabled.

Defaults to true, so existing installations see no change in behaviour.
Disabling it does not affect share availability, only discovery.

Includes the schema entry, DOCS.md documentation, the en.yaml UI strings,
a version bump to 12.9.0, and a changelog entry.

Summary by CodeRabbit

  • New Features

    • Added a network_discovery configuration option to control WSDD-based advertising for Windows File Explorer.
    • When enabled (default), the host is discoverable on the local network; when disabled, it won’t be advertised.
    • Share access remains available by hostname or IP address regardless of discovery.
  • Documentation

    • Updated documentation and example configuration to include network_discovery.
    • Added UI text and translation for the new setting.

Samba: add wsdd config option
Samba: add changelog entry for 12.9.0
Samba: document wsdd option
Samba: gate wsdd service behind config option
Samba: add UI strings for wsdd option

@home-assistant home-assistant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @clowncracker

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant

Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 440f2c52-73ee-49ab-8ba7-2c71d0ba7382

📥 Commits

Reviewing files that changed from the base of the PR and between e0531ef and 83226bf.

📒 Files selected for processing (4)
  • samba/DOCS.md
  • samba/config.yaml
  • samba/rootfs/etc/s6-overlay/scripts/enable-check.sh
  • samba/translations/en.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • samba/rootfs/etc/s6-overlay/scripts/enable-check.sh

📝 Walkthrough

Walkthrough

Samba 12.9.0 adds a network_discovery boolean option, defaults it to enabled, documents its WSDD behavior, and conditionally enables the WSDD service through s6-rc.

Changes

Samba network discovery

Layer / File(s) Summary
Network discovery configuration contract
samba/config.yaml, samba/DOCS.md, samba/translations/en.yaml, samba/CHANGELOG.md
Adds and validates network_discovery: true, documents its WSDD discovery behavior, adds UI text, and records the 12.9.0 release change.
WSDD service toggle
samba/rootfs/etc/s6-overlay/scripts/enable-check.sh
Creates or removes the WSDD s6-rc contents marker based on network_discovery and logs the selected state.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: add-on: samba

Suggested reviewers: atx32

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding an option to disable WSDD in Samba.
Linked Issues check ✅ Passed The PR implements the requested WSDD opt-out, keeps shares reachable by hostname/IP, and preserves the default enabled behavior for #4722.
Out of Scope Changes check ✅ Passed The remaining edits are supporting docs, translations, changelog, and version bump changes within the stated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@agners

agners commented Jul 22, 2026

Copy link
Copy Markdown
Member

What is the use case here? Is it a problem when it's discoverable on the network?

The amount of options gets a bit out of hand. And I guess once we support mDNS (e.g. via #4742), yet another flag needs to be introduced 😢 .

@clowncracker

Copy link
Copy Markdown
Contributor Author

The primary use case is preventing the host from advertising itself on networks you don't fully control, where you'd rather it not broadcast itself to every device on the LAN. It's also restoring previous behavior rather than introducing a new feature. Before 12.7.0, the add-on didn't advertise itself this way, so servers that were intentionally hidden suddenly became discoverable with no way to disable it. That's the issue being addressed in #4722.

I also agree that adding a separate boolean for every discovery protocol doesn't scale, NetBIOS today, WSDD now, mDNS next. Would a single option, something like discoverable (defaulting to true), make more sense? It could control WSDD now and the upcoming mDNS work in #4742, rather than introducing a new flag for each protocol. NetBIOS is a bit of an exception since it already shipped as a standalone option in 12.8.0, but newer discovery mechanisms could share a common switch.

I'm happy to rework the PR in that direction if you think that's the better approach. Just let me know your preference.

@atx32

atx32 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The primary use case is preventing the host from advertising itself on networks you don't fully control, where you'd rather it not broadcast itself to every device on the LAN. It's also restoring previous behavior rather than introducing a new feature. Before 12.7.0, the add-on didn't advertise itself this way, so servers that were intentionally hidden suddenly became discoverable with no way to disable it. That's the issue being addressed in #4722.

I also agree that adding a separate boolean for every discovery protocol doesn't scale, NetBIOS today, WSDD now, mDNS next. Would a single option, something like discoverable (defaulting to true), make more sense? It could control WSDD now and the upcoming mDNS work in #4742, rather than introducing a new flag for each protocol. NetBIOS is a bit of an exception since it already shipped as a standalone option in 12.8.0, but newer discovery mechanisms could share a common switch.

I also didn't understand the use case for disabling discovery. The reason I added a flag for mDNS in #4742 is I had taken note of #4722 and decided to just do the work to give the user a choice. I think NetBIOS needs separate control as (like SMB1) it's now considered insecure and should not be used unless absolutely needed. As far as bundling WSDD and mDNS into a single option I'm neutral either way.

@agners

agners commented Jul 27, 2026

Copy link
Copy Markdown
Member

I also didn't understand the use case for disabling discovery. The reason I added a flag for mDNS in #4742 is I had taken note of #4722 and decided to just do the work to give the user a choice. I think NetBIOS needs separate control as (like SMB1) it's now considered insecure and should not be used unless absolutely needed. As far as bundling WSDD and mDNS into a single option I'm neutral either way.

NetBIOS has an option since #4705. Ultimately we also want to flip the switch to default off, I intend to make a breaking change to the Samba app, I started to collect them in #4750.

Comment thread samba/translations/en.yaml Outdated
@home-assistant
home-assistant Bot marked this pull request as draft July 27, 2026 07:42
clowncracker and others added 4 commits July 27, 2026 20:01
Co-authored-by: Stefan Agner <stefan@agner.ch>
samba: rename option to network_discovery
samba: gate service on network_discovery
samba: update docs for network_discovery
@clowncracker

Copy link
Copy Markdown
Contributor Author

I also didn't understand the use case for disabling discovery. The reason I added a flag for mDNS in #4742 is I had taken note of #4722 and decided to just do the work to give the user a choice. I think NetBIOS needs separate control as (like SMB1) it's now considered insecure and should not be used unless absolutely needed. As far as bundling WSDD and mDNS into a single option I'm neutral either way.

NetBIOS has an option since #4705. Ultimately we also want to flip the switch to default off, I intend to make a breaking change to the Samba app, I started to collect them in #4750.

I renamed to network_discovery across config, schema, the script, and the docs heading. Kept the description WSDD-specific for now so the mDNS PR can extend it, and left netbios as its own option as you suggested.

@clowncracker
clowncracker marked this pull request as ready for review July 28, 2026 03:11
@home-assistant
home-assistant Bot requested a review from agners July 28, 2026 03:11

@agners agners left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@agners
agners merged commit 7d6c524 into home-assistant:master Jul 28, 2026
8 checks passed
atx32 added a commit to atx32/samba-update that referenced this pull request Jul 29, 2026
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.

[Samba] v12.7.0 enables WSDD with no way to disable it - Home Assistant now advertises itself on the network

3 participants