Compare commits

..

2 Commits
0.7.1 ... 0.7.2

11 changed files with 26 additions and 28 deletions

View File

@@ -46,7 +46,7 @@ If you want to take a look at the current beta version, go ahead and get your co
apt-get install oracle-java8-installer oracle-java8-unlimited-jce-policy fakeroot maven git apt-get install oracle-java8-installer oracle-java8-unlimited-jce-policy fakeroot maven git
git clone https://github.com/cryptomator/cryptomator.git git clone https://github.com/cryptomator/cryptomator.git
cd cryptomator/main cd cryptomator/main
git checkout v0.6.0 git checkout 0.7.1
mvn clean install -Pdebian mvn clean install -Pdebian
``` ```

View File

@@ -12,7 +12,7 @@
<parent> <parent>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
</parent> </parent>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<name>Cryptomator WebDAV and I/O module</name> <name>Cryptomator WebDAV and I/O module</name>

View File

@@ -12,7 +12,7 @@
<parent> <parent>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
</parent> </parent>
<artifactId>crypto-aes</artifactId> <artifactId>crypto-aes</artifactId>
<name>Cryptomator cryptographic module (AES)</name> <name>Cryptomator cryptographic module (AES)</name>

View File

@@ -12,7 +12,7 @@
<parent> <parent>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
</parent> </parent>
<artifactId>crypto-api</artifactId> <artifactId>crypto-api</artifactId>
<name>Cryptomator cryptographic module API</name> <name>Cryptomator cryptographic module API</name>

View File

@@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
</parent> </parent>
<artifactId>installer-debian</artifactId> <artifactId>installer-debian</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
</parent> </parent>
<artifactId>installer-osx</artifactId> <artifactId>installer-osx</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
</parent> </parent>
<artifactId>installer-win-portable</artifactId> <artifactId>installer-win-portable</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
</parent> </parent>
<artifactId>installer-win</artifactId> <artifactId>installer-win</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Cryptomator</name> <name>Cryptomator</name>

View File

@@ -12,7 +12,7 @@
<parent> <parent>
<groupId>org.cryptomator</groupId> <groupId>org.cryptomator</groupId>
<artifactId>main</artifactId> <artifactId>main</artifactId>
<version>0.7.1</version> <version>0.7.2</version>
</parent> </parent>
<artifactId>ui</artifactId> <artifactId>ui</artifactId>
<name>Cryptomator GUI</name> <name>Cryptomator GUI</name>

View File

@@ -30,7 +30,7 @@ import org.cryptomator.ui.util.command.Script;
final class WindowsWebDavMounter implements WebDavMounterStrategy { final class WindowsWebDavMounter implements WebDavMounterStrategy {
private static final Pattern WIN_MOUNT_DRIVELETTER_PATTERN = Pattern.compile("\\s*([A-Z]:)\\s*"); private static final Pattern WIN_MOUNT_DRIVELETTER_PATTERN = Pattern.compile("\\s*([A-Z]:)\\s*");
private static final int MAX_MOUNT_ATTEMPTS = 5; private static final int MAX_MOUNT_ATTEMPTS = 8;
@Override @Override
public boolean shouldWork() { public boolean shouldWork() {
@@ -39,30 +39,26 @@ final class WindowsWebDavMounter implements WebDavMounterStrategy {
@Override @Override
public void warmUp(int serverPort) { public void warmUp(int serverPort) {
// try { // no-op
// final Script mountScript = fromLines("net use * \\\\localhost@%DAV_PORT%\\DavWWWRoot\\bill-gates-mom-uses-goto /persistent:no");
// mountScript.addEnv("DAV_PORT", String.valueOf(serverPort));
// mountScript.execute(1, TimeUnit.SECONDS);
// } catch (CommandFailedException e) {
// // will most certainly throw an exception, because this is a fake WebDav path. But now windows has some DNS things cached :)
// }
} }
@Override @Override
public WebDavMount mount(URI uri, String name) throws CommandFailedException { public WebDavMount mount(URI uri, String name) throws CommandFailedException {
CommandResult mountResult; CommandResult mountResult;
try { try {
final Script mountScript = fromLines("net use * \\\\0--1.ipv6-literal.net@%DAV_PORT%\\DavWWWRoot%DAV_UNC_PATH% /persistent:no"); final Script mountScript = fromLines("net use * \\\\localhost@%DAV_PORT%\\DavWWWRoot%DAV_UNC_PATH% /persistent:no");
mountScript.addEnv("DAV_PORT", String.valueOf(uri.getPort())).addEnv("DAV_UNC_PATH", uri.getRawPath().replace('/', '\\')); mountScript.addEnv("DAV_PORT", String.valueOf(uri.getPort())).addEnv("DAV_UNC_PATH", uri.getRawPath().replace('/', '\\'));
mountResult = mountScript.execute(5, TimeUnit.SECONDS); mountResult = mountScript.execute(5, TimeUnit.SECONDS);
} catch (CommandFailedException ex) { } catch (CommandFailedException ex) {
final Script mountScript = fromLines("net use * \\\\0--1.ipv6-literal.net@%DAV_PORT%\\DavWWWRoot%DAV_UNC_PATH% /persistent:no"); final Script localhostMountScript = fromLines("net use * \\\\localhost@%DAV_PORT%\\DavWWWRoot%DAV_UNC_PATH% /persistent:no");
mountScript.addEnv("DAV_PORT", String.valueOf(uri.getPort())).addEnv("DAV_UNC_PATH", uri.getRawPath().replace('/', '\\')); localhostMountScript.addEnv("DAV_PORT", String.valueOf(uri.getPort())).addEnv("DAV_UNC_PATH", uri.getRawPath().replace('/', '\\'));
final Script ipv6literaltMountScript = fromLines("net use * \\\\0--1.ipv6-literal.net@%DAV_PORT%\\DavWWWRoot%DAV_UNC_PATH% /persistent:no");
ipv6literaltMountScript.addEnv("DAV_PORT", String.valueOf(uri.getPort())).addEnv("DAV_UNC_PATH", uri.getRawPath().replace('/', '\\'));
final Script proxyBypassScript = fromLines("reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" /v \"ProxyOverride\" /d \"<local>;0--1.ipv6-literal.net;0--1.ipv6-literal.net:%DAV_PORT%\" /f"); final Script proxyBypassScript = fromLines("reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" /v \"ProxyOverride\" /d \"<local>;0--1.ipv6-literal.net;0--1.ipv6-literal.net:%DAV_PORT%\" /f");
proxyBypassScript.addEnv("DAV_PORT", String.valueOf(uri.getPort())); proxyBypassScript.addEnv("DAV_PORT", String.valueOf(uri.getPort()));
mountResult = bypassProxyAndRetryMount(mountScript, proxyBypassScript); mountResult = bypassProxyAndRetryMount(localhostMountScript, ipv6literaltMountScript, proxyBypassScript);
} }
final String driveLetter = getDriveLetter(mountResult.getStdOut()); final String driveLetter = getDriveLetter(mountResult.getStdOut());
final Script openExplorerScript = fromLines("start explorer.exe " + driveLetter); final Script openExplorerScript = fromLines("start explorer.exe " + driveLetter);
openExplorerScript.execute(); openExplorerScript.execute();
@@ -77,7 +73,7 @@ final class WindowsWebDavMounter implements WebDavMounterStrategy {
} }
}; };
} }
private boolean isVolumeMounted(String driveLetter) { private boolean isVolumeMounted(String driveLetter) {
for (Path path : FileSystems.getDefault().getRootDirectories()) { for (Path path : FileSystems.getDefault().getRootDirectories()) {
if (path.toString().startsWith(driveLetter)) { if (path.toString().startsWith(driveLetter)) {
@@ -86,15 +82,17 @@ final class WindowsWebDavMounter implements WebDavMounterStrategy {
} }
return false; return false;
} }
private CommandResult bypassProxyAndRetryMount(Script mountScript, Script proxyBypassScript) throws CommandFailedException { private CommandResult bypassProxyAndRetryMount(Script localhostMountScript, Script ipv6literalMountScript, Script proxyBypassScript) throws CommandFailedException {
CommandFailedException latestException = null; CommandFailedException latestException = null;
for (int i = 0; i < MAX_MOUNT_ATTEMPTS; i++) { for (int i = 0; i < MAX_MOUNT_ATTEMPTS; i++) {
try { try {
// wait a moment before next attempt // wait a moment before next attempt
Thread.sleep(5000); Thread.sleep(5000);
proxyBypassScript.execute(); proxyBypassScript.execute();
return mountScript.execute(5, TimeUnit.SECONDS); // alternate localhost and 0--1.ipv6literal.net
final Script mountScript = (i % 2 == 0) ? localhostMountScript : ipv6literalMountScript;
return mountScript.execute(3, TimeUnit.SECONDS);
} catch (CommandFailedException ex) { } catch (CommandFailedException ex) {
latestException = ex; latestException = ex;
} catch (InterruptedException ex) { } catch (InterruptedException ex) {