Skip to content

Commit c0ca052

Browse files
authored
Zowe Suite v3.1.0
2 parents a7c402c + 7b63513 commit c0ca052

File tree

7 files changed

+64
-40
lines changed

7 files changed

+64
-40
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Zlux App Server Changelog
22

33
All notable changes to the Zlux App Server package will be documented in this file.
4+
## v3.1.0
5+
- Enhancement: if no `zowe.logDirectory` is defined in config, logging is disabled. [(#317)](https://github.com/zowe/zlux-app-server/pull/317)
6+
7+
## v3.1.0
8+
- Enhancement: app-server tries to detect ssh and telnet ports (used by terminals) automatically. [(#326)](https://github.com/zowe/zlux-app-server/pull/326)
9+
- 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)
410

511
## v3.0.0
612
- Enhancement: Added new plugin identifier for the V3 Ivy Desktop to list of default plugins. Also added this plugin to list of allowedPlugins.json.

bin/start.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ if [ -n "${ZWE_zowe_runtimeDirectory}" ]; then
2727
# used for relativeTo plugins
2828
export ZLUX_ROOT_DIR=$COMPONENT_HOME/share
2929
else
30-
# dev env
31-
. ./validate.sh
32-
COMPONENT_HOME=$(cd ../..; pwd)
30+
# dev env
31+
COMPONENT_HOME=$(cd ../..; pwd)
3332

3433
# used for relativeTo plugins
3534
export ZLUX_ROOT_DIR=$COMPONENT_HOME

bin/utils/setup-logs.sh

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This program and the accompanying materials are
33
# made available under the terms of the Eclipse Public License v2.0 which accompanies
44
# this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
5-
#
5+
#
66
# SPDX-License-Identifier: EPL-2.0
7-
#
7+
#
88
# Copyright Contributors to the Zowe Project.
99

1010
if [ -n "$ZWED_NODE_LOG_FILE" ]
@@ -21,26 +21,33 @@ else
2121
then
2222
ZWED_NODE_LOG_DIR=${ZWE_zowe_logDirectory}
2323
elif [ -n "${HOME}" ]; then
24-
ZWED_NODE_LOG_DIR="${HOME}/.zowe/logs"
24+
ZWED_NODE_LOG_DIR="${HOME}/.zowe/logs"
2525
else
26-
ZWED_NODE_LOG_DIR="../log"
26+
if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then
27+
ZWED_NODE_LOG_DIR="../log"
28+
else
29+
echo "No log directory. Logging disabled."
30+
ZWED_NODE_LOG_DIR=
31+
ZWED_NODE_LOG_FILE=/dev/null
32+
fi
2733
fi
2834
fi
29-
35+
3036
if [ -f "$ZWED_NODE_LOG_DIR" ]
3137
then
3238
ZWED_NODE_LOG_FILE=$ZWED_NODE_LOG_DIR
3339
elif [ ! -d "$ZWED_NODE_LOG_DIR" ]
3440
then
35-
echo "Will make log directory $ZWED_NODE_LOG_DIR"
36-
mkdir -p $ZWED_NODE_LOG_DIR
37-
if [ $? -ne 0 ]
38-
then
39-
echo "Cannot make log directory. Logging disabled."
40-
ZWED_NODE_LOG_FILE=/dev/null
41+
if [ -n "$ZWED_NODE_LOG_DIR" ]; then
42+
echo "Will make log directory $ZWED_NODE_LOG_DIR"
43+
mkdir -p $ZWED_NODE_LOG_DIR
44+
if [ $? -ne 0 ]; then
45+
echo "Cannot make log directory. Logging disabled."
46+
ZWED_NODE_LOG_FILE=/dev/null
47+
fi
4148
fi
4249
fi
43-
50+
4451
ZLUX_ROTATE_LOGS=0
4552
if [ -d "$ZWED_NODE_LOG_DIR" ] && [ -z "$ZWED_NODE_LOG_FILE" ]
4653
then
@@ -58,9 +65,9 @@ else
5865
if [ $ZWED_NODE_LOGS_TO_KEEP -ge 0 ]
5966
then
6067
ZLUX_ROTATE_LOGS=1
61-
fi
68+
fi
6269
fi
63-
70+
6471
#Clean up excess logs, if appropriate.
6572
if [ $ZLUX_ROTATE_LOGS -ne 0 ]
6673
then

bin/validate.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

defaults/serverConfig/defaults.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ zowe:
22
workspaceDirectory: ${{ process.env.HOME + '/.zowe/workspace' }}
33
externalDomains: ${{ function a() { if (process.env.ZWE_zowe_externalDomains) { return process.env.ZWE_zowe_externalDomains.split(','); } else { return [ os.hostname() ] } }; a() }}
44
environments:
5-
ZWED_SSH_PORT: 22
6-
ZWED_TN3270_PORT: 23
5+
ZWED_SSH_PORT: "${{ process.env.ZWED_SSH_PORT ? process.env.ZWED_SSH_PORT : 22 }}"
6+
ZWED_TN3270_PORT: "${{ process.env.ZWED_TN3270_PORT ? process.env.ZWED_TN3270_PORT : 23 }}"
77
ZWED_TN3270_SECURITY: telnet
88
ZWED_SSH_HOST: ${{ zowe.externalDomains[0] }}
99
ZWED_TN3270_HOST: ${{ zowe.externalDomains[0] }}

lib/initUtils.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,35 @@ let registerBundledPlugin = function(pluginId, destination, oldPlugins, filePerm
320320
}
321321
module.exports.registerBundledPlugin = registerBundledPlugin;
322322

323+
function readPortFromUnixConfig(configFile, regex) {
324+
let result = 0;
325+
if (fileExists(configFile)) {
326+
const configContent = fs.readFileSync(configFile, 'utf8');
327+
if (configContent) {
328+
const configLines = configContent.split('\n');
329+
for (let line in configLines) {
330+
const matchLine = configLines[line].match(regex);
331+
if (matchLine) {
332+
const portNumber = parseInt(matchLine[0].replace(/\s+/g, " ").split(' ')[1]);
333+
if (portNumber > 0 && portNumber < 65536) {
334+
printFormattedDebug(`readPortFromUnixConfig: ${configFile} -> "${matchLine[0]}" -> ${portNumber}`);
335+
result = portNumber;
336+
}
337+
}
338+
}
339+
}
340+
}
341+
return result;
342+
}
343+
323344
module.exports.setTerminalDefaults = function(configDestination, instanceItems) {
324345
if (instanceItems.indexOf('org.zowe.terminal.vt.json') != -1) {
346+
if (!process.env['ZWED_SSH_PORT']) {
347+
const sshPort = readPortFromUnixConfig('/etc/ssh/sshd_config', /^port[\s]+[0-9]{1,5}/i);
348+
if (sshPort) {
349+
process.env['ZWED_SSH_PORT'] = sshPort;
350+
}
351+
}
325352
let defaultConfigDir = path.join(configDestination,'org.zowe.terminal.vt','sessions');
326353
mkdirp(defaultConfigDir);
327354
try {
@@ -334,6 +361,12 @@ module.exports.setTerminalDefaults = function(configDestination, instanceItems)
334361
}
335362
}
336363
if (instanceItems.indexOf('org.zowe.terminal.tn3270.json') != -1) {
364+
if (!process.env['ZWED_TN3270_PORT']) {
365+
const telnetPort = readPortFromUnixConfig('/etc/services', /^telnet[\s]+[0-9]{1,5}/i);
366+
if (telnetPort) {
367+
process.env['ZWED_TN3270_PORT'] = telnetPort;
368+
}
369+
}
337370
let security = 'telnet';
338371
if (process.env['ZWED_TN3270_SECURITY']) {
339372
security = process.env['ZWED_TN3270_SECURITY'];

manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ commands:
2828
install: share/zlux-app-server/bin/internal-install.sh
2929
start: bin/start.sh
3030
configure: bin/configure.sh
31-
validate: bin/validate.sh
3231
# we do not specify encoding here because its already tagged ascii
3332
apimlServices:
3433
dynamic:

0 commit comments

Comments
 (0)