mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:53:30 +02:00
Add socket.io with authentication and start rebuilding the device list.
This commit is contained in:
19
lib/cli.js
19
lib/cli.js
@@ -335,6 +335,12 @@ program
|
||||
.option('-a, --auth-url <url>'
|
||||
, 'URL to auth client'
|
||||
, String)
|
||||
.option('-u, --connect-sub <endpoint>'
|
||||
, 'sub endpoint'
|
||||
, cliutil.list)
|
||||
.option('-c, --connect-push <endpoint>'
|
||||
, 'push endpoint'
|
||||
, cliutil.list)
|
||||
.action(function(options) {
|
||||
if (!options.secret) {
|
||||
this.missingArgument('--secret')
|
||||
@@ -342,12 +348,23 @@ program
|
||||
if (!options.authUrl) {
|
||||
this.missingArgument('--auth-url')
|
||||
}
|
||||
if (!options.connectSub) {
|
||||
this.missingArgument('--connect-sub')
|
||||
}
|
||||
if (!options.connectPush) {
|
||||
this.missingArgument('--connect-push')
|
||||
}
|
||||
|
||||
require('./roles/app')({
|
||||
port: options.port
|
||||
, secret: options.secret
|
||||
, ssid: options.ssid
|
||||
, authUrl: options.authUrl
|
||||
, groupTimeout: 10000
|
||||
, endpoints: {
|
||||
sub: options.connectSub
|
||||
, push: options.connectPush
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -493,6 +510,8 @@ program
|
||||
, '--port', options.appPort
|
||||
, '--secret', options.authSecret
|
||||
, '--auth-url', util.format('http://localhost:%d/', options.authPort)
|
||||
, '--connect-sub', options.bindAppPub
|
||||
, '--connect-push', options.bindAppPull
|
||||
])
|
||||
.catch(function(err) {
|
||||
log.error('app died', err.stack)
|
||||
|
||||
Reference in New Issue
Block a user