oauth_reverse_proxy
Advanced tools
Comparing version 0.9.10 to 0.9.11
28
index.js
@@ -12,7 +12,6 @@ /** | ||
var oauth_reverse_proxy = require('./lib'); | ||
var logger = require('./lib/logger.js').getLogger(); | ||
/** | ||
* The config path can be provided as an environemnt variable. If not rpvoided, we chose | ||
* sane defaults for Windows and non-Windows. | ||
* The config path can be provided as an environemnt variable. If not provided, | ||
* we choose sane defaults for Windows and non-Windows. | ||
*/ | ||
@@ -29,2 +28,23 @@ var config_path = process.env.OAUTH_REVERSE_PROXY_CONFIG_PATH; | ||
/** | ||
* The logging directory can be provided as an environment variable. If not provided, | ||
* we choose sane defaults for Windows and non-Windows. | ||
*/ | ||
var log_dir = process.env.OAUTH_REVERSE_PROXY_LOG_DIR; | ||
if (!log_dir) { | ||
var os = require('os').type().toLowerCase(); | ||
if (os.indexOf('windows') !== -1 || os.indexOf('cygwin') !== -1) { | ||
log_dir = "C:\\ProgramData\\oauth_reverse_proxy\\logs\\"; | ||
} else { | ||
log_dir = "/var/log/oauth_reverse_proxy/"; | ||
} | ||
} | ||
try { | ||
var logger = require('./lib/logger.js').setLogDir(log_dir); | ||
} catch(e) { | ||
console.err("Failed to initialize logger pointing at %s", log_dir); | ||
process.exit(1); | ||
} | ||
// Create an oauth_reverse_proxy instance at our configured root dir. | ||
@@ -37,5 +57,5 @@ oauth_reverse_proxy.init(config_path, function(err, proxy) { | ||
setTimeout(function() { | ||
process.exit(1); | ||
process.exit(2); | ||
}, 2000); | ||
} | ||
}); |
@@ -5,7 +5,24 @@ var util = require('util'); | ||
var default_config = { | ||
name: 'oauth_reverse_proxy', | ||
streams: [{ | ||
level: process.env.OAUTH_REVERSE_PROXY_LOG_LEVEL || "warn", | ||
stream: process.stdout | ||
}] | ||
}; | ||
// Create a default logger to use if all else fails. | ||
var default_logger = bunyan.createLogger({name: 'oauth_reverse_proxy'}); | ||
var default_logger = bunyan.createLogger(default_config); | ||
// TODO: Wire up file logging | ||
/* istanbul ignore next */ | ||
module.exports.setLogDir = function(dir) { | ||
default_config.streams.push({ | ||
"level": process.env.OAUTH_REVERSE_PROXY_LOG_LEVEL || "info", | ||
"type": "rotating-file", | ||
"path": dir + "proxy.log" | ||
}); | ||
default_logger = bunyan.createLogger(default_config); | ||
}; | ||
// Init the logger with a configuration object | ||
@@ -12,0 +29,0 @@ /* istanbul ignore next */ |
{ | ||
"name": "oauth_reverse_proxy", | ||
"description": "An OAuth 1.0a authenticating reverse proxy", | ||
"version": "0.9.10", | ||
"version": "0.9.11", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15828978
3262
27