Make env vars more palatable for containerization (#10895)

* refactor(env-vars): remove object/colon syntax

* fix(tests): correct config expectations
This commit is contained in:
Sabe Jones
2018-12-06 10:13:49 -06:00
committed by GitHub
parent 18ab57eb91
commit f42e22b58f
25 changed files with 140 additions and 178 deletions
+5 -5
View File
@@ -4,20 +4,20 @@ import apn from 'apn';
import logger from './logger';
import gcmLib from 'node-gcm'; // works with FCM notifications too
const FCM_API_KEY = nconf.get('PUSH_CONFIGS:FCM_SERVER_API_KEY');
const FCM_API_KEY = nconf.get('PUSH_CONFIGS_FCM_SERVER_API_KEY');
const fcmSender = FCM_API_KEY ? new gcmLib.Sender(FCM_API_KEY) : undefined;
let apnProvider;
// Load APN certificate and key from S3
const APN_ENABLED = nconf.get('PUSH_CONFIGS:APN_ENABLED') === 'true';
const APN_ENABLED = nconf.get('PUSH_CONFIGS_APN_ENABLED') === 'true';
if (APN_ENABLED) {
apnProvider = APN_ENABLED ? new apn.Provider({
token: {
key: nconf.get('PUSH_CONFIGS:APN_KEY'),
keyId: nconf.get('PUSH_CONFIGS:APN_KEY_ID'),
teamId: nconf.get('PUSH_CONFIGS:APN_TEAM_ID'),
key: nconf.get('PUSH_CONFIGS_APN_KEY'),
keyId: nconf.get('PUSH_CONFIGS_APN_KEY_ID'),
teamId: nconf.get('PUSH_CONFIGS_APN_TEAM_ID'),
},
production: nconf.get('IS_PROD'),
}) : undefined;