mirror of https://github.com/BTCPrivate/z-nomp.git
commit
8b33ddd6f1
|
@ -42,6 +42,11 @@
|
|||
"adminCenter": {
|
||||
"enabled": false,
|
||||
"password": "password"
|
||||
},
|
||||
"tlsOptions" : {
|
||||
"enabled": false,
|
||||
"cert": "",
|
||||
"key": ""
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
var https = require('https');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
|
@ -327,11 +327,23 @@ module.exports = function(logger){
|
|||
});
|
||||
|
||||
try {
|
||||
if (typeof portalConfig.website.tlsOptions !== 'undefined' && !portalConfig.website.tlsOptions.enabled) {
|
||||
app.listen(portalConfig.website.port, portalConfig.website.host, function () {
|
||||
logger.debug(logSystem, 'Server', 'Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
|
||||
});
|
||||
} else {
|
||||
var TLSoptions = {
|
||||
key: fs.readFileSync(portalConfig.website.tlsOptions.key),
|
||||
cert: fs.readFileSync(portalConfig.website.tlsOptions.cert)
|
||||
};
|
||||
|
||||
https.createServer(TLSoptions, app).listen(portalConfig.website.port, portalConfig.website.host, function() {
|
||||
logger.debug(logSystem, 'Server', 'TLS Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
|
||||
});
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
console.log(e)
|
||||
logger.error(logSystem, 'Server', 'Could not start website on ' + portalConfig.website.host + ':' + portalConfig.website.port
|
||||
+ ' - its either in use or you do not have permission');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue