Skip to content

Commit 324eb8c

Browse files
committed
Merge branch 'release/3.0.0'
2 parents c01ef6e + c576100 commit 324eb8c

File tree

9 files changed

+161
-25
lines changed

9 files changed

+161
-25
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@ updates:
1010
- "org.apache.maven.plugins:*"
1111
- "org.jacoco:jacoco-maven-plugin"
1212
- "org.owasp:dependency-check-maven"
13-
- "org.sonatype.plugins:nexus-staging-maven-plugin"
13+
- "org.sonatype.central:central-publishing-maven-plugin"
14+
java-test-dependencies:
15+
patterns:
16+
- "org.junit.jupiter:*"
17+
- "org.cryptomator:cryptofs"
1418
java-production-dependencies:
1519
patterns:
1620
- "*"
1721
exclude-patterns:
1822
- "org.apache.maven.plugins:*"
1923
- "org.jacoco:jacoco-maven-plugin"
2024
- "org.owasp:dependency-check-maven"
21-
- "org.sonatype.plugins:nexus-staging-maven-plugin"
25+
- "org.sonatype.central:central-publishing-maven-plugin"
2226
- "org.junit.jupiter:*"
27+
- "org.cryptomator:cryptofs"
2328
ignore:
2429
# keep using Jetty 10.x (javax.*) instead of Jetty 11 (jakarta.*)
2530
- dependency-name: "org.eclipse.jetty:jetty-server"

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
name: Build and Test
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- uses: actions/setup-java@v4
11+
- uses: actions/checkout@v5
12+
- uses: actions/setup-java@v5
1313
with:
1414
java-version: 21
1515
distribution: 'temurin'
@@ -37,3 +37,5 @@ jobs:
3737
prerelease: true
3838
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
3939
generate_release_notes: true
40+
body: |
41+
For a list of all notable changes, read the [changelog](/CHANGELOG.md).

.github/workflows/publish-central.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
99
steps:
10-
- uses: actions/checkout@v4
11-
- uses: actions/setup-java@v4
10+
- uses: actions/checkout@v5
11+
- uses: actions/setup-java@v5
1212
with:
1313
java-version: 21
1414
distribution: 'temurin'

.github/workflows/publish-github.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
99
steps:
10-
- uses: actions/checkout@v4
11-
- uses: actions/setup-java@v4
10+
- uses: actions/checkout@v5
11+
- uses: actions/setup-java@v5
1212
with:
1313
java-version: 21
1414
distribution: 'temurin'

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
77
The changelog starts with version 2.0.9.
88
Changes to prior versions can be found on the [Github release page](https://github.com/cryptomator/webdav-nio-adapter/releases).
99

10-
## [Unreleased]
10+
## [3.0.0] - 2025-09-09
11+
12+
### Changed
13+
* **[BREAKING]** Update build target to JDK 21
14+
* Updated `org.cryptomator:webdav-nio-adapter-servlet` from 1.2.8 to 1.2.10
15+
* Updated `org.cryptomator:integrations-api` from 1.5.1 to 1.6.0
16+
* Updated `org.eclipse.jetty:jetty-server` from 10.0.25 to 10.0.26
17+
* Updated `org.eclipse.jetty:jetty-servlet` from 10.0.25 to 10.0.26
18+
19+
20+
## [2.0.10] - 2025-04-04
21+
22+
### Changed
23+
* Updated org.cryptomator:webdav-nio-adapter-servlet from 1.2.7 to 1.2.8
24+
* Mounting with MacAppleScriptMounter adds credential entry to keychain (again) ([75ef214cd44a3eb84cd4ecc6242456cfa42b35a7](https://github.com/cryptomator/webdav-nio-adapter/commit/75ef214cd44a3eb84cd4ecc6242456cfa42b35a7))
25+
1126

1227
## [2.0.9] - 2025-04-04
1328

@@ -16,5 +31,5 @@ Changes to prior versions can be found on the [Github release page](https://gith
1631

1732
## Changed
1833
* Increase timeout for MacAppleScript mounter to 120s (see #107)
19-
* Updates org.eclipse.jetty:jetty-server from 10.0.24 to 10.0.25
20-
* Updates org.eclipse.jetty:jetty-servlet from 10.0.24 to 10.0.25
34+
* Updated org.eclipse.jetty:jetty-server from 10.0.24 to 10.0.25
35+
* Updated org.eclipse.jetty:jetty-servlet from 10.0.24 to 10.0.25

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Uses Jackrabbit and an embedded Jetty to server the servlet.
1616
<dependency>
1717
<groupId>org.cryptomator</groupId>
1818
<artifactId>webdav-nio-adapter</artifactId>
19-
<version>1.0.0</version>
19+
<version>2.0.10</version>
2020
</dependency>
2121
</dependencies>
2222
```

pom.xml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.cryptomator</groupId>
55
<artifactId>webdav-nio-adapter</artifactId>
6-
<version>2.0.10</version>
6+
<version>3.0.0</version>
77
<name>WebDAV-NIO Adapter</name>
88
<description>Embedded Jetty serving a WebDAV servlet to access resources at a given NIO path.</description>
99
<url>https://github.com/cryptomator/webdav-nio-adapter</url>
@@ -15,29 +15,30 @@
1515
</scm>
1616

1717
<properties>
18-
<project.build.jdk>17</project.build.jdk>
18+
<project.build.jdk>21</project.build.jdk>
1919
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2020

2121
<!-- dependencies -->
22-
<integrations-api.version>1.5.1</integrations-api.version>
23-
<webdavservlet.version>1.2.8</webdavservlet.version>
24-
<jetty.version>10.0.25</jetty.version>
22+
<integrations-api.version>1.6.0</integrations-api.version>
23+
<webdavservlet.version>1.2.10</webdavservlet.version>
24+
<jetty.version>10.0.26</jetty.version>
2525
<slf4j.version>2.0.17</slf4j.version>
2626

2727
<!-- test dependencies -->
28-
<junit.jupiter.version>5.12.1</junit.jupiter.version>
28+
<junit.jupiter.version>5.13.4</junit.jupiter.version>
29+
<cryptofs.version>2.9.0</cryptofs.version>
2930

3031
<!-- mvn plugin dependencies -->
3132
<mvn-compiler.version>3.14.0</mvn-compiler.version>
3233
<mvn-surefire.version>3.5.3</mvn-surefire.version>
3334
<mvn-jar.version>3.4.2</mvn-jar.version>
3435
<mvn-source.version>3.3.1</mvn-source.version>
35-
<mvn-javadoc.version>3.11.2</mvn-javadoc.version>
36+
<mvn-javadoc.version>3.11.3</mvn-javadoc.version>
3637
<mvn-deploy.version>3.1.4</mvn-deploy.version>
37-
<mvn-gpg.version>3.2.7</mvn-gpg.version>
38-
<dependency-check.version>12.1.0</dependency-check.version>
39-
<jacoco.version>0.8.12</jacoco.version>
40-
<central-publishing.version>0.7.0</central-publishing.version>
38+
<mvn-gpg.version>3.2.8</mvn-gpg.version>
39+
<dependency-check.version>12.1.3</dependency-check.version>
40+
<jacoco.version>0.8.13</jacoco.version>
41+
<central-publishing.version>0.8.0</central-publishing.version>
4142
</properties>
4243

4344
<licenses>
@@ -88,7 +89,7 @@
8889
<dependency>
8990
<groupId>org.jetbrains</groupId>
9091
<artifactId>annotations</artifactId>
91-
<version>26.0.2</version>
92+
<version>26.0.2-1</version>
9293
<scope>provided</scope>
9394
</dependency>
9495

@@ -112,6 +113,12 @@
112113
<version>${slf4j.version}</version>
113114
<scope>test</scope>
114115
</dependency>
116+
<dependency>
117+
<groupId>org.cryptomator</groupId>
118+
<artifactId>cryptofs</artifactId>
119+
<version>${cryptofs.version}</version>
120+
<scope>test</scope>
121+
</dependency>
115122
</dependencies>
116123

117124
<build>
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2016 Sebastian Stenzel and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the accompanying LICENSE.txt.
5+
*
6+
* Contributors:
7+
* Sebastian Stenzel - initial API and implementation
8+
*******************************************************************************/
9+
package org.cryptomator.frontend.webdav;
10+
11+
import com.google.common.base.Preconditions;
12+
import org.cryptomator.cryptofs.CryptoFileSystemProperties;
13+
import org.cryptomator.cryptofs.CryptoFileSystemProvider;
14+
import org.cryptomator.cryptofs.DirStructure;
15+
import org.cryptomator.cryptolib.common.MasterkeyFileAccess;
16+
import org.cryptomator.integrations.mount.MountCapability;
17+
import org.cryptomator.integrations.mount.MountFailedException;
18+
import org.cryptomator.integrations.mount.MountService;
19+
import org.cryptomator.integrations.mount.UnmountFailedException;
20+
import org.slf4j.Logger;
21+
import org.slf4j.LoggerFactory;
22+
import org.slf4j.simple.SimpleLogger;
23+
24+
import java.io.IOException;
25+
import java.io.UncheckedIOException;
26+
import java.nio.file.FileSystem;
27+
import java.nio.file.Path;
28+
import java.nio.file.Paths;
29+
import java.security.NoSuchAlgorithmException;
30+
import java.security.SecureRandom;
31+
import java.util.Scanner;
32+
33+
public class CryptoFsTest {
34+
35+
static {
36+
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "INFO");
37+
System.setProperty(SimpleLogger.LOG_FILE_KEY, "System.out");
38+
System.setProperty(SimpleLogger.SHOW_DATE_TIME_KEY, "true");
39+
System.setProperty(SimpleLogger.DATE_TIME_FORMAT_KEY, "HH:mm:ss:SSS");
40+
}
41+
42+
private static final Logger LOG = LoggerFactory.getLogger(CryptoFsTest.class);
43+
44+
public static void main(String[] args) throws IOException, MountFailedException, NoSuchAlgorithmException {
45+
var webDAVMountService = MountService.get() //
46+
.filter(svc -> svc.getClass().getPackageName().startsWith("org.cryptomator.frontend.webdav.")) //
47+
.findFirst() //
48+
.orElseThrow(() -> new MountFailedException("Did not find a mount provider"));
49+
LOG.info("Using mount provider: {}", webDAVMountService.displayName());
50+
try (Scanner scanner = new Scanner(System.in)) {
51+
LOG.info("Enter path to the vault you want to mirror:");
52+
Path vaultPath = Paths.get(scanner.nextLine());
53+
Preconditions.checkArgument(CryptoFileSystemProvider.checkDirStructureForVault(vaultPath, "vault.cryptomator", "masterkey.cryptomator") == DirStructure.VAULT, "Not a vault: " + vaultPath);
54+
55+
LOG.info("Enter vault password:");
56+
String passphrase = scanner.nextLine();
57+
58+
SecureRandom csprng = SecureRandom.getInstanceStrong();
59+
CryptoFileSystemProperties props = CryptoFileSystemProperties.cryptoFileSystemProperties()
60+
.withKeyLoader(url -> new MasterkeyFileAccess(new byte[0], csprng).load(vaultPath.resolve("masterkey.cryptomator"), passphrase))
61+
.build();
62+
try (FileSystem cryptoFs = CryptoFileSystemProvider.newFileSystem(vaultPath, props)) {
63+
Path p = cryptoFs.getPath("/");
64+
mount(webDAVMountService, p, scanner);
65+
}
66+
}
67+
}
68+
69+
private static void mount(MountService mountProvider, Path pathToMirror, Scanner scanner) throws MountFailedException {
70+
var mountBuilder = mountProvider.forFileSystem(pathToMirror);
71+
if (mountProvider.hasCapability(MountCapability.VOLUME_ID)) {
72+
mountBuilder.setVolumeId("mirror");
73+
}
74+
if (mountProvider.hasCapability(MountCapability.VOLUME_NAME)) {
75+
mountBuilder.setVolumeName("Mirror");
76+
}
77+
if (mountProvider.hasCapability(MountCapability.FILE_SYSTEM_NAME)) {
78+
mountBuilder.setFileSystemName("MirrorFS");
79+
}
80+
if (! mountProvider.hasCapability(MountCapability.MOUNT_TO_SYSTEM_CHOSEN_PATH)) {
81+
// don't set a mount point
82+
} else {
83+
LOG.info("Enter mount point: ");
84+
Path m = Paths.get(scanner.nextLine());
85+
mountBuilder.setMountpoint(m);
86+
}
87+
88+
try (var mount = mountBuilder.mount()) {
89+
LOG.info("Mounted successfully to: {}", mount.getMountpoint().uri());
90+
LOG.info("Enter anything to unmount...");
91+
System.in.read();
92+
93+
try {
94+
mount.unmount();
95+
} catch (UnmountFailedException e) {
96+
if (mountProvider.hasCapability(MountCapability.UNMOUNT_FORCED)) {
97+
LOG.warn("Graceful unmount failed. Attempting force-unmount...");
98+
mount.unmountForced();
99+
}
100+
}
101+
} catch (UnmountFailedException e) {
102+
LOG.warn("Unmount failed.", e);
103+
} catch (IOException e) {
104+
throw new UncheckedIOException(e);
105+
}
106+
}
107+
}

0 commit comments

Comments
 (0)