Running Cryptomator on Fedora 25
Cryptomator is a great tool for encrypting your files on the go and it works great with cloud storage solutions. It runs on all platforms however I ran into some small issues trying to get it to run on my Fedora 25. I’m going to outline my issues here and describe how I solved it.
This might not be the ultimate way to solve everything though! If I did something bad or you have a better way, please contact me and let me know!
Installing
The first thing I did was to go to the home page and download the rpm because I couldn’t find any yum/dnf repo. I actually found an issue explaining that there’s no repo because of a missing OpenJFX package.
However as I’m installing the rpm I get some dependency errors.
$ sudo rpm --install cryptomator-1.2.3-amd64.rpm
error: Failed dependencies:
libXi.so.6 is needed by cryptomator-1.2.3-1.x86_64
libXrender.so.1 is needed by cryptomator-1.2.3-1.x86_64
libXtst.so.6 is needed by cryptomator-1.2.3-1.x86_64
libasound.so.2 is needed by cryptomator-1.2.3-1.x86_64
However I found that a bit odd considering I’m pretty sure I have those libraries.
$ sudo dnf install libXi libXrender libXtst alsa-lib
Package libXi-1.7.9-1.fc25.x86_64 is already installed, skipping.
Package libXrender-0.9.10-1.fc25.x86_64 is already installed, skipping.
Package libXtst-1.2.3-1.fc25.x86_64 is already installed, skipping.
Package alsa-lib-1.1.1-2.fc25.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
After some Googling I found a relevant issue. It seems like due to the way the app is packaged it requires the 32bit dependencies and not the 64bit. After installing the 32bit versions.
$ sudo dnf install libXi.686 libXrender.i686 libXtst.i686 alsa-lib.i686
And then running the install again.
$ sudo rpm --install cryptomator-1.2.3-amd64.rpm
It worked just fine.
Running
Another thing I observed was that the Cryptomator-executable didn’t appear in my path directly after installing. I listed the paths in the rpm to check where it was installed.
$ rpm -qlp cryptomator-1.2.3-amd64.rpm
/opt/Cryptomator
/opt/Cryptomator/Cryptomator
So it was installed under opt! That’s just fine. There are many ways to solve that. I just made a symlink to under /usr/bin just to don’t mess with any files.
$ sudo ln -s /opt/Cryptomator/Cryptomator /usr/bin/Cryptomator
And now I can run Cryptomator as normal!
Path to opened vault
When you open the vaults they get mounted via dav or webdav based on your settings. However I also want to access the vault from the commandline.
Unlocking the vault from the Cryptomator GUI opened the mount in a Nautilus window. Meaning the actual vault has to be mounted somewhere. After some more Googling I found that they are mounted under
/run/user/$uid/gvfs/dav:host=localhost,port=42427,ssl=false,prefix=%2F$somePrefix%2F$vaultName
And that’s a tiny bit of an inconvenient path to cd to. So I wanted to write some kind of shorthand for cd’ing to Cryptomator vaults.
UID is very easy to get from a script, and you can take vault name as an argument. However getting that ID for the prefix bit might have been tedious. Thankfully, Cryptomator writes a very nice settings.json file to your home directory where we can get all this information. By using the amazing jq-utility we can also easily extract information from json-files.
So, if we have the vault name, extracting the vault id can be done like so.
$ jq '.directories[] | select(.mountName=="vaultName").id' < .Cryptomator/settings.json
"a7kB1GqFWwHJ"
In order to easily change paths I wrote a shell function and put it in my zshrc.
cryptocd () {
vaultName=$1
settingsFile=$HOME/.Cryptomator/settings.json
uid=$(id -u `whoami`)
port=$(jq '.port' < $settingsFile)
prefixQuery=".directories[] | select(.mountName==\"$vaultName\").id"
jsonOutput=$(jq "$prefixQuery" < $settingsFile)
prefixNoQuotes=${jsonOutput//\"}
vaultPath=/run/user/$uid/gvfs/dav:host=localhost,port=$port,ssl=false,prefix=%2F$prefixNoQuotes%2F$vaultName
cd $vaultPath
}
Which meant after unlocking a vault named “testVault” in the Cryptomator GUI I can easily cd to it from a terminal by typing.
$ cryptocd testVault
$ pwd
/run/user/38712/gvfs/dav:host=localhost,port=42427,ssl=false,prefix=%2Fg2kE2GqFRwRJ%2FtestVault
This seems to work well so far! However I’m really not sure about how stable and multiplatform this is and who actually does the mounting. However it looks like a useable way to go without using a manual dav2fs mount.
GUI problems
One thing I’m not quite sure why happens though is that there are no close or hide-buttons on the top of the GUI window. Which means you have to use other means to hide it. I’m sure there’s some solution to this however I haven’t found it yet. If you know it please let me know!