Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
overheadhunter committed Dec 6, 2016
2 parents 9c4ab21 + 92310d1 commit 6b082d2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
[![Build Status](https://travis-ci.org/cryptomator/cli.svg?branch=develop)](https://travis-ci.org/cryptomator/cli)

# Cryptomator CLI version

This is a minimal command line program which unlocks vaults, which can then be accessed via an embedded WebDAV server.

## Disclaimer

This project is in an early stage and not ready for production use. We recommend to use it only for testing and evaluation purposes.

## Download and Usage

Download the jar file via [GitHub Releases](https://github.com/cryptomator/cli/releases)

Cryptomator CLI depends on a Java 8 JRE. In addition the JCE unlimited strength policy files (needed for 256-bit keys) must be installed.

```sh
java -jar cryptomator-cli-x.y.z.jar --bind 0.0.0.0 --port 8080 --vault demoVault=/path/to/vault --password demoVault=topSecret
# you can now mount http://localhost:8080/demoVault/
```

In the current test version passwords can only be provided as a program argument. This will change in the future.

## License

Expand Down
11 changes: 7 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>cli</artifactId>
<version>0.1.0</version>
<version>0.2.0</version>
<name>Cryptomator CLI</name>
<description>Command line program to access encrypted files via WebDAV.</description>
<url>https://github.com/cryptomator/cli</url>

<properties>
<java.version>1.8</java.version>
<commons.cli.version>1.3.1</commons.cli.version>
<cryptofs.version>1.0.0</cryptofs.version>
<webdav-nio.version>0.2.2</webdav-nio.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -34,19 +37,19 @@
<dependency>
<groupId>org.cryptomator</groupId>
<artifactId>cryptofs</artifactId>
<version>0.1.6</version>
<version>${cryptofs.version}</version>
</dependency>
<dependency>
<groupId>org.cryptomator</groupId>
<artifactId>webdav-nio-adapter</artifactId>
<version>0.1.0</version>
<version>${webdav-nio.version}</version>
</dependency>

<!-- Commons -->
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.3.1</version>
<version>${commons.cli.version}</version>
</dependency>

<!-- Logging -->
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/org/cryptomator/cli/Args.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,17 @@
public class Args {

private static final String USAGE = "java -jar cryptomator-cli.jar" //
+ " --bind localhost --port 8080" //
+ " --vault mySecretVault=/path/to/vault --password mySecretVault=FooBar3000" //
+ " --vault myOtherVault=/path/to/other/vault --password myOtherVault=BarFoo4000";
private static final Options OPTIONS = new Options();
static {
OPTIONS.addOption(Option.builder() //
.longOpt("bind") //
.argName("WebDAV bind address") //
.desc("TCP socket bind address of the WebDAV server. Use 0.0.0.0 to accept all incoming connections.") //
.hasArg() //
.build());
OPTIONS.addOption(Option.builder() //
.longOpt("port") //
.argName("WebDAV port") //
Expand All @@ -51,16 +58,22 @@ public class Args {
.build());
}

private final String bindAddr;
private final int port;
private final Properties vaultPaths;
private final Properties vaultPasswords;

public Args(CommandLine commandLine) throws ParseException {
this.bindAddr = commandLine.getOptionValue("bind", "localhost");
this.port = Integer.parseInt(commandLine.getOptionValue("port", "0"));
this.vaultPaths = commandLine.getOptionProperties("vault");
this.vaultPasswords = commandLine.getOptionProperties("password");
}

public String getBindAddr() {
return bindAddr;
}

public int getPort() {
return port;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cryptomator/cli/CryptomatorCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static void validate(Args args) throws IllegalArgumentException {
}

private static void startup(Args args) throws IOException {
WebDavServer server = WebDavServer.create(args.getPort());
WebDavServer server = WebDavServer.create(args.getBindAddr(), args.getPort());
server.start();

for (String vaultName : args.getVaultNames()) {
Expand Down

0 comments on commit 6b082d2

Please sign in to comment.