From 3f438510b3aae2372b33d4d976cd10482a07492a Mon Sep 17 00:00:00 2001 From: tangpeng Date: Sat, 30 Mar 2019 07:58:02 +0000 Subject: HTTP/S Modifications Change-Id: Icabaf996d23297d0d5f16601645665a128616105 Issue-ID: HOLMES-203 Signed-off-by: tangpeng --- engine-d-standalone/src/main/assembly/bin/run.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'engine-d-standalone/src/main') 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%:*}" -- cgit 1.2.3-korg