[How-To] Giving Plugins Write Permissions to Your Data

Status
Not open for further replies.

xv1nx

Cadet
Joined
Jan 9, 2016
Messages
6
Hi guys,
i am trying to share my data from Freenas 9.3 with my owncloud.
With the Freenas GUI i added a Storage into owncloud. Then i connect to owncloud via SSH and change the permission for the mount folder to 777. I event changed the owner of the mount point to www:www, but owncloud still can't see the data.
What am i missing?

Update 1:
if i create an folder via brower, the owner of it is www and group of owner is www. So i changed my data folder to owner www, but owncloud still doesn't show me my data.

my system:
OS: Freenas 9.3
owncloud with nginx, MySQL, PHP55.
Installed with this guide: http://www.tinkertailorsoldiersponge.com/blog/2014/08/11/owncloud-on-freenas-9-2

Thanks in advance,
Vince
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi guys,
i am trying to share my data from Freenas 9.3 with my owncloud.
With the Freenas GUI i added a Storage into owncloud. Then i connect to owncloud via SSH and change the permission for the mount folder to 777. I event changed the owner of the mount point to www:www, but owncloud still can't see the data.
What am i missing?

Update 1:
if i create an folder via brower, the owner of it is www and group of owner is www. So i changed my data folder to owner www, but owncloud still doesn't show me my data.

my system:
OS: Freenas 9.3
owncloud with nginx, MySQL, PHP55.
Installed with this guide: http://www.tinkertailorsoldiersponge.com/blog/2014/08/11/owncloud-on-freenas-9-2

Thanks in advance,
Vince
this isn't a permission related issue.

how are you trying to add the folder to owncloud?
are you trying to use it as your owncloud's data-directory (which you shouldn't need with files directly).
Or are you trying to have a directory where you can edit files? the only proper way to do this is to you the external storage mount plugin
 

xv1nx

Cadet
Joined
Jan 9, 2016
Messages
6
this isn't a permission related issue.

how are you trying to add the folder to owncloud?
are you trying to use it as your owncloud's data-directory (which you shouldn't need with files directly).
Or are you trying to have a directory where you can edit files? the only proper way to do this is to you the external storage mount plugin

Freenas:
....... - usr
....... ..
....... - mnt/NAS/
............. o Photos
............. o Documents
............. o jails/owncloud/...
............. o ownCloud_Data

ownCloud:
....... - usr
....... - mnt
....... - myData/
.............. o user/files/ << Mount Point for ownCloud_Data

I want to mount ownCloud_Data into /myData/user/files, or even one folder behind folder files if needed.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Freenas:
- usr
..
- mnt/NAS/
o Photos
o Documents
o jails/owncloud/...
o ownCloud_Data

ownCloud:
- usr
- mnt
- myData/
o user/files/ << Mount Point for ownCloud_Data

I want to mount ownCloud_Data into /myData/user/files, or even one folder behind folder files if needed.
that's not the proper way, either make the whole data-directory a mountpoint (for snapshot / backup purposes) or mount your dataset somewhere else like /mnt/files and use the external storage mount owncloud app to access the files.
if you mess with files that are directly in owncloud's data-directory owncloud won't notice the change and will not update it's own metadata about the file.
 

xv1nx

Cadet
Joined
Jan 9, 2016
Messages
6
that's not the proper way, either make the whole data-directory a mountpoint (for snapshot / backup purposes) or mount your dataset somewhere else like /mnt/files and use the external storage mount owncloud app to access the files.
if you mess with files that are directly in owncloud's data-directory owncloud won't notice the change and will not update it's own metadata about the file.
Ahh nice to know. I tried to use myData folder as the whole data-directory for owncloud. But the owncloud server doesn't start because it doesn't have the permission.

Do you have a guide where i can follow?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ahh nice to know. I tried to use myData folder as the whole data-directory for owncloud. But the owncloud server doesn't start because it doesn't have the permission.

Do you have a guide where i can follow?
'chown -R www:www /path/to/mountpoint' should allow you to do this. but do remember you still should access these files in any way other than through freenas.
If you do need to access files a different way then just use the owncloud app I mentioned which assumes the storage is also being changed and is rescanned by owncloud.


yup, here it is.
https://forums.freenas.org/index.php?threads/how-to-owncloud-using-nginx-php-fpm-and-mysql.17786/
 

xv1nx

Cadet
Joined
Jan 9, 2016
Messages
6
Hi Joshua,
thank you very much for all your efforts. I gived your guide a try, but it doesn't seem to solve the problem (or i still did it wrong).

owncloud stil doesn't recognize if i manually add something via ssh into data folder.
do i have to do anything to tell mysql, that something is changed in the data folder?

This is my system:
----- oDatabase: folder contains mysql database (owner is root:wheel)
----- oFiles: folder contains my data (owner is www:www)

ScreenShot2016-01-14at23.32.23.png
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Joshua,
thank you very much for all your efforts. I gived your guide a try, but it doesn't seem to solve the problem (or i still did it wrong).

owncloud stil doesn't recognize if i manually add something via ssh into data folder.
do i have to do anything to tell mysql, that something is changed in the data folder?

This is my system:
----- oDatabase: folder contains mysql database (owner is root:wheel)
----- oFiles: folder contains my data (owner is www:www)

ScreenShot2016-01-14at23.32.23.png
what you are doing is correct for backup/snapshots of your owncloud instance but is not the way to be able to add/change files externally.
to do this you must use the owncloud add "external storage mounts"
* create a second dataset, mount it into your jail somewhere like /mnt/files2
* install the app, configure it to access /mnt/files2

https://doc.owncloud.org/server/8.2/admin_manual/configuration_files/external_storage_configuration_gui.html
 

