Open mhogomchungu opened 3 years ago
The second commit leaves the defaults as they are and it allows users to set FUSE fsname and subtype if they want to and an ideal command that uses them looks like below
cryptomator-cli --vault blabla=/path/to/cryptomator -fusemount blabla=/path/to/mountpath -fsname blabla=cryptomator@/path/to/cryptomator -subtype blabla=cryptomator
Thank you for your PR! I must admit, I think it would be much easier if we'd introduce a mountFlags
option and not options for each mount flag (because the list could become very long then). What do you think?
That makes sense and the latest code has the option.
Example is below where it sets fsname,subtype and allow_other.
With an option like fsname that takes an argument, the option is supposed to be in a format of fsname=cryptomator
but i went with fsname cryptomator
because the command line parser seems to be confused when it sees the "=" sign.
java -jar cryptomator-cli.jar --vault aaa=cipherPath -fusemount aaa=mountPath -mountFlags aaa=fsname cryptomator,subtype cryptomater,allow_other
Out of curiosity, does the command-line parser handle quotes better? Would something like this be possible (without making things more complex)?
-mountFlags aaa="-ofsname=cryptomator -osubtype=cryptomater -oallow_other"
And then not even adding them to the default flags but using them "as is".
Out of curiosity, does the command-line parser handle quotes better? Would something like this be possible (without making things more complex)?
No, it does not, it stops when it sees the "=" sign.
java -jar cryptomator-cli.jar --vault aaa=cipherPath -fusemount aaa=aaa -mountFlags aaa="-ofsname=cryptomator -osubtype=cryptomater -oallow_other"
06:54:30.399 [main] INFO org.cryptomator.cli.CryptomatorCli - Unlocking vault "aaa" located at /home/ink/.vaults/cryptomator
06:54:30.411 [main] INFO o.c.c.p.PasswordFromStdInputStrategy - Vault 'aaa' password from standard input.
Enter password for vault 'aaa':
fuse: unknown option `-ofsname'
06:54:34.679 [main] ERROR o.cryptomator.cli.frontend.FuseMount - Can't mount: aaa, error: ru.serce.jnrfuse.FuseException: Unable to mount FS
06:54:34.683 [main] INFO org.cryptomator.cli.CryptomatorCli - Press Ctrl+C to terminate.
"=" character appears to be an illegal character and any option including cipher path and mount point path that has it will be broken because it will get truncated at the location of the character.
Currently, a mounted cryptomator volume shows up in "/proc/self/mountinfo" in linux as follows:
Notice that there is no way of knowing if this entry belongs to cryptomator because "fuse.fusefs-1001772408" is not very meaningful because the numbers are randomly generated i think from here[1]
With this patch, the above line shows up as below
The above line has the following improvements :-
The last two makes it easy to identify cryptomator volumes and are necessary for identification by other tools like file managers and desktop environments.
[1] https://github.com/SerCeMan/jnr-fuse/blob/c5d071af150a191c72b6ed91fd5865ffa1853d4a/src/main/java/ru/serce/jnrfuse/AbstractFuseFS.java#L315