External storage and samba share

Hi all

Using instructions on this website and a few others, I’ve install Nextcloud on a Dell server with ubuntu 16.04. I’ve added an external folder storage to nextcloud from the admin GUI (directory is /srv/samba/cabinet). This directory is also shared on local network with samba. It is stored on the ubuntu server.
My problem is : I want the folder to be accessible, readable and writable to www-data so that users can access it and modify files from next cloud client when they’re not on the same lan as the server, and I want the samba share to work at the same time, so that users can modify files from computers on the lan not using next cloud but windows explorer.

So far i’ve managed to share the directory with samba, and make it accessible from next cloud, but it is read only on nextcloud GUI.
I created another folder to run tests (/home/sam/partage), added it to nextcloud as external storage, shared it with samba, changed ownership to www-data : this way the folder is writable on nextcloud GUI but not with nautilus on the ubuntu server or from the others computer on the lan.

Is my problem clear enough ?
Is there a way I could set permissions/ownership so that both nextcloud and local users could read and write to the folder ?

1 Like

I have setup NextCloud 16.x and I want to have have my network share that is on the same network mapped and indexed by nextcloud. How can I go about doing this?

you are the only user or is it a team server?

if you are the only user:

  • create a smb share on the server. you have to configure it that way, that all files on linux are mapped to www-data (or your webserver user).
  • configure your system (php, webserver, selinux) that this folder is accessible
  • configure this folder as external storage in your nextcloud.

if it’s a team server:

  • you have to share this folder among the team

here is an article in german about this. maybe you pick the php settings from it.

Is there a way to have Nextcloud creating files with a certain umask, so that it would be possible with e.g. umask 007 to add the samba user to the www-data group and the otherway round to grant cross R/W access? The Samba share can be configured with certain umask.

This would be the safest approach then.

If Nextcloud is the only website on this webserver, then it can be configured on webserver and/or PHP level by setting this umask within the systemd units, I guess, but having it set Nextcloud internally would be quite handy.