summaryrefslogtreecommitdiffstats
path: root/packages/policy-gui-docker/src/main/docker/policy-gui.sh
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2022-01-28 11:41:38 +0000
committerDaniel Hanrahan <daniel.hanrahan@est.tech>2022-02-28 13:33:32 +0000
commite56f12777c43885696a98f07e01c040f95ca7015 (patch)
tree6366ce00bb7ca9740a98347bbc6e38ff62a54593 /packages/policy-gui-docker/src/main/docker/policy-gui.sh
parent4a4a638d6d0336134cdb4cdab093054f3b3f09f9 (diff)
Run policy GUIs in a single JAR
Create gui-server module serving clamp and apex GUIs using Spring Add Spring filter to pass client SSL cert to clamp backend Remove nginx from docker image Add logback.xml to docker image Add helper scripts for running gui-server jar and docker Issue-ID: POLICY-3638 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ie857f5755015c522b8cf781de255f7a1d567e263
Diffstat (limited to 'packages/policy-gui-docker/src/main/docker/policy-gui.sh')
-rw-r--r--packages/policy-gui-docker/src/main/docker/policy-gui.sh28
1 files changed, 26 insertions, 2 deletions
diff --git a/packages/policy-gui-docker/src/main/docker/policy-gui.sh b/packages/policy-gui-docker/src/main/docker/policy-gui.sh
index 7cdefba..02d44af 100644
--- a/packages/policy-gui-docker/src/main/docker/policy-gui.sh
+++ b/packages/policy-gui-docker/src/main/docker/policy-gui.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#
# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
+# Copyright (C) 2021-2022 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,4 +19,28 @@
# ============LICENSE_END=========================================================
#
-nginx -g "daemon off;"
+JAVA_HOME=/usr/lib/jvm/java-11-openjdk/
+export KEYSTORE="${KEYSTORE:-$POLICY_HOME/etc/ssl/policy-keystore}"
+export TRUSTSTORE="${TRUSTSTORE:-$POLICY_HOME/etc/ssl/policy-truststore}"
+export KEYSTORE_PASSWD="${KEYSTORE_PASSWD:-Pol1cy_0nap}"
+export TRUSTSTORE_PASSWD="${TRUSTSTORE_PASSWD:-Pol1cy_0nap}"
+
+if [ -f "${POLICY_HOME}/etc/mounted/policy-truststore" ]; then
+ echo "overriding policy-truststore"
+ cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}"
+fi
+
+if [ -f "${POLICY_HOME}/etc/mounted/policy-keystore" ]; then
+ echo "overriding policy-keystore"
+ cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}"
+fi
+
+if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then
+ echo "overriding logback xml files"
+ cp -f "${POLICY_HOME}"/etc/mounted/logback*.xml "${POLICY_HOME}"/etc/
+fi
+
+$JAVA_HOME/bin/java \
+ -Dlogging.config="${POLICY_HOME}/etc/logback.xml" \
+ -jar /app/app.jar \
+ --spring.config.location="${POLICY_HOME}/etc/application.yml"