lint, bugfix

This commit is contained in:
AJ ONeal 2015-04-01 17:47:26 +00:00
parent 2e515b890f
commit 16bee8ae76
1 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,7 @@ fs.readFileSync = function (filename) {
}; };
*/ */
var PromiseA = require('bluebird').Promise;
//var config = require('./device.json'); //var config = require('./device.json');
var securePort = process.argv[2] || 443; var securePort = process.argv[2] || 443;
var insecurePort = process.argv[3] || 80; var insecurePort = process.argv[3] || 80;
@ -61,11 +62,11 @@ function phoneHome() {
holepunch.run(require('./redirects.json').reduce(function (all, redirect) { holepunch.run(require('./redirects.json').reduce(function (all, redirect) {
if (!all[redirect.from.hostname]) { if (!all[redirect.from.hostname]) {
all[redirect.from.hostname] = true; all[redirect.from.hostname] = true;
all.push(redirect.from.hostname) all.push(redirect.from.hostname);
} }
if (!all[redirect.to.hostname]) { if (!all[redirect.to.hostname]) {
all[redirect.to.hostname] = true; all[redirect.to.hostname] = true;
all.push(redirect.to.hostname) all.push(redirect.to.hostname);
} }
return all; return all;
@ -74,11 +75,11 @@ function phoneHome() {
}); });
} }
PromiseA.all( PromiseA.all([
require('./lib/insecure-server').create(securePort, insecurePort, redirects) require('./lib/insecure-server').create(securePort, insecurePort, redirects)
, require('./lib/vhost-sni-server.js').create(securePort, certsPath, vhostsdir) , require('./lib/vhost-sni-server.js').create(securePort, certsPath, vhostsdir)
).then(function () { ]).then(function () {
// TODO use `id' to find user's uid / gid and set to file // TODO use `id' to find user's uid / gid and set to file
process.setgid(1000); process.setgid(1000);
process.setuid(1000); process.setuid(1000);
})//.then(phoneHome); });//.then(phoneHome);