summaryrefslogtreecommitdiffstats
path: root/certServicePostProcessor/README.md
diff options
context:
space:
mode:
authorJan Malkiewicz <jan.malkiewicz@nokia.com>2020-09-18 09:53:12 +0200
committerJan Malkiewicz <jan.malkiewicz@nokia.com>2020-09-18 10:01:49 +0200
commitf8ce5f7332bd79b584ddd45ed8062cfdb5a938f3 (patch)
tree378475eac7d70cbc4d478af39c82d809a1972b3f /certServicePostProcessor/README.md
parent900b8224a0401e126e9033c61602aceed68c4080 (diff)
[OOM-CMPv2] Rename module folder truststoreMerger -> certServicePostProcessor
Issue-ID: DCAEGEN2-2253 Signed-off-by: Jan Malkiewicz <jan.malkiewicz@nokia.com> Change-Id: I975f37507f7f79c238f1eac15f375fe64761c80c
Diffstat (limited to 'certServicePostProcessor/README.md')
-rw-r--r--certServicePostProcessor/README.md87
1 files changed, 87 insertions, 0 deletions
diff --git a/certServicePostProcessor/README.md b/certServicePostProcessor/README.md
new file mode 100644
index 00000000..5a2c2b47
--- /dev/null
+++ b/certServicePostProcessor/README.md
@@ -0,0 +1,87 @@
+# Truststore merger
+
+### Project building
+```
+mvn clean package
+```
+
+### Install the package into the local repository
+```
+mvn clean install
+```
+
+### Building Docker image and install the package into the local repository
+```
+mvn clean install -P docker
+```
+
+### Nexus container image
+```
+nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-truststore-merger:latest
+```
+
+### Running application as standalone docker container
+
+Exemplary config.env file with necessary envs
+```
+TRUSTSTORES_PATHS=/var/certs/truststore.jks:/var/certs/truststore.pem
+TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass:
+KEYSTORE_SOURCE_PATHS=/var/certs/external/keystore.jks:/var/certs/external/keystore.pass
+KEYSTORE_DESTINATION_PATHS=/var/certs/cert.jks:/var/certs/jks.pass
+```
+TRUSTSTORES_PATHS env indicates paths (separated by ":") where truststores files are located.
+
+TRUSTSTORES_PASSWORDS_PATHS env indicates paths (separated by ":") where files with passwords to truststores are located.
+PEM is not protected by password so its value should be empty
+
+KEYSTORE_SOURCE_PATHS env (optional) indicates paths (separated by ":") where files to copy are located.
+
+KEYSTORE_DESTINATION_PATHS env (optional) indicates paths (separated by ":") to files which should be replaced. Before keystore files override, destination files will be copied with addition of .bak extension.
+
+Execute below command in order to run app as docker container
+```
+docker run \
+ --name oom-truststore-merger \
+ --env-file ./config.env \
+ --mount type=bind,src=<src_path>,dst=/var/certs \
+onap/org.onap.oom.platform.cert-service.oom-truststore-merger:latest
+```
+Before run replace <src_path> with absolute path where you located truststores to merge (eg. /certs/resources/)
+
+Output from merger (when pointed more than one truststore to merge in TRUSTSTORES_PATHS env and provided optional envs) success execution should be:
+1. Created backup file (with .bak ext) of first truststore pointed in TRUSTSTORES_PATHS env
+2. Keystores files listed in KEYSTORE_SOURCE_PATHS env overrides corresponding to them files defined in KEYSTORE_DESTINATION_PATHS env.
+3. Keystores listed in KEYSTORE_SOURCE_PATHS env are in locations taken from KEYSTORE_DESTINATION_PATHS env. Files listed in KEYSTORE_DESTINATION_PATHS env before application run, still exist with appended .bak extension.
+
+Remove docker container:
+```
+docker rm oom-truststore-merger
+```
+
+### Logs locally
+
+path:
+```
+var/log/onap/oom/truststore-merger/truststore-merger.log
+```
+### Logs in Docker container
+```
+docker logs oom-merger
+```
+###Exit codes
+```
+0 Success
+1 Invalid paths in environment variables
+2 Invalid merger configuration
+3 Invalid truststore file-password pair
+4 Cannot read password from file
+5 Cannot create backup file
+6 Cannot initialize keystore instance
+7 Cannot load truststore file
+8 Cannot operate on truststore data
+9 Missing truststore certificates in provided file
+10 Alias conflict detected
+11 Cannot save truststore file
+12 Cannot copy keystore file
+13 Keystore file does not exist
+99 Application exited abnormally