From 3813c856a0450d61f4f2f36f495ecab72699f846 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Tue, 10 Mar 2026 09:25:47 -0400 Subject: [PATCH 1/3] Allow static registration instead of eureka if desired Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 1 + app-server.apiml_static_reg.yaml.template | 28 +++++++++++++++++++++++ bin/configure.sh | 14 ++++++++++++ defaults/serverConfig/defaults.yaml | 1 + schemas/app-server-config.json | 5 ++++ 5 files changed, 49 insertions(+) create mode 100644 app-server.apiml_static_reg.yaml.template diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e09c9..fa30585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to the Zlux App Server package will be documented in this fi ## v3.5.0 - Bugfix: App-server was not respecting property "components.app-server.zowe.network.server.tls.attls". Instead, property "zowe.network.server.tls.attls" was taking priority. [(#357)](https://github.com/zowe/zlux-app-server/pull/357) - Bugfix: SSH and TELNET port detection may fail due to a lack of necessary permissions. [(#356)](https://github.com/zowe/zlux-app-server/pull/356) +- Enhancement: app-server can do static registration to APIML instead of eureka registration if desired. To opt-in to this behavior, set YAML property "components.app-server.node.mediationLayer.static: true" [(#???)]() ## v3.4.0 - Enhancement: Built-in apps such as 'zlux-editor', 'tn3270-ng2', 'vt-ng2' can now be enabled or disabled using the Zowe YAML with the same syntax as seen in other apps such as 'explorer-jes'. [(#346)](https://github.com/zowe/zlux-app-server/pull/346) diff --git a/app-server.apiml_static_reg.yaml.template b/app-server.apiml_static_reg.yaml.template new file mode 100644 index 0000000..b30a6e7 --- /dev/null +++ b/app-server.apiml_static_reg.yaml.template @@ -0,0 +1,28 @@ +services: + - serviceId: zlux + title: App Server + description: 'An HTTPS and Websocket server built on NodeJS and ExpressJS. It serves static content via "Plugins", and is extensible by REST and Websocket "Dataservices" optionally present within Plugins. It hosts the Zowe Desktop.' + catalogUiTileId: zlux + instanceBaseUrls: + - https://${ZWE_haInstance_hostname}:${ZWE_components_app_server_port}/ + homePageRelativeUrl: / + routedServices: + - gatewayUrl: api/v1 + serviceRelativeUrl: / + - gatewayUrl: ui/v1 + serviceRelativeUrl: / + - gatewayUrl: ws/v1 + serviceRelativeUrl: / + apiInfo: + - apiId: org.zowe.zlux + gatewayUrl: api/v1 + swaggerUrl: https://${ZWE_haInstance_hostname}:${ZWE_components_app_server_port}/api-docs/server + version: ${APP_SERVER_VERSION} + defaultApi: true + authentication: + scheme: zoweJwt + +catalogUiTiles: + zlux: + title: App Server + description: "Zowe's App Server is the component of Zowe which serves the Zowe Desktop. It is an extensible webserver for HTTPS and Websocket APIs written using ExpressJS. Extensions are delivered as 'App Framework Plugins', and several are included by default." diff --git a/bin/configure.sh b/bin/configure.sh index 369ad20..9e39f15 100755 --- a/bin/configure.sh +++ b/bin/configure.sh @@ -31,6 +31,20 @@ elif [ "$ZWE_components_apiml_enabled" = "true" ]; then fi if [ "$apiml_enabled" = "true" ]; then + app_server_static="${ZWE_components_app_server_node_mediationLayer_static:-false}" + app_server_registration_yaml=${ZWE_STATIC_DEFINITIONS_DIR}/app-server.apiml_static_reg_yaml_template.${ZWE_CLI_PARAMETER_HA_INSTANCE}.yml + if [ "$app_server_static" = "true" ] && [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ]; then + app_server_def_template="app-server.apiml_static_reg.yaml.template" + app_server_def="../${app_server_def_template}" + export APP_SERVER_VERSION=$(grep '^version:' "${COMPONENT_HOME}/manifest.yaml" | head -1 | sed 's/^version: *//; s/"//g') + app_server_parsed_def=$( ( echo "cat <&1) + echo "${app_server_parsed_def}" > "${app_server_registration_yaml}" + chmod 770 "${app_server_registration_yaml}" + unset APP_SERVER_VERSION + elif [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ] && [ -f "${app_server_registration_yaml}" ]; then + rm -f "${app_server_registration_yaml}" + fi + if [ "$ZWE_components_zss_enabled" = "true" ]; then if [ "${ZWE_RUN_ON_ZOS}" != "true" ]; then zss_def_template="zss.apiml_static_reg.yaml.template" diff --git a/defaults/serverConfig/defaults.yaml b/defaults/serverConfig/defaults.yaml index 828dbc0..bf63a3f 100644 --- a/defaults/serverConfig/defaults.yaml +++ b/defaults/serverConfig/defaults.yaml @@ -155,6 +155,7 @@ components: cachingService: enabled: ${{ components['app-server'].node.mediationLayer.enabled && (components.apiml?.enabled || components['caching-service']?.enabled) }} enabled: ${{ components.apiml?.enabled || (components.gateway?.enabled && components.discovery?.enabled) }} + static: false headers: X-frame-Options: override: true diff --git a/schemas/app-server-config.json b/schemas/app-server-config.json index 3235bf7..1ec72e3 100755 --- a/schemas/app-server-config.json +++ b/schemas/app-server-config.json @@ -192,6 +192,11 @@ "type": "boolean", "description": "Enable API Mediation Layer onboarding and SSO capability", "default": false + }, + "static": { + "type": "boolean", + "description": "Controls whether the app-server static APIML registration definition is written to the Zowe workspace api-mediation/api-defs directory during configure. When true, the app-server is registered with the API Mediation Layer via a static definition file.", + "default": false } } }, From 56c2d9ab02cffd53dbbb7b599bae5487938c7b60 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Tue, 10 Mar 2026 14:59:58 -0400 Subject: [PATCH 2/3] Update configure.sh for right encoding Signed-off-by: 1000TurquoisePogs --- bin/configure.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/configure.sh b/bin/configure.sh index 9e39f15..9eb4231 100755 --- a/bin/configure.sh +++ b/bin/configure.sh @@ -38,7 +38,9 @@ if [ "$apiml_enabled" = "true" ]; then app_server_def="../${app_server_def_template}" export APP_SERVER_VERSION=$(grep '^version:' "${COMPONENT_HOME}/manifest.yaml" | head -1 | sed 's/^version: *//; s/"//g') app_server_parsed_def=$( ( echo "cat <&1) - echo "${app_server_parsed_def}" > "${app_server_registration_yaml}" + echo "${app_server_parsed_def}" > "${app_server_registration_yaml}.1047" + iconv -f 1047 -t 819 "${app_server_registration_yaml}.1047" "${app_server_registration_yaml}" + rm "${app_server_registration_yaml}.1047" chmod 770 "${app_server_registration_yaml}" unset APP_SERVER_VERSION elif [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ] && [ -f "${app_server_registration_yaml}" ]; then From 86d5f206f83689ea29df5c0778b91251a9a57a91 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Tue, 10 Mar 2026 15:10:05 -0400 Subject: [PATCH 3/3] Update configure.sh for right encoding Signed-off-by: 1000TurquoisePogs --- bin/configure.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/configure.sh b/bin/configure.sh index 9eb4231..b163aff 100755 --- a/bin/configure.sh +++ b/bin/configure.sh @@ -39,8 +39,9 @@ if [ "$apiml_enabled" = "true" ]; then export APP_SERVER_VERSION=$(grep '^version:' "${COMPONENT_HOME}/manifest.yaml" | head -1 | sed 's/^version: *//; s/"//g') app_server_parsed_def=$( ( echo "cat <&1) echo "${app_server_parsed_def}" > "${app_server_registration_yaml}.1047" - iconv -f 1047 -t 819 "${app_server_registration_yaml}.1047" "${app_server_registration_yaml}" + iconv -f 1047 -t 819 "${app_server_registration_yaml}.1047" > "${app_server_registration_yaml}" rm "${app_server_registration_yaml}.1047" + chtag -r "${app_server_registration_yaml}" chmod 770 "${app_server_registration_yaml}" unset APP_SERVER_VERSION elif [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ] && [ -f "${app_server_registration_yaml}" ]; then