diff --git a/bin/browserid b/bin/browserid index 3e88bd93f1a0194bf0c28d5504d7cec0dfa883dd..c7bc941cf8fd7f75b04541e9220417093582b9f2 100755 --- a/bin/browserid +++ b/bin/browserid @@ -180,9 +180,9 @@ db.open(config.get('database'), function (error) { logger.error("error creating test users - bcrypt encrypt pass: " + err); process.exit(1); } - var want = parseInt(process.env['CREATE_TEST_USERS']); + var want = parseInt(process.env['CREATE_TEST_USERS'], 10); var have = 0; - for (i = 1; i <= want; i++) { + for (var i = 1; i <= want; i++) { db.addTestUser(i + "@loadtest.domain", hash, function(err, email) { if (++have == want) { logger.warn("created " + want + " test users"); diff --git a/bin/dbwriter b/bin/dbwriter index c629863e2241f62b8d94e08342cd66697caffe70..f50e577de773aebaf3592c25c5a8aabb3c5cdca1 100755 --- a/bin/dbwriter +++ b/bin/dbwriter @@ -8,13 +8,13 @@ const fs = require('fs'), path = require('path'), url = require('url'), -http = require('http'); +http = require('http'), urlparse = require('urlparse'), express = require('express'), wsapi = require('../lib/wsapi.js'), -httputils = require('../lib/httputils.js'); +httputils = require('../lib/httputils.js'), secrets = require('../lib/secrets.js'), -db = require('../lib/db.js'); +db = require('../lib/db.js'), config = require('../lib/configuration.js'), heartbeat = require('../lib/heartbeat.js'), metrics = require('../lib/metrics.js'), @@ -49,7 +49,7 @@ app.use(express.logger({ var statsd_config = config.get('statsd'); if (statsd_config && statsd_config.enabled) { - logger_statsd = require("connect-logger-statsd"); + var logger_statsd = require("connect-logger-statsd"); app.use(logger_statsd({ host: statsd_config.hostname || "localhost", port: statsd_config.port || 8125, @@ -93,7 +93,7 @@ wsapi.setup({ function doShutdown(readyForShutdownCB) { require('../lib/bcrypt.js').shutdown(); - db.close(readyForShutdownCB) + db.close(readyForShutdownCB); } // open the databse diff --git a/bin/keysigner b/bin/keysigner index 714a4fed322de04c1971f966c1f94755ec1c4784..1d981b0c5bc2203a46673e15eef3f423920402de 100755 --- a/bin/keysigner +++ b/bin/keysigner @@ -42,7 +42,7 @@ app.use(express.logger({ var statsd_config = config.get('statsd'); if (statsd_config && statsd_config.enabled) { - logger_statsd = require("connect-logger-statsd"); + var logger_statsd = require("connect-logger-statsd"); app.use(logger_statsd({ host: statsd_config.hostname || "localhost", port: statsd_config.port || 8125, diff --git a/bin/router b/bin/router index dc409f51267387c05c08a9f0f6c540854cf6c25c..3f7f1330ddb431d5eb8b16076e0b29b68aefca26 100755 --- a/bin/router +++ b/bin/router @@ -8,7 +8,7 @@ const fs = require('fs'), path = require('path'), url = require('url'), -http = require('http'); +http = require('http'), urlparse = require('urlparse'), express = require('express'); @@ -70,7 +70,7 @@ app.use(express.limit("10kb")); var statsd_config = config.get('statsd'); if (statsd_config && statsd_config.enabled) { - logger_statsd = require("connect-logger-statsd"); + var logger_statsd = require("connect-logger-statsd"); app.use(logger_statsd({ host: statsd_config.hostname || "localhost", port: statsd_config.port || 8125, diff --git a/bin/verifier b/bin/verifier index d58415422bb02a7aabdfca68a478a66bf73a4b29..5596047ee2b6b86f6edc65a65361a4ec08f3685f 100755 --- a/bin/verifier +++ b/bin/verifier @@ -41,7 +41,7 @@ app.use(express.limit("10kb")); var statsd_config = config.get('statsd'); if (statsd_config && statsd_config.enabled) { - logger_statsd = require("connect-logger-statsd"); + var logger_statsd = require("connect-logger-statsd"); app.use(logger_statsd({ host: statsd_config.hostname || "localhost", port: statsd_config.port || 8125, @@ -73,7 +73,7 @@ try { } function doVerification(req, resp, next) { - req.body = req.body || {} + req.body = req.body || {}; var assertion = (req.query && req.query.assertion) ? req.query.assertion : req. body.assertion; var audience = (req.query && req.query.audience) ? req.query.audience : req.body.audience; @@ -124,7 +124,7 @@ function doVerification(req, resp, next) { }); } }); -}; +} app.post('/verify', doVerification); app.post('/', doVerification);