diff --git a/.gitattributes b/.gitattributes index e8f976258..2862755be 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,10 +2,10 @@ # git's .gitattributes and .gitignore files to be encoded as EBCDIC. # Selected binary files will not be translated at all. # The default for text files -* git-encoding=iso8859-1 working-tree-encoding=ibm-1047 +* git-encoding=iso8859-1 zos-working-tree-encoding=ibm-1047 # git's files (which MUST be ASCII) -.gitattributes git-encoding=iso8859-1 working-tree-encoding=iso8859-1 -.gitignore git-encoding=iso8859-1 working-tree-encoding=iso8859-1 +.gitattributes git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1 +.gitignore git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1 # Binary files, selected by file extension. # # Note that "Binary" really just means "Not touched when moved @@ -14,36 +14,40 @@ # # If you don't have these in your tree, removing these from the # .gitattributes file will speed up git's processing a bit. -/build/env.sh git-encoding=iso8859-1 working-tree-encoding=iso8859-1 -sonar-project.properties git-encoding=iso8859-1 working-tree-encoding=iso8859-1 -*.jpg git-encoding=BINARY working-tree-encoding=BINARY -*.crx git-encoding=BINARY working-tree-encoding=BINARY -*.eot git-encoding=BINARY working-tree-encoding=BINARY -*.fdt git-encoding=BINARY working-tree-encoding=BINARY -*.fdx git-encoding=BINARY working-tree-encoding=BINARY -*.gen git-encoding=BINARY working-tree-encoding=BINARY -*.gif git-encoding=BINARY working-tree-encoding=BINARY -*.gz git-encoding=BINARY working-tree-encoding=BINARY -*.ico git-encoding=BINARY working-tree-encoding=BINARY -*.jar git-encoding=BINARY working-tree-encoding=BINARY -*.jpg git-encoding=BINARY working-tree-encoding=BINARY -*.node git-encoding=BINARY working-tree-encoding=BINARY -*.otf git-encoding=BINARY working-tree-encoding=BINARY -*.png git-encoding=BINARY working-tree-encoding=BINARY -*.PNG git-encoding=BINARY working-tree-encoding=BINARY -*.resources git-encoding=BINARY working-tree-encoding=BINARY -*.scss git-encoding=BINARY working-tree-encoding=BINARY -*.segments_1 git-encoding=BINARY working-tree-encoding=BINARY -*.so git-encoding=BINARY working-tree-encoding=BINARY -*.svg git-encoding=BINARY working-tree-encoding=BINARY -*.swp git-encoding=BINARY working-tree-encoding=BINARY -*.tar git-encoding=BINARY working-tree-encoding=BINARY -*.tgz git-encoding=BINARY working-tree-encoding=BINARY -*.tii git-encoding=BINARY working-tree-encoding=BINARY -*.tis git-encoding=BINARY working-tree-encoding=BINARY -*.tree git-encoding=BINARY working-tree-encoding=BINARY -*.ttf git-encoding=BINARY working-tree-encoding=BINARY -*.woff git-encoding=BINARY working-tree-encoding=BINARY -*.woff2 git-encoding=BINARY working-tree-encoding=BINARY -*.zip git-encoding=BINARY working-tree-encoding=BINARY - +# +# While it would make sense to have BINARY be BINARY on all platforms, +# Other platforms don't use the BINARY term, But do recognize "binary" macro +*.jpg git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.crx git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.eot git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.fdt git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.fdx git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.gen git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.gif git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.gz git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.ico git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.jar git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.jpg git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.node git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.otf git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.png git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.PNG git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.resources git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.scss git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.segments_1 git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.so git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.svg git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.swp git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.tar git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.tgz git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.tii git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.tis git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.tree git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.ttf git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.woff git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.woff2 git-encoding=BINARY zos-working-tree-encoding=BINARY binary +*.zip git-encoding=BINARY zos-working-tree-encoding=BINARY binary +# Always use LF for npm package files because npm cli likes to change line endings. +package*.json text eol=lf +# sonar scanning +sonar-project.properties git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1 diff --git a/README.md b/README.md index 947f482a6..a32841fd7 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,16 @@ this distribution, and is available at https://www.eclipse.org/legal/epl-v20.htm SPDX-License-Identifier: EPL-2.0 Copyright Contributors to the Zowe Project. -# zlux-example-server -This is an example of a server built upon the zLUX framework. Within, you will find a collection of build, deploy, and run scripts as well as configuration files that will help you to configure a simple zLUX server with a few Apps included. +# zlux-app-server +This is the default setup of the Zowe App Server, built upon the zLUX framework. Within, you will find a collection of build, deploy, and run scripts as well as configuration files that will help you to configure a simple zLUX server with a few Apps included. ## Server layout -At the core of the zLUX App infrastructure backend is an extensible server, written for nodeJS and utilizing expressJS for routing. It handles the backend components of Apps, and also can server as a proxy for requests from Apps to additional servers as needed. One such proxy destination is the ZSS - the zLUX backend component for **Z Secure Services**. It is recommended that everyone who is going to set up a zLUX install contact Rocket, which can provide the ZSS binary to use in the install. +At the core of the zLUX App infrastructure backend is an extensible server, written for nodeJS and utilizing expressJS for routing. It handles the backend components of Apps, and also can server as a proxy for requests from Apps to additional servers as needed. One such proxy destination is the ZSS - the zLUX backend component for **Z Secure Services**, a so called agent for the App server. It is recommended that everyone who is going to set up a zLUX install contact Rocket, which can provide the ZSS binary to use in the install. ### ZSS & zLUX Server overlap -The zLUX Proxy Server and ZSS utilize the same deployment & App/Plugin structure, and share some configuration parameters as well. It is possible to run ZSS and zLUX Proxy Server from the same system, in which case you would be running under z/OS USS. This configuration requires that IBM's version of nodeJS is installed prior. +The zLUX App Server and ZSS utilize the same deployment & App/Plugin structure, and share some configuration parameters as well. It is possible to run ZSS and zLUX App Server from the same system, in which case you would be running under z/OS USS. This configuration requires that IBM's version of nodeJS is installed prior. -Another way to set up zLUX is to have the zLUX Proxy Server running under LUW, while keeping ZSS under USS. This is the configuration scenario presented below. In this scenario, you'll need to clone these github repositories to two different systems, and they'll need to have compatible configurations. For first-timers, it is fine to have identical configuration files and /plugins folders in order to get going. +Another way to set up zLUX is to have the zLUX App Server running under LUW, while keeping ZSS under USS. This is the configuration scenario presented below. In this scenario, you'll need to clone these github repositories to two different systems, and they'll need to have compatible configurations. For first-timers, it is fine to have identical configuration files and /plugins folders in order to get going. ## First-time Installation & Use Getting started with this server requires just a few steps: @@ -28,15 +28,15 @@ Getting started with this server requires just a few steps: 6. [Run the server](#6-run-the-server) 7. [Connect in a browser!](#7-connect-in-a-browser) -So, with that in mind, follow each step and you'll be on your way to your first zLUX Proxy Server instance! +So, with that in mind, follow each step and you'll be on your way to your first zLUX App Server instance! ### 0. (Optional) Install git for z/OS -Because all of our code is on github, yet ZSS must run on z/OS and the zLUX Proxy Server may optionally run on z/OS as well, having git on z/OS is the most convenient way to work with the source code. The alternative would be to utilize FTP or another method to transfer contents to z/OS. +Because all of our code is on github, yet ZSS must run on z/OS and the zLUX App Server may optionally run on z/OS as well, having git on z/OS is the most convenient way to work with the source code. The alternative would be to utilize FTP or another method to transfer contents to z/OS. If you'd like to go this route, you can find git for z/OS free of charge here: http://www.rocketsoftware.com/product-categories/mainframe/git-for-zos ### 1. Acquire the source code To get started, first clone or download the github capstone repository, https://github.com/zowe/zlux -As we'll be configuring ZSS on z/OS's USS, and the zLUX Proxy Server on a LUW host, you'll need to put the contents on both systems. +As we'll be configuring ZSS on z/OS's USS, and the zLUX App Server on a LUW host, you'll need to put the contents on both systems. If using git, the following commands should be used: ``` git clone --recursive git@github.com:zowe/zlux.git @@ -46,10 +46,10 @@ cd zlux-build ``` At this point, you'll have the latest code from each repository on your system. -Continue from within zlux-example-server. +Continue from within zlux-app-server. ### 2. Acquire external components -Apps and external servers can require contents not found in the Zowe github repositories. In the case of the zlux-example-server, there is a component which cannot be found in the repositories: a ZSS binary. +Apps and external servers can require contents not found in the Zowe github repositories. In the case of the zlux-app-server, there is a component which cannot be found in the repositories: a ZSS binary. If you contact the Zowe project, this will be provided. Afterwards, you should receive *zssServer*. @@ -64,7 +64,7 @@ mv zssServer externals/Rocket ``` ### 3. Set the server configuration -Read the [Configuration](https://github.com/zowe/zlux/wiki/Configuration-for-zLUX-Proxy-Server-&-ZSS) wiki page for a detailed explanation of the primary items that you'll want to configure for your first server. +Read the [Configuration](https://github.com/zowe/zlux/wiki/Configuration-for-zLUX-App-Server-&-ZSS) wiki page for a detailed explanation of the primary items that you'll want to configure for your first server. In short, ensure that within **config/zluxserver.json**, **node.http.port** OR **node.https.port + other HTTPS parameters** are set to your liking on the LUW host, and that **zssPort** is set on the z/OS host. @@ -77,9 +77,9 @@ Edit *../vt-ng2/_defaultVT.json* to set *host* and *port* to a valid ssh host an zLUX Apps can contain server and/or web components. The web components must be built, as webpack is involved in optimized packaging, and server components are also likely to need building if they require external dependencies from NPM, use native code, or are written in typescript. -This example server only needs transpilation and packaging of web components, and therefore we do not need any special build steps for the host running ZSS. +This server only needs transpilation and packaging of web components, and therefore we do not need any special build steps for the host running ZSS. -Instead, on the host running the zLUX Proxy Server, run the script that will automatically build all included Apps. +Instead, on the host running the zLUX App Server, run the script that will automatically build all included Apps. Simply, ``` //Windows @@ -91,21 +91,21 @@ build.sh This will take some time to complete. ### 5. Deploy server configuration files -If you are running the zLUX Proxy Server seperate from ZSS, you must ensure the ZSS installation has its configuration deployed. You can accomplish this via: +If you are running the zLUX App Server seperate from ZSS, you must ensure the ZSS installation has its configuration deployed. You can accomplish this via: ``` ant deploy ``` -On the other hand, if you are running ZSS and the zLUX Proxy Server on the same host, *build.sh* and *build.bat* execute *deploy* and therefore this task was accomplished in step #4. +On the other hand, if you are running ZSS and the zLUX App Server on the same host, *build.sh* and *build.bat* execute *deploy* and therefore this task was accomplished in step #4. -However, if you need to change the server configuration files or want to add more Apps to be included at startup, you'll need to update the deploy content to reflect this. Simply running deploy.bat or deploy.sh will accomplish this, but files such as zluxserver.json are only read at startup, so a reload of the zLUX Proxy Server & ZSS would be required. +However, if you need to change the server configuration files or want to add more Apps to be included at startup, you'll need to update the deploy content to reflect this. Simply running deploy.bat or deploy.sh will accomplish this, but files such as zluxserver.json are only read at startup, so a reload of the zLUX App Server & ZSS would be required. ### 6. Run the server At this point, all server files have been configured and Apps built, so ZSS and the App server are ready to run. First, from the z/OS system, start ZSS. ``` -cd ../zlux-example-server/bin +cd ../zlux-app-server/bin ./zssServer.sh ``` This should start the zssServer. If the server did not start, two common sources of error are: @@ -113,9 +113,9 @@ This should start the zssServer. If the server did not start, two common sources 1. The *zssPort* chosen is already occupied. To fix, edit *config/zluxserver.json* to choose a new one, and re-run *build/deploy.sh* to have that change take effect. 2. The zssServer binary does not have the APF bit set. Since this server is meant for secure services, it is required. To fix, execute `extattr +a zssServer`. Note you may need to alter the execute permissions of zssServer.sh in the event that the previous command is not satisfactory (eg chmod +x zssServer.sh) -Second, from the system with the zLUX Proxy Server, start it with a few parameters to hook it to ZSS. +Second, from the system with the zLUX App Server, start it with a few parameters to hook it to ZSS. ``` -cd ../zlux-example-server/bin +cd ../zlux-app-server/bin // Windows: nodeServer.bat @@ -126,41 +126,43 @@ nodeServer.sh Valid parameters for nodeServer are as follows: - *-h*: Specifies the hostname where ZSS can be found. Use as *-h \* - *-P*: Specifies the port where ZSS can be found. Use as *-P \*. This overrides *zssPort* from the configuration file. -- *-p*: Specifies the HTTP port to be used by the zLUX Proxy Server. Use as *-p *. This overrides *node.http.port* from the configuration file. -- *-s*: Specifies the HTTPS port to be used by the zLUX Proxy Server. Use as *-s *. This overrides *node.https.port* from the configuration file. +- *-p*: Specifies the HTTP port to be used by the zLUX App Server. Use as *-p *. This overrides *node.http.port* from the configuration file. +- *-s*: Specifies the HTTPS port to be used by the zLUX App Server. Use as *-s *. This overrides *node.https.port* from the configuration file. - *--noChild*: If specified, tells the server to ignore and skip spawning of child processes defined as *node.childProcesses* in the configuration file. -In the example where we're running ZSS on a host named mainframe.zowe.com, running on zssPort = 19997, the Proxy server running on Windows could be started with the following: +In the example where we're running ZSS on a host named mainframe.zowe.com, running on zssPort = 19997, the App server running on Windows could be started with the following: `nodeServer.bat -h mainframe.zowe.com -P 19997 -p 19998` -After which we'd be able to connect to the Proxy server at port 19998. +After which we'd be able to connect to the App server at port 19998. -**NOTE: the parameter parsing is provided by [argumentParser.js](https://github.com/zowe/zlux-proxy-server/blob/master/js/argumentParser.js), which allows for a few variations of input, depending on preference. For example, the following are all valid ways to specify the ZSS host** +**NOTE: the parameter parsing is provided by [argumentParser.js](https://github.com/zowe/zlux-server-framework/blob/master/js/argumentParser.js), which allows for a few variations of input, depending on preference. For example, the following are all valid ways to specify the ZSS host** - **-h myhost.com** - **-h=myhost.com** - **--hostServer myhost.com** - **--hostServer=myhost.com** -When the zLUX Proxy Server has started, one of the last messages you will see as bootstrapping completes is that the server is listening on the HTTP/s port. At this time, you should be able to use the server. +When the zLUX App Server has started, one of the last messages you will see as bootstrapping completes is that the server is listening on the HTTP/s port. At this time, you should be able to use the server. ### 7. Connect in a browser -Now that ZSS & the zLUX Proxy Server are both started, you can access this instance by pointing your web browser to the zLUX Proxy Server. -In this example, the address you will want to go to first is the location of the window management App - Mainframe Virtual Desktop (MVD). +Now that ZSS & the zLUX App Server are both started, you can access this instance by pointing your web browser to the zLUX App Server. +In this example, the address you will want to go to first is the location of the window management App - Zowe Desktop. The URL for this is: -http(s)://\:\/ZLUX/plugins/org.zowe.zlux.bootstrap/web/index.html +http(s)://\:\/ZLUX/plugins/org.zowe.zlux.bootstrap/web/index.html -Once here, you should be greeted with a Login screen and a few example Apps in the taskbar at the bottom of the screen. You can login with your mainframe credentials, and try out a few Apps to see how they interact with the framework: -- tn3270-ng2: This App communicates with the zLUX Proxy Server to enable a TN3270 connection in the browser +Once here, you should be greeted with a Login screen and a few Apps in the taskbar at the bottom of the screen. You can login with your mainframe credentials, and try out a few Apps to see how they interact with the framework: +- tn3270-ng2: This App communicates with the zLUX App Server to enable a TN3270 connection in the browser - subsystems: This App shows various z/OS subsystems installed on the host the ZSS runs on. This is accomplished via discovery of these services by the App's portion running in the ZSS context. -- sample-app: A simple app showing how a zLUX App frontend (Angular) component can communicate with an App backend (REST) component. +- sample-angular-app: A simple app showing how a zLUX App frontend (here, Angular) component can communicate with an App backend (REST) component. +- sample-react-app: Similar to the Angular App, but using React instead to show how you have the flexibility to use a framework of your choice. +- sample-iframe-app: Similar in functionality to the Angular & React Apps, but presented via inclusion of an iframe, to show that even pre-existing pages can be included #### Deploy example ``` -// All paths relative to zlux-example-server/js or zlux-example-server/bin +// All paths relative to zlux-app-server/js or zlux-app-server/bin // In real installations, these values will be configured during the install. "rootDir":"../deploy", "productDir":"../deploy/product", @@ -177,11 +179,11 @@ In the configuration file, a directory can be specified which contains JSON file To include Apps, be sure to define the location of the Plugins directory in the configuration file, via the top-level attribute *pluginsDir* -**NOTE: In this repository, the directory for these JSON files is /plugins. Yet, in order to seperate configuration files from runtime files, the zlux-example-server repository copies the contents of this folder into /deploy/instance/ZLUX/plugins. So, the example configuration file uses the latter directory.** +**NOTE: In this repository, the directory for these JSON files is /plugins. Yet, in order to seperate configuration files from runtime files, the zlux-app-server repository copies the contents of this folder into /deploy/instance/ZLUX/plugins. So, the example configuration file uses the latter directory.** #### Plugins directory example ``` -// All paths relative to zlux-example-server/js or zlux-example-server/bin +// All paths relative to zlux-app-server/js or zlux-app-server/bin // In real installations, these values will be configured during the install. //... "pluginsDir":"../deploy/instance/ZLUX/plugins", diff --git a/config/server-nopass.pfx b/config/server-nopass.pfx deleted file mode 100644 index f644a1077..000000000 Binary files a/config/server-nopass.pfx and /dev/null differ diff --git a/config/server.cert b/config/server.cert deleted file mode 100644 index 547710a65..000000000 --- a/config/server.cert +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDxjCCAq6gAwIBAgIJAKgDZj45OP2lMA0GCSqGSIb3DQEBCwUAMHgxCzAJBgNV -BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMQ0wCwYDVQQKDARab3dlMQ0wCwYD -VQQDDARab3dlMTYwNAYJKoZIhvcNAQkBFid6b3dlLXpsY0BsaXN0cy5vcGVubWFp -bmZyYW1lcHJvamVjdC5vcmcwHhcNMTgwOTA1MjAxNzI5WhcNMjAwOTA0MjAxNzI5 -WjB4MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTENMAsGA1UECgwE -Wm93ZTENMAsGA1UEAwwEWm93ZTE2MDQGCSqGSIb3DQEJARYnem93ZS16bGNAbGlz -dHMub3Blbm1haW5mcmFtZXByb2plY3Qub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA7Ss4kzOocz8LVqFvRhfFvGGhrvRw3eeC6DNVfAuf0YR9y7uU -RFqdKeMSfgjj6dBrOO8b4B1cIEtDSNFwAGwhemTFSMusF4vefR1rGqgT37I8WpJb -Zd7CdiLJyTrGGxSjFEusVRNW8jade2MDAcYeCM/ETUCozFhOKRhT8zeKu6TvA9oH -t0JRqfwJRkvQOxWtExYveD2RUvKTzoXLSQh434d5+uLw3J/w/Gv/67om9VYB4TDM -XCkNxPColpIBwDGAt+XHZ1DJeYRHD0AY96mrne3EgVmd0xBzHTV2qyk7uxK9rCMx -AtNKGhe39ztWIRunwa7rqo7BvHq5NZ8WVwAp8wIDAQABo1MwUTAdBgNVHQ4EFgQU -Ernsn836VOhZ9jNDXkylfNKaH6cwHwYDVR0jBBgwFoAUErnsn836VOhZ9jNDXkyl -fNKaH6cwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAew8DpR9+ -S2dow9GWIA2hBnnp4IzB6bp8/toYIC0dAUPovSOxHpJFk75lbbi/p/6qarr7vYxH -6Kk3jI6apmCZAAolJEXZgAamCDazSmnvnKYDNCoyE2ntLlxG9r9n9MD5rqzgRVk+ -hlCEi7r8cOkMuLRlL23aS5QypLqwWq4urb1Q6tfmngLixoabGbBN3BcV5RMK2GtX -/Gd7QgVntujkqrEicfm1CGEH2D0GjhiBB3uaRhtY9vOvPJPD6Dtwxnnut6PV6sMS -4zDGwnoS1zTzy8fP7g/QiKlIQ+S2nkJ/YvC7tsThnSQGXxMR6SINayVsuCRQHwk8 -Eo+0EEIu0KTjAg== ------END CERTIFICATE----- diff --git a/config/server.key b/config/server.key deleted file mode 100644 index 2aa69e68d..000000000 --- a/config/server.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEA7Ss4kzOocz8LVqFvRhfFvGGhrvRw3eeC6DNVfAuf0YR9y7uU -RFqdKeMSfgjj6dBrOO8b4B1cIEtDSNFwAGwhemTFSMusF4vefR1rGqgT37I8WpJb -Zd7CdiLJyTrGGxSjFEusVRNW8jade2MDAcYeCM/ETUCozFhOKRhT8zeKu6TvA9oH -t0JRqfwJRkvQOxWtExYveD2RUvKTzoXLSQh434d5+uLw3J/w/Gv/67om9VYB4TDM -XCkNxPColpIBwDGAt+XHZ1DJeYRHD0AY96mrne3EgVmd0xBzHTV2qyk7uxK9rCMx -AtNKGhe39ztWIRunwa7rqo7BvHq5NZ8WVwAp8wIDAQABAoIBAFSC1zkU6kyOxYKM -KfOHGw3imFOYhPN9wJbvW+HE3qExHgZQBChLRb+cS4Wfs18oxlxWT8+Phrl3ODWl -c8yiu1c6u1YSRXNqgtCAgB7Sj6phf8IibvEg7JheExtilx8lPmtH/9Oc/Zl3vqwt -/u9N4nvvVRrWFJAkU02vfpKnUwdDscjI34cEo8cQQaN0lDqJ3hLXDNhNvFrpUf8/ -qmDjZmanqwadJEIeg1ewn10QgfkYiggi/I/ESyJOxPElBnhyxBxSFSDB+58jIVZL -P221kb2ecmzI0ILpKkh17n5gWcWwbMqpYwBI6MGMHWUs66992IqdqbgXXOZdixTM -+Y8vh6kCgYEA+wV94j6W5V1vASIEQAb1e5ruXeAzGc6po2RyqORBKLLt0l/MsxM3 -wkq7d1o+uTfViGFL4Vd+4OL9X6eyAM6PEU09T2CksU3MiJMp2NmPG3SzWL19x1aC -LUGR2ibg0fj7ElWUA6Rg6cw+O9Bn3FmB8vAhGNjeIHdmjF6a5dQwGH8CgYEA8d9l -QKXXzNt0IQShGx183zC8S0gCsssMpei5gCh9LDe3Edv1k0+WL4ZmeOrvXUeFasq4 -zztVs6f47XzKuCZWj04ANI4371XWUsma6C3sFuf9e06SWBWlceAQwy1PgQfMgdsz -J0FxGqgD1SDp+4uqD8F9/Y1qovBm6bFWtXsHVI0CgYEA0n1xaMUJLX4itfV7UOFE -+ggZt5hn4U0djMiPKTZ1uRYJPK5ebQ9BY2fdOSDwlcnPAdRsl6IR36wXwR1Ss0CC -UYTOU4B7ub2+NAwLPC56xRAfz9rd3Mia0i44ipCtVwUMK/yc6Ezvgz1kNi302Z4o -zLk1V6uK3/ifgjdWdkBusCsCgYEA13sgZ5HYSceRFAFdzhxdLTHr7l1/Ge5PnFdT -O9vWeFhCnoSJqe2TbU+dZ0hWa5HWSKfGMck4ts+Es38j0x9EqnLhN/Ej3/Nm92Zo -vUR8OoP/jaUYN6VBOcxW4qsxU1CxX1b7oZNpwkfA8lVaXyG0JklJh2Q/hl4KMVQu -XYv3odkCgYEAobhsYqutHAkpJGNo0lVTWn+EuL2SWJ5Kl3B/PHSlTx0RykzHPU5D -WFagmrCXfVVJ/buwcHk4MMx4cFXgHeonIqRlMhH4wNaJNl/l8TH9SA/OGAcQdd53 -+en+Xl3ZYaCiVIZvKHyFaUkHNdlPYq10IJ1fTfcVny86EmKXkzoSUMQ= ------END RSA PRIVATE KEY----- diff --git a/config/server.pfx b/config/server.pfx deleted file mode 100644 index 8c340435c..000000000 Binary files a/config/server.pfx and /dev/null differ diff --git a/config/zluxserver.json b/config/zluxserver.json index ef168d5ed..543d34239 100644 --- a/config/zluxserver.json +++ b/config/zluxserver.json @@ -8,10 +8,6 @@ "certificates": ["../deploy/product/ZLUX/serverConfig/zlux.keystore.cer"], "certificateAuthorities": ["../deploy/product/ZLUX/serverConfig/apiml-localca.cer"] }, - "http": { - "ipAddresses": ["0.0.0.0"], - "port": 8543 - }, "mediationLayer": { "server": { "hostname": "localhost", diff --git a/doc/swagger/fileapi.yaml b/doc/swagger/fileapi.yaml index 4ac5383e0..569d6f992 100644 --- a/doc/swagger/fileapi.yaml +++ b/doc/swagger/fileapi.yaml @@ -344,6 +344,7 @@ paths: type: string put: summary: writes contents to file or creates non-empty file + description: When writing to a Unix File, the process must be done in chunks of 3MB or less. Please note that your first request will fail because you haven't been assigned a sessionID. If you don't have a sessionID in your request, then the server will assign you one and send it as a response. Please attach this sessionID to every subsequent request as a query parameter. This sessionID is linked to a particular file, so you must use it for the duration of the upload. If you lose it, then the file will be inaccessible via this API until your session timesout in five minutes. When you have specified lastChunk as true, then that signals the end of the upload session; thus, you have sent all the contents of the file. tags: - Unix File parameters: @@ -364,6 +365,11 @@ paths: schema: type: string example: aW50IG1haW4oKSB7CiAgcmV0dXJuIDA7Cn0= + - name: sessionID + in: query + description: the id for current upload session + type: string + required: true - name: sourceEncoding in: query description: the source encoding of the file (UTF-8 or ISO-8859-1 or IBM-1047) @@ -374,34 +380,95 @@ paths: description: the target encoding of the file (UTF-8 or ISO-8859-1 or IBM-1047) type: string required: true + - name: lastChunk + in: query + description: whether or not this is the last chunk of the file + type: boolean + required: true - name: forceOverwrite in: query description: whether or not to overwrite a currently existing file type: boolean + consumes: - text/plain responses: '200': - description: successfully wrote a file + description: OK schema: type: object properties: msg: type: string - '404': - description: file could not be opened or does not exist + sessionID: + type: number + examples: + SessionID: + {msg: Please attach the sessionID to subsequent requests, sessionID: int} + File Already Exists: + {msg: File already exists. Please choose a different file name or attach the forceOverwrite query parameter to your next request.} + Wrote Chunk: + {msg: Successfully wrote chunk to file.} + Wrote File: + {msg: Successfully wrote file.} + + '400': + description: Bad Request schema: type: object properties: - error: + msg: + type: string + examples: + Encoding Missing: + {error: Source encoding or target encoding are missing.} + Invalid Encoding: + {error: Unsupported encodings requested. Please review the swagger documentation.} + Invalid Session ID: + {error: Session identifier is invalid.} + Last Chunk Missing: + {error: Last chunk is missing.} + + '403': + description: Forbidden + schema: + type: object + properties: + error: type: string + examples: + Resource Busy (Duplicate): + {error: Duplicate in table. Requested resource is busy. Please try again later.} + Resource Busy (Could not open file): + {error: Could not open file. Requested resource is busy. Please try again later.} + '500': - description: failed to write a file + description: Internal Server Error schema: type: object properties: error: type: string + examples: + Failure To Assign Session ID: + {error: Could not assign session id. Please try again later.} + Failed To Write Chunk: + {error: Failed to write chunk to file. Aborting upload.} + Failed To Open File: + {error: Could not open file.} + Failed To Close File: + {error: Could not close file.} + Failed to Create File: + {error: Could not create file.} + Failed to Get Metadata: + {error: Could not get metadata for file.} + Failed to Get iNode: + {error: Could not get iNode of file.} + Failed to Get deviceID: + {error: Could not get deviceID of file.} + Failed to Tag: + {error: Could not tag file.} + delete: summary: deletes a file tags: @@ -830,4 +897,4 @@ definitions: type: object properties: name: -type: string + type: string \ No newline at end of file diff --git a/js/zluxArgs.js b/js/zluxArgs.js index 8c80448da..005432da9 100644 --- a/js/zluxArgs.js +++ b/js/zluxArgs.js @@ -71,13 +71,21 @@ const DEFAULT_CONFIG = { "pluginsDir":"../deploy/instance/"+PRODUCT_CODE+"/plugins", "node": { - "http": { + "https": { "ipAddresses": ["0.0.0.0"], - "port": 8543 + "port": 8544, + //pfx (string), keys, certificates, certificateAuthorities, and certificateRevocationLists are all valid here. + "keys": ["../deploy/product/ZLUX/serverConfig/zlux.keystore.key"], + "certificates": ["../deploy/product/ZLUX/serverConfig/zlux.keystore.cer"], + "certificateAuthorities": ["../deploy/product/ZLUX/serverConfig/apiml-localca.cer"] }, - "eureka": { - "hostname": "localhost", - "port": 10011 + "mediationLayer": { + "server": { + "hostname": "localhost", + "port": 10011, + "isHttps": false + }, + "enabled": false } }, "dataserviceAuthentication": { @@ -158,9 +166,10 @@ if (userInput.hostServer) { zssHost = userInput.hostServer; } if (userInput.port) { + if (!configJSON.node.http) { configJSON.node.http = {}; } configJSON.node.http.port = userInput.port; } -if (userInput.securePort && configJSON.https) { +if (userInput.securePort && configJSON.node.https) { configJSON.node.https.port = userInput.securePort; } if (userInput.noChild) {