Skip to content

Commit

Permalink
Zowe Suite v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Jan 7, 2025
2 parents a7c402c + 7b63513 commit c0ca052
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 40 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Zlux App Server Changelog

All notable changes to the Zlux App Server package will be documented in this file.
## v3.1.0
- Enhancement: if no `zowe.logDirectory` is defined in config, logging is disabled. [(#317)](https://github.com/zowe/zlux-app-server/pull/317)

## v3.1.0
- Enhancement: app-server tries to detect ssh and telnet ports (used by terminals) automatically. [(#326)](https://github.com/zowe/zlux-app-server/pull/326)
- Bugfix: app-server no longer causes Zowe to print "FSUM7422 node is not found" and "Node found in NODE_HOME" upon startup. This avoids confusion about if node requirements are met. (#325)

## v3.0.0
- Enhancement: Added new plugin identifier for the V3 Ivy Desktop to list of default plugins. Also added this plugin to list of allowedPlugins.json.
Expand Down
5 changes: 2 additions & 3 deletions bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ if [ -n "${ZWE_zowe_runtimeDirectory}" ]; then
# used for relativeTo plugins
export ZLUX_ROOT_DIR=$COMPONENT_HOME/share
else
# dev env
. ./validate.sh
COMPONENT_HOME=$(cd ../..; pwd)
# dev env
COMPONENT_HOME=$(cd ../..; pwd)

# used for relativeTo plugins
export ZLUX_ROOT_DIR=$COMPONENT_HOME
Expand Down
35 changes: 21 additions & 14 deletions bin/utils/setup-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This program and the accompanying materials are
# made available under the terms of the Eclipse Public License v2.0 which accompanies
# this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
#
#
# SPDX-License-Identifier: EPL-2.0
#
#
# Copyright Contributors to the Zowe Project.

if [ -n "$ZWED_NODE_LOG_FILE" ]
Expand All @@ -21,26 +21,33 @@ else
then
ZWED_NODE_LOG_DIR=${ZWE_zowe_logDirectory}
elif [ -n "${HOME}" ]; then
ZWED_NODE_LOG_DIR="${HOME}/.zowe/logs"
ZWED_NODE_LOG_DIR="${HOME}/.zowe/logs"
else
ZWED_NODE_LOG_DIR="../log"
if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then
ZWED_NODE_LOG_DIR="../log"
else
echo "No log directory. Logging disabled."
ZWED_NODE_LOG_DIR=
ZWED_NODE_LOG_FILE=/dev/null
fi
fi
fi

if [ -f "$ZWED_NODE_LOG_DIR" ]
then
ZWED_NODE_LOG_FILE=$ZWED_NODE_LOG_DIR
elif [ ! -d "$ZWED_NODE_LOG_DIR" ]
then
echo "Will make log directory $ZWED_NODE_LOG_DIR"
mkdir -p $ZWED_NODE_LOG_DIR
if [ $? -ne 0 ]
then
echo "Cannot make log directory. Logging disabled."
ZWED_NODE_LOG_FILE=/dev/null
if [ -n "$ZWED_NODE_LOG_DIR" ]; then
echo "Will make log directory $ZWED_NODE_LOG_DIR"
mkdir -p $ZWED_NODE_LOG_DIR
if [ $? -ne 0 ]; then
echo "Cannot make log directory. Logging disabled."
ZWED_NODE_LOG_FILE=/dev/null
fi
fi
fi

ZLUX_ROTATE_LOGS=0
if [ -d "$ZWED_NODE_LOG_DIR" ] && [ -z "$ZWED_NODE_LOG_FILE" ]
then
Expand All @@ -58,9 +65,9 @@ else
if [ $ZWED_NODE_LOGS_TO_KEEP -ge 0 ]
then
ZLUX_ROTATE_LOGS=1
fi
fi
fi

#Clean up excess logs, if appropriate.
if [ $ZLUX_ROTATE_LOGS -ne 0 ]
then
Expand Down
20 changes: 0 additions & 20 deletions bin/validate.sh

This file was deleted.

4 changes: 2 additions & 2 deletions defaults/serverConfig/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ zowe:
workspaceDirectory: ${{ process.env.HOME + '/.zowe/workspace' }}
externalDomains: ${{ function a() { if (process.env.ZWE_zowe_externalDomains) { return process.env.ZWE_zowe_externalDomains.split(','); } else { return [ os.hostname() ] } }; a() }}
environments:
ZWED_SSH_PORT: 22
ZWED_TN3270_PORT: 23
ZWED_SSH_PORT: "${{ process.env.ZWED_SSH_PORT ? process.env.ZWED_SSH_PORT : 22 }}"
ZWED_TN3270_PORT: "${{ process.env.ZWED_TN3270_PORT ? process.env.ZWED_TN3270_PORT : 23 }}"
ZWED_TN3270_SECURITY: telnet
ZWED_SSH_HOST: ${{ zowe.externalDomains[0] }}
ZWED_TN3270_HOST: ${{ zowe.externalDomains[0] }}
Expand Down
33 changes: 33 additions & 0 deletions lib/initUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,35 @@ let registerBundledPlugin = function(pluginId, destination, oldPlugins, filePerm
}
module.exports.registerBundledPlugin = registerBundledPlugin;

function readPortFromUnixConfig(configFile, regex) {
let result = 0;
if (fileExists(configFile)) {
const configContent = fs.readFileSync(configFile, 'utf8');
if (configContent) {
const configLines = configContent.split('\n');
for (let line in configLines) {
const matchLine = configLines[line].match(regex);
if (matchLine) {
const portNumber = parseInt(matchLine[0].replace(/\s+/g, " ").split(' ')[1]);
if (portNumber > 0 && portNumber < 65536) {
printFormattedDebug(`readPortFromUnixConfig: ${configFile} -> "${matchLine[0]}" -> ${portNumber}`);
result = portNumber;
}
}
}
}
}
return result;
}

module.exports.setTerminalDefaults = function(configDestination, instanceItems) {
if (instanceItems.indexOf('org.zowe.terminal.vt.json') != -1) {
if (!process.env['ZWED_SSH_PORT']) {
const sshPort = readPortFromUnixConfig('/etc/ssh/sshd_config', /^port[\s]+[0-9]{1,5}/i);
if (sshPort) {
process.env['ZWED_SSH_PORT'] = sshPort;
}
}
let defaultConfigDir = path.join(configDestination,'org.zowe.terminal.vt','sessions');
mkdirp(defaultConfigDir);
try {
Expand All @@ -334,6 +361,12 @@ module.exports.setTerminalDefaults = function(configDestination, instanceItems)
}
}
if (instanceItems.indexOf('org.zowe.terminal.tn3270.json') != -1) {
if (!process.env['ZWED_TN3270_PORT']) {
const telnetPort = readPortFromUnixConfig('/etc/services', /^telnet[\s]+[0-9]{1,5}/i);
if (telnetPort) {
process.env['ZWED_TN3270_PORT'] = telnetPort;
}
}
let security = 'telnet';
if (process.env['ZWED_TN3270_SECURITY']) {
security = process.env['ZWED_TN3270_SECURITY'];
Expand Down
1 change: 0 additions & 1 deletion manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ commands:
install: share/zlux-app-server/bin/internal-install.sh
start: bin/start.sh
configure: bin/configure.sh
validate: bin/validate.sh
# we do not specify encoding here because its already tagged ascii
apimlServices:
dynamic:
Expand Down

0 comments on commit c0ca052

Please sign in to comment.