summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2020-10-19 15:13:32 +0200
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2020-10-20 13:00:42 +0200
commit3c0dfe4a46dc059306c668d0f5dba7125fd2d82f (patch)
tree722a43c46d23b1204a3c50cb596f616787892c9b
parent92767ce7668ad4566e1f202e28b466d5fbdc2f89 (diff)
Fix error caused by empty env TOPOURL
container in crashloop back due to empty env TOPOURL Issue-ID: SDNC-1385 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Change-Id: Id5d106caee7fcb78ee9fce390521dad056debca4 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Former-commit-id: aedaa63d22821c83042a4dd3f16b1c053d3ac031
-rw-r--r--installation/sdnc-web/src/main/docker/Dockerfile3
-rw-r--r--installation/sdnc-web/src/main/resources/http_site.conf2
-rw-r--r--installation/sdnc-web/src/main/resources/https_site.conf2
-rw-r--r--installation/sdnc-web/src/main/scripts/configure.sh3
-rw-r--r--installation/sdnc-web/src/main/scripts/run.sh27
5 files changed, 21 insertions, 16 deletions
diff --git a/installation/sdnc-web/src/main/docker/Dockerfile b/installation/sdnc-web/src/main/docker/Dockerfile
index e4c594b2..a552137f 100644
--- a/installation/sdnc-web/src/main/docker/Dockerfile
+++ b/installation/sdnc-web/src/main/docker/Dockerfile
@@ -21,7 +21,7 @@
# Base bitnami nginx image
FROM ${base.image.repo}
-MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
+LABEL maintainer="CCSDK Team (onap-ccsdk@lists.onap.org)"
# copy ODLUX files to nginx
COPY html /opt/bitnami/nginx/html
@@ -38,6 +38,7 @@ ENV WEBPROTOCOL="HTTP" \
TRPCEURL="" \
TOPOURL="" \
TILEURL="" \
+ DNS_RESOLVER="1.1.1.1" \
SSL_CERT_DIR="/app/cert" \
SSL_CERTIFICATE="cert.pem" \
SSL_CERTIFICATE_KEY="cert.key"
diff --git a/installation/sdnc-web/src/main/resources/http_site.conf b/installation/sdnc-web/src/main/resources/http_site.conf
index d62fc8e7..53356b43 100644
--- a/installation/sdnc-web/src/main/resources/http_site.conf
+++ b/installation/sdnc-web/src/main/resources/http_site.conf
@@ -64,7 +64,7 @@ server {
proxy_pass TOPOURL;
}
location ~ ^/tiles/ {
- resolver 1.1.1.1;
+ resolver DNS_RESOLVER;
if ($request_uri ~* "/tiles/(.*)") {
proxy_pass TILEURL/$1;
}
diff --git a/installation/sdnc-web/src/main/resources/https_site.conf b/installation/sdnc-web/src/main/resources/https_site.conf
index d2d6ecd7..da86272d 100644
--- a/installation/sdnc-web/src/main/resources/https_site.conf
+++ b/installation/sdnc-web/src/main/resources/https_site.conf
@@ -83,7 +83,7 @@ server {
proxy_pass TOPOURL;
}
location ~ ^/tiles/ {
- resolver 1.1.1.1;
+ resolver DNS_RESOLVER;
if ($request_uri ~* "/tiles/(.*)") {
proxy_pass TILEURL/$1;
}
diff --git a/installation/sdnc-web/src/main/scripts/configure.sh b/installation/sdnc-web/src/main/scripts/configure.sh
index 2a007672..cf53a0d9 100644
--- a/installation/sdnc-web/src/main/scripts/configure.sh
+++ b/installation/sdnc-web/src/main/scripts/configure.sh
@@ -59,6 +59,7 @@ update_nginx_site_conf() {
sed -i 's|SDNRPROTOCOL|'$SDNRPROTOCOL'|g' $FN
sed -i 's|SDNRHOST|'$SDNRHOST'|g' $FN
sed -i 's|SDNRPORT|'$SDNRPORT'|g' $FN
+ sed -i 's|DNS_RESOLVER|'$DNS_RESOLVER'|g' $FN
# handle optional parameters
if [ -z "$TRPCEURL" ]; then
@@ -70,7 +71,7 @@ update_nginx_site_conf() {
fi
if [ -z "$TOPOURL" ]; then
echo "topology api forwarding disabled"
- sed -i 's|proxy_pass TOPOURL/$1;|return 404;|g' $FN
+ sed -i 's|proxy_pass TOPOURL;|return 404;|g' $FN
else
sed -i 's|TOPOURL|'$TOPOURL'|g' $FN
fi
diff --git a/installation/sdnc-web/src/main/scripts/run.sh b/installation/sdnc-web/src/main/scripts/run.sh
index 9d912a65..c310837f 100644
--- a/installation/sdnc-web/src/main/scripts/run.sh
+++ b/installation/sdnc-web/src/main/scripts/run.sh
@@ -30,21 +30,24 @@ echo " WEBPORT : $WEBPORT"
echo " SDNRPROTOCOL : $SDNRPROTOCOL"
echo " SDNRHOST : $SDNRHOST"
echo " SDNRPORT : $SDNRPORT"
+echo " DNS_RESOLVER : $DNS_RESOLVER"
echo " TRPCEURL : $TRPCEURL"
echo " TOPOURL : $TOPOURL"
echo " TILEURL : $TILEURL"
-echo " SSL_CERT_DIR : $SSL_CERT_DIR"
-echo -n " SSL_CERTIFICATE: $SSL_CERTIFICATE"
-if [ -f "$SSL_CERTIFICATE" ]; then
-echo " (exists)"
-else
-echo " (missing)"
-fi
-echo -n " SSL_CERTIFICATE_KEY: $SSL_CERTIFICATE_KEY"
-if [ -f "$SSL_CERTIFICATE_KEY" ]; then
-echo " (exists)"
-else
-echo " (missing)"
+if [ "$WEBPROTOCOL" == "HTTPS" ]; then
+ echo " SSL_CERT_DIR : $SSL_CERT_DIR"
+ echo -n " SSL_CERTIFICATE: $SSL_CERTIFICATE"
+ if [ -f "$SSL_CERT_DIR/$SSL_CERTIFICATE" ]; then
+ echo " (exists)"
+ else
+ echo " (missing)"
+ fi
+ echo -n " SSL_CERTIFICATE_KEY: $SSL_CERTIFICATE_KEY"
+ if [ -f "$SSL_CERT_DIR/$SSL_CERTIFICATE_KEY" ]; then
+ echo " (exists)"
+ else
+ echo " (missing)"
+ fi
fi
echo ""