Hi there, I am trying to include the Cryptomator sanitizer into my backup script by have it check consistency of my containers before they get saved away.
To determine integrity I am looking for “Errors” in the output file which is when I noticed I always get an error referring to an invalid configuration file logback.xml:
10:03:04,332 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
10:03:04,332 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
10:03:04,332 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/home/thomas/Cryptomator/CryptomatorSanitizer.jar!/logback.xml]
10:03:04,353 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@5419f379 - URL [jar:file:/home/thomas/Cryptomator/CryptomatorSanitizer.jar!/logback.xml] is not of type file
10:03:04,442 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
10:03:04,444 |-ERROR in ch.qos.logback.core.joran.conditional.IfAction - Could not find Janino library on the class path. Skipping conditional processing.
10:03:04,444 |-ERROR in ch.qos.logback.core.joran.conditional.IfAction - See also http://logback.qos.ch/codes.html#ifJanino
10:03:04,447 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
10:03:04,449 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@7dc7cbad - Registering current configuration as safe fallback point
Second issue is that I can’t take the vault password from a file. Whenever I specify the passphrasefile option the application crashes with the error below. “-passphrase pwd” works but obviously this is not a suitable option.
# Cryptomator vault sanitizer v0.14 #
Exception in thread "main" java.lang.IndexOutOfBoundsException
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:151)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at org.cryptomator.sanitizer.commands.CheckCommand.passphraseFromFile(CheckCommand.java:189)
at org.cryptomator.sanitizer.commands.CheckCommand.passphrase(CheckCommand.java:161)
at org.cryptomator.sanitizer.commands.CheckCommand.parse(CheckCommand.java:130)
at org.cryptomator.sanitizer.commands.Commands.<init>(Commands.java:61)
at org.cryptomator.sanitizer.commands.Commands.parse(Commands.java:26)
at org.cryptomator.sanitizer.Sanitizer.main(Sanitizer.java:12)
My platform is Ubuntu server, Kernel 4.13.0-37-generic
Thanks
Thomas
Thanks for the swift response, I can confirm both errors are gone but somehow it doesn’t want to accept what’s in the pwd file. Is there anything I need to consider re. how the password is written inside the file?
I tried following the PWD with a new line and without but neither did make a difference.
The pwd file exists and is accessible as can be seen form the ls statement below. If I replace ls with cat I get to see my password as expected.
Output file(s) exist. Overwrite [Y|n]? y
Scanning vault structure may take some time. Be patient…
Wrote structure to Container.structure.txt.
46786 files in vault
Checking the vault may take some time. Be patient…
Check failed: Invalid passphrase
~$ sudo ls -al /home/thomas/.config/TZ/cryptomator.txt
-rw------- 1 thomas thomas 11 Apr 20 12:07 /home/thomas/.config/TZ/cryptomator.txt
$ java --version
openjdk 9-Ubuntu
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)
I tried both options and just double checked again. No newline!
Set up a test vault to see if it’s got to do with my special character password, but same issue.
Created a new vault with password “test”
Successfully ran Sanitizer with “-passphrase test” option
Copied password into file pwd
Changed Sanitizer string to “-passphrasefile ./pwd”
So… there is a newline. The $ indicates that there is a newline. I admit that we could patch Sanitizer so that newlines aren’t an issue but it’d be easier for now if you’d remove the newline.
Ok, I must admit I don’t know how I can get rid of it.
I created the file with echo test > pwd, and after things didn’t work used nano to check the content.
Not even vi shows that there is something behind the last character.
I’ve tried the same commands here and noticed one thing that could be the issue: Try passphraseFile instead of passphrasefile. Sanitizer’s interpreter isn’t that smart.