3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2019-2020 Nordix Foundation.
5 # Modifications Copyright (C) 2019-2021 AT&T Intellectual Property.
6 # Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
7 # ================================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
20 # SPDX-License-Identifier: Apache-2.0
21 # ============LICENSE_END=========================================================
24 JAVA_HOME=/usr/lib/jvm/java-11-openjdk/
25 KEYSTORE="${KEYSTORE:-$POLICY_HOME/etc/ssl/policy-keystore}"
26 TRUSTSTORE="${TRUSTSTORE:-$POLICY_HOME/etc/ssl/policy-truststore}"
27 KEYSTORE_PASSWD="${KEYSTORE_PASSWD:-Pol1cy_0nap}"
28 TRUSTSTORE_PASSWD="${TRUSTSTORE_PASSWD:-Pol1cy_0nap}"
30 if [ "$#" -ge 1 ]; then
33 CONFIG_FILE=${CONFIG_FILE}
38 if [ -z "$CONFIG_FILE" ]; then
39 CONFIG_FILE="${POLICY_HOME}/etc/papParameters.yaml"
42 echo "Policy pap config file: $CONFIG_FILE"
44 if [ -f "${POLICY_HOME}/etc/mounted/policy-truststore" ]; then
45 echo "overriding policy-truststore"
46 cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}"
49 if [ -f "${POLICY_HOME}/etc/mounted/policy-keystore" ]; then
50 echo "overriding policy-keystore"
51 cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}"
54 if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then
55 echo "overriding logback.xml"
56 cp -f "${POLICY_HOME}"/etc/mounted/logback.xml "${POLICY_HOME}"/etc/
59 # provide and external PDP group configuration if a groups.json
60 # file is present in the data directory. If none is present,
61 # the PAP will use the PapDb.json resource in the classpath
62 # to load a default group.
64 if [ -f "${POLICY_HOME}/etc/mounted/groups.json" ]; then
65 CUSTOM_GROUPS="${POLICY_HOME}/etc/mounted/groups.json"
69 -Dlogback.configurationFile="${POLICY_HOME}/etc/logback.xml" \
70 -Dserver.ssl.key-store="${KEYSTORE}" \
71 -Dserver.ssl.key-store-password="${KEYSTORE_PASSWD}" \
72 -Djavax.net.ssl.trustStore="${TRUSTSTORE}" \
73 -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" \
75 --spring.config.location="${CONFIG_FILE}" \
76 --group-config-file="${CUSTOM_GROUPS}"