summaryrefslogtreecommitdiffstats
path: root/engine-d-standalone/src/main/assembly
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2019-04-02 01:13:40 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-02 01:13:40 +0000
commit2cb2e9902f2bb2bd3c84c64e8682891decae8fcb (patch)
tree91fbf99de886d61884172fc06a60a8408db7a20d /engine-d-standalone/src/main/assembly
parentbc1bf79f7d237400e4eef4ef8ba090396d7f9f1b (diff)
parent3f438510b3aae2372b33d4d976cd10482a07492a (diff)
Merge "HTTP/S Modifications"
Diffstat (limited to 'engine-d-standalone/src/main/assembly')
-rw-r--r--engine-d-standalone/src/main/assembly/bin/run.sh22
1 files changed, 20 insertions, 2 deletions
diff --git a/engine-d-standalone/src/main/assembly/bin/run.sh b/engine-d-standalone/src/main/assembly/bin/run.sh
index 0da0cf8..d036ceb 100644
--- a/engine-d-standalone/src/main/assembly/bin/run.sh
+++ b/engine-d-standalone/src/main/assembly/bin/run.sh
@@ -69,13 +69,31 @@ if [ ! -z ${URL_JDBC} ] && [ `expr index $URL_JDBC :` != 0 ]; then
fi
echo DB_PORT=$DB_PORT
-KEY_PATH="$main_path/conf/holmes.keystore"
-KEY_PASSWORD="holmes"
+if [ -z ${ENABLE_ENCRYPT} ]; then
+ export ENABLE_ENCRYPT=true
+fi
+echo ENABLE_ENCRYPT=$ENABLE_ENCRYPT
+KEY_PATH="/home/holmes/conf/holmes.keystore"
+KEY_PASSWORD="holmes"
#HTTPS Configurations
sed -i "s|keyStorePath:.*|keyStorePath: $KEY_PATH|" "$main_path/conf/engine-d.yml"
sed -i "s|keyStorePassword:.*|keyStorePassword: $KEY_PASSWORD|" "$main_path/conf/engine-d.yml"
+if [ ${ENABLE_ENCRYPT} == true ]; then
+ sed -i "s|type:\s*https\?$|type: https|" "$main_path/conf/engine-d.yml"
+ sed -i "s|#\?keyStorePath|keyStorePath|" "$main_path/conf/engine-d.yml"
+ sed -i "s|#\?keyStorePassword|keyStorePassword|" "$main_path/conf/engine-d.yml"
+ sed -i "s|#\?validateCerts|validateCerts|" "$main_path/conf/engine-d.yml"
+ sed -i "s|#\?validatePeers|validatePeers|" "$main_path/conf/engine-d.yml"
+else
+ sed -i 's|type:\s*https\?$|type: http|' "$main_path/conf/engine-d.yml"
+ sed -i "s|#\?keyStorePath|#keyStorePath|" "$main_path/conf/engine-d.yml"
+ sed -i "s|#\?keyStorePassword|#keyStorePassword|" "$main_path/conf/engine-d.yml"
+ sed -i "s|#\?validateCerts|#validateCerts|" "$main_path/conf/engine-d.yml"
+ sed -i "s|#\?validatePeers|#validatePeers|" "$main_path/conf/engine-d.yml"
+fi
+
cat "$main_path/conf/engine-d.yml"
./bin/initDB.sh $JDBC_USERNAME $JDBC_PASSWORD $DB_NAME $DB_PORT "${URL_JDBC%:*}"