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:
Paul Melnikow
2019-01-06 10:42:09 -05:00
committed by GitHub
parent 3ffb3ef5b4
commit fa5309400d
35 changed files with 493 additions and 484 deletions

View File

@@ -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 =>

View File

@@ -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() {