Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow skipping Gatekeper check #100

Merged
merged 6 commits into from
Nov 11, 2016
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ 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.

`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.

--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']) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it would be better to have && opts['gatekeeper-assess'] as && opts['gatekeeper-assess'] !== false so it is still by default enabled for users not using the command line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely should. Otherwise programmatic default is not equals to CLI and it is strange.

promise = promise.then(function () {
return new Promise(function (resolve, reject) {
debuglog('Verifying Gatekeeper acceptance for darwin platform...')
Expand Down