Protect logging backend.
This commit is contained in:
parent
09b01f5ccf
commit
921052dff5
5 changed files with 32 additions and 1 deletions
server
|
@ -2,11 +2,27 @@
|
|||
|
||||
angular.module('ffffng').factory('app', function (fs, config, _) {
|
||||
var express = require('express');
|
||||
var auth = require('http-auth');
|
||||
var bodyParser = require('body-parser');
|
||||
var compress = require('compression');
|
||||
|
||||
var app = express();
|
||||
|
||||
// urls beneath /internal are protected
|
||||
var internalAuth = auth.basic(
|
||||
{
|
||||
realm: "Knotenformular - Intern"
|
||||
},
|
||||
function (username, password, callback) {
|
||||
callback(
|
||||
config.server.internal.active &&
|
||||
username === config.server.internal.user &&
|
||||
password === config.server.internal.password
|
||||
);
|
||||
}
|
||||
);
|
||||
app.use('/internal', auth.connect(internalAuth));
|
||||
|
||||
app.use(bodyParser.json());
|
||||
|
||||
var clientDir = __dirname + '/../client';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue