update to latest lamassu.json
This commit is contained in:
parent
e559548b04
commit
478c6ebe0c
3 changed files with 13 additions and 19 deletions
|
|
@ -15,7 +15,7 @@ var httpOnly = options.httpOnly || argv.http
|
||||||
if (!httpOnly) {
|
if (!httpOnly) {
|
||||||
try {
|
try {
|
||||||
options.https = {
|
options.https = {
|
||||||
key: fs.readFileSync(options.certKeyPath),
|
key: fs.readFileSync(options.keyPath),
|
||||||
cert: fs.readFileSync(options.certPath)
|
cert: fs.readFileSync(options.certPath)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,20 @@
|
||||||
'use strict'
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const os = require('os')
|
||||||
|
|
||||||
var fs = require('fs')
|
let serverConfig
|
||||||
var path = require('path')
|
|
||||||
var os = require('os')
|
|
||||||
|
|
||||||
var options
|
|
||||||
var configPath
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
configPath = '/etc/lamassu.json'
|
const homeConfigPath = path.resolve(os.homedir(), '.lamassu', 'lamassu.json')
|
||||||
options = JSON.parse(fs.readFileSync(configPath))
|
serverConfig = JSON.parse(fs.readFileSync(homeConfigPath))
|
||||||
} catch (err) {
|
} catch (_) {
|
||||||
try {
|
try {
|
||||||
configPath = path.resolve(os.homedir(), '.lamassu', 'lamassu.json')
|
const globalConfigPath = path.resolve('/etc', 'lamassu', 'lamassu.json')
|
||||||
console.log(configPath)
|
serverConfig = JSON.parse(fs.readFileSync(globalConfigPath))
|
||||||
options = JSON.parse(fs.readFileSync(configPath))
|
} catch (_) {
|
||||||
} catch (err2) {
|
console.log("Couldn't open config file.")
|
||||||
console.log('Missing configuration file -- exiting.')
|
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = options
|
module.exports = serverConfig
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,6 @@
|
||||||
"bin": {
|
"bin": {
|
||||||
"lamassu-server": "./bin/lamassu-server",
|
"lamassu-server": "./bin/lamassu-server",
|
||||||
"lamassu-migrate": "./bin/lamassu-migrate",
|
"lamassu-migrate": "./bin/lamassu-migrate",
|
||||||
"ssu-raqia": "./bin/ssu-raqia",
|
|
||||||
"ssu": "./bin/ssu",
|
|
||||||
"hkdf": "./bin/hkdf"
|
"hkdf": "./bin/hkdf"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue