added "expose" option to installer and template

This commit is contained in:
jash
2018-10-08 15:24:13 +02:00
committed by kexkey
parent ba354478fd
commit 9b979ed4eb
2 changed files with 16 additions and 13 deletions

View File

@@ -4,11 +4,19 @@ const chalk = require('chalk');
const name = 'installer';
const installerDocker = function(props) {
return props.installer === 'docker'
return props.installer_mode === 'docker'
};
const installerDocker_bitcoinInternal = function(props) {
return props.installer_mode === 'docker' && props.bitcoin_mode === 'internal'
};
const installerDocker_bitcoinExternal = function(props) {
return props.installer_mode === 'docker' && props.bitcoin_mode === 'external'
};
const installerLunanode = function(props) {
return props.installer === 'lunanode'
return props.installer_mode === 'lunanode'
};
module.exports = {
@@ -35,9 +43,7 @@ module.exports = {
}]
},
{
when: function(props) {
return (installerDocker(props) && props.bitcoin_mode === 'internal')
},
when: installerDocker_bitcoinInternal,
type: 'confirm',
name: 'bitcoin_expose',
default: utils._getDefault( 'bitcoin_expose' ),
@@ -49,8 +55,7 @@ module.exports = {
name: 'installer_confirm_lunanode',
default: utils._getDefault( 'installer_confirm_lunanode' ),
message: 'Lunanode?! No wayyyy!'+'\n'
}
];
}];
},
templates: function( props ) {
if( props.installer_mode === 'docker' ) {

View File

@@ -77,12 +77,10 @@ services:
bitcoin:
# Bitcoin node
image: cyphernode/bitcoin
# ports:
# - "18333:18333"
# - "18332:18332"
# - "29000:29000"
# - "8333:8333"
# - "8332:8332"
<% if( bitcoin_expose ) { %>
ports:
- "<%= (net === 'mainnet')?'8332:8332':'18332:18332' %>"
<% } %>
volumes:
- "~/.bitcoin:/bitcoinuser/.bitcoin"
networks: