blob: 27e909546bb81e7fafd31109fa8a5854d38ea7ab [file] [log] [blame]
rameshiyer27befb22b2021-09-06 12:16:56 +01001#!/usr/bin/env sh
2#
3# ============LICENSE_START=======================================================
4# Copyright (C) 2021 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
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
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.
17#
18# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
20#
21
22JAVA_HOME=/usr/lib/jvm/java-11-openjdk/
23KEYSTORE="${KEYSTORE:-$POLICY_HOME/etc/ssl/policy-keystore}"
24TRUSTSTORE="${TRUSTSTORE:-$POLICY_HOME/etc/ssl/policy-truststore}"
25KEYSTORE_PASSWD="${KEYSTORE_PASSWD:-Pol1cy_0nap}"
26TRUSTSTORE_PASSWD="${TRUSTSTORE_PASSWD:-Pol1cy_0nap}"
27
28if [ "$#" -eq 1 ]; then
29 CONFIG_FILE=$1
rameshiyer27befb22b2021-09-06 12:16:56 +010030fi
31
32if [ -z "$CONFIG_FILE" ]; then
33 CONFIG_FILE="${POLICY_HOME}/etc/HttpParticipantParameters.yaml"
34fi
35
liamfallon8040c952022-05-31 11:22:10 +010036echo "Policy clamp HTTP participant config file: $CONFIG_FILE"
rameshiyer27befb22b2021-09-06 12:16:56 +010037
38if [ -f "${POLICY_HOME}/etc/mounted/policy-truststore" ]; then
39 echo "overriding policy-truststore"
40 cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}"
41fi
42
43if [ -f "${POLICY_HOME}/etc/mounted/policy-keystore" ]; then
44 echo "overriding policy-keystore"
45 cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}"
46fi
47
48if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then
49 echo "overriding logback xml files"
50 cp -f "${POLICY_HOME}"/etc/mounted/logback*.xml "${POLICY_HOME}"/etc/
51fi
52
liamfallon8040c952022-05-31 11:22:10 +010053$JAVA_HOME/bin/java \
FrancescoFioraEst7b7fbdf2021-09-17 15:02:03 +010054 -Dserver.ssl.keyStore="${KEYSTORE}" \
rameshiyer27befb22b2021-09-06 12:16:56 +010055 -Dserver.ssl.keyStorePassword="${KEYSTORE_PASSWD}" \
FrancescoFioraEst7b7fbdf2021-09-17 15:02:03 +010056 -Djavax.net.ssl.trustStore="${TRUSTSTORE}" \
57 -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" \
rameshiyer27befb22b2021-09-06 12:16:56 +010058 -jar /app/app.jar \
liamfallon8040c952022-05-31 11:22:10 +010059 --spring.config.location="${CONFIG_FILE}"