Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs

This commit is contained in:
Bryan Ashby 2017-06-01 18:51:36 -06:00
commit 7fb1dd800c
2 changed files with 9 additions and 8 deletions

View File

@ -25,7 +25,7 @@ const ModuleInfo = exports.moduleInfo = {
function WebSocketClient(ws, req, serverType) { function WebSocketClient(ws, req, serverType) {
Object.defineProperty(this, 'isSecure', { Object.defineProperty(this, 'isSecure', {
get : () => ('secure' === serverType || true === this.secureProxyConnection) ? true : false, get : () => ('secure' === serverType || true === this.proxied) ? true : false,
}); });
// //
@ -47,7 +47,8 @@ function WebSocketClient(ws, req, serverType) {
} }
get remoteAddress() { get remoteAddress() {
return req.connection.remoteAddress; // Support X-Forwarded-For and X-Real-IP headers for proxied connections
return (this.proxied && (req.headers['x-forwarded-for'] || req.headers['x-real-ip'])) || req.connection.remoteAddress;
} }
}(ws); }(ws);
@ -75,11 +76,11 @@ function WebSocketClient(ws, req, serverType) {
// If the config allows it, look for 'x-forwarded-proto' as "https" // If the config allows it, look for 'x-forwarded-proto' as "https"
// to override |isSecure| // to override |isSecure|
// //
if(true === _.get(Config, 'loginServers.webSocket.secureProxy') && if(true === _.get(Config, 'loginServers.webSocket.proxied') &&
'https' === req.headers['x-forwarded-proto']) 'https' === req.headers['x-forwarded-proto'])
{ {
Log.debug(`Assuming secure connection due to X-Forwarded-Proto of ${req.headers['x-forwarded-proto']}`); Log.debug(`Assuming secure connection due to X-Forwarded-Proto of "${req.headers['x-forwarded-proto']}"`);
this.secureProxyConnection = true; this.proxied = true;
} }
// start handshake process // start handshake process

View File

@ -101,10 +101,10 @@ enigma_footer() {
log "ENiGMA½ installation complete!" log "ENiGMA½ installation complete!"
echo -e "\e[33m" echo -e "\e[33m"
cat << EndOfMessage cat << EndOfMessage
If this is the first time you've installed ENiGMA½, you now need to generate a minimal configuration. To do so, run the following commands: If this is the first time you've installed ENiGMA½, you now need to generate a minimal configuration. To do so, run the following commands (note: if you did not already have node.js installed, you may need to log out/back in to refresh your path):
cd ${ENIGMA_INSTALL_DIR} cd ${ENIGMA_INSTALL_DIR}
./oputil.js config --new ./oputil.js config new
Additionally, the following support binaires are recommended: Additionally, the following support binaires are recommended:
7zip: Archive support 7zip: Archive support