Custom Samba Share?

I see that the Samba addon exposes a set of directories - addons, backup, config, etc. What if I want to add my own custom directory? Or remove any of the given set of directories? Is that possible?

AFAIK you Cannot remove the default directory structure because HA depends on it. But you can add directories. Use the terminal add-on for examples to do that.

You can use the Veto files Option in the samba add-on to hide files. For examples /ssl/* will hide all files in the ssl folder.

How can that be? HA works just fine without the Samba addon installed.

In which case Samba would then expose an empty and unusable “ssl” share. That seems an odd solution.

The documentation says:
This addon exposes the following directories over smb (samba):

Directory Description
addons This is for your local add-ons.
backup This is for your backups.
config This is for your Home Assistant configuration.
media This is for local media files.
share This is for your data that is shared between add-ons and Home Assistant.
ssl This is for your SSL certificates.

I don’t see any options to change that.

Everything on a haos setup should be available in one of those directories (I think)

1 Like

That’s the problem, for my taste, it exposes way too much. I actually only want to expose a single share. I don’t understand why it doesn’t allow me to do just that. It should be a simple matter of editing /etc/smb.conf, but for whatever reason, HA has obfuscated that route.

Well, then, you’d either (1) write your own add-on, or (2) submit a Feature Request and ask very nicely for the devs of the existing add-on to consider your proposed enhancement.

Frankly, I don’t see your current approach leading to any great success.

The Samba Share Addon is meant as an administration tool and not as a NAS stand in.
If you want a NAS feature, then a supervised installation might be better, but I would evaluate the hardware thoroughly before trying to run a service, that might be network intensive together with HA.

Which share(s) do you want to expose and why only this/those?

I agree. I’ve uninstalled the Samba addon. I’ve found another, more secure, way to reach my data-sharing goal. Thanks for your advice.

Since you ask, I wanted just a single “share” as a location for another network device to poll for a .json file an HA automation created there. However, I’ve decided to use curl to push the .json to the other device instead, which is anyway a better solution.

Thanks for your interest. I’ve now uninstalled the Samba addon, so I shouldn’t be bothering you folks further. Thanks again.

Hello, can you give us the name of this better addon ? thx

Not an add-on as such. I used the “curl” command from a bash shell script to transfer the data I wanted to send to another device. The bash shell script is added into HA via the shell_command: clause in configuration.yaml. Then the command can triggered via the service Shell Command in an automation.

It seems rather more complicated than it needs to be, but it works OK.

Just to add full picture, I attempted this workaround in the official Samba addon and the result would be it would hide ALL files in ALL shares. Not sure why. I would add /ssl/* as an option, and all the contents within config, or media would be gone as well, directories included.
Not sure if its a bug or what, I’m unable to understand why it does that.

You are right, all files disappear. Seems to be a bug. You should open a new issue for it.

1 Like

Done Samba: 'Veto files' will hide all files no matter the share · Issue #3551 · home-assistant/addons · GitHub