diff --git a/README.md b/README.md index fd392b2a5..f3b6c2eff 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,96 @@ # report-exporter -export reports from lexevs queries. +Export reports from the NCI Thesaurus. The Report Exporter utilizes the EVS REST API for querying its data. +## Development Setup +### Report Exporter UI Setup +The UI is developed using [Vue.js](https://vuejs.org/). +Vue.js can be installed with NPM. NPM is available through [Node.js](https://nodejs.org/en/). + +Once Vue.js and NMP are installed, the Report Exporter UI can be build and run the client in dev mode. To do this, go to the **report-exporter/clientui** directory. + +To build the UI, run the following command: + + npm run build + +To run the UI, run the following command: + + npm run serve + + +### Report Exporter Service Setup +## Deployment Setup - Tomcat +The Report Exporter Application has been built and tested on a Tomcat 8 webserver. Our instructions will focus on deploying to a Tomcat server. + +### Report Exporter Build + +At the root of the git project directory, run the Maven command that builds both the client and the server and encapsulates them in on war file. + +**Maven builds for their respective tier** +* mvn clean install -DBuild_Env=build-dev +* mvn clean install -DBuild_Env=build-qa +* mvn clean install -DBuild_Env=build-stage +* mvn clean install -DBuild_Env=build-prod + +Add the war file from the Maven build to Tomcat webapps directory. The war file will be located under **report-exporter/service/target/** + +#### Configure Tomcat Server +You will need to create a file called **Tomcat8/conf/Catalina/localhost/rewrite.config** and add the following contents in it. + + #------------------------------------------------------------------------------- + # site that has example of this. + # https://stackoverflow.com/questions/34619751/tomcat-8-url-rewrite-issues + #------------------------------------------------------------------------------- + #------------------------------------------------------------------------------- + # Any subsequent file that the index.html file needs, needs to pass through. + # This would be the js and css files along with other miscellaneous ones. + #------------------------------------------------------------------------------- + RewriteCond %{REQUEST_URI} .*\.(css|map|js|html|png|jpg|jpeg|gif|txt|ttf|json|woff|ico)$ [OR] + + #---------------------------------------- + # Allow these service calls to go through + #---------------------------------------- + RewriteCond %{REQUEST_URI} ^(/reportexporter/download).*$ [OR] + RewriteCond %{REQUEST_URI} ^(/reportexporter/properties).*$ [OR] + RewriteCond %{REQUEST_URI} ^(/reportexporter/codereadrest).*$ [OR] + RewriteCond %{REQUEST_URI} ^(/reportexporter/roots).*$ [OR] + RewriteCond %{REQUEST_URI} ^(/reportexporter/curated).*$ [OR] + RewriteCond %{REQUEST_URI} ^(/reportexporter/resolve\-).*$ [OR] + RewriteCond %{REQUEST_URI} ^(/reportexporter/survey).*$ [OR] + RewriteCond %{REQUEST_URI} ^(/reportexporter/sortedroles).*$ [OR] + RewriteCond %{REQUEST_URI} ^(/reportexporter/sortedassociations).*$ [OR] + + RewriteRule ^(.*)$ - [L] + RewriteRule ^(.*)$ /reportexporter/index.html + + +Update the **Tomcat8/conf/server.xml** file for Tomcat. Add the following **"RewriteValve"** entry to the Host section: + + + + + + +#### Content Security Policy (CSP) + +The following CSP settings were set to satisfy some app scan security issues. + +On the apache server, add the following section to +/local/content/apache/conf/vhosts-ssl/reportexporter.conf + + + RequestHeader set X-HTTPS 1 + Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' www.googletagmanager.com www.google-analytics.com ajax.googleapis.com; connect-src 'self' www.google-analytics.com; img-src 'self' data:; style-src 'self' 'unsafe-inline'; base-uri 'self'; form-action 'self'" + + +#### Application Properties + +Tier related settings must be adjusted using the application properties files specific to each tier. Since there is a dependency upon the EVS REST API these settings would be specific EVS REST API instances on each tier. So for the production tier the application-prod.properties file would contain URLs for both meta and concept resources. The tomcat server would be started using a setenv.sh file with the prod version of one of the following additions to the CATALINA_OPTS environmental variable configuration: + + -Dspring.profiles.active=dev + -Dspring.profiles.active=qa + -Dspring.profiles.active=stage + -Dspring.profiles.active=prod + + Start the Tomcat server + + Open a browser and go to http://localhost:8080/reportexporter diff --git a/clientui/package-lock.json b/clientui/package-lock.json index 0293f9896..84ad66804 100644 --- a/clientui/package-lock.json +++ b/clientui/package-lock.json @@ -3445,7 +3445,6 @@ "thread-loader": "^2.1.3", "url-loader": "^2.2.0", "vue-loader": "^15.9.2", - "vue-loader-v16": "npm:vue-loader@^16.1.0", "vue-style-loader": "^4.1.2", "webpack": "^4.0.0", "webpack-bundle-analyzer": "^3.8.0", @@ -3607,7 +3606,6 @@ "lru-cache": "^4.1.2", "merge-source-map": "^1.1.0", "postcss-selector-parser": "^6.0.2", - "prettier": "^1.18.2", "source-map": "~0.6.1", "vue-template-es2015-compiler": "^1.9.0" }, @@ -5312,7 +5310,6 @@ "anymatch": "^2.0.0", "async-each": "^1.0.1", "braces": "^2.3.2", - "fsevents": "^1.2.7", "glob-parent": "^3.1.0", "inherits": "^2.0.3", "is-binary-path": "^1.0.0", @@ -7160,11 +7157,14 @@ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" }, "node_modules/eventsource": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", - "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.1.tgz", + "integrity": "sha512-qV5ZC0h7jYIAOhArFJgSfdyz6rALJyb270714o7ZtNnw2WSJ+eexhKtE0O8LYPRsHZHf2osHKZBxGPvm3kPkCA==", "dependencies": { "original": "^1.0.0" + }, + "engines": { + "node": ">=0.12.0" } }, "node_modules/evp_bytestokey": { @@ -11479,7 +11479,6 @@ "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -13571,10 +13570,8 @@ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", "dependencies": { - "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.1" + "neo-async": "^2.5.0" }, "optionalDependencies": { "chokidar": "^3.4.1", @@ -21556,9 +21553,9 @@ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" }, "eventsource": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", - "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.1.tgz", + "integrity": "sha512-qV5ZC0h7jYIAOhArFJgSfdyz6rALJyb270714o7ZtNnw2WSJ+eexhKtE0O8LYPRsHZHf2osHKZBxGPvm3kPkCA==", "requires": { "original": "^1.0.0" }