From 30e1c989d07ac9595b85a550960c886abc32f6e5 Mon Sep 17 00:00:00 2001 From: JaniruTEC <52893617+JaniruTEC@users.noreply.github.com> Date: Sun, 1 May 2022 00:46:36 +0200 Subject: [PATCH 01/53] Fixed typo --- src/main/java/org/cryptomator/common/vaults/VaultState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/cryptomator/common/vaults/VaultState.java b/src/main/java/org/cryptomator/common/vaults/VaultState.java index 51365fbd2..ff09c8b82 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultState.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultState.java @@ -83,7 +83,7 @@ public class VaultState extends ObservableValueBase implements if (success) { fireValueChangedEvent(); } else { - LOG.debug("Failed transiting into state {}: Expected state was not{}.", fromState, toState); + LOG.debug("Failed transiting into state {}: Expected state was not {}.", fromState, toState); } return success; } From eae5f4d8705064de5cbb7c8450dd6cecdbbec5ee Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Tue, 3 May 2022 16:08:01 +0200 Subject: [PATCH 02/53] Fix truncation if new size is larger than the current file size when FUSE is used to mount the vault Fixes #2218 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index edb24d63b..cff35715b 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.1.0 1.1.0 1.1.0 - 1.3.3 + 1.3.4 1.3.3 1.2.7 From 12ef32835ca6bb1a8f465a1361fc728b0aa9a4c1 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Tue, 3 May 2022 16:13:21 +0200 Subject: [PATCH 03/53] Prepare 1.6.10 [ci skip] --- dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml | 1 + pom.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml b/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml index 865ac739e..329e03d0b 100644 --- a/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml +++ b/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml @@ -66,6 +66,7 @@ + diff --git a/pom.xml b/pom.xml index cff35715b..1ddd62243 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.cryptomator cryptomator - 1.6.9 + 1.6.10 Cryptomator Desktop App From 1151157dff6b86bcf48d792061f54418f94229d6 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 5 May 2022 07:32:19 +0200 Subject: [PATCH 04/53] Report Download Stats (#2230) [ci skip] --- .github/workflows/dl-stats.yml | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/dl-stats.yml diff --git a/.github/workflows/dl-stats.yml b/.github/workflows/dl-stats.yml new file mode 100644 index 000000000..518a85360 --- /dev/null +++ b/.github/workflows/dl-stats.yml @@ -0,0 +1,64 @@ +name: Report Download Stats + +on: + schedule: + - cron: '0/15 * * * *' # run every 15 min + +jobs: + report-download-stats: + runs-on: ubuntu-latest + steps: + - name: Get download count of latest releases + id: get-stats + uses: actions/github-script@v6 + with: + script: | + const query = `query($owner:String!, $name:String!) { + repository(owner:$owner, name:$name){ + releases(first: 10, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { + isPrerelease + tagName + releaseAssets(first: 20) { + nodes { + name + downloadCount + } + } + } + } + } + }`; + const variables = { + owner: context.repo.owner, + name: context.repo.repo + } + return await github.graphql(query, variables) + - name: Transform Results + id: transform-stats + run: | + TIME=$(date +%s) + echo ${JSON_DATA} | jq --arg TIME "$TIME" -c '.repository.releases.nodes[] | select(.isPrerelease == false) | .tagName as $tagName | .releaseAssets.nodes[] | {filename: .name, downloads: .downloadCount, release: $tagName, time: ($TIME|tonumber)}' > input.json + + jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("_amd64.deb")) | {name: "github.releases.downloads", tags: ["file=deb", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x64.msi")) | {name: "github.releases.downloads", tags: ["file=msi", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x64.exe")) | {name: "github.releases.downloads", tags: ["file=exe", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-arm64.dmg")) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith(".dmg")) | select(.filename|endswith("-arm64.dmg")|not) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json + + RESULT=$(jq -s -c "." output.json) + echo "::set-output name=result::${RESULT}" + env: + JSON_DATA: ${{ steps.get-stats.outputs.result }} + - name: Upload Results + id: upload-stats + run: | + echo ${STATS} | curl -X POST -H "Authorization: Bearer ${BEARER_TOKEN}" -H "Content-Type: application/json" "https://graphite-us-central1.grafana.net/metrics" --data-binary @- + env: + BEARER_TOKEN : ${{ secrets.GRAFANA_GRAPHITE_TOKEN }} + STATS: ${{ steps.transform-stats.outputs.result }} + + + From d4367b97a633fae1a0bdf8dee6c5e9e9094fc8fd Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 5 May 2022 07:39:05 +0200 Subject: [PATCH 05/53] adjust interval to 900s, when reporting stats every 15min --- .github/workflows/dl-stats.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dl-stats.yml b/.github/workflows/dl-stats.yml index 518a85360..4d9035be4 100644 --- a/.github/workflows/dl-stats.yml +++ b/.github/workflows/dl-stats.yml @@ -2,7 +2,7 @@ name: Report Download Stats on: schedule: - - cron: '0/15 * * * *' # run every 15 min + - cron: '0/15 * * * *' # run every 15 min - don't forget to adjust the "interval" in the json sent to the metrics endpoint jobs: report-download-stats: @@ -40,13 +40,13 @@ jobs: TIME=$(date +%s) echo ${JSON_DATA} | jq --arg TIME "$TIME" -c '.repository.releases.nodes[] | select(.isPrerelease == false) | .tagName as $tagName | .releaseAssets.nodes[] | {filename: .name, downloads: .downloadCount, release: $tagName, time: ($TIME|tonumber)}' > input.json - jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("_amd64.deb")) | {name: "github.releases.downloads", tags: ["file=deb", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("-x64.msi")) | {name: "github.releases.downloads", tags: ["file=msi", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("-x64.exe")) | {name: "github.releases.downloads", tags: ["file=exe", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("-arm64.dmg")) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith(".dmg")) | select(.filename|endswith("-arm64.dmg")|not) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 86400, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("_amd64.deb")) | {name: "github.releases.downloads", tags: ["file=deb", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x64.msi")) | {name: "github.releases.downloads", tags: ["file=msi", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x64.exe")) | {name: "github.releases.downloads", tags: ["file=exe", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-arm64.dmg")) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith(".dmg")) | select(.filename|endswith("-arm64.dmg")|not) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json RESULT=$(jq -s -c "." output.json) echo "::set-output name=result::${RESULT}" From 3435a6701a5dfa748ecb77f1da6c7eede6bb4636 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 5 May 2022 07:41:36 +0200 Subject: [PATCH 06/53] round timestamp to latest 15min mark --- .github/workflows/dl-stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dl-stats.yml b/.github/workflows/dl-stats.yml index 4d9035be4..084e3ac41 100644 --- a/.github/workflows/dl-stats.yml +++ b/.github/workflows/dl-stats.yml @@ -37,7 +37,7 @@ jobs: - name: Transform Results id: transform-stats run: | - TIME=$(date +%s) + TIME=$(($(date +%s) / 900 * 900)) echo ${JSON_DATA} | jq --arg TIME "$TIME" -c '.repository.releases.nodes[] | select(.isPrerelease == false) | .tagName as $tagName | .releaseAssets.nodes[] | {filename: .name, downloads: .downloadCount, release: $tagName, time: ($TIME|tonumber)}' > input.json jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json From 31f77e62ead23ddf5000514b7f71650d58c5ae23 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 5 May 2022 07:44:28 +0200 Subject: [PATCH 07/53] configurable time interval --- .github/workflows/dl-stats.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dl-stats.yml b/.github/workflows/dl-stats.yml index 084e3ac41..9c50eea88 100644 --- a/.github/workflows/dl-stats.yml +++ b/.github/workflows/dl-stats.yml @@ -37,20 +37,21 @@ jobs: - name: Transform Results id: transform-stats run: | - TIME=$(($(date +%s) / 900 * 900)) - echo ${JSON_DATA} | jq --arg TIME "$TIME" -c '.repository.releases.nodes[] | select(.isPrerelease == false) | .tagName as $tagName | .releaseAssets.nodes[] | {filename: .name, downloads: .downloadCount, release: $tagName, time: ($TIME|tonumber)}' > input.json + TIME=$(($(date +%s) / $INTERVAL * $INTERVAL)) + echo ${JSON_DATA} | jq --arg TIME "$TIME" --arg INTERVAL "$INTERVAL" -c '.repository.releases.nodes[] | select(.isPrerelease == false) | .tagName as $tagName | .releaseAssets.nodes[] | {filename: .name, downloads: .downloadCount, release: $tagName, time: ($TIME|tonumber), interval: ($INTERVAL|tonumber)}' > input.json - jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("_amd64.deb")) | {name: "github.releases.downloads", tags: ["file=deb", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("-x64.msi")) | {name: "github.releases.downloads", tags: ["file=msi", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("-x64.exe")) | {name: "github.releases.downloads", tags: ["file=exe", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("-arm64.dmg")) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith(".dmg")) | select(.filename|endswith("-arm64.dmg")|not) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json - jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: 900, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("_amd64.deb")) | {name: "github.releases.downloads", tags: ["file=deb", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("-x64.msi")) | {name: "github.releases.downloads", tags: ["file=msi", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("-x64.exe")) | {name: "github.releases.downloads", tags: ["file=exe", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("-arm64.dmg")) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith(".dmg")) | select(.filename|endswith("-arm64.dmg")|not) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json RESULT=$(jq -s -c "." output.json) echo "::set-output name=result::${RESULT}" env: + INTERVAL: 900 JSON_DATA: ${{ steps.get-stats.outputs.result }} - name: Upload Results id: upload-stats From 0fdc5b28268762d14ab9f4e72a43892e58d8570b Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 5 May 2022 07:50:06 +0200 Subject: [PATCH 08/53] fix duplicate arm64 dmg and duplicate appimage [ci skip] --- .github/workflows/dl-stats.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dl-stats.yml b/.github/workflows/dl-stats.yml index 9c50eea88..81b63d3f1 100644 --- a/.github/workflows/dl-stats.yml +++ b/.github/workflows/dl-stats.yml @@ -41,12 +41,11 @@ jobs: echo ${JSON_DATA} | jq --arg TIME "$TIME" --arg INTERVAL "$INTERVAL" -c '.repository.releases.nodes[] | select(.isPrerelease == false) | .tagName as $tagName | .releaseAssets.nodes[] | {filename: .name, downloads: .downloadCount, release: $tagName, time: ($TIME|tonumber), interval: ($INTERVAL|tonumber)}' > input.json jq -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json - jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("_amd64.deb")) | {name: "github.releases.downloads", tags: ["file=deb", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json - jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("-x64.msi")) | {name: "github.releases.downloads", tags: ["file=msi", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json - jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("-x64.exe")) | {name: "github.releases.downloads", tags: ["file=exe", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json - jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("-arm64.dmg")) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json - jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith(".dmg")) | select(.filename|endswith("-arm64.dmg")|not) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json - jq --arg INTERVAL "$INTERVAL" -c 'select(.filename|endswith("-x86_64.AppImage")) | {name: "github.releases.downloads", tags: ["file=AppImage", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("_amd64.deb")) | {name: "github.releases.downloads", tags: ["file=deb", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x64.msi")) | {name: "github.releases.downloads", tags: ["file=msi", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-x64.exe")) | {name: "github.releases.downloads", tags: ["file=exe", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith("-arm64.dmg")) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=arm64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json + jq -c 'select(.filename|endswith(".dmg")) | select(.filename|endswith("-arm64.dmg")|not) | {name: "github.releases.downloads", tags: ["file=dmg", "version=\(.release)", "arch=amd64"], value: .downloads, interval: .interval, time: .time}' input.json >> output.json RESULT=$(jq -s -c "." output.json) echo "::set-output name=result::${RESULT}" From 6d082330e6dcfb5779cf265b5d93bda2ad519ec0 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 5 May 2022 08:00:21 +0200 Subject: [PATCH 09/53] replace failing curl with http-request-action [ci skip] --- .github/workflows/dl-stats.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dl-stats.yml b/.github/workflows/dl-stats.yml index 81b63d3f1..fceaea1d3 100644 --- a/.github/workflows/dl-stats.yml +++ b/.github/workflows/dl-stats.yml @@ -53,12 +53,10 @@ jobs: INTERVAL: 900 JSON_DATA: ${{ steps.get-stats.outputs.result }} - name: Upload Results - id: upload-stats - run: | - echo ${STATS} | curl -X POST -H "Authorization: Bearer ${BEARER_TOKEN}" -H "Content-Type: application/json" "https://graphite-us-central1.grafana.net/metrics" --data-binary @- - env: - BEARER_TOKEN : ${{ secrets.GRAFANA_GRAPHITE_TOKEN }} - STATS: ${{ steps.transform-stats.outputs.result }} - - - + uses: fjogeleit/http-request-action@v1 + with: + url: 'https://graphite-us-central1.grafana.net/metrics' + method: 'POST' + contentType: 'application/json' + bearerToken: ${{ secrets.GRAFANA_GRAPHITE_TOKEN }} + data: ${{ steps.transform-stats.outputs.result }} From 55f67785cd2eb112ae3101bd848cc4d778c803c1 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 5 May 2022 09:05:05 +0200 Subject: [PATCH 10/53] don't cause the job to fail if the upload fails [ci skip] --- .github/workflows/dl-stats.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dl-stats.yml b/.github/workflows/dl-stats.yml index fceaea1d3..0d9ca5dd7 100644 --- a/.github/workflows/dl-stats.yml +++ b/.github/workflows/dl-stats.yml @@ -60,3 +60,4 @@ jobs: contentType: 'application/json' bearerToken: ${{ secrets.GRAFANA_GRAPHITE_TOKEN }} data: ${{ steps.transform-stats.outputs.result }} + continue-on-error: true # currently there seems to be a problem with the metrics endpoint, failing every now and then From 5ba0e674f296c419a8be845b66013e7b151176e6 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 6 May 2022 13:13:45 +0200 Subject: [PATCH 11/53] Add automatic release to winget to msi/exe ci job --- .github/workflows/win-exe.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 3a9ed8ab0..2709c15e2 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -188,6 +188,21 @@ jobs: semVerStr: ${{ steps.versions.outputs.semVerStr }} revNum: ${{ steps.versions.outputs.revNum }} + publish-winget: + name: Publish on winget repo + runs-on: windows-latest + needs: [build-msi] + defaults: + run: + shell: pwsh + steps: + - name: Submit package to Windows Package Manager Community Repository + run: | + iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe + $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json + $installerUrl = $github.release.assets | Where-Object -Property name -match 'Cryptomator-*.msi' | Select -ExpandProperty browser_download_url -First 1 + .\wingetcreate.exe update Cryptomator.Cryptomator -s -v $github.release.tag_name -u $installerUrl -t ${{ secrets.CRYPTOBOT_WINGET_TOKEN }} + build-exe: name: Build .exe installer runs-on: windows-latest From f57d8dab6dc9d57a374f4aadc995a3410422595c Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 6 May 2022 17:34:04 +0200 Subject: [PATCH 12/53] instead of defining pwsh as default for winget job, only use it in specific step --- .github/workflows/win-exe.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 2709c15e2..fd13e0501 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -192,9 +192,6 @@ jobs: name: Publish on winget repo runs-on: windows-latest needs: [build-msi] - defaults: - run: - shell: pwsh steps: - name: Submit package to Windows Package Manager Community Repository run: | @@ -202,6 +199,7 @@ jobs: $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json $installerUrl = $github.release.assets | Where-Object -Property name -match 'Cryptomator-*.msi' | Select -ExpandProperty browser_download_url -First 1 .\wingetcreate.exe update Cryptomator.Cryptomator -s -v $github.release.tag_name -u $installerUrl -t ${{ secrets.CRYPTOBOT_WINGET_TOKEN }} + shell: pwsh build-exe: name: Build .exe installer From f50eb1f047782c4cb6e74c40428e9ff96ae2694b Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 9 May 2022 13:06:15 +0200 Subject: [PATCH 13/53] Revert "Reset webdavport field if changes are not applied and focus lost" This reverts commit c6e9e33feb5c92c413676214b75fdd73b5f4786c. --- .../ui/preferences/VolumePreferencesController.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java index 8f9f6f6da..4af86dc85 100644 --- a/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/VolumePreferencesController.java @@ -48,11 +48,6 @@ public class VolumePreferencesController implements FxController { webDavPortField.setText(String.valueOf(settings.port().get())); changeWebDavPortButton.visibleProperty().bind(settings.port().asString().isNotEqualTo(webDavPortField.textProperty())); changeWebDavPortButton.disableProperty().bind(Bindings.createBooleanBinding(this::validateWebDavPort, webDavPortField.textProperty()).not()); - webDavPortField.focusedProperty().addListener((observableValue, wasFocused, isFocused) -> { - if(!isFocused) { - webDavPortField.setText(String.valueOf(settings.port().get())); - } - }); webDavUrlSchemeChoiceBox.getItems().addAll(WebDavUrlScheme.values()); webDavUrlSchemeChoiceBox.valueProperty().bindBidirectional(settings.preferredGvfsScheme()); From 120be431ee51309e7bea5c2c4d5d5b4d2371349a Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Tue, 10 May 2022 11:36:40 +0200 Subject: [PATCH 14/53] prepare Cryptomator to eventually change the update check URL --- .../java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java index 8c9f7fb20..58b8653da 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java @@ -43,7 +43,9 @@ public abstract class UpdateCheckerModule { @FxApplicationScoped static Optional provideHttpClient() { try { - return Optional.of(HttpClient.newHttpClient()); + return Optional.of(HttpClient.newBuilder() // + .followRedirects(HttpClient.Redirect.NORMAL) // from version 1.6.11 onwards, Cryptomator can follow redirects, in case this URL ever changes + .build()); } catch (UncheckedIOException e) { LOG.error("HttpClient for update check cannot be created.", e); return Optional.empty(); From 0b2685f271434a06ff31c52e37d7a2912d06fbad Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Tue, 10 May 2022 15:23:02 +0200 Subject: [PATCH 15/53] adjusted .gitignore to latest IntelliJ IDEA standards see https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems [ci skip] --- .gitignore | 18 +------------- .idea/.gitignore | 12 +++++++++ .idea/compiler.xml | 51 +++++++++++++++++++++++++++++++++++++++ .idea/jarRepositories.xml | 25 +++++++++++++++++++ 4 files changed, 89 insertions(+), 17 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/jarRepositories.xml diff --git a/.gitignore b/.gitignore index 5c84c0dfb..796458fe6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,25 +5,9 @@ *.war *.ear -# Eclipse Settings Files # -.settings -.project -.classpath - # Maven # target/ pom.xml.versionsBackup -# IntelliJ Settings Files (https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems) # -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/shelf -.idea/dictionaries/** -!.idea/dictionaries/dict_* -.idea/compiler.xml -.idea/jarRepositories.xml -.idea/uiDesigner.xml -.idea/**/libraries/ -*.iml - +# Java Crash Logs hs_err_pid*.log \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..803eb5fa8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,12 @@ +# see https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems + +# Default ignored files +/shelf/ +/workspace.xml +/usage.statistics.xml +/dictionaries/ + +# generated from Maven +/modules.xml +/*.iml +/libraries/*.xml \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 000000000..18be437d6 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 000000000..c01c87f31 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file From a8b920698d680b8b3c33e995f5371d865daf8eb3 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 10 May 2022 16:32:59 +0200 Subject: [PATCH 16/53] Generify error message in installer --- dist/win/resources/customWizard.wxi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/win/resources/customWizard.wxi b/dist/win/resources/customWizard.wxi index ce82c2933..0cd34e44f 100644 --- a/dist/win/resources/customWizard.wxi +++ b/dist/win/resources/customWizard.wxi @@ -91,7 +91,7 @@ FOUNDRUNNINGAPP From 67027476527935b80d8dd52cb90454a8185d03c9 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 10 May 2022 18:35:04 +0200 Subject: [PATCH 17/53] separate cryptomator labels and asset paths from installer file --- dist/win/resources/main.wxs | 16 ++++++------- dist/win/resources/overrides.wxi | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 dist/win/resources/overrides.wxi diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 09b555caa..6df4439ab 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -86,12 +86,12 @@ - - - - + + + + - + @@ -130,12 +130,12 @@ diff --git a/dist/win/resources/overrides.wxi b/dist/win/resources/overrides.wxi new file mode 100644 index 000000000..3328ccec2 --- /dev/null +++ b/dist/win/resources/overrides.wxi @@ -0,0 +1,39 @@ + + + + + + + + + + + + From a29f10a5048a2421e33ab8934feec16e3f913081 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 12:22:29 +0200 Subject: [PATCH 18/53] refactor build scipt to be easiert customizable --- dist/win/build.bat | 15 +++++++- dist/win/build.ps1 | 61 +++++++++++++++++--------------- dist/win/resources/main.wxs | 2 +- dist/win/resources/overrides.wxi | 1 - 4 files changed, 47 insertions(+), 32 deletions(-) diff --git a/dist/win/build.bat b/dist/win/build.bat index 8ca9183b4..84013ec1b 100644 --- a/dist/win/build.bat +++ b/dist/win/build.bat @@ -1,2 +1,15 @@ @echo off -powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1 \ No newline at end of file +SET APPNAME="Cryptomator" +SET VENDOR="Skymatic GmbH" +SET FIRST_COPYRIGHT_YEAR=2016 +SET ABOUT_URL="https://cryptomator.org" +SET UPDATE_URL="https://cryptomator.org/downloads/" +SET HELP_URL="https://cryptomator.org/contact/" +powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1^ + -AppName %APPNAME%^ + -Vendor "%VENDOR%"^ + -CopyrightStartYear %FIRST_COPYRIGHT_YEAR%^ + -AboutUrl "%ABOUT_URL%"^ + -HelpUrl "%HELP_URL%"^ + -UpdateUrl "%UPDATE_URL%"^ + -Clean 1 \ No newline at end of file diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index abecdef61..84900f9ff 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -1,5 +1,13 @@ -# check parameters -$clean = $args[0] -eq "fresh" +Param( + [Parameter(Mandatory, HelpMessage="Please provide a name for the app")][string] $AppName, + [Parameter(Mandatory, HelpMessage="Please provide a valud path to an icon file")][string] $IconPath, + [Parameter(Mandatory, HelpMessage="Please provide the name of the vendor")][string] $Vendor, + [Parameter(Mandatory, HelpMessage="Please provide the starting year for the copyright notice")][int] $CopyrightStartYear, + [Parameter(Mandatory, HelpMessage="Please provide a help url")][string] $HelpUrl, + [Parameter(Mandatory, HelpMessage="Please provide an update url")][string] $UpdateUrl, + [Parameter(Mandatory, HelpMessage="Please provide an about url")][string] $AboutUrl, + [bool] $clean +) # check preconditions if ((Get-Command "git" -ErrorAction SilentlyContinue) -eq $null) @@ -24,8 +32,7 @@ Write-Output "`$revisionNo=$revisionNo" Write-Output "`$buildDir=$buildDir" Write-Output "`$Env:JAVA_HOME=$Env:JAVA_HOME" -$vendor = "Skymatic GmbH" -$copyright = "(C) 2016 - 2022 Skymatic GmbH" +$copyright = "(C) $CopyrightStartYear - $((Get-Date).Year) $Vendor" # compile &mvn -B -f $buildDir/../../pom.xml clean package -DskipTests -Pwin @@ -48,7 +55,7 @@ if ($clean -and (Test-Path -Path $runtimeImagePath)) { --strip-debug ` --compress=1 -$appPath = '.\Cryptomator' +$appPath = ".\$AppName" if ($clean -and (Test-Path -Path $appPath)) { Remove-Item -Path $appPath -Force -Recurse } @@ -62,20 +69,20 @@ if ($clean -and (Test-Path -Path $appPath)) { --module-path ../../target/mods ` --module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator ` --dest . ` - --name Cryptomator ` - --vendor $vendor ` + --name $AppName ` + --vendor $Vendor ` --copyright $copyright ` --java-options "-Xss5m" ` --java-options "-Xmx256m" ` --java-options "-Dcryptomator.appVersion=`"$semVerNo`"" ` --app-version "$semVerNo.$revisionNo" ` --java-options "-Dfile.encoding=`"utf-8`"" ` - --java-options "-Dcryptomator.logDir=`"~/AppData/Roaming/Cryptomator`"" ` - --java-options "-Dcryptomator.pluginDir=`"~/AppData/Roaming/Cryptomator/Plugins`"" ` - --java-options "-Dcryptomator.settingsPath=`"~/AppData/Roaming/Cryptomator/settings.json`"" ` - --java-options "-Dcryptomator.ipcSocketPath=`"~/AppData/Roaming/Cryptomator/ipc.socket`"" ` - --java-options "-Dcryptomator.keychainPath=`"~/AppData/Roaming/Cryptomator/keychain.json`"" ` - --java-options "-Dcryptomator.mountPointsDir=`"~/Cryptomator`"" ` + --java-options "-Dcryptomator.logDir=`"~/AppData/Roaming/$AppName`"" ` + --java-options "-Dcryptomator.pluginDir=`"~/AppData/Roaming/$AppName/Plugins`"" ` + --java-options "-Dcryptomator.settingsPath=`"~/AppData/Roaming/$AppName/settings.json`"" ` + --java-options "-Dcryptomator.ipcSocketPath=`"~/AppData/Roaming/$AppName/ipc.socket`"" ` + --java-options "-Dcryptomator.keychainPath=`"~/AppData/Roaming/$AppName/keychain.json`"" ` + --java-options "-Dcryptomator.mountPointsDir=`"~/$AppName`"" ` --java-options "-Dcryptomator.showTrayIcon=true" ` --java-options "-Dcryptomator.buildNumber=`"msi-$revisionNo`"" ` --resource-dir resources ` @@ -92,12 +99,8 @@ if ($clean -and (Test-Path -Path $appPath)) { "-Dlicense.licenseMergesUrl=file:///$buildDir/../../license/merges" # patch app dir -Copy-Item "contrib\*" -Destination "Cryptomator" -attrib -r "Cryptomator\Cryptomator.exe" - -$aboutUrl="https://cryptomator.org" -$updateUrl="https://cryptomator.org/downloads/" -$helpUrl="https://cryptomator.org/contact/" +Copy-Item "contrib\*" -Destination "$AppName" +attrib -r "$AppName\$AppName.exe" # create .msi $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" @@ -107,18 +110,18 @@ $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775 ` --app-image Cryptomator ` --dest installer ` - --name Cryptomator ` - --vendor $vendor ` + --name $AppName ` + --vendor $Vendor ` --copyright $copyright ` --app-version "$semVerNo" ` --win-menu ` --win-dir-chooser ` --win-shortcut-prompt ` - --win-update-url $updateUrl ` - --win-menu-group Cryptomator ` + --win-menu-group $AppName ` --resource-dir resources ` - --about-url $aboutUrl ` --license-file resources/license.rtf ` + --win-update-url $UpdateUrl ` + --about-url $AboutUrl ` --file-associations resources/FAvaultFile.properties #Create RTF license for bundle @@ -139,14 +142,14 @@ Write-Output "Downloading ${winfspMsiUrl}..." Invoke-WebRequest $winfspMsiUrl -OutFile ".\bundle\resources\winfsp.msi" # redirects are followed by default # copy MSI to bundle resources -Copy-Item ".\installer\Cryptomator-*.msi" -Destination ".\bundle\resources\Cryptomator.msi" +Copy-Item ".\installer\$AppName-*.msi" -Destination ".\bundle\resources\$AppName.msi" # create bundle including winfsp & "$env:WIX\bin\candle.exe" .\bundle\bundleWithWinfsp.wxs -ext WixBalExtension -out bundle\ ` -dBundleVersion="$semVerNo.$revisionNo" ` - -dBundleVendor="$vendor" ` + -dBundleVendor="$Vendor" ` -dBundleCopyright="$copyright" ` - -dAboutUrl="$aboutUrl" ` - -dHelpUrl="$helpUrl" ` - -dUpdateUrl="$updateUrl" + -dAboutUrl="$AboutUrl" ` + -dHelpUrl="$HelpUrl" ` + -dUpdateUrl="$UpdateUrl" & "$env:WIX\bin\light.exe" -b . .\bundle\BundlewithWinfsp.wixobj -ext WixBalExtension -out installer\Cryptomator-Installer.exe \ No newline at end of file diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 6df4439ab..26f968fbd 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -86,7 +86,7 @@ - + diff --git a/dist/win/resources/overrides.wxi b/dist/win/resources/overrides.wxi index 3328ccec2..41194fa05 100644 --- a/dist/win/resources/overrides.wxi +++ b/dist/win/resources/overrides.wxi @@ -31,7 +31,6 @@ Default value is `yes`. --> - From 90d43f28d9bfac49c968f727060e1b33fe8681e6 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 12:25:53 +0200 Subject: [PATCH 19/53] eradicate last hard coded app name occurences in build script --- dist/win/build.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index 84900f9ff..25b4cfea8 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -1,6 +1,5 @@ Param( [Parameter(Mandatory, HelpMessage="Please provide a name for the app")][string] $AppName, - [Parameter(Mandatory, HelpMessage="Please provide a valud path to an icon file")][string] $IconPath, [Parameter(Mandatory, HelpMessage="Please provide the name of the vendor")][string] $Vendor, [Parameter(Mandatory, HelpMessage="Please provide the starting year for the copyright notice")][int] $CopyrightStartYear, [Parameter(Mandatory, HelpMessage="Please provide a help url")][string] $HelpUrl, @@ -86,7 +85,7 @@ if ($clean -and (Test-Path -Path $appPath)) { --java-options "-Dcryptomator.showTrayIcon=true" ` --java-options "-Dcryptomator.buildNumber=`"msi-$revisionNo`"" ` --resource-dir resources ` - --icon resources/Cryptomator.ico + --icon resources/$AppName.ico #Create RTF license for msi &mvn -B -f $buildDir/../../pom.xml license:add-third-party ` @@ -108,7 +107,7 @@ $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" --verbose ` --type msi ` --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775 ` - --app-image Cryptomator ` + --app-image $AppName ` --dest installer ` --name $AppName ` --vendor $Vendor ` @@ -152,4 +151,4 @@ Copy-Item ".\installer\$AppName-*.msi" -Destination ".\bundle\resources\$AppName -dAboutUrl="$AboutUrl" ` -dHelpUrl="$HelpUrl" ` -dUpdateUrl="$UpdateUrl" -& "$env:WIX\bin\light.exe" -b . .\bundle\BundlewithWinfsp.wixobj -ext WixBalExtension -out installer\Cryptomator-Installer.exe \ No newline at end of file +& "$env:WIX\bin\light.exe" -b . .\bundle\BundlewithWinfsp.wixobj -ext WixBalExtension -out installer\$AppName-Installer.exe \ No newline at end of file From fb3d64c43f858633417577770d8250fe2bb326cb Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 12:41:33 +0200 Subject: [PATCH 20/53] update integrations-win dependency --- dist/win/build.ps1 | 1 + pom.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index abecdef61..61a2ab42e 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -76,6 +76,7 @@ if ($clean -and (Test-Path -Path $appPath)) { --java-options "-Dcryptomator.ipcSocketPath=`"~/AppData/Roaming/Cryptomator/ipc.socket`"" ` --java-options "-Dcryptomator.keychainPath=`"~/AppData/Roaming/Cryptomator/keychain.json`"" ` --java-options "-Dcryptomator.mountPointsDir=`"~/Cryptomator`"" ` + --java-options "-Dcryptomator.integrationsWin.autoStartShellLinkName=`"Cryptomator`"" ` --java-options "-Dcryptomator.showTrayIcon=true" ` --java-options "-Dcryptomator.buildNumber=`"msi-$revisionNo`"" ` --resource-dir resources ` diff --git a/pom.xml b/pom.xml index c4290f374..25e874630 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 2.4.1 1.1.0 - 1.1.0 + 1.1.1 1.1.0 1.1.0 1.3.4 From 0f88e6c2fe44e39824146bed5b72e2f8a72e31cf Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 12:48:56 +0200 Subject: [PATCH 21/53] fix errors --- dist/win/build.bat | 2 +- dist/win/resources/main.wxs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/win/build.bat b/dist/win/build.bat index 84013ec1b..b65bda600 100644 --- a/dist/win/build.bat +++ b/dist/win/build.bat @@ -7,7 +7,7 @@ SET UPDATE_URL="https://cryptomator.org/downloads/" SET HELP_URL="https://cryptomator.org/contact/" powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1^ -AppName %APPNAME%^ - -Vendor "%VENDOR%"^ + -Vendor ""%VENDOR%""^ -CopyrightStartYear %FIRST_COPYRIGHT_YEAR%^ -AboutUrl "%ABOUT_URL%"^ -HelpUrl "%HELP_URL%"^ diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 26f968fbd..9397bab8a 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -86,7 +86,7 @@ - + From a3d4eb6048c1b97f30c5cc9da9172349002866ba Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Wed, 11 May 2022 12:51:48 +0200 Subject: [PATCH 22/53] adjust build to integrations-win 1.1.1 --- .github/workflows/win-exe.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index fd13e0501..02e3167c3 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -97,6 +97,7 @@ jobs: --java-options "-Dcryptomator.mountPointsDir=\"~/Cryptomator\"" --java-options "-Dcryptomator.showTrayIcon=true" --java-options "-Dcryptomator.buildNumber=\"msi-${{ steps.versions.outputs.revNum }}\"" + --java-options "-Dcryptomator.integrationsWin.autoStartShellLinkName=\"Cryptomator\"" --resource-dir dist/win/resources --icon dist/win/resources/Cryptomator.ico - name: Patch Application Directory From 80696972cb433d569e64495489878244f32839d5 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 13:00:32 +0200 Subject: [PATCH 23/53] allow upgrade-uuid to be customized in build script --- dist/win/build.bat | 4 ++++ dist/win/build.ps1 | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/win/build.bat b/dist/win/build.bat index b65bda600..b2ec68225 100644 --- a/dist/win/build.bat +++ b/dist/win/build.bat @@ -1,12 +1,16 @@ @echo off +:: Default values for Cryptomator builds SET APPNAME="Cryptomator" +SET UPGRADE_UUID="bda45523-42b1-4cae-9354-a45475ed4775" SET VENDOR="Skymatic GmbH" SET FIRST_COPYRIGHT_YEAR=2016 SET ABOUT_URL="https://cryptomator.org" SET UPDATE_URL="https://cryptomator.org/downloads/" SET HELP_URL="https://cryptomator.org/contact/" + powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1^ -AppName %APPNAME%^ + -UpgradeUUID "%UPGRADE_UUID%"^ -Vendor ""%VENDOR%""^ -CopyrightStartYear %FIRST_COPYRIGHT_YEAR%^ -AboutUrl "%ABOUT_URL%"^ diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index 7e812ebb2..23c897ab6 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -1,5 +1,6 @@ Param( [Parameter(Mandatory, HelpMessage="Please provide a name for the app")][string] $AppName, + [Parameter(Mandatory, HelpMessage="Please provide the windows upgrade uuid for the app")][string] $UpgradeUUID, [Parameter(Mandatory, HelpMessage="Please provide the name of the vendor")][string] $Vendor, [Parameter(Mandatory, HelpMessage="Please provide the starting year for the copyright notice")][int] $CopyrightStartYear, [Parameter(Mandatory, HelpMessage="Please provide a help url")][string] $HelpUrl, @@ -107,7 +108,7 @@ $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" & "$Env:JAVA_HOME\bin\jpackage" ` --verbose ` --type msi ` - --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775 ` + --win-upgrade-uuid $UpgradeUUID ` --app-image $AppName ` --dest installer ` --name $AppName ` From 98002f63dc7c5109cc736da6400a799e2b85b71b Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 12 May 2022 08:45:03 +0200 Subject: [PATCH 24/53] Use enum for well-known local cloud storage paths and move class to commons package --- .../cryptomator/common/LocationPreset.java | 60 +++++++++++++++++++ .../CreateNewVaultLocationController.java | 6 +- ...sets.java => ObservedLocationPresets.java} | 46 ++++---------- .../resources/fxml/addvault_new_location.fxml | 12 ++-- 4 files changed, 79 insertions(+), 45 deletions(-) create mode 100644 src/main/java/org/cryptomator/common/LocationPreset.java rename src/main/java/org/cryptomator/ui/addvaultwizard/{LocationPresets.java => ObservedLocationPresets.java} (64%) diff --git a/src/main/java/org/cryptomator/common/LocationPreset.java b/src/main/java/org/cryptomator/common/LocationPreset.java new file mode 100644 index 000000000..1c984160c --- /dev/null +++ b/src/main/java/org/cryptomator/common/LocationPreset.java @@ -0,0 +1,60 @@ +package org.cryptomator.common; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.List; + +/** + * Enum of common cloud providers and their default local storage location path. + */ +public enum LocationPreset { + + DROPBOX("Dropbox", "~/Dropbox"), + ICLOUD("iCloud Drive", "~/Library/Mobile Documents/com~apple~CloudDocs", "~/iCloudDrive"), + GDRIVE("Google Drive", "~/Google Drive/My Drive", "~/Google Drive"), + MEGA("MEGA", "~/MEGA"), + ONEDRIVE("OneDrive", "~/OneDrive"), + PCLOUD("pCloud", "~/pCloudDrive"), + + LOCAL("local"); + + final String name; + final List candidates; + + LocationPreset(String name, String... candidates) { + this.name = name; + + String userHome = System.getProperty("user.home"); + this.candidates = Arrays.stream(candidates).map(c -> LocationPreset.resolveHomePath(userHome, c)).map(Path::of).toList(); + } + + private static String resolveHomePath(String home, String path) { + if (path.startsWith("~/")) { + return home + path.substring(1); + } else { + return path; + } + } + + /** + * Checks for this LocationPreset if any of the associated paths exist. + * + * @return the first existing path or null, if none exists. + */ + public Path existingPath() { + for (Path candidate : candidates) { + if (Files.isDirectory(candidate)) { + return candidate; + } + } + return null; + } + + @Override + public String toString() { + return name; + } + +} + diff --git a/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java b/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java index 1fd463432..cadccc091 100644 --- a/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java +++ b/src/main/java/org/cryptomator/ui/addvaultwizard/CreateNewVaultLocationController.java @@ -46,7 +46,7 @@ public class CreateNewVaultLocationController implements FxController { private final Stage window; private final Lazy chooseNameScene; private final Lazy choosePasswordScene; - private final LocationPresets locationPresets; + private final ObservedLocationPresets locationPresets; private final ObjectProperty vaultPath; private final StringProperty vaultName; private final ResourceBundle resourceBundle; @@ -71,7 +71,7 @@ public class CreateNewVaultLocationController implements FxController { public FontAwesome5IconView badLocation; @Inject - CreateNewVaultLocationController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_NAME) Lazy chooseNameScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_PASSWORD) Lazy choosePasswordScene, LocationPresets locationPresets, ObjectProperty vaultPath, @Named("vaultName") StringProperty vaultName, ResourceBundle resourceBundle) { + CreateNewVaultLocationController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_NEW_NAME) Lazy chooseNameScene, @FxmlScene(FxmlFile.ADDVAULT_NEW_PASSWORD) Lazy choosePasswordScene, ObservedLocationPresets locationPresets, ObjectProperty vaultPath, @Named("vaultName") StringProperty vaultName, ResourceBundle resourceBundle) { this.window = window; this.chooseNameScene = chooseNameScene; this.choosePasswordScene = choosePasswordScene; @@ -197,7 +197,7 @@ public class CreateNewVaultLocationController implements FxController { return validVaultPath.get(); } - public LocationPresets getLocationPresets() { + public ObservedLocationPresets getObservedLocationPresets() { return locationPresets; } diff --git a/src/main/java/org/cryptomator/ui/addvaultwizard/LocationPresets.java b/src/main/java/org/cryptomator/ui/addvaultwizard/ObservedLocationPresets.java similarity index 64% rename from src/main/java/org/cryptomator/ui/addvaultwizard/LocationPresets.java rename to src/main/java/org/cryptomator/ui/addvaultwizard/ObservedLocationPresets.java index 313a31dc9..0a057845b 100644 --- a/src/main/java/org/cryptomator/ui/addvaultwizard/LocationPresets.java +++ b/src/main/java/org/cryptomator/ui/addvaultwizard/ObservedLocationPresets.java @@ -1,23 +1,15 @@ package org.cryptomator.ui.addvaultwizard; +import org.cryptomator.common.LocationPreset; + import javax.inject.Inject; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.ReadOnlyObjectProperty; import javafx.beans.property.SimpleObjectProperty; -import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; @AddVaultWizardScoped -public class LocationPresets { - - private static final String USER_HOME = System.getProperty("user.home"); - private static final String[] ICLOUDDRIVE_LOCATIONS = {"~/Library/Mobile Documents/iCloud~com~setolabs~Cryptomator/Documents", "~/iCloudDrive/iCloud~com~setolabs~Cryptomator"}; - private static final String[] DROPBOX_LOCATIONS = {"~/Dropbox"}; - private static final String[] GDRIVE_LOCATIONS = {"~/Google Drive/My Drive", "~/Google Drive"}; - private static final String[] ONEDRIVE_LOCATIONS = {"~/OneDrive"}; - private static final String[] MEGA_LOCATIONS = {"~/MEGA"}; - private static final String[] PCLOUD_LOCATIONS = {"~/pCloudDrive"}; +public class ObservedLocationPresets { private final ReadOnlyObjectProperty iclouddriveLocation; private final ReadOnlyObjectProperty dropboxLocation; @@ -33,13 +25,13 @@ public class LocationPresets { private final BooleanBinding foundPcloud; @Inject - public LocationPresets() { - this.iclouddriveLocation = new SimpleObjectProperty<>(existingWritablePath(ICLOUDDRIVE_LOCATIONS)); - this.dropboxLocation = new SimpleObjectProperty<>(existingWritablePath(DROPBOX_LOCATIONS)); - this.gdriveLocation = new SimpleObjectProperty<>(existingWritablePath(GDRIVE_LOCATIONS)); - this.onedriveLocation = new SimpleObjectProperty<>(existingWritablePath(ONEDRIVE_LOCATIONS)); - this.megaLocation = new SimpleObjectProperty<>(existingWritablePath(MEGA_LOCATIONS)); - this.pcloudLocation = new SimpleObjectProperty<>(existingWritablePath(PCLOUD_LOCATIONS)); + public ObservedLocationPresets() { + this.iclouddriveLocation = new SimpleObjectProperty<>(LocationPreset.ICLOUD.existingPath()); + this.dropboxLocation = new SimpleObjectProperty<>(LocationPreset.DROPBOX.existingPath()); + this.gdriveLocation = new SimpleObjectProperty<>(LocationPreset.GDRIVE.existingPath()); + this.onedriveLocation = new SimpleObjectProperty<>(LocationPreset.ONEDRIVE.existingPath()); + this.megaLocation = new SimpleObjectProperty<>(LocationPreset.MEGA.existingPath()); + this.pcloudLocation = new SimpleObjectProperty<>(LocationPreset.PCLOUD.existingPath()); this.foundIclouddrive = iclouddriveLocation.isNotNull(); this.foundDropbox = dropboxLocation.isNotNull(); this.foundGdrive = gdriveLocation.isNotNull(); @@ -48,24 +40,6 @@ public class LocationPresets { this.foundPcloud = pcloudLocation.isNotNull(); } - private static Path existingWritablePath(String... candidates) { - for (String candidate : candidates) { - Path path = Paths.get(resolveHomePath(candidate)); - if (Files.isDirectory(path)) { - return path; - } - } - return null; - } - - private static String resolveHomePath(String path) { - if (path.startsWith("~/")) { - return USER_HOME + path.substring(1); - } else { - return path; - } - } - /* Observables */ public ReadOnlyObjectProperty iclouddriveLocationProperty() { diff --git a/src/main/resources/fxml/addvault_new_location.fxml b/src/main/resources/fxml/addvault_new_location.fxml index 3c25ba569..343a2d580 100644 --- a/src/main/resources/fxml/addvault_new_location.fxml +++ b/src/main/resources/fxml/addvault_new_location.fxml @@ -31,12 +31,12 @@