[OOM-CMPv2] Rename module and docker image
[oom/platform/cert-service.git] / certServicePostProcessor / README.md
1 # Certificate Post Processor
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-certservice-post-processor: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 KEYSTORE_SOURCE_PATHS=/var/certs/external/keystore.jks:/var/certs/external/keystore.pass
30 KEYSTORE_DESTINATION_PATHS=/var/certs/cert.jks:/var/certs/jks.pass
31 ```
32 TRUSTSTORES_PATHS env indicates paths (separated by ":") where truststores files are located.
33
34 TRUSTSTORES_PASSWORDS_PATHS env indicates paths (separated by ":") where files with passwords to truststores are located.
35 PEM is not protected by password so its value should be empty
36
37 KEYSTORE_SOURCE_PATHS env (optional) indicates paths (separated by ":") where files to copy are located.
38
39 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.
40
41 Execute below command in order to run app as docker container
42 ```
43 docker run \
44     --name oom-certservice-post-processor \
45     --env-file ./config.env \
46     --mount type=bind,src=<src_path>,dst=/var/certs \
47 onap/org.onap.oom.platform.cert-service.oom-certservice-post-processor:latest
48 ```
49 Before run replace <src_path> with absolute path where you located truststores to merge (eg. /certs/resources/)
50
51 Output from merger (when pointed more than one truststore to merge in TRUSTSTORES_PATHS env and provided optional envs) success execution should be:
52 1. Created backup file (with .bak ext) of first truststore pointed in TRUSTSTORES_PATHS env
53 2. Keystores files listed in KEYSTORE_SOURCE_PATHS env overrides corresponding to them files defined in KEYSTORE_DESTINATION_PATHS env.
54 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.
55
56 Remove docker container:
57 ```
58 docker rm oom-certservice-post-processor
59 ```
60
61 ### Logs locally
62
63 path:
64 ```
65 var/log/onap/oom/cert-service/post-processor/application.log
66 ```
67 ### Logs in Docker container
68 ```
69 docker logs oom-certservice-post-processor
70 ```
71 ###Exit codes
72 ```
73 0   Success
74 1   Invalid paths in environment variables
75 2   Invalid merger configuration
76 3   Invalid truststore file-password pair
77 4   Cannot read password from file
78 5   Cannot create backup file
79 6   Cannot initialize keystore instance
80 7   Cannot load truststore file
81 8   Cannot operate on truststore data
82 9   Missing truststore certificates in provided file
83 10  Alias conflict detected
84 11  Cannot save truststore file
85 12  Cannot copy keystore file
86 13  Keystore file does not exist
87 99  Application exited abnormally