File tree Expand file tree Collapse file tree 4 files changed +39
-5
lines changed
src/main/java/org/cryptomator/cli Expand file tree Collapse file tree 4 files changed +39
-5
lines changed Original file line number Diff line number Diff line change 1+ [ ![ Build Status] ( https://travis-ci.org/cryptomator/cli.svg?branch=develop )] ( https://travis-ci.org/cryptomator/cli )
2+
13# Cryptomator CLI version
24
35This is a minimal command line program which unlocks vaults, which can then be accessed via an embedded WebDAV server.
46
7+ ## Disclaimer
8+
9+ This project is in an early stage and not ready for production use. We recommend to use it only for testing and evaluation purposes.
10+
11+ ## Download and Usage
12+
13+ Download the jar file via [ GitHub Releases] ( https://github.com/cryptomator/cli/releases )
14+
15+ Cryptomator CLI depends on a Java 8 JRE. In addition the JCE unlimited strength policy files (needed for 256-bit keys) must be installed.
16+
17+ ``` sh
18+ java -jar cryptomator-cli-x.y.z.jar --bind 0.0.0.0 --port 8080 --vault demoVault=/path/to/vault --password demoVault=topSecret
19+ # you can now mount http://localhost:8080/demoVault/
20+ ```
21+
22+ In the current test version passwords can only be provided as a program argument. This will change in the future.
523
624## License
725
Original file line number Diff line number Diff line change 22 <modelVersion >4.0.0</modelVersion >
33 <groupId >org.cryptomator</groupId >
44 <artifactId >cli</artifactId >
5- <version >0.1 .0</version >
5+ <version >0.2 .0</version >
66 <name >Cryptomator CLI</name >
77 <description >Command line program to access encrypted files via WebDAV.</description >
88 <url >https://github.com/cryptomator/cli</url >
99
1010 <properties >
1111 <java .version>1.8</java .version>
12+ <commons .cli.version>1.3.1</commons .cli.version>
13+ <cryptofs .version>1.0.0</cryptofs .version>
14+ <webdav-nio .version>0.2.2</webdav-nio .version>
1215 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
1316 </properties >
1417
3437 <dependency >
3538 <groupId >org.cryptomator</groupId >
3639 <artifactId >cryptofs</artifactId >
37- <version >0.1.6 </version >
40+ <version >${cryptofs.version} </version >
3841 </dependency >
3942 <dependency >
4043 <groupId >org.cryptomator</groupId >
4144 <artifactId >webdav-nio-adapter</artifactId >
42- <version >0.1.0 </version >
45+ <version >${webdav-nio.version} </version >
4346 </dependency >
4447
4548 <!-- Commons -->
4649 <dependency >
4750 <groupId >commons-cli</groupId >
4851 <artifactId >commons-cli</artifactId >
49- <version >1.3.1 </version >
52+ <version >${commons.cli.version} </version >
5053 </dependency >
5154
5255 <!-- Logging -->
Original file line number Diff line number Diff line change 2525public class Args {
2626
2727 private static final String USAGE = "java -jar cryptomator-cli.jar" //
28+ + " --bind localhost --port 8080" //
2829 + " --vault mySecretVault=/path/to/vault --password mySecretVault=FooBar3000" //
2930 + " --vault myOtherVault=/path/to/other/vault --password myOtherVault=BarFoo4000" ;
3031 private static final Options OPTIONS = new Options ();
3132 static {
33+ OPTIONS .addOption (Option .builder () //
34+ .longOpt ("bind" ) //
35+ .argName ("WebDAV bind address" ) //
36+ .desc ("TCP socket bind address of the WebDAV server. Use 0.0.0.0 to accept all incoming connections." ) //
37+ .hasArg () //
38+ .build ());
3239 OPTIONS .addOption (Option .builder () //
3340 .longOpt ("port" ) //
3441 .argName ("WebDAV port" ) //
@@ -51,16 +58,22 @@ public class Args {
5158 .build ());
5259 }
5360
61+ private final String bindAddr ;
5462 private final int port ;
5563 private final Properties vaultPaths ;
5664 private final Properties vaultPasswords ;
5765
5866 public Args (CommandLine commandLine ) throws ParseException {
67+ this .bindAddr = commandLine .getOptionValue ("bind" , "localhost" );
5968 this .port = Integer .parseInt (commandLine .getOptionValue ("port" , "0" ));
6069 this .vaultPaths = commandLine .getOptionProperties ("vault" );
6170 this .vaultPasswords = commandLine .getOptionProperties ("password" );
6271 }
6372
73+ public String getBindAddr () {
74+ return bindAddr ;
75+ }
76+
6477 public int getPort () {
6578 return port ;
6679 }
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ private static void validate(Args args) throws IllegalArgumentException {
5656 }
5757
5858 private static void startup (Args args ) throws IOException {
59- WebDavServer server = WebDavServer .create (args .getPort ());
59+ WebDavServer server = WebDavServer .create (args .getBindAddr (), args . getPort ());
6060 server .start ();
6161
6262 for (String vaultName : args .getVaultNames ()) {
You can’t perform that action at this time.
0 commit comments