Skip to content

Commit

Permalink
Merge pull request #521 from zowe/bugfix/v2/ha-mode-detection
Browse files Browse the repository at this point in the history
Fix for detecting whether or not in HA mode
  • Loading branch information
1000TurquoisePogs authored Jan 9, 2024
2 parents 698a5ea + 8e8ac6a commit 565283d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ All notable changes to the Zlux Server Framework package will be documented in t
This repo is part of the app-server Zowe Component, and the change logs here may appear on Zowe.org in that section.

## 2.14.0
- Bugfix: A call to GET /plugins would trigger an authorization check regardless of if rbac was set on or off

- Bugfix: App-server would not correctly detect when it was running in a high-availability configuration environment. (#521)
- Bugfix: A call to GET /plugins would trigger an authorization check regardless of if rbac was set on or off (#523)

## 2.13.0
- Added support for using zowe.network and components.app-server.zowe.network to set listener IP and TLS properties including max and min version, ciphers, and ECDH curves. (#511)
Expand Down
6 changes: 4 additions & 2 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,11 @@ module.exports.getCookieName = (cookieIdentifier) => {
return 'connect.sid.' + cookieIdentifier;
}


const HA_INSTANCE_COUNT=Object.keys(process.env).filter(key=>!key.match(/ZWE_haInstances_.*_components_.*hostname.*/)).filter(key=>key.match(/ZWE_haInstances_.*hostname/)).length;
const isHaMode = module.exports.isHaMode = function () {
const haInstanceCount = +process.env['ZWE_HA_INSTANCES_COUNT'];
return (!isNaN(haInstanceCount) && haInstanceCount > 1);
let isHaMode = (!isNaN(HA_INSTANCE_COUNT) && HA_INSTANCE_COUNT > 1);
return isHaMode;
}

//TODO, ATTLS
Expand Down

0 comments on commit 565283d

Please sign in to comment.