Accessing GreenAnt Nest Files Using WebDAV

Nest fully supports the WebDAV protocol, you can connect and synchronize with your Nest files over WebDAV. In this chapter you will learn how to connect Linux, Mac OS X, Windows, and mobile devices to your Nextcloud server via WebDAV. Before we get into configuring WebDAV, let’s take a quick look at the recommended way of connecting client devices to your files.

Nextcloud Desktop and Mobile Clients

The recommended method for keeping your desktop PC synchronized with GreenAnt Nest is by using the Nextcloud/ownCloud sync clients. You can configure the client to save files in any local directory you want, and you choose which directories on GreenAnt Nest to sync with. The client displays the current connection status and logs all activity, so you always know which remote files have been downloaded to your PC, and you can verify that files created and updated on your local PC are properly synchronized with the server.

The recommended method for syncing your GreenAnt Nest files with Android, Apple iOS, and SailfishOS devices is by using the mobile apps.

To connect to your GreenAnt Nest Account with the mobile apps, use the base URL and folder only:

https://nest.greenant.net

In addition to the mobile apps provided by Nextcloud, you can use other apps to connect to GreenAnt Nest from your mobile device using WebDAV. WebDAV Navigator is a good (proprietary) app for Android devices and iPhones. The URL to use on these is:

https://nest.greenant.net/remote.php/dav/files/USERNAME/

WebDAV Configuration

If you prefer, you may also connect your desktop PC to your GreenAnt Nest account by using the WebDAV protocol rather than using a special client application. Web Distributed Authoring and Versioning (WebDAV) is a Hypertext Transfer Protocol (HTTP) extension that makes it easy to create, read, and edit files on Web servers. With WebDAV you can access your files on Linux, Mac OS X and Windows in the same way as any remote network share, and stay synchronized.

Accessing Files Using Linux

You can access files in Linux operating systems using the following methods.

Nautilus File Manager

Use the davs:// protocol to connect the Nautilus file manager to your GreenAnt Nest share:

davs://nest.greenant.net/remote.php/dav/files/USERNAME/

screenshot of configuring Nautilus file manager to use WebDAV

Accessing Files with KDE and Dolphin File Manager

To access your GreenAnt Nest files using the Dolphin file manager in KDE, use the webdav:// protocol:

webdav://nest.greenant.net/remote.php/dav/files/USERNAME/

screenshot of configuring Dolphin file manager to use WebDAV

You can create a permanent link to GreenAnt Nest:

  1. Open Dolphin and click “Network” in the left hand “Places” column.
  2. Click on the icon labeled Add a Network Folder. The resulting dialog should appear with WebDAV already selected.
    • If WebDAV is not selected, select it.
    • Click Next.
  3. Enter the following settings:
    • Name: The name you want to see in the Places bookmark, for example "GreenAnt Nest".
    • User: The GreenAnt Nest USERNAME you used to log in, for example myuser@greenant.net.
    • Server: The Nextcloud domain name, for example nest.greenant.net (without https:// before or directories afterwards).
    • Folder – Enter the path remote.php/dav/files/USERNAME/.
    • (Optional) Check the “Create icon checkbox” for a bookmark to appear in the Places column.
    • (Optional) Provide any special settings or an SSL certificate in the “Port & Encrypted” checkbox.

Creating WebDAV Mounts on the Linux Command Line

You can create WebDAV mounts from the Linux command line. This is useful if you prefer to access GreenAnt Nest the same way as any other remote filesystem mount. The following example shows how to create a personal mount and have it mounted automatically every time you log in to your Linux computer.

Install the davfs2 WebDAV filesystem driver, which allows you to mount WebDAV shares just like any other remote filesystem. Use this command to install it on Debian/Ubuntu:

apt-get install davfs2

Use this command to install it on CentOS, Fedora, and openSUSE:

yum install davfs2

Add yourself to the davfs2 group:

usermod -aG davfs2 <username>

Then create an nest directory in your home directory for the mountpoint, and .davfs2/ for your personal configuration file:

mkdir ~/nest
mkdir ~/.davfs2

Copy /etc/davfs2/secrets to ~/.davfs2:

cp  /etc/davfs2/secrets ~/.davfs2/secrets

Setyourself as the owner and make the permissions read-write owner only:

chown <username>:<username>  ~/.davfs2/secrets
chmod 600 ~/.davfs2/secrets

Add your GreenAnt Nest login credentials to the end of the secrets file, using your GreenAnt Nest server URL and your Nest username and password:

nest.greenant.net/remote.php/dav/files/USERNAME/ <username> <password>

Add the mount information to /etc/fstab:

nest.greenant.net/remote.php/dav/files/USERNAME/ /home/<username>/nest
davfs user,rw,auto 0 0

Then test that it mounts and authenticates by running the following command. If you set it up correctly you won’t need root permissions:

mount ~/nest

You should also be able to unmount it:

umount ~/nest

Now every time you login to your Linux system your GreenAnt Nest share should automatically mount via WebDAV in your ~/nest directory. If you prefer to mount it manually, change auto to noauto in /etc/fstab.

Known Issues

Problem

Resource temporarily unavailable

Solution

If you experience trouble when you create a file in the directory, edit /etc/davfs2/davfs2.conf and add:

use_locks 0

Accessing Files Using Mac OS X

To access files through the Mac OS X Finder:

  1. Choose Go > Connect to Server.

    The “Connect to Server” window opens.

  2. Specify the address of the server in the Server Address field.

Screenshot of entering your Nextcloud server address on Mac OS X

For example, the URL used to connect to the Nextcloud server from the Mac OS X Finder is:

https://nest.greenant.net/remote.php/dav/files/USERNAME/

Screenshot of entering your Nextcloud server address on Mac OS X

  1. Click Connect.

    The device connects to the server. For added details about how to connect to an external server using Mac OS X, check the vendor documentation

Accessing Files Using Microsoft Windows

It is possible to access your files via WebDAV using the native Windows client or a third-party client, a comparison of clients is shown here. While the Windows native client will work for accessing shares, we generally recommend using Cyberduck as it provides faster access and an easier to use interface. The native windows client can also have difficulties re-connecting to WebDAV shares which can be quite difficult to debug.

Accessing Files Using Cyberduck

Cyberduck is an open source FTP and SFTP, WebDAV, OpenStack Swift, and Amazon S3 browser designed for file transfers on Mac OS X and Windows.

Note

This example uses Cyberduck version 6.1.0 on Windows 7 Ultimate.

To use Cyberduck:

  1. Download and install Cyberduck from https://cyberduck.io/?l=en
  2. Specify a server without any leading protocol information. For example:
     nest.greenant.net
    
  3. Specify the appropriate port. As all GreenAnt services are encrypted, we use the SSL port:
     443 (for WebDAV (HTTPS/SSL))
    
  4. Use the More Options drop-down menu to add the rest of your WebDAV URL into the Path field. For example:
     remote.php/dav/files/USERNAME/
    

cyberduck

Now Cyberduck will enable file access to the GreenAnt Nest server.

Cyberduck has a sister product called Mountain Duck which can be used to map WebDAV mounts to a local drive. However, it is not a free product.

Native Windows implementation

You can map your Greenant Nest share to a new drive. Mapping to a drive enables you to browse files stored on GreenAnt Nest the way you would files stored in a mapped network drive.

Using this feature requires network connectivity. If you want to store your files offline, use the Desktop Client to sync all files on your Nextcloud to one or more directories of your local hard drive.

Note

Prior to mapping your drive, you must permit the use of Basic Authentication in the Windows Registry. The procedure is documented in KB841215 and differs somewhat between different windows versions.

To use the built-in WebDAV support in Windows 7, you need to enable the “WebClient” service, via the following process.

  1. On the Start menu, in the Search programs and files box, type “services” and click on the Services entry that appears under Programs. (If more than one is shown, select the one with a gear-wheel icon.)

Start menu

Services

  1. The Windows Services Manager will open. Scroll down to WebClient and then double-click on it.

List of Windows services

  1. In the WebClient Properties dialog box, change Startup type from Manual to Automatic.

WebClient service settings

  1. Under Service status, click the Start button, and a Windows is attempting to start the following service box will appear, which may take a minute or two to complete.

WebClient service starting up

  1. Once the WebClient service has started, click OK and then close the Services Manager window.

Mapping Drives With Windows Explorer

To map a drive using the Microsoft Windows Explorer:

  1. Go to Computer in Windows Explorer.
  2. Right-click on Computer entry and select Map network drive... from the drop-down menu.
  3. Choose a local network drive to which you want to map Nextcloud.
    • Specify the address to your GreenAnt Nest share and your USERNAME
    • For example:
     https://nest.greenant.net/remote.php/dav/files/USERNAME/
    

Note Check Reconnect at logon to ensure that the mapping is persistent upon subsequent reboots. If you want to connect to the Nextcloud server as a different user, check Connect using different credentials.

screenshot of mapping WebDAV on Windows Explorer

  1. Click the Finish button. You will be asked for your USERNAME and PASSWORD

screenshot of mapping WebDAV on Windows Explorer

Windows Explorer maps the network drive, making your Nextcloud instance available. You will now be able to browse the files form the drive letter Z:

Mapping a drive using the command line.

To map the drive:

  1. Open a command prompt in Windows.
  2. Enter the following line in the command prompt to map to the computer Z drive:
     net use Z: `https://nest.greenant.net/remote.php/dav/files/USERNAME/ /user:youruser yourpassword
    

The computer maps the files of your Nextcloud account to the drive letter Z.

Accessing public shares over WebDAV

Nest provides the possibility to access public shares over WebDAV.

To access the public share, open:

https://nest.greenant.net/public.php/dav

in a WebDAV client, use the share token as username and the (optional) share password as password.

Known Problems

Problem

You receive the following error message: Error 0x800700DF: The file size exceeds the limit allowed and cannot be saved.

Solution

Windows limits the maximum size a file transferred from or to a WebDAV share may have. You can increase the value FileSizeLimitInBytes in HKEY_LOCAL_MacHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters by clicking on Modify.

To increase the limit to the maximum value of 4GB, select Decimal, enter a value of 4294967295, and reboot Windows or restart the WebClient service.

Problem

Accessing your files from Microsoft Office via WebDAV fails.

Solution

Known problems and their solutions are documented in the KB2123563 article.

Problem

You cannot download more than 50 MB or upload large Files when the upload takes longer than 30 minutes using Web Client in Windows 7.

Solution

Workarounds are documented in the KB2668751 article.

Accessing Files Using cURL

Since WebDAV is an extension of HTTP cURL can be used to script file operations.

To create a folder with the current date as name:

$ curl -u user:pass -X MKCOL "https://nest.greenant.net/remote.php/dav/files/USERNAME/$(date '+%d-%b-%Y')"

To upload a file error.log into that directory:

$ curl -u user:pass -T error.log "https://nest.greenant.net/remote.php/dav/files/USERNAME/$(date '+%d-%b-%Y')/error.log"

To move a file:

$ curl -u user:pass -X MOVE --header 'Destination: https://nest.greenant.net/remote.php/dav/files/USERNAME/target.jpg' https://nest.greenant.net/remote.php/dav/files/USERNAME/source.jpg

To get the properties of files in the root folder:

    $ curl -X PROPFIND -H "Depth: 1" -u user:pass https://nest.greenant.net/remote.php/dav/files/USERNAME/ | xml_pp
    <?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:oc="http://nextcloud.org/ns" xmlns:s="http://sabredav.org/ns">
  <d:response>
    <d:href>/remote.php/dav/files/USERNAME/</d:href>
    <d:propstat>
      <d:prop>
        <d:getlastmodified>Tue, 13 Oct 2015 17:07:45 GMT</d:getlastmodified>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
        <d:quota-used-bytes>163</d:quota-used-bytes>
        <d:quota-available-bytes>11802275840</d:quota-available-bytes>
        <d:getetag>"561d3a6139d05"</d:getetag>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/files/USERNAME/welcome.txt</d:href>
    <d:propstat>
      <d:prop>
        <d:getlastmodified>Tue, 13 Oct 2015 17:07:35 GMT</d:getlastmodified>
        <d:getcontentlength>163</d:getcontentlength>
        <d:resourcetype/>
        <d:getetag>"47465fae667b2d0fee154f5e17d1f0f1"</d:getetag>
        <d:getcontenttype>text/plain</d:getcontenttype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>