From ce70c75378edb36d01fa45d952fdb83738c20999 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 25 May 2018 01:13:05 +0000 Subject: [PATCH] defaults for secret and greenlock --- bin/telebitd.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/telebitd.js b/bin/telebitd.js index cc107b9..81fddb7 100755 --- a/bin/telebitd.js +++ b/bin/telebitd.js @@ -46,7 +46,7 @@ function applyConfig(config) { state.config = config; state.servernames = config.servernames || []; state.secret = state.config.secret; - if (state.secret) { + if (!state.secret) { state.secret = require('crypto').randomBytes(16).toString('hex'); console.info(""); console.info("Secret for this session:"); @@ -55,6 +55,12 @@ function applyConfig(config) { console.info(""); console.info(""); } + if (!state.config.greenlock) { + state.config.greenlock = {}; + } + if (!state.config.greenlock.configDir) { + state.config.greenlock.configDir = require('os').homedir() + require('path').sep + 'acme'; + } function approveDomains(opts, certs, cb) { console.log('[debug] approveDomains', opts.domains); @@ -122,7 +128,7 @@ function applyConfig(config) { , approveDomains: approveDomains - , configDir: '/root/acme' + , configDir: state.config.configDir , debug: true //, approvedDomains: program.servernames