Skip to content

Commit

Permalink
Merge pull request #100 from salomvary/allow-skipping-gatekeeper
Browse files Browse the repository at this point in the history
Allow skipping Gatekeper check
  • Loading branch information
sethlu authored Nov 11, 2016
2 parents 3a3c04e + 8a1c5fd commit 5197101
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ Default to system default keychain.
Regex or function that signals ignoring a file before signing.
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 on `darwin` platform.
Default to `true`.

`platform` - *String*

Build platform of Electron.
Expand Down
4 changes: 4 additions & 0 deletions bin/electron-osx-sign-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ DESCRIPTION
The keychain name.
Default to system default keychain.

--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 on ``darwin'' platform.

--platform=platform
Build platform of Electron.
Allowed values: ``darwin'', ``mas''.
Expand Down
6 changes: 4 additions & 2 deletions bin/electron-osx-sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
'gatekeeper-assess'
],
'default': {
'pre-auto-entitlements': true,
'pre-embed-provisioning-profile': true
'pre-embed-provisioning-profile': true,
'gatekeeper-assess': true
}
})
var usage = fs.readFileSync(path.join(__dirname, 'electron-osx-sign-usage.txt')).toString()
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface SignOptions extends BaseSignOptions {
binaries?: string[];
entitlements?: string;
'entitlements-inherit'?: string;
'gatekeeper-check'?: boolean;
}

export function sign(opts: SignOptions, callback: (error: Error) => void): void;
Expand Down
2 changes: 1 addition & 1 deletion sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function verifySignApplicationAsync (opts) {
})

// Additionally test Gatekeeper acceptance for darwin platform
if (opts.platform === 'darwin') {
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...')
Expand Down

0 comments on commit 5197101

Please sign in to comment.