generalization, updates

This commit is contained in:
AJ ONeal 2015-11-28 05:57:07 +00:00
parent 5a8f901bbe
commit 9bcee6ae99
2 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@ module.exports.create = function (opts) {
// Worker Mode
//
function waitForConfig(message) {
if ('com.daplie.walnut.init' !== message.type) {
if ('walnut.init' !== message.type) {
console.warn('[Worker] 0 got unexpected message:');
console.warn(message);
return;
@ -59,7 +59,7 @@ module.exports.create = function (opts) {
}
promiseApp = new PromiseA(function (resolve) {
function initWebServer(srvmsg) {
if ('com.daplie.walnut.webserver.onrequest' !== srvmsg.type) {
if ('walnut.webserver.onrequest' !== srvmsg.type) {
console.warn('[Worker] 1 got unexpected message:');
console.warn(srvmsg);
return;
@ -70,7 +70,7 @@ module.exports.create = function (opts) {
resolve(require('../lib/worker').create(webserver, srvmsg));
}
process.send({ type: 'com.daplie.walnut.webserver.listening' });
process.send({ type: 'walnut.webserver.listening' });
process.on('message', initWebServer);
}).then(function (app) {
console.info('[Worker Ready]');

View File

@ -15,7 +15,7 @@ module.exports.create = function (webserver, info, state) {
var models = {};
var systemFactory = require('sqlite3-cluster/client').createClientFactory({
dirname: path.join(__dirname, '..', '..', 'var') // TODO info.conf
, prefix: 'com.daplie.'
, prefix: 'com.example.'
//, dbname: 'config'
, suffix: ''
, ext: '.sqlite3'
@ -27,7 +27,7 @@ module.exports.create = function (webserver, info, state) {
, bits: 128
, mode: 'cbc'
, dirname: path.join(__dirname, '..', '..', 'var') // TODO info.conf
, prefix: 'com.daplie.'
, prefix: 'com.example.'
//, dbname: 'cluster'
, suffix: ''
, ext: '.sqlcipher'
@ -53,7 +53,7 @@ module.exports.create = function (webserver, info, state) {
return require('./lib/unlock-device').create().then(function (result) {
result.promise.then(function (_rootMasterKey) {
process.send({
type: 'com.daplie.walnut.keys.root'
type: 'walnut.keys.root'
conf: {
rootMasterKey: _rootMasterkey
}
@ -204,7 +204,7 @@ module.exports.create = function (webserver, info, state) {
if (/(^|\.)proxyable\./.test(req.hostname)) {
// device-id-12345678.proxyable.myapp.mydomain.com => myapp.mydomain.com
// proxyable.myapp.mydomain.com => myapp.mydomain.com
// TODO myapp.mydomain.com.daplieproxyable.com => myapp.mydomain.com
// TODO myapp.mydomain.com.example.proxyable.com => myapp.mydomain.com
req.hostname = req.hostname.replace(/.*\.?proxyable\./, '');
}