Nextcloud / Owncloud, problem with mount External Storage

Zofoor

Patron
Joined
Aug 16, 2016
Messages
219
Hi all!
Today I had successfully installed nextcloud on a new jail, following this tutorial
https://forums.freenas.org/index.php?threads/how-to-owncloud-using-nginx-php-fpm-and-mysql.17786/

The problem now is a little tricky.

I have some folders that are based on CIFS windows permissions. There is a folder for each user, and only that user can access it.

root@nextcloud:/mnt/private # ls -la
total 3
drwxrwxr-x+ 4 root wheel 5 Sep 8 21:58 .
drwxr-xr-x 5 root wheel 5 Sep 9 14:46 ..
-rwxrwxr-x+ 1 root wheel 0 Sep 5 13:53 .windows
drwxrwxr-x+ 2 root User1 2 Sep 8 21:58 User1
drwxrwxr-x+ 2 root User2 2 Sep 9 14:52 User2


Inside each folder, the owner is UserX:UserX. So there is a group with the same name of the users.
This works great becouse in that way each user can access to his own directory, and cannot access to others.

So, I have mounted that folders using JAIL mount from the freenas interface. Then I have created in the jail a group with same ID and GroupName of freenas, and I have added these groups on the jail to both www and root user. Basically what I have do is the solution 3 linked here: https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/

JAIL:
root@nextcloud:/mnt/private # cat /etc/group | grep -i User1
User1:*:1003:www,root

FREENAS:
[root@freenas] ~# cat /etc/group | grep -i User1
User1:*:1003:User1


From windows I see that the permissions on the files are correct (both User1 and the group called User1 has all permissions on each file/folder that is inside the private/User1 folder).

The problem is that if I write from the jail ls User1\ I don't see any file/folder. So, of course also adding these folders on the nextcloud external storage results in a problem.

root@nextcloud:/mnt/private # ls -la User1/
total 1
drwxrwxr-x+ 2 root User1 2 Sep 9 14:52 .
drwxrwxr-x+ 4 root wheel 5 Sep 8 21:58 ..


I think that I miss a stupid thing, but I cannot find how to make that working... Any idea?


JAIL
[root@freenas] ~# getfacl /mnt/main_volume/private/User1/
# file: /mnt/main_volume/private/User1/
# owner: User1
# group: User1
owner@:rwxpDdaARWcCo-:fd-----:allow
group@:rwxpDdaARWcCo-:fd-----:allow

FREENAS
root@nextcloud:/mnt/private # getfacl User1/
# file: User1/
# owner: root
# group: User1
owner@:rwxpDdaARWcCos:fd----I:allow
group@:rwxpDdaARWcCos:fd----I:allow
everyone@:r-x---a-R-c---:fd----I:allow


PS: I don't want to chage owners of the files/folder.
PPS: I have also rebooted the jail thinking that perhaps was a problem with some cached data of the http server or something like that.
PPPS: I have also tried using samba configuration on nextcloud extenal storage plugin, but in that way also didn't worked
 
Last edited:

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Can you provide a screenshot of your jail setup? Especially the mounted storage.
 

Zofoor

Patron
Joined
Aug 16, 2016
Messages
219
Sure!

Jail mounts:
HgGblkn.png


Storage:
5vLwnsG.png


Permissions:
kmNBMee.png


Permissions showed from windows:
19wWzJR.png


Configuration of the mount on Nextcloud interface:
hz1GRRb.png


PS: as you could note, user/group names of my first post are different, I had edited them before posting to be more "generic names"
 
Last edited:

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Something that's weird is that your getfacl results show different owners from FreeNAS and from within the jail, and I'm pretty sure that shouldn't be the case.

Can you run that again from both? Also, can you provide "ls -la" for both inside the jail and FreeNAS?

EDIT: I realize your problem: you're using sub datasets for the users. You'll need to add those datasets as well to the jail storage.
 

Zofoor

Patron
Joined
Aug 16, 2016
Messages
219
Something that's weird is that your getfacl results show different owners from FreeNAS and from within the jail, and I'm pretty sure that shouldn't be the case.

Can you run that again from both? Also, can you provide "ls -la" for both inside the jail and FreeNAS?

EDIT: I realize your problem: you're using sub datasets for the users. You'll need to add those datasets as well to the jail storage.

Really? Oh, I was going mad for a so stupid thing, didn't know that a mount is needed if inside a dataset there is another! Well, there is always time to learn something.

Thank you very much, you have made me very very happy! :)
 

seedz

Dabbler
Joined
May 2, 2018
Messages
39
damn, i was searching for the exact same thing...
too bad the "home directory" setting generates sub datasets, and not just folders, as it could have been a really neat automated user directory creation process :/
 
Top