balena-supervisor/src/config.coffee

21 lines
602 B
CoffeeScript
Raw Normal View History

module.exports = config =
apiEndpoint: process.env.API_ENDPOINT
registryEndpoint: process.env.REGISTRY_ENDPOINT
pubnub:
subscribe_key: process.env.PUBNUB_SUBSCRIBE_KEY
publish_key: process.env.PUBNUB_PUBLISH_KEY
2014-06-18 16:54:36 +00:00
mixpanelToken: process.env.MIXPANEL_TOKEN
2014-06-15 11:34:16 +00:00
dockerSocket: '/run/docker.sock'
expectedEnvVars: [
'API_ENDPOINT'
'REGISTRY_ENDPOINT'
2014-06-18 16:54:36 +00:00
'MIXPANEL_TOKEN'
'PUBNUB_SUBSCRIBE_KEY'
'PUBNUB_PUBLISH_KEY'
]
# A check that all variables are set and notify the user if not
for envVar in config.expectedEnvVars when !process.env[envVar]?
console.error('Cannot find env var:', envVar)