mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-09-09 09:36:38 +00:00
Merge branch 'develop' into feature/dialog-builder
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ public final class GoogleDriveMacLocationPresetsProvider implements LocationPres
|
||||
*/
|
||||
private String getDriveLocationString(Path accountPath) {
|
||||
String accountName = accountPath.getFileName().toString().replace("GoogleDrive-", "");
|
||||
return STR."Google Drive - \{accountName}";
|
||||
return "Google Drive - " + accountName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -160,7 +160,7 @@ public class Mounter {
|
||||
var mountService = mountProviders.stream().filter(s -> s.getClass().getName().equals(vaultSettings.mountService.getValue())).findFirst().orElse(defaultMountService.getValue());
|
||||
|
||||
if (isConflictingMountService(mountService)) {
|
||||
var msg = STR."\{mountService.getClass()} unavailable due to conflict with either of \{CONFLICTING_MOUNT_SERVICES.get(mountService.getClass().getName())}";
|
||||
var msg = mountService.getClass() + " unavailable due to conflict with either of " + CONFLICTING_MOUNT_SERVICES.get(mountService.getClass().getName());
|
||||
throw new ConflictingMountServiceException(msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ public interface ErrorComponent {
|
||||
default Stage show() {
|
||||
Stage stage = window();
|
||||
stage.setScene(scene());
|
||||
stage.setMinWidth(420);
|
||||
stage.setMinHeight(300);
|
||||
stage.show();
|
||||
return stage;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ public interface HealthCheckComponent {
|
||||
default Stage showHealthCheckWindow() {
|
||||
Stage stage = window();
|
||||
stage.setScene(startScene().get());
|
||||
stage.setMinWidth(420);
|
||||
stage.setMinHeight(300);
|
||||
stage.show();
|
||||
return stage;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class HubConfig {
|
||||
public String devicesResourceUrl;
|
||||
|
||||
/**
|
||||
* A collection of String template processors to construct URIs related to this Hub instance.
|
||||
* A collection of functions to construct URIs related to this Hub instance.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public final URIProcessors URIs = new URIProcessors();
|
||||
@@ -49,14 +49,20 @@ public class HubConfig {
|
||||
|
||||
public class URIProcessors {
|
||||
|
||||
public final URIProcessor API = this::fromApiEndpoint;
|
||||
|
||||
/**
|
||||
* Resolves paths relative to the <code>/api/</code> endpoint of this Hub instance.
|
||||
*/
|
||||
public final StringTemplate.Processor<URI, RuntimeException> API = template -> {
|
||||
var path = template.interpolate();
|
||||
public URI fromApiEndpoint(String path) {
|
||||
var relPath = path.startsWith("/") ? path.substring(1) : path;
|
||||
return getApiBaseUrl().resolve(relPath);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface URIProcessor {
|
||||
|
||||
URI resolve(String path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ReceiveKeyController implements FxController {
|
||||
* STEP 0 (Request): GET /api/config
|
||||
*/
|
||||
private void requestApiConfig() {
|
||||
var configUri = hubConfig.URIs.API."config";
|
||||
var configUri = hubConfig.URIs.API.resolve("config");
|
||||
var request = HttpRequest.newBuilder(configUri) //
|
||||
.GET() //
|
||||
.timeout(REQ_TIMEOUT) //
|
||||
@@ -122,7 +122,7 @@ public class ReceiveKeyController implements FxController {
|
||||
* STEP 1 (Request): GET user key for this device
|
||||
*/
|
||||
private void requestDeviceData() {
|
||||
var deviceUri = hubConfig.URIs.API."devices/\{deviceId}";
|
||||
var deviceUri = hubConfig.URIs.API.resolve("devices/" + deviceId);
|
||||
var request = HttpRequest.newBuilder(deviceUri) //
|
||||
.header("Authorization", "Bearer " + bearerToken) //
|
||||
.GET() //
|
||||
@@ -162,7 +162,7 @@ public class ReceiveKeyController implements FxController {
|
||||
* STEP 2 (Request): GET vault key for this user
|
||||
*/
|
||||
private void requestVaultMasterkey(String encryptedUserKey) {
|
||||
var vaultKeyUri = hubConfig.URIs.API."vaults/\{vaultId}/access-token";
|
||||
var vaultKeyUri = hubConfig.URIs.API.resolve("vaults/" + vaultId + "/access-token");
|
||||
var request = HttpRequest.newBuilder(vaultKeyUri) //
|
||||
.header("Authorization", "Bearer " + bearerToken) //
|
||||
.GET() //
|
||||
@@ -205,7 +205,7 @@ public class ReceiveKeyController implements FxController {
|
||||
*/
|
||||
@Deprecated
|
||||
private void requestLegacyAccessToken() {
|
||||
var legacyAccessTokenUri = hubConfig.URIs.API."vaults/\{vaultId}/keys/\{deviceId}";
|
||||
var legacyAccessTokenUri = hubConfig.URIs.API.resolve("vaults/" + vaultId + "/keys/" + deviceId);
|
||||
var request = HttpRequest.newBuilder(legacyAccessTokenUri) //
|
||||
.header("Authorization", "Bearer " + bearerToken) //
|
||||
.GET() //
|
||||
|
||||
@@ -115,7 +115,7 @@ public class RegisterDeviceController implements FxController {
|
||||
workInProgress.set(true);
|
||||
|
||||
|
||||
var userReq = HttpRequest.newBuilder(hubConfig.URIs.API."users/me") //
|
||||
var userReq = HttpRequest.newBuilder(hubConfig.URIs.API.resolve("users/me")) //
|
||||
.GET() //
|
||||
.timeout(REQ_TIMEOUT) //
|
||||
.header("Authorization", "Bearer " + bearerToken) //
|
||||
@@ -143,7 +143,7 @@ public class RegisterDeviceController implements FxController {
|
||||
var now = Instant.now().toString();
|
||||
var dto = new CreateDeviceDto(deviceId, deviceNameField.getText(), BaseEncoding.base64().encode(deviceKeyPair.getPublic().getEncoded()), "DESKTOP", jwe.serialize(), now);
|
||||
var json = toJson(dto);
|
||||
var deviceUri = hubConfig.URIs.API."devices/\{deviceId}";
|
||||
var deviceUri = hubConfig.URIs.fromApiEndpoint("devices/" + deviceId);
|
||||
var putDeviceReq = HttpRequest.newBuilder(deviceUri) //
|
||||
.PUT(HttpRequest.BodyPublishers.ofString(json, StandardCharsets.UTF_8)) //
|
||||
.timeout(REQ_TIMEOUT) //
|
||||
@@ -164,7 +164,7 @@ public class RegisterDeviceController implements FxController {
|
||||
private void migrateLegacyDevices(ECPublicKey userPublicKey) {
|
||||
try {
|
||||
// GET legacy access tokens
|
||||
var getUri = hubConfig.URIs.API."devices/\{deviceId}/legacy-access-tokens";
|
||||
var getUri = hubConfig.URIs.API.resolve("devices/" + deviceId + "/legacy-access-tokens");
|
||||
var getReq = HttpRequest.newBuilder(getUri).GET().timeout(REQ_TIMEOUT).header("Authorization", "Bearer " + bearerToken).build();
|
||||
var getRes = httpClient.send(getReq, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
|
||||
if (getRes.statusCode() != 200) {
|
||||
@@ -185,12 +185,12 @@ public class RegisterDeviceController implements FxController {
|
||||
LOG.warn("Failed to decrypt legacy access token for vault {}. Skipping migration.", entry.getKey());
|
||||
}
|
||||
}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
var postUri = hubConfig.URIs.API."users/me/access-tokens";
|
||||
var postUri = hubConfig.URIs.fromApiEndpoint("users/me/access-tokens");
|
||||
var postBody = JSON.writer().writeValueAsString(newAccessTokens);
|
||||
var postReq = HttpRequest.newBuilder(postUri).POST(HttpRequest.BodyPublishers.ofString(postBody)).timeout(REQ_TIMEOUT).header("Authorization", "Bearer " + bearerToken).build();
|
||||
var postRes = httpClient.send(postReq, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
|
||||
if (postRes.statusCode() != 200) {
|
||||
throw new IOException(STR."Unexpected response from POST \{postUri}: \{postRes.statusCode()}");
|
||||
throw new IOException("Unexpected response from POST " + postUri + ": " + postRes.statusCode());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// log and ignore: this is merely a best-effort attempt of migrating legacy devices. Failure is uncritical as this is merely a convenience feature.
|
||||
|
||||
@@ -113,6 +113,10 @@ public class VaultListController implements FxController {
|
||||
vaultList.setItems(vaults);
|
||||
vaultList.setCellFactory(cellFactory);
|
||||
|
||||
vaultList.prefHeightProperty().bind(
|
||||
vaultList.fixedCellSizeProperty().multiply(Bindings.size(vaultList.getItems()))
|
||||
);
|
||||
|
||||
selectedVault.bind(vaultList.getSelectionModel().selectedItemProperty());
|
||||
vaults.addListener((ListChangeListener.Change<? extends Vault> c) -> {
|
||||
while (c.next()) {
|
||||
|
||||
@@ -57,9 +57,14 @@ public class GeneralVaultOptionsController implements FxController {
|
||||
}
|
||||
|
||||
private void trimVaultNameOnFocusLoss(Observable observable, Boolean wasFocussed, Boolean isFocussed) {
|
||||
var displayNameSetting = vault.getVaultSettings().displayName;
|
||||
if (!isFocussed) {
|
||||
var trimmed = vaultName.getText().trim();
|
||||
vault.getVaultSettings().displayName.set(trimmed);
|
||||
if (!trimmed.isEmpty()) {
|
||||
displayNameSetting.set(trimmed); //persist changes
|
||||
} else {
|
||||
vaultName.setText(displayNameSetting.get()); //revert changes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
<children>
|
||||
<HBox VBox.vgrow="ALWAYS">
|
||||
<VBox alignment="CENTER" minWidth="175" maxWidth="175">
|
||||
<ImageView VBox.vgrow="ALWAYS" fitHeight="128" preserveRatio="true" smooth="true" cache="true">
|
||||
<Image url="@../img/logo.png"/>
|
||||
<ImageView VBox.vgrow="ALWAYS" fitHeight="128" preserveRatio="true" cache="true">
|
||||
<Image url="@../img/logo128.png"/>
|
||||
</ImageView>
|
||||
</VBox>
|
||||
<VBox HBox.hgrow="ALWAYS" alignment="CENTER">
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
</padding>
|
||||
<children>
|
||||
<HBox spacing="12" VBox.vgrow="NEVER">
|
||||
<ImageView VBox.vgrow="ALWAYS" fitHeight="64" preserveRatio="true" smooth="true" cache="true">
|
||||
<Image url="@../img/logo.png"/>
|
||||
<ImageView VBox.vgrow="ALWAYS" fitHeight="64" preserveRatio="true" cache="true">
|
||||
<Image url="@../img/logo64.png"/>
|
||||
</ImageView>
|
||||
<VBox spacing="3" HBox.hgrow="ALWAYS" alignment="CENTER_LEFT">
|
||||
<FormattedLabel styleClass="label-extra-large" format="Cryptomator %s" arg1="${controller.fullApplicationVersion}"/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
xmlns="http://javafx.com/javafx"
|
||||
fx:controller="org.cryptomator.ui.mainwindow.VaultDetailMissingVaultController"
|
||||
alignment="TOP_CENTER"
|
||||
spacing="24">
|
||||
spacing="9">
|
||||
<children>
|
||||
<VBox spacing="9" alignment="CENTER">
|
||||
<StackPane alignment="CENTER">
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
xmlns="http://javafx.com/javafx"
|
||||
fx:controller="org.cryptomator.ui.mainwindow.WelcomeController"
|
||||
alignment="CENTER"
|
||||
spacing="24">
|
||||
spacing="9">
|
||||
<children>
|
||||
<ImageView VBox.vgrow="ALWAYS" fitHeight="128" preserveRatio="true" smooth="true" cache="true">
|
||||
<Image url="@../img/logo.png"/>
|
||||
<ImageView VBox.vgrow="ALWAYS" fitHeight="128" preserveRatio="true" cache="true">
|
||||
<Image url="@../img/logo128.png"/>
|
||||
</ImageView>
|
||||
|
||||
<TextFlow styleClass="text-flow" prefWidth="-Infinity" visible="${controller.noVaultPresent}" managed="${controller.noVaultPresent}">
|
||||
|
||||
@@ -18,11 +18,14 @@
|
||||
minWidth="206">
|
||||
<VBox>
|
||||
<StackPane VBox.vgrow="ALWAYS">
|
||||
<ListView fx:id="vaultList" editable="true" fixedCellSize="${controller.cellSize}">
|
||||
<contextMenu>
|
||||
<fx:include source="vault_list_contextmenu.fxml"/>
|
||||
</contextMenu>
|
||||
</ListView>
|
||||
<VBox>
|
||||
<ListView fx:id="vaultList" editable="true" fixedCellSize="${controller.cellSize}">
|
||||
<contextMenu>
|
||||
<fx:include source="vault_list_contextmenu.fxml"/>
|
||||
</contextMenu>
|
||||
</ListView>
|
||||
<Region VBox.vgrow="ALWAYS" styleClass="list-view"/>
|
||||
</VBox>
|
||||
<VBox visible="${controller.emptyVaultList}" spacing="6" alignment="CENTER">
|
||||
<Region VBox.vgrow="ALWAYS"/>
|
||||
<Label VBox.vgrow="NEVER" text="%main.vaultlist.emptyList.onboardingInstruction" textAlignment="CENTER" wrapText="true"/>
|
||||
|
||||
@@ -14,6 +14,7 @@ generic.button.copied=Copied!
|
||||
generic.button.done=Done
|
||||
generic.button.next=Next
|
||||
generic.button.print=Print
|
||||
generic.button.remove=Remove
|
||||
|
||||
# Error
|
||||
error.message=An error occurred
|
||||
@@ -106,7 +107,6 @@ addvaultwizard.success.unlockNow=Unlock Now
|
||||
removeVault.title=Remove "%s"
|
||||
removeVault.message=Remove vault?
|
||||
removeVault.description=This will only make Cryptomator forget about this vault. You can add it again. No encrypted files will be deleted from your hard drive.
|
||||
removeVault.confirmBtn=Remove Vault
|
||||
|
||||
# Change Password
|
||||
changepassword.title=Change Password
|
||||
@@ -344,7 +344,6 @@ preferences.contribute.sponsor=Sponsor
|
||||
removeCert.title=Remove Certificate
|
||||
removeCert.message=Remove supporter certificate?
|
||||
removeCert.description=Cryptomator's core features are not affected by this. Neither access to your vaults is restricted nor the level of security is lowered.
|
||||
removeCert.confirmBtn=Remove
|
||||
#<-- Add entries for donations and code/translation/documentation contribution -->
|
||||
|
||||
## About
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
Reference in New Issue
Block a user