mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-17 10:11:27 +00:00
Compare commits
2 Commits
feature/jd
...
feature/hy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d521c3f78 | ||
|
|
737d7e6317 |
5
.github/workflows/release-check.yml
vendored
5
.github/workflows/release-check.yml
vendored
@@ -57,6 +57,11 @@ jobs:
|
|||||||
dependency-check
|
dependency-check
|
||||||
env:
|
env:
|
||||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
|
||||||
|
- name: Validate urls used in app
|
||||||
|
uses: urlstechie/urlchecker-action@0.0.34
|
||||||
|
with:
|
||||||
|
file_types: .md,.json
|
||||||
|
include_files: README.md,src/main/resources/hyperlinks.json
|
||||||
- name: Run org.owasp:dependency-check plugin
|
- name: Run org.owasp:dependency-check plugin
|
||||||
id: dependency-check
|
id: dependency-check
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
31
src/main/java/org/cryptomator/common/Hyperlinks.java
Normal file
31
src/main/java/org/cryptomator/common/Hyperlinks.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package org.cryptomator.common;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public record Hyperlinks(String docsVolumeType, String docsGettingStarted, String homepageHub) {
|
||||||
|
|
||||||
|
private static final ObjectMapper JSON_DESERIALIZER = new ObjectMapper();
|
||||||
|
/*
|
||||||
|
String docsAccessingVaults;
|
||||||
|
String docsExpertSettings;
|
||||||
|
String docsManualMigration;
|
||||||
|
String homepageDownload;
|
||||||
|
String homepageHub;
|
||||||
|
String homepageDonate;
|
||||||
|
String homepageSponsors;
|
||||||
|
String storeDesktop;
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public static Hyperlinks load() {
|
||||||
|
try {
|
||||||
|
return JSON_DESERIALIZER.readValue(Hyperlinks.class.getResource("/hyperlinks.json"), Hyperlinks.class);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package org.cryptomator.launcher;
|
|||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
|
import org.cryptomator.common.Hyperlinks;
|
||||||
import org.cryptomator.integrations.autostart.AutoStartProvider;
|
import org.cryptomator.integrations.autostart.AutoStartProvider;
|
||||||
import org.cryptomator.integrations.tray.TrayIntegrationProvider;
|
import org.cryptomator.integrations.tray.TrayIntegrationProvider;
|
||||||
import org.cryptomator.integrations.uiappearance.UiAppearanceProvider;
|
import org.cryptomator.integrations.uiappearance.UiAppearanceProvider;
|
||||||
@@ -23,6 +24,12 @@ class CryptomatorModule {
|
|||||||
return ResourceBundle.getBundle("i18n.strings");
|
return ResourceBundle.getBundle("i18n.strings");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
static Hyperlinks provideHyperlinks() {
|
||||||
|
return Hyperlinks.load();
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
@Named("launchEventQueue")
|
@Named("launchEventQueue")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.cryptomator.ui.sharevault;
|
package org.cryptomator.ui.sharevault;
|
||||||
|
|
||||||
import dagger.Lazy;
|
import dagger.Lazy;
|
||||||
|
import org.cryptomator.common.Hyperlinks;
|
||||||
import org.cryptomator.common.vaults.Vault;
|
import org.cryptomator.common.vaults.Vault;
|
||||||
import org.cryptomator.ui.common.FxController;
|
import org.cryptomator.ui.common.FxController;
|
||||||
import org.cryptomator.ui.keyloading.hub.HubKeyLoadingStrategy;
|
import org.cryptomator.ui.keyloading.hub.HubKeyLoadingStrategy;
|
||||||
@@ -18,9 +19,9 @@ import java.net.URISyntaxException;
|
|||||||
public class ShareVaultController implements FxController {
|
public class ShareVaultController implements FxController {
|
||||||
|
|
||||||
private static final String SCHEME_PREFIX = "hub+";
|
private static final String SCHEME_PREFIX = "hub+";
|
||||||
private static final String VISIT_HUB_URL = "https://cryptomator.org/hub/";
|
|
||||||
private static final String BEST_PRACTICES_URL = "https://docs.cryptomator.org/en/latest/security/best-practices/#sharing-of-vaults";
|
private static final String BEST_PRACTICES_URL = "https://docs.cryptomator.org/en/latest/security/best-practices/#sharing-of-vaults";
|
||||||
|
|
||||||
|
private final String VISIT_HUB_URL;
|
||||||
private final Stage window;
|
private final Stage window;
|
||||||
private final Lazy<Application> application;
|
private final Lazy<Application> application;
|
||||||
private final Vault vault;
|
private final Vault vault;
|
||||||
@@ -29,10 +30,12 @@ public class ShareVaultController implements FxController {
|
|||||||
@Inject
|
@Inject
|
||||||
ShareVaultController(@ShareVaultWindow Stage window, //
|
ShareVaultController(@ShareVaultWindow Stage window, //
|
||||||
Lazy<Application> application, //
|
Lazy<Application> application, //
|
||||||
|
Hyperlinks links, //
|
||||||
@ShareVaultWindow Vault vault) {
|
@ShareVaultWindow Vault vault) {
|
||||||
this.window = window;
|
this.window = window;
|
||||||
this.application = application;
|
this.application = application;
|
||||||
this.vault = vault;
|
this.vault = vault;
|
||||||
|
this.VISIT_HUB_URL =links.homepageHub();
|
||||||
var vaultScheme = vault.getVaultConfigCache().getUnchecked().getKeyId().getScheme();
|
var vaultScheme = vault.getVaultConfigCache().getUnchecked().getKeyId().getScheme();
|
||||||
this.hubVault = (vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTP) || vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTPS));
|
this.hubVault = (vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTP) || vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTPS));
|
||||||
}
|
}
|
||||||
|
|||||||
4
src/main/resources/hyperlinks.json
Normal file
4
src/main/resources/hyperlinks.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"docsGettingStarted": "https://docs.cryptomator.org/desktop/getting-started/",
|
||||||
|
"homepageHub": "https://cryptomator.org/hub"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user