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
|
|
|
|
|
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:
|
2014-07-15 16:51:20 +00:00
|
|
|
subscribe_key: process.env.PUBNUB_SUBSCRIBE_KEY ? 'sub-c-bananas'
|
|
|
|
publish_key: process.env.PUBNUB_PUBLISH_KEY ? 'pub-c-bananas'
|
|
|
|
mixpanelToken: process.env.MIXPANEL_TOKEN ? 'bananasbananas'
|
|
|
|
dockerSocket: process.env.DOCKER_SOCKET ? '/run/docker.sock'
|
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-07-24 20:59:58 +00:00
|
|
|
forceApiSecret: process.env.RESIN_SUPERVISOR_SECRET ? null
|
2015-08-26 21:57:14 +00:00
|
|
|
vpnStatusPath: process.env.VPN_STATUS_PATH ? '/mnt/root/run/openvpn/vpn_status'
|
2014-08-14 12:35:05 +00:00
|
|
|
|
2014-08-05 14:18:19 +00:00
|
|
|
config.supervisorContainer =
|
2014-09-15 11:31:14 +00:00
|
|
|
Volumes:
|
2014-07-17 13:45:10 +00:00
|
|
|
'/boot/config.json': {}
|
|
|
|
'/data': {}
|
|
|
|
'/run/docker.sock': {}
|
|
|
|
'/mnt/fib_trie': {}
|
2015-01-02 17:34:42 +00:00
|
|
|
'/var/log': {}
|
2014-07-17 13:45:10 +00:00
|
|
|
Binds: [
|
2014-08-05 14:18:19 +00:00
|
|
|
config.configMountPoint + ':/boot/config.json'
|
2014-07-17 13:45:10 +00:00
|
|
|
'/var/run/docker.sock:/run/docker.sock'
|
2014-07-23 13:17:54 +00:00
|
|
|
'/resin-data/resin-supervisor:/data'
|
2014-07-17 13:45:10 +00:00
|
|
|
'/proc/net/fib_trie:/mnt/fib_trie'
|
2014-12-29 12:10:06 +00:00
|
|
|
'/var/log/supervisor-log:/var/log'
|
2015-07-21 22:09:59 +00:00
|
|
|
'/etc/resolv.conf:/etc/resolv.conf:rw'
|
2014-07-17 13:45:10 +00:00
|
|
|
]
|