balena-cli/lib/resin/config.coffee

38 lines
902 B
CoffeeScript
Raw Normal View History

2014-11-18 11:37:29 -04:00
_ = require('lodash')
url = require('url')
2014-11-17 15:40:16 -04:00
path = require('path')
2014-11-18 11:37:29 -04:00
config =
2014-10-31 11:59:23 -04:00
# TODO: Should be configurable
remoteUrl: 'https://staging.resin.io'
2014-11-18 10:11:07 -04:00
apiPrefix: '/ewa/'
2014-11-18 12:20:37 -04:00
# TODO: Check if not running on UNIX environment
# and add a custom path accordingly
2014-11-17 15:40:16 -04:00
dataPrefix: path.join(process.env.HOME, '.resin')
2014-11-20 14:00:39 -04:00
sshKeyWidth: 43
2014-11-18 11:37:29 -04:00
2014-11-28 12:46:24 -04:00
pubnub:
subscribe_key: 'sub-c-bbc12eba-ce4a-11e3-9782-02ee2ddab7fe'
publish_key: 'pub-c-6cbce8db-bfd1-4fdf-a8c8-53671ae2b226'
ssl: true
events:
deviceLogs: 'device-<%= uuid %>-logs'
config.pluginsDirectory = path.join(config.dataPrefix, 'plugins')
2014-11-18 11:37:29 -04:00
config.urls =
signup: '/signup'
2014-11-19 08:59:17 -04:00
preferences: '/preferences'
2014-11-20 13:02:29 -04:00
keys: '/user/keys'
2014-11-24 11:40:51 -04:00
identify: '/blink'
2014-12-01 09:52:45 -04:00
authenticate: '/login_'
2014-11-18 11:37:29 -04:00
# Append config.remoteUrl before every url
config.urls = _.object _.map config.urls, (value, key, object) ->
return [ key, url.resolve(config.remoteUrl, value) ]
module.exports = config