rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 1 | #!/usr/bin/env sh |
| 2 | # |
| 3 | # ============LICENSE_START======================================================= |
liamfallon | 6171177 | 2022-06-14 11:37:47 +0100 | [diff] [blame^] | 4 | # Copyright (C) 2021-2022 Nordix Foundation. |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 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 | |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 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}" |
| 26 | |
FrancescoFioraEst | 252a4bb | 2021-07-23 15:53:46 +0100 | [diff] [blame] | 27 | if [ "$#" -eq 1 ]; then |
| 28 | CONFIG_FILE=$1 |
FrancescoFioraEst | 252a4bb | 2021-07-23 15:53:46 +0100 | [diff] [blame] | 29 | fi |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 30 | |
FrancescoFioraEst | 252a4bb | 2021-07-23 15:53:46 +0100 | [diff] [blame] | 31 | if [ -z "$CONFIG_FILE" ]; then |
| 32 | CONFIG_FILE="${POLICY_HOME}/etc/KubernetesParticipantParameters.yaml" |
| 33 | fi |
| 34 | |
liamfallon | 8040c95 | 2022-05-31 11:22:10 +0100 | [diff] [blame] | 35 | echo "Policy clamp Kubernetes participant config file: $CONFIG_FILE" |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 36 | |
| 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}" |
| 40 | fi |
| 41 | |
| 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}" |
| 45 | fi |
| 46 | |
| 47 | if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then |
| 48 | echo "overriding logback xml files" |
| 49 | cp -f "${POLICY_HOME}"/etc/mounted/logback*.xml "${POLICY_HOME}"/etc/ |
| 50 | fi |
| 51 | |
liamfallon | 8040c95 | 2022-05-31 11:22:10 +0100 | [diff] [blame] | 52 | $JAVA_HOME/bin/java \ |
liamfallon | 6171177 | 2022-06-14 11:37:47 +0100 | [diff] [blame^] | 53 | -Dlogging.config="${POLICY_HOME}/etc/logback.xml" \ |
FrancescoFioraEst | 7b7fbdf | 2021-09-17 15:02:03 +0100 | [diff] [blame] | 54 | -Dserver.ssl.keyStore="${KEYSTORE}" \ |
rameshiyer27 | 4334af1 | 2021-07-16 07:27:16 +0100 | [diff] [blame] | 55 | -Dserver.ssl.keyStorePassword="${KEYSTORE_PASSWD}" \ |
FrancescoFioraEst | 7b7fbdf | 2021-09-17 15:02:03 +0100 | [diff] [blame] | 56 | -Djavax.net.ssl.trustStore="${TRUSTSTORE}" \ |
| 57 | -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" \ |
FrancescoFioraEst | 252a4bb | 2021-07-23 15:53:46 +0100 | [diff] [blame] | 58 | -jar /app/app.jar \ |
liamfallon | 8040c95 | 2022-05-31 11:22:10 +0100 | [diff] [blame] | 59 | --spring.config.location="${CONFIG_FILE}" |