Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs
This commit is contained in:
commit
7fb1dd800c
|
@ -25,7 +25,7 @@ const ModuleInfo = exports.moduleInfo = {
|
|||
function WebSocketClient(ws, req, serverType) {
|
||||
|
||||
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() {
|
||||
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);
|
||||
|
||||
|
@ -75,11 +76,11 @@ function WebSocketClient(ws, req, serverType) {
|
|||
// If the config allows it, look for 'x-forwarded-proto' as "https"
|
||||
// to override |isSecure|
|
||||
//
|
||||
if(true === _.get(Config, 'loginServers.webSocket.secureProxy') &&
|
||||
if(true === _.get(Config, 'loginServers.webSocket.proxied') &&
|
||||
'https' === req.headers['x-forwarded-proto'])
|
||||
{
|
||||
Log.debug(`Assuming secure connection due to X-Forwarded-Proto of ${req.headers['x-forwarded-proto']}`);
|
||||
this.secureProxyConnection = true;
|
||||
Log.debug(`Assuming secure connection due to X-Forwarded-Proto of "${req.headers['x-forwarded-proto']}"`);
|
||||
this.proxied = true;
|
||||
}
|
||||
|
||||
// start handshake process
|
||||
|
|
|
@ -101,10 +101,10 @@ enigma_footer() {
|
|||
log "ENiGMA½ installation complete!"
|
||||
echo -e "\e[33m"
|
||||
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}
|
||||
./oputil.js config --new
|
||||
./oputil.js config new
|
||||
|
||||
Additionally, the following support binaires are recommended:
|
||||
7zip: Archive support
|
||||
|
@ -133,4 +133,4 @@ download_enigma_source
|
|||
install_node_packages
|
||||
enigma_footer
|
||||
|
||||
} # this ensures the entire script is downloaded before execution
|
||||
} # this ensures the entire script is downloaded before execution
|
||||
|
|
Loading…
Reference in New Issue