Mounting with webdav under Linux

I recently got a Box account with 50 gB of online storage (see this thread on XDA on how to get one).

To get it mounted under linux, install the davfs2 package, add your credentials in /etc/davfs2/secrets with the syntax: <email address used in account> <password>

Next, edit the /etc/davfs2/davfs2.conf file, to disable locking. It doesn’t really support it, and causes input/output errors when trying to write anything to the filesystem. To this file you should add the entry

use_locks 0

To automatically mount it at boot, you can add the following to /etc/fstab (all in one line): /mnt/ davfs defaults,uid=<your linux user>,gid=<your linux group> 0 0

Now you just need to create the directory, and mount it:

mkdir /mnt/
mount /mnt/

Et voila, you can now use your Box account as a regular filesystem ;)

Cadaver and proxy auth

At work we regularly have to send over files to $vendor. $Vendor has two ways of accepting files: FTP, and Webdav (over https). Since our company’s policy is to not send things out unencrypted, we have to go the webdav way. It’s also the policy to send things over our internetproxy if possible.

After some searching for a console-based webdav client we ran across cadaver, a lightweight client that seemed to do the trick. It has proxy support, so great ;)

What isn’t so great is that it doesn’t have any way to supply the proxy authentication in a non-interactive way, which is crucial to allow us to script this file transfer.

Today I took the time to create a patch that allows just that – setting the proxy info in advance. It also includes a parameter to trust the server certificate implicitly, otherwise it was yet another step where cadaver would come and ask for user input.

Now it works like a charm! :)