From 1d8b44600d4b90588c4a2d96092637411d104e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Salomv=C3=A1ry?= Date: Thu, 3 Nov 2016 23:44:05 +0100 Subject: [PATCH 1/6] Allow skipping Gatekeper check --- README.md | 5 +++++ bin/electron-osx-sign-usage.txt | 3 +++ bin/electron-osx-sign.js | 6 ++++-- index.d.ts | 1 + sign.js | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5932805..ae8a539 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,11 @@ Default to system default keychain. Regex or function that signals ignoring a file before signing. Default to `undefined`. +`no-getekeeper-check` - *Boolean* + +Skip Gatekeeper check after signing the app. Useful for signing with self-signed certificates. +Gatekeeper check is enabled by default. + `platform` - *String* Build platform of Electron. diff --git a/bin/electron-osx-sign-usage.txt b/bin/electron-osx-sign-usage.txt index 47fc434..c3878d7 100644 --- a/bin/electron-osx-sign-usage.txt +++ b/bin/electron-osx-sign-usage.txt @@ -35,6 +35,9 @@ DESCRIPTION The keychain name. Default to system default keychain. + --no-getekeeper-check + Skip Gatekeeper check after signing the app. Useful for signing with self-signed certificates. + --platform=platform Build platform of Electron. Allowed values: ``darwin'', ``mas''. diff --git a/bin/electron-osx-sign.js b/bin/electron-osx-sign.js index 13e7c5a..c3c1117 100755 --- a/bin/electron-osx-sign.js +++ b/bin/electron-osx-sign.js @@ -6,11 +6,13 @@ var args = require('minimist')(process.argv.slice(2), { 'boolean': [ 'help', 'pre-auto-entitlements', - 'pre-embed-provisioning-profile' + 'pre-embed-provisioning-profile', + 'no-gatekeeper-check' ], 'default': { 'pre-auto-entitlements': true, - 'pre-embed-provisioning-profile': true + 'pre-embed-provisioning-profile': true, + 'no-gatekeeper-check': false } }) var usage = fs.readFileSync(path.join(__dirname, 'electron-osx-sign-usage.txt')).toString() diff --git a/index.d.ts b/index.d.ts index 9d539fc..60d30b0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -10,6 +10,7 @@ interface SignOptions extends BaseSignOptions { binaries?: string[]; entitlements?: string; 'entitlements-inherit'?: string; + 'no-gatekeeper-check'?: boolean; } export function sign(opts: SignOptions, callback: (error: Error) => void): void; diff --git a/sign.js b/sign.js index 838f10b..6c3c9b1 100644 --- a/sign.js +++ b/sign.js @@ -103,7 +103,7 @@ function verifySignApplicationAsync (opts) { }) // Additionally test Gatekeeper acceptance for darwin platform - if (opts.platform === 'darwin') { + if (opts.platform === 'darwin' && !opts['no-gatekeeper-check']) { promise = promise.then(function () { return new Promise(function (resolve, reject) { debuglog('Verifying Gatekeeper acceptance for darwin platform...') From 1563825f045bee12cf0d7f8ac45edfcb08c59f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Salomv=C3=A1ry?= Date: Sun, 6 Nov 2016 11:29:19 +0100 Subject: [PATCH 2/6] Rename no-getekeeper-check flag to gatekeeper-assess --- README.md | 6 +++--- bin/electron-osx-sign.js | 4 ++-- index.d.ts | 2 +- sign.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ae8a539..61d665e 100644 --- a/README.md +++ b/README.md @@ -150,10 +150,10 @@ Default to system default keychain. Regex or function that signals ignoring a file before signing. Default to `undefined`. -`no-getekeeper-check` - *Boolean* +`gatekeeper-assess` - *Boolean* -Skip Gatekeeper check after signing the app. Useful for signing with self-signed certificates. -Gatekeeper check is enabled by default. +Flag to enable Gatekeeper assessment after signing the app. Disabling it is useful for signing with self-signed certificates. +Gatekeeper assessment is enabled by default. `platform` - *String* diff --git a/bin/electron-osx-sign.js b/bin/electron-osx-sign.js index c3c1117..30a7980 100755 --- a/bin/electron-osx-sign.js +++ b/bin/electron-osx-sign.js @@ -7,12 +7,12 @@ var args = require('minimist')(process.argv.slice(2), { 'help', 'pre-auto-entitlements', 'pre-embed-provisioning-profile', - 'no-gatekeeper-check' + 'gatekeeper-assess' ], 'default': { 'pre-auto-entitlements': true, 'pre-embed-provisioning-profile': true, - 'no-gatekeeper-check': false + 'gatekeeper-assess': true } }) var usage = fs.readFileSync(path.join(__dirname, 'electron-osx-sign-usage.txt')).toString() diff --git a/index.d.ts b/index.d.ts index 60d30b0..6a750b5 100644 --- a/index.d.ts +++ b/index.d.ts @@ -10,7 +10,7 @@ interface SignOptions extends BaseSignOptions { binaries?: string[]; entitlements?: string; 'entitlements-inherit'?: string; - 'no-gatekeeper-check'?: boolean; + 'gatekeeper-check'?: boolean; } export function sign(opts: SignOptions, callback: (error: Error) => void): void; diff --git a/sign.js b/sign.js index 6c3c9b1..2c29baa 100644 --- a/sign.js +++ b/sign.js @@ -103,7 +103,7 @@ function verifySignApplicationAsync (opts) { }) // Additionally test Gatekeeper acceptance for darwin platform - if (opts.platform === 'darwin' && !opts['no-gatekeeper-check']) { + if (opts.platform === 'darwin' && opts['gatekeeper-assess']) { promise = promise.then(function () { return new Promise(function (resolve, reject) { debuglog('Verifying Gatekeeper acceptance for darwin platform...') From 6e4118247eb1d589ade2f394468e6ea929383ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Salomv=C3=A1ry?= Date: Sun, 6 Nov 2016 11:32:31 +0100 Subject: [PATCH 3/6] Update docs with no-getekeeper-check -> gatekeeper-assess rename --- bin/electron-osx-sign-usage.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/electron-osx-sign-usage.txt b/bin/electron-osx-sign-usage.txt index c3878d7..074995e 100644 --- a/bin/electron-osx-sign-usage.txt +++ b/bin/electron-osx-sign-usage.txt @@ -35,8 +35,9 @@ DESCRIPTION The keychain name. Default to system default keychain. - --no-getekeeper-check - Skip Gatekeeper check after signing the app. Useful for signing with self-signed certificates. + --gatekeeper-assess, --no-gatekeeper-assess + Flag to enable Gatekeeper assessment after signing the app. Disabling it is useful for signing with self-signed certificates. + Gatekeeper assessment is enabled by default. --platform=platform Build platform of Electron. From cfebac65b3183c53276bddeaeeb75f6973b7acc3 Mon Sep 17 00:00:00 2001 From: Zhuo Lu Date: Fri, 11 Nov 2016 00:07:06 -0800 Subject: [PATCH 4/6] Update sign.js --- sign.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sign.js b/sign.js index 2c29baa..3567346 100644 --- a/sign.js +++ b/sign.js @@ -103,7 +103,7 @@ function verifySignApplicationAsync (opts) { }) // Additionally test Gatekeeper acceptance for darwin platform - if (opts.platform === 'darwin' && opts['gatekeeper-assess']) { + if (opts.platform === 'darwin' && opts['gatekeeper-assess'] !== false) { promise = promise.then(function () { return new Promise(function (resolve, reject) { debuglog('Verifying Gatekeeper acceptance for darwin platform...') From b3fd83a3319b2e8dc825c25bc40042ebcb09d996 Mon Sep 17 00:00:00 2001 From: Zhuo Lu Date: Fri, 11 Nov 2016 00:08:25 -0800 Subject: [PATCH 5/6] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61d665e..4e92b4e 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,8 @@ Default to `undefined`. `gatekeeper-assess` - *Boolean* Flag to enable Gatekeeper assessment after signing the app. Disabling it is useful for signing with self-signed certificates. -Gatekeeper assessment is enabled by default. +Gatekeeper assessment is enabled by default on `darwin` platform. +Default to `true`. `platform` - *String* From 8a1c5fd8c232ad22d3699b6a2785b7b706a9237b Mon Sep 17 00:00:00 2001 From: Zhuo Lu Date: Fri, 11 Nov 2016 00:09:51 -0800 Subject: [PATCH 6/6] Update electron-osx-sign-usage.txt --- bin/electron-osx-sign-usage.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/electron-osx-sign-usage.txt b/bin/electron-osx-sign-usage.txt index 074995e..774303e 100644 --- a/bin/electron-osx-sign-usage.txt +++ b/bin/electron-osx-sign-usage.txt @@ -37,7 +37,7 @@ DESCRIPTION --gatekeeper-assess, --no-gatekeeper-assess Flag to enable Gatekeeper assessment after signing the app. Disabling it is useful for signing with self-signed certificates. - Gatekeeper assessment is enabled by default. + Gatekeeper assessment is enabled by default on ``darwin'' platform. --platform=platform Build platform of Electron.