Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Dec 5, 2023
2 parents 7a15e92 + 7663ccb commit f35693c
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 74 deletions.
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "monthly"
day: "monday"
time: "06:00"
timezone: "Etc/UTC"
groups:
java-test-dependencies:
patterns:
- "org.junit.jupiter:*"
maven-build-plugins:
patterns:
- "org.apache.maven.plugins:*"
- "org.owasp:dependency-check-maven"
- "org.sonatype.plugins:nexus-staging-maven-plugin"
java-production-dependencies:
patterns:
- "*"
exclude-patterns:
- "org.junit.jupiter:*"
- "org.apache.maven.plugins:*"
- "org.owasp:dependency-check-maven"
- "org.sonatype.plugins:nexus-staging-maven-plugin"

- package-ecosystem: "github-actions"
directory: "/" # even for `.github/workflows`
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
java-version: 21
cache: 'maven'
- name: Ensure to use tagged version
if: startsWith(github.ref, 'refs/tags/')
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
# dependeabot has on push events only read-only access, but codeql requires write access
if: ${{ !(github.actor == 'dependabot[bot]' && contains(fromJSON('["push"]'), github.event_name)) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
java-version: 21
cache: 'maven'
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: "refs/tags/${{ github.event.inputs.tag }}"
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
java-version: 21
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
java-version: 21
cache: 'maven'
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 16 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>integrations-linux</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>

<name>integrations-linux</name>
<description>Provides optional Linux services used by Cryptomator</description>
Expand Down Expand Up @@ -36,23 +36,21 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.jdk.version>20</project.jdk.version>
<project.jdk.version>21</project.jdk.version>

<!-- runtime dependencies -->

<api.version>1.3.0</api.version>
<secret-service.version>1.8.1-jdk17</secret-service.version>
<kdewallet.version>1.3.2</kdewallet.version>
<appindicator.version>1.3.4</appindicator.version>
<guava.version>32.0.0-jre</guava.version>
<slf4j.version>1.7.36</slf4j.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<secret-service.version>2.0.0-alpha</secret-service.version>
<kdewallet.version>1.3.3</kdewallet.version>
<appindicator.version>1.3.6</appindicator.version>
<slf4j.version>2.0.9</slf4j.version>

<!-- test dependencies -->
<junit.version>5.8.2</junit.version>
<junit.version>5.10.1</junit.version>

<!-- build plugin dependencies -->
<dependency-check.version>8.2.1</dependency-check.version>
<dependency-check.version>8.4.2</dependency-check.version>
<nexus-staging.version>1.6.8</nexus-staging.version>
</properties>

Expand All @@ -67,11 +65,6 @@
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>de.swiesend</groupId>
<artifactId>secret-service</artifactId>
Expand All @@ -82,12 +75,6 @@
<artifactId>kdewallet</artifactId>
<version>${kdewallet.version}</version>
</dependency>
<!-- Apache Commons -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<!-- Java bindings for appindicator -->
<dependency>
<groupId>org.purejava</groupId>
Expand All @@ -107,7 +94,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.9.0</version>
<version>3.11.0</version>
<configuration>
<release>${project.jdk.version}</release>
<compilerArgs>
Expand All @@ -118,12 +105,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>check-preconditions</id>
Expand All @@ -144,7 +131,7 @@
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -156,7 +143,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<version>3.6.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down Expand Up @@ -248,7 +235,7 @@
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -283,7 +270,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -309,7 +296,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
</plugin>
</plugins>
</build>
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
module org.cryptomator.integrations.linux {
requires org.cryptomator.integrations.api;
requires org.slf4j;
requires com.google.common;
requires org.apache.commons.lang3;
requires org.freedesktop.dbus;
requires org.purejava.appindicator;
requires org.purejava.kwallet;
requires secret.service;
requires de.swiesend.secretservice;

provides KeychainAccessProvider with SecretServiceKeychainAccess, KDEWalletKeychainAccess;
provides RevealPathService with DBusSendRevealPathService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.cryptomator.linux.keychain;

import com.google.common.base.Preconditions;
import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.keychain.KeychainAccessException;
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
import org.cryptomator.linux.util.CheckUtil;
import org.freedesktop.dbus.connections.impl.DBusConnection;
import org.freedesktop.dbus.connections.impl.DBusConnectionBuilder;
import org.freedesktop.dbus.exceptions.DBusConnectionException;
Expand Down Expand Up @@ -49,25 +49,25 @@ public boolean isLocked() {

@Override
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
Preconditions.checkState(wallet.isPresent(), "Keychain not supported.");
CheckUtil.checkState(wallet.isPresent(), "Keychain not supported.");
wallet.get().storePassphrase(key, passphrase);
}

@Override
public char[] loadPassphrase(String key) throws KeychainAccessException {
Preconditions.checkState(wallet.isPresent(), "Keychain not supported.");
CheckUtil.checkState(wallet.isPresent(), "Keychain not supported.");
return wallet.get().loadPassphrase(key);
}

@Override
public void deletePassphrase(String key) throws KeychainAccessException {
Preconditions.checkState(wallet.isPresent(), "Keychain not supported.");
CheckUtil.checkState(wallet.isPresent(), "Keychain not supported.");
wallet.get().deletePassphrase(key);
}

@Override
public void changePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
Preconditions.checkState(wallet.isPresent(), "Keychain not supported.");
CheckUtil.checkState(wallet.isPresent(), "Keychain not supported.");
wallet.get().changePassphrase(key, passphrase);
}

Expand Down Expand Up @@ -95,11 +95,7 @@ private static DBusConnection getNewConnection() throws DBusException {
} catch (DBusConnectionException | DBusExecutionException de) {
LOG.warn("Connecting to SESSION bus failed.", de);
LOG.warn("Falling back to SYSTEM DBus");
try {
return DBusConnectionBuilder.forSystemBus().build();
} catch (DBusException e) {
throw e;
}
return DBusConnectionBuilder.forSystemBus().build();
}
}

Expand Down Expand Up @@ -144,7 +140,7 @@ public char[] loadPassphrase(String key) throws KeychainAccessException {
} else {
LOG.debug("loadPassphrase: wallet is closed.");
}
return (password.equals("")) ? null : password.toCharArray();
return (password.isEmpty()) ? null : password.toCharArray();
} catch (RuntimeException e) {
throw new KeychainAccessException("Loading the passphrase failed.", e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package org.cryptomator.linux.keychain;

import de.swiesend.secretservice.simple.SimpleCollection;
import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.keychain.KeychainAccessException;
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
import org.freedesktop.dbus.exceptions.DBusConnectionException;
import org.freedesktop.dbus.exceptions.DBusExecutionException;
import org.freedesktop.secret.simple.SimpleCollection;

import java.io.IOException;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cryptomator.linux.revealpath;

import com.google.common.base.Preconditions;
import org.cryptomator.integrations.revealpath.RevealFailedException;
import org.cryptomator.integrations.revealpath.RevealPathService;

Expand Down Expand Up @@ -91,7 +90,9 @@ public boolean isSupported() {
* @throws IOException if the Inputer reader on the process output cannot be created
*/
private boolean parseOutputForFileManagerInterface(Process fileManager1Process) throws IOException {
Preconditions.checkState(!fileManager1Process.isAlive());
if( fileManager1Process.isAlive()) {
throw new IllegalArgumentException("Process " + fileManager1Process + " must be terminated to read output.");
}
try (var reader = fileManager1Process.inputReader(StandardCharsets.UTF_8)) {
return reader.lines().map(String::trim).anyMatch(FILEMANAGER1_XML_ELEMENT::equals);
}
Expand Down
Loading

0 comments on commit f35693c

Please sign in to comment.