NextCloud Plugin and saving files through webdav

Chett

Dabbler
Joined
Feb 2, 2019
Messages
10
Hello,

Any help appreciated. I have 2 questions.

Setup: Do i need to to setup my pool/share within freenas as a webdav before I even start configuring nextcloud which will be setup for webdav as well?
I currently have my share in freenas setup as SMB so that another server can access the drive shares over the lan, however we need our office to to access using
webdav when they connect to nextcloud. Or can I setup my freenas as a SMB share and all the webdav configuration is done through nextcloud? Are these
two products independent of each other?

Usage: How do I setup webdav so say word documents can be saved back on the share remotley?

My freenas installation is not under a linux distro it was installed from a freenas iso if that helps as I understand freenas under a linux distro requires many other things.

Thank You so much.
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi Chett,

Nextcloud is doing its own Webdav. As such, you do not need to configure your FreeNAS for that. All Nextcloud needs is file access to store the files itself. Here, I run Nextcloud in a docker from a separate host. For that, Nextcloud reaches FreeNAS storage over NFS. I do not use the Nextcloud plugin from FreeNAS, but I trust that it does not even needs NFS and can do direct file access.

Also, I recommend you not to bypass Nextcloud.

For data that you wish to manage using Nextcloud, have people handle that content with Nextcloud. Nextcloud keeps a lot of info in its database and if you access the backend directly, you will de-sync that database. It is possible to manually re-sync it, but to permanently break-N-fix is not a good way to work.

For people to access their content from Nextcloud, they can have the Nextcloud desktop client installed in their computer. The client will sync a copy of their files locally and will propagate changes both ways. Users can also use Nextcloud Web interface where you have tools like OnlyOffice, Draw.IO and more.

You said that your FreeNAS is not a linux distro... Well... Know that FreeNAS is based on FreeBSD... For you to mention that suggests that you do not fully master your environment. Know that FreeNAS is simple enough to use, but it is also powerful enough to do a lot of damage. Also, when not used properly, not only will FreeNAS not protect your data, it can aggravate the risk of loosing it.

I would really recommend you to do a lot more test and learning in a dev environment where you can loose everything without any consequence. You need to understand the basic of FreeNAS, from its operating system to ZFS, its sharing services to its plugins, from its own handling of data like snapshots to the need for real backups and more.

Have fun learning FreeNAS,
 

Chett

Dabbler
Joined
Feb 2, 2019
Messages
10
Thanks for responding.
Poor choice of words on my part, what I meant and said I think that freenas was not installed under ubuntu or any other linux distro
but rather standalone as installing it under say like ubuntu requires other things to be done as I have experienced.
 

Chett

Dabbler
Joined
Feb 2, 2019
Messages
10
People are accessing the nextcloud files through a mac on their finder. None are using a client.
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi again Chett,

Good you know that FreeNAS is not an application to install in a Linux distro :smile:

The Mac users can also use the Desktop client. They will keep accessing the files using Finder. It's just that instead of breaking the sync between the backend and the frontend all day long, the desktop client will ensure everything will go through the frontend.

To bypass Nextcloud and reach its backend directly is asking for trouble, so I really recommend you to respect the Nextcloud architecture. Go through the Frontend. You can do it with desktop clients, web, mobile apps and standards protocoles and interfaces likes Carddav, Caldav, Webdav, ...
 

Chett

Dabbler
Joined
Feb 2, 2019
Messages
10
Understood. Thanks so much. based on what you said on your first post, I am now contemplating setting up nextcloud on one of my other servers and having nextcloud get to the freenas share using nfs or smb. Not sure if that topology is going to slowdown the remote users from seeing the data or not because of latency. May I ask what linux distro you are using on your nextcloud box. I really dont want to use ubuntu again as it was a pain, maybe because I was using 18.10 vs 18.04 LTS who knows. My data I am sharing is a backup of a backup so if I destroy it testing I have multiple backups. This is not production yet just testing, but I think you are on the right track at least for me that putting nextcloud on a seperate host and not use the "problematic" freenas plugin......now what distro to use for nextcloud...hmm...
 

Chett

Dabbler
Joined
Feb 2, 2019
Messages
10
oh by the way, the shares only have word documents and pdf files. Not streaming media or anything like that.
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi,

You do not have to worry about the speed. This is exactly what the database is for. The file inventory is kept in the database and whenever the content of a file is needed, then only will Nextcloud go to its backend to get the content.

I am running the official Docker container by Nextcloud. My Docker engine is running from Alpine Linux.

What I did is :
Created an Alpine Linux VM in my ESXi server
Configured it (things like adding VMTools, setting the timezone, network, ...)
Map the storage over NFS from FreeNAS to /mnt/backend
Installed Docker in that Alpine Linux VM
Created a volume for the database
installed a MariaDB container in Docker, using the volume to save the databases (to survive container updates..._
Created 4 Docker volumes (Apps ; Root ; Config ; Themes) ; again, to survive container updates
Created the Nextcloud container, mapping volumes like this :
Apps : /var/www/html/custom_apps
Root : /var/www/html
Config : /var/www/html/config
Themes : /var/www/html/themes
/mnt/backend : /var/www/html/data
Run the Nextcloud container
Connect it to the MariaDB container instead of using the default SQLite local database.

Be sure to adjust file and directory ownership for the proper UID used by Nextcloud (uid 33).

Good luck setting your own server,
 

Chett

Dabbler
Joined
Feb 2, 2019
Messages
10
Sweet! Thanks so much. I have been reading about containers and its very promising. I will setup a vm and study how it works first.
I have 3 esxi boxes here so I can mess around and get familiar with it. In the meantime I will leave freenas where it is, on a Dell R710 and properly configure it there as discussed. It was running perfectly by itself but since I was tweaking I had changed some things, so I factory reset it and imported my existing pool again. I have learned/gleaned from our discussion that putting the nextcloud plugin on it is not the best scenario and I think the nextcloud plugin is a scaled down version of what is downloaded. Again thanks so much. you are very gracious.
 

Chett

Dabbler
Joined
Feb 2, 2019
Messages
10
May I ask how you mapped the NFS drive on the nextcloud GUI? There does not seem to be an option to do that. My Freenas box is now a separate box and next cloud is on another system. File services are setup on freeness as NFS, just a matter of connecting next cloud over to it.
Thanks
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi Chett,

Here, I did not mounted the NFS share from Nextcloud as external storage. I did it from Alpine and did a local re-map from Alpine to the Docker container for NC to access the content.

So first step is to install the NFS client tools in Alpine (If I remember, the package is named nfs-common. If that one is not enough, there may be one named nfs-client also that you would need...).

Once the package is installed in Alpine, it will be able to mount NFS shares from outside like your FreeNAS.

Here, in my FreeNAS, I created a dataset for my Nextcloud data. In that dataset, I created a first folder called NFSRoot. It is that one that I shared over NFS. The goal is not to share the hidden folder hosting the snapshots. I also changed ownership of NFSRoot to UID=33 ; GID=33. To create the UID and GID, I had to use the legacy interface because the new one did not let me use number 33.

To mount the share, you need to access a few ports from your Alpine Linux to Nextcloud. If there is a firewall between the two, you will need these ports open.

Once the share is mounted in Alpine in a place like /mnt/backend, you configure your container to re-map that /mnt/backend as /var/www/html/data

Once done, NC will do its file access considering all these files are local when in fact, they are remote. NC will not be aware of anything, will not be equipped with the required program to mount NFS itself, etc.

Hope that helps you understand the setup a little better,
 
Top