begin admin interface

This commit is contained in:
AJ ONeal 2018-05-26 08:48:23 +00:00
parent 28944a6933
commit d3a6ef96d6
4 changed files with 19 additions and 3 deletions

View File

@ -2,8 +2,14 @@
<html>
<head>
<title>Telebit Relay</title>
<meta charset="UTF-8">
</head>
<body>
<script>document.body.hidden = true;</script>
<button class="js-login">Login</button>
<button class="js-login">Sign Up</button>
<br>
[TODO: Admin Interface]
<script src="js/app.js"></script>
</body>
</html>

6
admin/js/app.js Normal file
View File

@ -0,0 +1,6 @@
(function () {
'use strict';
document.body.hidden = false;
}());

View File

@ -129,7 +129,7 @@ function applyConfig(config) {
, approveDomains: approveDomains
, configDir: state.config.greenlock.configDir
, debug: true
, debug: state.config.debug || state.config.greenlock.debug
//, approvedDomains: program.servernames

View File

@ -118,8 +118,12 @@ module.exports.create = function (state) {
var serveAdmin = require('serve-static')(__dirname + '/admin', { redirect: true });
var finalhandler = require('finalhandler');
state.httpTunnelServer = http.createServer(function (req, res) {
console.log('req.socket.encrypted', req.socket.encrypted);
serveAdmin(req, res, finalhandler(req, res));
console.log('admin req.socket.encrypted', req.socket.encrypted);
res.setHeader('connection', 'close');
serveAdmin(req, res, function () {
console.log("serveAdmin fail");
finalhandler(req, res)
});
});
Object.keys(state.tlsOptions).forEach(function (key) {
tunnelAdminTlsOpts[key] = state.tlsOptions[key];