Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ZeroConf Service Discovery #1

Open
crazy-max opened this issue May 30, 2021 · 7 comments
Open

Add ZeroConf Service Discovery #1

crazy-max opened this issue May 30, 2021 · 7 comments

Comments

@crazy-max
Copy link
Owner

crazy-max commented May 30, 2021

As this image drops support for legacy protocols including NetBIOS, WINS, and Samba port 139 for security purposes, for Windows clients, Samba won't be shown under network browsing. We could use mDNS and DNS-SD with Samba using Avahi daemon for that but it only works on Linux and OSX machines afaik.

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
   <type>_smb._tcp</type>
   <port>445</port>
 </service>
 <service>
   <type>_device-info._tcp</type>
   <port>0</port>
   <txt-record>model=RackMac</txt-record>
 </service>
 <service>
   <type>_adisk._tcp</type>
   <txt-record>sys=waMa=0,adVF=0x100</txt-record>
   <txt-record>dk0=adVN=TimeMachine,adVF=0x82</txt-record>
 </service>
</service-group>
@Erriez
Copy link

Erriez commented Dec 22, 2021

The Samba server automatic network discovery can be added with:

  • wsdd: Via Windows Explorer | Network.
  • avahi Linux (for example Ubuntu GNOME Nautilus | Other Locations.

wsdd and avahi don't have a relation to Samba. For example, the avahi configuration below can make a Samba server and SSH server available in Nautilus:

image

Windows Explorer:

Windows Explorer

Avahi smb.service

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
   <type>_smb._tcp</type>
   <port>445</port>
 </service>
</service-group>

My proposal is to create two separate wsdd and avahi containers which can be launched via docker-compose.yml, for example in my forked dperson/samba: https://github.com/Erriez/docker-samba/blob/master/docker-compose.yml

@crazy-max
Copy link
Owner Author

My proposal is to create two separate wsdd and avahi containers which can be launched via docker-compose.yml, for example in my forked dperson/samba: https://github.com/Erriez/docker-samba/blob/master/docker-compose.yml

Yes indeed, the idea is to have sidecar containers to handle that.

@Erriez
Copy link

Erriez commented Dec 27, 2021

Do you have a preference to choose an existing well-maintained and easy to configure wsdd and avahi image?

https://hub.docker.com/search?q=avahi&type=image
https://hub.docker.com/search?q=wsdd&type=image

@itrich
Copy link

itrich commented Apr 12, 2022

I have added these two containers, which announces the host successfully in both worlds, Windows and *nix/OSX.

  wsdd:
    image: jonasped/wsdd
    container_name: wsdd
    network_mode: host
    restart: unless-stopped
  avahi:
    image: ydkn/avahi
    container_name: avahi
    network_mode: host
    volumes:
      - "./data/avahi/services:/etc/avahi/services"
    restart: unless-stopped

Should we add this as a seperate example docker-compose file? I'd be happy to open a pull request.

@crazy-max
Copy link
Owner Author

@itrich Sure contribs welcomed!

@crazy-max
Copy link
Owner Author

@itrich Opened #86 if you're interested to try it.

@Sharpiro
Copy link

Sharpiro commented Feb 6, 2024

It looks like @crazy-max added support for service discovery in #86, but I enabled it and it doesn't seem to work. I've tested with a few different clients and nothing appears.

Edit:

It actually is appearing in my VLC SMB clients, but not Nautilus for some reason. I'm using Raspberry Pi 5 with Ubuntu 23.10.

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

No branches or pull requests

4 participants