added gatekeeper port option to config tool

This commit is contained in:
SKP
2019-02-09 00:11:28 +01:00
committed by kexkey
parent 85d838c9c4
commit 5a18be3d8e
7 changed files with 79 additions and 96 deletions

View File

@@ -406,6 +406,7 @@ module.exports = class extends Generator {
bitcoin_mode: 'internal',
bitcoin_expose: false,
lightning_expose: true,
gatekeeper_port: 443,
gatekeeper_apiproperties: defaultAPIProperties,
gatekeeper_ipwhitelist: '',
gatekeeper_keys: { configEntries: [], clientInformation: [] },

View File

@@ -39,62 +39,72 @@ module.exports = {
filter: utils._trimFilter,
validate: utils._notEmptyValidator
},
{
when: function( props ) {
// hacky hack
password = props.gatekeeper_clientkeyspassword;
return true;
},
type: 'password',
name: 'gatekeeper_clientkeyspassword_c',
default: utils._getDefault( 'gatekeeper_clientkeyspassword_c' ),
message: prefix()+'Confirm your client keys password.'+utils._getHelp('gatekeeper_clientkeyspassword_c'),
filter: utils._trimFilter,
validate: function( input ) {
if(input !== password) {
throw new Error( 'Client keys passwords do not match' );
}
return true;
{
when: function( props ) {
// hacky hack
password = props.gatekeeper_clientkeyspassword;
return true;
},
type: 'password',
name: 'gatekeeper_clientkeyspassword_c',
default: utils._getDefault( 'gatekeeper_clientkeyspassword_c' ),
message: prefix()+'Confirm your client keys password.'+utils._getHelp('gatekeeper_clientkeyspassword_c'),
filter: utils._trimFilter,
validate: function( input ) {
if(input !== password) {
throw new Error( 'Client keys passwords do not match' );
}
return true;
}
},
{
type: 'input',
name: 'gatekeeper_port',
default: utils._getDefault( 'gatekeeper_port' ),
message: prefix()+'The port gatekeeper will listen on for requests'+utils._getHelp('gatekeeper_port'),
filter: utils._trimFilter,
validate: function( port ) {
return utils._notEmptyValidator( port ) && !isNaN( parseInt(port) )
}
},
{
when: function() { return hasAuthKeys( utils.props ); },
type: 'confirm',
name: 'gatekeeper_recreatekeys',
default: false,
message: prefix()+'Recreate gatekeeper keys?'+utils._getHelp('gatekeeper_recreatekeys')
},
{
when: function() { return hasCert( utils.props ); },
type: 'confirm',
name: 'gatekeeper_recreatecert',
default: false,
message: prefix()+'Recreate gatekeeper certificate?'+utils._getHelp('gatekeeper_recreatecert')
},
{
when: function(props) { return !hasCert( utils.props ) || props.gatekeeper_recreatecert },
type: 'input',
name: 'gatekeeper_cns',
default: utils._getDefault( 'gatekeeper_cns' ),
message: prefix()+'Gatekeeper cert CNS (ips, domains, wildcard domains seperated by comma)?'+utils._getHelp('gatekeeper_cns')
},
{
type: 'confirm',
name: 'gatekeeper_edit_apiproperties',
default: false,
message: prefix()+'Edit API properties?'+utils._getHelp('gatekeeper_edit_apiproperties')
},
{
when: function( props ) {
const r = props.gatekeeper_edit_apiproperties;
delete props.gatekeeper_edit_apiproperties;
return r;
},
{
when: function() { return hasAuthKeys( utils.props ); },
type: 'confirm',
name: 'gatekeeper_recreatekeys',
default: false,
message: prefix()+'Recreate gatekeeper keys?'+utils._getHelp('gatekeeper_recreatekeys')
},
{
when: function() { return hasCert( utils.props ); },
type: 'confirm',
name: 'gatekeeper_recreatecert',
default: false,
message: prefix()+'Recreate gatekeeper certificate?'+utils._getHelp('gatekeeper_recreatecert')
},
{
when: function(props) { return !hasCert( utils.props ) || props.gatekeeper_recreatecert },
type: 'input',
name: 'gatekeeper_cns',
default: utils._getDefault( 'gatekeeper_cns' ),
message: prefix()+'Gatekeeper cert CNS (ips, domains, wildcard domains seperated by comma)?'+utils._getHelp('gatekeeper_cns')
},
{
type: 'confirm',
name: 'gatekeeper_edit_apiproperties',
default: false,
message: prefix()+'Edit API properties?'+utils._getHelp('gatekeeper_edit_apiproperties')
},
{
when: function( props ) {
const r = props.gatekeeper_edit_apiproperties;
delete props.gatekeeper_edit_apiproperties;
return r;
},
type: 'editor',
name: 'gatekeeper_apiproperties',
message: utils._getHelp('gatekeeper_apiproperties')||' ',
default: utils._getDefault( 'gatekeeper_apiproperties' )
}];
type: 'editor',
name: 'gatekeeper_apiproperties',
message: utils._getHelp('gatekeeper_apiproperties')||' ',
default: utils._getDefault( 'gatekeeper_apiproperties' )
}];
},
templates: function( props ) {
return [ 'keys.properties', 'api.properties', 'cert.pem', 'key.pem', 'htpasswd' ];

View File

@@ -7,7 +7,7 @@ services:
- "TRACING=1"
image: cyphernode/gatekeeper:<%= gatekeeper_version %>
ports:
- "443:443"
- "<%= gatekeeper_port %>:443"
volumes:
- "<%= gatekeeper_datapath %>/certs:/etc/ssl/certs"
- "<%= gatekeeper_datapath %>/private:/etc/ssl/private"

View File

@@ -46,5 +46,5 @@ fi
printf "\r\n\033[0;92mDepending on your current location and DNS settings, point your favorite browser to one of the following URLs to access Cyphernode's status page:\r\n"
printf "\r\n"
printf "\033[0;95m<% cns.forEach(cn => { %><%= ('https://' + cn + '/status/\\r\\n') %><% }) %>\033[0m\r\n"
printf "\033[0;95m<% cns.forEach(cn => { %><%= ('https://' + cn + ':'+ gatekeeper_port + '/status/\\r\\n') %><% }) %>\033[0m\r\n"
printf "\033[0;92mUse 'admin' as the username with the configuration password you selected at the beginning of the configuration process.\r\n\r\n\033[0m"