2014-10-14 10:31:37 +00:00
|
|
|
checkInt = (s) ->
|
|
|
|
# Make sure `s` exists and is not an empty string.
|
|
|
|
if !s
|
|
|
|
return
|
|
|
|
i = parseInt(s, 10)
|
|
|
|
if isNaN(i)
|
|
|
|
return
|
|
|
|
return i
|
|
|
|
|
2015-10-14 21:50:26 +00:00
|
|
|
checkValidKey = (s) ->
|
|
|
|
# Make sure `s` exists and is not an empty string, or 'null'.
|
|
|
|
if !s? or s == 'null' or s == ''
|
|
|
|
return
|
|
|
|
return s
|
|
|
|
|
2014-05-11 23:15:10 +00:00
|
|
|
module.exports = config =
|
2014-07-15 16:51:20 +00:00
|
|
|
apiEndpoint: process.env.API_ENDPOINT ? 'https://api.resin.io'
|
2015-01-13 17:14:51 +00:00
|
|
|
listenPort: process.env.LISTEN_PORT ? 80
|
2015-07-24 17:26:33 +00:00
|
|
|
gosuperAddress: "http://unix:#{process.env.GOSUPER_SOCKET}:"
|
2014-07-15 16:51:20 +00:00
|
|
|
registryEndpoint: process.env.REGISTRY_ENDPOINT ? 'registry.resin.io'
|
2014-05-11 23:15:10 +00:00
|
|
|
pubnub:
|
2015-10-14 21:50:26 +00:00
|
|
|
subscribe_key: checkValidKey(process.env.PUBNUB_SUBSCRIBE_KEY) ? process.env.DEFAULT_PUBNUB_SUBSCRIBE_KEY
|
|
|
|
publish_key: checkValidKey(process.env.PUBNUB_PUBLISH_KEY) ? process.env.DEFAULT_PUBNUB_PUBLISH_KEY
|
|
|
|
mixpanelToken: checkValidKey(process.env.MIXPANEL_TOKEN) ? process.env.DEFAULT_MIXPANEL_TOKEN
|
2015-12-21 14:44:43 +00:00
|
|
|
dockerSocket: process.env.DOCKER_SOCKET
|
2015-02-16 20:49:43 +00:00
|
|
|
supervisorImage: process.env.SUPERVISOR_IMAGE ? 'resin/rpi-supervisor'
|
2014-08-05 14:18:19 +00:00
|
|
|
configMountPoint: process.env.CONFIG_MOUNT_POINT ? '/mnt/mmcblk0p1/config.json'
|
2014-08-14 21:32:03 +00:00
|
|
|
ledFile: process.env.LED_FILE ? '/sys/class/leds/led0/brightness'
|
2014-10-14 10:31:37 +00:00
|
|
|
bootstrapRetryDelay: checkInt(process.env.BOOTSTRAP_RETRY_DELAY_MS) ? 30000
|
|
|
|
restartSuccessTimeout: checkInt(process.env.RESTART_SUCCESS_TIMEOUT) ? 60000
|
2014-10-14 10:38:50 +00:00
|
|
|
appUpdatePollInterval: checkInt(process.env.APPLICATION_UPDATE_POLL_INTERVAL) ? 60000
|
2014-09-03 23:01:27 +00:00
|
|
|
successMessage: 'SUPERVISOR OK'
|
2015-11-02 16:16:43 +00:00
|
|
|
forceSecret:
|
|
|
|
api: process.env.RESIN_SUPERVISOR_SECRET ? null
|
|
|
|
logsChannel: process.env.RESIN_SUPERVISOR_LOGS_CHANNEL ? null
|
2015-08-26 21:57:14 +00:00
|
|
|
vpnStatusPath: process.env.VPN_STATUS_PATH ? '/mnt/root/run/openvpn/vpn_status'
|
2015-10-01 12:12:52 +00:00
|
|
|
checkInt: checkInt
|