From 66d12f41b530a063dc17a4add8dc3f2f842f04f6 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Tue, 20 Aug 2019 15:06:28 +0200 Subject: Update Readme - Fix Code Blocks --- readme.md | 97 +++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 27 deletions(-) diff --git a/readme.md b/readme.md index ff9c5e3..433f5a6 100644 --- a/readme.md +++ b/readme.md @@ -14,48 +14,91 @@ mvn test ### Run Integration Tests -Integration tests start with the prefix `IT`. Note that some integration tests have additional requirements (e.g. ITMsgClientTest also tests the TLS connection and Client Authentication). Ensure that these requirements are met as well. +Integration tests start with the prefix `IT`. Run them with the following command: +``` +mvn test -P integration-tests +``` + +### Run All Tests Command: ``` -mvn test -P integration-test +mvn test -P all-tests ``` +Note that some integration tests (prefix `ITSSL`) rely on a TLS connection and Client Authentication. The following guide +expalins how to set up TLS and Client Authentication with Apache 2. + #### Quick Guide: Set Up SSL (inc. Client Authentication) in Apache 2. -Some tests in ITMsgClientTest require SSL protection of the service endpoint with SSL Client Authentication. Here's a quick guide how to set up an Apache 2 service on localhost as a SSL terminating reverse proxy to the zusemsg endpoint that runs on http://localhost:8081/ : +Some tests require SSL protection of the service endpoint with SSL Client Authentication. Here's a quick guide how to set up an Apache 2 service on localhost as a SSL terminating reverse proxy to the zusemsg endpoint that runs on . This guide is only needed for running all integration tests. -1. Install Apache 2. -1. Ensure that mod-proxy is installed and enabled. -1. In `default-ssl.conf` add the following lines to proxy requests from `https://localhost/zusemsg` to `http://localhost:8081`: -``` -ProxyRequests off -ProxyPass /zusemsg/ http://localhost:8081/ -ProxyPassReverse /zusemsg/ http://localhost:8081/ - - Order allow,deny - allow from all - -``` -1. Use certificate and key provided in this repository for the TLS connection and add the following directives to `default-ssl.conf`: -``` -SSLCertificateFile /server.localhost.cert.pem -SSLCertificateKeyFile /server.localhost.key.pem -SSLCertificateChainFile /ca-chain.cert.pem -``` -1. Trust the client certificate with the following directive in `default-ssl-conf`: -``` -SSLCACertificateFile /trusted-cas-bundle.pem -``` +1. Install Apache 2. +1. Ensure that mod-proxy is installed and enabled. +1. In `default-ssl.conf` add the following lines to proxy requests from `https://localhost/zusemsg` to `http://localhost:8081`: + + ``` + ProxyRequests off + ProxyPass /zusemsg/ http://localhost:8081/ + ProxyPassReverse /zusemsg/ http://localhost:8081/ + + Order allow,deny + allow from all + + ``` + +1. Use certificate and key provided in this repository for the TLS connection and add the following directives to `default-ssl.conf`: + + ``` + SSLCertificateFile /server.localhost.cert.pem + SSLCertificateKeyFile /server.localhost.key.pem + SSLCertificateChainFile /ca-chain.cert.pem + ``` + +1. Trust the client certificate with the following directive in `default-ssl-conf`: -## Package to .war + ``` + SSLCACertificateFile /trusted-cas-bundle.pem + ``` + + +### Package to .war + +The application can be packaged to a web application archive by running the following command: ``` -mvn clean package +mvn package ``` Find the war file in the `target/` folder. +## Deployment + +After packaging the application to a `war` file, the application can be deployed into a servlet container or as a standalone application. + +### Deploy as Standalone Application + +1. Create a new directory that serves as the application's working directory. + + ``` + mkdir standalone + ``` + +1. Copy the `war` file into the applications working directory. + + ``` + cp target/moa-zs-$MZS_VERSION.war standalone/ + ``` + +1. Copy the directory `test/main/resources/config/` into the applications working directory. + + ``` + cp test/main/resources/config/ standalone/ -r + ``` + + The `config` folder works out of the box for test environments. You may apply changes to files in the `config` folder to fit the needs of a productive environment. + + # Footnotes [1] https://bugs.openjdk.java.net/browse/JDK-8214098 -- cgit v1.2.3