Airsonic Directory Permissions with Nextcloud

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
808dot
Posts: 4
Joined: Fri Nov 08, 2019 11:32 am

Airsonic Directory Permissions with Nextcloud

Post by 808dot »

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!
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: Airsonic Directory Permissions with Nextcloud

Post by MichaIng »

Try to add Airsonic to the www-data group:
usermod -aG www-data airsonic
808dot
Posts: 4
Joined: Fri Nov 08, 2019 11:32 am

Re: Airsonic Directory Permissions with Nextcloud

Post by 808dot »

Thanks for your help, Airsonic still says the folder isn't found though. Any other ideas?
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: Airsonic Directory Permissions with Nextcloud

Post by MichaIng »

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.
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: Airsonic Directory Permissions with Nextcloud

Post by MichaIng »

Code: Select all

usermod -g dietpi -aG airsonic,www-data,audio airsonic
sed -i '/^Group=/d' /etc/systemd/system/airsonic.service
systemctl daemon-reload
systemctl restart airsonic
808dot
Posts: 4
Joined: Fri Nov 08, 2019 11:32 am

Re: Airsonic Directory Permissions with Nextcloud

Post by 808dot »

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!
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: Airsonic Directory Permissions with Nextcloud

Post by MichaIng »

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
Post Reply