diff options
author | tangpeng <tang.peng5@zte.com.cn> | 2019-03-30 07:54:52 +0000 |
---|---|---|
committer | tangpeng <tang.peng5@zte.com.cn> | 2019-03-30 07:55:28 +0000 |
commit | dd6a7fa137605db8e2eec437167c438af0ea2447 (patch) | |
tree | 631d5d3015d08cbba97461399828cbbc5ef9aaf4 /rulemgt-standalone/src/main/assembly/bin | |
parent | b0d81fb3801a9c3bca157a23326d74ec45ab28b1 (diff) |
Modified HTTP/S Related Funcs
Change-Id: I554a7a93c49ef29f586e4b494d832c552987993e
Issue-ID: HOLMES-203
Signed-off-by: tangpeng <tang.peng5@zte.com.cn>
Diffstat (limited to 'rulemgt-standalone/src/main/assembly/bin')
-rw-r--r-- | rulemgt-standalone/src/main/assembly/bin/run.sh | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/rulemgt-standalone/src/main/assembly/bin/run.sh b/rulemgt-standalone/src/main/assembly/bin/run.sh index daa803c..d500e5e 100644 --- a/rulemgt-standalone/src/main/assembly/bin/run.sh +++ b/rulemgt-standalone/src/main/assembly/bin/run.sh @@ -70,13 +70,31 @@ if [ ! -z ${URL_JDBC} ] && [ `expr index $URL_JDBC :` != 0 ]; then fi echo DB_PORT=$DB_PORT +if [ -z ${ENABLE_ENCRYPT} ]; then + export ENABLE_ENCRYPT=true +fi +echo ENABLE_ENCRYPT=$ENABLE_ENCRYPT + KEY_PATH="$main_path/conf/holmes.keystore" KEY_PASSWORD="holmes" - #HTTPS Configurations sed -i "s|keyStorePath:.*|keyStorePath: $KEY_PATH|" "$main_path/conf/rulemgt.yml" sed -i "s|keyStorePassword:.*|keyStorePassword: $KEY_PASSWORD|" "$main_path/conf/rulemgt.yml" +if [ ${ENABLE_ENCRYPT} == true ]; then + sed -i "s|type:\s*https\?$|type: https|" "$main_path/conf/rulemgt.yml" + sed -i "s|#\?keyStorePath|keyStorePath|" "$main_path/conf/rulemgt.yml" + sed -i "s|#\?keyStorePassword|keyStorePassword|" "$main_path/conf/rulemgt.yml" + sed -i "s|#\?validateCerts|validateCerts|" "$main_path/conf/rulemgt.yml" + sed -i "s|#\?validatePeers|validatePeers|" "$main_path/conf/rulemgt.yml" +else + sed -i 's|type:\s*https\?$|type: http|' "$main_path/conf/rulemgt.yml" + sed -i "s|#\?keyStorePath|#keyStorePath|" "$main_path/conf/rulemgt.yml" + sed -i "s|#\?keyStorePassword|#keyStorePassword|" "$main_path/conf/rulemgt.yml" + sed -i "s|#\?validateCerts|#validateCerts|" "$main_path/conf/rulemgt.yml" + sed -i "s|#\?validatePeers|#validatePeers|" "$main_path/conf/rulemgt.yml" +fi + ./bin/initDB.sh $JDBC_USERNAME $JDBC_PASSWORD $DB_NAME $DB_PORT "${URL_JDBC%:*}" @@ -88,7 +106,11 @@ sed -i "s|keyStorePassword:.*|keyStorePassword: $KEY_PASSWORD|" "$main_path/conf #echo Registered UI to MSB. -nginx -c /usr/local/openresty/nginx/conf/nginx.conf +if [ ${ENABLE_ENCRYPT} == true ]; then + nginx -c /usr/local/openresty/nginx/conf/nginx-https.conf +else + nginx -c /usr/local/openresty/nginx/conf/nginx-http.conf +fi echo nginx started. "$JAVA" $JAVA_OPTS -classpath "$class_path" org.onap.holmes.rulemgt.RuleActiveApp server "$main_path/conf/rulemgt.yml" |