Skip to content

Commit f59c6cb

Browse files
committed
Merge branch 'release/1.5.0'
2 parents d3ce8e6 + 6269df3 commit f59c6cb

21 files changed

+753
-42
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build
22
on:
3-
[push]
3+
push:
4+
pull_request_target:
5+
types: [labeled]
46
jobs:
57
build:
68
name: Build and Test
@@ -31,4 +33,4 @@ jobs:
3133
with:
3234
prerelease: true
3335
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
34-
generate_release_notes: true
36+
generate_release_notes: true

.github/workflows/publish-central.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
2222
server-username: MAVEN_USERNAME # env variable for username in deploy
2323
server-password: MAVEN_PASSWORD # env variable for token in deploy
24-
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
25-
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
2624
- name: Enforce project version ${{ github.event.inputs.tag }}
2725
run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
2826
- name: Deploy
@@ -35,4 +33,5 @@ jobs:
3533
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED
3634
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3735
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
38-
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
36+
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
37+
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}

.github/workflows/publish-github.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ jobs:
1313
distribution: 'zulu'
1414
java-version: 22
1515
cache: 'maven'
16-
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
17-
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
1816
- name: Enforce project version ${{ github.event.release.tag_name }}
1917
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
2018
- name: Deploy
2119
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
2220
env:
2321
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2422
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
23+
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
2524
- name: Slack Notification
2625
uses: rtCamp/action-slack-notify@v2
2726
env:

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Linux-specific implemenations of the [integrations-api](https://github.com/crypt
33

44
# Config
55

6-
This project uses the following JVM properties:
6+
This library uses the following JVM properties:
77
* `cryptomator.integrationsLinux.trayIconsDir` - specifies the directory from which svg images for the tray icon are loaded
8+
* `cryptomator.integrationsLinux.autoStartCmd` - specifies the command used for starting Cryptomator
89

10+
## Building Requirements
11+
12+
* JDK 22
13+
* Maven 3.9.6

pom.xml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>org.cryptomator</groupId>
77
<artifactId>integrations-linux</artifactId>
8-
<version>1.4.5</version>
8+
<version>1.5.0</version>
99

1010
<name>integrations-linux</name>
1111
<description>Provides optional Linux services used by Cryptomator</description>
@@ -40,17 +40,17 @@
4040

4141
<!-- runtime dependencies -->
4242

43-
<api.version>1.3.1</api.version>
43+
<api.version>1.4.0</api.version>
4444
<secret-service.version>2.0.1-alpha</secret-service.version>
4545
<kdewallet.version>1.4.0</kdewallet.version>
46-
<slf4j.version>2.0.13</slf4j.version>
47-
<appindicator.version>1.4.0</appindicator.version>
46+
<slf4j.version>2.0.16</slf4j.version>
47+
<appindicator.version>1.4.1</appindicator.version>
4848

4949
<!-- test dependencies -->
50-
<junit.version>5.10.2</junit.version>
50+
<junit.version>5.10.3</junit.version>
5151

5252
<!-- build plugin dependencies -->
53-
<dependency-check.version>9.1.0</dependency-check.version>
53+
<dependency-check.version>10.0.3</dependency-check.version>
5454
<nexus-staging.version>1.6.8</nexus-staging.version>
5555
</properties>
5656

@@ -87,6 +87,12 @@
8787
<version>${junit.version}</version>
8888
<scope>test</scope>
8989
</dependency>
90+
<dependency>
91+
<groupId>org.slf4j</groupId>
92+
<artifactId>slf4j-simple</artifactId>
93+
<version>${slf4j.version}</version>
94+
<scope>test</scope>
95+
</dependency>
9096
</dependencies>
9197

9298
<build>
@@ -102,12 +108,12 @@
102108
<plugin>
103109
<groupId>org.apache.maven.plugins</groupId>
104110
<artifactId>maven-surefire-plugin</artifactId>
105-
<version>3.2.5</version>
111+
<version>3.3.1</version>
106112
</plugin>
107113
<plugin>
108114
<groupId>org.apache.maven.plugins</groupId>
109115
<artifactId>maven-enforcer-plugin</artifactId>
110-
<version>3.4.1</version>
116+
<version>3.5.0</version>
111117
<executions>
112118
<execution>
113119
<id>check-preconditions</id>
@@ -140,7 +146,7 @@
140146
</plugin>
141147
<plugin>
142148
<artifactId>maven-javadoc-plugin</artifactId>
143-
<version>3.6.3</version>
149+
<version>3.8.0</version>
144150
<executions>
145151
<execution>
146152
<id>attach-javadocs</id>
@@ -242,10 +248,7 @@
242248
<goal>sign</goal>
243249
</goals>
244250
<configuration>
245-
<gpgArguments>
246-
<arg>--pinentry-mode</arg>
247-
<arg>loopback</arg>
248-
</gpgArguments>
251+
<signer>bc</signer>
249252
</configuration>
250253
</execution>
251254
</executions>
@@ -268,7 +271,7 @@
268271
<plugin>
269272
<groupId>org.sonatype.plugins</groupId>
270273
<artifactId>nexus-staging-maven-plugin</artifactId>
271-
<version>1.6.13</version>
274+
<version>1.7.0</version>
272275
<extensions>true</extensions>
273276
<configuration>
274277
<serverId>ossrh</serverId>

src/main/java/module-info.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
import org.cryptomator.integrations.autostart.AutoStartProvider;
12
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
3+
import org.cryptomator.integrations.quickaccess.QuickAccessService;
24
import org.cryptomator.integrations.revealpath.RevealPathService;
35
import org.cryptomator.integrations.tray.TrayMenuController;
6+
import org.cryptomator.linux.autostart.FreedesktopAutoStartService;
47
import org.cryptomator.linux.keychain.KDEWalletKeychainAccess;
58
import org.cryptomator.linux.keychain.SecretServiceKeychainAccess;
9+
import org.cryptomator.linux.quickaccess.DolphinPlaces;
10+
import org.cryptomator.linux.quickaccess.NautilusBookmarks;
611
import org.cryptomator.linux.revealpath.DBusSendRevealPathService;
712
import org.cryptomator.linux.tray.AppindicatorTrayMenuController;
813

@@ -14,9 +19,13 @@
1419
requires org.purejava.kwallet;
1520
requires de.swiesend.secretservice;
1621

22+
provides AutoStartProvider with FreedesktopAutoStartService;
1723
provides KeychainAccessProvider with SecretServiceKeychainAccess, KDEWalletKeychainAccess;
1824
provides RevealPathService with DBusSendRevealPathService;
1925
provides TrayMenuController with AppindicatorTrayMenuController;
26+
provides QuickAccessService with NautilusBookmarks, DolphinPlaces;
2027

2128
opens org.cryptomator.linux.tray to org.cryptomator.integrations.api;
29+
opens org.cryptomator.linux.quickaccess to org.cryptomator.integrations.api;
30+
opens org.cryptomator.linux.autostart to org.cryptomator.integrations.api;
2231
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package org.cryptomator.linux.autostart;
2+
3+
import org.cryptomator.integrations.autostart.AutoStartProvider;
4+
import org.cryptomator.integrations.autostart.ToggleAutoStartFailedException;
5+
import org.cryptomator.integrations.common.CheckAvailability;
6+
import org.cryptomator.integrations.common.OperatingSystem;
7+
import org.slf4j.Logger;
8+
import org.slf4j.LoggerFactory;
9+
10+
import java.io.IOException;
11+
import java.nio.file.Files;
12+
import java.nio.file.Path;
13+
import java.nio.file.StandardOpenOption;
14+
import java.util.Objects;
15+
16+
/**
17+
* Enables autostart for Linux desktop environments following the freedesktop standard.
18+
* <p>
19+
* This service is based on <a href=https://specifications.freedesktop.org/autostart-spec/autostart-spec-0.5.html>version 0.5 of the freedesktop autostart-spec</a>.
20+
*/
21+
@CheckAvailability
22+
@OperatingSystem(OperatingSystem.Value.LINUX)
23+
public class FreedesktopAutoStartService implements AutoStartProvider {
24+
25+
private static final Logger LOG = LoggerFactory.getLogger(FreedesktopAutoStartService.class);
26+
private static final String CMD_PROPERTY = "cryptomator.integrationsLinux.autoStartCmd";
27+
private static final String AUTOSTART_FILENAME = "Cryptomator.desktop";
28+
private static final String CONTENT_TEMPLATE = """
29+
[Desktop Entry]
30+
Type=Application
31+
Exec=%s
32+
Hidden=false
33+
NoDisplay=false
34+
X-GNOME-Autostart-enabled=true
35+
Name=Cryptomator
36+
Comment=Created with %s
37+
""";
38+
39+
private final Path autostartFile;
40+
private final String content;
41+
private final boolean hasExecValue;
42+
43+
public FreedesktopAutoStartService() {
44+
var xdgConfigDirString = Objects.requireNonNullElse(System.getenv("XDG_CONFIG_HOME"), System.getProperty("user.home") + "/.config");
45+
this.autostartFile = Path.of(xdgConfigDirString, "autostart", AUTOSTART_FILENAME);
46+
47+
var execValue = System.getProperty(CMD_PROPERTY,"");
48+
this.hasExecValue = !execValue.isBlank();
49+
this.content = CONTENT_TEMPLATE.formatted(execValue, this.getClass().getName());
50+
}
51+
52+
@Override
53+
public synchronized void enable() throws ToggleAutoStartFailedException {
54+
try {
55+
Files.writeString(autostartFile, content, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
56+
} catch (IOException e) {
57+
throw new ToggleAutoStartFailedException("Failed to activate Cryptomator autostart for GNOME desktop environment.", e);
58+
}
59+
}
60+
61+
@Override
62+
public synchronized void disable() throws ToggleAutoStartFailedException {
63+
try {
64+
Files.deleteIfExists(autostartFile);
65+
} catch (IOException e) {
66+
throw new ToggleAutoStartFailedException("Failed to deactivate Cryptomator autostart for GNOME desktop environment.", e);
67+
}
68+
}
69+
70+
@Override
71+
public synchronized boolean isEnabled() {
72+
return Files.exists(autostartFile);
73+
}
74+
75+
@CheckAvailability
76+
public boolean isSupported() {
77+
//TODO: might need to research which Desktop Environments support this
78+
return hasExecValue && Files.exists(autostartFile.getParent());
79+
}
80+
81+
}

src/main/java/org/cryptomator/linux/keychain/KDEWalletKeychainAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public boolean isLocked() {
4848
}
4949

5050
@Override
51-
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
51+
public void storePassphrase(String key, String displayName, CharSequence passphrase, boolean ignored) throws KeychainAccessException {
5252
CheckUtil.checkState(wallet.isPresent(), "Keychain not supported.");
5353
wallet.get().storePassphrase(key, passphrase);
5454
}

src/main/java/org/cryptomator/linux/keychain/SecretServiceKeychainAccess.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@OperatingSystem(OperatingSystem.Value.LINUX)
1717
public class SecretServiceKeychainAccess implements KeychainAccessProvider {
1818

19-
private static Logger LOG = LoggerFactory.getLogger(SecretServiceKeychainAccess.class);
19+
private static final Logger LOG = LoggerFactory.getLogger(SecretServiceKeychainAccess.class);
2020

2121
private final String LABEL_FOR_SECRET_IN_KEYRING = "Cryptomator";
2222

@@ -29,8 +29,11 @@ public String displayName() {
2929
public boolean isSupported() {
3030
try {
3131
return SimpleCollection.isAvailable();
32-
} catch (ExceptionInInitializerError e) {
33-
LOG.warn("Initializing secret service keychain access failed", e.getException());
32+
} catch (RuntimeException e) {
33+
LOG.warn("Initializing secret service keychain access failed", e);
34+
return false;
35+
} catch (ExceptionInInitializerError err) {
36+
LOG.warn("Initializing secret service keychain access failed", err.getException());
3437
return false;
3538
}
3639
}
@@ -45,7 +48,7 @@ public boolean isLocked() {
4548
}
4649

4750
@Override
48-
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
51+
public void storePassphrase(String key, String displayName, CharSequence passphrase, boolean ignored) throws KeychainAccessException {
4952
try (SimpleCollection keyring = new SimpleCollection()) {
5053
List<String> list = keyring.getItems(createAttributes(key));
5154
if (list == null || list.isEmpty()) {

0 commit comments

Comments
 (0)