PaaS, CI, and production-friendly config (#2626)
This implements the configuration mechanism I described in #2621. The heavy lifting is delegated to [node-config](https://github.com/lorenwest/node-config) with a minor assist from [dotenv](https://github.com/motdotla/dotenv). `private/secret.json` has been replaced with environment variables and/or `config/local.yml`. See `doc/server-secrets.md`.
This commit is contained in:
@@ -8,7 +8,7 @@ const serverSecrets = require('../../../lib/server-secrets')
|
||||
const secretIsValid = require('../../../lib/sys/secret-is-valid')
|
||||
|
||||
function sendTokenToAllServers(token) {
|
||||
const { shieldsIps, shieldsSecret } = serverSecrets
|
||||
const { shieldsIps, shields_secret: shieldsSecret } = serverSecrets
|
||||
return Promise.all(
|
||||
shieldsIps.map(
|
||||
ip =>
|
||||
|
||||
@@ -24,10 +24,10 @@ describe('GitHub admin route', function() {
|
||||
let sandbox
|
||||
beforeEach(function() {
|
||||
sandbox = sinon.createSandbox()
|
||||
// Make this work when there is no `shieldsSecret` defined.
|
||||
serverSecrets.shieldsSecret = undefined
|
||||
// Make this work when there is no `shields_secret` defined.
|
||||
serverSecrets.shields_secret = undefined
|
||||
sandbox
|
||||
.stub(serverSecrets, 'shieldsSecret')
|
||||
.stub(serverSecrets, 'shields_secret')
|
||||
.value(validCredentials.password)
|
||||
})
|
||||
afterEach(function() {
|
||||
|
||||
Reference in New Issue
Block a user