Skip to content

Commit

Permalink
Merge branch 'develop' into release/0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Dec 16, 2024
2 parents 598331d + a32cdb2 commit 68989e0
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 19 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ on:
inputs:
sem-version:
description: 'Version'
required: false
required: true

permissions:
contents: write
packages: write

env:
JAVA_DIST: 'zulu'
JAVA_VERSION: '22.0.2+9'
JAVA_VERSION: '23.0.1+11'

defaults:
run:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ on:
inputs:
sem-version:
description: 'Version'
required: false
required: true
notarize:
description: 'Notarize app'
required: false
type: boolean

permissions:
contents: write
packages: write

env:
JAVA_DIST: 'zulu'
JAVA_VERSION: '22.0.2+9'
JAVA_VERSION: '23.0.1+11'

defaults:
run:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ on:
inputs:
sem-version:
description: 'Version'
required: false
required: true

permissions:
contents: write
packages: write

env:
JAVA_DIST: 'zulu'
JAVA_VERSION: '22.0.2+9'
JAVA_VERSION: '23.0.1+11'

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '22'
java-version: '23'
distribution: 'temurin'
- name: Ensure to use tagged version
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} # use shell parameter expansion to strip of 'refs/tags'
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/post-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Post Release Publish Tasks

on:
release:
types: [published]

permissions:
contents: write

defaults:
run:
shell: bash

jobs:
get-version:
runs-on: ubuntu-latest
env:
ARCHIVE_NAME: cryptomator-cli-${{ github.event.release.tag_name }}.tar.gz
steps:
- name: Download source tarball
run: |
curl -L -H "Accept: application/vnd.github+json" https://github.com/cryptomator/cli/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz --output ${{ env.ARCHIVE_NAME }}
- name: Sign source tarball with key 615D449FE6E6A235
run: |
echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a ${{ env.ARCHIVE_NAME }}
env:
GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
- name: Publish asc on GitHub Releases
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
files: |
${{ env.ARCHIVE_NAME }}.asc
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jdk.version>22</jdk.version>
<jdk.version>23</jdk.version>

<!--jpackage stuff -->
<!-- Group IDs of jars that need to stay on the class path for now
Expand All @@ -20,7 +20,7 @@
<mainClass>org.cryptomator.cli.CryptomatorCli</mainClass>

<!-- runtime dependencies -->
<cryptofs.version>2.7.0</cryptofs.version>
<cryptofs.version>2.7.1</cryptofs.version>
<webdav-nio.version>2.0.7</webdav-nio.version>
<fuse-nio.version>5.0.2</fuse-nio.version>
<logback.version>1.5.12</logback.version>
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/org/cryptomator/cli/MountSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void setMountService(String value) {

@CommandLine.Option(names = {"--loopbackHostName"}, description = "Name of the loopback address.")
Optional<String> loopbackHostName;

@CommandLine.Option(names = {"--loopbackPort"}, description = "Port used at the loopback address.")
Optional<Integer> loopbackPort;

Expand Down Expand Up @@ -92,7 +92,7 @@ MountBuilder prepareMountBuilder(FileSystem fs) {
}

var ignoredMOPs = specifiedMOPs.entrySet().stream().filter(Map.Entry::getValue).map(e -> e.getKey().name()).collect(Collectors.joining(","));
if(!ignoredMOPs.isEmpty()) {
if (!ignoredMOPs.isEmpty()) {
LOG.info("Ignoring unsupported options: {}", ignoredMOPs);
}
return builder;
Expand All @@ -111,10 +111,17 @@ private Map<MountCapability, Boolean> listSpecifiedMountOptions() {

Mount mount(FileSystem fs) throws MountFailedException {
if (!mountService.hasCapability(MOUNT_TO_SYSTEM_CHOSEN_PATH) && mountPoint.isEmpty()) {
throw new CommandLine.ParameterException(spec.commandLine(), "The selected mounter %s requires a mount point. Use --mountPoint /path/to/mount/point to specify it.".formatted(mountService.displayName()));
throw new RuntimeException("Unsupported configuration: Mounter %s requires a mount point. Use --mountPoint /path/to/mount/point to specify it.".formatted(mountService.getClass().getName()));
}

var builder = prepareMountBuilder(fs);
mountPoint.ifPresent(builder::setMountpoint);

try {
mountPoint.ifPresent(builder::setMountpoint);
} catch (UnsupportedOperationException e) {
var errorMessage = String.format("Unsupported configuration: Mounter '%s' does not support flag --mountpoint", mountService.getClass().getName());
throw new RuntimeException(errorMessage);
}
LOG.debug("Mounting vault using {} to {}.", mountService.displayName(), mountPoint.isPresent() ? mountPoint.get() : "system chosen location");
return builder.mount();
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/cryptomator/cli/PasswordSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class PasswordSource {

Passphrase readPassphrase() throws IOException {
if (passphraseStdin != null) {
return new Passphrase(passphraseStdin); //readPassphraseFromStdin();
System.out.println("\n"); //otherwise other output might not be clearly separated on the console
return new Passphrase(passphraseStdin);
} else if (passphraseEnvironmentVariable != null) {
return readPassphraseFromEnvironment();
} else if (passphraseFile != null) {
Expand Down Expand Up @@ -60,7 +61,7 @@ private Passphrase readPassphraseFromFile() throws ReadingFileFailedException {
charWrapper = StandardCharsets.UTF_8.decode(ByteBuffer.wrap(fileContent));
//strips newline, since most files on linux end with a new line
var length = charWrapper.limit();
if(charWrapper.get(length) == '\n') {
if(charWrapper.get(length - 1) == '\n') {
length--;
}
char[] content = new char[length];
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cryptomator/cli/Unlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public Integer call() throws Exception {

try (var fs = CryptoFileSystemProvider.newFileSystem(pathToVault, fsPropsBuilder.build());
var mount = mountSetup.mount(fs)) {
System.out.println(mount.getMountpoint().uri());
LOG.info("Unlocked and mounted vault successfully to {}", mount.getMountpoint().uri());
Runtime.getRuntime().addShutdownHook(new Thread(() -> teardown(mount)));
Thread.currentThread().join();
}
Expand Down

0 comments on commit 68989e0

Please sign in to comment.