mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-26 00:55:08 +01:00
fixed recreation of keys and certs
This commit is contained in:
@@ -316,19 +316,6 @@ module.exports = class extends Generator {
|
||||
|
||||
/* some utils */
|
||||
|
||||
_hasAuthKeys() {
|
||||
return this.props &&
|
||||
this.props.gatekeeper_keys &&
|
||||
this.props.gatekeeper_keys.configEntries &&
|
||||
this.props.gatekeeper_keys.configEntries.length > 0;
|
||||
}
|
||||
|
||||
_hasCert() {
|
||||
return this.props &&
|
||||
this.props.gatekeeper_sslkey &&
|
||||
this.props.gatekeeper_sslcert
|
||||
}
|
||||
|
||||
_assignConfigDefaults() {
|
||||
this.props = Object.assign( {
|
||||
features: [],
|
||||
|
||||
@@ -10,6 +10,19 @@ const prefix = function() {
|
||||
return chalk.bold.red(capitalise(name)+': ');
|
||||
};
|
||||
|
||||
const hasAuthKeys = function( props ) {
|
||||
return props &&
|
||||
props.gatekeeper_keys &&
|
||||
props.gatekeeper_keys.configEntries &&
|
||||
props.gatekeeper_keys.configEntries.length > 0;
|
||||
}
|
||||
|
||||
const hasCert = function( props ) {
|
||||
return props &&
|
||||
props.gatekeeper_sslkey &&
|
||||
props.gatekeeper_sslcert
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: function() {
|
||||
return name;
|
||||
@@ -25,14 +38,14 @@ module.exports = {
|
||||
validate: utils._notEmptyValidator
|
||||
},
|
||||
{
|
||||
when: utils._hasAuthKeys,
|
||||
when: function() { return hasAuthKeys( utils.props ); },
|
||||
type: 'confirm',
|
||||
name: 'gatekeeper_recreatekeys',
|
||||
default: false,
|
||||
message: prefix()+'Recreate gatekeeper keys?'+utils._getHelp('gatekeeper_recreatekeys')
|
||||
},
|
||||
{
|
||||
when: utils._hasCert,
|
||||
when: function() { return hasCert( utils.props ); },
|
||||
type: 'confirm',
|
||||
name: 'gatekeeper_recreatecert',
|
||||
default: false,
|
||||
|
||||
Reference in New Issue
Block a user