cli icon indicating copy to clipboard operation
cli copied to clipboard

What is the correct WebDav URL to mount in CLI?

Open shaiguitar opened this issue 6 years ago • 3 comments

First off, thank you for Cryptomator!

When following the README to get started with CLI, it seems like #14 (PROPFIND) shows up, perhaps because the correct URL is not something inferable. When I use the Cryptomator GUI app, it seems like the WebDAV URL has some secret prefix path. See screenshots:

cryptomator1 cryptomator2

When I use the CLI version headless in a raspberry pi, I am not able to mount properly and get that error:

# Config vars
pi@rpi3a:~/cryptomator $ cat variables.sh
CRYPTOMATOR_HOME="/home/pi/cryptomator"
DIR_TO_SYNC_PATH="$CRYPTOMATOR_HOME/syncMe"
CRYPTOMATOR_PATH="$CRYPTOMATOR_HOME/cryptomator-cli-0.3.1.jar"
MOUNT_PATH="$CRYPTOMATOR_HOME/demoVault_mountpoint"
VAULT_PATH="$CRYPTOMATOR_HOME/demoVault"
VAULT_PASSWORD="topSecret"
VAULT_NAME="demoVaultName"
BIND_HOST="localhost"
BIND_PORT="8198"

# START UP THE CLI/WEBDAV SERVER

pi@rpi3a:~/cryptomator $ /usr/bin/java -Dcryptomator.logPath=dcryptodebug.log -jar $CRYPTOMATOR_PATH --vault $VAULT_NAME=$VAULT_PATH  --password $VAULT_NAME=$VAULT_PASSWORD --bind $BIND_HOST --port $BIND_PORT

# different window, all the dirs created, trying to mount:

pi@rpi3a $ sudo mount -t davfs http://localhost:8198/demoVault /home/pi/cryptomator/demoVault_mountpoint/
...
Username: demoVault
Password: topSecret

# returns:
/sbin/mount.davfs: Mounting failed.
501 Method PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API

This is true if I try using http://localhost:8198/ or http://localhost:8198/demoVault as the mount URL. So either the documentation is not clear, or I am not sure how to determine what URL to use. As per screenshots above, I don't know if there is some prefix that needs to be added.

FWIW a comment I left in #22 I'm happy to help contribute but I'll need a few pointers to get started.

shaiguitar avatar Apr 23 '18 15:04 shaiguitar

Cryptomator has this "secret prefix path" for various reasons. It's a "vault id" that is randomly set when adding a vault to the list (and is saved in the settings). Cryptomator CLI doesn't have this so this is nothing that you have to think about here.

I've tried your script (well, not exactly because I've tried it on macOS and used a different mount command... but I used shell variables and called Cryptomator CLI like you did) and was able to successfully mount the vault drive. With that, I can at least confirm that your setup should work.

http://localhost:8198/demoVault should be the correct URL. Or maybe add a trailing slash because I'm not sure how important that is: http://localhost:8198/demoVault/

I'm not familiar with davfs2 but I've noticed that you passed a username/password to the WebDAV server. Cryptomator CLI currently doesn't support authentication (see #5). So the username/password should have no effect. If it's asked, you can type anything in there.

If I'm not mistaken, Cryptomator CLI doesn't support logging. Setting cryptomator.logPath should have no effect.

tobihagemann avatar Apr 23 '18 21:04 tobihagemann

Has there been any testing done on Raspberry Pi setups? The setup above with the vars I ran on was on a RPi3.

# uname
Linux rpi3a 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) Client VM (build 25.171-b11, mixed mode)

# davfs
pi@rpi3a:~ $ sudo apt list --installed |grep dav
davfs2/stable,now 1.5.4-2 armhf [installed]

shaiguitar avatar Apr 23 '18 21:04 shaiguitar

Personally, no. I've heard about some successful attempts but I believe they all just involved in running Cryptomator CLI and not mounting the vault on the same device. The only public topic I could found is this one (other ones were via email): https://community.cryptomator.org/t/cryptomator-on-raspberry-pi-3-javafx-problem/644

Maybe you could try and make sure that davfs2 works independently. Try to mount a "regular" WebDAV server like this one: https://webdavserver.com

tobihagemann avatar Apr 24 '18 08:04 tobihagemann