[OOM-CPMv2] Allow optional input parameters
[oom/platform/cert-service.git] / trustStoreMerger / README.md
1 # Truststore merger
2
3 ### Project building
4 ```
5 mvn clean package
6 ```
7
8 ### Install the package into the local repository
9 ```
10 mvn clean install
11 ```
12
13 ### Building Docker image and  install the package into the local repository
14 ```
15 mvn clean install -P docker
16 ```
17
18 ### Nexus container image
19 ```
20 nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-truststore-merger:latest
21 ```
22
23 ### Running application as standalone docker container
24
25 Exemplary config.env file with necessary envs
26 ```
27 TRUSTSTORES_PATHS=/var/certs/truststore.jks:/var/certs/truststore.pem
28 TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass:
29 ```
30 TRUSTSTORES_PATHS env indicates paths (separated by ":") where truststores files are located.
31
32 TRUSTSTORES_PASSWORDS_PATHS env indicates paths (separated by ":") where files with passwords to truststores are located.
33 PEM is not protected by password so its value should be empty
34
35 Execute below command in order to run app as docker container
36 ```
37 docker run \
38     --name oom-truststore-merger \
39     --env-file ./config.env \
40     --mount type=bind,src=<src_path>,dst=/var/certs \
41 onap/org.onap.oom.platform.cert-service.oom-truststore-merger:latest
42 ```
43 Before run replace <src_path> with absolute path where you located truststores to merge (eg. /certs/resources/)
44
45 Output from merger (when pointed more than one truststore to merge in TRUSTSTORES_PATHS env) success execution should be:
46 1. Created backup file (with .bak ext) of first truststore pointed in TRUSTSTORES_PATHS env
47 2. First truststore pointed in TRUSTSTORES_PATHS env contains merged certificates from all truststores mentioned in TRUSTSTORES_PATHS env
48
49 Remove docker container:
50 ```
51 docker rm oom-truststore-merger
52 ```
53
54 ### Logs locally
55
56 path:
57 ```
58 var/log/onap/oom/truststore-merger/truststore-merger.log
59 ```
60 ### Logs in Docker container
61 ```
62 docker logs oom-merger
63 ```
64 ###Exit codes
65 ```
66 0   Success
67 1   Invalid paths in environment variables
68 2   Invalid merger configuration
69 3   Invalid truststore file-password pair
70 4   Cannot read password from file
71 5   Cannot create backup file
72 6   Cannot initialize keystore instance
73 7   Cannot load truststore file
74 8   Cannot operate on truststore data
75 9   Missing truststore certificates in provided file
76 10  Alias conflict detected
77 11  Cannot save truststore file
78 12  Cannot copy keystore file
79 13  Keystore file does not exist
80 99  Application exited abnormally