From 93b4cbfb2c473fa06fef67ddb7d263796925be6e Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 26 Sep 2023 13:42:18 +0200 Subject: [PATCH 01/13] add test script --- dist/win/signJarDlls.ps1 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 dist/win/signJarDlls.ps1 diff --git a/dist/win/signJarDlls.ps1 b/dist/win/signJarDlls.ps1 new file mode 100644 index 000000000..701ed69ff --- /dev/null +++ b/dist/win/signJarDlls.ps1 @@ -0,0 +1,23 @@ +<# +1. Select jar file +2. extract jar to own directory +3. Sign everything +4. Update dlls in the jar +#> + +New-Item -Path ".\extract" -ItemType Directory +Get-ChildItem -Path "." -File *.jar | ForEach-Object { + $jar = Copy-Item $_ -Destination ".\extract" -PassThru + Set-Location -Path ".\extract" + "Extracting jar $($jar.FullName)" + jar --file=$($_.FullName) --extract + Get-ChildItem -Path "." -Recurse -File "*.dll" | ForEach-Object { + <# pipe into signtool, here we are just writing something into the file #> + Set-Content -Path $_ -Value "Hello" + jar --file=$($jar.FullName) --update $(Resolve-Path -Relative -Path $_) + } + Move-Item -Path $($jar.FullName) -Destination $_ -Force + Remove-Item -Path ".\*" -Force -Recurse + Set-Location -Path ".." +} +Remove-Item -Path ".\extract" \ No newline at end of file From d85733590147a25e5ebd1812fd81e94f6bb84e8e Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 26 Sep 2023 16:43:00 +0200 Subject: [PATCH 02/13] update test script: * use variables * use signtool * find newest signtool version --- dist/win/signJarDlls.ps1 | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/dist/win/signJarDlls.ps1 b/dist/win/signJarDlls.ps1 index 701ed69ff..edf55aed0 100644 --- a/dist/win/signJarDlls.ps1 +++ b/dist/win/signJarDlls.ps1 @@ -1,23 +1,32 @@ -<# -1. Select jar file -2. extract jar to own directory -3. Sign everything -4. Update dlls in the jar -#> -New-Item -Path ".\extract" -ItemType Directory -Get-ChildItem -Path "." -File *.jar | ForEach-Object { - $jar = Copy-Item $_ -Destination ".\extract" -PassThru - Set-Location -Path ".\extract" +$certificateSHA1 = 5FC94CE149E5B511E621F53A060AC67CBD446B3A +$description = Cryptomator +$timestampUrl = 'http://timestamp.digicert.com' +$folder = ".\appdir\Cryptomator" +$tmpDir = ".\extract" +$signtool = $(Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/" -Recurse -File signtool.exe | Where-Object { $_.Directory.ToString().EndsWith("x64")} | Select-Object -Last 1).FullName + +# import certificate + +# create directory to extract every jar to +New-Item -Path $tmpDir -ItemType Directory +# iterate over all jars +Get-ChildItem -Path $folder -Recurse -File *.jar | ForEach-Object { + $jar = Copy-Item $_ -Destination $tmpDir -PassThru + Set-Location -Path $tmpDir "Extracting jar $($jar.FullName)" jar --file=$($_.FullName) --extract Get-ChildItem -Path "." -Recurse -File "*.dll" | ForEach-Object { - <# pipe into signtool, here we are just writing something into the file #> - Set-Content -Path $_ -Value "Hello" + # sign + & $signtool sign /sm /tr ${timestampUrl} /td SH256 /fd SHA256 /d $description /sha1 $certificateSHA1 $_.FullName + # update jar with signed dll jar --file=$($jar.FullName) --update $(Resolve-Path -Relative -Path $_) } + # replace old jar with its update Move-Item -Path $($jar.FullName) -Destination $_ -Force + # clear extraction dir Remove-Item -Path ".\*" -Force -Recurse Set-Location -Path ".." } -Remove-Item -Path ".\extract" \ No newline at end of file +# clean up +Remove-Item -Path $tmpDir \ No newline at end of file From fadd6b761fc308b0e5b3364724427a671533c5dd Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 26 Sep 2023 17:30:18 +0200 Subject: [PATCH 03/13] add cert import --- dist/win/signJarDlls.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dist/win/signJarDlls.ps1 b/dist/win/signJarDlls.ps1 index edf55aed0..3f185e249 100644 --- a/dist/win/signJarDlls.ps1 +++ b/dist/win/signJarDlls.ps1 @@ -1,4 +1,5 @@ - +$certificate = 'abc' +$password = 'secret' $certificateSHA1 = 5FC94CE149E5B511E621F53A060AC67CBD446B3A $description = Cryptomator $timestampUrl = 'http://timestamp.digicert.com' @@ -6,7 +7,14 @@ $folder = ".\appdir\Cryptomator" $tmpDir = ".\extract" $signtool = $(Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/" -Recurse -File signtool.exe | Where-Object { $_.Directory.ToString().EndsWith("x64")} | Select-Object -Last 1).FullName +# preps +# does this work on CI? +Install-Module -Name Microsoft.PowerShell.TextUtility + # import certificate +$bytes = ConvertFrom-Base64 -EncodedText $certificate -AsByteArray +Set-Content -Path $certificateFile -AsByteStream -Value $bytes +& certutil -f -p $password -importpfx $certificateFile # create directory to extract every jar to New-Item -Path $tmpDir -ItemType Directory From 29fedcd39032e12d09e6f5473e4cea2574632431 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 26 Sep 2023 17:30:56 +0200 Subject: [PATCH 04/13] integrate code from test script into github workflow --- .github/workflows/win-exe.yml | 46 ++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 066b7d49e..b54d6731c 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -143,9 +143,47 @@ jobs: - name: Fix permissions run: attrib -r appdir/Cryptomator/Cryptomator.exe shell: pwsh - - name: Extract integrations DLL for code signing + - name: Codesign binaries inside jars + run: | + $certificate = '${{ secrets.WIN_CODESIGN_P12_BASE64 }}' + $password = '${{ secrets.WIN_CODESIGN_P12_PW }}' + $certificateSHA1 = '5FC94CE149E5B511E621F53A060AC67CBD446B3A' + $description = 'Cryptomator' + $timestampUrl = 'http://timestamp.digicert.com' + $folder = ".\appdir\Cryptomator\app" + $tmpDir = ".\extract" + $signtool = $(Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\bin\' -Recurse -File signtool.exe | Where-Object { $_.Directory.ToString().EndsWith('x64') } | Select-Object -Last 1).FullName + + # preps + Install-Module -Name Microsoft.PowerShell.TextUtility -Force -Confirm:$False + + # import certificate + $bytes = ConvertFrom-Base64 -EncodedText $certificate -AsByteArray + Set-Content -Path ".\certFile" -AsByteStream -Value $bytes + & certutil -f -p $password -importpfx ".\certFile" + + # create directory to extract every jar to + New-Item -Path $tmpDir -ItemType Directory + # iterate over all jars + Get-ChildItem -Path $folder -Recurse -File *.jar | ForEach-Object { + $jar = Copy-Item $_ -Destination $tmpDir -PassThru + Set-Location -Path $tmpDir + jar --file=$($_.FullName) --extract + Get-ChildItem -Path "." -Recurse -File "*.dll" | ForEach-Object { + # sign + & $signtool sign /sm /tr ${timestampUrl} /td SHA256 /fd SHA256 /d $description /sha1 $certificateSHA1 $_.FullName + # update jar with signed dll + jar --file=$($jar.FullName) --update $(Resolve-Path -Relative -Path $_) + } + # replace old jar with its update + Move-Item -Path $($jar.FullName) -Destination $_ -Force + # clear extraction dir + Remove-Item -Path ".\*" -Force -Recurse + Set-Location -Path ".." + } + # clean up + Remove-Item -Path $tmpDir shell: pwsh - run: gci ./appdir/Cryptomator/app/mods/ -File integrations-win-*.jar | ForEach-Object {Set-Location -Path $_.Directory; jar --file=$($_.FullName) --extract integrations.dll } - name: Codesign uses: skymatic/code-sign-action@v2 with: @@ -156,10 +194,6 @@ jobs: timestampUrl: 'http://timestamp.digicert.com' folder: appdir/Cryptomator recursive: true - - name: Repack signed DLL into jar - shell: pwsh - run: | - gci ./appdir/Cryptomator/app/mods/ -File integrations-win-*.jar | ForEach-Object {Set-Location -Path $_.Directory; jar --file=$($_.FullName) --update integrations.dll; Remove-Item integrations.dll} - name: Generate license for MSI run: > mvn -B license:add-third-party From 15885545b58036d2c9318a94da5681399a01cdb4 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 27 Sep 2023 11:13:52 +0200 Subject: [PATCH 05/13] supress some output --- .github/workflows/win-exe.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index b54d6731c..3b43a24ec 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -163,7 +163,7 @@ jobs: & certutil -f -p $password -importpfx ".\certFile" # create directory to extract every jar to - New-Item -Path $tmpDir -ItemType Directory + New-Item -Path $tmpDir -ItemType Directory > $null # iterate over all jars Get-ChildItem -Path $folder -Recurse -File *.jar | ForEach-Object { $jar = Copy-Item $_ -Destination $tmpDir -PassThru From ce466e7715414238ecb1ccc26ccff485a994df5b Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 28 Sep 2023 13:42:16 +0200 Subject: [PATCH 06/13] fixes #3130 --- .github/workflows/win-exe.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 3b43a24ec..2b0352e79 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -14,7 +14,7 @@ on: env: - JAVA_DIST: 'temurin' + JAVA_DIST: 'corretto' JAVA_VERSION: 20 OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/20.0.2/openjfx-20.0.2_windows-x64_bin-jmods.zip' OPENJFX_JMODS_AMD64_HASH: '18625bbc13c57dbf802486564247a8d8cab72ec558c240a401bf6440384ebd77' From ae50846257d673a8bfb561fc7e00b5bfa769b4cb Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 28 Sep 2023 18:33:01 +0200 Subject: [PATCH 07/13] Revert ce466e7715414238ecb1ccc26ccff485a994df5b --- .github/workflows/win-exe.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 2b0352e79..3b43a24ec 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -14,7 +14,7 @@ on: env: - JAVA_DIST: 'corretto' + JAVA_DIST: 'temurin' JAVA_VERSION: 20 OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/20.0.2/openjfx-20.0.2_windows-x64_bin-jmods.zip' OPENJFX_JMODS_AMD64_HASH: '18625bbc13c57dbf802486564247a8d8cab72ec558c240a401bf6440384ebd77' From 7bc47fe6d72f97d950fdcfb8777e4b490d9dcc4b Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 28 Sep 2023 18:33:26 +0200 Subject: [PATCH 08/13] Really fixes #3130 --- .github/workflows/win-exe.yml | 9 ++++++++- dist/win/build.ps1 | 1 + dist/win/resources/main.wxs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 3b43a24ec..c6ebdecbb 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -184,6 +184,12 @@ jobs: # clean up Remove-Item -Path $tmpDir shell: pwsh + - name: Extract wixhelper.dll for Codesigning #see https://github.com/cryptomator/cryptomator/issues/3130 + run: | + New-Item -Path appdir/jpackage-jmod -ItemType Directory + & $env:JAVA_HOME\bin\jmod.exe extract --dir jpackage-jmod "${env:JAVA_HOME}\jmods\jdk.jpackage.jmod" + Get-ChildItem -Recurse -Path "jpackage-jmod" -File wixhelper.dll | Select-Object -Last 1 | Copy-Item -Destination "appdir" + shell: pwsh - name: Codesign uses: skymatic/code-sign-action@v2 with: @@ -192,7 +198,7 @@ jobs: certificatesha1: 5FC94CE149E5B511E621F53A060AC67CBD446B3A description: Cryptomator timestampUrl: 'http://timestamp.digicert.com' - folder: appdir/Cryptomator + folder: appdir recursive: true - name: Generate license for MSI run: > @@ -227,6 +233,7 @@ jobs: --file-associations dist/win/resources/FAvaultFile.properties env: JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs + JP_WIXHELPER_DIR: ${{ github.workspace }}\appdir - name: Codesign MSI uses: skymatic/code-sign-action@v2 with: diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index d011f7cc6..9d2fb0def 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -144,6 +144,7 @@ try { # create .msi $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" +$Env:JP_WIXHELPER_DIR = "." & "$Env:JAVA_HOME\bin\jpackage" ` --verbose ` --type msi ` diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index c940b9f9a..2fe2eb348 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -70,7 +70,7 @@ - + From 0d805b2d432e8a4ca35410a72aca18adb45066ff Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 28 Sep 2023 18:34:38 +0200 Subject: [PATCH 09/13] clean up --- dist/win/signJarDlls.ps1 | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 dist/win/signJarDlls.ps1 diff --git a/dist/win/signJarDlls.ps1 b/dist/win/signJarDlls.ps1 deleted file mode 100644 index 3f185e249..000000000 --- a/dist/win/signJarDlls.ps1 +++ /dev/null @@ -1,40 +0,0 @@ -$certificate = 'abc' -$password = 'secret' -$certificateSHA1 = 5FC94CE149E5B511E621F53A060AC67CBD446B3A -$description = Cryptomator -$timestampUrl = 'http://timestamp.digicert.com' -$folder = ".\appdir\Cryptomator" -$tmpDir = ".\extract" -$signtool = $(Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/" -Recurse -File signtool.exe | Where-Object { $_.Directory.ToString().EndsWith("x64")} | Select-Object -Last 1).FullName - -# preps -# does this work on CI? -Install-Module -Name Microsoft.PowerShell.TextUtility - -# import certificate -$bytes = ConvertFrom-Base64 -EncodedText $certificate -AsByteArray -Set-Content -Path $certificateFile -AsByteStream -Value $bytes -& certutil -f -p $password -importpfx $certificateFile - -# create directory to extract every jar to -New-Item -Path $tmpDir -ItemType Directory -# iterate over all jars -Get-ChildItem -Path $folder -Recurse -File *.jar | ForEach-Object { - $jar = Copy-Item $_ -Destination $tmpDir -PassThru - Set-Location -Path $tmpDir - "Extracting jar $($jar.FullName)" - jar --file=$($_.FullName) --extract - Get-ChildItem -Path "." -Recurse -File "*.dll" | ForEach-Object { - # sign - & $signtool sign /sm /tr ${timestampUrl} /td SH256 /fd SHA256 /d $description /sha1 $certificateSHA1 $_.FullName - # update jar with signed dll - jar --file=$($jar.FullName) --update $(Resolve-Path -Relative -Path $_) - } - # replace old jar with its update - Move-Item -Path $($jar.FullName) -Destination $_ -Force - # clear extraction dir - Remove-Item -Path ".\*" -Force -Recurse - Set-Location -Path ".." -} -# clean up -Remove-Item -Path $tmpDir \ No newline at end of file From 9b55f6fc56cb0a91aaa5eb80899fe3225f91eb37 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 Oct 2023 12:55:05 +0200 Subject: [PATCH 10/13] Refactor extraction and singing in seperate steps --- .github/workflows/win-exe.yml | 72 +++++++++++++++-------------------- 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index c6ebdecbb..490c7eafb 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -143,53 +143,29 @@ jobs: - name: Fix permissions run: attrib -r appdir/Cryptomator/Cryptomator.exe shell: pwsh - - name: Codesign binaries inside jars - run: | - $certificate = '${{ secrets.WIN_CODESIGN_P12_BASE64 }}' - $password = '${{ secrets.WIN_CODESIGN_P12_PW }}' - $certificateSHA1 = '5FC94CE149E5B511E621F53A060AC67CBD446B3A' - $description = 'Cryptomator' - $timestampUrl = 'http://timestamp.digicert.com' - $folder = ".\appdir\Cryptomator\app" - $tmpDir = ".\extract" - $signtool = $(Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\bin\' -Recurse -File signtool.exe | Where-Object { $_.Directory.ToString().EndsWith('x64') } | Select-Object -Last 1).FullName - - # preps - Install-Module -Name Microsoft.PowerShell.TextUtility -Force -Confirm:$False - - # import certificate - $bytes = ConvertFrom-Base64 -EncodedText $certificate -AsByteArray - Set-Content -Path ".\certFile" -AsByteStream -Value $bytes - & certutil -f -p $password -importpfx ".\certFile" - - # create directory to extract every jar to - New-Item -Path $tmpDir -ItemType Directory > $null - # iterate over all jars - Get-ChildItem -Path $folder -Recurse -File *.jar | ForEach-Object { - $jar = Copy-Item $_ -Destination $tmpDir -PassThru - Set-Location -Path $tmpDir - jar --file=$($_.FullName) --extract - Get-ChildItem -Path "." -Recurse -File "*.dll" | ForEach-Object { - # sign - & $signtool sign /sm /tr ${timestampUrl} /td SHA256 /fd SHA256 /d $description /sha1 $certificateSHA1 $_.FullName - # update jar with signed dll - jar --file=$($jar.FullName) --update $(Resolve-Path -Relative -Path $_) - } - # replace old jar with its update - Move-Item -Path $($jar.FullName) -Destination $_ -Force - # clear extraction dir - Remove-Item -Path ".\*" -Force -Recurse - Set-Location -Path ".." - } - # clean up - Remove-Item -Path $tmpDir + - name: Extract jars with DLLs for Codesigning shell: pwsh + run: | + Add-Type -AssemblyName "System.io.compression.filesystem" + $jarFolder = Resolve-Path ".\appdir\Cryptomator\app\mods" + $jarExtractDir = New-Item -Path ".\appdir\jar-extract" -ItemType Directory + + #for all jars inspect + Get-ChildItem -Path $jarFolder -Filter "*.jar" | ForEach-Object { + $jar = [Io.compression.zipfile]::OpenRead($_.FullName) + if (@($jar.Entries | Where-Object {$_.Name.ToString().EndsWith(".dll")} | Select-Object -First 1).Count -gt 0) { + #jars containing dlls extract + Set-Location $jarExtractDir + Expand-Archive -Path $_.FullName + } + $jar.Dispose() + } - name: Extract wixhelper.dll for Codesigning #see https://github.com/cryptomator/cryptomator/issues/3130 + shell: pwsh run: | New-Item -Path appdir/jpackage-jmod -ItemType Directory & $env:JAVA_HOME\bin\jmod.exe extract --dir jpackage-jmod "${env:JAVA_HOME}\jmods\jdk.jpackage.jmod" Get-ChildItem -Recurse -Path "jpackage-jmod" -File wixhelper.dll | Select-Object -Last 1 | Copy-Item -Destination "appdir" - shell: pwsh - name: Codesign uses: skymatic/code-sign-action@v2 with: @@ -200,6 +176,20 @@ jobs: timestampUrl: 'http://timestamp.digicert.com' folder: appdir recursive: true + - name: Replace DLLs inside jars with signed ones + shell: pwsh + run: | + $jarExtractDir = Resolve-Path ".\appdir\jar-extract" + $jarFolder = Resolve-Path ".\appdir\Cryptomator\app\mods" + Get-ChildItem -Path $jarExtractDir | ForEach-Object { + $jarName = $_.Name + $jarFile = "${jarFolder}\${jarName}.jar" + Set-Location $_ + Get-ChildItem -Path $_ -Recurse -File "*.dll" | ForEach-Object { + # update jar with signed dll + jar --file="$jarFile" --update $(Resolve-Path -Relative -Path $_) + } + } - name: Generate license for MSI run: > mvn -B license:add-third-party From 109f5d1faa1057884445ed16f0b9c16d54dfe845 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Thu, 12 Oct 2023 10:56:14 +0200 Subject: [PATCH 11/13] Update the error-db when a discussion is deleted --- .github/workflows/error-db.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/error-db.yml b/.github/workflows/error-db.yml index 09a15fe1f..57c5ca057 100644 --- a/.github/workflows/error-db.yml +++ b/.github/workflows/error-db.yml @@ -2,7 +2,7 @@ name: Update Error Database on: discussion: - types: [created, edited, category_changed, answered, unanswered] + types: [created, edited, deleted, category_changed, answered, unanswered] discussion_comment: types: [created, edited, deleted] From 7f7f0a099a03d55e1e14ae95c737b0c43c7abf6e Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Thu, 12 Oct 2023 14:11:54 +0200 Subject: [PATCH 12/13] Propagate deleted discussions to the error database --- .github/workflows/error-db.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/error-db.yml b/.github/workflows/error-db.yml index 57c5ca057..e885af4a2 100644 --- a/.github/workflows/error-db.yml +++ b/.github/workflows/error-db.yml @@ -12,6 +12,7 @@ jobs: if: github.event.discussion.category.name == 'Errors' steps: - name: Query Discussion Data + if: github.event_name == 'discussion_comment' || github.event_name == 'discussion' && github.event.action != 'deleted' id: query-data uses: actions/github-script@v6 with: @@ -47,8 +48,13 @@ jobs: - name: Merge Error Code Data run: | jq -c '.' ${{ steps.get-gist.outputs.file }} > original.json - echo $DISCUSSION | jq -c '.repository.discussion | .comments = .comments.totalCount | {(.id|tostring) : .}' > new.json - jq -s '.[0] * .[1]' original.json new.json > merged.json + if [ ! -z "$DISCUSSION" ] + then + echo $DISCUSSION | jq -c '.repository.discussion | .comments = .comments.totalCount | {(.id|tostring) : .}' > new.json + jq -s '.[0] * .[1]' original.json new.json > merged.json + else + cat original.json | jq 'del(.[] | select(.url=="https://github.com/cryptomator/cryptomator/discussions/${{ github.event.discussion.number }}"))' > merged.json + fi env: DISCUSSION: ${{ steps.query-data.outputs.result }} - name: Patch Gist From 1debe4c7c8593e24d6fa8f81db9da6d19913eefc Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 16 Oct 2023 16:20:03 +0200 Subject: [PATCH 13/13] explicitly set Logback `ConfiguratorRank` --- src/main/java/org/cryptomator/logging/LogbackConfigurator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/cryptomator/logging/LogbackConfigurator.java b/src/main/java/org/cryptomator/logging/LogbackConfigurator.java index 511599132..3b77993cc 100644 --- a/src/main/java/org/cryptomator/logging/LogbackConfigurator.java +++ b/src/main/java/org/cryptomator/logging/LogbackConfigurator.java @@ -5,6 +5,7 @@ import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.encoder.PatternLayoutEncoder; import ch.qos.logback.classic.spi.Configurator; +import ch.qos.logback.classic.spi.ConfiguratorRank; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.Appender; import ch.qos.logback.core.ConsoleAppender; @@ -19,6 +20,7 @@ import org.cryptomator.common.Environment; import java.nio.file.Path; import java.util.Map; +@ConfiguratorRank(ConfiguratorRank.CUSTOM_NORMAL_PRIORITY) public class LogbackConfigurator extends ContextAwareBase implements Configurator { private static final String LOG_PATTERN = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n";