15
src/nginx.js
15
src/nginx.js
@@ -11,7 +11,6 @@ var assert = require('assert'),
|
||||
shell = require('./shell.js');
|
||||
|
||||
exports = module.exports = {
|
||||
requiresOAuthProxy: requiresOAuthProxy,
|
||||
configureAdmin: configureAdmin,
|
||||
configureApp: configureApp,
|
||||
unconfigureApp: unconfigureApp,
|
||||
@@ -21,18 +20,6 @@ exports = module.exports = {
|
||||
var NGINX_APPCONFIG_EJS = fs.readFileSync(__dirname + '/../setup/start/nginx/appconfig.ejs', { encoding: 'utf8' }),
|
||||
RELOAD_NGINX_CMD = path.join(__dirname, 'scripts/reloadnginx.sh');
|
||||
|
||||
function requiresOAuthProxy(app) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
|
||||
var tmp = app.accessRestriction;
|
||||
|
||||
// if no accessRestriction set, or the app uses one of the auth modules, we do not need the oauth proxy
|
||||
if (tmp === null) return false;
|
||||
if (app.manifest.addons['ldap'] || app.manifest.addons['oauth'] || app.manifest.addons['simpleauth']) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function configureAdmin(certFilePath, keyFilePath, callback) {
|
||||
assert.strictEqual(typeof certFilePath, 'string');
|
||||
assert.strictEqual(typeof keyFilePath, 'string');
|
||||
@@ -62,7 +49,7 @@ function configureApp(app, certFilePath, keyFilePath, callback) {
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
var sourceDir = path.resolve(__dirname, '..');
|
||||
var oauthProxy = requiresOAuthProxy(app);
|
||||
var oauthProxy = app.oauthProxy;
|
||||
var endpoint = oauthProxy ? 'oauthproxy' : 'app';
|
||||
var vhost = app.altDomain || config.appFqdn(app.location);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user