Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

desktop: add windows code signing

Abdullah Atta764c721f1d7c
diff --git a/.github/workflows/desktop.publish.yml b/.github/workflows/desktop.publish.yml
index 4d5792d21..40e51b465 100644
--- a/.github/workflows/desktop.publish.yml
+++ b/.github/workflows/desktop.publish.yml
@@ -227,6 +227,11 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v3
+ - name: Setup .NET Core SDK
+ uses: actions/setup-dotnet@v2
+ with:
+ dotnet-version: 6.0.x
+
- name: Setup Node
uses: ./.github/actions/setup-node-with-cache
@@ -247,6 +252,9 @@ jobs:
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
+ AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
+ AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
run: |
if ($${{ inputs.publish-github }} -eq $true) {
yarn electron-builder --win --publish always
diff --git a/apps/desktop/package-lock.json b/apps/desktop/package-lock.json
index 1bf2e9b87..86b494046 100644
--- a/apps/desktop/package-lock.json
+++ b/apps/desktop/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@notesnook/desktop",
- "version": "2.6.14",
+ "version": "2.6.15",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@notesnook/desktop",
- "version": "2.6.14",
+ "version": "2.6.15",
"hasInstallScript": true,
"license": "GPL-3.0-or-later",
"dependencies": {
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index ce1b910a6..3b362e2a0 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -2,7 +2,7 @@
"name": "@notesnook/desktop",
"productName": "Notesnook",
"description": "Your private note taking space",
- "version": "2.6.14",
+ "version": "2.6.15",
"appAppleId": "1544027013",
"private": true,
"main": "./dist/index.js",
@@ -135,6 +135,7 @@
]
}
],
+ "sign": "./sign.js",
"icon": "assets/icons/app.ico"
},
"portable": {
diff --git a/apps/desktop/sign.js b/apps/desktop/sign.js
new file mode 100644
index 000000000..c4254c326
--- /dev/null
+++ b/apps/desktop/sign.js
@@ -0,0 +1,60 @@
+/*
+This file is part of the Notesnook project (https://notesnook.com/)
+
+Copyright (C) 2023 Streetwriters (Private) Limited
+
+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.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+const { writeFileSync, rmSync } = require("fs");
+const { execSync } = require("child_process");
+const { relative } = require("path");
+
+module.exports = async function (configuration) {
+ const Endpoint = "https://weu.codesigning.azure.net";
+ const CodeSigningAccountName = "Notesnook";
+ const CertificateProfileName = "Notesnook";
+ const FileDigest = "SHA256";
+ const TimestampRfc3161 = "http://timestamp.acs.microsoft.com";
+ const TimestampDigest = "SHA256";
+ const Description = "The Notesnook app";
+ const DescriptionUrl = "https://notesnook.com/";
+ const FilesCatalog = createCatalog(configuration.path);
+
+ const command = `Invoke-AzureCodeSigning -Endpoint "${Endpoint}" -CodeSigningAccountName "${CodeSigningAccountName}" -CertificateProfileName "${CertificateProfileName}" -FileDigest "${FileDigest}" -TimestampRfc3161 "${TimestampRfc3161}" -TimestampDigest "${TimestampDigest}" -Description "${Description}" -DescriptionUrl "${DescriptionUrl}" -FilesCatalog "${FilesCatalog}"`;
+
+ console.log("Signing", configuration.path, "using command", command);
+
+ psexec(command);
+
+ console.log("Signed", configuration.path);
+
+ deleteCatalog();
+};
+
+function createCatalog(path) {
+ writeFileSync("_catalog", relative(__dirname, path));
+ return "_catalog";
+}
+
+function deleteCatalog() {
+ rmSync("_catalog");
+}
+
+function psexec(cmd) {
+ return execSync(cmd, {
+ env: process.env,
+ stdio: "inherit",
+ shell: "pwsh"
+ });
+}
diff --git a/apps/web/package-lock.json b/apps/web/package-lock.json
index 826c04eab..a654cd829 100644
--- a/apps/web/package-lock.json
+++ b/apps/web/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@notesnook/web",
- "version": "2.6.14",
+ "version": "2.6.15",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@notesnook/web",
- "version": "2.6.14",
+ "version": "2.6.15",
"license": "GPL-3.0-or-later",
"dependencies": {
"@aws-sdk/util-base64-browser": "^3.208.0",
diff --git a/apps/web/package.json b/apps/web/package.json
index a6b18dd08..177eefc5a 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -1,7 +1,7 @@
{
"name": "@notesnook/web",
"description": "Your private note taking space",
- "version": "2.6.14",
+ "version": "2.6.15",
"private": true,
"main": "./src/app.js",
"homepage": "https://notesnook.com/",