3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2022 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
22 KEYSTORE="${KEYSTORE:-$POLICY_HOME/etc/ssl/policy-keystore}"
23 TRUSTSTORE="${TRUSTSTORE:-$POLICY_HOME/etc/ssl/policy-truststore}"
24 KEYSTORE_PASSWD="${KEYSTORE_PASSWD:-Pol1cy_0nap}"
25 TRUSTSTORE_PASSWD="${TRUSTSTORE_PASSWD:-Pol1cy_0nap}"
27 if [ "$#" -ge 1 ]; then
30 CONFIG_FILE=${CONFIG_FILE}
33 if [ -z "$CONFIG_FILE" ]; then
34 CONFIG_FILE="${POLICY_HOME}/etc/defaultConfig.json"
37 if [ -f "${POLICY_HOME}/etc/mounted/policy-truststore" ]; then
38 echo "overriding policy-truststore"
39 cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}"
42 if [ -f "${POLICY_HOME}/etc/mounted/policy-keystore" ]; then
43 echo "overriding policy-keystore"
44 cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}"
47 if [ -f "${POLICY_HOME}/etc/mounted/xacml.properties" ]; then
48 echo "overriding xacml.properties in guards application"
49 cp -f "${POLICY_HOME}"/etc/mounted/xacml-pg.properties "${POLICY_HOME}"/apps/guard/
52 if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then
53 echo "overriding logback.xml"
54 cp -f "${POLICY_HOME}"/etc/mounted/logback.xml "${POLICY_HOME}"/etc/
57 # Create operationshistory table
58 "${POLICY_HOME}"/postgres/bin/create-guard-table-pg.sh
60 echo "Policy Xacml PDP config file: $CONFIG_FILE"
62 $JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_HOME}/lib/*" -Dlogback.configurationFile="${POLICY_HOME}/etc/logback.xml" -Djavax.net.ssl.keyStore="${KEYSTORE}" -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PASSWD}" -Djavax.net.ssl.trustStore="${TRUSTSTORE}" -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" org.onap.policy.pdpx.main.startstop.Main -c "${CONFIG_FILE}"