From 75c971c598c281b6ff19b71d6ea5ea2bb28d5b6f Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 28 Jun 2018 02:20:51 -0600 Subject: [PATCH] good default acme dir --- bin/telebitd.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/telebitd.js b/bin/telebitd.js index 89866fd..88381e9 100755 --- a/bin/telebitd.js +++ b/bin/telebitd.js @@ -451,7 +451,7 @@ function parseConfig(err, text) { } common._init( state.config.root || path.join(__dirname, '..') - , path.join(state.config.root || path.join(__dirname, '..'), 'etc') + , (state.config.root && path.join(state.config.root, 'etc')) || path.join(os.homedir(), '.config/telebit') ); state._ipc = common.pipename(state.config, true); console.info(''); @@ -601,7 +601,9 @@ function connectTunnel(token, cb) { , server: state.greenlockConf.server || 'https://acme-v02.api.letsencrypt.org/directory' , communityMember: state.greenlockConf.communityMember || state.config.communityMember , telemetry: state.greenlockConf.telemetry || state.config.telemetry - , configDir: state.greenlockConf.configDir || path.resolve(__dirname, '..', 'etc/acme/') + , configDir: state.greenlockConf.configDir + || (state.config.root && path.join(state.config.root, 'etc/acme')) + || path.join(os.homedir(), '.config/telebit/acme') // TODO, store: require(state.greenlockConf.store.name || 'le-store-certbot').create(state.greenlockConf.store.options || {}) , approveDomains: function (opts, certs, cb) { // Certs being renewed are listed in certs.altnames