localhost and 127.0.0.1 are always added to the gatekeeper cert, the current hostname will be set as default hostname, which can be changed during configuraion

This commit is contained in:
jash
2018-12-06 19:37:08 +01:00
committed by kexkey
parent 17c764ce72
commit 4b72317260
3 changed files with 6 additions and 3 deletions

1
dist/setup.sh vendored
View File

@@ -177,6 +177,7 @@ configure() {
# configure features of cyphernode
docker run -v $current_path:/data \
-e DEFAULT_USER=$USER \
-e DEFAULT_CERT_HOSTNAME=$(hostname) \
--log-driver=none$pw_env \
--network none \
--rm$interactive cyphernode/cyphernodeconf:cyphernode-0.05 $(id -u):$(id -g) yo --no-insight cyphernode$gen_options $recreate

View File

@@ -364,7 +364,7 @@ module.exports = class extends Generator {
gatekeeper_keys: { configEntries: [], clientInformation: [] },
gatekeeper_sslcert: '',
gatekeeper_sslkey: '',
gatekeeper_cns: '',
gatekeeper_cns: process.env['DEFAULT_CERT_HOSTNAME'] || '',
proxy_datapath: '',
lightning_implementation: 'c-lightning',
lightning_datapath: '',

View File

@@ -64,6 +64,8 @@ module.exports = class Cert {
async create( cns ) {
cns = cns || [];
cns = cns.concat(['127.0.0.1','localhost']);
let args = defaultArgs.slice();
const certFileTmp = tmp.fileSync();
@@ -84,9 +86,9 @@ module.exports = class Cert {
const conf = this.buildConfig( cns );
fs.writeFileSync( confFileTmp.name, conf );
const openssl = spawn('openssl', args, { stdio: ['ignore', 'ignore', 'ignore'] } );
let code = await new Promise( function(resolve, reject) {
openssl.on('exit', (code) => {
resolve(code);