Hello, I’ve just setup a NAS running DietPi and I’m using Nextcloud to manage all my files. One directory within Nextcloud is for music but when I add this directory ("/mnt/dietpi_userdata/nextcloud_data/admin/files/Music") to Airsonic as a media folder it’s not found.
I understand this is because of the folder permissions since the folder should be owned by dietpi or airsonic and have temporarily fixed the issue by giving ownership of this directory to airsonic, however then it takes down Nextcloud since www-data is no longer an owner.
How can I set up these permissions so I can use Nextcloud and Airsonic to manage the same music folder located within Nextcloud’s data directory? Thanks!
Try to add Airsonic to the www-data group:
usermod -aG www-data airsonic
Thanks for your help, Airsonic still says the folder isn’t found though. Any other ideas?
Hmm I guess the hardcoded dietpi group from Airsonic breaks the supplementary groups. So we have to set Airsonic primary group to dietpi system-wide and skip the hardcode within the systemd unit.
I’ll come back to you later about how to do that.
usermod -g dietpi -aG airsonic,www-data,audio airsonic
sed -i '/^Group=/d' /etc/systemd/system/airsonic.service
systemctl restart airsonic
Great, it sees the directory and works perfectly now!
I’m just curious if you might have some time to explain what exactly the problem was and how this solves it, I’d love to learn more about it if possible. In any case, thank you very much for your help!
Okay I think this is something we should do generally for services/programs which require access to downloads and/or media files and as well need to create files with “dietpi” group to allow other services access those the same way. I opened an issue to apply this with v6.28: https://github.com/MichaIng/DietPi/issues/3235