From 4f3ca2a6c4c207168e1d7ed55da07ca324a5fbda Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 9 Feb 2024 12:55:36 +0100 Subject: [PATCH 01/50] fix appimage build script [ci skip] --- dist/linux/appimage/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/linux/appimage/build.sh b/dist/linux/appimage/build.sh index 6af5b5663..05a2c1f22 100755 --- a/dist/linux/appimage/build.sh +++ b/dist/linux/appimage/build.sh @@ -38,14 +38,14 @@ fi curl -L ${OPENJFX_URL} -o openjfx-jmods.zip echo "${OPENJFX_SHA} openjfx-jmods.zip" | shasum -a256 --check mkdir -p openjfx-jmods -unzip -j openjfx-jmods.zip \*/javafx.base.jmod \*/javafx.controls.jmod \*/javafx.fxml.jmod \*/javafx.graphics.jmod -d openjfx-jmods -JMOD_VERSION=$(jmod describe openjfx-jmods/javafx.base.jmod | head -1) +unzip -o -j openjfx-jmods.zip \*/javafx.base.jmod \*/javafx.controls.jmod \*/javafx.fxml.jmod \*/javafx.graphics.jmod -d openjfx-jmods +JMOD_VERSION=$(jmod describe ./openjfx-jmods/javafx.base.jmod | head -1) JMOD_VERSION=${JMOD_VERSION#*@} JMOD_VERSION=${JMOD_VERSION%%.*} -POM_JFX_VERSION=$(mvn help:evaluate "-Dexpression=javafx.version" -q -DforceStdout) +POM_JFX_VERSION=$(mvn help:evaluate "-Dexpression=javafx.version" -q -DforceStdout -B -f ../../../pom.xml) POM_JFX_VERSION=${POM_JFX_VERSION#*@} POM_JFX_VERSION=${POM_JFX_VERSION%%.*} -if [ $POM_JFX_VERSION -ne $JMOD_VERSION_AMD64 ]; then +if [ $POM_JFX_VERSION -ne $JMOD_VERSION ]; then >&2 echo "Major JavaFX version in pom.xml (${POM_JFX_VERSION}) != amd64 jmod version (${JMOD_VERSION})" exit 1 fi From fcb940e29c64244b03be96775866ad3ce1b87c88 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 9 Feb 2024 14:52:10 +0100 Subject: [PATCH 02/50] update release section of appstream metainfo file [ci skip] --- .../org.cryptomator.Cryptomator.metainfo.xml | 116 +++++++++++++----- 1 file changed, 87 insertions(+), 29 deletions(-) diff --git a/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml b/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml index 0330cac11..a542eca67 100644 --- a/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml +++ b/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml @@ -66,34 +66,92 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + https://github.com/cryptomator/cryptomator/releases/1.12.2 + + + https://github.com/cryptomator/cryptomator/releases/1.12.1 + + + https://github.com/cryptomator/cryptomator/releases/1.12.0 + + + https://github.com/cryptomator/cryptomator/releases/1.11.1 + + + https://github.com/cryptomator/cryptomator/releases/1.11.0 + + + https://github.com/cryptomator/cryptomator/releases/1.10.1 + + + https://github.com/cryptomator/cryptomator/releases/1.10.0 + + + https://github.com/cryptomator/cryptomator/releases/1.9.4 + + + https://github.com/cryptomator/cryptomator/releases/1.9.3 + + + https://github.com/cryptomator/cryptomator/releases/1.9.2 + + + https://github.com/cryptomator/cryptomator/releases/1.9.1 + + + https://github.com/cryptomator/cryptomator/releases/1.9.0 + + + https://github.com/cryptomator/cryptomator/releases/1.8.0 + + + https://github.com/cryptomator/cryptomator/releases/1.7.5 + + + https://github.com/cryptomator/cryptomator/releases/1.7.4 + + + https://github.com/cryptomator/cryptomator/releases/1.7.3 + + + https://github.com/cryptomator/cryptomator/releases/1.7.2 + + + https://github.com/cryptomator/cryptomator/releases/1.7.1 + + + https://github.com/cryptomator/cryptomator/releases/1.7.0 + + + https://github.com/cryptomator/cryptomator/releases/1.6.17 + + + https://github.com/cryptomator/cryptomator/releases/1.6.16 + + + https://github.com/cryptomator/cryptomator/releases/1.6.15 + + + https://github.com/cryptomator/cryptomator/releases/1.6.14 + + + https://github.com/cryptomator/cryptomator/releases/1.6.12 + + + https://github.com/cryptomator/cryptomator/releases/1.6.11 + + + https://github.com/cryptomator/cryptomator/releases/1.6.10 + + + https://github.com/cryptomator/cryptomator/releases/1.6.9 + + + https://github.com/cryptomator/cryptomator/releases/1.6.8 + + + https://github.com/cryptomator/cryptomator/releases/1.6.5 + From be4aad4168400ee794a53cf343bed8387bc43b4f Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 9 Feb 2024 17:03:22 +0100 Subject: [PATCH 03/50] set default value for Windows debug flag --- .github/workflows/win-exe.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 0ca2a7789..e3b96b722 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -11,6 +11,7 @@ on: isDebug: description: 'Build debug version with console output' type: boolean + default: false env: From 36ec1a5ebca5edab5ccfe5b444ec933b66745fbf Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 9 Feb 2024 18:12:02 +0100 Subject: [PATCH 04/50] update windows update url [ci skip] --- .github/workflows/win-exe.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index e3b96b722..e3e874e01 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -220,7 +220,7 @@ jobs: --win-menu --win-dir-chooser --win-shortcut-prompt - --win-update-url "https:\\cryptomator.org" + --win-update-url "https:\\cryptomator.org\downloads" --win-menu-group Cryptomator --resource-dir dist/win/resources --license-file dist/win/resources/license.rtf From 5fc981abd367831aa05da8dd3cbca30c00bc69e0 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 12 Feb 2024 13:16:45 +0100 Subject: [PATCH 05/50] prevent automatic overwrite of already released files --- .github/workflows/appimage.yml | 2 +- .github/workflows/debian.yml | 2 +- .github/workflows/mac-dmg.yml | 2 +- .github/workflows/win-exe.yml | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 9b08c82c8..267bdfc75 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -173,7 +173,7 @@ jobs: cryptomator-*.asc if-no-files-found: error - name: Publish AppImage on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 39811359d..8cfbc16b6 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -145,7 +145,7 @@ jobs: # If ref is a tag, also upload to GitHub Releases: - name: Publish Debian package on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && inputs.dput env: GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} run: | diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 6d2bc19ce..be5747839 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -256,7 +256,7 @@ jobs: path: Cryptomator-*.dmg if-no-files-found: error - name: Publish dmg on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index e3e874e01..035b75e14 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -255,7 +255,7 @@ jobs: Cryptomator-*.asc if-no-files-found: error - name: Publish .msi on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true @@ -366,7 +366,7 @@ jobs: Cryptomator-*.asc if-no-files-found: error - name: Publish .msi on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true @@ -416,7 +416,7 @@ jobs: local-dir: files/ notify-winget: name: Notify for winget-release - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'published' needs: [build-msi] runs-on: ubuntu-latest steps: From c7b8bc89c24f587108b2bd871891bd970a09b94d Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 12 Feb 2024 13:18:17 +0100 Subject: [PATCH 06/50] also don't bother upload to av scan, if not published --- .github/workflows/win-exe.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 035b75e14..4aa2772ab 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -377,7 +377,7 @@ jobs: allowlist: name: Anti Virus Allowlisting - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'published' runs-on: ubuntu-latest needs: [build-msi, build-exe] steps: From 3b3aa18c92e1d70207ae3fb26827c1c1328a33d8 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 13 Feb 2024 00:55:07 +0100 Subject: [PATCH 07/50] fixes #3233 this time with gc prevention of a binding --- .../CreateNewVaultLocationController.java | 74 +++++++++++++++---- .../resources/fxml/addvault_new_location.fxml | 34 ++++++--- 2 files changed, 82 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java b/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java index 3178f0ba4..2a69dbcf7 100644 --- a/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java +++ b/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java @@ -13,31 +13,37 @@ import org.slf4j.LoggerFactory; import javax.inject.Inject; import javax.inject.Named; +import javafx.application.Platform; +import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.StringProperty; import javafx.beans.value.ObservableValue; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; import javafx.fxml.FXML; +import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.control.RadioButton; import javafx.scene.control.Toggle; import javafx.scene.control.ToggleGroup; +import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.stage.DirectoryChooser; import javafx.stage.Stage; +import javafx.stage.WindowEvent; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; -import java.util.Comparator; -import java.util.List; import java.util.Optional; import java.util.ResourceBundle; +import java.util.concurrent.ExecutorService; @AddVaultWizardScoped public class CreateNewVaultLocationController implements FxController { @@ -49,19 +55,23 @@ public class CreateNewVaultLocationController implements FxController { private final Stage window; private final Lazy chooseNameScene; private final Lazy chooseExpertSettingsScene; - private final List locationPresetBtns; private final ObjectProperty vaultPath; private final StringProperty vaultName; + private final ExecutorService backgroundExecutor; private final ResourceBundle resourceBundle; private final ObservableValue vaultPathStatus; private final ObservableValue validVaultPath; private final BooleanProperty usePresetPath; + private final BooleanProperty loadingPresetLocations = new SimpleBooleanProperty(false); + private final ObservableList radioButtons; + private final ObservableList sortedRadioButtons; private Path customVaultPath = DEFAULT_CUSTOM_VAULT_PATH; //FXML public ToggleGroup locationPresetsToggler; public VBox radioButtonVBox; + public HBox customLocationRadioBtn; public RadioButton customRadioButton; public Label locationStatusLabel; public FontAwesome5IconView goodLocation; @@ -73,25 +83,20 @@ public class CreateNewVaultLocationController implements FxController { @FxmlScene(FxmlFile.ADDVAULT_NEW_EXPERT_SETTINGS) Lazy chooseExpertSettingsScene, // ObjectProperty vaultPath, // @Named("vaultName") StringProperty vaultName, // - ResourceBundle resourceBundle) { + ExecutorService backgroundExecutor, ResourceBundle resourceBundle) { this.window = window; this.chooseNameScene = chooseNameScene; this.chooseExpertSettingsScene = chooseExpertSettingsScene; this.vaultPath = vaultPath; this.vaultName = vaultName; + this.backgroundExecutor = backgroundExecutor; this.resourceBundle = resourceBundle; this.vaultPathStatus = ObservableUtil.mapWithDefault(vaultPath, this::validatePath, new VaultPathStatus(false, "error.message")); this.validVaultPath = ObservableUtil.mapWithDefault(vaultPathStatus, VaultPathStatus::valid, false); this.vaultPathStatus.addListener(this::updateStatusLabel); this.usePresetPath = new SimpleBooleanProperty(); - this.locationPresetBtns = LocationPresetsProvider.loadAll(LocationPresetsProvider.class) // - .flatMap(LocationPresetsProvider::getLocations) // - .sorted(Comparator.comparing(LocationPreset::name)) // - .map(preset -> { // - var btn = new RadioButton(preset.name()); - btn.setUserData(preset.path()); - return btn; - }).toList(); + this.radioButtons = FXCollections.observableArrayList(); + this.sortedRadioButtons = radioButtons.sorted(this::compareLocationPresets); } private VaultPathStatus validatePath(Path p) throws NullPointerException { @@ -137,12 +142,45 @@ public class CreateNewVaultLocationController implements FxController { @FXML public void initialize() { - radioButtonVBox.getChildren().addAll(1, locationPresetBtns); //first item is the list header - locationPresetsToggler.getToggles().addAll(locationPresetBtns); + var task = backgroundExecutor.submit(this::loadLocationPresets); + window.addEventHandler(WindowEvent.WINDOW_HIDING, _ -> task.cancel(true)); locationPresetsToggler.selectedToggleProperty().addListener(this::togglePredefinedLocation); usePresetPath.bind(locationPresetsToggler.selectedToggleProperty().isNotEqualTo(customRadioButton)); + radioButtons.add(customLocationRadioBtn); + Bindings.bindContent(radioButtonVBox.getChildren(), sortedRadioButtons); //to prevent garbage collection of the binding, we bind explicitly to the sorted list } + private void loadLocationPresets() { + Platform.runLater(() -> loadingPresetLocations.set(true)); + try { + LocationPresetsProvider.loadAll(LocationPresetsProvider.class) // + .flatMap(LocationPresetsProvider::getLocations) //we do not use sorted(), because it evaluates the stream elements, blocking until all elements are gathered + .forEach(this::createRadioButtonFor); + } finally { + Platform.runLater(() -> loadingPresetLocations.set(false)); + } + } + + private void createRadioButtonFor(LocationPreset preset) { + Platform.runLater(() -> { + var btn = new RadioButton(preset.name()); + btn.setUserData(preset.path()); + radioButtons.add(btn); + locationPresetsToggler.getToggles().add(btn); + }); + } + + private int compareLocationPresets(Node left, Node right) { + if (customLocationRadioBtn.getId().equals(left.getId())) { + return 1; + } else if (customLocationRadioBtn.getId().equals(right.getId())) { + return -1; + } else { + return ((RadioButton) left).getText().compareToIgnoreCase(((RadioButton) right).getText()); + } + } + + private void togglePredefinedLocation(@SuppressWarnings("unused") ObservableValue observable, @SuppressWarnings("unused") Toggle oldValue, Toggle newValue) { var storagePath = Optional.ofNullable((Path) newValue.getUserData()).orElse(customVaultPath); vaultPath.set(storagePath.resolve(vaultName.get())); @@ -200,6 +238,14 @@ public class CreateNewVaultLocationController implements FxController { return validVaultPath.getValue(); } + public boolean isLoadingPresetLocations() { + return loadingPresetLocations.getValue(); + } + + public BooleanProperty loadingPresetLocationsProperty() { + return loadingPresetLocations; + } + public BooleanProperty usePresetPathProperty() { return usePresetPath; } diff --git a/src/main/resources/fxml/addvault_new_location.fxml b/src/main/resources/fxml/addvault_new_location.fxml index 3374acaa6..7b3157ffb 100644 --- a/src/main/resources/fxml/addvault_new_location.fxml +++ b/src/main/resources/fxml/addvault_new_location.fxml @@ -1,11 +1,13 @@ + + @@ -29,18 +31,26 @@ - - +