From 8ba2540b35b1e981f2f231a468564565b4b02693 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Mon, 11 Sep 2023 14:23:31 +0200 Subject: [PATCH 01/71] implemented volume type selection in 'vault options mount' --- .../vaultoptions/MountOptionsController.java | 126 ++++++++++++++++-- .../resources/fxml/vault_options_mount.fxml | 29 +++- 2 files changed, 140 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java b/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java index 5eeab43e0..4e97e7fd5 100644 --- a/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java +++ b/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java @@ -1,18 +1,26 @@ package org.cryptomator.ui.vaultoptions; import com.google.common.base.Strings; +import dagger.Lazy; +import org.cryptomator.common.ObservableUtil; import org.cryptomator.common.mount.ActualMountService; +import org.cryptomator.common.mount.MountModule; import org.cryptomator.common.mount.WindowsDriveLetters; +import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.VaultSettings; import org.cryptomator.common.vaults.Vault; import org.cryptomator.integrations.mount.MountCapability; +import org.cryptomator.integrations.mount.MountService; import org.cryptomator.ui.common.FxController; -import org.cryptomator.ui.fxapp.FxApplicationWindows; -import org.cryptomator.ui.preferences.SelectedPreferencesTab; import javax.inject.Inject; +import javax.inject.Named; +import javafx.application.Application; +import javafx.beans.binding.Bindings; +import javafx.beans.binding.BooleanExpression; import javafx.beans.value.ObservableValue; import javafx.fxml.FXML; +import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.ChoiceBox; import javafx.scene.control.RadioButton; @@ -26,16 +34,25 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; +import java.util.List; +import java.util.Optional; import java.util.ResourceBundle; import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; @VaultOptionsScoped public class MountOptionsController implements FxController { + private static final String DOCS_MOUNTING_URL = "https://docs.cryptomator.org/en/1.7/desktop/volume-type/"; + private static final int MIN_PORT = 1024; + private static final int MAX_PORT = 65535; + private final Stage window; private final VaultSettings vaultSettings; private final WindowsDriveLetters windowsDriveLetters; private final ResourceBundle resourceBundle; + private final Lazy application; + private final Settings settings; private final ObservableValue defaultMountFlags; private final ObservableValue mountpointDirSupported; @@ -43,7 +60,10 @@ public class MountOptionsController implements FxController { private final ObservableValue readOnlySupported; private final ObservableValue mountFlagsSupported; private final ObservableValue directoryPath; - private final FxApplicationWindows applicationWindows; + private final List mountProviders; + private final ObservableValue selectedMountService; + private final ObservableValue fuseRestartRequired; + private final BooleanExpression loopbackPortSupported; //-- FXML objects -- @@ -56,9 +76,21 @@ public class MountOptionsController implements FxController { public RadioButton mountPointDirBtn; public TextField directoryPathField; public ChoiceBox driveLetterSelection; + public ChoiceBox volumeTypeChoiceBox; + public TextField loopbackPortField; + public Button loopbackPortApplyButton; + @Inject - MountOptionsController(@VaultOptionsWindow Stage window, @VaultOptionsWindow Vault vault, ObservableValue mountService, WindowsDriveLetters windowsDriveLetters, ResourceBundle resourceBundle, FxApplicationWindows applicationWindows) { + MountOptionsController(@VaultOptionsWindow Stage window, // + @VaultOptionsWindow Vault vault, // + ObservableValue mountService, // + WindowsDriveLetters windowsDriveLetters, // + ResourceBundle resourceBundle, // + Lazy application, + Settings settings, // + List mountProviders, // + @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService) { this.window = window; this.vaultSettings = vault.getVaultSettings(); this.windowsDriveLetters = windowsDriveLetters; @@ -75,7 +107,17 @@ public class MountOptionsController implements FxController { this.mountFlagsSupported = mountService.map(as -> as.service().hasCapability(MountCapability.MOUNT_FLAGS)); this.readOnlySupported = mountService.map(as -> as.service().hasCapability(MountCapability.READ_ONLY)); this.directoryPath = vault.getVaultSettings().mountPoint.map(p -> isDriveLetter(p) ? null : p.toString()); - this.applicationWindows = applicationWindows; + this.application = application; + this.settings = settings; + this.mountProviders = mountProviders; + var fallbackProvider = mountProviders.stream().findFirst().orElse(null); + this.selectedMountService = ObservableUtil.mapWithDefault(settings.mountService, serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), fallbackProvider); + this.fuseRestartRequired = selectedMountService.map(s -> {// + return firstUsedProblematicFuseMountService.get() != null // + && MountModule.isProblematicFuseService(s) // + && !firstUsedProblematicFuseMountService.get().equals(s); + }); + this.loopbackPortSupported = BooleanExpression.booleanExpression(selectedMountService.map(s -> s.hasCapability(MountCapability.LOOPBACK_PORT))); } @FXML @@ -106,11 +148,21 @@ public class MountOptionsController implements FxController { mountPointToggleGroup.selectToggle(mountPointDirBtn); } mountPointToggleGroup.selectedToggleProperty().addListener(this::selectedToggleChanged); - } - @FXML - public void openVolumePreferences() { - applicationWindows.showPreferencesWindow(SelectedPreferencesTab.VOLUME); + volumeTypeChoiceBox.getItems().add(null); + volumeTypeChoiceBox.getItems().addAll(mountProviders); + volumeTypeChoiceBox.setConverter(new MountServiceConverter()); + boolean autoSelected = settings.mountService.get() == null; + volumeTypeChoiceBox.getSelectionModel().select(autoSelected ? null : selectedMountService.getValue()); + volumeTypeChoiceBox.valueProperty().addListener((observableValue, oldProvider, newProvider) -> { + var toSet = Optional.ofNullable(newProvider).map(nP -> nP.getClass().getName()).orElse(null); + settings.mountService.set(toSet); + }); + + loopbackPortField.setText(String.valueOf(settings.port.get())); + loopbackPortApplyButton.visibleProperty().bind(settings.port.asString().isNotEqualTo(loopbackPortField.textProperty())); + loopbackPortApplyButton.disableProperty().bind(Bindings.createBooleanBinding(this::validateLoopbackPort, loopbackPortField.textProperty()).not()); + } @FXML @@ -229,6 +281,26 @@ public class MountOptionsController implements FxController { } + public void openDocs() { + application.get().getHostServices().showDocument(DOCS_MOUNTING_URL); + } + + private boolean validateLoopbackPort() { + try { + int port = Integer.parseInt(loopbackPortField.getText()); + return port == 0 // choose port automatically + || port >= MIN_PORT && port <= MAX_PORT; // port within range + } catch (NumberFormatException e) { + return false; + } + } + + public void doChangeLoopbackPort() { + if (validateLoopbackPort()) { + settings.port.set(Integer.parseInt(loopbackPortField.getText())); + } + } + //@formatter:off private static class NoDirSelectedException extends Exception {} //@formatter:on @@ -274,4 +346,40 @@ public class MountOptionsController implements FxController { public String getDirectoryPath() { return directoryPath.getValue(); } + + public ObservableValue fuseRestartRequiredProperty() { + return fuseRestartRequired; + } + + public boolean getFuseRestartRequired() { + return fuseRestartRequired.getValue(); + } + + public BooleanExpression loopbackPortSupportedProperty() { + return loopbackPortSupported; + } + + public boolean isLoopbackPortSupported() { + return loopbackPortSupported.get(); + } + + //Helpers + /* Helpers */ + + private class MountServiceConverter extends StringConverter { + + @Override + public String toString(MountService provider) { + if (provider == null) { + return resourceBundle.getString("preferences.volume.type.automatic"); + } else { + return provider.displayName(); + } + } + + @Override + public MountService fromString(String string) { + throw new UnsupportedOperationException(); + } + } } diff --git a/src/main/resources/fxml/vault_options_mount.fxml b/src/main/resources/fxml/vault_options_mount.fxml index 762d36d27..921747132 100644 --- a/src/main/resources/fxml/vault_options_mount.fxml +++ b/src/main/resources/fxml/vault_options_mount.fxml @@ -1,6 +1,7 @@ + @@ -12,7 +13,7 @@ - + - - + + + + From e7e88f13e3d096c7e61b6fbf87afde8ebcf10377 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Fri, 17 Nov 2023 14:51:13 +0100 Subject: [PATCH 21/71] improved code quality --- .../java/org/cryptomator/common/CommonsModule.java | 13 ------------- .../cryptomator/common/vaults/VaultListManager.java | 2 -- .../ui/preferences/VolumePreferencesController.java | 6 +----- .../unlock/UnlockFuseRestartRequiredController.java | 9 +++++++++ .../org/cryptomator/ui/unlock/UnlockWorkflow.java | 5 ----- .../cryptomator/common/settings/SettingsTest.java | 8 ++++++-- 6 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/main/java/org/cryptomator/common/CommonsModule.java b/src/main/java/org/cryptomator/common/CommonsModule.java index 9cba60131..5ea69da6d 100644 --- a/src/main/java/org/cryptomator/common/CommonsModule.java +++ b/src/main/java/org/cryptomator/common/CommonsModule.java @@ -7,12 +7,10 @@ package org.cryptomator.common; import dagger.Module; import dagger.Provides; -import org.apache.commons.lang3.SystemUtils; import org.cryptomator.common.keychain.KeychainModule; import org.cryptomator.common.mount.MountModule; import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.SettingsProvider; -import org.cryptomator.common.settings.VaultSettings; import org.cryptomator.common.vaults.VaultComponent; import org.cryptomator.common.vaults.VaultListModule; import org.cryptomator.cryptolib.common.MasterkeyFileAccess; @@ -23,8 +21,6 @@ import org.slf4j.LoggerFactory; import javax.inject.Named; import javax.inject.Singleton; -import javafx.beans.value.ObservableValue; -import java.net.InetSocketAddress; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Comparator; @@ -138,15 +134,6 @@ public abstract class CommonsModule { LOG.error("Uncaught exception in " + thread.getName(), throwable); } - @Provides - @Singleton - static ObservableValue provideServerSocketAddressBinding(VaultSettings vaultSettings) { - return vaultSettings.port.map(port -> { - String host = SystemUtils.IS_OS_WINDOWS ? "127.0.0.1" : "localhost"; - return InetSocketAddress.createUnresolved(host, vaultSettings.port.intValue()); - }); - } - @Provides @Singleton @Named("FUPFMS") diff --git a/src/main/java/org/cryptomator/common/vaults/VaultListManager.java b/src/main/java/org/cryptomator/common/vaults/VaultListManager.java index 0351981a0..cbcc281ac 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultListManager.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultListManager.java @@ -73,8 +73,6 @@ public class VaultListManager { private VaultSettings newVaultSettings(Path path) { VaultSettings vaultSettings = VaultSettings.withRandomId(); vaultSettings.path.set(path); - vaultSettings.mountService.set(vaultSettings.mountService.getValue()); - vaultSettings.port.set(vaultSettings.port.getValue()); if (path.getFileName() != null) { vaultSettings.displayName.set(path.getFileName().toString()); } else { diff --git a/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java index fbd5d11ec..c06a4596b 100644 --- a/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java @@ -3,13 +3,11 @@ package org.cryptomator.ui.preferences; import dagger.Lazy; import org.cryptomator.common.ObservableUtil; import org.cryptomator.common.settings.Settings; -import org.cryptomator.common.vaults.VaultModule; import org.cryptomator.integrations.mount.MountCapability; import org.cryptomator.integrations.mount.MountService; import org.cryptomator.ui.common.FxController; import javax.inject.Inject; -import javax.inject.Named; import javafx.application.Application; import javafx.beans.value.ObservableValue; import javafx.scene.control.ChoiceBox; @@ -17,7 +15,6 @@ import javafx.util.StringConverter; import java.util.List; import java.util.Optional; import java.util.ResourceBundle; -import java.util.concurrent.atomic.AtomicReference; @PreferencesScoped public class VolumePreferencesController implements FxController { @@ -39,7 +36,6 @@ public class VolumePreferencesController implements FxController { VolumePreferencesController(Settings settings, Lazy application, List mountProviders, - @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService, ResourceBundle resourceBundle) { this.settings = settings; this.application = application; @@ -101,7 +97,7 @@ public class VolumePreferencesController implements FxController { /* Helpers */ - public class MountServiceConverter extends StringConverter { + private class MountServiceConverter extends StringConverter { @Override public String toString(MountService provider) { diff --git a/src/main/java/org/cryptomator/ui/unlock/UnlockFuseRestartRequiredController.java b/src/main/java/org/cryptomator/ui/unlock/UnlockFuseRestartRequiredController.java index 26ef4c7de..4f9e5649b 100644 --- a/src/main/java/org/cryptomator/ui/unlock/UnlockFuseRestartRequiredController.java +++ b/src/main/java/org/cryptomator/ui/unlock/UnlockFuseRestartRequiredController.java @@ -8,22 +8,31 @@ import org.cryptomator.ui.vaultoptions.SelectedVaultOptionsTab; import javax.inject.Inject; import javafx.fxml.FXML; import javafx.stage.Stage; +import java.util.ResourceBundle; @UnlockScoped public class UnlockFuseRestartRequiredController implements FxController { private final Stage window; + private final ResourceBundle resourceBundle; private final FxApplicationWindows appWindows; private final Vault vault; + @Inject UnlockFuseRestartRequiredController(@UnlockWindow Stage window, + ResourceBundle resourceBundle, FxApplicationWindows appWindows, @UnlockWindow Vault vault) { this.window = window; + this.resourceBundle = resourceBundle; this.appWindows = appWindows; this.vault = vault; } + public void initialize() { + window.setTitle(String.format(resourceBundle.getString("unlock.error.fuseRestartRequired.title"), vault.getDisplayName())); + } + @FXML public void close() { window.close(); diff --git a/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java b/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java index 7c776ad14..98385f1d6 100644 --- a/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java +++ b/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java @@ -23,7 +23,6 @@ import javafx.concurrent.Task; import javafx.scene.Scene; import javafx.stage.Stage; import java.io.IOException; -import java.util.ResourceBundle; /** * A multi-step task that consists of background activities as well as user interaction. @@ -36,7 +35,6 @@ public class UnlockWorkflow extends Task { private static final Logger LOG = LoggerFactory.getLogger(UnlockWorkflow.class); private final Stage window; - private final ResourceBundle resourceBundle; private final Vault vault; private final VaultService vaultService; private final Lazy successScene; @@ -48,7 +46,6 @@ public class UnlockWorkflow extends Task { @Inject UnlockWorkflow(@UnlockWindow Stage window, // - ResourceBundle resourceBundle, @UnlockWindow Vault vault, // VaultService vaultService, // @FxmlScene(FxmlFile.UNLOCK_SUCCESS) Lazy successScene, // @@ -58,7 +55,6 @@ public class UnlockWorkflow extends Task { @UnlockWindow KeyLoadingStrategy keyLoadingStrategy, // @UnlockWindow ObjectProperty illegalMountPointException) { this.window = window; - this.resourceBundle = resourceBundle; this.vault = vault; this.vaultService = vaultService; this.successScene = successScene; @@ -103,7 +99,6 @@ public class UnlockWorkflow extends Task { private void handleFuseRestartRequiredError(FuseRestartRequiredException fRRE) { Platform.runLater(() -> { window.setScene(fuseRestartRequiredScene.get()); - window.setTitle(String.format(resourceBundle.getString("unlock.error.fuseRestartRequired.title"), vault.getDisplayName())); window.show(); }); } diff --git a/src/test/java/org/cryptomator/common/settings/SettingsTest.java b/src/test/java/org/cryptomator/common/settings/SettingsTest.java index ee18b50c1..114b7f980 100644 --- a/src/test/java/org/cryptomator/common/settings/SettingsTest.java +++ b/src/test/java/org/cryptomator/common/settings/SettingsTest.java @@ -24,12 +24,16 @@ public class SettingsTest { Mockito.verify(changeListener, Mockito.times(0)).accept(settings); // first change (to property): - settings.directories.add(vaultSettings); + settings.windowXPosition.set(100); Mockito.verify(changeListener, Mockito.times(1)).accept(settings); // second change (to list): - vaultSettings.displayName.set("asd"); + settings.directories.add(vaultSettings); Mockito.verify(changeListener, Mockito.times(2)).accept(settings); + + // third change (to property of list item): + vaultSettings.displayName.set("asd"); + Mockito.verify(changeListener, Mockito.times(3)).accept(settings); } } From 1052e4c3d2a0d4a5efe72d8e28124ad4bdd8f8d5 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Thu, 23 Nov 2023 10:55:17 +0100 Subject: [PATCH 22/71] fix gui issues in vault mount settings --- .../vaultoptions/MountOptionsController.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java b/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java index 66c0b1685..9d28d8d9d 100644 --- a/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java +++ b/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java @@ -97,12 +97,15 @@ public class MountOptionsController implements FxController { this.application = application; this.mountProviders = mountProviders; var fallbackProvider = mountProviders.stream().findFirst().orElse(null); - this.defaultMountService = ObservableUtil.mapWithDefault(settings.mountService, serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), fallbackProvider); - this.selectedMountService = ObservableUtil.mapWithDefault(vaultSettings.mountService, serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(defaultMountService.getValue()), defaultMountService.getValue()); - this.fuseRestartRequired = selectedMountService.map(s -> // - firstUsedProblematicFuseMountService.get() != null // - && VaultModule.isProblematicFuseService(s) // - && !firstUsedProblematicFuseMountService.get().equals(s) + this.defaultMountService = ObservableUtil.mapWithDefault(settings.mountService, // + serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), // + fallbackProvider); + this.selectedMountService = Bindings.createObjectBinding(this::reselectMountService, defaultMountService, vaultSettings.mountService); + this.fuseRestartRequired = selectedMountService.map(s -> { + return firstUsedProblematicFuseMountService.get() != null // + && VaultModule.isProblematicFuseService(s) // + && !firstUsedProblematicFuseMountService.get().equals(s); + } ); this.loopbackPortSupported = BooleanExpression.booleanExpression(selectedMountService.map(s -> s.hasCapability(MountCapability.LOOPBACK_PORT))); @@ -119,8 +122,16 @@ public class MountOptionsController implements FxController { this.mountpointDriveLetterSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_AS_DRIVE_LETTER)); } + private MountService reselectMountService() { + var desired = vaultSettings.mountService.getValue(); + var defaultMS = defaultMountService.getValue(); + return mountProviders.stream().filter(s -> s.getClass().getName().equals(desired)).findFirst().orElse(defaultMS); + } + @FXML public void initialize() { + defaultMountService.addListener((_,_,_) -> vaultVolumeTypeChoiceBox.setConverter(new MountServiceConverter())); + // readonly: readOnlyCheckbox.selectedProperty().bindBidirectional(vaultSettings.usesReadOnlyMode); From 6bb5ed1d734f0aaa5be0c1445e02634f0b65ca4f Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 24 Nov 2023 11:19:44 +0100 Subject: [PATCH 23/71] fixes #3207 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3911795c2..609c36eb4 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 1.2.4 1.2.2 1.4.0-beta2 - 4.0.0-beta4 + 4.0.0-beta5 2.0.0 2.0.5 From 38c102a64b59ed2d6646edfcb491e6cf3328d979 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Mon, 27 Nov 2023 12:46:29 +0100 Subject: [PATCH 24/71] refactored code by removing unnecessary observables --- .../org/cryptomator/common/vaults/Vault.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/cryptomator/common/vaults/Vault.java b/src/main/java/org/cryptomator/common/vaults/Vault.java index afe5380c1..d617a5db3 100644 --- a/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -10,7 +10,6 @@ package org.cryptomator.common.vaults; import org.apache.commons.lang3.SystemUtils; import org.cryptomator.common.Constants; -import org.cryptomator.common.ObservableUtil; import org.cryptomator.common.mount.ActualMountService; import org.cryptomator.common.mount.FuseRestartRequiredException; import org.cryptomator.common.mount.Mounter; @@ -83,16 +82,16 @@ public class Vault { private final AtomicReference mountHandle = new AtomicReference<>(null); @Inject - Vault(Settings settings, - VaultSettings vaultSettings, - VaultConfigCache configCache, - AtomicReference cryptoFileSystem, - List mountProviders, - VaultState state, - @Named("lastKnownException") ObjectProperty lastKnownException, - VaultStats stats, - Mounter mounter, - @Named("vaultMountService") ObservableValue actualMountService, + Vault(Settings settings, // + VaultSettings vaultSettings, // + VaultConfigCache configCache, // + AtomicReference cryptoFileSystem, // + List mountProviders, // + VaultState state, // + @Named("lastKnownException") ObjectProperty lastKnownException, // + VaultStats stats, // + Mounter mounter, // + @Named("vaultMountService") ObservableValue actualMountService, // @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService) { this.settings = settings; this.vaultSettings = vaultSettings; @@ -167,13 +166,12 @@ public class Vault { throw new IllegalStateException("Already unlocked."); } var fallbackProvider = mountProviders.stream().findFirst().orElse(null); - var defMntServ = ObservableUtil.mapWithDefault(settings.mountService, serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), fallbackProvider).getValue(); - var selMntServ = ObservableUtil.mapWithDefault(vaultSettings.mountService, serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(defMntServ), defMntServ); - var fuseRestartRequired = selMntServ.map(s -> // - firstUsedProblematicFuseMountService.get() != null // - && VaultModule.isProblematicFuseService(s) // - && !firstUsedProblematicFuseMountService.get().equals(s)).getValue(); - if(fuseRestartRequired){ + var defMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(settings.mountService.getValue())).findFirst().orElse(fallbackProvider); + var selMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(vaultSettings.mountService.getValue())).findFirst().orElse(defMntServ); + var fuseRestartRequired = firstUsedProblematicFuseMountService.get() != null // + && VaultModule.isProblematicFuseService(selMntServ) // + && !firstUsedProblematicFuseMountService.get().equals(selMntServ); + if (fuseRestartRequired) { throw new FuseRestartRequiredException("fuseRestartRequired"); } From e940c29110edbdfffedad7db502e5eec0a12141c Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 28 Nov 2023 12:44:42 +0100 Subject: [PATCH 25/71] Closes #3226 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 609c36eb4..fd433c2ce 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ org.ow2.asm,org.apache.jackrabbit,org.apache.httpcomponents - 2.6.7 + 2.6.8 1.3.0 1.2.4 1.2.2 From 5b1ca7a533cdbd660e145841ee84a9ac4994ff6f Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 28 Nov 2023 12:59:39 +0100 Subject: [PATCH 26/71] update dependabot config --- .github/dependabot.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e15900880..0e12bbba9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,9 +8,36 @@ updates: time: "06:00" timezone: "UTC" groups: - maven-dependencies: + java-test-dependencies: + patterns: + - "org.junit.jupiter:*" + - "org.mockito:*" + - "org.hamcrest:*" + - "com.google.jimfs:jimfs" + maven-build-plugins: + patterns: + - "org.apache.maven.plugins:*" + - "org.jacoco:jacoco-maven-plugin" + - "org.owasp:dependency-check-maven" + - "me.fabriciorby:maven-surefire-junit5-tree-reporter" + - "org.codehaus.mojo:license-maven-plugin" + javafx: + patterns: + - "org.openjfx:*" + java-production-dependencies: patterns: - "*" + exclude-patterns: + - "org.openjfx:*" + - "org.apache.maven.plugins:*" + - "org.jacoco:jacoco-maven-plugin" + - "org.owasp:dependency-check-maven" + - "me.fabriciorby:maven-surefire-junit5-tree-reporter" + - "org.codehaus.mojo:license-maven-plugin" + - "org.junit.jupiter:*" + - "org.mockito:*" + - "org.hamcrest:*" + - "com.google.jimfs:jimfs" - package-ecosystem: "github-actions" directory: "/" # even for `.github/workflows` From dac3311b81009c8ca9c3e26639b5d0b259e8df6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:05:42 +0000 Subject: [PATCH 27/71] Bump the java-test-dependencies group with 2 updates (#3227) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fd433c2ce..6b27321c5 100644 --- a/pom.xml +++ b/pom.xml @@ -57,8 +57,8 @@ 1.8.2 - 5.10.0 - 5.6.0 + 5.10.1 + 5.7.0 2.2 From 93b09cf449b82c69b9a87f25ba112d358ac12736 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:19:58 +0000 Subject: [PATCH 28/71] Bump the java-production-dependencies group with 6 updates (#3230) --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 6b27321c5..ba72ba485 100644 --- a/pom.xml +++ b/pom.xml @@ -43,15 +43,15 @@ 2.0.5 - 3.13.0 + 3.14.0 2.48.1 2.2 32.1.3-jre - 2.15.3 + 2.16.0 20.0.2 4.4.0 - 9.37 - 1.4.11 + 9.37.1 + 1.4.12 2.0.9 0.8.0 1.8.2 @@ -62,7 +62,7 @@ 2.2 - 24.0.1 + 24.1.0 8.4.0 0.8.11 2.2.0 From 8382299a055b7fd01a2adafd0ebeafb68262529d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:20:39 +0000 Subject: [PATCH 29/71] Bump the maven-build-plugins group with 4 updates Bumps the maven-build-plugins group with 4 updates: [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin), [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire), [org.codehaus.mojo:license-maven-plugin](https://github.com/mojohaus/license-maven-plugin) and [org.owasp:dependency-check-maven](https://github.com/jeremylong/DependencyCheck). Updates `org.apache.maven.plugins:maven-dependency-plugin` from 3.6.0 to 3.6.1 - [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.6.0...maven-dependency-plugin-3.6.1) Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.1.2 to 3.2.2 - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.2...surefire-3.2.2) Updates `org.codehaus.mojo:license-maven-plugin` from 2.2.0 to 2.3.0 - [Release notes](https://github.com/mojohaus/license-maven-plugin/releases) - [Commits](https://github.com/mojohaus/license-maven-plugin/compare/2.2.0...2.3.0) Updates `org.owasp:dependency-check-maven` from 8.4.0 to 9.0.1 - [Release notes](https://github.com/jeremylong/DependencyCheck/releases) - [Changelog](https://github.com/jeremylong/DependencyCheck/blob/main/CHANGELOG.md) - [Commits](https://github.com/jeremylong/DependencyCheck/compare/v8.4.0...v9.0.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-dependency-plugin dependency-type: direct:production update-type: version-update:semver-patch dependency-group: maven-build-plugins - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: maven-build-plugins - dependency-name: org.codehaus.mojo:license-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: maven-build-plugins - dependency-name: org.owasp:dependency-check-maven dependency-type: direct:production update-type: version-update:semver-major dependency-group: maven-build-plugins ... Signed-off-by: dependabot[bot] --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index ba72ba485..2e0bbeeda 100644 --- a/pom.xml +++ b/pom.xml @@ -63,14 +63,14 @@ 24.1.0 - 8.4.0 + 9.0.1 0.8.11 - 2.2.0 + 2.3.0 1.2.1 3.11.0 3.3.1 - 3.6.0 - 3.1.2 + 3.6.1 + 3.2.2 3.3.0 From dbacbc8874fea826aa25ffb813979ca7ab9d9df4 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 28 Nov 2023 13:23:40 +0100 Subject: [PATCH 30/71] do not exectue dependency-check on CI (due to missing NVD API key) --- .github/workflows/appimage.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/debian.yml | 2 +- .github/workflows/mac-dmg.yml | 2 +- .github/workflows/pullrequest.yml | 2 +- .github/workflows/win-exe.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 5821a7fde..68127dbb6 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -68,7 +68,7 @@ jobs: - name: Set version run : mvn versions:set -DnewVersion=${{ needs.get-version.outputs.semVerStr }} - name: Run maven - run: mvn -B clean package -Pdependency-check,linux -DskipTests + run: mvn -B clean package -Plinux -DskipTests - name: Patch target dir run: | cp LICENSE.txt target diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbb57cbbf..0d1eb5739 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: mvn -B verify jacoco:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar - -Pcoverage,dependency-check + -Pcoverage -Dsonar.projectKey=cryptomator_cryptomator -Dsonar.organization=cryptomator -Dsonar.host.url=https://sonarcloud.io diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index e8fd5da22..f1cffb96b 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -53,7 +53,7 @@ jobs: check-latest: true cache: 'maven' - name: Run maven - run: mvn -B clean package -Pdependency-check,linux -DskipTests + run: mvn -B clean package -Plinux -DskipTests - name: Download OpenJFX jmods id: download-jmods run: | diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 1372fe6ce..666e9f19c 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -79,7 +79,7 @@ jobs: - name: Set version run : mvn versions:set -DnewVersion=${{ needs.get-version.outputs.semVerStr }} - name: Run maven - run: mvn -B clean package -Pdependency-check,mac -DskipTests + run: mvn -B clean package -Pmac -DskipTests - name: Patch target dir run: | cp LICENSE.txt target diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 931817418..a8f4c5617 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -24,4 +24,4 @@ jobs: java-version: ${{ env.JAVA_VERSION }} cache: 'maven' - name: Build and Test - run: xvfb-run mvn -B clean install jacoco:report -Pcoverage,dependency-check \ No newline at end of file + run: xvfb-run mvn -B clean install jacoco:report -Pcoverage \ No newline at end of file diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index dece30a8b..1002718d0 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -73,7 +73,7 @@ jobs: - name: Set version run : mvn versions:set -DnewVersion=${{ needs.get-version.outputs.semVerStr }} - name: Run maven - run: mvn -B clean package -Pdependency-check,win -DskipTests + run: mvn -B clean package -Pwin -DskipTests - name: Patch target dir run: | cp LICENSE.txt target From e994133177ec12148e78c8a67e0afc0948f9e5ef Mon Sep 17 00:00:00 2001 From: Cryptobot Date: Tue, 28 Nov 2023 13:32:08 +0100 Subject: [PATCH 31/71] New Crowdin updates (#3191) New translations strings.properties Bulgarian; Chinese Simplified; Chinese Traditional; Dutch; Filipino; French; Greek; Hungarian; Norwegian Bokmal; Polish; Portuguese; Portuguese, Brazilian; Punjabi; Romanian; Spanish; Swedish; Turkish; [ci skip] --- src/main/resources/i18n/strings_bg.properties | 4 ++++ src/main/resources/i18n/strings_el.properties | 2 ++ src/main/resources/i18n/strings_es.properties | 2 ++ src/main/resources/i18n/strings_fil.properties | 6 ++++++ src/main/resources/i18n/strings_fr.properties | 2 +- src/main/resources/i18n/strings_hu.properties | 2 ++ src/main/resources/i18n/strings_nb.properties | 6 ++++++ src/main/resources/i18n/strings_nl.properties | 4 ++++ src/main/resources/i18n/strings_pa.properties | 1 + src/main/resources/i18n/strings_pl.properties | 6 ++++++ src/main/resources/i18n/strings_pt.properties | 7 +++++++ src/main/resources/i18n/strings_pt_BR.properties | 2 ++ src/main/resources/i18n/strings_ro.properties | 5 +++++ src/main/resources/i18n/strings_sv.properties | 6 ++++++ src/main/resources/i18n/strings_tr.properties | 4 ++++ src/main/resources/i18n/strings_zh.properties | 4 +++- src/main/resources/i18n/strings_zh_TW.properties | 2 ++ 17 files changed, 63 insertions(+), 2 deletions(-) diff --git a/src/main/resources/i18n/strings_bg.properties b/src/main/resources/i18n/strings_bg.properties index 6ceb6c3bb..0a2eef368 100644 --- a/src/main/resources/i18n/strings_bg.properties +++ b/src/main/resources/i18n/strings_bg.properties @@ -169,6 +169,10 @@ hub.registerFailed.description=В процеса на именуване е до hub.unauthorized.message=Отказан достъп hub.unauthorized.description=Устройството не е упълномощено за достъп до това хранилище. Поискайте достъп от собственика. ### Requires Account Initialization +hub.requireAccountInit.message=Необходимо действие +hub.requireAccountInit.description.0=За да продължите завършене необходимите стъпки в +hub.requireAccountInit.description.1=профила в Hub +hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Лиценза за Hub е недействителен hub.invalidLicense.description=Лиценза на екземпляра на Концентратора на Криптоматор който вие използвате е лиценз. Информирайте администратора на Концентратора, за да поднови или надгради лиценза. diff --git a/src/main/resources/i18n/strings_el.properties b/src/main/resources/i18n/strings_el.properties index 029656ddc..bd7c0e725 100644 --- a/src/main/resources/i18n/strings_el.properties +++ b/src/main/resources/i18n/strings_el.properties @@ -170,6 +170,8 @@ hub.unauthorized.message=Δεν επιτρέπεται η πρόσβαση hub.unauthorized.description=Η συσκευή σας δεν έχει ακόμη εξουσιοδοτηθεί να έχει πρόσβαση σε αυτή την κρύπτη. Ζητήστε από τον κάτοχο της κρύπτης να την εξουσιοδοτήσει. ### Requires Account Initialization hub.requireAccountInit.message=Απαιτείται ενέργεια +hub.requireAccountInit.description.0=Για να συνεχίσετε, παρακαλούμε ολοκληρώστε τα βήματα που απαιτούνται στο δικό σας +hub.requireAccountInit.description.1=προφίλ χρήστη Hub hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Μη έγκυρη Άδεια Hub diff --git a/src/main/resources/i18n/strings_es.properties b/src/main/resources/i18n/strings_es.properties index fb804e757..32ff02f2c 100644 --- a/src/main/resources/i18n/strings_es.properties +++ b/src/main/resources/i18n/strings_es.properties @@ -169,8 +169,10 @@ hub.registerFailed.description=Ocurrió un error en el nombramiento. Para más d hub.unauthorized.message=Acceso denegado hub.unauthorized.description=Su dispositivo aún no ha sido autorizado para acceder a esta bóveda. Pídale al propietario de la bóveda que lo autorice. ### Requires Account Initialization +hub.requireAccountInit.message=Acción requerida hub.requireAccountInit.description.0=Para continuar, por favor complete los pasos necesarios en su hub.requireAccountInit.description.1=Perfil de usuario del Hub +hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Licencia del Hub inválida hub.invalidLicense.description=Su instancia del Hub de Cryptomator tiene una licencia inválida. Informe a un administrador del Hub para actualizar o renovar la licencia. diff --git a/src/main/resources/i18n/strings_fil.properties b/src/main/resources/i18n/strings_fil.properties index 56ce0c11d..59d7b136e 100644 --- a/src/main/resources/i18n/strings_fil.properties +++ b/src/main/resources/i18n/strings_fil.properties @@ -154,7 +154,9 @@ hub.receive.message=Pinoproseso ang tugon… hub.receive.description=Ang Cryptomator ay tumatanggap at nagpoproseso ng tugon mula sa Hub. Mangyaring maghintay. ### Register Device hub.register.message=Bagong Device +hub.register.description=Ito ang unang Hub access mula sa device na ito. Mangyaring pahintulutan ito gamit ang iyong Account Key. hub.register.nameLabel=Pangalan ng device +hub.register.invalidAccountKeyLabel=Di-wastong Account Key hub.register.occupiedMsg=Ang pangalan ay nagamit na hub.register.registerBtn=Kumpirmahin ### Registration Success @@ -167,6 +169,10 @@ hub.registerFailed.description=Nagkaroon ng error sa proseso ng pagbibigay ng pa hub.unauthorized.message=Walang pahintulot hub.unauthorized.description=Hindi pa pinahihintulutan ang iyong device na i-access ang vault na ito. Hilingin sa may-ari ng vault na pahintulutan ito. ### Requires Account Initialization +hub.requireAccountInit.message=Kinakailangan ang pagkilos +hub.requireAccountInit.description.0=Upang magpatuloy, mangyaring kumpletuhin ang mga hakbang na kinakailangan sa iyong +hub.requireAccountInit.description.1=Profile ng user ng hub +hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Di-wasto ang Lisensya ng Hub hub.invalidLicense.description=Ang iyong Cryptomator Hub instance ay may di-wastong lisensya. Mangyaring ipagbigay-alam sa administrator ng Hub na mag-upgrade o mag-renew ng lisensya. diff --git a/src/main/resources/i18n/strings_fr.properties b/src/main/resources/i18n/strings_fr.properties index bb08d22e2..0cfab5d03 100644 --- a/src/main/resources/i18n/strings_fr.properties +++ b/src/main/resources/i18n/strings_fr.properties @@ -171,7 +171,7 @@ hub.unauthorized.description=Votre appareil n'a pas encore été autorisé à ac ### Requires Account Initialization hub.requireAccountInit.message=Action requise hub.requireAccountInit.description.0=Pour continuer, veuillez compléter les étapes requises -hub.requireAccountInit.description.1=Profil utilisateur Hub +hub.requireAccountInit.description.1=Profil utilisateur de Hub hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Licence de Hub invalide diff --git a/src/main/resources/i18n/strings_hu.properties b/src/main/resources/i18n/strings_hu.properties index fdb53f898..49fb95409 100644 --- a/src/main/resources/i18n/strings_hu.properties +++ b/src/main/resources/i18n/strings_hu.properties @@ -154,7 +154,9 @@ hub.receive.message=Válasz feldolgozása… hub.receive.description=Cryptomator fogadja és feldolgozza a Hub válaszát. Kérem, várjon. ### Register Device hub.register.message=Új eszköz +hub.register.description=Ez az első Hub-hozzáférés erről az eszközről. Kérjük, engedélyezd a Fiókkulcsoddal. hub.register.nameLabel=Készülék neve +hub.register.invalidAccountKeyLabel=Érvénytelen fiókkulcs hub.register.occupiedMsg=Ez a név már használatban van hub.register.registerBtn=Megerősítés ### Registration Success diff --git a/src/main/resources/i18n/strings_nb.properties b/src/main/resources/i18n/strings_nb.properties index 600822e3a..a92b02919 100644 --- a/src/main/resources/i18n/strings_nb.properties +++ b/src/main/resources/i18n/strings_nb.properties @@ -154,7 +154,9 @@ hub.receive.message=Prosesserer svar… hub.receive.description=Cryptomator mottar og behandler svaret fra Hub. Vennligst vent. ### Register Device hub.register.message=Ny Enhet +hub.register.description=Dette er den første Hub-tilgangen fra denne enheten. Vennligst autoriser den ved hjelp av kontonøkkelen. hub.register.nameLabel=Enhetsnavn +hub.register.invalidAccountKeyLabel=Ugyldig kontonøkkel hub.register.occupiedMsg=Navnet er allerede i bruk hub.register.registerBtn=Bekreft ### Registration Success @@ -167,6 +169,10 @@ hub.registerFailed.description=Under navngivingsprosessen oppsto det en feilmeld hub.unauthorized.message=Ingen tilgang hub.unauthorized.description=Enheten din har ikke blitt autorisert til å få tilgang til dette hvelvet ennå. Spør hvelveieren om å tillate det. ### Requires Account Initialization +hub.requireAccountInit.message=Påkrevd handling +hub.requireAccountInit.description.0=For å fortsette, fullfør trinnene som kreves i din +hub.requireAccountInit.description.1=Hub brukerprofil +hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Hub-lisens er ugyldig hub.invalidLicense.description=Cryptomator Hub instansen din har en ugyldig lisens. Vennligst informer en Hub-administrator om å oppgradere eller fornye lisensen. diff --git a/src/main/resources/i18n/strings_nl.properties b/src/main/resources/i18n/strings_nl.properties index 82f4585bd..43660d4d8 100644 --- a/src/main/resources/i18n/strings_nl.properties +++ b/src/main/resources/i18n/strings_nl.properties @@ -154,7 +154,9 @@ hub.receive.message=Antwoord verwerken… hub.receive.description=Cryptomator ontvangt en verwerkt de reactie van Hub. Een ogenblik geduld. ### Register Device hub.register.message=Nieuw apparaat +hub.register.description=Dit is de eerste Hub toegang vanaf dit apparaat. Bevestig deze toegang met behulp van uw Account Key. hub.register.nameLabel=Apparaatnaam +hub.register.invalidAccountKeyLabel=Ongeldige Account Key hub.register.occupiedMsg=Naam al in gebruik hub.register.registerBtn=Bevestig ### Registration Success @@ -168,6 +170,8 @@ hub.unauthorized.message=Toegang geweigerd hub.unauthorized.description=Uw apparaat is nog niet gemachtigd om toegang te krijgen tot deze kluis. Vraag de eigenaar van de kluis om toestemming te geven. ### Requires Account Initialization hub.requireAccountInit.message=Actie vereist +hub.requireAccountInit.description.0=Om verder te gaan, gelieve de stappen te voltooien in uw +hub.requireAccountInit.description.1=Hub gebruikersprofiel hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Hub Licentie ongeldig diff --git a/src/main/resources/i18n/strings_pa.properties b/src/main/resources/i18n/strings_pa.properties index 98b2e4a4b..1953d2b59 100644 --- a/src/main/resources/i18n/strings_pa.properties +++ b/src/main/resources/i18n/strings_pa.properties @@ -99,6 +99,7 @@ unlock.success.revealBtn=ਡਰਾਇਵ ਦਿਖਾਓ ### Waiting ### Receive Key ### Register Device +hub.register.registerBtn=ਤਸਦੀਕ ### Registration Success ### Registration Failed ### Unauthorized diff --git a/src/main/resources/i18n/strings_pl.properties b/src/main/resources/i18n/strings_pl.properties index 73106ba00..484472562 100644 --- a/src/main/resources/i18n/strings_pl.properties +++ b/src/main/resources/i18n/strings_pl.properties @@ -154,7 +154,9 @@ hub.receive.message=Przetwarzanie odpowiedzi… hub.receive.description=Cryptomator odbiera i przetwarza odpowiedź z Huba, proszę czekać. ### Register Device hub.register.message=Nowe Urządzenie +hub.register.description=To jest pierwszy dostęp do Huba z tego urządzenia. Proszę autoryzować go za pomocą klucza konta. hub.register.nameLabel=Nazwa urządzenia +hub.register.invalidAccountKeyLabel=Błędny klucz konta hub.register.occupiedMsg=Nazwa jest już używana hub.register.registerBtn=Zatwierdź ### Registration Success @@ -167,6 +169,10 @@ hub.registerFailed.description=Wystąpił błąd podczas ustawiania nazwy. Aby u hub.unauthorized.message=Brak dostępu hub.unauthorized.description=Twoje urządzenie nie zostało jeszcze upoważnione do dostępu do tego sejfu. Poproś właściciela sejfu o autoryzację. ### Requires Account Initialization +hub.requireAccountInit.message=Wymagane działanie +hub.requireAccountInit.description.0=Aby kontynuować, wykonaj wymagane kroki w Twoim +hub.requireAccountInit.description.1=profilu użytkownika Hub +hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Nieważna licencja Huba hub.invalidLicense.description=Twoja instancja Hub ma nieprawidłową licencję. Poproś administratora Hub o uaktualnienie lub odnowienie licencji. diff --git a/src/main/resources/i18n/strings_pt.properties b/src/main/resources/i18n/strings_pt.properties index f237e11d5..0f461bf22 100644 --- a/src/main/resources/i18n/strings_pt.properties +++ b/src/main/resources/i18n/strings_pt.properties @@ -41,6 +41,7 @@ traymenu.vault.reveal=Revelar # Add Vault Wizard addvaultwizard.title=Adicionar Cofre ## New +addvaultwizard.new.title=Adicionar novo cofre ### Name addvaultwizard.new.nameInstruction=Escolha um nome para o cofre addvaultwizard.new.namePrompt=Nome do Cofre @@ -90,6 +91,7 @@ addvault.new.readme.accessLocation.2=Este é o local de acesso do seu cofre. addvault.new.readme.accessLocation.3=Qualquer ficheiro adicionado a este volume será encriptado pelo Cryptomator. Poderá trabalhar nestes normalmente como em qualquer outra unidade/pasta. Esta é apenas uma visualização desencriptada do seu conteúdo, os seus ficheiros continuam encriptados no seu disco rígido. addvault.new.readme.accessLocation.4=Sinta-se livre para remover este ficheiro. ## Existing +addvaultwizard.existing.title=Adicionar cofre existente addvaultwizard.existing.instruction=Escolha o ficheiro "vault.cryptomator" do seu cofre. Se encontrar unicamente o ficheiro "masterkey.cryptomator", selecione-o. addvaultwizard.existing.chooseBtn=Escolher… addvaultwizard.existing.filePickerTitle=Selecionar o ficheiro do cofre @@ -166,6 +168,8 @@ hub.unauthorized.message=Acesso negado hub.unauthorized.description=O seu dispositivo ainda não foi autorizado a aceder a este cofre. Peça ao proprietário do cofre para o autorizar. ### Requires Account Initialization hub.requireAccountInit.message=Ação requerida +hub.requireAccountInit.description.0=Para continuar, conclua as etapas necessárias no seu +hub.requireAccountInit.description.1=perfil de usuário do Hub hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Licença Hub inválida @@ -339,6 +343,9 @@ main.vaultlist.contextMenu.unlock=Desbloquear… main.vaultlist.contextMenu.unlockNow=Desbloquear agora main.vaultlist.contextMenu.vaultoptions=Mostrar opções do Cofre main.vaultlist.contextMenu.reveal=Revelar unidade +main.vaultlist.addVaultBtn=Adicionar +main.vaultlist.addVaultBtn.menuItemNew=Novo cofre... +main.vaultlist.addVaultBtn.menuItemExisting=Cofre Existente... ## Vault Detail ### Welcome main.vaultDetail.welcomeOnboarding=Obrigado por escolher Cryptomator para proteger os seus ficheiros. Se precisar de alguma ajuda, veja os nossos guias introdutórios: diff --git a/src/main/resources/i18n/strings_pt_BR.properties b/src/main/resources/i18n/strings_pt_BR.properties index ea8df1fbd..17f872e09 100644 --- a/src/main/resources/i18n/strings_pt_BR.properties +++ b/src/main/resources/i18n/strings_pt_BR.properties @@ -170,6 +170,8 @@ hub.unauthorized.message=Acesso negado hub.unauthorized.description=Seu dispositivo ainda não foi autorizado a acessar este cofre. Peça ao proprietário ou a um administrador deste cofre para autorizá-lo. ### Requires Account Initialization hub.requireAccountInit.message=Ação necessária +hub.requireAccountInit.description.0=Para prosseguir, por favor, complete os passos necessários +hub.requireAccountInit.description.1=Perfil de usuário do Hub hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Licença Invalida diff --git a/src/main/resources/i18n/strings_ro.properties b/src/main/resources/i18n/strings_ro.properties index f63ca5e7e..ac0f50739 100644 --- a/src/main/resources/i18n/strings_ro.properties +++ b/src/main/resources/i18n/strings_ro.properties @@ -153,6 +153,7 @@ hub.auth.loginLink=Nu ați fost redirecționat? Apăsați aici pentru a deschide hub.receive.message=Se procesează răspunsul… hub.receive.description=In acest moment Criptomatorul primește și procesează răspunsul de la Hub. Vă rugăm să așteptați. ### Register Device +hub.register.message=Dispozitiv nou hub.register.nameLabel=Numele dispozitivului hub.register.occupiedMsg=Acest nume este deja utilizat hub.register.registerBtn=Confirmați @@ -166,6 +167,10 @@ hub.registerFailed.description=O eroare a fost întâmpinata în procesul de den hub.unauthorized.message=Acces respins hub.unauthorized.description=Dispozitivul dvs. nu a fost autorizat să acceseze acest seif. Solicitați proprietarului seifului să va autorizeze accesul. ### Requires Account Initialization +hub.requireAccountInit.message=Acțiune necesară +hub.requireAccountInit.description.0=Pentru a continua, vă rugăm să finalizaţi paşii necesari în +hub.requireAccountInit.description.1=Profil utilizator Hub +hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Licență de Hub invalidă hub.invalidLicense.description=Instanța Hub are o licență invalidă. Vă rugăm să informați un administrator Hub să actualizeze sau să reînnoiască licența. diff --git a/src/main/resources/i18n/strings_sv.properties b/src/main/resources/i18n/strings_sv.properties index b30e9848b..3ac3a33cf 100644 --- a/src/main/resources/i18n/strings_sv.properties +++ b/src/main/resources/i18n/strings_sv.properties @@ -154,7 +154,9 @@ hub.receive.message=Bearbetar svar… hub.receive.description=Cryptomator tar emot och bearbetar svaret från Hub. Vänligen vänta. ### Register Device hub.register.message=Ny enhet +hub.register.description=Detta är den första navåtkomsten från den här enheten. Vänligen auktorisera den med din kontonyckel. hub.register.nameLabel=Enhetsnamn +hub.register.invalidAccountKeyLabel=Ogiltig kontonyckel hub.register.occupiedMsg=Namnet används redan hub.register.registerBtn=Bekräfta ### Registration Success @@ -167,6 +169,10 @@ hub.registerFailed.description=Ett fel uppstod i namngivningsprocessen. För mer hub.unauthorized.message=Åtkomst nekad hub.unauthorized.description=Din enhet har ännu inte behörighet att komma åt detta valv. Be valvägaren att godkänna det. ### Requires Account Initialization +hub.requireAccountInit.message=Åtgärd krävs +hub.requireAccountInit.description.0=För att fortsätta, vänligen fyll i de steg som krävs i din +hub.requireAccountInit.description.1=Hubb användarprofil +hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Din Hub-licens är ogiltig hub.invalidLicense.description=Din Cryptomator Hub-instans har en ogiltig licens. Vänligen informera en Hub administratör för att uppgradera eller förnya licensen. diff --git a/src/main/resources/i18n/strings_tr.properties b/src/main/resources/i18n/strings_tr.properties index 4c3d95e76..23a482a54 100644 --- a/src/main/resources/i18n/strings_tr.properties +++ b/src/main/resources/i18n/strings_tr.properties @@ -154,7 +154,9 @@ hub.receive.message=Yanıt işleniyor… hub.receive.description=Cryptomator, Hub'dan yanıtı alıyor ve işliyor. Lütfen bekleyin. ### Register Device hub.register.message=Yeni Cihaz +hub.register.description=Bu işlem bu cihazdan yapılan ilk Hub erişimidir. Lütfen kurulum kodunuzu kullanarak yetkilendirin. hub.register.nameLabel=Cihaz adı +hub.register.invalidAccountKeyLabel=Geçersiz Hesap Anahtarı hub.register.occupiedMsg=Ad zaten kullanımda hub.register.registerBtn=Onayla ### Registration Success @@ -167,8 +169,10 @@ hub.registerFailed.description=İsimlendirme işleminde bir hata oluştu. Daha f hub.unauthorized.message=Erişim engellendi hub.unauthorized.description=Cihazınıza henüz bu kasaya erişim yetkisi verilmedi. Kasa sahibinden yetkilendirmesini isteyin. ### Requires Account Initialization +hub.requireAccountInit.message=Eylem gerekli hub.requireAccountInit.description.0=Devam etmek için, lütfen gerekli adımları tamamlayın hub.requireAccountInit.description.1=Hub kullanıcı profili +hub.requireAccountInit.description.2=. ### License Exceeded hub.invalidLicense.message=Hub Lisansı geçersiz hub.invalidLicense.description=Cryptomator Hub örneğinizde geçersiz bir lisans var. Lisansı yükseltmesi veya yenilemesi için lütfen bir Hub yöneticisini bilgilendirin. diff --git a/src/main/resources/i18n/strings_zh.properties b/src/main/resources/i18n/strings_zh.properties index e3298d38c..8ebfa5ff6 100644 --- a/src/main/resources/i18n/strings_zh.properties +++ b/src/main/resources/i18n/strings_zh.properties @@ -170,6 +170,8 @@ hub.unauthorized.message=拒绝访问 hub.unauthorized.description=您的设备尚未授权访问此保险库,请联系保险库所有者, ### Requires Account Initialization hub.requireAccountInit.message=操作请求 +hub.requireAccountInit.description.0=要继续,请完成所需的步骤 +hub.requireAccountInit.description.1=Hub 用户中心 hub.requireAccountInit.description.2=。 ### License Exceeded hub.invalidLicense.message=Hub 许可证无效 @@ -295,7 +297,7 @@ preferences.volume=虚拟磁盘 preferences.volume.type=卷类型 preferences.volume.type.automatic=自动 preferences.volume.docsTooltip=打开文档以了解有关不同卷类型的更多信息 -preferences.volume.fuseRestartRequired=Cryptomator 需要重新启动以应用更改。 +preferences.volume.fuseRestartRequired=Cryptomator 需要重新启动以应用更改 preferences.volume.tcp.port=TCP 端口 preferences.volume.supportedFeatures=选定的卷类型支持以下功能: preferences.volume.feature.mountAuto=自动选择挂载点 diff --git a/src/main/resources/i18n/strings_zh_TW.properties b/src/main/resources/i18n/strings_zh_TW.properties index b8d231361..6be82f561 100644 --- a/src/main/resources/i18n/strings_zh_TW.properties +++ b/src/main/resources/i18n/strings_zh_TW.properties @@ -166,6 +166,8 @@ hub.registerFailed.description=命名過程中出現錯誤。更多詳情,請 hub.unauthorized.message=拒絕存取 hub.unauthorized.description=您的設備權限尚未允許存取檔案庫,請聯絡檔案庫擁有者 ### Requires Account Initialization +hub.requireAccountInit.description.0=請完成您的 +hub.requireAccountInit.description.1=Hub使用者資料 ### License Exceeded hub.invalidLicense.message=Hub 憑證無效 hub.invalidLicense.description=此 Cryptomator Hub 實例授權無效,請聯繫管理員升級或續訂授權。 From 688450bf5ae9b62859382a35a2b1f53f8a4c80db Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 28 Nov 2023 13:34:35 +0100 Subject: [PATCH 32/71] prepare 1.11.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2e0bbeeda..714735f87 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.cryptomator cryptomator - 1.12.0-SNAPSHOT + 1.11.1 Cryptomator Desktop App From 7d281e2878b5aa9f7dd8af3b07d36b59f6592510 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:08:31 +0000 Subject: [PATCH 33/71] Bump the javafx group with 5 updates (#3229) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2e0bbeeda..b6ff690ef 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ 2.2 32.1.3-jre 2.16.0 - 20.0.2 + 21.0.1 4.4.0 9.37.1 1.4.12 From 1343099be6fccb3d9fac31fd3364f9f195e64f84 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 30 Nov 2023 09:26:11 +0100 Subject: [PATCH 34/71] [ci skip] correct dependabot config --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0e12bbba9..3d2f42f8d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,7 @@ updates: interval: "weekly" day: "monday" time: "06:00" - timezone: "UTC" + timezone: "Etc/UTC" groups: java-test-dependencies: patterns: From c7839e2c46de4975197045ff09f5324628176aa5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 14:26:07 +0000 Subject: [PATCH 35/71] Bump the java-production-dependencies group with 2 updates (#3234) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b6ff690ef..cae8f0517 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 21.0.1 4.4.0 9.37.1 - 1.4.12 + 1.4.13 2.0.9 0.8.0 1.8.2 From 98590ecec532197e92b7bfc5169a8c1ab598d60a Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Fri, 1 Dec 2023 09:11:43 +0100 Subject: [PATCH 36/71] refactoring --- .../common/mount/ActualMountService.java | 6 --- .../org/cryptomator/common/mount/Mounter.java | 48 +++++++++++++++--- .../org/cryptomator/common/vaults/Vault.java | 33 ++---------- .../common/vaults/VaultListManager.java | 10 ++-- .../common/vaults/VaultModule.java | 50 ------------------- .../vaultoptions/MountOptionsController.java | 13 +++-- 6 files changed, 55 insertions(+), 105 deletions(-) delete mode 100644 src/main/java/org/cryptomator/common/mount/ActualMountService.java diff --git a/src/main/java/org/cryptomator/common/mount/ActualMountService.java b/src/main/java/org/cryptomator/common/mount/ActualMountService.java deleted file mode 100644 index a96cc8e37..000000000 --- a/src/main/java/org/cryptomator/common/mount/ActualMountService.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.cryptomator.common.mount; - -import org.cryptomator.integrations.mount.MountService; - -public record ActualMountService(MountService service, boolean isDesired) { -} diff --git a/src/main/java/org/cryptomator/common/mount/Mounter.java b/src/main/java/org/cryptomator/common/mount/Mounter.java index 0cd838b9e..cf5f2b678 100644 --- a/src/main/java/org/cryptomator/common/mount/Mounter.java +++ b/src/main/java/org/cryptomator/common/mount/Mounter.java @@ -1,6 +1,7 @@ package org.cryptomator.common.mount; import org.cryptomator.common.Environment; +import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.VaultSettings; import org.cryptomator.integrations.mount.Mount; import org.cryptomator.integrations.mount.MountBuilder; @@ -8,11 +9,13 @@ import org.cryptomator.integrations.mount.MountFailedException; import org.cryptomator.integrations.mount.MountService; import javax.inject.Inject; +import javax.inject.Named; import javax.inject.Singleton; -import javafx.beans.value.ObservableValue; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; import static org.cryptomator.integrations.mount.MountCapability.MOUNT_AS_DRIVE_LETTER; import static org.cryptomator.integrations.mount.MountCapability.MOUNT_TO_EXISTING_DIR; @@ -23,13 +26,24 @@ import static org.cryptomator.integrations.mount.MountCapability.UNMOUNT_FORCED; @Singleton public class Mounter { + private static final List problematicFuseMountServices = List.of("org.cryptomator.frontend.fuse.mount.MacFuseMountProvider", "org.cryptomator.frontend.fuse.mount.FuseTMountProvider"); + private final Environment env; private final WindowsDriveLetters driveLetters; + private final Settings settings; + private final List mountProviders; + private final AtomicReference firstUsedProblematicFuseMountService; @Inject - public Mounter(Environment env, WindowsDriveLetters driveLetters) { + public Mounter(Environment env, // + WindowsDriveLetters driveLetters, // + Settings settings, List mountProviders, // + @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService) { this.env = env; this.driveLetters = driveLetters; + this.settings = settings; + this.mountProviders = mountProviders; + this.firstUsedProblematicFuseMountService = firstUsedProblematicFuseMountService; } private class SettledMounter { @@ -124,12 +138,32 @@ public class Mounter { } - public MountHandle mount(VaultSettings vaultSettings, Path cryptoFsRoot, ObservableValue actualMountService) throws IOException, MountFailedException { - var mountService = actualMountService.getValue().service(); - var builder = mountService.forFileSystem(cryptoFsRoot); - var internal = new SettledMounter(mountService, builder, vaultSettings); + public MountHandle mount(VaultSettings vaultSettings, Path cryptoFsRoot) throws IOException, MountFailedException { + var fallbackProvider = mountProviders.stream().findFirst().orElse(null); + var defMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(settings.mountService.getValue())).findFirst().orElse(fallbackProvider); + var selMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(vaultSettings.mountService.getValue())).findFirst().orElse(defMntServ); + + var targetIsProblematicFuse = isProblematicFuseService(selMntServ); + if (targetIsProblematicFuse && firstUsedProblematicFuseMountService.get() == null) { + firstUsedProblematicFuseMountService.set(selMntServ); + } + + var fuseRestartRequired = firstUsedProblematicFuseMountService.get() != null // + && isProblematicFuseService(selMntServ) // + && !firstUsedProblematicFuseMountService.get().equals(selMntServ); + + if (fuseRestartRequired) { + throw new FuseRestartRequiredException("fuseRestartRequired"); + } + + var builder = selMntServ.forFileSystem(cryptoFsRoot); + var internal = new SettledMounter(selMntServ, builder, vaultSettings); var cleanup = internal.prepare(); - return new MountHandle(builder.mount(), mountService.hasCapability(UNMOUNT_FORCED), cleanup); + return new MountHandle(builder.mount(), selMntServ.hasCapability(UNMOUNT_FORCED), cleanup); + } + + public static boolean isProblematicFuseService(MountService service) { + return problematicFuseMountServices.contains(service.getClass().getName()); } public record MountHandle(Mount mountObj, boolean supportsUnmountForced, Runnable specialCleanup) { diff --git a/src/main/java/org/cryptomator/common/vaults/Vault.java b/src/main/java/org/cryptomator/common/vaults/Vault.java index d617a5db3..d741ae5c4 100644 --- a/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -10,10 +10,7 @@ package org.cryptomator.common.vaults; import org.apache.commons.lang3.SystemUtils; import org.cryptomator.common.Constants; -import org.cryptomator.common.mount.ActualMountService; -import org.cryptomator.common.mount.FuseRestartRequiredException; import org.cryptomator.common.mount.Mounter; -import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.VaultSettings; import org.cryptomator.cryptofs.CryptoFileSystem; import org.cryptomator.cryptofs.CryptoFileSystemProperties; @@ -24,7 +21,6 @@ import org.cryptomator.cryptolib.api.CryptoException; import org.cryptomator.cryptolib.api.MasterkeyLoader; import org.cryptomator.cryptolib.api.MasterkeyLoadingFailedException; import org.cryptomator.integrations.mount.MountFailedException; -import org.cryptomator.integrations.mount.MountService; import org.cryptomator.integrations.mount.Mountpoint; import org.cryptomator.integrations.mount.UnmountFailedException; import org.slf4j.Logger; @@ -41,12 +37,10 @@ import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.ReadOnlyStringProperty; import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.value.ObservableValue; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.EnumSet; -import java.util.List; import java.util.Objects; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; @@ -58,9 +52,7 @@ public class Vault { private static final Path HOME_DIR = Paths.get(SystemUtils.USER_HOME); private static final int UNLIMITED_FILENAME_LENGTH = Integer.MAX_VALUE; - private final Settings settings; private final VaultSettings vaultSettings; - private final List mountProviders; private final AtomicReference cryptoFileSystem; private final VaultState state; private final ObjectProperty lastKnownException; @@ -76,28 +68,20 @@ public class Vault { private final ObjectBinding mountPoint; private final Mounter mounter; private final BooleanProperty showingStats; - private final ObservableValue actualMountService; - private final AtomicReference firstUsedProblematicFuseMountService; private final AtomicReference mountHandle = new AtomicReference<>(null); @Inject - Vault(Settings settings, // - VaultSettings vaultSettings, // + Vault(VaultSettings vaultSettings, // VaultConfigCache configCache, // AtomicReference cryptoFileSystem, // - List mountProviders, // VaultState state, // @Named("lastKnownException") ObjectProperty lastKnownException, // VaultStats stats, // - Mounter mounter, // - @Named("vaultMountService") ObservableValue actualMountService, // - @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService) { - this.settings = settings; + Mounter mounter) { this.vaultSettings = vaultSettings; this.configCache = configCache; this.cryptoFileSystem = cryptoFileSystem; - this.mountProviders = mountProviders; this.state = state; this.lastKnownException = lastKnownException; this.stats = stats; @@ -111,8 +95,6 @@ public class Vault { this.mountPoint = Bindings.createObjectBinding(this::getMountPoint, state); this.mounter = mounter; this.showingStats = new SimpleBooleanProperty(false); - this.actualMountService = actualMountService; - this.firstUsedProblematicFuseMountService = firstUsedProblematicFuseMountService; } // ****************************************************************************** @@ -165,22 +147,13 @@ public class Vault { if (cryptoFileSystem.get() != null) { throw new IllegalStateException("Already unlocked."); } - var fallbackProvider = mountProviders.stream().findFirst().orElse(null); - var defMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(settings.mountService.getValue())).findFirst().orElse(fallbackProvider); - var selMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(vaultSettings.mountService.getValue())).findFirst().orElse(defMntServ); - var fuseRestartRequired = firstUsedProblematicFuseMountService.get() != null // - && VaultModule.isProblematicFuseService(selMntServ) // - && !firstUsedProblematicFuseMountService.get().equals(selMntServ); - if (fuseRestartRequired) { - throw new FuseRestartRequiredException("fuseRestartRequired"); - } CryptoFileSystem fs = createCryptoFileSystem(keyLoader); boolean success = false; try { cryptoFileSystem.set(fs); var rootPath = fs.getRootDirectories().iterator().next(); - var mountHandle = mounter.mount(vaultSettings, rootPath, actualMountService); + var mountHandle = mounter.mount(vaultSettings, rootPath); success = this.mountHandle.compareAndSet(null, mountHandle); } finally { if (!success) { diff --git a/src/main/java/org/cryptomator/common/vaults/VaultListManager.java b/src/main/java/org/cryptomator/common/vaults/VaultListManager.java index cbcc281ac..6f0e30153 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultListManager.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultListManager.java @@ -37,19 +37,19 @@ public class VaultListManager { private static final Logger LOG = LoggerFactory.getLogger(VaultListManager.class); - private final AutoLocker autoLocker; private final VaultComponent.Factory vaultComponentFactory; private final ObservableList vaultList; private final String defaultVaultName; - private final Settings settings; + @Inject - public VaultListManager(ObservableList vaultList, AutoLocker autoLocker, VaultComponent.Factory vaultComponentFactory, ResourceBundle resourceBundle, Settings settings) { + public VaultListManager(ObservableList vaultList, // + AutoLocker autoLocker, // + VaultComponent.Factory vaultComponentFactory, // + ResourceBundle resourceBundle, Settings settings) { this.vaultList = vaultList; - this.autoLocker = autoLocker; this.vaultComponentFactory = vaultComponentFactory; this.defaultVaultName = resourceBundle.getString("defaults.vault.vaultName"); - this.settings = settings; addAll(settings.directories); vaultList.addListener(new VaultListChangeListener(settings.directories)); diff --git a/src/main/java/org/cryptomator/common/vaults/VaultModule.java b/src/main/java/org/cryptomator/common/vaults/VaultModule.java index b172a1e03..276af9f96 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultModule.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultModule.java @@ -8,72 +8,22 @@ package org.cryptomator.common.vaults; import dagger.Module; import dagger.Provides; import org.cryptomator.common.Nullable; -import org.cryptomator.common.ObservableUtil; -import org.cryptomator.common.mount.ActualMountService; -import org.cryptomator.common.settings.Settings; -import org.cryptomator.common.settings.VaultSettings; import org.cryptomator.cryptofs.CryptoFileSystem; -import org.cryptomator.integrations.mount.MountService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.inject.Named; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.value.ObservableValue; -import java.util.List; import java.util.concurrent.atomic.AtomicReference; @Module public class VaultModule { - private static final AtomicReference formerSelectedMountService = new AtomicReference<>(null); - private static final List problematicFuseMountServices = List.of("org.cryptomator.frontend.fuse.mount.MacFuseMountProvider", "org.cryptomator.frontend.fuse.mount.FuseTMountProvider"); - private static final Logger LOG = LoggerFactory.getLogger(VaultModule.class); - @Provides @PerVault public AtomicReference provideCryptoFileSystemReference() { return new AtomicReference<>(); } - @Provides - @Named("vaultMountService") - @PerVault - static ObservableValue provideMountService(Settings settings, VaultSettings vaultSettings, List serviceImpls, @Named("FUPFMS") AtomicReference fupfms) { - var fallbackProvider = serviceImpls.stream().findFirst().orElse(null); - var defaultMountService = ObservableUtil.mapWithDefault(settings.mountService, serviceName -> serviceImpls.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), fallbackProvider); - return ObservableUtil.mapWithDefault(vaultSettings.mountService, // - desiredServiceImpl -> { // - var serviceFromSettings = serviceImpls.stream().filter(serviceImpl -> serviceImpl.getClass().getName().equals(desiredServiceImpl)).findAny(); // - var targetedService = serviceFromSettings.orElse(defaultMountService.getValue()); - return applyWorkaroundForProblematicFuse(targetedService, serviceFromSettings.isPresent(), fupfms); - }, // - () -> applyWorkaroundForProblematicFuse(defaultMountService.getValue(), true, fupfms) - ); - } - - //see https://github.com/cryptomator/cryptomator/issues/2786 - private synchronized static ActualMountService applyWorkaroundForProblematicFuse(MountService targetedService, boolean isDesired, AtomicReference firstUsedProblematicFuseMountService) { - //set the first used problematic fuse service if applicable - var targetIsProblematicFuse = isProblematicFuseService(targetedService); - if (targetIsProblematicFuse && firstUsedProblematicFuseMountService.get() == null) { - firstUsedProblematicFuseMountService.set(targetedService); - } - - //do not use the targeted mount service and fallback to former one, if the service is problematic _and_ not the first problematic one used. - if (targetIsProblematicFuse && !firstUsedProblematicFuseMountService.get().equals(targetedService)) { - return new ActualMountService(formerSelectedMountService.get(), false); - } else { - formerSelectedMountService.set(targetedService); - return new ActualMountService(targetedService, isDesired); - } - } - - public static boolean isProblematicFuseService(MountService service) { - return problematicFuseMountServices.contains(service.getClass().getName()); - } - @Provides @Named("lastKnownException") @PerVault diff --git a/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java b/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java index 9d28d8d9d..0583e4fbb 100644 --- a/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java +++ b/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java @@ -3,11 +3,11 @@ package org.cryptomator.ui.vaultoptions; import com.google.common.base.Strings; import dagger.Lazy; import org.cryptomator.common.ObservableUtil; +import org.cryptomator.common.mount.Mounter; import org.cryptomator.common.mount.WindowsDriveLetters; import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.VaultSettings; import org.cryptomator.common.vaults.Vault; -import org.cryptomator.common.vaults.VaultModule; import org.cryptomator.integrations.mount.MountCapability; import org.cryptomator.integrations.mount.MountService; import org.cryptomator.ui.common.FxController; @@ -102,11 +102,10 @@ public class MountOptionsController implements FxController { fallbackProvider); this.selectedMountService = Bindings.createObjectBinding(this::reselectMountService, defaultMountService, vaultSettings.mountService); this.fuseRestartRequired = selectedMountService.map(s -> { - return firstUsedProblematicFuseMountService.get() != null // - && VaultModule.isProblematicFuseService(s) // - && !firstUsedProblematicFuseMountService.get().equals(s); - } - ); + return firstUsedProblematicFuseMountService.get() != null // + && Mounter.isProblematicFuseService(s) // + && !firstUsedProblematicFuseMountService.get().equals(s); + }); this.loopbackPortSupported = BooleanExpression.booleanExpression(selectedMountService.map(s -> s.hasCapability(MountCapability.LOOPBACK_PORT))); this.defaultMountFlags = selectedMountService.map(s -> { @@ -130,7 +129,7 @@ public class MountOptionsController implements FxController { @FXML public void initialize() { - defaultMountService.addListener((_,_,_) -> vaultVolumeTypeChoiceBox.setConverter(new MountServiceConverter())); + defaultMountService.addListener((_, _, _) -> vaultVolumeTypeChoiceBox.setConverter(new MountServiceConverter())); // readonly: readOnlyCheckbox.selectedProperty().bindBidirectional(vaultSettings.usesReadOnlyMode); From a07dea7ca8cce551c735617ef3b5159d1370dec9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:39:49 +0000 Subject: [PATCH 37/71] Bump the github-actions group with 2 updates (#3235) --- .github/workflows/appimage.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/check-jdk-updates.yml | 4 ++-- .github/workflows/debian.yml | 2 +- .github/workflows/dl-stats.yml | 2 +- .github/workflows/error-db.yml | 2 +- .github/workflows/get-version.yml | 2 +- .github/workflows/mac-dmg.yml | 2 +- .github/workflows/pullrequest.yml | 2 +- .github/workflows/win-exe.yml | 4 ++-- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 68127dbb6..1bb3e694a 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -38,7 +38,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DIST }} java-version: ${{ env.JAVA_VERSION }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d1eb5739..dc575baca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DIST }} java-version: ${{ env.JAVA_VERSION }} diff --git a/.github/workflows/check-jdk-updates.yml b/.github/workflows/check-jdk-updates.yml index 30954b9e4..b1cdca4bb 100644 --- a/.github/workflows/check-jdk-updates.yml +++ b/.github/workflows/check-jdk-updates.yml @@ -15,7 +15,7 @@ jobs: outputs: jdk-date: ${{ steps.get-data.outputs.jdk-date}} steps: - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: java-version: ${{ env.JDK_VERSION }} distribution: ${{ env.JDK_VENDOR }} @@ -32,7 +32,7 @@ jobs: jdk-date: ${{ steps.get-data.outputs.jdk-date}} jdk-version: ${{ steps.get-data.outputs.jdk-version}} steps: - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: java-version: 21 distribution: ${{ env.JDK_VENDOR }} diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index f1cffb96b..00b49f4fc 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -46,7 +46,7 @@ jobs: sudo apt-get update sudo apt-get install debhelper devscripts dput coffeelibs-jdk-${{ env.COFFEELIBS_JDK }}=${{ env.COFFEELIBS_JDK_VERSION }} libgtk2.0-0 - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DIST }} java-version: ${{ env.JAVA_VERSION }} diff --git a/.github/workflows/dl-stats.yml b/.github/workflows/dl-stats.yml index dc87a2bbd..b16899520 100644 --- a/.github/workflows/dl-stats.yml +++ b/.github/workflows/dl-stats.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Get download count of latest releases id: get-stats - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const query = `query($owner:String!, $name:String!) { diff --git a/.github/workflows/error-db.yml b/.github/workflows/error-db.yml index e885af4a2..301713681 100644 --- a/.github/workflows/error-db.yml +++ b/.github/workflows/error-db.yml @@ -14,7 +14,7 @@ jobs: - name: Query Discussion Data if: github.event_name == 'discussion_comment' || github.event_name == 'discussion' && github.event.action != 'deleted' id: query-data - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const query = `query ($owner: String!, $name: String!, $discussionNumber: Int!) { diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 1bed1cff8..ae2b60b4b 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -39,7 +39,7 @@ jobs: with: fetch-depth: 0 - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DIST }} java-version: ${{ env.JAVA_VERSION }} diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 666e9f19c..3b4905a12 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -49,7 +49,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DIST }} java-version: ${{ env.JAVA_VERSION }} diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index a8f4c5617..2730f5c24 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -18,7 +18,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DIST }} java-version: ${{ env.JAVA_VERSION }} diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 1002718d0..648b58884 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -41,7 +41,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DIST }} java-version: ${{ env.JAVA_VERSION }} @@ -275,7 +275,7 @@ jobs: path: dist/win/bundle/resources - name: Strip version info from msi file name run: mv dist/win/bundle/resources/Cryptomator*.msi dist/win/bundle/resources/Cryptomator.msi - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DIST }} java-version: ${{ env.JAVA_VERSION }} From a4545352d8ccbe257696744741917478c6579236 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 5 Dec 2023 11:09:09 +0100 Subject: [PATCH 38/71] finalize 1.11.1 --- dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml b/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml index e28172efe..b6f05d102 100644 --- a/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml +++ b/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml @@ -66,6 +66,7 @@ + From 63bf0315c7ce476de6b2ed9ff0657efe3186d5e3 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 5 Dec 2023 16:21:12 +0100 Subject: [PATCH 39/71] created global mountService --- .../org/cryptomator/common/CommonsModule.java | 11 ++++++++++ .../org/cryptomator/common/mount/Mounter.java | 20 +++++++++---------- .../vaultoptions/MountOptionsController.java | 8 ++------ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/cryptomator/common/CommonsModule.java b/src/main/java/org/cryptomator/common/CommonsModule.java index 5ea69da6d..ab52d43fd 100644 --- a/src/main/java/org/cryptomator/common/CommonsModule.java +++ b/src/main/java/org/cryptomator/common/CommonsModule.java @@ -21,9 +21,11 @@ import org.slf4j.LoggerFactory; import javax.inject.Named; import javax.inject.Singleton; +import javafx.beans.value.ObservableValue; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Comparator; +import java.util.List; import java.util.Optional; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; @@ -141,4 +143,13 @@ public abstract class CommonsModule { return new AtomicReference<>(null); } + @Provides + @Singleton + static ObservableValue provideDefaultMountService(List mountProviders, Settings settings) { + var fallbackProvider = mountProviders.stream().findFirst().orElse(null); + + return ObservableUtil.mapWithDefault(settings.mountService, // + serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), // + fallbackProvider); + } } diff --git a/src/main/java/org/cryptomator/common/mount/Mounter.java b/src/main/java/org/cryptomator/common/mount/Mounter.java index cf5f2b678..4bdaa580b 100644 --- a/src/main/java/org/cryptomator/common/mount/Mounter.java +++ b/src/main/java/org/cryptomator/common/mount/Mounter.java @@ -11,6 +11,7 @@ import org.cryptomator.integrations.mount.MountService; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; +import javafx.beans.value.ObservableValue; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -30,27 +31,28 @@ public class Mounter { private final Environment env; private final WindowsDriveLetters driveLetters; - private final Settings settings; private final List mountProviders; private final AtomicReference firstUsedProblematicFuseMountService; + private final ObservableValue defaultMountService; @Inject public Mounter(Environment env, // WindowsDriveLetters driveLetters, // - Settings settings, List mountProviders, // - @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService) { + List mountProviders, // + @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService, + ObservableValue defaultMountService) { this.env = env; this.driveLetters = driveLetters; - this.settings = settings; this.mountProviders = mountProviders; this.firstUsedProblematicFuseMountService = firstUsedProblematicFuseMountService; + this.defaultMountService = defaultMountService; } private class SettledMounter { - private MountService service; - private MountBuilder builder; - private VaultSettings vaultSettings; + private final MountService service; + private final MountBuilder builder; + private final VaultSettings vaultSettings; public SettledMounter(MountService service, MountBuilder builder, VaultSettings vaultSettings) { this.service = service; @@ -139,9 +141,7 @@ public class Mounter { } public MountHandle mount(VaultSettings vaultSettings, Path cryptoFsRoot) throws IOException, MountFailedException { - var fallbackProvider = mountProviders.stream().findFirst().orElse(null); - var defMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(settings.mountService.getValue())).findFirst().orElse(fallbackProvider); - var selMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(vaultSettings.mountService.getValue())).findFirst().orElse(defMntServ); + var selMntServ = mountProviders.stream().filter(s -> s.getClass().getName().equals(vaultSettings.mountService.getValue())).findFirst().orElse(defaultMountService.getValue()); var targetIsProblematicFuse = isProblematicFuseService(selMntServ); if (targetIsProblematicFuse && firstUsedProblematicFuseMountService.get() == null) { diff --git a/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java b/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java index 0583e4fbb..edcf0bb23 100644 --- a/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java +++ b/src/main/java/org/cryptomator/ui/vaultoptions/MountOptionsController.java @@ -2,7 +2,6 @@ package org.cryptomator.ui.vaultoptions; import com.google.common.base.Strings; import dagger.Lazy; -import org.cryptomator.common.ObservableUtil; import org.cryptomator.common.mount.Mounter; import org.cryptomator.common.mount.WindowsDriveLetters; import org.cryptomator.common.settings.Settings; @@ -88,7 +87,7 @@ public class MountOptionsController implements FxController { ResourceBundle resourceBundle, // Lazy application, // List mountProviders, // - @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService) { + @Named("FUPFMS") AtomicReference firstUsedProblematicFuseMountService, ObservableValue defaultMountService) { this.window = window; this.vaultSettings = vault.getVaultSettings(); this.windowsDriveLetters = windowsDriveLetters; @@ -96,10 +95,7 @@ public class MountOptionsController implements FxController { this.directoryPath = vault.getVaultSettings().mountPoint.map(p -> isDriveLetter(p) ? null : p.toString()); this.application = application; this.mountProviders = mountProviders; - var fallbackProvider = mountProviders.stream().findFirst().orElse(null); - this.defaultMountService = ObservableUtil.mapWithDefault(settings.mountService, // - serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), // - fallbackProvider); + this.defaultMountService = defaultMountService; this.selectedMountService = Bindings.createObjectBinding(this::reselectMountService, defaultMountService, vaultSettings.mountService); this.fuseRestartRequired = selectedMountService.map(s -> { return firstUsedProblematicFuseMountService.get() != null // From dce4c608812724d4888cd5051a211125143d8ddc Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Wed, 6 Dec 2023 08:40:43 +0100 Subject: [PATCH 40/71] removed pr unrelated changes and code cleanup --- src/main/java/org/cryptomator/common/vaults/Vault.java | 1 - .../java/org/cryptomator/common/vaults/VaultListManager.java | 4 +++- src/main/java/org/cryptomator/common/vaults/VaultModule.java | 4 ++++ src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cryptomator/common/vaults/Vault.java b/src/main/java/org/cryptomator/common/vaults/Vault.java index d741ae5c4..ac913d316 100644 --- a/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -147,7 +147,6 @@ public class Vault { if (cryptoFileSystem.get() != null) { throw new IllegalStateException("Already unlocked."); } - CryptoFileSystem fs = createCryptoFileSystem(keyLoader); boolean success = false; try { diff --git a/src/main/java/org/cryptomator/common/vaults/VaultListManager.java b/src/main/java/org/cryptomator/common/vaults/VaultListManager.java index 6f0e30153..2399a5107 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultListManager.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultListManager.java @@ -37,6 +37,7 @@ public class VaultListManager { private static final Logger LOG = LoggerFactory.getLogger(VaultListManager.class); + private final AutoLocker autoLocker; private final VaultComponent.Factory vaultComponentFactory; private final ObservableList vaultList; private final String defaultVaultName; @@ -48,9 +49,10 @@ public class VaultListManager { VaultComponent.Factory vaultComponentFactory, // ResourceBundle resourceBundle, Settings settings) { this.vaultList = vaultList; + this.autoLocker = autoLocker; this.vaultComponentFactory = vaultComponentFactory; this.defaultVaultName = resourceBundle.getString("defaults.vault.vaultName"); - + addAll(settings.directories); vaultList.addListener(new VaultListChangeListener(settings.directories)); autoLocker.init(); diff --git a/src/main/java/org/cryptomator/common/vaults/VaultModule.java b/src/main/java/org/cryptomator/common/vaults/VaultModule.java index 276af9f96..c8853fa5b 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultModule.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultModule.java @@ -9,6 +9,8 @@ import dagger.Module; import dagger.Provides; import org.cryptomator.common.Nullable; import org.cryptomator.cryptofs.CryptoFileSystem; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.inject.Named; import javafx.beans.property.ObjectProperty; @@ -18,6 +20,8 @@ import java.util.concurrent.atomic.AtomicReference; @Module public class VaultModule { + private static final Logger LOG = LoggerFactory.getLogger(VaultModule.class); + @Provides @PerVault public AtomicReference provideCryptoFileSystemReference() { diff --git a/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java b/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java index 98385f1d6..6be17ff26 100644 --- a/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java +++ b/src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java @@ -133,8 +133,8 @@ public class UnlockWorkflow extends Task { Throwable throwable = super.getException(); if(throwable instanceof IllegalMountPointException impe) { handleIllegalMountPointError(impe); - } else if (throwable instanceof FuseRestartRequiredException fRRE) { - handleFuseRestartRequiredError(fRRE); + } else if (throwable instanceof FuseRestartRequiredException e) { + handleFuseRestartRequiredError(e); } else { handleGenericError(throwable); } From 5cbed502ed4bd0da355cc484d1d6f75532350f4a Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Wed, 6 Dec 2023 08:49:21 +0100 Subject: [PATCH 41/71] undo VaultListManager changes --- .../org/cryptomator/common/vaults/VaultListManager.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/org/cryptomator/common/vaults/VaultListManager.java b/src/main/java/org/cryptomator/common/vaults/VaultListManager.java index 2399a5107..53616c3db 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultListManager.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultListManager.java @@ -42,12 +42,8 @@ public class VaultListManager { private final ObservableList vaultList; private final String defaultVaultName; - @Inject - public VaultListManager(ObservableList vaultList, // - AutoLocker autoLocker, // - VaultComponent.Factory vaultComponentFactory, // - ResourceBundle resourceBundle, Settings settings) { + public VaultListManager(ObservableList vaultList, AutoLocker autoLocker, VaultComponent.Factory vaultComponentFactory, ResourceBundle resourceBundle, Settings settings) { this.vaultList = vaultList; this.autoLocker = autoLocker; this.vaultComponentFactory = vaultComponentFactory; From fac72ca24aec3466a0a4a61c9d8e4fa766b82e9c Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Wed, 6 Dec 2023 09:44:05 +0100 Subject: [PATCH 42/71] undo remove settings port --- .../cryptomator/common/settings/Settings.java | 15 +++----- .../common/settings/SettingsJson.java | 5 +-- .../VolumePreferencesController.java | 38 +++++++++++++++++++ .../resources/fxml/preferences_volume.fxml | 6 +++ .../common/settings/SettingsJsonTest.java | 2 + .../common/settings/SettingsTest.java | 2 +- 6 files changed, 54 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/cryptomator/common/settings/Settings.java b/src/main/java/org/cryptomator/common/settings/Settings.java index 13e3d32ec..4e0e0df97 100644 --- a/src/main/java/org/cryptomator/common/settings/Settings.java +++ b/src/main/java/org/cryptomator/common/settings/Settings.java @@ -36,6 +36,7 @@ public class Settings { static final boolean DEFAULT_START_HIDDEN = false; static final boolean DEFAULT_AUTO_CLOSE_VAULTS = false; static final boolean DEFAULT_USE_KEYCHAIN = true; + static final int DEFAULT_PORT = 42427; static final int DEFAULT_NUM_TRAY_NOTIFICATIONS = 3; static final boolean DEFAULT_DEBUG_MODE = false; static final UiTheme DEFAULT_THEME = UiTheme.LIGHT; @@ -51,6 +52,7 @@ public class Settings { public final BooleanProperty startHidden; public final BooleanProperty autoCloseVaults; public final BooleanProperty useKeychain; + public final IntegerProperty port; public final IntegerProperty numTrayNotifications; public final BooleanProperty debugMode; public final ObjectProperty theme; @@ -87,6 +89,7 @@ public class Settings { this.startHidden = new SimpleBooleanProperty(this, "startHidden", json.startHidden); this.autoCloseVaults = new SimpleBooleanProperty(this, "autoCloseVaults", json.autoCloseVaults); this.useKeychain = new SimpleBooleanProperty(this, "useKeychain", json.useKeychain); + this.port = new SimpleIntegerProperty(this, "webDavPort", json.port); this.numTrayNotifications = new SimpleIntegerProperty(this, "numTrayNotifications", json.numTrayNotifications); this.debugMode = new SimpleBooleanProperty(this, "debugMode", json.debugMode); this.theme = new SimpleObjectProperty<>(this, "theme", json.theme); @@ -106,7 +109,6 @@ public class Settings { this.directories.addAll(json.directories.stream().map(VaultSettings::new).toList()); migrateLegacySettings(json); - migratePortToVaultSettings(json); directories.addListener(this::somethingChanged); askedForUpdateCheck.addListener(this::somethingChanged); @@ -114,6 +116,7 @@ public class Settings { startHidden.addListener(this::somethingChanged); autoCloseVaults.addListener(this::somethingChanged); useKeychain.addListener(this::somethingChanged); + port.addListener(this::somethingChanged); numTrayNotifications.addListener(this::somethingChanged); debugMode.addListener(this::somethingChanged); theme.addListener(this::somethingChanged); @@ -131,15 +134,6 @@ public class Settings { lastUpdateCheck.addListener(this::somethingChanged); } - @SuppressWarnings("deprecation") - private void migratePortToVaultSettings(SettingsJson json) { - if(json.port != 0){ - for (VaultSettings vaultSettings : directories) { - vaultSettings.port.set(json.port); - } - } - } - @SuppressWarnings("deprecation") private void migrateLegacySettings(SettingsJson json) { // implicit migration of 1.6.x legacy setting "preferredVolumeImpl": @@ -176,6 +170,7 @@ public class Settings { json.startHidden = startHidden.get(); json.autoCloseVaults = autoCloseVaults.get(); json.useKeychain = useKeychain.get(); + json.port = port.get(); json.numTrayNotifications = numTrayNotifications.get(); json.debugMode = debugMode.get(); json.theme = theme.get(); diff --git a/src/main/java/org/cryptomator/common/settings/SettingsJson.java b/src/main/java/org/cryptomator/common/settings/SettingsJson.java index bf1514b1d..2c7c963da 100644 --- a/src/main/java/org/cryptomator/common/settings/SettingsJson.java +++ b/src/main/java/org/cryptomator/common/settings/SettingsJson.java @@ -46,9 +46,8 @@ class SettingsJson { @JsonProperty("numTrayNotifications") int numTrayNotifications = Settings.DEFAULT_NUM_TRAY_NOTIFICATIONS; - @Deprecated(since = "1.12.0") - @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) // WRITE_ONLY means value is "written" into the java object during deserialization. Upvote this: https://github.com/FasterXML/jackson-annotations/issues/233 - int port; + @JsonProperty("port") + int port = Settings.DEFAULT_PORT; @JsonProperty("showMinimizeButton") boolean showMinimizeButton = Settings.DEFAULT_SHOW_MINIMIZE_BUTTON; diff --git a/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java index c06a4596b..c02a59ee5 100644 --- a/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java @@ -9,8 +9,12 @@ import org.cryptomator.ui.common.FxController; import javax.inject.Inject; import javafx.application.Application; +import javafx.beans.binding.Bindings; +import javafx.beans.binding.BooleanExpression; import javafx.beans.value.ObservableValue; +import javafx.scene.control.Button; import javafx.scene.control.ChoiceBox; +import javafx.scene.control.TextField; import javafx.util.StringConverter; import java.util.List; import java.util.Optional; @@ -20,10 +24,13 @@ import java.util.ResourceBundle; public class VolumePreferencesController implements FxController { private static final String DOCS_MOUNTING_URL = "https://docs.cryptomator.org/en/1.7/desktop/volume-type/"; + private static final int MIN_PORT = 1024; + private static final int MAX_PORT = 65535; private final Settings settings; private final ObservableValue selectedMountService; private final ResourceBundle resourceBundle; + private final BooleanExpression loopbackPortSupported; private final ObservableValue mountToDirSupported; private final ObservableValue mountToDriveLetterSupported; private final ObservableValue mountFlagsSupported; @@ -31,6 +38,8 @@ public class VolumePreferencesController implements FxController { private final Lazy application; private final List mountProviders; public ChoiceBox volumeTypeChoiceBox; + public TextField loopbackPortField; + public Button loopbackPortApplyButton; @Inject VolumePreferencesController(Settings settings, @@ -44,6 +53,7 @@ public class VolumePreferencesController implements FxController { var fallbackProvider = mountProviders.stream().findFirst().orElse(null); this.selectedMountService = ObservableUtil.mapWithDefault(settings.mountService, serviceName -> mountProviders.stream().filter(s -> s.getClass().getName().equals(serviceName)).findFirst().orElse(fallbackProvider), fallbackProvider); + this.loopbackPortSupported = BooleanExpression.booleanExpression(selectedMountService.map(s -> s.hasCapability(MountCapability.LOOPBACK_PORT))); this.mountToDirSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_WITHIN_EXISTING_PARENT) || s.hasCapability(MountCapability.MOUNT_TO_EXISTING_DIR)); this.mountToDriveLetterSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_AS_DRIVE_LETTER)); this.mountFlagsSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_FLAGS)); @@ -60,9 +70,37 @@ public class VolumePreferencesController implements FxController { var toSet = Optional.ofNullable(newProvider).map(nP -> nP.getClass().getName()).orElse(null); settings.mountService.set(toSet); }); + + loopbackPortField.setText(String.valueOf(settings.port.get())); + loopbackPortApplyButton.visibleProperty().bind(settings.port.asString().isNotEqualTo(loopbackPortField.textProperty())); + loopbackPortApplyButton.disableProperty().bind(Bindings.createBooleanBinding(this::validateLoopbackPort, loopbackPortField.textProperty()).not()); + } + + private boolean validateLoopbackPort() { + try { + int port = Integer.parseInt(loopbackPortField.getText()); + return port == 0 // choose port automatically + || port >= MIN_PORT && port <= MAX_PORT; // port within range + } catch (NumberFormatException e) { + return false; + } + } + + public void doChangeLoopbackPort() { + if (validateLoopbackPort()) { + settings.port.set(Integer.parseInt(loopbackPortField.getText())); + } } /* Property Getters */ + + public BooleanExpression loopbackPortSupportedProperty() { + return loopbackPortSupported; + } + + public boolean isLoopbackPortSupported() { + return loopbackPortSupported.get(); + } public ObservableValue readonlySupportedProperty() { return readonlySupported; } diff --git a/src/main/resources/fxml/preferences_volume.fxml b/src/main/resources/fxml/preferences_volume.fxml index b2f955801..fef85aadc 100644 --- a/src/main/resources/fxml/preferences_volume.fxml +++ b/src/main/resources/fxml/preferences_volume.fxml @@ -32,6 +32,12 @@ + +