From 3ff9c09af58d65f1233b9bc16940a51190c6e153 Mon Sep 17 00:00:00 2001 From: majakomel Date: Tue, 30 Jul 2024 12:27:03 +0200 Subject: [PATCH 1/4] Remove code signing step from download-cli --- package.json | 3 ++- scripts/download-probe-cli.js | 14 +------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 17ce7174..5aab4b24 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "download": "yarn run download:tor && yarn run download:probe-cli", "download:tor": "node scripts/download-tor.js", "download:probe-cli": "node scripts/download-probe-cli.js", - "pack": "yarn run build:clean && electron-builder --win --mac --linux", + "pack": "yarn run build:clean && electron-builder --mac --linux -p never && electron-builder --dir --win -p never", + "packWin": "electron-builder --prepackaged ./dist/win-arm64-unpacked --win", "pack:win": "yarn run build:clean && electron-builder --win --x64", "pack:mac": "yarn run build:clean && electron-builder --mac", "pack:linux": "yarn run build:clean && electron-builder --linux", diff --git a/scripts/download-probe-cli.js b/scripts/download-probe-cli.js index 44cf95b1..e190778f 100644 --- a/scripts/download-probe-cli.js +++ b/scripts/download-probe-cli.js @@ -26,19 +26,7 @@ const download = () => { } osarch = osarch.replace('-', '_') ensureDirSync(`${dstDir}/${osarch}`) - if (osarch === 'windows_amd64') { - execSync( - `cp ${dstDir}/${versionedFilename} ${dstDir}/${osarch}/ooniprobe${extension}-unsigned` - ) - execSync( - `osslsigncode sign -pkcs12 ${process.env.WIN_CSC_LINK} -pass ${process.env.WIN_CSC_KEY_PASSWORD} -n "OONI Probe CLI" -i https://ooni.org/ -in ${dstDir}/${osarch}/ooniprobe${extension}-unsigned -out ${dstDir}/${osarch}/ooniprobe${extension}` - ) - execSync(`rm -rf ${dstDir}/${osarch}/ooniprobe${extension}-unsigned`) - } else { - execSync( - `cp ${dstDir}/${versionedFilename} ${dstDir}/${osarch}/ooniprobe${extension}` - ) - } + execSync(`cp ${dstDir}/${versionedFilename} ${dstDir}/${osarch}/ooniprobe${extension}`) execSync(`chmod +x ${dstDir}/${osarch}/ooniprobe${extension}`) } } From 41f410b08db21ad734777bfec4dbe594f2fc1890 Mon Sep 17 00:00:00 2001 From: Maja Komel Date: Tue, 30 Jul 2024 13:38:49 +0200 Subject: [PATCH 2/4] Bump version to 3.9.7-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5aab4b24..9e6bead2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "OONI Probe Desktop app", "author": "Open Observatory of Network Interference (OONI) ", "productName": "OONI Probe", - "version": "3.9.6", + "version": "3.9.7-rc.1", "probeVersion": "3.22.0", "main": "main/index.js", "license": "BSD-3-Clause", From e672f4701cd945aa1c68ee4412a8d8a5abc42045 Mon Sep 17 00:00:00 2001 From: Maja Komel Date: Tue, 6 Aug 2024 11:57:11 +0200 Subject: [PATCH 3/4] Add hash script --- scripts/hashFile.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 scripts/hashFile.js diff --git a/scripts/hashFile.js b/scripts/hashFile.js new file mode 100644 index 00000000..b140e214 --- /dev/null +++ b/scripts/hashFile.js @@ -0,0 +1,34 @@ +// copied from https://stackoverflow.com/a/60208623 +const path = require('path') +const fs = require('fs') +const crypto = require('crypto') + +const YOUR_FILE_PATH = './dist/OONI Probe Setup 3.9.7-rc.1.exe' + +function hashFile(file, algorithm = 'sha512', encoding = 'base64', options) { + return new Promise((resolve, reject) => { + const hash = crypto.createHash(algorithm) + hash.on('error', reject).setEncoding(encoding) + fs.createReadStream( + file, + Object.assign({}, options, { + highWaterMark: 1024 * 1024, + /* better to use more memory but hash faster */ + }) + ) + .on('error', reject) + .on('end', () => { + hash.end() + console.log('hash done') + console.log(hash.read()) + resolve(hash.read()) + }) + .pipe(hash, { + end: false, + }) + }) +} + +const installerPath = path.resolve(__dirname, YOUR_FILE_PATH) + +hashFile(installerPath) From 3c3d949452a27bd04faf2e80d2609dfb7eb5ca1f Mon Sep 17 00:00:00 2001 From: Maja Komel Date: Tue, 6 Aug 2024 11:58:40 +0200 Subject: [PATCH 4/4] Bump version to 3.9.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e6bead2..94d9ed51 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "OONI Probe Desktop app", "author": "Open Observatory of Network Interference (OONI) ", "productName": "OONI Probe", - "version": "3.9.7-rc.1", + "version": "3.9.7", "probeVersion": "3.22.0", "main": "main/index.js", "license": "BSD-3-Clause",