Supported either HTTP or HTTPS 69/130269/1
authorGuangrong Fu <fu.guangrong@zte.com.cn>
Fri, 12 Aug 2022 01:07:04 +0000 (09:07 +0800)
committerGuangrong Fu <fu.guangrong@zte.com.cn>
Fri, 12 Aug 2022 01:07:04 +0000 (09:07 +0800)
Issue-ID: HOLMES-511
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Change-Id: Ibeb5d19aa5cb69a71b13157f0fd63ed84478aa34

rulemgt-standalone/src/main/assembly/bin/run.sh

index f54ca50..d1cebc3 100644 (file)
@@ -92,21 +92,18 @@ echo "KEY_PASS=$KEY_PASSWORD"
 sed -i "s|key-store:.*|key-store: $KEY_PATH|" "$main_path/conf/application.yaml"
 sed -i "s|key-store-password:.*|key-store-password: $KEY_PASSWORD|" "$main_path/conf/application.yaml"
 
-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"
+if [ "${ENABLE_ENCRYPT}"x = "true"x ]; then
+    sed -i "s|#\?ssl:|ssl:|" "$main_path/conf/application.yaml"
+    sed -i "s|#\?key-store|key-store|" "$main_path/conf/application.yaml"
+    sed -i "s|#\?key-store-password|key-store-password|" "$main_path/conf/application.yaml"
+    sed -i "s|#\?key-store-type|key-store-type|" "$main_path/conf/application.yaml"
 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"
+    sed -i 's|#\?ssl:|#ssl:|' "$main_path/conf/application.yaml"
+    sed -i "s|#\?key-store|#key-store|" "$main_path/conf/application.yaml"
+    sed -i "s|#\?key-store-password|#key-store-password|" "$main_path/conf/application.yaml"
+    sed -i "s|#\?key-store-type|#key-store-type|" "$main_path/conf/application.yaml"
 fi
 
-
 ${RUNHOME}/initDB.sh "$JDBC_USERNAME" "$JDBC_PASSWORD" "$DB_NAME" "$DB_PORT" "${URL_JDBC%:*}"