OwnCloud : preferred data configuration

Status
Not open for further replies.

Thomas_VDB

Contributor
Joined
Sep 22, 2012
Messages
102
Hi,
I've been a long time user of FreeNAS. We are using it as a normal NAS. It has a single volume, shared with a CIFS share. Multiple PC's are accessing it here at home.
Now I've installed the OwnCloud plugin, hoping to be able to access my data externally.
I've set up dyndns and owncloud, and can access OwnCloud externally.
The trouble that I'm having is making the data already on the NAS, available in OwnCloud.
What is the preferred way to do this (without starting from scratch)?

I've tried the 'add storage' feature but this didn't work (dis not see my data). Also installed the 'External storage support' app. It worked but all my data was read-only.

So what is the preferred way of getting my data in Owncloud, so that I can keep working with my network drives, and I can use owncloud to use my data externally?

Thx!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
The plugin has owncloud's data directory at /media so by default your owncloud user's files will reside under there. But owncloud was not designed to allow other programs to edit these files directly. Changes to files in owncloud's data-directory will not be noticed by owncloud and can cause issues.

You should be using the 'External storage support' owncloud app to add any shares/directorys that will be modified by other methods then through owncloud. So you sounds like you already got most of the way there by doing the following.
* Add storage to add your dataset/folder into the jail, somewhere other then /media, like /mnt/files
* Use the 'External storage support' app to map the previously mounted storage for your desired owncloud user(s)

Now regarding permissions the owncloud program runs as the www user with UID=80.
Files need to be writable for this user. See here
https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/
- I suggest you either change the owner of the files (Solution #1) or add the www user to the group that owns the files (Solution #3).
 

Thomas_VDB

Contributor
Joined
Sep 22, 2012
Messages
102
Hi,

I succesfully added storage and mounted this external folder in OwnCloud.
Then I used the freeNAS GUI to change permissions for both my datavolume and the owncloud_1 jail. For both I've set the owner(user) to the built-in www account.
However when opening a file from within owncloud, it is still read-only.
What can I be doing wrong? Should I set the recursive checkbox?

upload_2016-10-16_10-0-6.png
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
dont do that, you are about the break your jails. never change permission on your jail datasets, those are operating system files that will not work properly if they are modified.

what dataset contains the files you are sharing? and dont say a folder in your jail... you should make dataset(s) for you share that you mount into your jail.
 

Thomas_VDB

Contributor
Joined
Sep 22, 2012
Messages
102
Hi, As you can see in my previous screenshot, 'DataMirror' is the volume that I am using. It has a Dataset, also called 'Datamirror'. On that dataset, there is a folder called 'Data' that I have shared via CIFS.
I have changed the owner of the 'Datamirror' dataset to www (recursively).
Can you please advise?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Well if you changed the permissions recursively the files at /mnt/DataMirror/DataMirror/Data should be writable by the www user.
You can run the following to show the permissions...
Code:
ls -l /mnt/DataMirror/DataMirror/Data


I assume your owncloud plugin will no longer work if you restart the jail. You should have made Data a dataset not a folder so you could change the permission for just 'Data' without possibly messing up your jail.
 
Joined
Aug 8, 2016
Messages
4
Another option would be to connect to your storage via SMB/CIFS. I would recommend to use Nextcloud instead of owncloud because it is more secure and has more features. It specifically has the smb connector as open source which is proprietary in owncloud. With this connector this integration should be very easy.
 

Thomas_VDB

Contributor
Joined
Sep 22, 2012
Messages
102
Hi,
I can't make it work. I started from scratch (uninstalled and reinstalled the owncloud plugin).
1. I added storage into the owncloud jail (/mnt/files)
upload_2016-10-22_12-23-23.png

2. I used the external storage support app to mount my dataset into this directory.
upload_2016-10-22_12-25-43.png

3. For the permissions :
- I am sharing the a directory on the dataset via CIFS/SMB, so that the Windows user can map a network drive to this share.
In order that they do not need to log in, I created for every Windows-user, a FreeNAS user with the same accountname and password.
I've put all these FreeNAS-users in a new FreeNAS group called (called 'thuis') and made this group the group owner of the dataset.
- I've made the existing www user the owner of the dataset, and added www also to the 'thuis'-group.
upload_2016-10-22_12-30-21.png

- So Now I can see my files from within owncloud, but they are still read-only.
Can somebody advise on this? (plse step by step)?
Thx!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
If you read the FACTS section of the thread I linked, it states that permissions for the plugin process are governed according to the jail's user/group mapping.
In the owncloud_1 jail, the www user must be in a group with a GID matching the "thuis" group.
See 'Solution 3'

EDIT
The above is if you want to use group permissions. But now that I look at your permission settings, the www user should have user permissions to write to those files.
Can you should the output of the following run in the owncloud_1 jail.
Code:
ls -l /mnt/files
 

Thomas_VDB

Contributor
Joined
Sep 22, 2012
Messages
102
[QUOTE="Can you should the output of the following run in the owncloud_1 jail.
Code:
ls -l /mnt/files
[/QUOTE]


upload_2016-10-23_9-54-29.png


Thx for your support!
Thomas.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
according to Unix permissions those files are writable by the www user, but you have widows ACLs enabled on the files (see the +). that is likely adding more requirements to writing to the files. I dont know anything about windows ACLs, goodluck.
 

Thomas_VDB

Contributor
Joined
Sep 22, 2012
Messages
102
Hi,
I was able to delete the ACLs using this command :
find /directory/with/your/files -exec setfacl -b {} \;

This resulted in no more + characters in the permissions column.

However this also resulted in read-only access on my SMB-shared Dataset.

Then I was able to fix this by enabling the 'Apply Default permissions' checkbox on my SMB-share.
upload_2016-10-23_19-6-44.png


And this resulted back in the ACLs (+ characters).

Can you please advise? I think I should be able to have write permissions without applying the Windows default ACLs?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
im not experienced at all how windows ACLs work. what I have implemented in the past for other peoples networks is adding 'force user = USER' to the auxiliary parameters of a CIFS share.
this allows writing but doesn't provide authentication, though I believe you could do that at the CIFS level.
 
Status
Not open for further replies.
Top