mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 16:51:28 +00:00
Compare commits
202 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e39eaa1f1 | ||
|
|
eaca95e8dc | ||
|
|
cf32e794c8 | ||
|
|
b5b221a5c7 | ||
|
|
d7cb99a12d | ||
|
|
b1893c63d4 | ||
|
|
b50cc703b6 | ||
|
|
9dc4a1dc5a | ||
|
|
f1a63a1679 | ||
|
|
d53d4e3452 | ||
|
|
b7fa1ae6d8 | ||
|
|
3f192a587c | ||
|
|
3a1b0b17d6 | ||
|
|
5d2a243c55 | ||
|
|
008a2a3301 | ||
|
|
0680437004 | ||
|
|
db6cf5459e | ||
|
|
1d8466a9e3 | ||
|
|
dcbcd692e7 | ||
|
|
87fd6c712a | ||
|
|
958505559f | ||
|
|
4736e5e7e7 | ||
|
|
55d217887a | ||
|
|
34ccd3ff73 | ||
|
|
989c349331 | ||
|
|
b9df56a6de | ||
|
|
38dbefff0b | ||
|
|
4cbe45919b | ||
|
|
b7ccf7986d | ||
|
|
40d632a489 | ||
|
|
800aca5207 | ||
|
|
6a26d95c15 | ||
|
|
439d3d7529 | ||
|
|
7476e192a3 | ||
|
|
c6193bc259 | ||
|
|
7446c69cd8 | ||
|
|
43c352e0d2 | ||
|
|
61ec3bc465 | ||
|
|
36dd98127d | ||
|
|
30862146b0 | ||
|
|
c19734da6f | ||
|
|
ba8fb273c7 | ||
|
|
5204a8e356 | ||
|
|
43b341860b | ||
|
|
ad02e43daf | ||
|
|
4942bcb52b | ||
|
|
6b2e718e04 | ||
|
|
a1323b5e81 | ||
|
|
ab4f487de1 | ||
|
|
d506e7472d | ||
|
|
2d33d02b46 | ||
|
|
06ddec4b70 | ||
|
|
24e31553fd | ||
|
|
eaa6b31de8 | ||
|
|
060ae588a2 | ||
|
|
262f84e8db | ||
|
|
6d55331ef2 | ||
|
|
42269a6057 | ||
|
|
181e45a596 | ||
|
|
3c8e506805 | ||
|
|
401b0afe9f | ||
|
|
42ec41b991 | ||
|
|
7ec3c5d04f | ||
|
|
f0a7379575 | ||
|
|
0d12b11c48 | ||
|
|
14a025f769 | ||
|
|
598fc9bbc8 | ||
|
|
fbab2df00f | ||
|
|
fb56b61a75 | ||
|
|
c5c3d55658 | ||
|
|
48c2d49c86 | ||
|
|
00d68393f6 | ||
|
|
7a50ba0b43 | ||
|
|
b2bee99286 | ||
|
|
88d384afdf | ||
|
|
7af82b831f | ||
|
|
a86f42fa44 | ||
|
|
70b0413777 | ||
|
|
577a77af38 | ||
|
|
3ba7e9ba00 | ||
|
|
b2250e8ce0 | ||
|
|
f2a480c7a0 | ||
|
|
bda38096e1 | ||
|
|
7e66a61294 | ||
|
|
3aa627a467 | ||
|
|
ae1b5fc925 | ||
|
|
b1076f9c86 | ||
|
|
ede1c72595 | ||
|
|
d2fcd5b64f | ||
|
|
6d9704ffa2 | ||
|
|
40df3d015a | ||
|
|
4e22706d92 | ||
|
|
341710f724 | ||
|
|
8386183f7a | ||
|
|
b76a7d6895 | ||
|
|
4a397a8151 | ||
|
|
2239a3e6a3 | ||
|
|
5318368879 | ||
|
|
41a279da9d | ||
|
|
478c69f82c | ||
|
|
eb0e630a44 | ||
|
|
0bcbf9a13a | ||
|
|
e3073a3613 | ||
|
|
3333dc7f22 | ||
|
|
12ec6fbec8 | ||
|
|
43fc976ad7 | ||
|
|
034278c0a0 | ||
|
|
92b3a9e1bd | ||
|
|
fc7169f2a0 | ||
|
|
c39710ede0 | ||
|
|
cc0b6aed15 | ||
|
|
f8a83c9cc8 | ||
|
|
43ce64f01e | ||
|
|
d585a03f76 | ||
|
|
f953be6237 | ||
|
|
e81bbe197b | ||
|
|
738fa4da12 | ||
|
|
9a08dcc46d | ||
|
|
74ef8d915d | ||
|
|
025a7a5582 | ||
|
|
3b2ddcf98d | ||
|
|
c10fc0ee5b | ||
|
|
aaa37e2c7a | ||
|
|
7af7c920e3 | ||
|
|
a4f79fb98a | ||
|
|
f429f2d3e7 | ||
|
|
4f6e091c13 | ||
|
|
2df779f7ab | ||
|
|
5b9d9150c5 | ||
|
|
f0aaec2058 | ||
|
|
4adc4a9175 | ||
|
|
5a97060fac | ||
|
|
db96074119 | ||
|
|
7ecc10bc79 | ||
|
|
44fe4a6f8a | ||
|
|
76a4ef50cb | ||
|
|
ca2f80024a | ||
|
|
dcd7077b08 | ||
|
|
31482d7d18 | ||
|
|
5ef666154e | ||
|
|
a810eff797 | ||
|
|
664158eb84 | ||
|
|
6b43881909 | ||
|
|
126004b1f8 | ||
|
|
ba34cfa9d5 | ||
|
|
03b4ad85ef | ||
|
|
1abfcd495f | ||
|
|
69964a80f1 | ||
|
|
aa8306ea4a | ||
|
|
3fecde37f4 | ||
|
|
2fc5fd99fb | ||
|
|
7edacfea70 | ||
|
|
7020fa49d9 | ||
|
|
7cea0bb33c | ||
|
|
3d622b18dc | ||
|
|
62cd506588 | ||
|
|
cd830f27a0 | ||
|
|
3f75018369 | ||
|
|
270a4c594d | ||
|
|
a5fdc5755b | ||
|
|
0a5a554714 | ||
|
|
976f22c27a | ||
|
|
8267574697 | ||
|
|
9077c964b3 | ||
|
|
f80467a3a4 | ||
|
|
8c462c4cb7 | ||
|
|
b25b5bd5a3 | ||
|
|
6365c22297 | ||
|
|
d7dd24b94e | ||
|
|
aee8844558 | ||
|
|
c536149c62 | ||
|
|
ca1ae8181b | ||
|
|
2b19c9757b | ||
|
|
d6871e3d82 | ||
|
|
0432a64537 | ||
|
|
06988b06c7 | ||
|
|
9b72eb8219 | ||
|
|
ea188f6176 | ||
|
|
cf67d022c8 | ||
|
|
7ba6e12799 | ||
|
|
b512518ccc | ||
|
|
93dfd35627 | ||
|
|
50b92f9510 | ||
|
|
7cca8922d8 | ||
|
|
c00889b1c4 | ||
|
|
b6224f355d | ||
|
|
9a8f96d432 | ||
|
|
3cc199227b | ||
|
|
3d0647bce3 | ||
|
|
192f35a9dd | ||
|
|
f2b4c9a35b | ||
|
|
3b8fec4c5a | ||
|
|
60b74a018d | ||
|
|
be69e04f51 | ||
|
|
194f6009df | ||
|
|
910a2eace8 | ||
|
|
3c95618eec | ||
|
|
fc709eb700 | ||
|
|
a6c60ac5d0 | ||
|
|
b88b9c8f92 | ||
|
|
2b8cd36b7b | ||
|
|
3d23deb744 |
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@@ -16,6 +16,10 @@
|
||||
|
||||
- Suggest your change by [submitting a new issue](https://github.com/cryptomator/cryptomator/issues/new/choose) and start writing code.
|
||||
|
||||
## Do you intend to add a new translation or change an existing one?
|
||||
|
||||
Translations are not managed directly in this repository. Instead, we use [Crowdin](https://translate.cryptomator.org/), which automatically synchronizes translations with this repository. If you want to help us with translations, please visit our translation project on Crowdin.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
Help us keep Cryptomator open and inclusive. Please read and follow our [Code of Conduct](https://github.com/cryptomator/cryptomator/blob/develop/.github/CODE_OF_CONDUCT.md).
|
||||
|
||||
18
.github/ISSUE_TEMPLATE/bug.yml
vendored
18
.github/ISSUE_TEMPLATE/bug.yml
vendored
@@ -1,7 +1,14 @@
|
||||
name: Bug Report
|
||||
description: Create a report to help us improve
|
||||
labels: ["type:bug"]
|
||||
type: "Bug"
|
||||
body:
|
||||
- type: input
|
||||
id: summary
|
||||
attributes:
|
||||
label: Summary
|
||||
placeholder: Please summarize your problem.
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
@@ -11,13 +18,6 @@ body:
|
||||
required: true
|
||||
- label: I agree to follow this project's [Code of Conduct](https://github.com/cryptomator/cryptomator/blob/develop/.github/CODE_OF_CONDUCT.md)
|
||||
required: true
|
||||
- type: input
|
||||
id: summary
|
||||
attributes:
|
||||
label: Summary
|
||||
placeholder: Please summarize your problem.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: software-versions
|
||||
attributes:
|
||||
@@ -97,4 +97,4 @@ body:
|
||||
id: further-info
|
||||
attributes:
|
||||
label: Anything else?
|
||||
description: Links? References? Screenshots? Configurations? Any data that might be necessary to reproduce the issue?
|
||||
description: Links? References? Screenshots? Configurations? Any data that might be necessary to reproduce the issue?
|
||||
16
.github/ISSUE_TEMPLATE/feature.yml
vendored
16
.github/ISSUE_TEMPLATE/feature.yml
vendored
@@ -1,7 +1,14 @@
|
||||
name: Feature Request
|
||||
description: Suggest an idea for this project
|
||||
labels: ["type:feature-request"]
|
||||
type: "Feature"
|
||||
body:
|
||||
- type: input
|
||||
id: summary
|
||||
attributes:
|
||||
label: Summary
|
||||
placeholder: Please summarize your feature request.
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
@@ -11,13 +18,6 @@ body:
|
||||
required: true
|
||||
- label: I agree to follow this project's [Code of Conduct](https://github.com/cryptomator/cryptomator/blob/develop/.github/CODE_OF_CONDUCT.md)
|
||||
required: true
|
||||
- type: input
|
||||
id: summary
|
||||
attributes:
|
||||
label: Summary
|
||||
placeholder: Please summarize your feature request.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: motivation
|
||||
attributes:
|
||||
|
||||
27
.github/workflows/appimage.yml
vendored
27
.github/workflows/appimage.yml
vendored
@@ -10,8 +10,8 @@ on:
|
||||
required: false
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_VERSION: '23.0.1+11'
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_VERSION: '23.0.2'
|
||||
|
||||
jobs:
|
||||
get-version:
|
||||
@@ -29,12 +29,12 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
appimage-suffix: x86_64
|
||||
openjfx-url: 'https://download2.gluonhq.com/openjfx/22.0.2/openjfx-22.0.2_linux-x64_bin-jmods.zip'
|
||||
openjfx-sha: 'd44bff3b94d5668fdee18a938d7b1269026d663d44765f02d29a9bdfd3fa1eb0'
|
||||
- os: [self-hosted, Linux, ARM64]
|
||||
openjfx-url: 'https://download2.gluonhq.com/openjfx/23.0.2/openjfx-23.0.2_linux-x64_bin-jmods.zip'
|
||||
openjfx-sha: '063baebc6922e4a89c94b9dfb7a4f53e59e8d6fec400d4e670b31bc2ab324dec'
|
||||
- os: ubuntu-24.04-arm
|
||||
appimage-suffix: aarch64
|
||||
openjfx-url: 'https://download2.gluonhq.com/openjfx/22.0.2/openjfx-22.0.2_linux-aarch64_bin-jmods.zip'
|
||||
openjfx-sha: '3d5457136690c4f5bb9522d38b45218e045bdac13c24aa4c808c7c8d17d039c7'
|
||||
openjfx-url: 'https://download2.gluonhq.com/openjfx/23.0.2/openjfx-23.0.2_linux-aarch64_bin-jmods.zip'
|
||||
openjfx-sha: '9bbedaeae1590b69e2b22237bda310936df33e344dbc243bea2e86acaab3a0d8'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
@@ -98,7 +98,7 @@ jobs:
|
||||
--dest appdir
|
||||
--name Cryptomator
|
||||
--vendor "Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2024 Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2025 Skymatic GmbH"
|
||||
--app-version "${{ needs.get-version.outputs.semVerNum }}.${{ needs.get-version.outputs.revNum }}"
|
||||
--java-options "--enable-preview"
|
||||
--java-options "--enable-native-access=org.cryptomator.jfuse.linux.amd64,org.cryptomator.jfuse.linux.aarch64,org.purejava.appindicator"
|
||||
@@ -116,6 +116,7 @@ jobs:
|
||||
--java-options "-Dcryptomator.showTrayIcon=true"
|
||||
--java-options "-Dcryptomator.integrationsLinux.trayIconsDir=\"@{appdir}/usr/share/icons/hicolor/symbolic/apps\""
|
||||
--java-options "-Dcryptomator.buildNumber=\"appimage-${{ needs.get-version.outputs.revNum }}\""
|
||||
--java-options "-Dcryptomator.networking.truststore.p12Path=\"/etc/cryptomator/certs.p12\""
|
||||
--resource-dir dist/linux/resources
|
||||
- name: Patch Cryptomator.AppDir
|
||||
run: |
|
||||
@@ -132,13 +133,13 @@ jobs:
|
||||
cp dist/linux/common/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop
|
||||
cp dist/linux/common/application-vnd.cryptomator.vault.xml Cryptomator.AppDir/usr/share/mime/packages/application-vnd.cryptomator.vault.xml
|
||||
ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg
|
||||
ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg
|
||||
ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/.DirIcon
|
||||
ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop
|
||||
ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/org.cryptomator.Cryptomator.desktop
|
||||
ln -s org.cryptomator.Cryptomator.metainfo.xml Cryptomator.AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml
|
||||
ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun
|
||||
- name: Download AppImageKit
|
||||
run: |
|
||||
curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-${{ matrix.appimage-suffix }}.AppImage -o appimagetool.AppImage
|
||||
curl -L https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${{ matrix.appimage-suffix }}.AppImage -o appimagetool.AppImage
|
||||
chmod +x appimagetool.AppImage
|
||||
./appimagetool.AppImage --appimage-extract
|
||||
- name: Prepare GPG-Agent for signing with key 615D449FE6E6A235
|
||||
@@ -152,7 +153,7 @@ jobs:
|
||||
run: >
|
||||
./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ needs.get-version.outputs.semVerStr }}-${{ matrix.appimage-suffix }}.AppImage
|
||||
-u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-${{ matrix.appimage-suffix }}.AppImage.zsync'
|
||||
--sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback"
|
||||
--sign --sign-key=615D449FE6E6A235
|
||||
- name: Create detached GPG signatures
|
||||
run: |
|
||||
gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a cryptomator-*.AppImage
|
||||
@@ -175,4 +176,4 @@ jobs:
|
||||
files: |
|
||||
cryptomator-*.AppImage
|
||||
cryptomator-*.zsync
|
||||
cryptomator-*.asc
|
||||
cryptomator-*.asc
|
||||
|
||||
66
.github/workflows/av-whitelist.yml
vendored
66
.github/workflows/av-whitelist.yml
vendored
@@ -13,15 +13,48 @@ on:
|
||||
description: "Url to the file to upload"
|
||||
required: true
|
||||
type: string
|
||||
avast:
|
||||
description: "Upload to Avast"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
kaspersky:
|
||||
description: "Upload to Kaspersky"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
allowlist:
|
||||
name: Anti Virus Allowlisting
|
||||
download-file:
|
||||
name: Downloads the file into the VM
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
fileName: ${{ steps.extractName.outputs.fileName}}
|
||||
steps:
|
||||
- name: Download file
|
||||
- name: Extract file name
|
||||
id: extractName
|
||||
run: |
|
||||
curl --remote-name ${{ inputs.url }} -L
|
||||
url="${{ inputs.url }}"
|
||||
echo "fileName=${url##*/}" >> $GITHUB_OUTPUT
|
||||
- name: Download file
|
||||
run: curl --remote-name ${{ inputs.url }} -L -o ${{steps.extractName.outputs.fileName}}
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.extractName.outputs.fileName }}
|
||||
path: ${{ steps.extractName.outputs.fileName }}
|
||||
if-no-files-found: error
|
||||
allowlist-kaspersky:
|
||||
name: Anti Virus Allowlisting Kaspersky
|
||||
runs-on: ubuntu-latest
|
||||
needs: download-file
|
||||
if: github.event_name == 'workflow_call' || inputs.kaspersky
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ needs.download-file.outputs.fileName }}
|
||||
path: upload
|
||||
- name: Upload to Kaspersky
|
||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
||||
with:
|
||||
@@ -30,11 +63,26 @@ jobs:
|
||||
port: 990
|
||||
username: ${{ secrets.ALLOWLIST_KASPERSKY_USERNAME }}
|
||||
password: ${{ secrets.ALLOWLIST_KASPERSKY_PASSWORD }}
|
||||
- name: Upload to Avast
|
||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
||||
local-dir: ./upload/
|
||||
allowlist-avast:
|
||||
name: Anti Virus Allowlisting Avast
|
||||
runs-on: ubuntu-latest
|
||||
needs: download-file
|
||||
if: github.event_name == 'workflow_call' || inputs.avast
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ needs.download-file.outputs.fileName }}
|
||||
path: upload
|
||||
- name: Upload to Avast
|
||||
uses: wlixcc/SFTP-Deploy-Action@v1.2.5
|
||||
with:
|
||||
protocol: ftp
|
||||
server: whitelisting.avast.com
|
||||
port: 21
|
||||
port: 22
|
||||
username: ${{ secrets.ALLOWLIST_AVAST_USERNAME }}
|
||||
password: ${{ secrets.ALLOWLIST_AVAST_PASSWORD }}
|
||||
password: ${{ secrets.ALLOWLIST_AVAST_PASSWORD }}
|
||||
ssh_private_key: ''
|
||||
sftp_only: true
|
||||
local_path: './upload/*'
|
||||
remote_path: '/data'
|
||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
types: [labeled]
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_VERSION: 23
|
||||
|
||||
defaults:
|
||||
|
||||
2
.github/workflows/check-jdk-updates.yml
vendored
2
.github/workflows/check-jdk-updates.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
env:
|
||||
JDK_VERSION: '23.0.1+11'
|
||||
JDK_VENDOR: zulu
|
||||
JDK_VENDOR: temurin
|
||||
RUNTIME_VERSION_HELPER: >
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
|
||||
16
.github/workflows/debian.yml
vendored
16
.github/workflows/debian.yml
vendored
@@ -16,19 +16,19 @@ on:
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_VERSION: '23.0.1+11'
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_VERSION: '23.0.2+7'
|
||||
COFFEELIBS_JDK: 23
|
||||
COFFEELIBS_JDK_VERSION: '23.0.1+11-0ppa1'
|
||||
OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/22.0.2/openjfx-22.0.2_linux-x64_bin-jmods.zip'
|
||||
OPENJFX_JMODS_AMD64_HASH: 'd44bff3b94d5668fdee18a938d7b1269026d663d44765f02d29a9bdfd3fa1eb0'
|
||||
OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/22.0.2/openjfx-22.0.2_linux-aarch64_bin-jmods.zip'
|
||||
OPENJFX_JMODS_AARCH64_HASH: '3d5457136690c4f5bb9522d38b45218e045bdac13c24aa4c808c7c8d17d039c7'
|
||||
COFFEELIBS_JDK_VERSION: '23.0.2+7-0ppa1'
|
||||
OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/23.0.2/openjfx-23.0.2_linux-x64_bin-jmods.zip'
|
||||
OPENJFX_JMODS_AMD64_HASH: '063baebc6922e4a89c94b9dfb7a4f53e59e8d6fec400d4e670b31bc2ab324dec'
|
||||
OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/23.0.2/openjfx-23.0.2_linux-aarch64_bin-jmods.zip'
|
||||
OPENJFX_JMODS_AARCH64_HASH: '9bbedaeae1590b69e2b22237bda310936df33e344dbc243bea2e86acaab3a0d8'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Debian Package
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- id: versions
|
||||
|
||||
2
.github/workflows/get-version.yml
vendored
2
.github/workflows/get-version.yml
vendored
@@ -22,7 +22,7 @@ on:
|
||||
value: ${{ jobs.determine-version.outputs.type }}
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_VERSION: 23
|
||||
|
||||
jobs:
|
||||
|
||||
10
.github/workflows/mac-dmg-x64.yml
vendored
10
.github/workflows/mac-dmg-x64.yml
vendored
@@ -14,8 +14,8 @@ on:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_VERSION: '23.0.1+11'
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_VERSION: '23.0.2+7'
|
||||
|
||||
jobs:
|
||||
get-version:
|
||||
@@ -35,8 +35,8 @@ jobs:
|
||||
architecture: x64
|
||||
output-suffix: x64
|
||||
fuse-lib: macFUSE
|
||||
openjfx-url: 'https://download2.gluonhq.com/openjfx/22.0.2/openjfx-22.0.2_osx-x64_bin-jmods.zip'
|
||||
openjfx-sha: '115cb08bb59d880cfff6e51e0bf0dcc45785ed9d456b8b8425597b04da6ab3d4'
|
||||
openjfx-url: 'https://download2.gluonhq.com/openjfx/23.0.2/openjfx-23.0.2_osx-x64_bin-jmods.zip'
|
||||
openjfx-sha: '5e6c65c065eea22430c0eab36f37a5985eb8ad99e19e8772262021740d338f68'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
--dest appdir
|
||||
--name Cryptomator
|
||||
--vendor "Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2024 Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2025 Skymatic GmbH"
|
||||
--app-version "${{ needs.get-version.outputs.semVerNum }}"
|
||||
--java-options "--enable-preview"
|
||||
--java-options "--enable-native-access=org.cryptomator.jfuse.mac"
|
||||
|
||||
10
.github/workflows/mac-dmg.yml
vendored
10
.github/workflows/mac-dmg.yml
vendored
@@ -15,8 +15,8 @@ on:
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_VERSION: '23.0.1+11'
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_VERSION: '23.0.2+7'
|
||||
|
||||
jobs:
|
||||
get-version:
|
||||
@@ -36,8 +36,8 @@ jobs:
|
||||
architecture: aarch64
|
||||
output-suffix: arm64
|
||||
fuse-lib: FUSE-T
|
||||
openjfx-url: 'https://download2.gluonhq.com/openjfx/22.0.2/openjfx-22.0.2_osx-aarch64_bin-jmods.zip'
|
||||
openjfx-sha: '813c6748f7c99cb7a579d48b48a087b4682b1fad1fc1a4fe5f9b21cf872b15a7'
|
||||
openjfx-url: 'https://download2.gluonhq.com/openjfx/23.0.2/openjfx-23.0.2_osx-aarch64_bin-jmods.zip'
|
||||
openjfx-sha: 'c690cc642a3924cf56622951f478ba57aec9ce09063761f800c3319331bed3fc'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
--dest appdir
|
||||
--name Cryptomator
|
||||
--vendor "Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2024 Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2025 Skymatic GmbH"
|
||||
--app-version "${{ needs.get-version.outputs.semVerNum }}"
|
||||
--java-options "--enable-preview"
|
||||
--java-options "--enable-native-access=org.cryptomator.jfuse.mac"
|
||||
|
||||
2
.github/workflows/pullrequest.yml
vendored
2
.github/workflows/pullrequest.yml
vendored
@@ -4,7 +4,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_VERSION: 23
|
||||
|
||||
defaults:
|
||||
|
||||
2
.github/workflows/release-check.yml
vendored
2
.github/workflows/release-check.yml
vendored
@@ -11,7 +11,7 @@ defaults:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_VERSION: 23
|
||||
|
||||
jobs:
|
||||
|
||||
19
.github/workflows/win-exe.yml
vendored
19
.github/workflows/win-exe.yml
vendored
@@ -16,9 +16,9 @@ on:
|
||||
|
||||
env:
|
||||
JAVA_DIST: 'zulu'
|
||||
JAVA_VERSION: '23.0.1+11'
|
||||
OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/22.0.2/openjfx-22.0.2_windows-x64_bin-jmods.zip'
|
||||
OPENJFX_JMODS_AMD64_HASH: 'f9376d200f5c5b85327d575c1ec1482e6455f19916577f7e2fc9be2f48bb29b6'
|
||||
JAVA_VERSION: '23.0.2+7'
|
||||
OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/23.0.1/openjfx-23.0.1_windows-x64_bin-jmods.zip'
|
||||
OPENJFX_JMODS_AMD64_HASH: 'ee176dcee3bd78bde7910735bd67f67c792882f5b89626796ae06f7a1c0119d3'
|
||||
WINFSP_MSI: 'https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi'
|
||||
WINFSP_UNINSTALLER: 'https://github.com/cryptomator/winfsp-uninstaller/releases/latest/download/winfsp-uninstaller.exe'
|
||||
|
||||
@@ -40,9 +40,6 @@ jobs:
|
||||
LOOPBACK_ALIAS: 'cryptomator-vault'
|
||||
WIN_CONSOLE_FLAG: ''
|
||||
steps:
|
||||
- name: Upgrade WIX to latest version
|
||||
run: choco install wixtoolset --version 3.14.1
|
||||
shell: pwsh
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
@@ -89,7 +86,7 @@ jobs:
|
||||
--verbose
|
||||
--output runtime
|
||||
--module-path "jfxjmods;${JAVA_HOME}/jmods"
|
||||
--add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.unsupported,jdk.accessibility,jdk.management.jfr,java.compiler
|
||||
--add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.crypto.mscapi,jdk.unsupported,jdk.accessibility,jdk.management.jfr,java.compiler
|
||||
--strip-native-commands
|
||||
--no-header-files
|
||||
--no-man-pages
|
||||
@@ -110,7 +107,7 @@ jobs:
|
||||
--dest appdir
|
||||
--name Cryptomator
|
||||
--vendor "Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2024 Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2025 Skymatic GmbH"
|
||||
--app-version "${{ needs.get-version.outputs.semVerNum }}.${{ needs.get-version.outputs.revNum }}"
|
||||
--java-options "--enable-preview"
|
||||
--java-options "--enable-native-access=org.cryptomator.jfuse.win,org.cryptomator.integrations.win"
|
||||
@@ -218,7 +215,7 @@ jobs:
|
||||
--dest installer
|
||||
--name Cryptomator
|
||||
--vendor "Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2024 Skymatic GmbH"
|
||||
--copyright "(C) 2016 - 2025 Skymatic GmbH"
|
||||
--app-version "${{ needs.get-version.outputs.semVerNum }}.${{ needs.get-version.outputs.revNum}}"
|
||||
--win-menu
|
||||
--win-dir-chooser
|
||||
@@ -304,7 +301,7 @@ jobs:
|
||||
-out dist/win/bundle/
|
||||
-dBundleVersion="${{ needs.get-version.outputs.semVerNum }}.${{ needs.get-version.outputs.revNum }}"
|
||||
-dBundleVendor="Skymatic GmbH"
|
||||
-dBundleCopyright="(C) 2016 - 2024 Skymatic GmbH"
|
||||
-dBundleCopyright="(C) 2016 - 2025 Skymatic GmbH"
|
||||
-dAboutUrl="https://cryptomator.org"
|
||||
-dHelpUrl="https://cryptomator.org/contact"
|
||||
-dUpdateUrl="https://cryptomator.org/downloads/"
|
||||
@@ -394,7 +391,7 @@ jobs:
|
||||
|
||||
allowlist-exe:
|
||||
uses: ./.github/workflows/av-whitelist.yml
|
||||
needs: [publish]
|
||||
needs: [publish, allowlist-msi]
|
||||
with:
|
||||
url: ${{ needs.publish.outputs.download-url-exe }}
|
||||
secrets: inherit
|
||||
|
||||
17
.idea/compiler.xml
generated
17
.idea/compiler.xml
generated
@@ -14,17 +14,16 @@
|
||||
<option name="dagger.fastInit" value="enabled" />
|
||||
<option name="dagger.formatGeneratedSource" value="enabled" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/dagger/dagger-compiler/2.52/dagger-compiler-2.52.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/dagger/dagger/2.52/dagger-2.52.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/dagger/dagger-compiler/2.55/dagger-compiler-2.55.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/dagger/dagger/2.55/dagger-2.55.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/jakarta/inject/jakarta.inject-api/2.0.1/jakarta.inject-api-2.0.1.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/javax/inject/javax.inject/1/javax.inject-1.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/dagger/dagger-spi/2.52/dagger-spi-2.52.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/dagger/dagger-spi/2.55/dagger-spi-2.55.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/devtools/ksp/symbol-processing-api/1.9.24-1.0.20/symbol-processing-api-1.9.24-1.0.20.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.9.0/kotlin-stdlib-jdk8-1.9.0.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/1.9.24/kotlin-stdlib-1.9.24.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/devtools/ksp/symbol-processing-api/2.0.21-1.0.28/symbol-processing-api-2.0.21-1.0.28.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/2.0.21/kotlin-stdlib-2.0.21.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/annotations/13.0/annotations-13.0.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.9.0/kotlin-stdlib-jdk7-1.9.0.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/guava/failureaccess/1.0.2/failureaccess-1.0.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/guava/guava/33.0.0-jre/guava-33.0.0-jre.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" />
|
||||
@@ -35,6 +34,8 @@
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/googlejavaformat/google-java-format/1.5/google-java-format-1.5.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/google/errorprone/javac-shaded/9-dev-r4023-3/javac-shaded-9-dev-r4023-3.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/com/squareup/kotlinpoet/1.11.0/kotlinpoet-1.11.0.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.6.10/kotlin-stdlib-jdk8-1.6.10.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.6.10/kotlin-stdlib-jdk7-1.6.10.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-reflect/1.6.10/kotlin-reflect-1.6.10.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/net/ltgt/gradle/incap/incap/0.2/incap-0.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar" />
|
||||
@@ -45,7 +46,7 @@
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="cryptomator" options="-Adagger.fastInit=enabled -Adagger.formatGeneratedSource=enabled --enable-preview" />
|
||||
<module name="cryptomator" options="-Adagger.fastInit=enabled -Adagger.formatGeneratedSource=enabled" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
14
README.md
14
README.md
@@ -1,9 +1,9 @@
|
||||
[](https://cryptomator.org/)
|
||||
|
||||
[](https://github.com/cryptomator/cryptomator/actions?query=workflow%3ABuild)
|
||||
[](https://github.com/cryptomator/cryptomator/actions/workflows/build.yml?query=branch%3Adevelop)
|
||||
[](https://snyk.io/test/github/cryptomator/cryptomator)
|
||||
[](https://sonarcloud.io/dashboard?id=cryptomator_cryptomator)
|
||||
[](http://twitter.com/Cryptomator)
|
||||
[](https://mastodon.online/@cryptomator)
|
||||
[](https://translate.cryptomator.org/)
|
||||
[](https://github.com/cryptomator/cryptomator/releases/latest)
|
||||
[](https://community.cryptomator.org)
|
||||
@@ -32,9 +32,9 @@ Become our Gold Sponsor and showcase your brand to a targeted audience! Please c
|
||||
|
||||
### Special Shoutout
|
||||
|
||||
Continuous integration hosting for ARM64 builds is provided by [MacStadium](https://www.macstadium.com/opensource).
|
||||
Continuous integration hosting for ARM64 builds is provided by [MacStadium](https://www.macstadium.com/company/opensource).
|
||||
|
||||
<a href="https://www.macstadium.com/opensource"><img src="https://uploads-ssl.webflow.com/5ac3c046c82724970fc60918/5c019d917bba312af7553b49_MacStadium-developerlogo.png" alt="MacStadium" height="100"></a>
|
||||
<a href="https://www.macstadium.com/company/opensource"><img src="https://uploads-ssl.webflow.com/5ac3c046c82724970fc60918/5c019d917bba312af7553b49_MacStadium-developerlogo.png" alt="MacStadium" height="100"></a>
|
||||
|
||||
---
|
||||
|
||||
@@ -54,7 +54,7 @@ Download native binaries of Cryptomator on [cryptomator.org](https://cryptomator
|
||||
- File names get encrypted
|
||||
- Folder structure gets obfuscated
|
||||
- Use as many vaults in your Dropbox as you want, each having individual passwords
|
||||
- Four thousand commits for the security of your data!! :tada:
|
||||
- More than Five thousand commits for the security of your data!! :tada:
|
||||
|
||||
### Privacy
|
||||
|
||||
@@ -72,13 +72,13 @@ Download native binaries of Cryptomator on [cryptomator.org](https://cryptomator
|
||||
|
||||
### Security Architecture
|
||||
|
||||
For more information on the security details visit [cryptomator.org](https://docs.cryptomator.org/en/latest/security/architecture/).
|
||||
For more information on the security details visit [cryptomator.org](https://docs.cryptomator.org/security/architecture/).
|
||||
|
||||
## Building
|
||||
|
||||
### Dependencies
|
||||
|
||||
* JDK 22 (e.g. temurin, zulu)
|
||||
* JDK 23 (e.g. temurin, zulu)
|
||||
* Maven 3
|
||||
|
||||
### Run Maven
|
||||
|
||||
15
dist/linux/appimage/build.sh
vendored
15
dist/linux/appimage/build.sh
vendored
@@ -23,12 +23,12 @@ mvn -B -f ../../../pom.xml clean package -Plinux -DskipTests -Djavafx.platform=l
|
||||
cp ../../../LICENSE.txt ../../../target
|
||||
cp ../../../target/cryptomator-*.jar ../../../target/mods
|
||||
|
||||
JAVAFX_VERSION=22.0.2
|
||||
JAVAFX_VERSION=23.0.2
|
||||
JAVAFX_ARCH="x64"
|
||||
JAVAFX_JMODS_SHA256='d44bff3b94d5668fdee18a938d7b1269026d663d44765f02d29a9bdfd3fa1eb0'
|
||||
JAVAFX_JMODS_SHA256='063baebc6922e4a89c94b9dfb7a4f53e59e8d6fec400d4e670b31bc2ab324dec'
|
||||
if [ "${CPU_ARCH}" = "aarch64" ]; then
|
||||
JAVAFX_ARCH="aarch64"
|
||||
JAVAFX_JMODS_SHA256='3d5457136690c4f5bb9522d38b45218e045bdac13c24aa4c808c7c8d17d039c7'
|
||||
JAVAFX_JMODS_SHA256='9bbedaeae1590b69e2b22237bda310936df33e344dbc243bea2e86acaab3a0d8'
|
||||
fi
|
||||
|
||||
# download javaFX jmods
|
||||
@@ -76,7 +76,7 @@ ${JAVA_HOME}/bin/jpackage \
|
||||
--vendor "Skymatic GmbH" \
|
||||
--java-options "--enable-preview" \
|
||||
--java-options "--enable-native-access=org.cryptomator.jfuse.linux.amd64,org.cryptomator.jfuse.linux.aarch64,org.purejava.appindicator" \
|
||||
--copyright "(C) 2016 - 2024 Skymatic GmbH" \
|
||||
--copyright "(C) 2016 - 2025 Skymatic GmbH" \
|
||||
--java-options "-Xss5m" \
|
||||
--java-options "-Xmx256m" \
|
||||
--app-version "${VERSION}.${REVISION_NO}" \
|
||||
@@ -91,6 +91,7 @@ ${JAVA_HOME}/bin/jpackage \
|
||||
--java-options "-Dcryptomator.showTrayIcon=true" \
|
||||
--java-options "-Dcryptomator.integrationsLinux.trayIconsDir=\"@{appdir}/usr/share/icons/hicolor/symbolic/apps\"" \
|
||||
--java-options "-Dcryptomator.buildNumber=\"appimage-${REVISION_NO}\"" \
|
||||
--java-options "-Dcryptomator.networking.truststore.p12Path=\"/etc/cryptomator/certs.p12\"" \
|
||||
--resource-dir ../resources
|
||||
|
||||
# transform AppDir
|
||||
@@ -108,13 +109,13 @@ cp ../common/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/usr/share/ap
|
||||
cp ../common/org.cryptomator.Cryptomator.metainfo.xml Cryptomator.AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.metainfo.xml
|
||||
cp ../common/application-vnd.cryptomator.vault.xml Cryptomator.AppDir/usr/share/mime/packages/application-vnd.cryptomator.vault.xml
|
||||
ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg
|
||||
ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg
|
||||
ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/.DirIcon
|
||||
ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop
|
||||
ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/org.cryptomator.Cryptomator.desktop
|
||||
ln -s org.cryptomator.Cryptomator.metainfo.xml Cryptomator.AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml
|
||||
ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun
|
||||
|
||||
# load AppImageTool
|
||||
curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-${CPU_ARCH}.AppImage -o /tmp/appimagetool.AppImage
|
||||
curl -L https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${CPU_ARCH}.AppImage -o /tmp/appimagetool.AppImage
|
||||
chmod +x /tmp/appimagetool.AppImage
|
||||
|
||||
# create AppImage
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright 2018 Armin Schrenk <armin.schrenk@zoho.eu> -->
|
||||
<component type="desktop-application">
|
||||
<id>org.cryptomator.Cryptomator</id>
|
||||
<metadata_license>FSFAP</metadata_license>
|
||||
<project_license>GPL-3.0-or-later</project_license>
|
||||
<name>Cryptomator</name>
|
||||
<summary>Encryption made easy and optimized for the cloud</summary>
|
||||
<summary>Encryption for your cloud made easy</summary>
|
||||
|
||||
<keywords>
|
||||
<keyword>encryption</keyword>
|
||||
<keyword>security</keyword>
|
||||
<keyword>privacy</keyword>
|
||||
</keywords>
|
||||
|
||||
<description>
|
||||
<p>
|
||||
@@ -44,12 +49,16 @@
|
||||
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<caption>Light theme</caption>
|
||||
<image>https://user-images.githubusercontent.com/11858409/156986109-6e58f59c-8b8c-4501-b33b-bb1e33007cea.png</image>
|
||||
<caption>Encrypts your data, protects your privacy</caption>
|
||||
<image>https://static.cryptomator.org/desktop/flathubScreenshots/MainWindowUnlockDialog_light.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<caption>Dark theme</caption>
|
||||
<image>https://user-images.githubusercontent.com/11858409/156986113-6c5d7801-86e0-4643-bc2f-aff9d95d3ce0.png</image>
|
||||
<caption>Dark theme available</caption>
|
||||
<image>https://static.cryptomator.org/desktop/flathubScreenshots/MainWindowUnlocked_dark.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<caption>Easy to use - work on encrypted files as if they were not</caption>
|
||||
<image>https://static.cryptomator.org/desktop/flathubScreenshots/MainWindowUnlocked_light.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
|
||||
@@ -74,6 +83,21 @@
|
||||
</content_rating>
|
||||
|
||||
<releases>
|
||||
<release date="2025-04-29" version="1.16.0">
|
||||
<url type="details">https://github.com/cryptomator/cryptomator/releases/1.16.0</url>
|
||||
</release>
|
||||
<release date="2025-04-09" version="1.15.3">
|
||||
<url type="details">https://github.com/cryptomator/cryptomator/releases/1.15.3</url>
|
||||
</release>
|
||||
<release date="2025-04-04" version="1.15.2">
|
||||
<url type="details">https://github.com/cryptomator/cryptomator/releases/1.15.2</url>
|
||||
</release>
|
||||
<release date="2025-02-05" version="1.15.1">
|
||||
<url type="details">https://github.com/cryptomator/cryptomator/releases/1.15.1</url>
|
||||
</release>
|
||||
<release date="2025-02-03" version="1.15.0">
|
||||
<url type="details">https://github.com/cryptomator/cryptomator/releases/1.15.0</url>
|
||||
</release>
|
||||
<release date="2024-11-19" version="1.14.2">
|
||||
<url type="details">https://github.com/cryptomator/cryptomator/releases/1.14.2</url>
|
||||
</release>
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<svg height="16" viewBox="0 0 42 42" width="16" xmlns="http://www.w3.org/2000/svg">
|
||||
<style
|
||||
id="current-color-scheme" type="text/css">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
<g fill-rule="evenodd" style="fill:#f2f2f2;fill-opacity:1" class="ColorScheme-Text" fill="currentColor">
|
||||
<path d="m15.591 35.824c-.019.009-.936.775-1.458 1.208a.418.418 0 0 1 -.627-.111 9.322 9.322 0 0 1 -.3-5.974 15.843 15.843 0 0 0 2.894 2.043c.051 1.03-.161 2.644-.509 2.834zm6.409-6.824h-2l.5-5a2 2 0 1 1 1 0zm-14.544-3.241.744-1.366a1.579 1.579 0 0 0 -.019-1.557l.653-1.2c.2.014-.03-.113.165-.14.051-.217-.051-.336 0-.5a3.269 3.269 0 0 0 0-1.5 7.151 7.151 0 0 1 0-3 2.366 2.366 0 0 0 -2.378 1.448 2.409 2.409 0 0 0 .229 2.661l-.7 1.278a1.779 1.779 0 0 0 -1.317.891l-.741 1.372a1.577 1.577 0 0 0 -.019 1.487 3.028 3.028 0 0 0 -2.746 1.525 2.648 2.648 0 0 0 .044 2.631.748.748 0 0 0 .981.266.656.656 0 0 0 .284-.92 1.37 1.37 0 0 1 -.023-1.361 1.6 1.6 0 0 1 2.079-.63 1.408 1.408 0 0 1 .672 1.95 1.546 1.546 0 0 1 -1.2.78.688.688 0 0 0 -.636.749.707.707 0 0 0 .717.6.789.789 0 0 0 .082 0 2.989 2.989 0 0 0 2.322-1.513 2.669 2.669 0 0 0 -.377-3.084 1.767 1.767 0 0 0 1.184-.867zm13.544-10.759a13.013 13.013 0 0 1 5-1 21.6 21.6 0 0 1 4.5.5 9.312 9.312 0 0 0 -9.5-8.5c-5.794 0-9.176 4-9.5 8.5a21.858 21.858 0 0 1 4.5-.5 12.819 12.819 0 0 1 5 1zm3.5-5c1.209 0 2.5.866 2.5 2h-5c0-1.134 1.291-2 2.5-2zm-7 0c1.209 0 2.5.866 2.5 2h-5c0-1.134 1.291-2 2.5-2zm14.473 6a8.067 8.067 0 0 0 -8.08 8v2.141a3.891 3.891 0 0 0 -2.893 3.734v5.125a23.166 23.166 0 0 1 -4.174-1.623 7.857 7.857 0 0 1 -.027.878 3.263 3.263 0 0 1 -.729 2.074l-1.794 1.483a.379.379 0 0 1 -.276.188h-4c-1.324 0-2.346-1.336-2.653-3.343a7.058 7.058 0 0 1 .234-3.18 3.477 3.477 0 0 1 1.636-2.157 1.868 1.868 0 0 1 .783-.32h1.5a8.035 8.035 0 0 1 -1.5-5 11.1 11.1 0 0 1 .5-3 2.519 2.519 0 0 0 0-1.5 13.272 13.272 0 0 1 -.5-3.5c6.687-1.936 11 0 11 0s4.319-1.955 11 0"/>
|
||||
<path d="m39 28h-10v-4a3.13 3.13 0 0 1 3-3 3.087 3.087 0 0 1 3 3v1a1.034 1.034 0 0 0 1 1h1a1.034 1.034 0 0 0 1-1v-1a6 6 0 0 0 -12 0v4h-1a2.073 2.073 0 0 0 -2 2v6a2.073 2.073 0 0 0 2 2h14a2.073 2.073 0 0 0 2-2v-6a2.073 2.073 0 0 0 -2-2zm-5.391 5.94a1.609 1.609 0 0 1 -3.217 0v-1.876a1.609 1.609 0 0 1 3.217 0z"/>
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">
|
||||
.ColorScheme-Text {
|
||||
color:#222222;
|
||||
}
|
||||
.ColorScheme-Highlight {
|
||||
color:#49B04A;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g fill-rule="evenodd">
|
||||
<path d="m15.591 35.824c-.019.009-.936.775-1.458 1.208a.418.418 0 0 1 -.627-.111 9.322 9.322 0 0 1 -.3-5.974 15.843 15.843 0 0 0 2.894 2.043c.051 1.03-.161 2.644-.509 2.834zm6.409-6.824h-2l.5-5a2 2 0 1 1 1 0zm-14.544-3.241.744-1.366a1.579 1.579 0 0 0 -.019-1.557l.653-1.2c.2.014-.03-.113.165-.14.051-.217-.051-.336 0-.5a3.269 3.269 0 0 0 0-1.5 7.151 7.151 0 0 1 0-3 2.366 2.366 0 0 0 -2.378 1.448 2.409 2.409 0 0 0 .229 2.661l-.7 1.278a1.779 1.779 0 0 0 -1.317.891l-.741 1.372a1.577 1.577 0 0 0 -.019 1.487 3.028 3.028 0 0 0 -2.746 1.525 2.648 2.648 0 0 0 .044 2.631.748.748 0 0 0 .981.266.656.656 0 0 0 .284-.92 1.37 1.37 0 0 1 -.023-1.361 1.6 1.6 0 0 1 2.079-.63 1.408 1.408 0 0 1 .672 1.95 1.546 1.546 0 0 1 -1.2.78.688.688 0 0 0 -.636.749.707.707 0 0 0 .717.6.789.789 0 0 0 .082 0 2.989 2.989 0 0 0 2.322-1.513 2.669 2.669 0 0 0 -.377-3.084 1.767 1.767 0 0 0 1.184-.867zm13.544-10.759a13.013 13.013 0 0 1 5-1 21.6 21.6 0 0 1 4.5.5 9.312 9.312 0 0 0 -9.5-8.5c-5.794 0-9.176 4-9.5 8.5a21.858 21.858 0 0 1 4.5-.5 12.819 12.819 0 0 1 5 1zm3.5-5c1.209 0 2.5.866 2.5 2h-5c0-1.134 1.291-2 2.5-2zm-7 0c1.209 0 2.5.866 2.5 2h-5c0-1.134 1.291-2 2.5-2zm14.473 6a8.067 8.067 0 0 0 -8.08 8v2.141a3.891 3.891 0 0 0 -2.893 3.734v5.125a23.166 23.166 0 0 1 -4.174-1.623 7.857 7.857 0 0 1 -.027.878 3.263 3.263 0 0 1 -.729 2.074l-1.794 1.483a.379.379 0 0 1 -.276.188h-4c-1.324 0-2.346-1.336-2.653-3.343a7.058 7.058 0 0 1 .234-3.18 3.477 3.477 0 0 1 1.636-2.157 1.868 1.868 0 0 1 .783-.32h1.5a8.035 8.035 0 0 1 -1.5-5 11.1 11.1 0 0 1 .5-3 2.519 2.519 0 0 0 0-1.5 13.272 13.272 0 0 1 -.5-3.5c6.687-1.936 11 0 11 0s4.319-1.955 11 0" class="ColorScheme-Text" fill="currentColor"/>
|
||||
<path d="m39 28h-10v-4a3.13 3.13 0 0 1 3-3 3.087 3.087 0 0 1 3 3v1a1.034 1.034 0 0 0 1 1h1a1.034 1.034 0 0 0 1-1v-1a6 6 0 0 0 -12 0v4h-1a2.073 2.073 0 0 0 -2 2v6a2.073 2.073 0 0 0 2 2h14a2.073 2.073 0 0 0 2-2v-6a2.073 2.073 0 0 0 -2-2zm-5.391 5.94a1.609 1.609 0 0 1 -3.217 0v-1.876a1.609 1.609 0 0 1 3.217 0z" class="ColorScheme-Highlight" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,8 +1,10 @@
|
||||
<svg height="16" viewBox="0 0 42 42" width="16" xmlns="http://www.w3.org/2000/svg">
|
||||
<style id="current-color-scheme" type="text/css">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
<path d="m32.66 29.319a1.432 1.432 0 0 0 -.66-.319h-1.5a8.125 8.125 0 0 0 1.5-5 11.027 11.027 0 0 0 -.5-3 2.519 2.519 0 0 1 0-1.5 12.987 12.987 0 0 0 .5-3.5c-6.681-1.955-11 0-11 0s-4.313-1.936-11 0a13.272 13.272 0 0 0 .5 3.5 2.519 2.519 0 0 1 0 1.5 11.1 11.1 0 0 0 -.5 3 8.035 8.035 0 0 0 1.5 5h-1.5a1.868 1.868 0 0 0 -.783.319 3.477 3.477 0 0 0 -1.636 2.157 7.058 7.058 0 0 0 -.234 3.18c.307 2.008 1.329 3.344 2.653 3.344h4a.379.379 0 0 0 .277-.187l1.793-1.483a3.263 3.263 0 0 0 .729-2.074 7.857 7.857 0 0 0 .027-.878 23.166 23.166 0 0 0 4.174 1.622 24.4 24.4 0 0 0 4.051-1.614 7.848 7.848 0 0 0 .027.869 3.263 3.263 0 0 0 .729 2.074l1.793 1.484a.61.61 0 0 0 .4.187h4c1.324 0 2.223-1.336 2.529-3.343a7.057 7.057 0 0 0 -.234-3.18 3.477 3.477 0 0 0 -1.635-2.158zm-17.069 6.5c-.019.009-.936.775-1.458 1.208a.418.418 0 0 1 -.627-.111 9.322 9.322 0 0 1 -.3-5.974 15.843 15.843 0 0 0 2.894 2.048c.051 1.03-.161 2.644-.509 2.834zm6.409-6.819h-2l.5-5a2 2 0 1 1 1 0zm6.38 7.921a.418.418 0 0 1 -.627.111c-.522-.433-1.439-1.2-1.458-1.208-.348-.189-.56-1.8-.505-2.828a15.84 15.84 0 0 0 2.9-2.037 9.322 9.322 0 0 1 -.31 5.962zm-20.924-11.162.744-1.366a1.579 1.579 0 0 0 -.019-1.557l.653-1.2c.2.014-.03-.113.165-.14.051-.217-.051-.336 0-.5a3.269 3.269 0 0 0 0-1.5 7.151 7.151 0 0 1 0-3 2.366 2.366 0 0 0 -2.378 1.448 2.409 2.409 0 0 0 .229 2.661l-.7 1.278a1.779 1.779 0 0 0 -1.317.891l-.741 1.372a1.577 1.577 0 0 0 -.019 1.487 3.028 3.028 0 0 0 -2.746 1.525 2.648 2.648 0 0 0 .044 2.631.748.748 0 0 0 .981.266.656.656 0 0 0 .284-.92 1.37 1.37 0 0 1 -.023-1.361 1.6 1.6 0 0 1 2.079-.63 1.408 1.408 0 0 1 .672 1.95 1.546 1.546 0 0 1 -1.2.78.688.688 0 0 0 -.636.749.707.707 0 0 0 .717.6.789.789 0 0 0 .082 0 2.989 2.989 0 0 0 2.322-1.513 2.669 2.669 0 0 0 -.377-3.084 1.767 1.767 0 0 0 1.184-.867zm33.217 1.2a3.021 3.021 0 0 0 -2.658-1.525 1.574 1.574 0 0 0 -.107-1.283l-.745-1.367a1.779 1.779 0 0 0 -1.317-.891l-.7-1.278a2.409 2.409 0 0 0 .229-2.661 2.283 2.283 0 0 0 -2.375-1.454 7.039 7.039 0 0 1 0 3 3.272 3.272 0 0 0 0 1.5c.047.152-.047.3 0 .5.227.04-.069.156.165.14l.653 1.2a1.579 1.579 0 0 0 -.019 1.557l.745 1.367a1.753 1.753 0 0 0 1.045.832 2.66 2.66 0 0 0 -.238 2.916 2.989 2.989 0 0 0 2.326 1.509.79.79 0 0 0 .082 0 .707.707 0 0 0 .717-.6.688.688 0 0 0 -.636-.749 1.546 1.546 0 0 1 -1.2-.78 1.408 1.408 0 0 1 .672-1.95 1.628 1.628 0 0 1 1.179-.089 1.512 1.512 0 0 1 .9.719 1.37 1.37 0 0 1 -.023 1.361.656.656 0 0 0 .284.92.748.748 0 0 0 .981-.266 2.648 2.648 0 0 0 .04-2.633zm-19.673-11.959a13.013 13.013 0 0 1 5-1 21.6 21.6 0 0 1 4.5.5 9.312 9.312 0 0 0 -9.5-8.5c-5.794 0-9.176 4-9.5 8.5a21.858 21.858 0 0 1 4.5-.5 12.819 12.819 0 0 1 5 1zm3.5-5c1.209 0 2.5.866 2.5 2h-5c0-1.134 1.291-2 2.5-2zm-7 0c1.209 0 2.5.866 2.5 2h-5c0-1.134 1.291-2 2.5-2z" fill-rule="evenodd" style="fill:#f2f2f2;fill-opacity:1" class="ColorScheme-Text" fill="currentColor"/>
|
||||
<defs>
|
||||
<style id="current-color-scheme" type="text/css">
|
||||
.ColorScheme-Text {
|
||||
color:#222222;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path d="m32.66 29.319a1.432 1.432 0 0 0 -.66-.319h-1.5a8.125 8.125 0 0 0 1.5-5 11.027 11.027 0 0 0 -.5-3 2.519 2.519 0 0 1 0-1.5 12.987 12.987 0 0 0 .5-3.5c-6.681-1.955-11 0-11 0s-4.313-1.936-11 0a13.272 13.272 0 0 0 .5 3.5 2.519 2.519 0 0 1 0 1.5 11.1 11.1 0 0 0 -.5 3 8.035 8.035 0 0 0 1.5 5h-1.5a1.868 1.868 0 0 0 -.783.319 3.477 3.477 0 0 0 -1.636 2.157 7.058 7.058 0 0 0 -.234 3.18c.307 2.008 1.329 3.344 2.653 3.344h4a.379.379 0 0 0 .277-.187l1.793-1.483a3.263 3.263 0 0 0 .729-2.074 7.857 7.857 0 0 0 .027-.878 23.166 23.166 0 0 0 4.174 1.622 24.4 24.4 0 0 0 4.051-1.614 7.848 7.848 0 0 0 .027.869 3.263 3.263 0 0 0 .729 2.074l1.793 1.484a.61.61 0 0 0 .4.187h4c1.324 0 2.223-1.336 2.529-3.343a7.057 7.057 0 0 0 -.234-3.18 3.477 3.477 0 0 0 -1.635-2.158zm-17.069 6.5c-.019.009-.936.775-1.458 1.208a.418.418 0 0 1 -.627-.111 9.322 9.322 0 0 1 -.3-5.974 15.843 15.843 0 0 0 2.894 2.048c.051 1.03-.161 2.644-.509 2.834zm6.409-6.819h-2l.5-5a2 2 0 1 1 1 0zm6.38 7.921a.418.418 0 0 1 -.627.111c-.522-.433-1.439-1.2-1.458-1.208-.348-.189-.56-1.8-.505-2.828a15.84 15.84 0 0 0 2.9-2.037 9.322 9.322 0 0 1 -.31 5.962zm-20.924-11.162.744-1.366a1.579 1.579 0 0 0 -.019-1.557l.653-1.2c.2.014-.03-.113.165-.14.051-.217-.051-.336 0-.5a3.269 3.269 0 0 0 0-1.5 7.151 7.151 0 0 1 0-3 2.366 2.366 0 0 0 -2.378 1.448 2.409 2.409 0 0 0 .229 2.661l-.7 1.278a1.779 1.779 0 0 0 -1.317.891l-.741 1.372a1.577 1.577 0 0 0 -.019 1.487 3.028 3.028 0 0 0 -2.746 1.525 2.648 2.648 0 0 0 .044 2.631.748.748 0 0 0 .981.266.656.656 0 0 0 .284-.92 1.37 1.37 0 0 1 -.023-1.361 1.6 1.6 0 0 1 2.079-.63 1.408 1.408 0 0 1 .672 1.95 1.546 1.546 0 0 1 -1.2.78.688.688 0 0 0 -.636.749.707.707 0 0 0 .717.6.789.789 0 0 0 .082 0 2.989 2.989 0 0 0 2.322-1.513 2.669 2.669 0 0 0 -.377-3.084 1.767 1.767 0 0 0 1.184-.867zm33.217 1.2a3.021 3.021 0 0 0 -2.658-1.525 1.574 1.574 0 0 0 -.107-1.283l-.745-1.367a1.779 1.779 0 0 0 -1.317-.891l-.7-1.278a2.409 2.409 0 0 0 .229-2.661 2.283 2.283 0 0 0 -2.375-1.454 7.039 7.039 0 0 1 0 3 3.272 3.272 0 0 0 0 1.5c.047.152-.047.3 0 .5.227.04-.069.156.165.14l.653 1.2a1.579 1.579 0 0 0 -.019 1.557l.745 1.367a1.753 1.753 0 0 0 1.045.832 2.66 2.66 0 0 0 -.238 2.916 2.989 2.989 0 0 0 2.326 1.509.79.79 0 0 0 .082 0 .707.707 0 0 0 .717-.6.688.688 0 0 0 -.636-.749 1.546 1.546 0 0 1 -1.2-.78 1.408 1.408 0 0 1 .672-1.95 1.628 1.628 0 0 1 1.179-.089 1.512 1.512 0 0 1 .9.719 1.37 1.37 0 0 1 -.023 1.361.656.656 0 0 0 .284.92.748.748 0 0 0 .981-.266 2.648 2.648 0 0 0 .04-2.633zm-19.673-11.959a13.013 13.013 0 0 1 5-1 21.6 21.6 0 0 1 4.5.5 9.312 9.312 0 0 0 -9.5-8.5c-5.794 0-9.176 4-9.5 8.5a21.858 21.858 0 0 1 4.5-.5 12.819 12.819 0 0 1 5 1zm3.5-5c1.209 0 2.5.866 2.5 2h-5c0-1.134 1.291-2 2.5-2zm-7 0c1.209 0 2.5.866 2.5 2h-5c0-1.134 1.291-2 2.5-2z" fill-rule="evenodd" class="ColorScheme-Text" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
2
dist/linux/debian/control
vendored
2
dist/linux/debian/control
vendored
@@ -2,7 +2,7 @@ Source: cryptomator
|
||||
Maintainer: Cryptobot <releases@cryptomator.org>
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Build-Depends: debhelper (>=10), coffeelibs-jdk-22 (>= 22.0.1+8-0ppa1), libgtk-3-0, libxxf86vm1, libgl1
|
||||
Build-Depends: debhelper (>=10), coffeelibs-jdk-23 (>= 23.0.2+7-0ppa1), libgtk-3-0, libxxf86vm1, libgl1
|
||||
Standards-Version: 4.5.0
|
||||
Homepage: https://cryptomator.org
|
||||
Vcs-Git: https://github.com/cryptomator/cryptomator.git
|
||||
|
||||
4
dist/linux/debian/copyright
vendored
4
dist/linux/debian/copyright
vendored
@@ -4,11 +4,11 @@ Upstream-Contact: Cryptomator <info@cryptomator.org>
|
||||
Source: https://cryptomator.org
|
||||
|
||||
Files: *
|
||||
Copyright: 2016-2024 Skymatic GmbH
|
||||
Copyright: 2016-2025 Skymatic GmbH
|
||||
License: GPL-3+
|
||||
|
||||
Files: debian/org.cryptomator.Cryptomator.appdata.xml
|
||||
Copyright: 2016-2024 Skymatic GmbH
|
||||
Copyright: 2016-2025 Skymatic GmbH
|
||||
License: FSFAP
|
||||
|
||||
License: GPL-3+
|
||||
|
||||
3
dist/linux/debian/rules
vendored
3
dist/linux/debian/rules
vendored
@@ -45,7 +45,7 @@ override_dh_auto_build:
|
||||
--vendor "Skymatic GmbH" \
|
||||
--java-options "--enable-preview" \
|
||||
--java-options "--enable-native-access=org.cryptomator.jfuse.linux.amd64,org.cryptomator.jfuse.linux.aarch64,org.purejava.appindicator" \
|
||||
--copyright "(C) 2016 - 2024 Skymatic GmbH" \
|
||||
--copyright "(C) 2016 - 2025 Skymatic GmbH" \
|
||||
--java-options "-Xss5m" \
|
||||
--java-options "-Xmx256m" \
|
||||
--java-options "-Dfile.encoding=\"utf-8\"" \
|
||||
@@ -62,6 +62,7 @@ override_dh_auto_build:
|
||||
--java-options "-Dcryptomator.appVersion=\"${SEMVER_STR}\"" \
|
||||
--java-options "-Dcryptomator.disableUpdateCheck=\"${DISABLE_UPDATE_CHECK}\"" \
|
||||
--java-options "-Dcryptomator.integrationsLinux.autoStartCmd=\"cryptomator\"" \
|
||||
--java-options "-Dcryptomator.networking.truststore.p12Path=\"/etc/cryptomator/certs.p12\"" \
|
||||
--app-version "${VERSION_NUM}.${REVISION_NUM}" \
|
||||
--resource-dir resources \
|
||||
--verbose
|
||||
|
||||
8
dist/mac/dmg/build.sh
vendored
8
dist/mac/dmg/build.sh
vendored
@@ -24,7 +24,7 @@ rm -rf runtime dmg *.app *.dmg
|
||||
# set variables
|
||||
APP_NAME="Cryptomator"
|
||||
VENDOR="Skymatic GmbH"
|
||||
COPYRIGHT_YEARS="2016 - 2024"
|
||||
COPYRIGHT_YEARS="2016 - 2025"
|
||||
PACKAGE_IDENTIFIER="org.cryptomator"
|
||||
MAIN_JAR_GLOB="cryptomator-*.jar"
|
||||
MODULE_AND_MAIN_CLASS="org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator"
|
||||
@@ -32,15 +32,15 @@ REVISION_NO=`git rev-list --count HEAD`
|
||||
VERSION_NO=`mvn -f../../../pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout | sed -rn 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p'`
|
||||
FUSE_LIB="FUSE-T"
|
||||
|
||||
JAVAFX_VERSION=22.0.2
|
||||
JAVAFX_VERSION=23.0.2
|
||||
JAVAFX_ARCH="undefined"
|
||||
JAVAFX_JMODS_SHA256="undefined"
|
||||
if [ "$(machine)" = "arm64e" ]; then
|
||||
JAVAFX_ARCH="aarch64"
|
||||
JAVAFX_JMODS_SHA256="813c6748f7c99cb7a579d48b48a087b4682b1fad1fc1a4fe5f9b21cf872b15a7"
|
||||
JAVAFX_JMODS_SHA256="c690cc642a3924cf56622951f478ba57aec9ce09063761f800c3319331bed3fc"
|
||||
else
|
||||
JAVAFX_ARCH="x64"
|
||||
JAVAFX_JMODS_SHA256="115cb08bb59d880cfff6e51e0bf0dcc45785ed9d456b8b8425597b04da6ab3d4"
|
||||
JAVAFX_JMODS_SHA256="5e6c65c065eea22430c0eab36f37a5985eb8ad99e19e8772262021740d338f68"
|
||||
fi
|
||||
JAVAFX_JMODS_URL="https://download2.gluonhq.com/openjfx/${JAVAFX_VERSION}/openjfx-${JAVAFX_VERSION}_osx-${JAVAFX_ARCH}_bin-jmods.zip"
|
||||
|
||||
|
||||
2
dist/mac/dmg/resources/licenseTemplate.ftl
vendored
2
dist/mac/dmg/resources/licenseTemplate.ftl
vendored
@@ -17,7 +17,7 @@
|
||||
\f1\b0 \
|
||||
\
|
||||
|
||||
\f0\b \'a9 2016 \'96 2024 Skymatic GmbH
|
||||
\f0\b \'a9 2016 \'96 2025 Skymatic GmbH
|
||||
\f1\b0 \
|
||||
\
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\
|
||||
|
||||
2
dist/win/build.bat
vendored
2
dist/win/build.bat
vendored
@@ -11,7 +11,7 @@ SET HELP_URL="https://cryptomator.org/contact/"
|
||||
SET MODULE_AND_MAIN_CLASS="org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator"
|
||||
SET LOOPBACK_ALIAS="cryptomator-vault"
|
||||
|
||||
powershell -NoLogo -NoProfile -ExecutionPolicy Unrestricted -Command .\build.ps1^
|
||||
pwsh -NoLogo -NoProfile -ExecutionPolicy Unrestricted -Command .\build.ps1^
|
||||
-AppName %APPNAME%^
|
||||
-MainJarGlob "%MAIN_JAR_GLOB%"^
|
||||
-ModuleAndMainClass "%MODULE_AND_MAIN_CLASS%"^
|
||||
|
||||
10
dist/win/build.ps1
vendored
10
dist/win/build.ps1
vendored
@@ -51,23 +51,23 @@ if ($clean -and (Test-Path -Path $runtimeImagePath)) {
|
||||
}
|
||||
|
||||
## download jfx jmods
|
||||
$javaFxVersion='22.0.2'
|
||||
$javaFxVersion='23.0.2'
|
||||
$javaFxJmodsUrl = "https://download2.gluonhq.com/openjfx/${javaFxVersion}/openjfx-${javaFxVersion}_windows-x64_bin-jmods.zip"
|
||||
$javaFxJmodsSHA256 = 'f9376d200f5c5b85327d575c1ec1482e6455f19916577f7e2fc9be2f48bb29b6'
|
||||
$javaFxJmodsSHA256 = 'ee176dcee3bd78bde7910735bd67f67c792882f5b89626796ae06f7a1c0119d3'
|
||||
$javaFxJmods = '.\resources\jfxJmods.zip'
|
||||
if( !(Test-Path -Path $javaFxJmods) ) {
|
||||
Write-Output "Downloading ${javaFxJmodsUrl}..."
|
||||
Invoke-WebRequest $javaFxJmodsUrl -OutFile $javaFxJmods # redirects are followed by default
|
||||
}
|
||||
|
||||
$jmodsChecksumActual = $(Get-FileHash -Path $javaFxJmods -Algorithm SHA256).Hash
|
||||
$jmodsChecksumActual = $(Get-FileHash -Path $javaFxJmods -Algorithm SHA256).Hash.ToLower()
|
||||
if( $jmodsChecksumActual -ne $javaFxJmodsSHA256 ) {
|
||||
Write-Error "Checksum mismatch for jfxJmods.zip. Expected: $javaFxJmodsSHA256
|
||||
, actual: $jmodsChecksumActual"
|
||||
exit 1;
|
||||
}
|
||||
Expand-Archive -Path $javaFxJmods -Force -DestinationPath ".\resources\"
|
||||
Remove-Item -Recurse -Force -Path ".\resources\javafx-jmods"
|
||||
Remove-Item -Recurse -Force -Path ".\resources\javafx-jmods" -ErrorAction Ignore
|
||||
Move-Item -Force -Path ".\resources\javafx-jmods-*" -Destination ".\resources\javafx-jmods" -ErrorAction Stop
|
||||
|
||||
## create custom runtime
|
||||
@@ -75,7 +75,7 @@ Move-Item -Force -Path ".\resources\javafx-jmods-*" -Destination ".\resources\ja
|
||||
--verbose `
|
||||
--output runtime `
|
||||
--module-path "$Env:JAVA_HOME/jmods;$buildDir/resources/javafx-jmods" `
|
||||
--add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.accessibility,jdk.management.jfr,java.compiler,javafx.base,javafx.graphics,javafx.controls,javafx.fxml `
|
||||
--add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.accessibility,jdk.management.jfr,jdk.crypto.mscapi,java.compiler,javafx.base,javafx.graphics,javafx.controls,javafx.fxml `
|
||||
--strip-native-commands `
|
||||
--no-header-files `
|
||||
--no-man-pages `
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
\vieww12000\viewh15840\viewkind0
|
||||
\pard\tx283\tx567\tx850\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\b\fs16\lang7 Cryptomator is distributed under the GPLv3 License, found below. Please see the bottom of this document for any other license applicable to code used within Cryptomator.\b0\par
|
||||
\par
|
||||
\b\'a9 2016 \'96 2024 Skymatic GmbH \b0\par
|
||||
\b\'a9 2016 \'96 2025 Skymatic GmbH \b0\par
|
||||
\par
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\par
|
||||
\par
|
||||
|
||||
BIN
dist/win/contrib/dokan1.dll
vendored
BIN
dist/win/contrib/dokan1.dll
vendored
Binary file not shown.
2
dist/win/resources/licenseTemplate.ftl
vendored
2
dist/win/resources/licenseTemplate.ftl
vendored
@@ -10,7 +10,7 @@
|
||||
\vieww12000\viewh15840\viewkind0
|
||||
\pard\tx283\tx567\tx850\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\b\fs16\lang7 Cryptomator is distributed under the GPLv3 License, found below. Please see the bottom of this document for any other license applicable to code used within Cryptomator.\b0\par
|
||||
\par
|
||||
\b\'a9 2016 \'96 2024 Skymatic GmbH \b0\par
|
||||
\b\'a9 2016 \'96 2025 Skymatic GmbH \b0\par
|
||||
\par
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\par
|
||||
\par
|
||||
|
||||
76
pom.xml
76
pom.xml
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.cryptomator</groupId>
|
||||
<artifactId>cryptomator</artifactId>
|
||||
<version>1.15.0-SNAPSHOT</version>
|
||||
<version>1.16.0</version>
|
||||
<name>Cryptomator Desktop App</name>
|
||||
|
||||
<organization>
|
||||
@@ -33,43 +33,46 @@
|
||||
<nonModularGroupIds>org.ow2.asm,org.apache.jackrabbit,org.apache.httpcomponents</nonModularGroupIds>
|
||||
|
||||
<!-- cryptomator dependencies -->
|
||||
<cryptomator.cryptofs.version>2.7.1</cryptomator.cryptofs.version>
|
||||
<cryptomator.integrations.version>1.4.0</cryptomator.integrations.version>
|
||||
<cryptomator.cryptofs.version>2.9.0</cryptomator.cryptofs.version>
|
||||
<cryptomator.integrations.version>1.5.1</cryptomator.integrations.version>
|
||||
<cryptomator.integrations.win.version>1.3.0</cryptomator.integrations.win.version>
|
||||
<cryptomator.integrations.mac.version>1.2.4</cryptomator.integrations.mac.version>
|
||||
<cryptomator.integrations.linux.version>1.5.1</cryptomator.integrations.linux.version>
|
||||
<cryptomator.fuse.version>5.0.2</cryptomator.fuse.version>
|
||||
<cryptomator.webdav.version>2.0.7</cryptomator.webdav.version>
|
||||
<cryptomator.integrations.mac.version>1.3.0</cryptomator.integrations.mac.version>
|
||||
<cryptomator.integrations.linux.version>1.5.3</cryptomator.integrations.linux.version>
|
||||
<cryptomator.fuse.version>5.0.5</cryptomator.fuse.version>
|
||||
<cryptomator.webdav.version>2.0.10</cryptomator.webdav.version>
|
||||
|
||||
<!-- 3rd party dependencies -->
|
||||
<commons-lang3.version>3.17.0</commons-lang3.version>
|
||||
<dagger.version>2.52</dagger.version>
|
||||
<dagger.version>2.56.1</dagger.version>
|
||||
<easybind.version>2.2</easybind.version>
|
||||
<jackson.version>2.18.1</jackson.version>
|
||||
<javafx.version>22.0.2</javafx.version>
|
||||
<jwt.version>4.4.0</jwt.version>
|
||||
<jackson.version>2.18.3</jackson.version>
|
||||
<javafx.version>23.0.2</javafx.version>
|
||||
<jwt.version>4.5.0</jwt.version>
|
||||
<nimbus-jose.version>9.37.3</nimbus-jose.version>
|
||||
<logback.version>1.5.12</logback.version>
|
||||
<slf4j.version>2.0.16</slf4j.version>
|
||||
<tinyoauth2.version>0.8.0</tinyoauth2.version>
|
||||
<logback.version>1.5.18</logback.version>
|
||||
<slf4j.version>2.0.17</slf4j.version>
|
||||
<tinyoauth2.version>0.8.1</tinyoauth2.version>
|
||||
<zxcvbn.version>1.9.0</zxcvbn.version>
|
||||
|
||||
<!-- test dependencies -->
|
||||
<junit.jupiter.version>5.11.3</junit.jupiter.version>
|
||||
<mockito.version>5.14.2</mockito.version>
|
||||
<junit.jupiter.version>5.12.2</junit.jupiter.version>
|
||||
<mockito.version>5.17.0</mockito.version>
|
||||
<hamcrest.version>3.0</hamcrest.version>
|
||||
|
||||
<!-- build-time dependencies -->
|
||||
<jetbrains.annotations.version>26.0.1</jetbrains.annotations.version>
|
||||
<dependency-check.version>11.1.0</dependency-check.version>
|
||||
<jacoco.version>0.8.12</jacoco.version>
|
||||
<license-generator.version>2.4.0</license-generator.version>
|
||||
<junit-tree-reporter.version>1.3.0</junit-tree-reporter.version>
|
||||
<mvn-compiler.version>3.13.0</mvn-compiler.version>
|
||||
<jetbrains.annotations.version>26.0.2</jetbrains.annotations.version>
|
||||
<dependency-check.version>12.1.1</dependency-check.version>
|
||||
<jacoco.version>0.8.13</jacoco.version>
|
||||
<license-generator.version>2.5.0</license-generator.version>
|
||||
<junit-tree-reporter.version>1.4.0</junit-tree-reporter.version>
|
||||
<mvn-compiler.version>3.14.0</mvn-compiler.version>
|
||||
<mvn-resources.version>3.3.1</mvn-resources.version>
|
||||
<mvn-dependency.version>3.8.1</mvn-dependency.version>
|
||||
<mvn-surefire.version>3.5.2</mvn-surefire.version>
|
||||
<mvn-surefire.version>3.5.3</mvn-surefire.version>
|
||||
<mvn-jar.version>3.4.2</mvn-jar.version>
|
||||
|
||||
<!-- Property used by surefire to determine jacoco engine -->
|
||||
<surefire.jacoco.args></surefire.jacoco.args>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -77,7 +80,7 @@
|
||||
<dependency>
|
||||
<groupId>org.cryptomator</groupId>
|
||||
<artifactId>cryptolib</artifactId>
|
||||
<version>2.2.0</version>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.cryptomator</groupId>
|
||||
@@ -156,6 +159,12 @@
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>${jwt.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nimbusds</groupId>
|
||||
@@ -201,6 +210,12 @@
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Caffeine -->
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
<version>3.2.0</version>
|
||||
</dependency>
|
||||
<!-- JUnit / Mockito / Hamcrest -->
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
@@ -302,7 +317,6 @@
|
||||
<compilerArgs>
|
||||
<arg>-Adagger.fastInit=enabled</arg>
|
||||
<arg>-Adagger.formatGeneratedSource=enabled</arg>
|
||||
<arg>--enable-preview</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
@@ -329,11 +343,11 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<argLine>--enable-preview</argLine>
|
||||
<reportFormat>plain</reportFormat>
|
||||
<consoleOutputReporter>
|
||||
<disable>true</disable>
|
||||
</consoleOutputReporter>
|
||||
<argLine>@{surefire.jacoco.args} -javaagent:${org.mockito:mockito-core:jar}</argLine>
|
||||
<statelessTestsetInfoReporter
|
||||
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
|
||||
</statelessTestsetInfoReporter>
|
||||
@@ -343,6 +357,13 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jar-paths-to-properties</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>properties</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<!-- sort jars into two buckets (classpath and modulepath). exclude openjfx, which gets jlinked separately -->
|
||||
<execution>
|
||||
<id>copy-mods</id>
|
||||
@@ -415,6 +436,9 @@
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<propertyName>surefire.jacoco.args</propertyName>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import ch.qos.logback.classic.spi.Configurator;
|
||||
import org.cryptomator.networking.SSLContextWithPKCS12TrustStore;
|
||||
import org.cryptomator.common.locationpresets.DropboxLinuxLocationPresetsProvider;
|
||||
import org.cryptomator.common.locationpresets.DropboxMacLocationPresetsProvider;
|
||||
import org.cryptomator.common.locationpresets.DropboxWindowsLocationPresetsProvider;
|
||||
@@ -13,6 +14,9 @@ import org.cryptomator.common.locationpresets.OneDriveLinuxLocationPresetsProvid
|
||||
import org.cryptomator.common.locationpresets.OneDriveMacLocationPresetsProvider;
|
||||
import org.cryptomator.common.locationpresets.OneDriveWindowsLocationPresetsProvider;
|
||||
import org.cryptomator.common.locationpresets.PCloudLocationPresetsProvider;
|
||||
import org.cryptomator.networking.SSLContextWithMacKeychain;
|
||||
import org.cryptomator.networking.SSLContextProvider;
|
||||
import org.cryptomator.networking.SSLContextWithWindowsCertStore;
|
||||
import org.cryptomator.integrations.tray.TrayMenuController;
|
||||
import org.cryptomator.logging.LogbackConfiguratorFactory;
|
||||
import org.cryptomator.ui.traymenu.AwtTrayMenuController;
|
||||
@@ -51,11 +55,15 @@ open module org.cryptomator.desktop {
|
||||
requires jakarta.inject;
|
||||
requires static javax.inject;
|
||||
requires java.compiler;
|
||||
requires com.github.benmanes.caffeine;
|
||||
|
||||
uses org.cryptomator.common.locationpresets.LocationPresetsProvider;
|
||||
uses SSLContextProvider;
|
||||
uses org.cryptomator.event.NotificationHandler;
|
||||
|
||||
provides TrayMenuController with AwtTrayMenuController;
|
||||
provides Configurator with LogbackConfiguratorFactory;
|
||||
provides SSLContextProvider with SSLContextWithWindowsCertStore, SSLContextWithMacKeychain, SSLContextWithPKCS12TrustStore;
|
||||
provides LocationPresetsProvider with //
|
||||
DropboxWindowsLocationPresetsProvider, DropboxMacLocationPresetsProvider, DropboxLinuxLocationPresetsProvider, //
|
||||
GoogleDriveMacLocationPresetsProvider, GoogleDriveWindowsLocationPresetsProvider, //
|
||||
|
||||
22
src/main/java/org/cryptomator/JavaFXUtil.java
Normal file
22
src/main/java/org/cryptomator/JavaFXUtil.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package org.cryptomator;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class JavaFXUtil {
|
||||
|
||||
private JavaFXUtil() {}
|
||||
|
||||
public static boolean startPlatform() throws InterruptedException {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
try {
|
||||
Platform.startup(latch::countDown);
|
||||
} catch (IllegalStateException e) {
|
||||
//already initialized
|
||||
latch.countDown();
|
||||
}
|
||||
return latch.await(5, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
}
|
||||
160
src/main/java/org/cryptomator/common/EventMap.java
Normal file
160
src/main/java/org/cryptomator/common/EventMap.java
Normal file
@@ -0,0 +1,160 @@
|
||||
package org.cryptomator.common;
|
||||
|
||||
import org.cryptomator.cryptofs.event.BrokenDirFileEvent;
|
||||
import org.cryptomator.cryptofs.event.BrokenFileNodeEvent;
|
||||
import org.cryptomator.cryptofs.event.ConflictResolutionFailedEvent;
|
||||
import org.cryptomator.cryptofs.event.ConflictResolvedEvent;
|
||||
import org.cryptomator.cryptofs.event.DecryptionFailedEvent;
|
||||
import org.cryptomator.cryptofs.event.FilesystemEvent;
|
||||
import org.cryptomator.event.VaultEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import javafx.beans.InvalidationListener;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.MapChangeListener;
|
||||
import javafx.collections.ObservableMap;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Map containing {@link VaultEvent}s.
|
||||
* The map is keyed by the ciphertext path of the affected resource _and_ the {@link FilesystemEvent}s class in order to group same events
|
||||
* <p>
|
||||
* Use {@link EventMap#put(VaultEvent)} to add an element and {@link EventMap#remove(VaultEvent)} to remove it.
|
||||
* <p>
|
||||
* The map is size restricted to {@value MAX_SIZE} elements. If a _new_ element (i.e. not already present) is added, the least recently added is removed.
|
||||
*/
|
||||
@Singleton
|
||||
public class EventMap implements ObservableMap<EventMap.EventKey, VaultEvent> {
|
||||
|
||||
private static final int MAX_SIZE = 300;
|
||||
|
||||
public record EventKey(Path ciphertextPath, Class<? extends FilesystemEvent> c) {}
|
||||
|
||||
private final ObservableMap<EventMap.EventKey, VaultEvent> delegate;
|
||||
|
||||
@Inject
|
||||
public EventMap() {
|
||||
delegate = FXCollections.observableHashMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(MapChangeListener<? super EventKey, ? super VaultEvent> mapChangeListener) {
|
||||
delegate.addListener(mapChangeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListener(MapChangeListener<? super EventKey, ? super VaultEvent> mapChangeListener) {
|
||||
delegate.removeListener(mapChangeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return delegate.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return delegate.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsKey(Object key) {
|
||||
return delegate.containsKey(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsValue(Object value) {
|
||||
return delegate.containsValue(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VaultEvent get(Object key) {
|
||||
return delegate.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable VaultEvent put(EventKey key, VaultEvent value) {
|
||||
return delegate.put(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VaultEvent remove(Object key) {
|
||||
return delegate.remove(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putAll(@NotNull Map<? extends EventKey, ? extends VaultEvent> m) {
|
||||
delegate.putAll(m);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
delegate.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<EventKey> keySet() {
|
||||
return delegate.keySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Collection<VaultEvent> values() {
|
||||
return delegate.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Entry<EventKey, VaultEvent>> entrySet() {
|
||||
return delegate.entrySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(InvalidationListener invalidationListener) {
|
||||
delegate.addListener(invalidationListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListener(InvalidationListener invalidationListener) {
|
||||
delegate.removeListener(invalidationListener);
|
||||
}
|
||||
|
||||
public synchronized void put(VaultEvent e) {
|
||||
//compute key
|
||||
var key = computeKey(e.actualEvent());
|
||||
//if-else
|
||||
var nullOrEntry = delegate.get(key);
|
||||
if (nullOrEntry == null) {
|
||||
if (size() == MAX_SIZE) {
|
||||
delegate.entrySet().stream() //
|
||||
.min(Comparator.comparing(entry -> entry.getValue().actualEvent().getTimestamp())) //
|
||||
.ifPresent(oldestEntry -> delegate.remove(oldestEntry.getKey()));
|
||||
}
|
||||
delegate.put(key, e);
|
||||
} else {
|
||||
delegate.put(key, nullOrEntry.incrementCount(e.actualEvent()));
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized VaultEvent remove(VaultEvent similar) {
|
||||
//compute key
|
||||
var key = computeKey(similar.actualEvent());
|
||||
return this.remove(key);
|
||||
}
|
||||
|
||||
private EventKey computeKey(FilesystemEvent e) {
|
||||
var p = switch (e) {
|
||||
case DecryptionFailedEvent(_, Path ciphertextPath, _) -> ciphertextPath;
|
||||
case ConflictResolvedEvent(_, _, _, _, Path resolvedCiphertext) -> resolvedCiphertext;
|
||||
case ConflictResolutionFailedEvent(_, _, Path conflictingCiphertext, _) -> conflictingCiphertext;
|
||||
case BrokenDirFileEvent(_, Path ciphertext) -> ciphertext;
|
||||
case BrokenFileNodeEvent(_, _, Path ciphertext) -> ciphertext;
|
||||
};
|
||||
return new EventKey(p, e.getClass());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.cryptomator.common.keychain;
|
||||
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||
import org.cryptomator.common.Passphrase;
|
||||
import org.cryptomator.integrations.keychain.KeychainAccessException;
|
||||
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
|
||||
|
||||
@@ -14,20 +14,24 @@ import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.ReadOnlyBooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
@Singleton
|
||||
public class KeychainManager implements KeychainAccessProvider {
|
||||
|
||||
private final ObjectExpression<KeychainAccessProvider> keychain;
|
||||
private final LoadingCache<String, BooleanProperty> passphraseStoredProperties;
|
||||
private final ReentrantReadWriteLock lock;
|
||||
|
||||
@Inject
|
||||
KeychainManager(ObjectExpression<KeychainAccessProvider> selectedKeychain) {
|
||||
this.keychain = selectedKeychain;
|
||||
this.passphraseStoredProperties = CacheBuilder.newBuilder() //
|
||||
.weakValues() //
|
||||
.build(CacheLoader.from(this::createStoredPassphraseProperty));
|
||||
this.passphraseStoredProperties = Caffeine.newBuilder() //
|
||||
.softValues() //
|
||||
.build(this::createStoredPassphraseProperty);
|
||||
keychain.addListener(ignored -> passphraseStoredProperties.invalidateAll());
|
||||
this.lock = new ReentrantReadWriteLock(false);
|
||||
}
|
||||
|
||||
private KeychainAccessProvider getKeychainOrFail() throws KeychainAccessException {
|
||||
@@ -43,29 +47,59 @@ public class KeychainManager implements KeychainAccessProvider {
|
||||
return getClass().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
|
||||
storePassphrase(key, displayName, passphrase, true);
|
||||
}
|
||||
|
||||
//TODO: remove ignored parameter once the API is fixed
|
||||
@Override
|
||||
public void storePassphrase(String key, String displayName, CharSequence passphrase, boolean ignored) throws KeychainAccessException {
|
||||
getKeychainOrFail().storePassphrase(key, displayName, passphrase);
|
||||
try {
|
||||
lock.writeLock().lock();
|
||||
var kc = getKeychainOrFail();
|
||||
//this is the only keychain actually using the parameter
|
||||
var usesOSAuth = (kc.getClass().getName().equals("org.cryptomator.macos.keychain.TouchIdKeychainAccess"));
|
||||
kc.storePassphrase(key, displayName, passphrase, usesOSAuth);
|
||||
} finally {
|
||||
lock.writeLock().unlock();
|
||||
}
|
||||
setPassphraseStored(key, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public char[] loadPassphrase(String key) throws KeychainAccessException {
|
||||
char[] passphrase = getKeychainOrFail().loadPassphrase(key);
|
||||
char[] passphrase = null;
|
||||
try {
|
||||
lock.readLock().lock();
|
||||
passphrase = getKeychainOrFail().loadPassphrase(key);
|
||||
} finally {
|
||||
lock.readLock().unlock();
|
||||
}
|
||||
setPassphraseStored(key, passphrase != null);
|
||||
return passphrase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePassphrase(String key) throws KeychainAccessException {
|
||||
getKeychainOrFail().deletePassphrase(key);
|
||||
try {
|
||||
lock.writeLock().lock();
|
||||
getKeychainOrFail().deletePassphrase(key);
|
||||
} finally {
|
||||
lock.writeLock().unlock();
|
||||
}
|
||||
setPassphraseStored(key, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
|
||||
if (isPassphraseStored(key)) {
|
||||
getKeychainOrFail().changePassphrase(key, displayName, passphrase);
|
||||
try {
|
||||
lock.writeLock().lock();
|
||||
getKeychainOrFail().changePassphrase(key, displayName, passphrase);
|
||||
} finally {
|
||||
lock.writeLock().unlock();
|
||||
}
|
||||
setPassphraseStored(key, true);
|
||||
}
|
||||
}
|
||||
@@ -102,13 +136,11 @@ public class KeychainManager implements KeychainAccessProvider {
|
||||
}
|
||||
|
||||
private void setPassphraseStored(String key, boolean value) {
|
||||
BooleanProperty property = passphraseStoredProperties.getIfPresent(key);
|
||||
if (property != null) {
|
||||
if (Platform.isFxApplicationThread()) {
|
||||
property.set(value);
|
||||
} else {
|
||||
Platform.runLater(() -> property.set(value));
|
||||
}
|
||||
BooleanProperty property = passphraseStoredProperties.get(key, _ -> new SimpleBooleanProperty(value));
|
||||
if (Platform.isFxApplicationThread()) {
|
||||
property.set(value);
|
||||
} else {
|
||||
Platform.runLater(() -> property.set(value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +156,7 @@ public class KeychainManager implements KeychainAccessProvider {
|
||||
* @see #isPassphraseStored(String)
|
||||
*/
|
||||
public ReadOnlyBooleanProperty getPassphraseStoredProperty(String key) {
|
||||
return passphraseStoredProperties.getUnchecked(key);
|
||||
return passphraseStoredProperties.get(key);
|
||||
}
|
||||
|
||||
private BooleanProperty createStoredPassphraseProperty(String key) {
|
||||
@@ -135,4 +167,22 @@ public class KeychainManager implements KeychainAccessProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectExpression<KeychainAccessProvider> getKeychainImplementation() {
|
||||
return this.keychain;
|
||||
}
|
||||
|
||||
public static void migrate(KeychainAccessProvider oldProvider, KeychainAccessProvider newProvider, Map<String, String> idsAndNames) throws KeychainAccessException {
|
||||
if (oldProvider instanceof KeychainManager || newProvider instanceof KeychainManager) {
|
||||
throw new IllegalArgumentException("KeychainManger must not be the source or target of migration");
|
||||
}
|
||||
for (var entry : idsAndNames.entrySet()) {
|
||||
var passphrase = oldProvider.loadPassphrase(entry.getKey());
|
||||
if (passphrase != null) {
|
||||
var wrapper = new Passphrase(passphrase);
|
||||
oldProvider.deletePassphrase(entry.getKey()); //we cannot apply "first-write-then-delete" pattern here, since we can potentially write to the same passphrase store (e.g., touchID and regular keychain)
|
||||
newProvider.storePassphrase(entry.getKey(), entry.getValue(), wrapper);
|
||||
wrapper.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ public class VaultSettings {
|
||||
public final StringExpression mountName;
|
||||
public final StringProperty mountService;
|
||||
public final IntegerProperty port;
|
||||
public final StringProperty lastKnownKeyLoader;
|
||||
|
||||
VaultSettings(VaultSettingsJson json) {
|
||||
this.id = json.id;
|
||||
@@ -74,6 +75,7 @@ public class VaultSettings {
|
||||
this.mountPoint = new SimpleObjectProperty<>(this, "mountPoint", json.mountPoint == null ? null : Path.of(json.mountPoint));
|
||||
this.mountService = new SimpleStringProperty(this, "mountService", json.mountService);
|
||||
this.port = new SimpleIntegerProperty(this, "port", json.port);
|
||||
this.lastKnownKeyLoader = new SimpleStringProperty(this, "lastKnownKeyLoader", json.lastKnownKeyLoader);
|
||||
// mount name is no longer an explicit setting, see https://github.com/cryptomator/cryptomator/pull/1318
|
||||
this.mountName = StringExpression.stringExpression(Bindings.createStringBinding(() -> {
|
||||
final String name;
|
||||
@@ -99,7 +101,7 @@ public class VaultSettings {
|
||||
}
|
||||
|
||||
Observable[] observables() {
|
||||
return new Observable[]{actionAfterUnlock, autoLockIdleSeconds, autoLockWhenIdle, displayName, maxCleartextFilenameLength, mountFlags, mountPoint, path, revealAfterMount, unlockAfterStartup, usesReadOnlyMode, port, mountService};
|
||||
return new Observable[]{actionAfterUnlock, autoLockIdleSeconds, autoLockWhenIdle, displayName, maxCleartextFilenameLength, mountFlags, mountPoint, path, revealAfterMount, unlockAfterStartup, usesReadOnlyMode, port, mountService, lastKnownKeyLoader};
|
||||
}
|
||||
|
||||
public static VaultSettings withRandomId() {
|
||||
@@ -130,6 +132,7 @@ public class VaultSettings {
|
||||
json.mountPoint = mountPoint.map(Path::toString).getValue();
|
||||
json.mountService = mountService.get();
|
||||
json.port = port.get();
|
||||
json.lastKnownKeyLoader = lastKnownKeyLoader.get();
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,9 @@ class VaultSettingsJson {
|
||||
@JsonProperty("mountService")
|
||||
String mountService;
|
||||
|
||||
@JsonProperty("lastKnownKeyLoader")
|
||||
String lastKnownKeyLoader;
|
||||
|
||||
@JsonProperty("port")
|
||||
int port = VaultSettings.DEFAULT_PORT;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ package org.cryptomator.common.vaults;
|
||||
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.cryptomator.common.Constants;
|
||||
import org.cryptomator.event.FileSystemEventAggregator;
|
||||
import org.cryptomator.common.mount.Mounter;
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
import org.cryptomator.common.settings.VaultSettings;
|
||||
@@ -18,9 +19,11 @@ import org.cryptomator.cryptofs.CryptoFileSystemProperties;
|
||||
import org.cryptomator.cryptofs.CryptoFileSystemProperties.FileSystemFlags;
|
||||
import org.cryptomator.cryptofs.CryptoFileSystemProvider;
|
||||
import org.cryptomator.cryptofs.common.FileSystemCapabilityChecker;
|
||||
import org.cryptomator.cryptofs.event.FilesystemEvent;
|
||||
import org.cryptomator.cryptolib.api.CryptoException;
|
||||
import org.cryptomator.cryptolib.api.MasterkeyLoader;
|
||||
import org.cryptomator.cryptolib.api.MasterkeyLoadingFailedException;
|
||||
import org.cryptomator.event.VaultEvent;
|
||||
import org.cryptomator.integrations.mount.MountFailedException;
|
||||
import org.cryptomator.integrations.mount.Mountpoint;
|
||||
import org.cryptomator.integrations.mount.UnmountFailedException;
|
||||
@@ -32,6 +35,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.binding.BooleanBinding;
|
||||
@@ -44,6 +48,7 @@ import javafx.beans.property.SimpleBooleanProperty;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.ReadOnlyFileSystemException;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
@@ -73,6 +78,7 @@ public class Vault {
|
||||
private final ObjectBinding<Mountpoint> mountPoint;
|
||||
private final Mounter mounter;
|
||||
private final Settings settings;
|
||||
private final FileSystemEventAggregator fileSystemEventAggregator;
|
||||
private final BooleanProperty showingStats;
|
||||
|
||||
private final AtomicReference<Mounter.MountHandle> mountHandle = new AtomicReference<>(null);
|
||||
@@ -84,7 +90,8 @@ public class Vault {
|
||||
VaultState state, //
|
||||
@Named("lastKnownException") ObjectProperty<Exception> lastKnownException, //
|
||||
VaultStats stats, //
|
||||
Mounter mounter, Settings settings) {
|
||||
Mounter mounter, Settings settings, //
|
||||
FileSystemEventAggregator fileSystemEventAggregator) {
|
||||
this.vaultSettings = vaultSettings;
|
||||
this.configCache = configCache;
|
||||
this.cryptoFileSystem = cryptoFileSystem;
|
||||
@@ -101,6 +108,7 @@ public class Vault {
|
||||
this.mountPoint = Bindings.createObjectBinding(this::getMountPoint, state);
|
||||
this.mounter = mounter;
|
||||
this.settings = settings;
|
||||
this.fileSystemEventAggregator = fileSystemEventAggregator;
|
||||
this.showingStats = new SimpleBooleanProperty(false);
|
||||
this.quickAccessEntry = new AtomicReference<>(null);
|
||||
}
|
||||
@@ -111,15 +119,22 @@ public class Vault {
|
||||
|
||||
private CryptoFileSystem createCryptoFileSystem(MasterkeyLoader keyLoader) throws IOException, MasterkeyLoadingFailedException {
|
||||
Set<FileSystemFlags> flags = EnumSet.noneOf(FileSystemFlags.class);
|
||||
if (vaultSettings.usesReadOnlyMode.get()) {
|
||||
var createReadOnly = vaultSettings.usesReadOnlyMode.get();
|
||||
try {
|
||||
FileSystemCapabilityChecker.assertWriteAccess(getPath());
|
||||
} catch (FileSystemCapabilityChecker.MissingCapabilityException e) {
|
||||
if (!createReadOnly) {
|
||||
throw new ReadOnlyFileSystemException();
|
||||
}
|
||||
}
|
||||
if (createReadOnly) {
|
||||
flags.add(FileSystemFlags.READONLY);
|
||||
} else if (vaultSettings.maxCleartextFilenameLength.get() == -1) {
|
||||
LOG.debug("Determining cleartext filename length limitations...");
|
||||
var checker = new FileSystemCapabilityChecker();
|
||||
int shorteningThreshold = configCache.get().allegedShorteningThreshold();
|
||||
int ciphertextLimit = checker.determineSupportedCiphertextFileNameLength(getPath());
|
||||
int ciphertextLimit = FileSystemCapabilityChecker.determineSupportedCiphertextFileNameLength(getPath());
|
||||
if (ciphertextLimit < shorteningThreshold) {
|
||||
int cleartextLimit = checker.determineSupportedCleartextFileNameLength(getPath());
|
||||
int cleartextLimit = FileSystemCapabilityChecker.determineSupportedCleartextFileNameLength(getPath());
|
||||
vaultSettings.maxCleartextFilenameLength.set(cleartextLimit);
|
||||
} else {
|
||||
vaultSettings.maxCleartextFilenameLength.setValue(UNLIMITED_FILENAME_LENGTH);
|
||||
@@ -135,6 +150,7 @@ public class Vault {
|
||||
.withFlags(flags) //
|
||||
.withMaxCleartextNameLength(vaultSettings.maxCleartextFilenameLength.get()) //
|
||||
.withVaultConfigFilename(Constants.VAULTCONFIG_FILENAME) //
|
||||
.withFilesystemEventConsumer(this::consumeVaultEvent) //
|
||||
.build();
|
||||
return CryptoFileSystemProvider.newFileSystem(getPath(), fsProps);
|
||||
}
|
||||
@@ -243,6 +259,11 @@ public class Vault {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void consumeVaultEvent(FilesystemEvent e) {
|
||||
fileSystemEventAggregator.put(this, e);
|
||||
}
|
||||
|
||||
// ******************************************************************************
|
||||
// Observable Properties
|
||||
// *******************************************************************************
|
||||
@@ -404,6 +425,17 @@ public class Vault {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cleartext name from a given path to an encrypted vault file
|
||||
*/
|
||||
public String getCleartextName(Path ciphertextPath) throws IOException {
|
||||
if (!state.getValue().equals(VaultState.Value.UNLOCKED)) {
|
||||
throw new IllegalStateException("Vault is not unlocked");
|
||||
}
|
||||
var fs = cryptoFileSystem.get();
|
||||
return fs.getCleartextName(ciphertextPath);
|
||||
}
|
||||
|
||||
public VaultConfigCache getVaultConfigCache() {
|
||||
return configCache;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@@ -49,9 +50,9 @@ public class VaultListManager {
|
||||
@Inject
|
||||
public VaultListManager(ObservableList<Vault> vaultList, //
|
||||
AutoLocker autoLocker, //
|
||||
List<MountService> mountServices,
|
||||
VaultComponent.Factory vaultComponentFactory,
|
||||
ResourceBundle resourceBundle,
|
||||
List<MountService> mountServices, //
|
||||
VaultComponent.Factory vaultComponentFactory, //
|
||||
ResourceBundle resourceBundle, //
|
||||
Settings settings) {
|
||||
this.vaultList = vaultList;
|
||||
this.autoLocker = autoLocker;
|
||||
@@ -114,6 +115,10 @@ public class VaultListManager {
|
||||
private Vault create(VaultSettings vaultSettings) {
|
||||
var wrapper = new VaultConfigCache(vaultSettings);
|
||||
try {
|
||||
if (Objects.isNull(vaultSettings.lastKnownKeyLoader.get())) {
|
||||
var keyIdScheme = wrapper.get().getKeyId().getScheme();
|
||||
vaultSettings.lastKnownKeyLoader.set(keyIdScheme);
|
||||
}
|
||||
var vaultState = determineVaultState(vaultSettings.path.get());
|
||||
if (vaultState == LOCKED) { //for legacy reasons: pre v8 vault do not have a config, but they are in the NEEDS_MIGRATION state
|
||||
wrapper.reloadConfig();
|
||||
|
||||
14
src/main/java/org/cryptomator/event/Answer.java
Normal file
14
src/main/java/org/cryptomator/event/Answer.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package org.cryptomator.event;
|
||||
|
||||
public sealed interface Answer permits Answer.DoNothing, Answer.DoSomething {
|
||||
|
||||
|
||||
record DoNothing() implements Answer {}
|
||||
|
||||
record DoSomething(Runnable action) implements Answer {
|
||||
|
||||
void run() {
|
||||
action.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
8
src/main/java/org/cryptomator/event/FSEventBucket.java
Normal file
8
src/main/java/org/cryptomator/event/FSEventBucket.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package org.cryptomator.event;
|
||||
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.cryptofs.event.FilesystemEvent;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
public record FSEventBucket(Vault vault, Path idPath, Class<? extends FilesystemEvent> c) {}
|
||||
@@ -0,0 +1,5 @@
|
||||
package org.cryptomator.event;
|
||||
|
||||
import org.cryptomator.cryptofs.event.FilesystemEvent;
|
||||
|
||||
public record FSEventBucketContent(FilesystemEvent mostRecentEvent, int count) {}
|
||||
@@ -0,0 +1,107 @@
|
||||
package org.cryptomator.event;
|
||||
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.cryptofs.event.BrokenDirFileEvent;
|
||||
import org.cryptomator.cryptofs.event.BrokenFileNodeEvent;
|
||||
import org.cryptomator.cryptofs.event.ConflictResolutionFailedEvent;
|
||||
import org.cryptomator.cryptofs.event.ConflictResolvedEvent;
|
||||
import org.cryptomator.cryptofs.event.DecryptionFailedEvent;
|
||||
import org.cryptomator.cryptofs.event.FilesystemEvent;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* Aggregator for {@link FilesystemEvent}s.
|
||||
* <p>
|
||||
* The aggregator groups filesystem events by the vault where the event occurred, an identifying path (clear- or ciphertext) and the event class (aka type).
|
||||
* A group is called an {@link FSEventBucket}, its {@link FSEventBucketContent} is the most recent event object and a count of how often the event already occurred.
|
||||
*/
|
||||
@Singleton
|
||||
public class FileSystemEventAggregator {
|
||||
|
||||
private final ConcurrentHashMap<FSEventBucket, FSEventBucketContent> map;
|
||||
private final AtomicBoolean hasUpdates;
|
||||
|
||||
@Inject
|
||||
public FileSystemEventAggregator() {
|
||||
this.map = new ConcurrentHashMap<>();
|
||||
this.hasUpdates = new AtomicBoolean(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the given event to the map. If a bucket for this event already exists, only the count is updated and the event set as the most recent one.
|
||||
*
|
||||
* @param v Vault where the event occurred
|
||||
* @param e Actual {@link FilesystemEvent}
|
||||
*/
|
||||
public void put(Vault v, FilesystemEvent e) {
|
||||
var key = computeKey(v, e);
|
||||
map.compute(key, (k, val) -> {
|
||||
if (val == null) {
|
||||
return new FSEventBucketContent(e, 1);
|
||||
} else {
|
||||
return new FSEventBucketContent(e, val.count() + 1);
|
||||
}
|
||||
});
|
||||
hasUpdates.set(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an event bucket from the map.
|
||||
*/
|
||||
public FSEventBucketContent remove(FSEventBucket key) {
|
||||
var content = map.remove(key);
|
||||
hasUpdates.set(true);
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the event map.
|
||||
*/
|
||||
public void clear() {
|
||||
map.clear();
|
||||
hasUpdates.set(true);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasMaybeUpdates() {
|
||||
return hasUpdates.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clones the map entries into a collection.
|
||||
* <p>
|
||||
* The collection is first cleared, then all map entries are added in one bulk operation. Cleans the hasUpdates status.
|
||||
*
|
||||
* @param target collection which is first cleared and then the EntrySet copied to.
|
||||
*/
|
||||
public void cloneTo(Collection<Map.Entry<FSEventBucket, FSEventBucketContent>> target) {
|
||||
hasUpdates.set(false);
|
||||
target.clear();
|
||||
target.addAll(map.entrySet());
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to compute the identifying key for a given filesystem event
|
||||
*
|
||||
* @param v Vault where the event occurred
|
||||
* @param event Actual {@link FilesystemEvent}
|
||||
* @return a {@link FSEventBucket} used in the map and lru cache
|
||||
*/
|
||||
private static FSEventBucket computeKey(Vault v, FilesystemEvent event) {
|
||||
var p = switch (event) {
|
||||
case DecryptionFailedEvent(_, Path ciphertextPath, _) -> ciphertextPath;
|
||||
case ConflictResolvedEvent(_, _, _, _, Path resolvedCiphertext) -> resolvedCiphertext;
|
||||
case ConflictResolutionFailedEvent(_, _, Path conflictingCiphertext, _) -> conflictingCiphertext;
|
||||
case BrokenDirFileEvent(_, Path ciphertext) -> ciphertext;
|
||||
case BrokenFileNodeEvent(_, _, Path ciphertext) -> ciphertext;
|
||||
};
|
||||
return new FSEventBucket(v, p, event.getClass());
|
||||
}
|
||||
}
|
||||
15
src/main/java/org/cryptomator/event/NotificationHandler.java
Normal file
15
src/main/java/org/cryptomator/event/NotificationHandler.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package org.cryptomator.event;
|
||||
|
||||
import org.cryptomator.integrations.common.IntegrationsLoader;
|
||||
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public interface NotificationHandler {
|
||||
|
||||
Answer handle(VaultEvent e);
|
||||
|
||||
static Stream<NotificationHandler> loadAll() {
|
||||
return IntegrationsLoader.loadAll(ServiceLoader.load(NotificationHandler.class), NotificationHandler.class);
|
||||
}
|
||||
}
|
||||
27
src/main/java/org/cryptomator/event/VaultEvent.java
Normal file
27
src/main/java/org/cryptomator/event/VaultEvent.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package org.cryptomator.event;
|
||||
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.cryptofs.event.FilesystemEvent;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public record VaultEvent(Vault v, FilesystemEvent actualEvent, int count) implements Comparable<VaultEvent> {
|
||||
|
||||
public VaultEvent(Vault v, FilesystemEvent actualEvent) {
|
||||
this(v, actualEvent, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(VaultEvent other) {
|
||||
var timeResult = actualEvent.getTimestamp().compareTo(other.actualEvent().getTimestamp());
|
||||
if(timeResult != 0) {
|
||||
return timeResult;
|
||||
} else {
|
||||
return this.equals(other) ? 0 : this.actualEvent.getClass().getName().compareTo(other.actualEvent.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public VaultEvent incrementCount(FilesystemEvent update) {
|
||||
return new VaultEvent(v, update, count+1);
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,9 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import dagger.Lazy;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.cryptomator.common.Environment;
|
||||
import org.cryptomator.common.SubstitutingProperties;
|
||||
import org.cryptomator.common.ShutdownHook;
|
||||
import org.cryptomator.common.SubstitutingProperties;
|
||||
import org.cryptomator.networking.SSLContextProvider;
|
||||
import org.cryptomator.ipc.IpcCommunicator;
|
||||
import org.cryptomator.logging.DebugMode;
|
||||
import org.cryptomator.ui.fxapp.FxApplicationComponent;
|
||||
@@ -19,8 +20,10 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javafx.application.Application;
|
||||
import javafx.stage.Stage;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -48,14 +51,16 @@ public class Cryptomator {
|
||||
private final Environment env;
|
||||
private final Lazy<IpcMessageHandler> ipcMessageHandler;
|
||||
private final ShutdownHook shutdownHook;
|
||||
private final SecureRandom csprng;
|
||||
|
||||
@Inject
|
||||
Cryptomator(DebugMode debugMode, SupportedLanguages supportedLanguages, Environment env, Lazy<IpcMessageHandler> ipcMessageHandler, ShutdownHook shutdownHook) {
|
||||
Cryptomator(DebugMode debugMode, SupportedLanguages supportedLanguages, Environment env, Lazy<IpcMessageHandler> ipcMessageHandler, ShutdownHook shutdownHook, SecureRandom csprng) {
|
||||
this.debugMode = debugMode;
|
||||
this.supportedLanguages = supportedLanguages;
|
||||
this.env = env;
|
||||
this.ipcMessageHandler = ipcMessageHandler;
|
||||
this.shutdownHook = shutdownHook;
|
||||
this.csprng = csprng;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
@@ -89,7 +94,7 @@ public class Cryptomator {
|
||||
LOG.info("Starting Cryptomator {} on {} {} ({})", env.getAppVersion(), SystemUtils.OS_NAME, SystemUtils.OS_VERSION, SystemUtils.OS_ARCH);
|
||||
debugMode.initialize();
|
||||
supportedLanguages.applyPreferred();
|
||||
|
||||
changeDefaultSSLContext();
|
||||
/*
|
||||
* Attempts to create an IPC connection to a running Cryptomator instance and sends it the given args.
|
||||
* If no external process could be reached, the args will be handled by the loopback IPC endpoint.
|
||||
@@ -115,6 +120,17 @@ public class Cryptomator {
|
||||
}
|
||||
}
|
||||
|
||||
private void changeDefaultSSLContext() {
|
||||
SSLContextProvider.loadAll().findFirst().ifPresent(p -> {
|
||||
try {
|
||||
var context = p.getContext(csprng);
|
||||
SSLContext.setDefault(context);
|
||||
} catch (SSLContextProvider.SSLContextBuildException e) {
|
||||
LOG.warn("Failed to change default SSL context with provider {}", p.getClass().getName(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Launches the JavaFX application, blocking the main thread until shuts down.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.cryptomator.networking;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
import java.io.IOException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.CertificateException;
|
||||
|
||||
abstract class SSLContextDifferentTrustStoreBase implements SSLContextProvider {
|
||||
|
||||
abstract KeyStore getTruststore() throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException;
|
||||
|
||||
@Override
|
||||
public SSLContext getContext(SecureRandom csprng) throws SSLContextBuildException {
|
||||
try {
|
||||
KeyStore truststore = getTruststore();
|
||||
truststore.load(null, null);
|
||||
|
||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
||||
tmf.init(truststore);
|
||||
|
||||
SSLContext context = SSLContext.getInstance("TLS");
|
||||
context.init(null, tmf.getTrustManagers(), csprng);
|
||||
return context;
|
||||
} catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | KeyManagementException | IOException e) {
|
||||
throw new SSLContextBuildException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.cryptomator.networking;
|
||||
|
||||
import org.cryptomator.integrations.common.IntegrationsLoader;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public interface SSLContextProvider {
|
||||
|
||||
SSLContext getContext(SecureRandom csprng) throws SSLContextBuildException;
|
||||
|
||||
class SSLContextBuildException extends Exception {
|
||||
|
||||
SSLContextBuildException(Throwable t) {
|
||||
super(t);
|
||||
}
|
||||
}
|
||||
|
||||
static Stream<SSLContextProvider> loadAll() {
|
||||
return IntegrationsLoader.loadAll(ServiceLoader.load(SSLContextProvider.class), SSLContextProvider.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.cryptomator.networking;
|
||||
|
||||
import org.cryptomator.integrations.common.OperatingSystem;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.CertificateException;
|
||||
|
||||
/**
|
||||
* SSLContextProvider for macOS using the macOS Keychain as truststore
|
||||
*/
|
||||
@OperatingSystem(OperatingSystem.Value.MAC)
|
||||
public class SSLContextWithMacKeychain extends SSLContextDifferentTrustStoreBase implements SSLContextProvider {
|
||||
|
||||
@Override
|
||||
KeyStore getTruststore() throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException {
|
||||
return KeyStore.getInstance("KeychainStore-ROOT");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.cryptomator.networking;
|
||||
|
||||
import org.cryptomator.integrations.common.CheckAvailability;
|
||||
import org.cryptomator.integrations.common.OperatingSystem;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* SSLContextProvider for Linux using a PKCS#12 file as trust store
|
||||
*/
|
||||
@OperatingSystem(OperatingSystem.Value.LINUX)
|
||||
@CheckAvailability
|
||||
public class SSLContextWithPKCS12TrustStore extends SSLContextDifferentTrustStoreBase implements SSLContextProvider {
|
||||
|
||||
private static final String CERT_FILE_LOCATION_PROPERTY = "cryptomator.networking.truststore.p12Path";
|
||||
|
||||
@Override
|
||||
KeyStore getTruststore() throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException {
|
||||
var pkcs12FilePath = Path.of(System.getProperty(CERT_FILE_LOCATION_PROPERTY));
|
||||
try {
|
||||
return KeyStore.getInstance(pkcs12FilePath.toFile(), new char[]{});
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new NoSuchFileException(pkcs12FilePath.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@CheckAvailability
|
||||
public static boolean isSupported() {
|
||||
var pkcs12Path = System.getProperty(CERT_FILE_LOCATION_PROPERTY);
|
||||
return Optional.ofNullable(pkcs12Path) //
|
||||
.map(Path::of) //
|
||||
.map(Files::exists).orElse(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.cryptomator.networking;
|
||||
|
||||
import org.cryptomator.integrations.common.OperatingSystem;
|
||||
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
|
||||
/**
|
||||
* SSLContextProvider for Windows using the Windows certificate store as trust store
|
||||
* <p>
|
||||
* In order to work, the jdk.crypto.mscapi jmod is needed
|
||||
*/
|
||||
@OperatingSystem(OperatingSystem.Value.WINDOWS)
|
||||
public class SSLContextWithWindowsCertStore extends SSLContextDifferentTrustStoreBase implements SSLContextProvider {
|
||||
|
||||
@Override
|
||||
KeyStore getTruststore() throws KeyStoreException {
|
||||
return KeyStore.getInstance("WINDOWS-ROOT");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class CreateNewVaultExpertSettingsController implements FxController {
|
||||
|
||||
public static final int MAX_SHORTENING_THRESHOLD = 220;
|
||||
public static final int MIN_SHORTENING_THRESHOLD = 36;
|
||||
private static final String DOCS_NAME_SHORTENING_URL = "https://docs.cryptomator.org/en/1.7/security/architecture/#name-shortening";
|
||||
private static final String DOCS_NAME_SHORTENING_URL = "https://docs.cryptomator.org/security/architecture/#name-shortening";
|
||||
|
||||
private final Stage window;
|
||||
private final Lazy<Application> application;
|
||||
|
||||
@@ -40,7 +40,6 @@ 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.Optional;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -50,7 +49,7 @@ public class CreateNewVaultLocationController implements FxController {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CreateNewVaultLocationController.class);
|
||||
private static final Path DEFAULT_CUSTOM_VAULT_PATH = Paths.get(System.getProperty("user.home"));
|
||||
private static final String TEMP_FILE_FORMAT = ".locationTest.cryptomator.tmp";
|
||||
private static final String TEMP_FILE_PREFIX = ".locationTest.cryptomator";
|
||||
|
||||
private final Stage window;
|
||||
private final Lazy<Scene> chooseNameScene;
|
||||
@@ -126,16 +125,19 @@ public class CreateNewVaultLocationController implements FxController {
|
||||
|
||||
|
||||
private boolean isActuallyWritable(Path p) {
|
||||
Path tmpFile = p.resolve(TEMP_FILE_FORMAT);
|
||||
try (var chan = Files.newByteChannel(tmpFile, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE, StandardOpenOption.DELETE_ON_CLOSE)) {
|
||||
Path tmpDir = null;
|
||||
try {
|
||||
tmpDir = Files.createTempDirectory(p, TEMP_FILE_PREFIX );
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
Files.deleteIfExists(tmpFile);
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Unable to delete temporary file {}. Needs to be deleted manually.", tmpFile);
|
||||
if (tmpDir != null) {
|
||||
try {
|
||||
Files.deleteIfExists(tmpDir);
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Unable to delete temporary directory {}. Needs to be deleted manually.", tmpDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,8 +76,10 @@ public class ReadmeGenerator {
|
||||
input.chars().forEachOrdered(c -> {
|
||||
if (c < 128) {
|
||||
sb.append((char) c);
|
||||
} else if (c <= 0xFF) {
|
||||
sb.append("\\'").append(String.format("%02X", c));
|
||||
} else if (c < 0xFFFF) {
|
||||
sb.append("\\u").append(c);
|
||||
sb.append("\\uc1\\u").append(c);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ public enum FxmlFile {
|
||||
CONVERTVAULT_HUBTOPASSWORD_START("/fxml/convertvault_hubtopassword_start.fxml"), //
|
||||
CONVERTVAULT_HUBTOPASSWORD_CONVERT("/fxml/convertvault_hubtopassword_convert.fxml"), //
|
||||
CONVERTVAULT_HUBTOPASSWORD_SUCCESS("/fxml/convertvault_hubtopassword_success.fxml"), //
|
||||
DECRYPTNAMES("/fxml/decryptnames.fxml"), //
|
||||
ERROR("/fxml/error.fxml"), //
|
||||
EVENT_VIEW("/fxml/eventview.fxml"), //
|
||||
FORGET_PASSWORD("/fxml/forget_password.fxml"), //
|
||||
HEALTH_START("/fxml/health_start.fxml"), //
|
||||
HEALTH_CHECK_LIST("/fxml/health_check_list.fxml"), //
|
||||
|
||||
@@ -7,6 +7,7 @@ public enum FontAwesome5Icon {
|
||||
ANCHOR("\uF13D"), //
|
||||
ARROW_UP("\uF062"), //
|
||||
BAN("\uF05E"), //
|
||||
BELL("\uF0F3"), //
|
||||
BUG("\uF188"), //
|
||||
CARET_DOWN("\uF0D7"), //
|
||||
CARET_RIGHT("\uF0Da"), //
|
||||
@@ -15,10 +16,12 @@ public enum FontAwesome5Icon {
|
||||
CLIPBOARD("\uF328"), //
|
||||
COG("\uF013"), //
|
||||
COGS("\uF085"), //
|
||||
COMPRESS_ALT("\uF422"), //
|
||||
COPY("\uF0C5"), //
|
||||
CROWN("\uF521"), //
|
||||
DONATE("\uF4B9"), //
|
||||
EDIT("\uF044"), //
|
||||
ELLIPSIS_V("\uF142"), //
|
||||
EXCHANGE_ALT("\uF362"), //
|
||||
EXCLAMATION("\uF12A"), //
|
||||
EXCLAMATION_CIRCLE("\uF06A"), //
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
import org.cryptomator.ui.fxapp.FxApplicationWindows;
|
||||
import org.cryptomator.ui.keyloading.masterkeyfile.MasterkeyFileLoadingStrategy;
|
||||
import org.cryptomator.ui.recoverykey.RecoveryKeyFactory;
|
||||
import org.jetbrains.annotations.VisibleForTesting;
|
||||
import org.slf4j.Logger;
|
||||
@@ -108,6 +109,7 @@ public class HubToPasswordConvertController implements FxController {
|
||||
.thenRunAsync(this::convertInternal, backgroundExecutorService) //
|
||||
.whenCompleteAsync((result, exception) -> {
|
||||
if (exception == null) {
|
||||
vault.getVaultSettings().lastKnownKeyLoader.set(MasterkeyFileLoadingStrategy.SCHEME);
|
||||
LOG.info("Conversion of vault {} succeeded.", vault.getPath());
|
||||
window.setScene(successScene.get());
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.cryptomator.ui.decryptname;
|
||||
|
||||
import javafx.beans.property.ReadOnlyStringWrapper;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public record CipherAndCleartext(Path ciphertext, String cleartextName) {
|
||||
|
||||
public String getCiphertextFilename() {
|
||||
return ciphertext.getFileName().toString();
|
||||
}
|
||||
|
||||
public ObservableValue<String> ciphertextFilenameProperty() {
|
||||
return new ReadOnlyStringWrapper(getCiphertextFilename());
|
||||
}
|
||||
|
||||
public String getCleartextName() {
|
||||
return cleartextName;
|
||||
}
|
||||
|
||||
public ObservableValue<String> cleartextNameProperty() {
|
||||
return new ReadOnlyStringWrapper(getCleartextName());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
package org.cryptomator.ui.decryptname;
|
||||
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.cryptofs.common.Constants;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.controls.FontAwesome5Icon;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.ListProperty;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleListProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.input.Clipboard;
|
||||
import javafx.scene.input.DataFormat;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.KeyCodeCombination;
|
||||
import javafx.scene.input.TransferMode;
|
||||
import javafx.stage.FileChooser;
|
||||
import javafx.stage.Stage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@DecryptNameScoped
|
||||
public class DecryptFileNamesViewController implements FxController {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DecryptFileNamesViewController.class);
|
||||
private static final KeyCodeCombination COPY_TO_CLIPBOARD_SHORTCUT = new KeyCodeCombination(KeyCode.C, KeyCodeCombination.SHORTCUT_DOWN);
|
||||
private static final String COPY_TO_CLIPBOARD_SHORTCUT_STRING_WIN = "CTRL+C";
|
||||
private static final String COPY_TO_CLIPBOARD_SHORTCUT_STRING_MAC = "⌘C";
|
||||
private static final String COPY_TO_CLIPBOARD_SHORTCUT_STRING_LINUX = "CTRL+C";
|
||||
|
||||
private final ListProperty<CipherAndCleartext> mapping;
|
||||
private final StringProperty dropZoneText = new SimpleStringProperty();
|
||||
private final ObjectProperty<FontAwesome5Icon> dropZoneIcon = new SimpleObjectProperty<>();
|
||||
private final BooleanProperty wrongFilesSelected = new SimpleBooleanProperty(false);
|
||||
private final Stage window;
|
||||
private final Vault vault;
|
||||
private final ResourceBundle resourceBundle;
|
||||
private final List<Path> initialList;
|
||||
|
||||
@FXML
|
||||
public TableColumn<CipherAndCleartext, String> ciphertextColumn;
|
||||
@FXML
|
||||
public TableColumn<CipherAndCleartext, String> cleartextColumn;
|
||||
@FXML
|
||||
public TableView<CipherAndCleartext> cipherToCleartextTable;
|
||||
|
||||
@Inject
|
||||
public DecryptFileNamesViewController(@DecryptNameWindow Stage window, @DecryptNameWindow Vault vault, @DecryptNameWindow List<Path> pathsToDecrypt, ResourceBundle resourceBundle) {
|
||||
this.window = window;
|
||||
this.vault = vault;
|
||||
this.resourceBundle = resourceBundle;
|
||||
this.mapping = new SimpleListProperty<>(FXCollections.observableArrayList());
|
||||
this.initialList = pathsToDecrypt;
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void initialize() {
|
||||
cipherToCleartextTable.setItems(mapping);
|
||||
cipherToCleartextTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY_ALL_COLUMNS);
|
||||
//DragNDrop
|
||||
cipherToCleartextTable.setOnDragEntered(event -> {
|
||||
if (event.getGestureSource() == null && event.getDragboard().hasFiles()) {
|
||||
cipherToCleartextTable.setItems(FXCollections.emptyObservableList());
|
||||
}
|
||||
});
|
||||
cipherToCleartextTable.setOnDragOver(event -> {
|
||||
if (event.getGestureSource() == null && event.getDragboard().hasFiles()) {
|
||||
if (SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_MAC) {
|
||||
event.acceptTransferModes(TransferMode.LINK);
|
||||
} else {
|
||||
event.acceptTransferModes(TransferMode.ANY);
|
||||
}
|
||||
}
|
||||
});
|
||||
cipherToCleartextTable.setOnDragDropped(event -> {
|
||||
if (event.getGestureSource() == null && event.getDragboard().hasFiles()) {
|
||||
checkAndDecrypt(event.getDragboard().getFiles().stream().map(File::toPath).toList());
|
||||
cipherToCleartextTable.setItems(mapping);
|
||||
}
|
||||
});
|
||||
cipherToCleartextTable.setOnDragExited(_ -> cipherToCleartextTable.setItems(mapping));
|
||||
//selectionModel and copy-to-clipboard action
|
||||
cipherToCleartextTable.getSelectionModel().setCellSelectionEnabled(true);
|
||||
cipherToCleartextTable.setOnKeyPressed(keyEvent -> {
|
||||
if (COPY_TO_CLIPBOARD_SHORTCUT.match(keyEvent)) {
|
||||
copySingleCelltoClipboard();
|
||||
}
|
||||
});
|
||||
ciphertextColumn.setCellValueFactory(new PropertyValueFactory<>("ciphertextFilename"));
|
||||
cleartextColumn.setCellValueFactory(new PropertyValueFactory<>("cleartextName"));
|
||||
|
||||
dropZoneText.setValue(resourceBundle.getString("decryptNames.dropZone.message"));
|
||||
dropZoneIcon.setValue(FontAwesome5Icon.FILE_IMPORT);
|
||||
|
||||
wrongFilesSelected.addListener((_, _, areWrongFiles) -> {
|
||||
if (areWrongFiles) {
|
||||
CompletableFuture.delayedExecutor(5, TimeUnit.SECONDS, Platform::runLater).execute(() -> {
|
||||
dropZoneText.setValue(resourceBundle.getString("decryptNames.dropZone.message"));
|
||||
dropZoneIcon.setValue(FontAwesome5Icon.FILE_IMPORT);
|
||||
wrongFilesSelected.setValue(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!initialList.isEmpty()) {
|
||||
checkAndDecrypt(initialList);
|
||||
}
|
||||
}
|
||||
|
||||
private void copySingleCelltoClipboard() {
|
||||
cipherToCleartextTable.getSelectionModel().getSelectedCells().stream().findFirst().ifPresent(tablePosition -> {
|
||||
var selectedItem = cipherToCleartextTable.getSelectionModel().getSelectedItem();
|
||||
//TODO: give user feedback, if content is copied -> must be done via a custom cell factory to access the actual table cell!
|
||||
if (tablePosition.getTableColumn().equals(ciphertextColumn)) {
|
||||
Clipboard.getSystemClipboard().setContent(Map.of(DataFormat.PLAIN_TEXT, selectedItem.ciphertext().toString()));
|
||||
} else {
|
||||
Clipboard.getSystemClipboard().setContent(Map.of(DataFormat.PLAIN_TEXT, selectedItem.cleartextName()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void selectFiles() {
|
||||
var fileChooser = new FileChooser();
|
||||
fileChooser.setTitle(resourceBundle.getString("decryptNames.filePicker.title"));
|
||||
fileChooser.setSelectedExtensionFilter(new FileChooser.ExtensionFilter(resourceBundle.getString("decryptNames.filePicker.extensionDescription"), List.of("*.c9r")));
|
||||
fileChooser.setInitialDirectory(vault.getPath().toFile());
|
||||
var ciphertextNodes = fileChooser.showOpenMultipleDialog(window);
|
||||
if (ciphertextNodes != null) {
|
||||
checkAndDecrypt(ciphertextNodes.stream().map(File::toPath).toList());
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAndDecrypt(List<Path> pathsToDecrypt) {
|
||||
mapping.clear();
|
||||
//Assumption: All files are in the same directory
|
||||
var testPath = pathsToDecrypt.getFirst();
|
||||
if (!testPath.startsWith(vault.getPath())) {
|
||||
setDropZoneError(resourceBundle.getString("decryptNames.dropZone.error.foreignFiles").formatted(vault.getDisplayName()));
|
||||
return;
|
||||
}
|
||||
if (pathsToDecrypt.size() == 1 && testPath.endsWith(Constants.DIR_ID_BACKUP_FILE_NAME)) {
|
||||
setDropZoneError(resourceBundle.getString("decryptNames.dropZone.error.vaultInternalFiles"));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var newMapping = pathsToDecrypt.stream().filter(p -> !p.endsWith(Constants.DIR_ID_BACKUP_FILE_NAME)).map(this::getCleartextName).toList();
|
||||
mapping.addAll(newMapping);
|
||||
} catch (UncheckedIOException e) {
|
||||
setDropZoneError(resourceBundle.getString("decryptNames.dropZone.error.generic"));
|
||||
LOG.info("Failed to decrypt filenames for directory {}", testPath.getParent(), e);
|
||||
} catch (IllegalArgumentException e) {
|
||||
setDropZoneError(resourceBundle.getString("decryptNames.dropZone.error.vaultInternalFiles"));
|
||||
} catch (UnsupportedOperationException e) {
|
||||
setDropZoneError(resourceBundle.getString("decryptNames.dropZone.error.noDirIdBackup"));
|
||||
}
|
||||
}
|
||||
|
||||
private void setDropZoneError(String text) {
|
||||
dropZoneIcon.setValue(FontAwesome5Icon.TIMES);
|
||||
dropZoneText.setValue(text);
|
||||
wrongFilesSelected.setValue(true);
|
||||
}
|
||||
|
||||
private CipherAndCleartext getCleartextName(Path ciphertextNode) {
|
||||
try {
|
||||
var cleartextName = vault.getCleartextName(ciphertextNode);
|
||||
return new CipherAndCleartext(ciphertextNode, cleartextName);
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
//obvservable getter
|
||||
|
||||
public ObservableValue<String> dropZoneTextProperty() {
|
||||
return dropZoneText;
|
||||
}
|
||||
|
||||
public String getDropZoneText() {
|
||||
return dropZoneText.get();
|
||||
}
|
||||
|
||||
public ObservableValue<FontAwesome5Icon> dropZoneIconProperty() {
|
||||
return dropZoneIcon;
|
||||
}
|
||||
|
||||
public FontAwesome5Icon getDropZoneIcon() {
|
||||
return dropZoneIcon.get();
|
||||
}
|
||||
|
||||
public void clearTable() {
|
||||
mapping.clear();
|
||||
}
|
||||
|
||||
public void copyTableToClipboard() {
|
||||
var csv = mapping.stream().map(cipherAndClear -> "\"" + cipherAndClear.ciphertext() + "\", \"" + cipherAndClear.cleartextName() + "\"").collect(Collectors.joining("\n"));
|
||||
Clipboard.getSystemClipboard().setContent(Map.of(DataFormat.PLAIN_TEXT, csv));
|
||||
}
|
||||
|
||||
public String getCopyToClipboardShortcutString() {
|
||||
if (SystemUtils.IS_OS_WINDOWS) {
|
||||
return COPY_TO_CLIPBOARD_SHORTCUT_STRING_WIN;
|
||||
} else if (SystemUtils.IS_OS_MAC) {
|
||||
return COPY_TO_CLIPBOARD_SHORTCUT_STRING_MAC;
|
||||
} else {
|
||||
return COPY_TO_CLIPBOARD_SHORTCUT_STRING_LINUX;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.cryptomator.ui.decryptname;
|
||||
|
||||
import dagger.BindsInstance;
|
||||
import dagger.Lazy;
|
||||
import dagger.Subcomponent;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.common.vaults.VaultState;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
@DecryptNameScoped
|
||||
@Subcomponent(modules = DecryptNameModule.class)
|
||||
public interface DecryptNameComponent {
|
||||
|
||||
Logger LOG = LoggerFactory.getLogger(DecryptNameComponent.class);
|
||||
|
||||
@DecryptNameWindow
|
||||
Stage window();
|
||||
|
||||
@FxmlScene(FxmlFile.DECRYPTNAMES)
|
||||
Lazy<Scene> decryptNamesView();
|
||||
|
||||
@DecryptNameWindow
|
||||
Vault vault();
|
||||
|
||||
default void showDecryptFileNameWindow() {
|
||||
Stage s = window();
|
||||
s.setScene(decryptNamesView().get());
|
||||
s.sizeToScene();
|
||||
if (vault().isUnlocked()) {
|
||||
s.show();
|
||||
} else {
|
||||
LOG.error("Aborted showing DecryptFileName window: vault state is not {}, but {}.", VaultState.Value.UNLOCKED, vault().getState());
|
||||
}
|
||||
}
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
|
||||
DecryptNameComponent create(@BindsInstance @DecryptNameWindow Vault vault, @BindsInstance @Named("windowOwner") Stage owner, @BindsInstance @DecryptNameWindow List<Path> pathsToDecrypt);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.cryptomator.ui.decryptname;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import dagger.multibindings.IntoMap;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.DefaultSceneFactory;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.common.FxControllerKey;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlLoaderFactory;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
import org.cryptomator.ui.common.StageFactory;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Provider;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Modality;
|
||||
import javafx.stage.Stage;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@Module
|
||||
public abstract class DecryptNameModule {
|
||||
|
||||
@Provides
|
||||
@DecryptNameScoped
|
||||
@DecryptNameWindow
|
||||
static Stage provideStage(StageFactory factory, @Named("windowOwner") Stage owner, @DecryptNameWindow Vault vault, ResourceBundle resourceBundle) {
|
||||
Stage stage = factory.create();
|
||||
stage.setResizable(true);
|
||||
stage.initModality(Modality.WINDOW_MODAL);
|
||||
stage.initOwner(owner);
|
||||
stage.setTitle(resourceBundle.getString("decryptNames.title"));
|
||||
vault.stateProperty().addListener(((_, _, _) -> stage.close())); //as soon as the state changes from unlocked, close the window
|
||||
return stage;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@DecryptNameScoped
|
||||
@DecryptNameWindow
|
||||
static FxmlLoaderFactory provideFxmlLoaderFactory(Map<Class<? extends FxController>, Provider<FxController>> factories, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle) {
|
||||
return new FxmlLoaderFactory(factories, sceneFactory, resourceBundle);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.DECRYPTNAMES)
|
||||
@DecryptNameScoped
|
||||
static Scene provideDecryptNamesViewScene(@DecryptNameWindow FxmlLoaderFactory fxmlLoaders) {
|
||||
return fxmlLoaders.createScene(FxmlFile.DECRYPTNAMES);
|
||||
}
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@FxControllerKey(DecryptFileNamesViewController.class)
|
||||
abstract FxController bindDecryptNamesViewController(DecryptFileNamesViewController controller);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.cryptomator.ui.decryptname;
|
||||
|
||||
import javax.inject.Scope;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Scope
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface DecryptNameScoped {}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.cryptomator.ui.decryptname;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
@interface DecryptNameWindow {}
|
||||
@@ -2,31 +2,34 @@ package org.cryptomator.ui.dialogs;
|
||||
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.StageFactory;
|
||||
import org.cryptomator.ui.controls.FontAwesome5Icon;
|
||||
import org.cryptomator.ui.fxapp.FxApplicationScoped;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.stage.Stage;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Singleton
|
||||
@FxApplicationScoped
|
||||
public class Dialogs {
|
||||
|
||||
private final ResourceBundle resourceBundle;
|
||||
private final StageFactory stageFactory;
|
||||
|
||||
@Inject
|
||||
public Dialogs(ResourceBundle resourceBundle) {
|
||||
public Dialogs(ResourceBundle resourceBundle, StageFactory stageFactory) {
|
||||
this.resourceBundle = resourceBundle;
|
||||
this.stageFactory = stageFactory;
|
||||
}
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(Dialogs.class);
|
||||
|
||||
private SimpleDialog.Builder createDialogBuilder() {
|
||||
return new SimpleDialog.Builder(resourceBundle);
|
||||
return new SimpleDialog.Builder(resourceBundle, stageFactory);
|
||||
}
|
||||
|
||||
public SimpleDialog.Builder prepareRemoveVaultDialog(Stage window, Vault vault, ObservableList<Vault> vaults) {
|
||||
@@ -35,7 +38,7 @@ public class Dialogs {
|
||||
.setMessageKey("removeVault.message") //
|
||||
.setDescriptionKey("removeVault.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setOkButtonKey("removeVault.confirmBtn") //
|
||||
.setOkButtonKey("generic.button.remove") //
|
||||
.setCancelButtonKey("generic.button.cancel") //
|
||||
.setOkAction(stage -> {
|
||||
LOG.debug("Removing vault {}.", vault.getDisplayName());
|
||||
@@ -51,7 +54,7 @@ public class Dialogs {
|
||||
.setMessageKey("removeCert.message") //
|
||||
.setDescriptionKey("removeCert.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setOkButtonKey("removeCert.confirmBtn") //
|
||||
.setOkButtonKey("generic.button.remove") //
|
||||
.setCancelButtonKey("generic.button.cancel") //
|
||||
.setOkAction(stage -> {
|
||||
settings.licenseKey.set(null);
|
||||
@@ -65,11 +68,23 @@ public class Dialogs {
|
||||
.setTitleKey("dokanySupportEnd.title") //
|
||||
.setMessageKey("dokanySupportEnd.message") //
|
||||
.setDescriptionKey("dokanySupportEnd.description") //
|
||||
.setIcon(FontAwesome5Icon.QUESTION) //
|
||||
.setIcon(FontAwesome5Icon.EXCLAMATION) //
|
||||
.setOkButtonKey("generic.button.close") //
|
||||
.setCancelButtonKey("dokanySupportEnd.preferencesBtn") //
|
||||
.setOkAction(Stage::close) //
|
||||
.setCancelAction(cancelAction);
|
||||
}
|
||||
|
||||
public SimpleDialog.Builder prepareRetryIfReadonlyDialog(Stage window, Consumer<Stage> okAction) {
|
||||
return createDialogBuilder() //
|
||||
.setOwner(window) //
|
||||
.setTitleKey("retryIfReadonly.title") //
|
||||
.setMessageKey("retryIfReadonly.message") //
|
||||
.setDescriptionKey("retryIfReadonly.description") //
|
||||
.setIcon(FontAwesome5Icon.EXCLAMATION) //
|
||||
.setOkButtonKey("retryIfReadonly.retry") //
|
||||
.setCancelButtonKey("generic.button.close") //
|
||||
.setOkAction(okAction) //
|
||||
.setCancelAction(Stage::close);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.cryptomator.ui.dialogs;
|
||||
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlLoaderFactory;
|
||||
import org.cryptomator.ui.common.StageFactory;
|
||||
import org.cryptomator.ui.controls.FontAwesome5Icon;
|
||||
|
||||
import javafx.scene.Scene;
|
||||
@@ -17,24 +18,24 @@ import java.util.function.Consumer;
|
||||
public class SimpleDialog {
|
||||
|
||||
private final ResourceBundle resourceBundle;
|
||||
|
||||
private final Stage dialogStage;
|
||||
|
||||
SimpleDialog(Builder builder) throws IOException {
|
||||
this.resourceBundle = builder.resourceBundle;
|
||||
dialogStage = new Stage();
|
||||
dialogStage = builder.stageFactory.create();
|
||||
dialogStage.initOwner(builder.owner);
|
||||
dialogStage.initModality(Modality.WINDOW_MODAL);
|
||||
dialogStage.setTitle(resolveText(builder.titleKey, builder.titleArgs));
|
||||
dialogStage.setResizable(false);
|
||||
|
||||
FxmlLoaderFactory loaderFactory = FxmlLoaderFactory.forController(
|
||||
new SimpleDialogController(resolveText(builder.messageKey, null),
|
||||
resolveText(builder.descriptionKey, null),
|
||||
builder.icon,resolveText(builder.okButtonKey, null),
|
||||
resolveText(builder.cancelButtonKey, null),
|
||||
() -> builder.okAction.accept(dialogStage),
|
||||
() -> builder.cancelAction.accept(dialogStage)),
|
||||
FxmlLoaderFactory loaderFactory = FxmlLoaderFactory.forController( //
|
||||
new SimpleDialogController(resolveText(builder.messageKey, null), //
|
||||
resolveText(builder.descriptionKey, null), //
|
||||
builder.icon, //
|
||||
resolveText(builder.okButtonKey, null), //
|
||||
builder.cancelButtonKey != null ? resolveText(builder.cancelButtonKey, null) : null, //
|
||||
() -> builder.okAction.accept(dialogStage), //
|
||||
() -> builder.cancelAction.accept(dialogStage)), //
|
||||
Scene::new, builder.resourceBundle);
|
||||
|
||||
dialogStage.setScene(new Scene(loaderFactory.load(FxmlFile.SIMPLE_DIALOG.getRessourcePathString()).getRoot()));
|
||||
@@ -60,19 +61,20 @@ public class SimpleDialog {
|
||||
|
||||
private Stage owner;
|
||||
private final ResourceBundle resourceBundle;
|
||||
private final StageFactory stageFactory;
|
||||
private String titleKey;
|
||||
private String[] titleArgs;
|
||||
private String messageKey;
|
||||
private String descriptionKey;
|
||||
private String okButtonKey;
|
||||
private String cancelButtonKey;
|
||||
|
||||
private FontAwesome5Icon icon;
|
||||
private Consumer<Stage> okAction = Stage::close;
|
||||
private Consumer<Stage> cancelAction = Stage::close;
|
||||
|
||||
public Builder(ResourceBundle resourceBundle) {
|
||||
public Builder(ResourceBundle resourceBundle, StageFactory stageFactory) {
|
||||
this.resourceBundle = resourceBundle;
|
||||
this.stageFactory = stageFactory;
|
||||
}
|
||||
|
||||
public Builder setOwner(Stage owner) {
|
||||
@@ -122,11 +124,10 @@ public class SimpleDialog {
|
||||
}
|
||||
|
||||
public SimpleDialog build() {
|
||||
Objects.requireNonNull(titleKey,"SimpleDialog titleKey must be set.");
|
||||
Objects.requireNonNull(messageKey,"SimpleDialog messageKey must be set.");
|
||||
Objects.requireNonNull(descriptionKey,"SimpleDialog descriptionKey must be set.");
|
||||
Objects.requireNonNull(okButtonKey,"SimpleDialog okButtonKey must be set.");
|
||||
Objects.requireNonNull(cancelButtonKey,"SimpleDialog cancelButtonKey must be set.");
|
||||
Objects.requireNonNull(titleKey, "SimpleDialog titleKey must be set.");
|
||||
Objects.requireNonNull(messageKey, "SimpleDialog messageKey must be set.");
|
||||
Objects.requireNonNull(descriptionKey, "SimpleDialog descriptionKey must be set.");
|
||||
Objects.requireNonNull(okButtonKey, "SimpleDialog okButtonKey must be set.");
|
||||
|
||||
try {
|
||||
return new SimpleDialog(this);
|
||||
|
||||
@@ -14,6 +14,7 @@ public class SimpleDialogController implements FxController {
|
||||
private final String cancelButtonText;
|
||||
private final Runnable okAction;
|
||||
private final Runnable cancelAction;
|
||||
private final boolean cancelButtonVisible;
|
||||
|
||||
public SimpleDialogController(String message, String description, FontAwesome5Icon icon, String okButtonText, String cancelButtonText, Runnable okAction, Runnable cancelAction) {
|
||||
this.message = message;
|
||||
@@ -23,6 +24,11 @@ public class SimpleDialogController implements FxController {
|
||||
this.cancelButtonText = cancelButtonText;
|
||||
this.okAction = okAction;
|
||||
this.cancelAction = cancelAction;
|
||||
this.cancelButtonVisible = cancelButtonText != null && !cancelButtonText.isEmpty();
|
||||
}
|
||||
|
||||
public boolean isCancelButtonVisible() {
|
||||
return cancelButtonVisible;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
|
||||
@@ -0,0 +1,329 @@
|
||||
package org.cryptomator.ui.eventview;
|
||||
|
||||
import org.cryptomator.event.FSEventBucket;
|
||||
import org.cryptomator.event.FSEventBucketContent;
|
||||
import org.cryptomator.event.FileSystemEventAggregator;
|
||||
import org.cryptomator.common.Nullable;
|
||||
import org.cryptomator.common.ObservableUtil;
|
||||
import org.cryptomator.cryptofs.CryptoPath;
|
||||
import org.cryptomator.cryptofs.event.BrokenDirFileEvent;
|
||||
import org.cryptomator.cryptofs.event.BrokenFileNodeEvent;
|
||||
import org.cryptomator.cryptofs.event.ConflictResolutionFailedEvent;
|
||||
import org.cryptomator.cryptofs.event.ConflictResolvedEvent;
|
||||
import org.cryptomator.cryptofs.event.DecryptionFailedEvent;
|
||||
import org.cryptomator.integrations.revealpath.RevealFailedException;
|
||||
import org.cryptomator.integrations.revealpath.RevealPathService;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.controls.FontAwesome5Icon;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.geometry.Side;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ContextMenu;
|
||||
import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.control.Tooltip;
|
||||
import javafx.scene.input.Clipboard;
|
||||
import javafx.scene.input.ClipboardContent;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.util.Duration;
|
||||
import java.nio.file.Path;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.FormatStyle;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class EventListCellController implements FxController {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(EventListCellController.class);
|
||||
private static final DateTimeFormatter LOCAL_DATE_FORMATTER = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT).withZone(ZoneId.systemDefault());
|
||||
private static final DateTimeFormatter LOCAL_TIME_FORMATTER = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT).withZone(ZoneId.systemDefault());
|
||||
|
||||
private final FileSystemEventAggregator fileSystemEventAggregator;
|
||||
@Nullable
|
||||
private final RevealPathService revealService;
|
||||
private final ResourceBundle resourceBundle;
|
||||
private final ObjectProperty<Map.Entry<FSEventBucket, FSEventBucketContent>> eventEntry;
|
||||
private final StringProperty eventMessage;
|
||||
private final StringProperty eventDescription;
|
||||
private final ObjectProperty<FontAwesome5Icon> eventIcon;
|
||||
private final ObservableValue<String> eventCount;
|
||||
private final ObservableValue<Boolean> vaultUnlocked;
|
||||
private final ObservableValue<String> readableTime;
|
||||
private final ObservableValue<String> readableDate;
|
||||
private final ObservableValue<String> message;
|
||||
private final ObservableValue<String> description;
|
||||
private final ObservableValue<FontAwesome5Icon> icon;
|
||||
private final BooleanProperty actionsButtonVisible;
|
||||
private final Tooltip eventTooltip;
|
||||
|
||||
@FXML
|
||||
HBox root;
|
||||
@FXML
|
||||
ContextMenu eventActionsMenu;
|
||||
@FXML
|
||||
Button eventActionsButton;
|
||||
|
||||
@Inject
|
||||
public EventListCellController(FileSystemEventAggregator fileSystemEventAggregator, Optional<RevealPathService> revealService, ResourceBundle resourceBundle) {
|
||||
this.fileSystemEventAggregator = fileSystemEventAggregator;
|
||||
this.revealService = revealService.orElseGet(() -> null);
|
||||
this.resourceBundle = resourceBundle;
|
||||
this.eventEntry = new SimpleObjectProperty<>(null);
|
||||
this.eventMessage = new SimpleStringProperty();
|
||||
this.eventDescription = new SimpleStringProperty();
|
||||
this.eventIcon = new SimpleObjectProperty<>();
|
||||
this.eventCount = ObservableUtil.mapWithDefault(eventEntry, e -> e.getValue().count() == 1? "" : "("+ e.getValue().count() +")", "");
|
||||
this.vaultUnlocked = ObservableUtil.mapWithDefault(eventEntry.flatMap(e -> e.getKey().vault().unlockedProperty()), Function.identity(), false);
|
||||
this.readableTime = ObservableUtil.mapWithDefault(eventEntry, e -> LOCAL_TIME_FORMATTER.format(e.getValue().mostRecentEvent().getTimestamp()), "");
|
||||
this.readableDate = ObservableUtil.mapWithDefault(eventEntry, e -> LOCAL_DATE_FORMATTER.format(e.getValue().mostRecentEvent().getTimestamp()), "");
|
||||
this.message = Bindings.createStringBinding(this::selectMessage, vaultUnlocked, eventMessage);
|
||||
this.description = Bindings.createStringBinding(this::selectDescription, vaultUnlocked, eventDescription);
|
||||
this.icon = Bindings.createObjectBinding(this::selectIcon, vaultUnlocked, eventIcon);
|
||||
this.actionsButtonVisible = new SimpleBooleanProperty();
|
||||
this.eventTooltip = new Tooltip();
|
||||
eventTooltip.setShowDelay(Duration.millis(500.0));
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void initialize() {
|
||||
actionsButtonVisible.bind(Bindings.createBooleanBinding(this::determineActionsButtonVisibility, root.hoverProperty(), eventActionsMenu.showingProperty(), vaultUnlocked));
|
||||
vaultUnlocked.addListener((_, _, newValue) -> eventActionsMenu.hide());
|
||||
Tooltip.install(root, eventTooltip);
|
||||
}
|
||||
|
||||
private boolean determineActionsButtonVisibility() {
|
||||
return vaultUnlocked.getValue() && (eventActionsMenu.isShowing() || root.isHover());
|
||||
}
|
||||
|
||||
public void setEventEntry(@NotNull Map.Entry<FSEventBucket, FSEventBucketContent> item) {
|
||||
eventEntry.set(item);
|
||||
eventActionsMenu.hide();
|
||||
eventActionsMenu.getItems().clear();
|
||||
eventTooltip.setText(item.getKey().vault().getDisplayName());
|
||||
addAction("generic.action.dismiss", () -> {
|
||||
fileSystemEventAggregator.remove(item.getKey());
|
||||
});
|
||||
switch (item.getValue().mostRecentEvent()) {
|
||||
case ConflictResolvedEvent fse -> this.adjustToConflictResolvedEvent(fse);
|
||||
case ConflictResolutionFailedEvent fse -> this.adjustToConflictEvent(fse);
|
||||
case DecryptionFailedEvent fse -> this.adjustToDecryptionFailedEvent(fse);
|
||||
case BrokenDirFileEvent fse -> this.adjustToBrokenDirFileEvent(fse);
|
||||
case BrokenFileNodeEvent fse -> this.adjustToBrokenFileNodeEvent(fse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void adjustToBrokenFileNodeEvent(BrokenFileNodeEvent bfe) {
|
||||
eventIcon.setValue(FontAwesome5Icon.TIMES);
|
||||
eventMessage.setValue(resourceBundle.getString("eventView.entry.brokenFileNode.message"));
|
||||
eventDescription.setValue(bfe.ciphertextPath().getFileName().toString());
|
||||
if (revealService != null) {
|
||||
addAction("eventView.entry.brokenFileNode.showEncrypted", () -> reveal(revealService, convertVaultPathToSystemPath(bfe.ciphertextPath())));
|
||||
} else {
|
||||
addAction("eventView.entry.brokenFileNode.copyEncrypted", () -> copyToClipboard(convertVaultPathToSystemPath(bfe.ciphertextPath()).toString()));
|
||||
}
|
||||
addAction("eventView.entry.brokenFileNode.copyDecrypted", () -> copyToClipboard(convertVaultPathToSystemPath(bfe.cleartextPath()).toString()));
|
||||
}
|
||||
|
||||
private void adjustToConflictResolvedEvent(ConflictResolvedEvent cre) {
|
||||
eventIcon.setValue(FontAwesome5Icon.CHECK);
|
||||
eventMessage.setValue(resourceBundle.getString("eventView.entry.conflictResolved.message"));
|
||||
eventDescription.setValue(cre.resolvedCiphertextPath().getFileName().toString());
|
||||
if (revealService != null) {
|
||||
addAction("eventView.entry.conflictResolved.showDecrypted", () -> reveal(revealService, convertVaultPathToSystemPath(cre.resolvedCleartextPath())));
|
||||
} else {
|
||||
addAction("eventView.entry.conflictResolved.copyDecrypted", () -> copyToClipboard(convertVaultPathToSystemPath(cre.resolvedCleartextPath()).toString()));
|
||||
}
|
||||
}
|
||||
|
||||
private void adjustToConflictEvent(ConflictResolutionFailedEvent cfe) {
|
||||
eventIcon.setValue(FontAwesome5Icon.COMPRESS_ALT);
|
||||
eventMessage.setValue(resourceBundle.getString("eventView.entry.conflict.message"));
|
||||
eventDescription.setValue(cfe.conflictingCiphertextPath().getFileName().toString());
|
||||
if (revealService != null) {
|
||||
addAction("eventView.entry.conflict.showDecrypted", () -> reveal(revealService, convertVaultPathToSystemPath(cfe.canonicalCleartextPath())));
|
||||
addAction("eventView.entry.conflict.showEncrypted", () -> reveal(revealService, cfe.conflictingCiphertextPath()));
|
||||
} else {
|
||||
addAction("eventView.entry.conflict.copyDecrypted", () -> copyToClipboard(convertVaultPathToSystemPath(cfe.canonicalCleartextPath()).toString()));
|
||||
addAction("eventView.entry.conflict.copyEncrypted", () -> copyToClipboard(cfe.conflictingCiphertextPath().toString()));
|
||||
}
|
||||
}
|
||||
|
||||
private void adjustToDecryptionFailedEvent(DecryptionFailedEvent dfe) {
|
||||
eventIcon.setValue(FontAwesome5Icon.BAN);
|
||||
eventMessage.setValue(resourceBundle.getString("eventView.entry.decryptionFailed.message"));
|
||||
eventDescription.setValue(dfe.ciphertextPath().getFileName().toString());
|
||||
if (revealService != null) {
|
||||
addAction("eventView.entry.decryptionFailed.showEncrypted", () -> reveal(revealService, dfe.ciphertextPath()));
|
||||
} else {
|
||||
addAction("eventView.entry.decryptionFailed.copyEncrypted", () -> copyToClipboard(dfe.ciphertextPath().toString()));
|
||||
}
|
||||
}
|
||||
|
||||
private void adjustToBrokenDirFileEvent(BrokenDirFileEvent bde) {
|
||||
eventIcon.setValue(FontAwesome5Icon.TIMES);
|
||||
eventMessage.setValue(resourceBundle.getString("eventView.entry.brokenDirFile.message"));
|
||||
eventDescription.setValue(bde.ciphertextPath().getParent().getFileName().toString());
|
||||
if (revealService != null) {
|
||||
addAction("eventView.entry.brokenDirFile.showEncrypted", () -> reveal(revealService, bde.ciphertextPath()));
|
||||
} else {
|
||||
addAction("eventView.entry.brokenDirFile.copyEncrypted", () -> copyToClipboard(bde.ciphertextPath().toString()));
|
||||
}
|
||||
}
|
||||
|
||||
private void addAction(String localizationKey, Runnable action) {
|
||||
var entry = new MenuItem(resourceBundle.getString(localizationKey));
|
||||
entry.getStyleClass().addLast("dropdown-button-context-menu-item");
|
||||
entry.setOnAction(_ -> action.run());
|
||||
eventActionsMenu.getItems().addLast(entry);
|
||||
}
|
||||
|
||||
|
||||
private FontAwesome5Icon selectIcon() {
|
||||
if (vaultUnlocked.getValue()) {
|
||||
return eventIcon.getValue();
|
||||
} else {
|
||||
return FontAwesome5Icon.LOCK;
|
||||
}
|
||||
}
|
||||
|
||||
private String selectMessage() {
|
||||
if (vaultUnlocked.getValue()) {
|
||||
return eventMessage.getValue();
|
||||
} else {
|
||||
return "***********";
|
||||
}
|
||||
}
|
||||
|
||||
private String selectDescription() {
|
||||
if (vaultUnlocked.getValue()) {
|
||||
return eventDescription.getValue();
|
||||
} else if (eventEntry.getValue() != null) {
|
||||
var e = eventEntry.getValue().getKey();
|
||||
return resourceBundle.getString("eventView.entry.vaultLocked.description").formatted(e != null ? e.vault().getDisplayName() : "");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@FXML
|
||||
public void toggleEventActionsMenu() {
|
||||
var e = eventEntry.get();
|
||||
if (e != null) {
|
||||
if (eventActionsMenu.isShowing()) {
|
||||
eventActionsMenu.hide();
|
||||
} else {
|
||||
eventActionsMenu.show(eventActionsButton, Side.BOTTOM, 0.0, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Path convertVaultPathToSystemPath(Path p) {
|
||||
if (!(p instanceof CryptoPath)) {
|
||||
throw new IllegalArgumentException("Path " + p + " is not a vault path");
|
||||
}
|
||||
var v = eventEntry.getValue().getKey().vault();
|
||||
if (!v.isUnlocked()) {
|
||||
return Path.of(System.getProperty("user.home"));
|
||||
}
|
||||
|
||||
var mountUri = v.getMountPoint().uri();
|
||||
var internalPath = p.toString().substring(1);
|
||||
return Path.of(mountUri.getPath().concat(internalPath).substring(1));
|
||||
}
|
||||
|
||||
private void reveal(RevealPathService s, Path p) {
|
||||
try {
|
||||
s.reveal(p);
|
||||
} catch (RevealFailedException e) {
|
||||
LOG.warn("Failed to show path {}", p, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void copyToClipboard(String s) {
|
||||
var content = new ClipboardContent();
|
||||
content.putString(s);
|
||||
Clipboard.getSystemClipboard().setContent(content);
|
||||
}
|
||||
|
||||
//-- property accessors --
|
||||
public ObservableValue<String> messageProperty() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<String> countProperty() {
|
||||
return eventCount;
|
||||
}
|
||||
|
||||
public String getCount() {
|
||||
return eventCount.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<String> descriptionProperty() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<FontAwesome5Icon> iconProperty() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public FontAwesome5Icon getIcon() {
|
||||
return icon.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<Boolean> actionsButtonVisibleProperty() {
|
||||
return actionsButtonVisible;
|
||||
}
|
||||
|
||||
public boolean isActionsButtonVisible() {
|
||||
return actionsButtonVisible.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<String> eventLocalTimeProperty() {
|
||||
return readableTime;
|
||||
}
|
||||
|
||||
public String getEventLocalTime() {
|
||||
return readableTime.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<String> eventLocalDateProperty() {
|
||||
return readableDate;
|
||||
}
|
||||
|
||||
public String getEventLocalDate() {
|
||||
return readableDate.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<Boolean> vaultUnlockedProperty() {
|
||||
return vaultUnlocked;
|
||||
}
|
||||
|
||||
public boolean isVaultUnlocked() {
|
||||
return vaultUnlocked.getValue();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.cryptomator.ui.eventview;
|
||||
|
||||
import org.cryptomator.event.FSEventBucket;
|
||||
import org.cryptomator.event.FSEventBucketContent;
|
||||
import org.cryptomator.ui.common.FxmlLoaderFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.ContentDisplay;
|
||||
import javafx.scene.control.ListCell;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.util.Callback;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Map;
|
||||
|
||||
@EventViewScoped
|
||||
public class EventListCellFactory implements Callback<ListView<Map.Entry<FSEventBucket, FSEventBucketContent>>, ListCell<Map.Entry<FSEventBucket, FSEventBucketContent>>> {
|
||||
|
||||
private static final String FXML_PATH = "/fxml/eventview_cell.fxml";
|
||||
|
||||
private final FxmlLoaderFactory fxmlLoaders;
|
||||
|
||||
@Inject
|
||||
EventListCellFactory(@EventViewWindow FxmlLoaderFactory fxmlLoaders) {
|
||||
this.fxmlLoaders = fxmlLoaders;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ListCell<Map.Entry<FSEventBucket, FSEventBucketContent>> call(ListView<Map.Entry<FSEventBucket, FSEventBucketContent>> eventListView) {
|
||||
try {
|
||||
FXMLLoader fxmlLoader = fxmlLoaders.load(FXML_PATH);
|
||||
return new Cell(fxmlLoader.getRoot(), fxmlLoader.getController());
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException("Failed to load %s.".formatted(FXML_PATH), e);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Cell extends ListCell<Map.Entry<FSEventBucket, FSEventBucketContent>> {
|
||||
|
||||
private final Parent root;
|
||||
private final EventListCellController controller;
|
||||
|
||||
public Cell(Parent root, EventListCellController controller) {
|
||||
this.root = root;
|
||||
this.controller = controller;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateItem(Map.Entry<FSEventBucket, FSEventBucketContent> item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
|
||||
if (empty || item == null) {
|
||||
setGraphic(null);
|
||||
this.getStyleClass().remove("list-cell");
|
||||
} else {
|
||||
this.getStyleClass().addLast("list-cell");
|
||||
setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
|
||||
setGraphic(root);
|
||||
controller.setEventEntry(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.cryptomator.ui.eventview;
|
||||
|
||||
import dagger.Lazy;
|
||||
import dagger.Subcomponent;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
@EventViewScoped
|
||||
@Subcomponent(modules = {EventViewModule.class})
|
||||
public interface EventViewComponent {
|
||||
|
||||
@EventViewWindow
|
||||
Stage window();
|
||||
|
||||
@FxmlScene(FxmlFile.EVENT_VIEW)
|
||||
Lazy<Scene> scene();
|
||||
|
||||
default Stage showEventViewerWindow() {
|
||||
Stage stage = window();
|
||||
stage.setScene(scene().get());
|
||||
stage.sizeToScene();
|
||||
stage.show();
|
||||
stage.requestFocus();
|
||||
return stage;
|
||||
}
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
|
||||
EventViewComponent create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package org.cryptomator.ui.eventview;
|
||||
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.event.FSEventBucket;
|
||||
import org.cryptomator.event.FSEventBucketContent;
|
||||
import org.cryptomator.event.FileSystemEventAggregator;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.fxapp.FxFSEventList;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.collections.transformation.FilteredList;
|
||||
import javafx.collections.transformation.SortedList;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.util.StringConverter;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@EventViewScoped
|
||||
public class EventViewController implements FxController {
|
||||
|
||||
private final FilteredList<Map.Entry<FSEventBucket, FSEventBucketContent>> filteredEventList;
|
||||
private final ObservableList<Vault> vaults;
|
||||
private final FileSystemEventAggregator aggregator;
|
||||
private final SortedList<Map.Entry<FSEventBucket, FSEventBucketContent>> sortedEventList;
|
||||
private final ObservableList<Vault> choiceBoxEntries;
|
||||
private final ResourceBundle resourceBundle;
|
||||
private final EventListCellFactory cellFactory;
|
||||
|
||||
@FXML
|
||||
ChoiceBox<Vault> vaultFilterChoiceBox;
|
||||
@FXML
|
||||
ListView<Map.Entry<FSEventBucket, FSEventBucketContent>> eventListView;
|
||||
|
||||
@Inject
|
||||
public EventViewController(FxFSEventList fxFSEventList, ObservableList<Vault> vaults, ResourceBundle resourceBundle, EventListCellFactory cellFactory, FileSystemEventAggregator aggregator) {
|
||||
this.filteredEventList = fxFSEventList.getObservableList().filtered(_ -> true);
|
||||
this.vaults = vaults;
|
||||
this.aggregator = aggregator;
|
||||
this.sortedEventList = new SortedList<>(filteredEventList, this::compareBuckets);
|
||||
this.choiceBoxEntries = FXCollections.observableArrayList();
|
||||
this.resourceBundle = resourceBundle;
|
||||
this.cellFactory = cellFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparison method for the lru cache. During comparsion the map is accessed.
|
||||
* First the entries are compared by the event timestamp, then vaultId, then identifying path and lastly by class name.
|
||||
*
|
||||
* @param left an entry of a {@link FSEventBucket} and its content
|
||||
* @param right another entry of a {@link FSEventBucket} plus content, compared to {@code left}
|
||||
* @return a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
|
||||
*/
|
||||
private int compareBuckets(Map.Entry<FSEventBucket, FSEventBucketContent> left, Map.Entry<FSEventBucket, FSEventBucketContent> right) {
|
||||
var t1 = left.getValue().mostRecentEvent().getTimestamp();
|
||||
var t2 = right.getValue().mostRecentEvent().getTimestamp();
|
||||
var timeComparison = t1.compareTo(t2);
|
||||
if (timeComparison != 0) {
|
||||
return -timeComparison; //we need the reverse timesorting
|
||||
}
|
||||
var vaultIdComparison = left.getKey().vault().getId().compareTo(right.getKey().vault().getId());
|
||||
if (vaultIdComparison != 0) {
|
||||
return vaultIdComparison;
|
||||
}
|
||||
var pathComparison = left.getKey().idPath().compareTo(right.getKey().idPath());
|
||||
if (pathComparison != 0) {
|
||||
return pathComparison;
|
||||
}
|
||||
return left.getKey().c().getName().compareTo(right.getKey().c().getName());
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void initialize() {
|
||||
choiceBoxEntries.add(null);
|
||||
choiceBoxEntries.addAll(vaults);
|
||||
vaults.addListener((ListChangeListener<? super Vault>) c -> {
|
||||
while (c.next()) {
|
||||
choiceBoxEntries.removeAll(c.getRemoved());
|
||||
choiceBoxEntries.addAll(c.getAddedSubList());
|
||||
}
|
||||
});
|
||||
|
||||
eventListView.setCellFactory(cellFactory);
|
||||
eventListView.setItems(sortedEventList);
|
||||
|
||||
vaultFilterChoiceBox.setItems(choiceBoxEntries);
|
||||
vaultFilterChoiceBox.valueProperty().addListener(this::applyVaultFilter);
|
||||
vaultFilterChoiceBox.setConverter(new VaultConverter(resourceBundle));
|
||||
}
|
||||
|
||||
private void applyVaultFilter(ObservableValue<? extends Vault> v, Vault oldV, Vault newV) {
|
||||
if (newV == null) {
|
||||
filteredEventList.setPredicate(_ -> true);
|
||||
} else {
|
||||
filteredEventList.setPredicate(e -> e.getKey().vault().equals(newV));
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
void clearEvents() {
|
||||
aggregator.clear();
|
||||
}
|
||||
|
||||
private static class VaultConverter extends StringConverter<Vault> {
|
||||
|
||||
private final ResourceBundle resourceBundle;
|
||||
|
||||
VaultConverter(ResourceBundle resourceBundle) {
|
||||
this.resourceBundle = resourceBundle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(Vault v) {
|
||||
if (v == null) {
|
||||
return resourceBundle.getString("eventView.filter.allVaults");
|
||||
} else {
|
||||
return v.getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vault fromString(String displayLanguage) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.cryptomator.ui.eventview;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import dagger.multibindings.IntoMap;
|
||||
import org.cryptomator.ui.common.DefaultSceneFactory;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.common.FxControllerKey;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlLoaderFactory;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
import org.cryptomator.ui.common.StageFactory;
|
||||
import org.cryptomator.ui.fxapp.FxFSEventList;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Modality;
|
||||
import javafx.stage.Stage;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@Module
|
||||
abstract class EventViewModule {
|
||||
|
||||
@Provides
|
||||
@EventViewScoped
|
||||
@EventViewWindow
|
||||
static Stage provideStage(StageFactory factory, ResourceBundle resourceBundle, FxFSEventList fxFSEventList) {
|
||||
Stage stage = factory.create();
|
||||
stage.setHeight(498);
|
||||
stage.setTitle(resourceBundle.getString("eventView.title"));
|
||||
stage.setResizable(true);
|
||||
stage.initModality(Modality.NONE);
|
||||
stage.focusedProperty().addListener((_,_,isFocused) -> {
|
||||
if(isFocused) {
|
||||
fxFSEventList.unreadEventsProperty().setValue(false);
|
||||
}
|
||||
});
|
||||
return stage;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@EventViewScoped
|
||||
@EventViewWindow
|
||||
static FxmlLoaderFactory provideFxmlLoaderFactory(Map<Class<? extends FxController>, Provider<FxController>> factories, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle) {
|
||||
return new FxmlLoaderFactory(factories, sceneFactory, resourceBundle);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.EVENT_VIEW)
|
||||
@EventViewScoped
|
||||
static Scene provideEventViewerScene(@EventViewWindow FxmlLoaderFactory fxmlLoaders) {
|
||||
return fxmlLoaders.createScene(FxmlFile.EVENT_VIEW);
|
||||
}
|
||||
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@FxControllerKey(EventViewController.class)
|
||||
abstract FxController bindEventViewController(EventViewController controller);
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@FxControllerKey(EventListCellController.class)
|
||||
abstract FxController bindEventListCellController(EventListCellController controller);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.cryptomator.ui.eventview;
|
||||
|
||||
import javax.inject.Scope;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Scope
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface EventViewScoped {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.cryptomator.ui.eventview;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
@interface EventViewWindow {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.cryptomator.ui.eventview;
|
||||
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@EventViewScoped
|
||||
public class UpdateEventViewController implements FxController {
|
||||
|
||||
@Inject
|
||||
public UpdateEventViewController() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -43,8 +43,8 @@ public class AutoUnlocker {
|
||||
private CompletionStage<Void> unlockSequentially(Stream<Vault> vaultStream) {
|
||||
// this is an attempt to run all the unlock workflows sequentially, i.e. start the next workflow only after completing/failing the previous workflow.
|
||||
return vaultStream.filter(Vault::isLocked).reduce(CompletableFuture.completedFuture(null),
|
||||
(prevUnlock, nextVault) -> prevUnlock.thenCompose(unused -> appWindows.startUnlockWorkflow(nextVault, null)),
|
||||
(prevUnlock, nextUnlock) -> nextUnlock.exceptionally(e -> null) // we don't care here about the exception, logged elsewhere
|
||||
(prevUnlock, nextVault) -> prevUnlock.thenCompose(_ -> appWindows.startUnlockWorkflow(nextVault, null)),
|
||||
(_, nextUnlock) -> nextUnlock.exceptionally(_ -> null) // we don't care here about the exception, logged elsewhere
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,9 +29,10 @@ public class FxApplication {
|
||||
private final FxApplicationStyle applicationStyle;
|
||||
private final FxApplicationTerminator applicationTerminator;
|
||||
private final AutoUnlocker autoUnlocker;
|
||||
private final FxFSEventList fxFSEventList;
|
||||
|
||||
@Inject
|
||||
FxApplication(@Named("startupTime") long startupTime, Environment environment, Settings settings, AppLaunchEventHandler launchEventHandler, Lazy<TrayMenuComponent> trayMenu, FxApplicationWindows appWindows, FxApplicationStyle applicationStyle, FxApplicationTerminator applicationTerminator, AutoUnlocker autoUnlocker) {
|
||||
FxApplication(@Named("startupTime") long startupTime, Environment environment, Settings settings, AppLaunchEventHandler launchEventHandler, Lazy<TrayMenuComponent> trayMenu, FxApplicationWindows appWindows, FxApplicationStyle applicationStyle, FxApplicationTerminator applicationTerminator, AutoUnlocker autoUnlocker, FxFSEventList fxFSEventList) {
|
||||
this.startupTime = startupTime;
|
||||
this.environment = environment;
|
||||
this.settings = settings;
|
||||
@@ -41,6 +42,7 @@ public class FxApplication {
|
||||
this.applicationStyle = applicationStyle;
|
||||
this.applicationTerminator = applicationTerminator;
|
||||
this.autoUnlocker = autoUnlocker;
|
||||
this.fxFSEventList = fxFSEventList;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
@@ -85,6 +87,7 @@ public class FxApplication {
|
||||
migrateAndInformDokanyRemoval();
|
||||
|
||||
launchEventHandler.startHandlingLaunchEvents();
|
||||
fxFSEventList.schedulePollForUpdates();
|
||||
autoUnlocker.tryUnlockForTimespan(2, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ package org.cryptomator.ui.fxapp;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import org.cryptomator.ui.decryptname.DecryptNameComponent;
|
||||
import org.cryptomator.ui.error.ErrorComponent;
|
||||
import org.cryptomator.ui.eventview.EventViewComponent;
|
||||
import org.cryptomator.ui.health.HealthCheckComponent;
|
||||
import org.cryptomator.ui.lock.LockComponent;
|
||||
import org.cryptomator.ui.mainwindow.MainWindowComponent;
|
||||
@@ -19,11 +21,15 @@ import org.cryptomator.ui.unlock.UnlockComponent;
|
||||
import org.cryptomator.ui.updatereminder.UpdateReminderComponent;
|
||||
import org.cryptomator.ui.vaultoptions.VaultOptionsComponent;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.scene.image.Image;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
@Module(includes = {UpdateCheckerModule.class}, subcomponents = {TrayMenuComponent.class, //
|
||||
DecryptNameComponent.class, //
|
||||
MainWindowComponent.class, //
|
||||
PreferencesComponent.class, //
|
||||
VaultOptionsComponent.class, //
|
||||
@@ -33,7 +39,8 @@ import java.io.InputStream;
|
||||
ErrorComponent.class, //
|
||||
HealthCheckComponent.class, //
|
||||
UpdateReminderComponent.class, //
|
||||
ShareVaultComponent.class})
|
||||
ShareVaultComponent.class, //
|
||||
EventViewComponent.class})
|
||||
abstract class FxApplicationModule {
|
||||
|
||||
private static Image createImageFromResource(String resourceName) throws IOException {
|
||||
@@ -66,4 +73,10 @@ abstract class FxApplicationModule {
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FxApplicationScoped
|
||||
static EventViewComponent provideEventViewComponent(EventViewComponent.Factory factory) {
|
||||
return factory.create();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,9 @@ import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.common.vaults.VaultState;
|
||||
import org.cryptomator.integrations.tray.TrayIntegrationProvider;
|
||||
import org.cryptomator.ui.dialogs.Dialogs;
|
||||
import org.cryptomator.ui.dialogs.SimpleDialog;
|
||||
import org.cryptomator.ui.error.ErrorComponent;
|
||||
import org.cryptomator.ui.eventview.EventViewComponent;
|
||||
import org.cryptomator.ui.lock.LockComponent;
|
||||
import org.cryptomator.ui.mainwindow.MainWindowComponent;
|
||||
import org.cryptomator.ui.preferences.PreferencesComponent;
|
||||
@@ -51,6 +53,7 @@ public class FxApplicationWindows {
|
||||
private final UpdateReminderComponent.Factory updateReminderWindowFactory;
|
||||
private final LockComponent.Factory lockWorkflowFactory;
|
||||
private final ErrorComponent.Factory errorWindowFactory;
|
||||
private final Lazy<EventViewComponent> eventViewWindow;
|
||||
private final ExecutorService executor;
|
||||
private final VaultOptionsComponent.Factory vaultOptionsWindow;
|
||||
private final ShareVaultComponent.Factory shareVaultWindow;
|
||||
@@ -69,6 +72,7 @@ public class FxApplicationWindows {
|
||||
ErrorComponent.Factory errorWindowFactory, //
|
||||
VaultOptionsComponent.Factory vaultOptionsWindow, //
|
||||
ShareVaultComponent.Factory shareVaultWindow, //
|
||||
Lazy<EventViewComponent> eventViewWindow, //
|
||||
ExecutorService executor, //
|
||||
Dialogs dialogs) {
|
||||
this.primaryStage = primaryStage;
|
||||
@@ -80,6 +84,7 @@ public class FxApplicationWindows {
|
||||
this.updateReminderWindowFactory = updateReminderWindowFactory;
|
||||
this.lockWorkflowFactory = lockWorkflowFactory;
|
||||
this.errorWindowFactory = errorWindowFactory;
|
||||
this.eventViewWindow = eventViewWindow;
|
||||
this.executor = executor;
|
||||
this.vaultOptionsWindow = vaultOptionsWindow;
|
||||
this.shareVaultWindow = shareVaultWindow;
|
||||
@@ -93,17 +98,17 @@ public class FxApplicationWindows {
|
||||
|
||||
// register preferences shortcut
|
||||
if (desktop.isSupported(Desktop.Action.APP_PREFERENCES)) {
|
||||
desktop.setPreferencesHandler(evt -> showPreferencesWindow(SelectedPreferencesTab.ANY));
|
||||
desktop.setPreferencesHandler(_ -> showPreferencesWindow(SelectedPreferencesTab.ANY));
|
||||
}
|
||||
|
||||
// register preferences shortcut
|
||||
if (desktop.isSupported(Desktop.Action.APP_ABOUT)) {
|
||||
desktop.setAboutHandler(evt -> showPreferencesWindow(SelectedPreferencesTab.ABOUT));
|
||||
desktop.setAboutHandler(_ -> showPreferencesWindow(SelectedPreferencesTab.ABOUT));
|
||||
}
|
||||
|
||||
// register app reopen listener
|
||||
if (desktop.isSupported(Desktop.Action.APP_EVENT_REOPENED)) {
|
||||
desktop.addAppEventListener((AppReopenedListener) e -> showMainWindow());
|
||||
desktop.addAppEventListener((AppReopenedListener) _ -> showMainWindow());
|
||||
}
|
||||
|
||||
// observe visible windows
|
||||
@@ -135,11 +140,12 @@ public class FxApplicationWindows {
|
||||
}
|
||||
|
||||
public CompletionStage<Stage> showVaultOptionsWindow(Vault vault, SelectedVaultOptionsTab tab) {
|
||||
return showMainWindow().thenApplyAsync((window) -> vaultOptionsWindow.create(vault).showVaultOptionsWindow(tab), Platform::runLater).whenComplete(this::reportErrors);
|
||||
return showMainWindow().thenApplyAsync(_ -> vaultOptionsWindow.create(vault).showVaultOptionsWindow(tab), Platform::runLater) //
|
||||
.whenComplete(this::reportErrors);
|
||||
}
|
||||
|
||||
public void showQuitWindow(QuitResponse response, boolean forced) {
|
||||
CompletableFuture.runAsync(() -> quitWindowBuilder.build().showQuitWindow(response,forced), Platform::runLater);
|
||||
CompletableFuture.runAsync(() -> quitWindowBuilder.build().showQuitWindow(response, forced), Platform::runLater);
|
||||
}
|
||||
|
||||
public void showUpdateReminderWindow() {
|
||||
@@ -147,13 +153,14 @@ public class FxApplicationWindows {
|
||||
}
|
||||
|
||||
public void showDokanySupportEndWindow() {
|
||||
CompletableFuture.runAsync(() -> dialogs.prepareDokanySupportEndDialog(
|
||||
mainWindow.get().window(),
|
||||
stage -> {
|
||||
showPreferencesWindow(SelectedPreferencesTab.VOLUME);
|
||||
stage.close();
|
||||
}
|
||||
).build().showAndWait(), Platform::runLater);
|
||||
CompletableFuture.runAsync(() -> createDokanySupportEndDialog().showAndWait(), Platform::runLater);
|
||||
}
|
||||
|
||||
private SimpleDialog createDokanySupportEndDialog() {
|
||||
return dialogs.prepareDokanySupportEndDialog(mainWindow.get().window(), stage -> {
|
||||
showPreferencesWindow(SelectedPreferencesTab.VOLUME);
|
||||
stage.close();
|
||||
}).build();
|
||||
}
|
||||
|
||||
public CompletionStage<Void> startUnlockWorkflow(Vault vault, @Nullable Stage owner) {
|
||||
@@ -162,8 +169,7 @@ public class FxApplicationWindows {
|
||||
LOG.debug("Start unlock workflow for {}", vault.getDisplayName());
|
||||
return unlockWorkflowFactory.create(vault, owner).unlockWorkflow();
|
||||
}, Platform::runLater) //
|
||||
.thenAcceptAsync(UnlockWorkflow::run, executor)
|
||||
.exceptionally(e -> {
|
||||
.thenAcceptAsync(UnlockWorkflow::run, executor).exceptionally(e -> {
|
||||
showErrorWindow(e, owner == null ? primaryStage : owner, null);
|
||||
return null;
|
||||
});
|
||||
@@ -182,6 +188,11 @@ public class FxApplicationWindows {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public CompletionStage<Stage> showEventViewer() {
|
||||
return CompletableFuture.supplyAsync(() -> eventViewWindow.get().showEventViewerWindow(), Platform::runLater).whenComplete(this::reportErrors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the generic error scene in the given window.
|
||||
*
|
||||
@@ -199,5 +210,4 @@ public class FxApplicationWindows {
|
||||
LOG.error("Failed to display stage", error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
67
src/main/java/org/cryptomator/ui/fxapp/FxFSEventList.java
Normal file
67
src/main/java/org/cryptomator/ui/fxapp/FxFSEventList.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package org.cryptomator.ui.fxapp;
|
||||
|
||||
import org.cryptomator.event.FSEventBucket;
|
||||
import org.cryptomator.event.FSEventBucketContent;
|
||||
import org.cryptomator.event.FileSystemEventAggregator;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* List of all occurred filesystem events.
|
||||
* <p>
|
||||
* The list exposes an observable list and a property to listen for updates. Internally it polls the {@link FileSystemEventAggregator} in a regular interval for updates.
|
||||
* If an update is available, the list from the {@link FileSystemEventAggregator } is cloned to this list on the FX application thread.
|
||||
*/
|
||||
@FxApplicationScoped
|
||||
public class FxFSEventList {
|
||||
|
||||
private final ObservableList<Map.Entry<FSEventBucket, FSEventBucketContent>> events;
|
||||
private final FileSystemEventAggregator eventAggregator;
|
||||
private final ScheduledExecutorService scheduler;
|
||||
private final BooleanProperty unreadEvents;
|
||||
|
||||
@Inject
|
||||
public FxFSEventList(FileSystemEventAggregator fsEventAggregator, ScheduledExecutorService scheduler) {
|
||||
this.events = FXCollections.observableArrayList();
|
||||
this.eventAggregator = fsEventAggregator;
|
||||
this.scheduler = scheduler;
|
||||
this.unreadEvents = new SimpleBooleanProperty(false);
|
||||
}
|
||||
|
||||
public void schedulePollForUpdates() {
|
||||
scheduler.schedule(this::checkForEventUpdates, 1000, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for event updates and reschedules.
|
||||
* If updates are available, the aggregated events are copied from back- to the frontend.
|
||||
* Reschedules itself on successful execution
|
||||
*/
|
||||
private void checkForEventUpdates() {
|
||||
if (eventAggregator.hasMaybeUpdates()) {
|
||||
Platform.runLater(() -> {
|
||||
eventAggregator.cloneTo(events);
|
||||
unreadEvents.setValue(true);
|
||||
schedulePollForUpdates();
|
||||
});
|
||||
} else {
|
||||
schedulePollForUpdates();
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableList<Map.Entry<FSEventBucket, FSEventBucketContent>> getObservableList() {
|
||||
return events;
|
||||
}
|
||||
|
||||
public BooleanProperty unreadEventsProperty() {
|
||||
return unreadEvents;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package org.cryptomator.ui.keyloading;
|
||||
import org.cryptomator.cryptolib.api.Masterkey;
|
||||
import org.cryptomator.cryptolib.api.MasterkeyLoader;
|
||||
import org.cryptomator.cryptolib.api.MasterkeyLoadingFailedException;
|
||||
import org.cryptomator.ui.keyloading.hub.HubKeyLoadingStrategy;
|
||||
import org.cryptomator.ui.keyloading.masterkeyfile.MasterkeyFileLoadingStrategy;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -28,6 +30,33 @@ public interface KeyLoadingStrategy extends MasterkeyLoader {
|
||||
@Override
|
||||
Masterkey loadKey(URI keyId) throws MasterkeyLoadingFailedException;
|
||||
|
||||
/**
|
||||
* Determines whether the provided key loader scheme corresponds to a Hub Vault.
|
||||
* <p>
|
||||
* This method compares the {@code keyLoader} parameter with the known Hub Vault schemes
|
||||
* {@link HubKeyLoadingStrategy#SCHEME_HUB_HTTP} and {@link HubKeyLoadingStrategy#SCHEME_HUB_HTTPS}.
|
||||
*
|
||||
* @param keyLoader A string representing the key loader scheme to be checked.
|
||||
* @return {@code true} if the given key loader scheme represents a Hub Vault; {@code false} otherwise.
|
||||
*/
|
||||
static boolean isHubVault(String keyLoader) {
|
||||
return HubKeyLoadingStrategy.SCHEME_HUB_HTTP.equals(keyLoader) || HubKeyLoadingStrategy.SCHEME_HUB_HTTPS.equals(keyLoader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the provided key loader scheme corresponds to a Masterkey File Vault.
|
||||
* <p>
|
||||
* This method checks if the {@code keyLoader} parameter matches the known Masterkey File Vault scheme
|
||||
* {@link MasterkeyFileLoadingStrategy#SCHEME}.
|
||||
* </p>
|
||||
*
|
||||
* @param keyLoader A string representing the key loader scheme to be checked.
|
||||
* @return {@code true} if the given key loader scheme represents a Masterkey File Vault; {@code false} otherwise.
|
||||
*/
|
||||
static boolean isMasterkeyFileVault(String keyLoader) {
|
||||
return MasterkeyFileLoadingStrategy.SCHEME.equals(keyLoader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the loader to try and recover from an exception thrown during the last attempt.
|
||||
*
|
||||
|
||||
@@ -165,6 +165,7 @@ public class ReceiveKeyController implements FxController {
|
||||
var vaultKeyUri = hubConfig.URIs.API.resolve("vaults/" + vaultId + "/access-token");
|
||||
var request = HttpRequest.newBuilder(vaultKeyUri) //
|
||||
.header("Authorization", "Bearer " + bearerToken) //
|
||||
.header("Hub-Device-ID", deviceId) //
|
||||
.GET() //
|
||||
.timeout(REQ_TIMEOUT) //
|
||||
.build();
|
||||
|
||||
@@ -112,12 +112,12 @@ public class MasterkeyFileLoadingStrategy implements KeyLoadingStrategy {
|
||||
}
|
||||
|
||||
private void savePasswordToSystemkeychain(Passphrase passphrase) {
|
||||
if (keychain.isSupported()) {
|
||||
try {
|
||||
try {
|
||||
if (keychain.isSupported() && !keychain.getPassphraseStoredProperty(vault.getId()).get()) {
|
||||
keychain.storePassphrase(vault.getId(), vault.getDisplayName(), passphrase);
|
||||
} catch (KeychainAccessException e) {
|
||||
LOG.error("Failed to store passphrase in system keychain.", e);
|
||||
}
|
||||
} catch (KeychainAccessException e) {
|
||||
LOG.error("Failed to store passphrase in system keychain.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import javafx.stage.Stage;
|
||||
import javafx.stage.WindowEvent;
|
||||
import javafx.util.Duration;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
@PassphraseEntryScoped
|
||||
public class PassphraseEntryController implements FxController {
|
||||
@@ -49,6 +50,7 @@ public class PassphraseEntryController implements FxController {
|
||||
private final ForgetPasswordComponent.Builder forgetPassword;
|
||||
private final KeychainManager keychain;
|
||||
private final StringBinding vaultName;
|
||||
private final ExecutorService backgroundExecutorService;
|
||||
private final BooleanProperty unlockInProgress = new SimpleBooleanProperty();
|
||||
private final ObjectBinding<ContentDisplay> unlockButtonContentDisplay = Bindings.when(unlockInProgress).then(ContentDisplay.LEFT).otherwise(ContentDisplay.TEXT_ONLY);
|
||||
private final BooleanProperty unlockButtonDisabled = new SimpleBooleanProperty();
|
||||
@@ -64,7 +66,7 @@ public class PassphraseEntryController implements FxController {
|
||||
public Animation unlockAnimation;
|
||||
|
||||
@Inject
|
||||
public PassphraseEntryController(@KeyLoading Stage window, @KeyLoading Vault vault, CompletableFuture<PassphraseEntryResult> result, @Nullable @Named("savedPassword") Passphrase savedPassword, ForgetPasswordComponent.Builder forgetPassword, KeychainManager keychain) {
|
||||
public PassphraseEntryController(@KeyLoading Stage window, @KeyLoading Vault vault, CompletableFuture<PassphraseEntryResult> result, @Nullable @Named("savedPassword") Passphrase savedPassword, ForgetPasswordComponent.Builder forgetPassword, KeychainManager keychain, ExecutorService backgroundExecutorService) {
|
||||
this.window = window;
|
||||
this.vault = vault;
|
||||
this.result = result;
|
||||
@@ -72,8 +74,8 @@ public class PassphraseEntryController implements FxController {
|
||||
this.forgetPassword = forgetPassword;
|
||||
this.keychain = keychain;
|
||||
this.vaultName = WeakBindings.bindString(vault.displayNameProperty());
|
||||
this.backgroundExecutorService = backgroundExecutorService;
|
||||
window.setOnHiding(this::windowClosed);
|
||||
result.whenCompleteAsync((r, t) -> unlockInProgress.set(false), Platform::runLater);
|
||||
}
|
||||
|
||||
@FXML
|
||||
@@ -119,8 +121,6 @@ public class PassphraseEntryController implements FxController {
|
||||
new KeyFrame(Duration.millis(800), legsExtendedY, legsExtendedX, faceHidden), //
|
||||
new KeyFrame(Duration.millis(1000), faceVisible) //
|
||||
);
|
||||
|
||||
result.whenCompleteAsync((r, t) -> stopUnlockAnimation());
|
||||
}
|
||||
|
||||
@FXML
|
||||
@@ -133,6 +133,9 @@ public class PassphraseEntryController implements FxController {
|
||||
result.cancel(true);
|
||||
LOG.debug("Unlock canceled by user.");
|
||||
}
|
||||
if( passwordField != null) {
|
||||
passwordField.getCharacters().destroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -142,7 +145,7 @@ public class PassphraseEntryController implements FxController {
|
||||
unlockInProgress.set(true);
|
||||
CharSequence pwFieldContents = passwordField.getCharacters();
|
||||
Passphrase pw = Passphrase.copyOf(pwFieldContents);
|
||||
result.complete(new PassphraseEntryResult(pw, savePasswordCheckbox.isSelected()));
|
||||
result.completeAsync(() -> new PassphraseEntryResult(pw, savePasswordCheckbox.isSelected()), backgroundExecutorService);
|
||||
startUnlockAnimation();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
package org.cryptomator.ui.mainwindow;
|
||||
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.binding.BooleanBinding;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.ReadOnlyBooleanProperty;
|
||||
import javafx.beans.property.ReadOnlyObjectProperty;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.stage.Stage;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.cryptomator.common.LicenseHolder;
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
@@ -21,6 +13,17 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.binding.BooleanBinding;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.ReadOnlyBooleanProperty;
|
||||
import javafx.beans.property.ReadOnlyObjectProperty;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.geometry.Rectangle2D;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.stage.Screen;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.WindowEvent;
|
||||
|
||||
@MainWindowScoped
|
||||
public class MainWindowController implements FxController {
|
||||
@@ -63,27 +66,66 @@ public class MainWindowController implements FxController {
|
||||
}
|
||||
window.focusedProperty().addListener(this::mainWindowFocusChanged);
|
||||
|
||||
if (!neverTouched()) {
|
||||
window.setHeight(settings.windowHeight.get() > window.getMinHeight() ? settings.windowHeight.get() : window.getMinHeight());
|
||||
window.setWidth(settings.windowWidth.get() > window.getMinWidth() ? settings.windowWidth.get() : window.getMinWidth());
|
||||
window.setX(settings.windowXPosition.get());
|
||||
window.setY(settings.windowYPosition.get());
|
||||
int x = settings.windowXPosition.get();
|
||||
int y = settings.windowYPosition.get();
|
||||
int width = settings.windowWidth.get();
|
||||
int height = settings.windowHeight.get();
|
||||
if (windowPositionSaved(x, y, width, height)) {
|
||||
window.setX(x);
|
||||
window.setY(y);
|
||||
window.setWidth(Math.clamp(width, window.getMinWidth(), window.getMaxWidth()));
|
||||
window.setHeight(Math.clamp(height, window.getMinHeight(), window.getMaxHeight()));
|
||||
}
|
||||
window.widthProperty().addListener((_, _, _) -> savePositionalSettings());
|
||||
window.heightProperty().addListener((_, _, _) -> savePositionalSettings());
|
||||
window.xProperty().addListener((_, _, _) -> savePositionalSettings());
|
||||
window.yProperty().addListener((_, _, _) -> savePositionalSettings());
|
||||
|
||||
window.setOnShowing(this::checkDisplayBounds);
|
||||
|
||||
settings.windowXPosition.bind(window.xProperty());
|
||||
settings.windowYPosition.bind(window.yProperty());
|
||||
settings.windowWidth.bind(window.widthProperty());
|
||||
settings.windowHeight.bind(window.heightProperty());
|
||||
}
|
||||
|
||||
private boolean neverTouched() {
|
||||
return (settings.windowHeight.get() == 0) && (settings.windowWidth.get() == 0) && (settings.windowXPosition.get() == 0) && (settings.windowYPosition.get() == 0);
|
||||
private boolean windowPositionSaved(int x, int y, int width, int height) {
|
||||
return x != 0 || y != 0 || width != 0 || height != 0;
|
||||
}
|
||||
|
||||
public void savePositionalSettings() {
|
||||
settings.windowWidth.setValue(window.getWidth());
|
||||
settings.windowHeight.setValue(window.getHeight());
|
||||
settings.windowXPosition.setValue(window.getX());
|
||||
settings.windowYPosition.setValue(window.getY());
|
||||
private void checkDisplayBounds(WindowEvent windowEvent) {
|
||||
int x = settings.windowXPosition.get();
|
||||
int y = settings.windowYPosition.get();
|
||||
int width = settings.windowWidth.get();
|
||||
int height = settings.windowHeight.get();
|
||||
|
||||
Rectangle2D primaryScreenBounds = Screen.getPrimary().getBounds();
|
||||
if (!isWithinDisplayBounds(x, y, width, height)) { //use stored window position
|
||||
LOG.debug("Resetting window position due to insufficient screen overlap");
|
||||
var centeredX = (primaryScreenBounds.getWidth() - window.getMinWidth()) / 2;
|
||||
var centeredY = (primaryScreenBounds.getHeight() - window.getMinHeight()) / 2;
|
||||
//check if we can keep width and height
|
||||
if (isWithinDisplayBounds((int) centeredX, (int) centeredY, width, height)) {
|
||||
//if so, keep window size
|
||||
window.setWidth(Math.clamp(width, window.getMinWidth(), window.getMaxWidth()));
|
||||
window.setHeight(Math.clamp(height, window.getMinHeight(), window.getMaxHeight()));
|
||||
}
|
||||
//reset position of upper left corner
|
||||
window.setX(centeredX);
|
||||
window.setY(centeredY);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isWithinDisplayBounds(int x, int y, int width, int height) {
|
||||
// define a rect which is inset on all sides from the window's rect:
|
||||
final int shrinkedX = x + 20; // 20px left
|
||||
final int shrinkedY = y + 5; // 5px top
|
||||
final int shrinkedWidth = width - 40; // 20px left + 20px right
|
||||
final int shrinkedHeigth = height - 25; // 5px top + 20px bottom
|
||||
return isRectangleWithinBounds(shrinkedX, shrinkedY, 0, shrinkedHeigth) // Left pixel column
|
||||
&& isRectangleWithinBounds(shrinkedX + shrinkedWidth, shrinkedY, 0, shrinkedHeigth) // Right pixel column
|
||||
&& isRectangleWithinBounds(shrinkedX, shrinkedY, shrinkedWidth, 0) // Top pixel row
|
||||
&& isRectangleWithinBounds(shrinkedX, shrinkedY + shrinkedHeigth, shrinkedWidth, 0); // Bottom pixel row
|
||||
}
|
||||
|
||||
private boolean isRectangleWithinBounds(int x, int y, int width, int height) {
|
||||
return !Screen.getScreensForRectangle(x, y, width, height).isEmpty();
|
||||
}
|
||||
|
||||
private void mainWindowFocusChanged(Observable observable) {
|
||||
@@ -124,7 +166,7 @@ public class MainWindowController implements FxController {
|
||||
return updateAvailable.get();
|
||||
}
|
||||
|
||||
public BooleanBinding licenseValidProperty(){
|
||||
public BooleanBinding licenseValidProperty() {
|
||||
return licenseHolder.validLicenseProperty();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.cryptomator.ui.mainwindow;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Lazy;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import dagger.multibindings.IntoMap;
|
||||
@@ -14,9 +15,11 @@ import org.cryptomator.ui.common.FxmlScene;
|
||||
import org.cryptomator.ui.common.StageFactory;
|
||||
import org.cryptomator.ui.common.StageInitializer;
|
||||
import org.cryptomator.ui.error.ErrorComponent;
|
||||
import org.cryptomator.ui.fxapp.FxApplicationTerminator;
|
||||
import org.cryptomator.ui.fxapp.PrimaryStage;
|
||||
import org.cryptomator.ui.migration.MigrationComponent;
|
||||
import org.cryptomator.ui.stats.VaultStatisticsComponent;
|
||||
import org.cryptomator.ui.traymenu.TrayMenuComponent;
|
||||
import org.cryptomator.ui.wrongfilealert.WrongFileAlertComponent;
|
||||
|
||||
import javax.inject.Named;
|
||||
@@ -35,11 +38,19 @@ abstract class MainWindowModule {
|
||||
@Provides
|
||||
@MainWindow
|
||||
@MainWindowScoped
|
||||
static Stage provideMainWindow(@PrimaryStage Stage stage, StageInitializer initializer) {
|
||||
static Stage provideMainWindow(@PrimaryStage Stage stage, StageInitializer initializer, FxApplicationTerminator terminator, Lazy<TrayMenuComponent> trayMenu) {
|
||||
initializer.accept(stage);
|
||||
stage.setTitle("Cryptomator");
|
||||
stage.setMinWidth(650);
|
||||
stage.setMinHeight(498);
|
||||
stage.setOnCloseRequest(e -> {
|
||||
if (!trayMenu.get().isInitialized()) {
|
||||
terminator.terminate();
|
||||
e.consume();
|
||||
} else {
|
||||
stage.close();
|
||||
}
|
||||
});
|
||||
return stage;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import org.cryptomator.ui.vaultoptions.SelectedVaultOptionsTab;
|
||||
import org.cryptomator.ui.vaultoptions.VaultOptionsComponent;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.ReadOnlyObjectProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.stage.Stage;
|
||||
@@ -21,7 +21,6 @@ public class VaultDetailLockedController implements FxController {
|
||||
private final ReadOnlyObjectProperty<Vault> vault;
|
||||
private final FxApplicationWindows appWindows;
|
||||
private final VaultOptionsComponent.Factory vaultOptionsWindow;
|
||||
private final KeychainManager keychain;
|
||||
private final Stage mainWindow;
|
||||
private final ObservableValue<Boolean> passwordSaved;
|
||||
|
||||
@@ -30,13 +29,11 @@ public class VaultDetailLockedController implements FxController {
|
||||
this.vault = vault;
|
||||
this.appWindows = appWindows;
|
||||
this.vaultOptionsWindow = vaultOptionsWindow;
|
||||
this.keychain = keychain;
|
||||
this.mainWindow = mainWindow;
|
||||
if (keychain.isSupported() && !keychain.isLocked()) {
|
||||
this.passwordSaved = vault.flatMap(v -> keychain.getPassphraseStoredProperty(v.getId())).orElse(false);
|
||||
} else {
|
||||
this.passwordSaved = new SimpleBooleanProperty(false);
|
||||
}
|
||||
this.passwordSaved = Bindings.createBooleanBinding(() -> {
|
||||
var v = vault.get();
|
||||
return v != null && keychain.getPassphraseStoredProperty(v.getId()).getValue();
|
||||
}, vault, keychain.getKeychainImplementation());
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
||||
@@ -6,12 +6,14 @@ import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import com.tobiasdiez.easybind.EasyBind;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.cryptomator.common.Nullable;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.integrations.mount.Mountpoint;
|
||||
import org.cryptomator.integrations.revealpath.RevealFailedException;
|
||||
import org.cryptomator.integrations.revealpath.RevealPathService;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.common.VaultService;
|
||||
import org.cryptomator.ui.decryptname.DecryptNameComponent;
|
||||
import org.cryptomator.ui.fxapp.FxApplicationWindows;
|
||||
import org.cryptomator.ui.stats.VaultStatisticsComponent;
|
||||
import org.cryptomator.ui.wrongfilealert.WrongFileAlertComponent;
|
||||
@@ -39,10 +41,13 @@ import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
@MainWindowScoped
|
||||
public class VaultDetailUnlockedController implements FxController {
|
||||
@@ -56,26 +61,39 @@ public class VaultDetailUnlockedController implements FxController {
|
||||
private final WrongFileAlertComponent.Builder wrongFileAlert;
|
||||
private final Stage mainWindow;
|
||||
private final Optional<RevealPathService> revealPathService;
|
||||
private final DecryptNameComponent.Factory decryptNameWindowFactory;
|
||||
private final ResourceBundle resourceBundle;
|
||||
private final LoadingCache<Vault, VaultStatisticsComponent> vaultStats;
|
||||
private final VaultStatisticsComponent.Builder vaultStatsBuilder;
|
||||
private final ObservableValue<Boolean> accessibleViaPath;
|
||||
private final ObservableValue<Boolean> accessibleViaUri;
|
||||
private final ObservableValue<String> mountPoint;
|
||||
private final BooleanProperty draggingOver = new SimpleBooleanProperty();
|
||||
private final BooleanProperty draggingOverLocateEncrypted = new SimpleBooleanProperty();
|
||||
private final BooleanProperty draggingOverDecryptName = new SimpleBooleanProperty();
|
||||
private final BooleanProperty ciphertextPathsCopied = new SimpleBooleanProperty();
|
||||
|
||||
//FXML
|
||||
public Button dropZone;
|
||||
@FXML
|
||||
public Button revealEncryptedDropZone;
|
||||
@FXML
|
||||
public Button decryptNameDropZone;
|
||||
|
||||
@Inject
|
||||
public VaultDetailUnlockedController(ObjectProperty<Vault> vault, FxApplicationWindows appWindows, VaultService vaultService, VaultStatisticsComponent.Builder vaultStatsBuilder, WrongFileAlertComponent.Builder wrongFileAlert, @MainWindow Stage mainWindow, Optional<RevealPathService> revealPathService, ResourceBundle resourceBundle) {
|
||||
public VaultDetailUnlockedController(ObjectProperty<Vault> vault, //
|
||||
FxApplicationWindows appWindows, //
|
||||
VaultService vaultService, //
|
||||
VaultStatisticsComponent.Builder vaultStatsBuilder, //
|
||||
WrongFileAlertComponent.Builder wrongFileAlert, //
|
||||
@MainWindow Stage mainWindow, //
|
||||
Optional<RevealPathService> revealPathService, //
|
||||
DecryptNameComponent.Factory decryptNameWindowFactory, //
|
||||
ResourceBundle resourceBundle) {
|
||||
this.vault = vault;
|
||||
this.appWindows = appWindows;
|
||||
this.vaultService = vaultService;
|
||||
this.wrongFileAlert = wrongFileAlert;
|
||||
this.mainWindow = mainWindow;
|
||||
this.revealPathService = revealPathService;
|
||||
this.decryptNameWindowFactory = decryptNameWindowFactory;
|
||||
this.resourceBundle = resourceBundle;
|
||||
this.vaultStats = CacheBuilder.newBuilder().weakValues().build(CacheLoader.from(this::buildVaultStats));
|
||||
this.vaultStatsBuilder = vaultStatsBuilder;
|
||||
@@ -92,89 +110,81 @@ public class VaultDetailUnlockedController implements FxController {
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
dropZone.setOnDragEntered(this::handleDragEvent);
|
||||
dropZone.setOnDragOver(this::handleDragEvent);
|
||||
dropZone.setOnDragDropped(this::handleDragEvent);
|
||||
dropZone.setOnDragExited(this::handleDragEvent);
|
||||
revealEncryptedDropZone.setOnDragOver(e -> handleDragOver(e, draggingOverLocateEncrypted));
|
||||
revealEncryptedDropZone.setOnDragDropped(e -> handleDragDropped(e, this::getCiphertextPath, this::revealOrCopyPaths));
|
||||
revealEncryptedDropZone.setOnDragExited(_ -> draggingOverLocateEncrypted.setValue(false));
|
||||
|
||||
EasyBind.includeWhen(dropZone.getStyleClass(), ACTIVE_CLASS, draggingOver);
|
||||
decryptNameDropZone.setOnDragOver(e -> handleDragOver(e, draggingOverDecryptName));
|
||||
decryptNameDropZone.setOnDragDropped(e -> showDecryptNameWindow(e.getDragboard().getFiles().stream().map(File::toPath).toList()));
|
||||
decryptNameDropZone.setOnDragExited(_ -> draggingOverDecryptName.setValue(false));
|
||||
|
||||
EasyBind.includeWhen(revealEncryptedDropZone.getStyleClass(), ACTIVE_CLASS, draggingOverLocateEncrypted);
|
||||
EasyBind.includeWhen(decryptNameDropZone.getStyleClass(), ACTIVE_CLASS, draggingOverDecryptName);
|
||||
}
|
||||
|
||||
private void handleDragEvent(DragEvent event) {
|
||||
if (DragEvent.DRAG_OVER.equals(event.getEventType()) && event.getGestureSource() == null && event.getDragboard().hasFiles()) {
|
||||
if(SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_MAC) {
|
||||
private void handleDragOver(DragEvent event, BooleanProperty prop) {
|
||||
if (event.getGestureSource() == null && event.getDragboard().hasFiles()) {
|
||||
if (SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_MAC) {
|
||||
event.acceptTransferModes(TransferMode.LINK);
|
||||
} else {
|
||||
event.acceptTransferModes(TransferMode.ANY);
|
||||
}
|
||||
draggingOver.set(true);
|
||||
} else if (DragEvent.DRAG_DROPPED.equals(event.getEventType()) && event.getGestureSource() == null && event.getDragboard().hasFiles()) {
|
||||
List<Path> ciphertextPaths = event.getDragboard().getFiles().stream().map(File::toPath).map(this::getCiphertextPath).flatMap(Optional::stream).toList();
|
||||
if (ciphertextPaths.isEmpty()) {
|
||||
wrongFileAlert.build().showWrongFileAlertWindow();
|
||||
} else {
|
||||
revealOrCopyPaths(ciphertextPaths);
|
||||
}
|
||||
event.setDropCompleted(!ciphertextPaths.isEmpty());
|
||||
event.consume();
|
||||
} else if (DragEvent.DRAG_EXITED.equals(event.getEventType())) {
|
||||
draggingOver.set(false);
|
||||
prop.set(true);
|
||||
}
|
||||
}
|
||||
|
||||
private VaultStatisticsComponent buildVaultStats(Vault vault) {
|
||||
return vaultStatsBuilder.vault(vault).build();
|
||||
private <T> void handleDragDropped(DragEvent event, Function<Path, T> computation, Consumer<List<T>> positiveAction) {
|
||||
if (event.getGestureSource() == null && event.getDragboard().hasFiles()) {
|
||||
List<T> objects = event.getDragboard().getFiles().stream().map(File::toPath).map(computation).filter(Objects::nonNull).toList();
|
||||
if (objects.isEmpty()) {
|
||||
wrongFileAlert.build().showWrongFileAlertWindow();
|
||||
} else {
|
||||
positiveAction.accept(objects);
|
||||
}
|
||||
event.setDropCompleted(!objects.isEmpty());
|
||||
event.consume();
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void revealAccessLocation() {
|
||||
vaultService.reveal(vault.get());
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void copyMountUri() {
|
||||
ClipboardContent clipboardContent = new ClipboardContent();
|
||||
clipboardContent.putString(mountPoint.getValue());
|
||||
Clipboard.getSystemClipboard().setContent(clipboardContent);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void lock() {
|
||||
appWindows.startLockWorkflow(vault.get(), mainWindow);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void showVaultStatistics() {
|
||||
vaultStats.getUnchecked(vault.get()).showVaultStatisticsWindow();
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void chooseFileAndReveal() {
|
||||
public void chooseDecryptedFileAndReveal() {
|
||||
Preconditions.checkState(accessibleViaPath.getValue());
|
||||
var fileChooser = new FileChooser();
|
||||
fileChooser.setTitle(resourceBundle.getString("main.vaultDetail.filePickerTitle"));
|
||||
fileChooser.setTitle(resourceBundle.getString("main.vaultDetail.locateEncrypted.filePickerTitle"));
|
||||
fileChooser.setInitialDirectory(Path.of(mountPoint.getValue()).toFile());
|
||||
var cleartextFile = fileChooser.showOpenDialog(mainWindow);
|
||||
if (cleartextFile != null) {
|
||||
var ciphertextPaths = getCiphertextPath(cleartextFile.toPath()).stream().toList();
|
||||
revealOrCopyPaths(ciphertextPaths);
|
||||
var ciphertextPath = getCiphertextPath(cleartextFile.toPath());
|
||||
if (ciphertextPath != null) {
|
||||
revealOrCopyPaths(List.of(ciphertextPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void showDecryptNameWindow() {
|
||||
showDecryptNameWindow(List.of());
|
||||
}
|
||||
|
||||
private void showDecryptNameWindow(List<Path> pathsToDecrypt) {
|
||||
decryptNameWindowFactory.create(vault.get(), mainWindow, pathsToDecrypt).showDecryptFileNameWindow();
|
||||
}
|
||||
|
||||
private boolean startsWithVaultAccessPoint(Path path) {
|
||||
return path.startsWith(Path.of(mountPoint.getValue()));
|
||||
}
|
||||
|
||||
private Optional<Path> getCiphertextPath(Path path) {
|
||||
@Nullable
|
||||
private Path getCiphertextPath(Path path) {
|
||||
if (!startsWithVaultAccessPoint(path)) {
|
||||
LOG.debug("Path does not start with access point of selected vault: {}", path);
|
||||
return Optional.empty();
|
||||
LOG.debug("Path does not start with mount point of selected vault: {}", path);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Optional.of(vault.get().getCiphertextPath(path));
|
||||
return vault.get().getCiphertextPath(path);
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Unable to get ciphertext path from path: {}", path, e);
|
||||
return Optional.empty();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,6 +216,32 @@ public class VaultDetailUnlockedController implements FxController {
|
||||
});
|
||||
}
|
||||
|
||||
private VaultStatisticsComponent buildVaultStats(Vault vault) {
|
||||
return vaultStatsBuilder.vault(vault).build();
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void revealAccessLocation() {
|
||||
vaultService.reveal(vault.get());
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void copyMountUri() {
|
||||
ClipboardContent clipboardContent = new ClipboardContent();
|
||||
clipboardContent.putString(mountPoint.getValue());
|
||||
Clipboard.getSystemClipboard().setContent(clipboardContent);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void lock() {
|
||||
appWindows.startLockWorkflow(vault.get(), mainWindow);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void showVaultStatistics() {
|
||||
vaultStats.getUnchecked(vault.get()).showVaultStatisticsWindow();
|
||||
}
|
||||
|
||||
/* Getter/Setter */
|
||||
|
||||
public ReadOnlyObjectProperty<Vault> vaultProperty() {
|
||||
@@ -247,4 +283,6 @@ public class VaultDetailUnlockedController implements FxController {
|
||||
public boolean isCiphertextPathsCopied() {
|
||||
return ciphertextPathsCopied.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,16 @@ import javax.inject.Inject;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.layout.HBox;
|
||||
|
||||
// unscoped because each cell needs its own controller
|
||||
public class VaultListCellController implements FxController {
|
||||
|
||||
private static final Insets COMPACT_INSETS = new Insets(6, 12, 6, 12);
|
||||
private static final Insets DEFAULT_INSETS = new Insets(12);
|
||||
|
||||
private final ObjectProperty<Vault> vault = new SimpleObjectProperty<>();
|
||||
private final ObservableValue<FontAwesome5Icon> glyph;
|
||||
private final ObservableValue<Boolean> compactMode;
|
||||
@@ -25,6 +31,8 @@ public class VaultListCellController implements FxController {
|
||||
|
||||
/* FXML */
|
||||
public FontAwesome5IconView vaultStateView;
|
||||
@FXML
|
||||
public HBox vaultListCell;
|
||||
|
||||
@Inject
|
||||
VaultListCellController(Settings settings) {
|
||||
@@ -37,6 +45,7 @@ public class VaultListCellController implements FxController {
|
||||
.onCondition(vault.flatMap(Vault::stateProperty).map(VaultState.Value.PROCESSING::equals).orElse(false)) //
|
||||
.afterStop(() -> vaultStateView.setRotate(0)) //
|
||||
.build();
|
||||
this.vaultListCell.paddingProperty().bind(compactMode.map(c -> c ? COMPACT_INSETS : DEFAULT_INSETS));
|
||||
}
|
||||
|
||||
// TODO deduplicate w/ VaultDetailController
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.cryptomator.ui.addvaultwizard.AddVaultWizardComponent;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.common.VaultService;
|
||||
import org.cryptomator.ui.dialogs.Dialogs;
|
||||
import org.cryptomator.ui.fxapp.FxFSEventList;
|
||||
import org.cryptomator.ui.fxapp.FxApplicationWindows;
|
||||
import org.cryptomator.ui.preferences.SelectedPreferencesTab;
|
||||
import org.slf4j.Logger;
|
||||
@@ -26,6 +27,7 @@ import javafx.collections.ListChangeListener;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.geometry.Side;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ContextMenu;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.input.ContextMenuEvent;
|
||||
@@ -34,7 +36,6 @@ import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.input.TransferMode;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.stage.Stage;
|
||||
import java.io.File;
|
||||
@@ -66,6 +67,7 @@ public class VaultListController implements FxController {
|
||||
private final VaultListCellFactory cellFactory;
|
||||
private final AddVaultWizardComponent.Builder addVaultWizard;
|
||||
private final BooleanBinding emptyVaultList;
|
||||
private final BooleanProperty unreadEvents;
|
||||
private final VaultListManager vaultListManager;
|
||||
private final BooleanProperty draggingVaultOver = new SimpleBooleanProperty();
|
||||
private final ResourceBundle resourceBundle;
|
||||
@@ -76,7 +78,7 @@ public class VaultListController implements FxController {
|
||||
public ListView<Vault> vaultList;
|
||||
public StackPane root;
|
||||
@FXML
|
||||
private HBox addVaultButton;
|
||||
private Button addVaultButton;
|
||||
@FXML
|
||||
private ContextMenu addVaultContextMenu;
|
||||
|
||||
@@ -91,7 +93,8 @@ public class VaultListController implements FxController {
|
||||
ResourceBundle resourceBundle, //
|
||||
FxApplicationWindows appWindows, //
|
||||
Settings settings, //
|
||||
Dialogs dialogs) {
|
||||
Dialogs dialogs, //
|
||||
FxFSEventList fxFSEventList) {
|
||||
this.mainWindow = mainWindow;
|
||||
this.vaults = vaults;
|
||||
this.selectedVault = selectedVault;
|
||||
@@ -104,6 +107,7 @@ public class VaultListController implements FxController {
|
||||
this.dialogs = dialogs;
|
||||
|
||||
this.emptyVaultList = Bindings.isEmpty(vaults);
|
||||
this.unreadEvents = fxFSEventList.unreadEventsProperty();
|
||||
|
||||
selectedVault.addListener(this::selectedVaultDidChange);
|
||||
cellSize = settings.compactMode.map(compact -> compact ? 30.0 : 60.0);
|
||||
@@ -263,6 +267,10 @@ public class VaultListController implements FxController {
|
||||
appWindows.showPreferencesWindow(SelectedPreferencesTab.ANY);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void showEventViewer() {
|
||||
appWindows.showEventViewer();
|
||||
}
|
||||
// Getter and Setter
|
||||
|
||||
public BooleanBinding emptyVaultListProperty() {
|
||||
@@ -289,4 +297,11 @@ public class VaultListController implements FxController {
|
||||
return cellSize.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<Boolean> unreadEventsPresentProperty() {
|
||||
return unreadEvents;
|
||||
}
|
||||
|
||||
public boolean getUnreadEventsPresent() {
|
||||
return unreadEvents.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import javafx.fxml.FXML;
|
||||
public class WelcomeController implements FxController {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(WelcomeController.class);
|
||||
private static final String GETTING_STARTED_URI = "https://docs.cryptomator.org/en/1.7/desktop/getting-started/";
|
||||
private static final String GETTING_STARTED_URI = "https://docs.cryptomator.org/desktop/getting-started/";
|
||||
|
||||
private final Application application;
|
||||
private final BooleanBinding noVaultPresent;
|
||||
|
||||
@@ -10,7 +10,7 @@ import javafx.stage.Stage;
|
||||
|
||||
public class MigrationImpossibleController implements FxController {
|
||||
|
||||
private static final String HELP_URI = "https://docs.cryptomator.org/en/1.7/help/manual-migration/";
|
||||
private static final String HELP_URI = "https://docs.cryptomator.org/help/manual-migration/";
|
||||
|
||||
private final Application application;
|
||||
private final Stage window;
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package org.cryptomator.ui.preferences;
|
||||
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.cryptomator.common.Environment;
|
||||
import org.cryptomator.common.keychain.KeychainManager;
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
import org.cryptomator.integrations.autostart.AutoStartProvider;
|
||||
import org.cryptomator.integrations.autostart.ToggleAutoStartFailedException;
|
||||
import org.cryptomator.integrations.common.NamedServiceProvider;
|
||||
import org.cryptomator.integrations.keychain.KeychainAccessException;
|
||||
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
|
||||
import org.cryptomator.integrations.quickaccess.QuickAccessService;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
@@ -14,6 +17,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.application.Application;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.CheckBox;
|
||||
@@ -23,6 +27,10 @@ import javafx.stage.Stage;
|
||||
import javafx.util.StringConverter;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@PreferencesScoped
|
||||
public class GeneralPreferencesController implements FxController {
|
||||
@@ -36,6 +44,8 @@ public class GeneralPreferencesController implements FxController {
|
||||
private final Application application;
|
||||
private final Environment environment;
|
||||
private final List<KeychainAccessProvider> keychainAccessProviders;
|
||||
private final KeychainManager keychain;
|
||||
private final ExecutorService backgroundExecutor;
|
||||
private final FxApplicationWindows appWindows;
|
||||
public CheckBox useKeychainCheckbox;
|
||||
public ChoiceBox<KeychainAccessProvider> keychainBackendChoiceBox;
|
||||
@@ -47,12 +57,18 @@ public class GeneralPreferencesController implements FxController {
|
||||
public CheckBox autoStartCheckbox;
|
||||
public ToggleGroup nodeOrientation;
|
||||
|
||||
private CompletionStage<Void> keychainMigrations = CompletableFuture.completedFuture(null);
|
||||
|
||||
@Inject
|
||||
GeneralPreferencesController(@PreferencesWindow Stage window, Settings settings, Optional<AutoStartProvider> autoStartProvider, List<KeychainAccessProvider> keychainAccessProviders, Application application, Environment environment, FxApplicationWindows appWindows) {
|
||||
GeneralPreferencesController(@PreferencesWindow Stage window, Settings settings, Optional<AutoStartProvider> autoStartProvider, //
|
||||
List<KeychainAccessProvider> keychainAccessProviders, KeychainManager keychain, Application application, //
|
||||
Environment environment, FxApplicationWindows appWindows, ExecutorService backgroundExecutor) {
|
||||
this.window = window;
|
||||
this.settings = settings;
|
||||
this.autoStartProvider = autoStartProvider;
|
||||
this.keychainAccessProviders = keychainAccessProviders;
|
||||
this.keychain = keychain;
|
||||
this.backgroundExecutor = backgroundExecutor;
|
||||
this.quickAccessServices = QuickAccessService.get().toList();
|
||||
this.application = application;
|
||||
this.environment = environment;
|
||||
@@ -73,6 +89,7 @@ public class GeneralPreferencesController implements FxController {
|
||||
Bindings.bindBidirectional(settings.keychainProvider, keychainBackendChoiceBox.valueProperty(), keychainSettingsConverter);
|
||||
useKeychainCheckbox.selectedProperty().bindBidirectional(settings.useKeychain);
|
||||
keychainBackendChoiceBox.disableProperty().bind(useKeychainCheckbox.selectedProperty().not());
|
||||
keychainBackendChoiceBox.valueProperty().addListener(this::migrateKeychainEntries);
|
||||
|
||||
useQuickAccessCheckbox.selectedProperty().bindBidirectional(settings.useQuickAccess);
|
||||
var quickAccessSettingsConverter = new ServiceToSettingsConverter<>(quickAccessServices);
|
||||
@@ -83,6 +100,25 @@ public class GeneralPreferencesController implements FxController {
|
||||
quickAccessServiceChoiceBox.disableProperty().bind(useQuickAccessCheckbox.selectedProperty().not());
|
||||
}
|
||||
|
||||
private void migrateKeychainEntries(Observable observable, KeychainAccessProvider oldProvider, KeychainAccessProvider newProvider) {
|
||||
//currently, we only migrate on macOS (touchID vs regular keychain)
|
||||
if (SystemUtils.IS_OS_MAC) {
|
||||
var idsAndNames = settings.directories.stream().collect(Collectors.toMap(vs -> vs.id, vs -> vs.displayName.getValue()));
|
||||
if (!idsAndNames.isEmpty()) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Migrating keychain entries {} from {} to {}", idsAndNames.keySet(), oldProvider.displayName(), newProvider.displayName());
|
||||
}
|
||||
keychainMigrations = keychainMigrations.thenRunAsync(() -> {
|
||||
try {
|
||||
KeychainManager.migrate(oldProvider, newProvider, idsAndNames);
|
||||
} catch (KeychainAccessException e) {
|
||||
LOG.warn("Failed to migrate all entries from {} to {}", oldProvider.displayName(), newProvider.displayName(), e);
|
||||
}
|
||||
}, backgroundExecutor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAutoStartSupported() {
|
||||
return autoStartProvider.isPresent();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.ContentDisplay;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -32,7 +34,10 @@ import java.util.ResourceBundle;
|
||||
@PreferencesScoped
|
||||
public class UpdatesPreferencesController implements FxController {
|
||||
|
||||
private static final String DOWNLOADS_URI = "https://cryptomator.org/downloads";
|
||||
private static final String DOWNLOADS_URI_TEMPLATE = "https://cryptomator.org/downloads/" //
|
||||
+ "?utm_source=cryptomator-desktop" //
|
||||
+ "&utm_medium=update-notification&" //
|
||||
+ "utm_campaign=app-update-%s";
|
||||
|
||||
private final Application application;
|
||||
private final Environment environment;
|
||||
@@ -50,6 +55,7 @@ public class UpdatesPreferencesController implements FxController {
|
||||
private final BooleanProperty upToDateLabelVisible = new SimpleBooleanProperty(false);
|
||||
private final DateTimeFormatter formatter;
|
||||
private final BooleanBinding upToDate;
|
||||
private final String downloadsUri;
|
||||
|
||||
/* FXML */
|
||||
public CheckBox checkForUpdatesCheckbox;
|
||||
@@ -65,12 +71,13 @@ public class UpdatesPreferencesController implements FxController {
|
||||
this.latestVersion = updateChecker.latestVersionProperty();
|
||||
this.lastSuccessfulUpdateCheck = updateChecker.lastSuccessfulUpdateCheckProperty();
|
||||
this.timeDifferenceMessage = Bindings.createStringBinding(this::getTimeDifferenceMessage, lastSuccessfulUpdateCheck);
|
||||
this.currentVersion = updateChecker.getCurrentVersion();
|
||||
this.currentVersion = environment.getAppVersion();
|
||||
this.updateAvailable = updateChecker.updateAvailableProperty();
|
||||
this.formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault());
|
||||
this.upToDate = updateChecker.updateCheckStateProperty().isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL).and(latestVersion.isEqualTo(currentVersion));
|
||||
this.checkFailed = updateChecker.checkFailedProperty();
|
||||
this.lastUpdateCheckMessage = Bindings.createStringBinding(this::getLastUpdateCheckMessage, lastSuccessfulUpdateCheck);
|
||||
this.downloadsUri = DOWNLOADS_URI_TEMPLATE.formatted(URLEncoder.encode(currentVersion, StandardCharsets.US_ASCII));
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
@@ -93,7 +100,7 @@ public class UpdatesPreferencesController implements FxController {
|
||||
|
||||
@FXML
|
||||
public void visitDownloadsPage() {
|
||||
application.getHostServices().showDocument(DOWNLOADS_URI);
|
||||
application.getHostServices().showDocument(downloadsUri);
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.ResourceBundle;
|
||||
@PreferencesScoped
|
||||
public class VolumePreferencesController implements FxController {
|
||||
|
||||
public static final String DOCS_MOUNTING_URL = "https://docs.cryptomator.org/en/1.7/desktop/volume-type/";
|
||||
public static final String DOCS_MOUNTING_URL = "https://docs.cryptomator.org/desktop/volume-type/";
|
||||
public static final int MIN_PORT = 1024;
|
||||
public static final int MAX_PORT = 65535;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.cryptomator.ui.sharevault;
|
||||
import dagger.Lazy;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.keyloading.hub.HubKeyLoadingStrategy;
|
||||
import org.cryptomator.ui.keyloading.KeyLoadingStrategy;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.application.Application;
|
||||
@@ -33,8 +33,7 @@ public class ShareVaultController implements FxController {
|
||||
this.window = window;
|
||||
this.application = application;
|
||||
this.vault = vault;
|
||||
var vaultScheme = vault.getVaultConfigCache().getUnchecked().getKeyId().getScheme();
|
||||
this.hubVault = (vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTP) || vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTPS));
|
||||
this.hubVault = KeyLoadingStrategy.isHubVault(vault.getVaultSettings().lastKnownKeyLoader.get());
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.cryptomator.integrations.mount.MountFailedException;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
import org.cryptomator.ui.common.VaultService;
|
||||
import org.cryptomator.ui.dialogs.Dialogs;
|
||||
import org.cryptomator.ui.fxapp.FxApplicationWindows;
|
||||
import org.cryptomator.ui.fxapp.PrimaryStage;
|
||||
import org.cryptomator.ui.keyloading.KeyLoadingStrategy;
|
||||
@@ -25,6 +26,8 @@ import javafx.scene.Scene;
|
||||
import javafx.stage.Screen;
|
||||
import javafx.stage.Stage;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.ReadOnlyFileSystemException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* A multi-step task that consists of background activities as well as user interaction.
|
||||
@@ -46,6 +49,7 @@ public class UnlockWorkflow extends Task<Void> {
|
||||
private final FxApplicationWindows appWindows;
|
||||
private final KeyLoadingStrategy keyLoadingStrategy;
|
||||
private final ObjectProperty<IllegalMountPointException> illegalMountPointException;
|
||||
private final Dialogs dialogs;
|
||||
|
||||
@Inject
|
||||
UnlockWorkflow(@PrimaryStage Stage mainWindow, //
|
||||
@@ -57,7 +61,8 @@ public class UnlockWorkflow extends Task<Void> {
|
||||
@FxmlScene(FxmlFile.UNLOCK_REQUIRES_RESTART) Lazy<Scene> restartRequiredScene, //
|
||||
FxApplicationWindows appWindows, //
|
||||
@UnlockWindow KeyLoadingStrategy keyLoadingStrategy, //
|
||||
@UnlockWindow ObjectProperty<IllegalMountPointException> illegalMountPointException) {
|
||||
@UnlockWindow ObjectProperty<IllegalMountPointException> illegalMountPointException, //
|
||||
Dialogs dialogs) {
|
||||
this.mainWindow = mainWindow;
|
||||
this.window = window;
|
||||
this.vault = vault;
|
||||
@@ -68,6 +73,7 @@ public class UnlockWorkflow extends Task<Void> {
|
||||
this.appWindows = appWindows;
|
||||
this.keyLoadingStrategy = keyLoadingStrategy;
|
||||
this.illegalMountPointException = illegalMountPointException;
|
||||
this.dialogs = dialogs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,11 +150,36 @@ public class UnlockWorkflow extends Task<Void> {
|
||||
switch (throwable) {
|
||||
case IllegalMountPointException e -> handleIllegalMountPointError(e);
|
||||
case ConflictingMountServiceException _ -> handleConflictingMountServiceException();
|
||||
case ReadOnlyFileSystemException _ -> handleReadOnlyFileSystem();
|
||||
default -> handleGenericError(throwable);
|
||||
}
|
||||
vault.stateProperty().transition(VaultState.Value.PROCESSING, VaultState.Value.LOCKED);
|
||||
}
|
||||
|
||||
private void handleReadOnlyFileSystem() {
|
||||
var readOnlyDialog = dialogs.prepareRetryIfReadonlyDialog(mainWindow, stage -> {
|
||||
stage.close();
|
||||
this.retry();
|
||||
}).build();
|
||||
|
||||
Platform.runLater(readOnlyDialog::showAndWait);
|
||||
}
|
||||
|
||||
private void retry() {
|
||||
try {
|
||||
vault.getVaultSettings().usesReadOnlyMode.set(true);
|
||||
var isLocked = vault.stateProperty().awaitState(VaultState.Value.LOCKED, 5, TimeUnit.SECONDS);
|
||||
if (!isLocked) {
|
||||
LOG.error("Vault did not changed to LOCKED state within 5 seconds. Aborting unlock retry.");
|
||||
} else {
|
||||
appWindows.startUnlockWorkflow(vault, mainWindow);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
LOG.error("Waiting for LOCKED vault state was interrupted. Aborting unlock retry.", e);
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void cancelled() {
|
||||
LOG.debug("Unlock of '{}' canceled.", vault.getDisplayName());
|
||||
|
||||
@@ -17,6 +17,8 @@ import org.cryptomator.ui.preferences.VolumePreferencesController;
|
||||
import javax.inject.Inject;
|
||||
import javafx.application.Application;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.binding.BooleanBinding;
|
||||
import javafx.beans.value.ObservableBooleanValue;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
@@ -50,7 +52,6 @@ public class MountOptionsController implements FxController {
|
||||
private final ObservableValue<String> defaultMountFlags;
|
||||
private final ObservableValue<Boolean> mountpointDirSupported;
|
||||
private final ObservableValue<Boolean> mountpointDriveLetterSupported;
|
||||
private final ObservableValue<Boolean> readOnlySupported;
|
||||
private final ObservableValue<Boolean> mountFlagsSupported;
|
||||
private final ObservableValue<Boolean> defaultMountServiceSelected;
|
||||
private final ObservableValue<String> directoryPath;
|
||||
@@ -60,6 +61,7 @@ public class MountOptionsController implements FxController {
|
||||
private final ObservableValue<MountService> selectedMountService;
|
||||
private final ObservableValue<Boolean> selectedMountServiceRequiresRestart;
|
||||
private final ObservableValue<Boolean> loopbackPortChangeable;
|
||||
private final ObservableBooleanValue readOnlyOptionAllowed;
|
||||
|
||||
|
||||
//-- FXML objects --
|
||||
@@ -108,10 +110,10 @@ public class MountOptionsController implements FxController {
|
||||
});
|
||||
this.mountFlagsSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_FLAGS));
|
||||
this.defaultMountServiceSelected = ObservableUtil.mapWithDefault(vaultSettings.mountService, _ -> false, true);
|
||||
this.readOnlySupported = selectedMountService.map(s -> s.hasCapability(MountCapability.READ_ONLY));
|
||||
this.mountpointDirSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_TO_EXISTING_DIR) || s.hasCapability(MountCapability.MOUNT_WITHIN_EXISTING_PARENT));
|
||||
this.mountpointDriveLetterSupported = selectedMountService.map(s -> s.hasCapability(MountCapability.MOUNT_AS_DRIVE_LETTER));
|
||||
this.loopbackPortChangeable = selectedMountService.map(s -> s.hasCapability(MountCapability.LOOPBACK_PORT) && vaultSettings.mountService.getValue() != null);
|
||||
this.readOnlyOptionAllowed = BooleanBinding.booleanExpression(selectedMountService.map(s -> s.hasCapability(MountCapability.READ_ONLY))).or(vaultSettings.usesReadOnlyMode);
|
||||
}
|
||||
|
||||
private MountService reselectMountService() {
|
||||
@@ -345,12 +347,12 @@ public class MountOptionsController implements FxController {
|
||||
return mountpointDriveLetterSupported.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<Boolean> readOnlySupportedProperty() {
|
||||
return readOnlySupported;
|
||||
public ObservableValue<Boolean> readOnlyOptionAllowedProperty() {
|
||||
return readOnlyOptionAllowed;
|
||||
}
|
||||
|
||||
public boolean isReadOnlySupported() {
|
||||
return readOnlySupported.getValue();
|
||||
public boolean isReadOnlyOptionAllowed() {
|
||||
return readOnlyOptionAllowed.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<String> directoryPathProperty() {
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.cryptomator.ui.vaultoptions;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.common.vaults.VaultState;
|
||||
import org.cryptomator.ui.common.FxController;
|
||||
import org.cryptomator.ui.keyloading.KeyLoadingStrategy;
|
||||
import org.cryptomator.ui.keyloading.hub.HubKeyLoadingStrategy;
|
||||
import org.cryptomator.ui.keyloading.masterkeyfile.MasterkeyFileLoadingStrategy;
|
||||
import org.slf4j.Logger;
|
||||
@@ -42,11 +43,11 @@ public class VaultOptionsController implements FxController {
|
||||
window.setOnShowing(this::windowWillAppear);
|
||||
selectedTabProperty.addListener(observable -> this.selectChosenTab());
|
||||
tabPane.getSelectionModel().selectedItemProperty().addListener(observable -> this.selectedTabChanged());
|
||||
var vaultScheme = vault.getVaultConfigCache().getUnchecked().getKeyId().getScheme();
|
||||
if(!vaultScheme.equals(MasterkeyFileLoadingStrategy.SCHEME)){
|
||||
var vaultKeyLoader = vault.getVaultSettings().lastKnownKeyLoader.get();
|
||||
if(!KeyLoadingStrategy.isMasterkeyFileVault(vaultKeyLoader)){
|
||||
tabPane.getTabs().remove(keyTab);
|
||||
}
|
||||
if(!(vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTP) || vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTPS))){
|
||||
if(!KeyLoadingStrategy.isHubVault(vaultKeyLoader)){
|
||||
tabPane.getTabs().remove(hubTab);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.io.UncheckedIOException;
|
||||
@WrongFileAlertScoped
|
||||
public class WrongFileAlertController implements FxController {
|
||||
|
||||
private static final String DOCUMENTATION_URI = "https://docs.cryptomator.org/en/1.7/desktop/accessing-vaults/";
|
||||
private static final String DOCUMENTATION_URI = "https://docs.cryptomator.org/desktop/accessing-vaults/";
|
||||
|
||||
private final Application app;
|
||||
private final Stage window;
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
src: url('opensans_bold.ttf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
src: url('firacode_regular.ttf');
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Root Styling & Colors *
|
||||
@@ -125,6 +129,12 @@
|
||||
-fx-fill: TEXT_FILL;
|
||||
}
|
||||
|
||||
.cryptic-text {
|
||||
-fx-fill: TEXT_FILL;
|
||||
-fx-font-family: 'Fira Code';
|
||||
-fx-font-size: 1.1em;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Glyph Icons *
|
||||
@@ -183,19 +193,37 @@
|
||||
}
|
||||
|
||||
.main-window .button-bar {
|
||||
-fx-min-height:42px;
|
||||
-fx-max-height:42px;
|
||||
-fx-background-color: MAIN_BG;
|
||||
-fx-border-color: CONTROL_BORDER_NORMAL transparent transparent transparent;
|
||||
-fx-border-width: 1px 0 0 0;
|
||||
}
|
||||
|
||||
.main-window .button-left {
|
||||
.main-window .button-bar .button-left {
|
||||
-fx-border-color: CONTROL_BORDER_NORMAL;
|
||||
-fx-border-width: 0 1px 0 0;
|
||||
-fx-background-color: MAIN_BG;
|
||||
-fx-background-radius: 0px;
|
||||
-fx-min-height: 42px;
|
||||
-fx-max-height: 42px;
|
||||
}
|
||||
|
||||
.main-window .button-right {
|
||||
.main-window .button-bar .button-right {
|
||||
-fx-border-color: CONTROL_BORDER_NORMAL;
|
||||
-fx-border-width: 0 0 0 1px;
|
||||
-fx-background-color: MAIN_BG;
|
||||
-fx-background-radius: 0px;
|
||||
-fx-min-height: 42px;
|
||||
-fx-max-height: 42px;
|
||||
}
|
||||
|
||||
.main-window .button-bar .button-left:armed {
|
||||
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
|
||||
}
|
||||
|
||||
.main-window .button-bar .button-right:armed {
|
||||
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -284,6 +312,10 @@
|
||||
-fx-font-size: 1.0em;
|
||||
}
|
||||
|
||||
.list-cell .header-misc {
|
||||
-fx-font-size: 1.0em;
|
||||
}
|
||||
|
||||
.list-cell .detail-label {
|
||||
-fx-text-fill: TEXT_FILL_MUTED;
|
||||
-fx-font-size: 0.8em;
|
||||
@@ -312,6 +344,42 @@
|
||||
-fx-fill: transparent;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Event List *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
.event-window .button-bar {
|
||||
-fx-min-height:42px;
|
||||
-fx-max-height:42px;
|
||||
-fx-background-color: MAIN_BG;
|
||||
-fx-border-color: transparent transparent CONTROL_BORDER_NORMAL transparent;
|
||||
-fx-border-width: 0 0 1px 0;
|
||||
}
|
||||
|
||||
.event-window .button-bar .button-right {
|
||||
-fx-border-color: transparent transparent transparent CONTROL_BORDER_NORMAL;
|
||||
-fx-border-width: 0 0 0 1px;
|
||||
-fx-background-color: MAIN_BG;
|
||||
-fx-background-radius: 0px;
|
||||
-fx-min-height: 42px;
|
||||
-fx-max-height: 42px;
|
||||
}
|
||||
|
||||
.event-window .button-bar .button-right:armed {
|
||||
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
|
||||
}
|
||||
|
||||
.event-window .list-view .list-cell:hover {
|
||||
-fx-background-color: CONTROL_BG_SELECTED;
|
||||
}
|
||||
|
||||
.event-window .list-view .list-cell:selected {
|
||||
-fx-background-color: PRIMARY, CONTROL_BG_SELECTED;
|
||||
-fx-background-insets: 0, 0 0 0 3px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* NotificationBar *
|
||||
@@ -341,6 +409,12 @@
|
||||
-fx-background-color: PRIMARY;
|
||||
}
|
||||
|
||||
.notification-debug:hover .notification-label,
|
||||
.notification-update:hover .notification-label,
|
||||
.notification-support:hover .notification-label {
|
||||
-fx-underline:true;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* ScrollBar *
|
||||
@@ -575,6 +649,16 @@
|
||||
-fx-graphic-text-gap: 9px;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Update indicator
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
.icon-update-indicator {
|
||||
-fx-fill: RED_5;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Hyperlinks *
|
||||
@@ -938,4 +1022,167 @@
|
||||
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL;
|
||||
-fx-background-insets: 0, 1px;
|
||||
-fx-background-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Decrypt Name Window
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
.decrypt-name-window .button-bar {
|
||||
-fx-min-height:42px;
|
||||
-fx-max-height:42px;
|
||||
-fx-background-color: MAIN_BG;
|
||||
-fx-border-color: transparent transparent CONTROL_BORDER_NORMAL transparent;
|
||||
-fx-border-width: 0 0 1px 0;
|
||||
}
|
||||
|
||||
.decrypt-name-window .button-bar .button-right {
|
||||
-fx-border-color: transparent transparent transparent CONTROL_BORDER_NORMAL;
|
||||
-fx-border-width: 0 0 0 1px;
|
||||
-fx-background-color: MAIN_BG;
|
||||
-fx-background-radius: 0px;
|
||||
-fx-min-height: 42px;
|
||||
-fx-max-height: 42px;
|
||||
}
|
||||
|
||||
.decrypt-name-window .button-bar .button-right:armed {
|
||||
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
|
||||
}
|
||||
|
||||
.decrypt-name-window .table-view {
|
||||
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL;
|
||||
-fx-background-insets: 0,1;
|
||||
/* There is some oddness if padding is in em values rather than pixels,
|
||||
in particular, the left border of the control doesn't show. */
|
||||
-fx-padding: 1; /* 0.083333em; */
|
||||
}
|
||||
|
||||
.table-view > .placeholder {
|
||||
-fx-background-color: transparent;
|
||||
-fx-background-radius: 0px;
|
||||
}
|
||||
|
||||
.table-view > .placeholder > .button {
|
||||
-fx-border-width: 0;
|
||||
-fx-border-color: transparent;
|
||||
-fx-background-radius: 0px;
|
||||
}
|
||||
|
||||
.table-view:focused {
|
||||
-fx-background-color: CONTROL_BORDER_FOCUSED, CONTROL_BG_NORMAL;
|
||||
-fx-background-insets: 0, 1;
|
||||
-fx-background-radius: 0, 0;
|
||||
/* There is some oddness if padding is in em values rather than pixels,
|
||||
in particular, the left border of the control doesn't show. */
|
||||
-fx-padding: 1; /* 0.083333em; */
|
||||
}
|
||||
|
||||
.table-view > .virtual-flow > .scroll-bar:vertical {
|
||||
-fx-background-insets: 0, 0 0 0 1;
|
||||
-fx-padding: -1 -1 -1 0;
|
||||
}
|
||||
|
||||
.table-view > .virtual-flow > .corner {
|
||||
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL ;
|
||||
-fx-background-insets: 0, 1 0 0 1;
|
||||
}
|
||||
|
||||
/* Each row in the table is a table-row-cell. Inside a table-row-cell is any
|
||||
number of table-cell. */
|
||||
.table-row-cell {
|
||||
-fx-background-color: GRAY_3, CONTROL_BG_NORMAL;
|
||||
-fx-background-insets: 0, 0 0 1 0;
|
||||
-fx-padding: 0.0em; /* 0 */
|
||||
-fx-text-fill: TEXT_FILL;
|
||||
}
|
||||
|
||||
.table-row-cell:odd {
|
||||
-fx-background-color: GRAY_3, GRAY_1;
|
||||
-fx-background-insets: 0, 0 0 1 0;
|
||||
}
|
||||
|
||||
.table-cell {
|
||||
-fx-padding: 3px 6px 3px 6px;
|
||||
-fx-background-color: transparent;
|
||||
-fx-border-color: transparent CONTROL_BORDER_NORMAL transparent transparent;
|
||||
-fx-border-width: 1px;
|
||||
-fx-cell-size: 30px;
|
||||
-fx-text-fill: TEXT_FILL;
|
||||
-fx-text-overrun: center-ellipsis;
|
||||
}
|
||||
|
||||
.table-view:focused > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled:selected > .table-cell {
|
||||
-fx-text-fill: TEXT_FILL;
|
||||
}
|
||||
|
||||
/* selected, hover - not specified */
|
||||
|
||||
/* selected, focused, hover */
|
||||
/* selected, focused */
|
||||
/* selected */
|
||||
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:selected,
|
||||
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:selected,
|
||||
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:selected:hover {
|
||||
-fx-background-color: CONTROL_PRIMARY_BG_NORMAL, PRIMARY_D1;
|
||||
-fx-background-insets: 0 0 0 0, 1 1 1 3;
|
||||
-fx-text-fill: TEXT_FILL;
|
||||
}
|
||||
/* focused */
|
||||
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused {
|
||||
-fx-background-color: CONTROL_PRIMARY_BORDER_FOCUSED, CONTROL_PRIMARY_BG_NORMAL , CONTROL_BG_NORMAL;
|
||||
-fx-background-insets: 0 1 0 0, 1 2 1 1, 2 3 2 2;
|
||||
-fx-text-fill: TEXT_FILL;
|
||||
}
|
||||
/* focused, hover */
|
||||
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:hover {
|
||||
-fx-background-color: CONTROL_PRIMARY_BORDER_FOCUSED, CONTROL_PRIMARY_BG_NORMAL , PRIMARY_D2;
|
||||
-fx-background-insets: 0 1 0 0, 1 2 1 1, 2 3 2 2;
|
||||
-fx-text-fill: TEXT_FILL;
|
||||
}
|
||||
/* hover */
|
||||
.table-view:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:hover {
|
||||
-fx-background-color: PRIMARY_D2;
|
||||
-fx-text-fill: TEXT_FILL;
|
||||
-fx-background-insets: 0 0 1 0;
|
||||
}
|
||||
|
||||
/* The column-resize-line is shown when the user is attempting to resize a column. */
|
||||
.table-view .column-resize-line {
|
||||
-fx-background-color: CONTROL_BG_ARMED;
|
||||
-fx-padding: 0.0em 0.0416667em 0.0em 0.0416667em; /* 0 0.571429 0 0.571429 */
|
||||
}
|
||||
|
||||
/* This is the area behind the column headers. An ideal place to specify background
|
||||
and border colors for the whole area (not individual column-header's). */
|
||||
.table-view .column-header-background {
|
||||
-fx-background-color: GRAY_2;
|
||||
-fx-padding: 0;
|
||||
}
|
||||
|
||||
/* The column header row is made up of a number of column-header, one for each
|
||||
TableColumn, and a 'filler' area that extends from the right-most column
|
||||
to the edge of the tableview, or up to the 'column control' button. */
|
||||
.table-view .column-header {
|
||||
-fx-text-fill: TEXT_FILL;
|
||||
-fx-font-size: 1.083333em; /* 13pt ; 1 more than the default font */
|
||||
-fx-size: 24;
|
||||
-fx-border-style: solid;
|
||||
-fx-border-color:
|
||||
transparent
|
||||
GRAY_3
|
||||
GRAY_3
|
||||
transparent;
|
||||
-fx-border-insets: 0 0 0 0;
|
||||
-fx-border-width: 0.083333em;
|
||||
}
|
||||
|
||||
.table-view .column-header .label {
|
||||
-fx-alignment: center;
|
||||
}
|
||||
|
||||
.table-view .empty-table {
|
||||
-fx-background-color: MAIN_BG;
|
||||
-fx-font-size: 1.166667em; /* 14pt - 2 more than the default font */
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user