diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e47dae730..c28785b01 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,10 +3,7 @@ updates: - package-ecosystem: "maven" directory: "/" schedule: - interval: "weekly" - day: "monday" - time: "06:00" - timezone: "Etc/UTC" + interval: "monthly" ignore: - dependency-name: "org.cryptomator:integrations-api" versions: ["2.0.0-alpha1"] @@ -18,36 +15,9 @@ updates: - dependency-name: "org.apache.maven.plugins:maven-surefire-plugin" versions: [ "3.5.4", "3.5.5" ] groups: - 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: + maven-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` diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 091d8722f..59db89176 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -212,7 +212,7 @@ jobs: if-no-files-found: error - name: Publish AppImage on GitHub Releases if: github.ref_type == 'tag' && inputs.is-release - uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 + uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1 with: draft: true fail_on_unmatched_files: true diff --git a/.github/workflows/av-whitelist.yml b/.github/workflows/av-whitelist.yml index 81322eec7..7577662da 100644 --- a/.github/workflows/av-whitelist.yml +++ b/.github/workflows/av-whitelist.yml @@ -63,7 +63,7 @@ jobs: if: inputs.kaspersky steps: - name: Download artifact - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ needs.download-file.outputs.fileName }} path: upload @@ -83,7 +83,7 @@ jobs: if: inputs.avast steps: - name: Download artifact - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ needs.download-file.outputs.fileName }} path: upload diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b4bb03b4..4061626ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: java-version: ${{ env.JAVA_VERSION }} cache: 'maven' - name: Cache SonarCloud packages - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar @@ -46,4 +46,4 @@ jobs: -Dsonar.host.url=https://sonarcloud.io env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index f75b22a63..45056f700 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -73,6 +73,6 @@ jobs: env: VERSION_STRING: ${{ inputs.version }} - name: Validate Version - uses: skymatic/semver-validation-action@7a6ae1c9e121540d11c9c7e4e667c83d583aa153 # v3.0.0 + uses: skymatic/semver-validation-action@7c80b6b03a18b42884761daa9862ff5683ec8c8a # v4.0.0 with: version: ${{ steps.versions.outputs.semVerStr }} \ No newline at end of file diff --git a/.github/workflows/linux-flatpak.yml b/.github/workflows/linux-flatpak.yml index d73d25c11..83afbed39 100644 --- a/.github/workflows/linux-flatpak.yml +++ b/.github/workflows/linux-flatpak.yml @@ -145,12 +145,12 @@ jobs: contents: none steps: - name: Download updated maven aarch64 dependencies - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: maven-sources-aarch64 path: mvn-src-aarch64 - name: Download updated maven x86_64 dependencies - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: maven-sources-x86_64 path: mvn-src-x64 @@ -194,12 +194,12 @@ jobs: TARBALL_SHA512=$(sha512sum cryptomator.tar.gz | cut -d ' ' -f1) echo "value=${TARBALL_SHA512}" >> "$GITHUB_OUTPUT" - name: Download updated maven aarch64 dependencies - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: maven-sources-aarch64 path: mvn-src-aarch64 - name: Download updated maven x86_64 dependencies - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: maven-sources-x86_64 path: mvn-src-x64 diff --git a/.github/workflows/linux-makepkg.yml b/.github/workflows/linux-makepkg.yml index b09ab4381..7f195c7db 100644 --- a/.github/workflows/linux-makepkg.yml +++ b/.github/workflows/linux-makepkg.yml @@ -146,7 +146,7 @@ jobs: env: TARGET_VERSION: ${{ needs.get-version.outputs.semVerStr }} - name: Download PKGBUILD template - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: pkgbuild-file - name: Prepare PKGBUILD diff --git a/.github/workflows/mac-dmg-x64.yml b/.github/workflows/mac-dmg-x64.yml index 11465a146..9786b452f 100644 --- a/.github/workflows/mac-dmg-x64.yml +++ b/.github/workflows/mac-dmg-x64.yml @@ -296,7 +296,7 @@ jobs: if-no-files-found: error - name: Publish dmg on GitHub Releases if: github.ref_type == 'tag' && inputs.is-release - uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 + uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1 with: draft: true fail_on_unmatched_files: true diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 03681dae7..1aa0654c5 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -295,7 +295,7 @@ jobs: if-no-files-found: error - name: Publish dmg on GitHub Releases if: github.ref_type == 'tag' && inputs.is-release - uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 + uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1 with: draft: true fail_on_unmatched_files: true diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index 2e6779093..bae89301d 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -50,7 +50,7 @@ jobs: exit 1 fi - name: Cache NVD DB - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ~/.m2/repository/org/owasp/dependency-check-data/ key: dependency-check-${{ github.run_id }} diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 67898e158..3d0712000 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -322,7 +322,7 @@ jobs: env: WIX_VERSION: ${{ env.WIX_VERSION }} - name: Download .msi - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: msi-${{ matrix.arch }} path: dist/win/bundle/resources @@ -433,12 +433,12 @@ jobs: needs: [ build-msi, build-exe ] steps: - name: Download installers - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: merge-multiple: true - name: Publish installers on GitHub Releases id: publish - uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 + uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1 with: draft: true fail_on_unmatched_files: true diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 5ab150229..e5a994243 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -18,7 +18,7 @@ jobs: env: GH_TOKEN: ${{ secrets.CRYPTOBOT_PR_TOKEN }} - name: Submit package - uses: vedantmgoyal2009/winget-releaser@19e706d4c9121098010096f9c495a70a7518b30f # no_specific_version + uses: vedantmgoyal2009/winget-releaser@7bd472be23763def6e16bd06cc8b1cdfab0e2fd5 # no_specific_version with: identifier: Cryptomator.Cryptomator version: ${{ inputs.tag }} diff --git a/src/main/java/org/cryptomator/ui/decryptname/DecryptFileNamesViewController.java b/src/main/java/org/cryptomator/ui/decryptname/DecryptFileNamesViewController.java index 5450e1d48..b7c14199f 100644 --- a/src/main/java/org/cryptomator/ui/decryptname/DecryptFileNamesViewController.java +++ b/src/main/java/org/cryptomator/ui/decryptname/DecryptFileNamesViewController.java @@ -58,8 +58,6 @@ public class DecryptFileNamesViewController implements FxController { private final Stage window; private final Vault vault; private final ResourceBundle resourceBundle; - private final List initialList; - @FXML public TableColumn ciphertextColumn; @FXML @@ -68,12 +66,11 @@ public class DecryptFileNamesViewController implements FxController { public TableView cipherToCleartextTable; @Inject - public DecryptFileNamesViewController(@DecryptNameWindow Stage window, @DecryptNameWindow Vault vault, @DecryptNameWindow List pathsToDecrypt, ResourceBundle resourceBundle) { + public DecryptFileNamesViewController(@DecryptNameWindow Stage window, @DecryptNameWindow Vault vault, ResourceBundle resourceBundle) { this.window = window; this.vault = vault; this.resourceBundle = resourceBundle; this.mapping = new SimpleListProperty<>(FXCollections.observableArrayList()); - this.initialList = pathsToDecrypt; } @FXML @@ -97,8 +94,7 @@ public class DecryptFileNamesViewController implements FxController { }); cipherToCleartextTable.setOnDragDropped(event -> { if (event.getGestureSource() == null && event.getDragboard().hasFiles()) { - checkAndDecrypt(event.getDragboard().getFiles().stream().map(File::toPath).toList()); - cipherToCleartextTable.setItems(mapping); + decrypt(event.getDragboard().getFiles().stream().map(File::toPath).toList()); } }); cipherToCleartextTable.setOnDragExited(_ -> cipherToCleartextTable.setItems(mapping)); @@ -124,9 +120,7 @@ public class DecryptFileNamesViewController implements FxController { }); } }); - if (!initialList.isEmpty()) { - checkAndDecrypt(initialList); - } + window.setOnHidden(_ -> mapping.clear()); } private void copySingleCelltoClipboard() { @@ -149,10 +143,18 @@ public class DecryptFileNamesViewController implements FxController { fileChooser.setInitialDirectory(vault.getPath().toFile()); var ciphertextNodes = fileChooser.showOpenMultipleDialog(window); if (ciphertextNodes != null) { - checkAndDecrypt(ciphertextNodes.stream().map(File::toPath).toList()); + decrypt(ciphertextNodes.stream().map(File::toPath).toList()); } } + public void decrypt(List pathsToDecrypt) { + if (pathsToDecrypt.isEmpty()) { + return; + } + checkAndDecrypt(pathsToDecrypt); + cipherToCleartextTable.setItems(mapping); + } + private void checkAndDecrypt(List pathsToDecrypt) { mapping.clear(); //Assumption: All files are in the same directory diff --git a/src/main/java/org/cryptomator/ui/decryptname/DecryptNameComponent.java b/src/main/java/org/cryptomator/ui/decryptname/DecryptNameComponent.java index 7684d4286..4abf7ee3f 100644 --- a/src/main/java/org/cryptomator/ui/decryptname/DecryptNameComponent.java +++ b/src/main/java/org/cryptomator/ui/decryptname/DecryptNameComponent.java @@ -28,23 +28,28 @@ public interface DecryptNameComponent { @FxmlScene(FxmlFile.DECRYPTNAMES) Lazy decryptNamesView(); + DecryptFileNamesViewController controller(); + @DecryptNameWindow Vault vault(); - default void showDecryptFileNameWindow() { + default void showDecryptFileNameWindow(List pathsToDecrypt) { Stage s = window(); s.setScene(decryptNamesView().get()); s.sizeToScene(); if (vault().isUnlocked()) { + controller().decrypt(pathsToDecrypt); s.show(); + s.requestFocus(); } else { LOG.error("Aborted showing DecryptFileName window: vault state is not {}, but {}.", VaultState.Value.UNLOCKED, vault().getState()); + s.close(); } } @Subcomponent.Factory interface Factory { - DecryptNameComponent create(@BindsInstance @DecryptNameWindow Vault vault, @BindsInstance @Named("windowOwner") Stage owner, @BindsInstance @DecryptNameWindow List pathsToDecrypt); + DecryptNameComponent create(@BindsInstance @DecryptNameWindow Vault vault, @BindsInstance @Named("windowOwner") Stage owner); } } diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java index 742e3baaa..92c2596f3 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailUnlockedController.java @@ -58,6 +58,7 @@ public class VaultDetailUnlockedController implements FxController { private final DecryptNameComponent.Factory decryptNameWindowFactory; private final ResourceBundle resourceBundle; private final LoadingCache vaultStats; + private final LoadingCache decryptNameWindows; private final VaultStatisticsComponent.Builder vaultStatsBuilder; private final ObservableValue accessibleViaPath; private final ObservableValue accessibleViaUri; @@ -90,6 +91,7 @@ public class VaultDetailUnlockedController implements FxController { this.decryptNameWindowFactory = decryptNameWindowFactory; this.resourceBundle = resourceBundle; this.vaultStats = CacheBuilder.newBuilder().weakValues().build(CacheLoader.from(this::buildVaultStats)); + this.decryptNameWindows = CacheBuilder.newBuilder().weakValues().build(CacheLoader.from(this::buildDecryptNameWindow)); this.vaultStatsBuilder = vaultStatsBuilder; var mp = vault.flatMap(Vault::mountPointProperty); this.accessibleViaPath = mp.map(m -> m instanceof Mountpoint.WithPath).orElse(false); @@ -161,7 +163,7 @@ public class VaultDetailUnlockedController implements FxController { } private void showDecryptNameWindow(List pathsToDecrypt) { - decryptNameWindowFactory.create(vault.get(), mainWindow, pathsToDecrypt).showDecryptFileNameWindow(); + decryptNameWindows.getUnchecked(vault.get()).showDecryptFileNameWindow(pathsToDecrypt); } private boolean startsWithVaultAccessPoint(Path path) { @@ -198,6 +200,10 @@ public class VaultDetailUnlockedController implements FxController { return vaultStatsBuilder.vault(vault).build(); } + private DecryptNameComponent buildDecryptNameWindow(Vault vault) { + return decryptNameWindowFactory.create(vault, mainWindow); + } + @FXML public void revealAccessLocation() { vaultService.reveal(vault.get());