From 478c6ebe0cfd4ac397e260d6291e0396a0a9a9bf Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Sun, 6 Nov 2016 16:04:27 +0000 Subject: [PATCH] update to latest lamassu.json --- bin/lamassu-server | 2 +- lib/options.js | 28 ++++++++++++---------------- package.json | 2 -- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/bin/lamassu-server b/bin/lamassu-server index a41632ec..a7cc615d 100755 --- a/bin/lamassu-server +++ b/bin/lamassu-server @@ -15,7 +15,7 @@ var httpOnly = options.httpOnly || argv.http if (!httpOnly) { try { options.https = { - key: fs.readFileSync(options.certKeyPath), + key: fs.readFileSync(options.keyPath), cert: fs.readFileSync(options.certPath) } } catch (err) { diff --git a/lib/options.js b/lib/options.js index 02b08d72..9a9b38a6 100644 --- a/lib/options.js +++ b/lib/options.js @@ -1,24 +1,20 @@ -'use strict' +const fs = require('fs') +const path = require('path') +const os = require('os') -var fs = require('fs') -var path = require('path') -var os = require('os') - -var options -var configPath +let serverConfig try { - configPath = '/etc/lamassu.json' - options = JSON.parse(fs.readFileSync(configPath)) -} catch (err) { + const homeConfigPath = path.resolve(os.homedir(), '.lamassu', 'lamassu.json') + serverConfig = JSON.parse(fs.readFileSync(homeConfigPath)) +} catch (_) { try { - configPath = path.resolve(os.homedir(), '.lamassu', 'lamassu.json') - console.log(configPath) - options = JSON.parse(fs.readFileSync(configPath)) - } catch (err2) { - console.log('Missing configuration file -- exiting.') + const globalConfigPath = path.resolve('/etc', 'lamassu', 'lamassu.json') + serverConfig = JSON.parse(fs.readFileSync(globalConfigPath)) + } catch (_) { + console.log("Couldn't open config file.") process.exit(1) } } -module.exports = options +module.exports = serverConfig diff --git a/package.json b/package.json index 0df5c24b..3482f8a6 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,6 @@ "bin": { "lamassu-server": "./bin/lamassu-server", "lamassu-migrate": "./bin/lamassu-migrate", - "ssu-raqia": "./bin/ssu-raqia", - "ssu": "./bin/ssu", "hkdf": "./bin/hkdf" }, "scripts": {