2017-05-13 00:46:39 +03:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2017-05-15 21:18:18 +03:00
|
|
|
const Fs = require('fs');
|
2017-05-13 00:46:39 +03:00
|
|
|
const ControlTower = require('../');
|
|
|
|
|
2017-05-15 21:18:18 +03:00
|
|
|
|
|
|
|
const cert = process.env.CMON_CERT_PATH ? Fs.readFileSync(process.env.CMON_CERT_PATH) : process.env.CMON_CERT;
|
|
|
|
const key = process.env.CMON_KEY_PATH ? Fs.readFileSync(process.env.CMON_KEY_PATH) : process.env.CMON_KEY;
|
|
|
|
const datacenter = 'cmon.us-sw-1.triton.zone:9163';
|
|
|
|
|
|
|
|
const tower = new ControlTower({ cmon: { cert, key, datacenter } });
|
2017-05-13 00:46:39 +03:00
|
|
|
tower.start((err) => {
|
|
|
|
if (err) {
|
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('Control Tower Started');
|
|
|
|
});
|