IrosTheBeggar / mStream

The easiest music streaming server available
http://mstream.io
GNU General Public License v3.0
2.21k stars 186 forks source link

[Feature Request] Support symlinks on Unix-like systems #392

Closed maxim-kukushkin closed 1 year ago

maxim-kukushkin commented 1 year ago

My music collection which I want to stream contains symlinks + when running mStream in Docker, there's only one host folder that can be provided. Thus I need to link my multiple folders with the one provided to mStream.

However, mStream seems to ignore the symlinks completely.

Can it be enabled to follow symlinks? If not by default, then may be through the config?

tdammers commented 1 year ago

Not sure if it's a Docker thing, but symlinks work exactly as they should on my install.

I have one big bucket of music in /mnt/data/media/music, and then a subdirectory /mnt/data/media/music/categorized containing relative symlinks, grouped into subfolders by genre/category, and the mStream server is then pointed to /mnt/data/media/music/categorized; it plays songs through the symlinks just fine.

maxim-kukushkin commented 1 year ago

@tdammers , you're absolutely right, thanks! I really overlooked this part. Symbolic links are not handled by the OS, it's just a pointer to a path. And the path will be the same string both in the host OS and in a Docker container. So, if a symlink points to /foo/bar, Docker will also read it as /foo/bar, but will try to access it inside the container, which obviously will result in broken links

After figuring this out I managed to resolve this by bind mounts (on Linux): /my/music/files /srv/mstream/music/Music none bind 0 2 (/etc/fstab)