xv1nx

Cadet
Joined
Jan 9, 2016
Messages
6
what you are doing is correct for backup/snapshots of your owncloud instance but is not the way to be able to add/change files externally.
to do this you must use the owncloud add "external storage mounts"
* create a second dataset, mount it into your jail somewhere like /mnt/files2
* install the app, configure it to access /mnt/files2

https://doc.owncloud.org/server/8.2/admin_manual/configuration_files/external_storage_configuration_gui.html

i tried to follow your guide line. But i am not able to add storage. FTP and SMB is not installed or not activated.
i have searched in owncloud appstore for FTP or SMB clients, but no result. Then i found your comment in the picture below and followed it. I couldn't compile libsmbclient-php, because at the configuration step, the header libsmbclient-php.h is missing.
I also add user_backend in the config.php file following this manual https://doc.owncloud.org/server/7.0/admin_manual/configuration/user_auth_ftp_smb_imap.html .
For my bad this doesn't lead to success.

Can you please help me, thanks in advance.

wqb6jf9e.png

--------------------
ScreenShot2016-01-16at02.10.41.png
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
i tried to follow your guide line. But i am not able to add storage. FTP and SMB is not installed or not activated.
i have searched in owncloud appstore for FTP or SMB clients, but no result. Then i found your comment in the picture below and followed it. I couldn't compile libsmbclient-php, because at the configuration step, the header libsmbclient-php.h is missing.
I also add user_backend in the config.php file following this manual https://doc.owncloud.org/server/7.0/admin_manual/configuration/user_auth_ftp_smb_imap.html .
For my bad this doesn't lead to success.

Can you please help me, thanks in advance.

wqb6jf9e.png

--------------------
ScreenShot2016-01-16at02.10.41.png
You should be using the "Local" 'External storage' type. Why are you following that link for ownCloud 7? Use the link I gave for the 8.2 docs, and use local storage.
 

xv1nx

Cadet
Joined
Jan 9, 2016
Messages
6
Thanks for your help. I didn't realize, that i have to include external storage in setting page, not in personal page.
 

brageo

Cadet
Joined
Jan 20, 2016
Messages
1
I changed the user that run Emby-server to media per solution no:2 (Emby installed from plug-ins)

Worked perfekt an now all my "important" plug-ins runs as media:media

My question is this:

Do the user and group for Emby-server revert do the plug-in default if i update?


BTW: THIS IS A GREAT FORUM TREAD
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I changed the user that run Emby-server to media per solution no:2 (Emby installed from plug-ins)

Worked perfekt an now all my "important" plug-ins runs as media:media

My question is this:

Do the user and group for Emby-server revert do the plug-in default if i update?


BTW: THIS IS A GREAT FORUM TREAD
good question. i don't think so since the setting in /etc/rc.conf isn't overwritten
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
I'm having issues with #2 from Solution 2 )

I don't use a plugin, I have PlexMediaServer-PlexPass installed from ports in a standard jail.
I tried using all of the following but none work:
chown -R plexuser:wheel /var/db/plexmediaserver
chown -R plexuser:wheel /var/db/plexmediaserver-plexpass
chown -R plexuser:wheel /var/db/plexmediaserver_plexpass

it returns "No such file or directory" no matter which one I try. Though typically plexmediaserver_plexpass is the proper, at least that is what I had to type to install using pkg. I would assume these instructions aren't limited to just plugin versions?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm having issues with #2 from Solution 2 )

I don't use a plugin, I have PlexMediaServer-PlexPass installed from ports in a standard jail.
I tried using all of the following but none work:
chown -R plexuser:wheel /var/db/plexmediaserver
chown -R plexuser:wheel /var/db/plexmediaserver-plexpass
chown -R plexuser:wheel /var/db/plexmediaserver_plexpass

it returns "No such file or directory" no matter which one I try. Though typically plexmediaserver_plexpass is the proper, at least that is what I had to type to install using pkg. I would assume these instructions aren't limited to just plugin versions?
the pkg doesn't use the same path. I think the path would be /usr/local/plexdata
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
the pkg doesn't use the same path. I think the path would be /usr/local/plexdata

Thanks. I think it sorta worked. It let me issue the commands (although it was /usr/local/plexdata-plexpass for the path). However, it's still not working for me. I hate permissions as they always seem to create issues for me. My plex is pulling in everything from my TV shows folder, but won't pull anything from my Movies. I've double checked the jail storage and everything is setup properly.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks. I think it sorta worked. It let me issue the commands (although it was /usr/local/plexdata-plexpass for the path). However, it's still not working for me. I hate permissions as they always seem to create issues for me. My plex is pulling in everything from my TV shows folder, but won't pull anything from my Movies. I've double checked the jail storage and everything is setup properly.
ls -l /path/to/media might give some clues
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
ls -l /path/to/media might give some clues

The permissions are all the same, though it does show that the Movies folder has no files, but I have CIFS setup to access the share and have copied a few movies in from another machine. So it is definitely not empty.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
The permissions are all the same, thought it does show that the Movies folder has no files, but I have CIFS setup to access the share and have copied a few movies in from another machine. So it is definitely not empty.
I'm wondering if you have a "+" on your permissions which means you have windows ACLs for those files.
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
I'm wondering if you have a "+" on your permissions which means you have windows ACLs for those files.

I'm not sure what that even means or what that would entail in regards to fixing the issue. The other issue I just ran into though is it seems the path in regards to the CHOWN -R command I referenced previously is different. SABnzbd plugin for example is not /var/db/sabnzbd, nor do I believe usr/local has anything either.
 
Status
Not open for further replies.
Top