+++ /dev/null
-@REM\r
-@REM Copyright 2017 ZTE Corporation.\r
-@REM\r
-@REM Licensed under the Apache License, Version 2.0 (the "License");\r
-@REM you may not use this file except in compliance with the License.\r
-@REM You may obtain a copy of the License at\r
-@REM\r
-@REM http://www.apache.org/licenses/LICENSE-2.0\r
-@REM\r
-@REM Unless required by applicable law or agreed to in writing, software\r
-@REM distributed under the License is distributed on an "AS IS" BASIS,\r
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-@REM See the License for the specific language governing permissions and\r
-@REM limitations under the License.\r
-@REM\r
-\r
-echo %1 | findstr %2 >NUL\r
-echo ERRORLEVEL=%ERRORLEVEL%\r
-IF ERRORLEVEL 1 goto findend\r
-for /f "tokens=1" %%a in (%1) do ( \r
- echo kill %1\r
- taskkill /F /pid %%a\r
-)\r
-:findend
\ No newline at end of file
+++ /dev/null
-@REM
-@REM Copyright 2017 ZTE Corporation.
-@REM
-@REM Licensed under the Apache License, Version 2.0 (the "License");
-@REM you may not use this file except in compliance with the License.
-@REM You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing, software
-@REM distributed under the License is distributed on an "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@REM See the License for the specific language governing permissions and
-@REM limitations under the License.
-@REM
-
-@echo off
-set HOME=%~dp0
-set user=%1
-set password=%2
-set port=%3
-set host=%4
-echo start init holmes rulemgt db
-echo HOME=%HOME%
-set main_path=%HOME%..\
-cd /d %main_path%
-mysql -u%user% -p%password% -P%port% -h%host% < %main_path%\dbscripts\mysql\onap-holmes_rulemgt-createobj.sql
-set "err=%errorlevel%"
-if "%err%"=="0" (
- echo init rulemgt db success
- ) else (
- echo failed init rulemgt db
- pause
- )
\ No newline at end of file
need_unset=1
fi
-psql -U "'$user'" -p "'$port'" -h "'$host'" -d "'$dbname'" -f $main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql
-psql -U "'$user'" -p "'$port'" -h "'$host'" -d "'$dbname'" --command 'select * from aplus_rule;'
+psql -U "$user" -p "$port" -h "$host" -d "$dbname" -f $main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql
+psql -U "$user" -p "$port" -h "$host" -d "$dbname" --command 'select * from aplus_rule;'
sql_result=$?
-if [ "$need_unset"x == "1"x ]; then
+if [ "$need_unset"x = "1"x ]; then
unset PGPASSWORD
fi
+++ /dev/null
-@REM\r
-@REM Copyright 2017 ZTE Corporation.\r
-@REM\r
-@REM Licensed under the Apache License, Version 2.0 (the "License");\r
-@REM you may not use this file except in compliance with the License.\r
-@REM You may obtain a copy of the License at\r
-@REM\r
-@REM http://www.apache.org/licenses/LICENSE-2.0\r
-@REM\r
-@REM Unless required by applicable law or agreed to in writing, software\r
-@REM distributed under the License is distributed on an "AS IS" BASIS,\r
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-@REM See the License for the specific language governing permissions and\r
-@REM limitations under the License.\r
-@REM\r
-\r
-@echo off\r
-title holmes-rulemgt-service\r
-\r
-set RUNHOME=%~dp0\r
-echo ### RUNHOME: %RUNHOME%\r
-echo ### Starting rulemgt-service\r
-set main_path=%RUNHOME%..\\r
-cd /d %main_path%\r
-set JAVA="%JAVA_HOME%\bin\java.exe"\r
-set port=8312\r
-set jvm_opts=-Xms50m -Xmx128m\r
-rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n\r
-set class_path=%main_path%;%main_path%holmes-rulemgt.jar\r
-echo ### jvm_opts: %jvm_opts%\r
-echo ### class_path: %class_path%\r
-\r
-%JAVA% -classpath %class_path% %jvm_opts% org.onap.holmes.rulemgt.RuleActiveApp server %main_path%conf/rulemgt.yml\r
-\r
-IF ERRORLEVEL 1 goto showerror\r
-exit\r
-:showerror\r
-echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check!\r
-echo After checking, press any key to close \r
-pause\r
-exit
\ No newline at end of file
#!/bin/sh
#
-# Copyright 2017-2020 ZTE Corporation.
+# Copyright 2017-2021 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
${RUNHOME}/initDB.sh "$JDBC_USERNAME" "$JDBC_PASSWORD" "$DB_NAME" "$DB_PORT" "${URL_JDBC%:*}"
-#Register the frontend to MSB
-#body='{"serviceName":"holmes","version":"v1","url":"/iui/holmes","nodes":[{"ip":"host_ip","port":"9104","lb_server_params":"","checkType":"","checkUrl":"","checkInterval":"","checkTimeOut":"","ttl":"","ha_role":""}],"protocol":"UI","visualRange":"0|1","lb_policy":"","publish_port":"","namespace":"","network_plane_type":"","host":"","path":"","labels":[],"metadata":[]}'
-#msg_body=${body/host_ip/"${HOSTNAME%:*}"}
-#curl -X POST -H "Content-Type: application/json" -d ${msg_body} http://${MSB_ADDR}/api/msdiscover/v1/services?is_manual=true
-#echo Registered UI to MSB.
-
if [ -f "/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.crt" ]; then
sed -i "s|/etc/ssl/certs/holmes-frontend-selfsigned.crt|/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.crt|" "/etc/nginx/conf.d/nginx-https.conf"
sed -i "s|/etc/ssl/private/holmes-frontend.key|/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.key|" "/etc/nginx/conf.d/nginx-https.conf"
fi
+if [ "$MSB_IAG_SERVICE_PORT"x = "443"x ]; then
+ sed -i "s|http://msb-iag.onap|https://$MSB_IAG_SERVICE_HOST:$MSB_IAG_SERVICE_PORT|g" /etc/nginx/conf.d/nginx-http*.conf
+else
+ sed -i "s|http://msb-iag.onap|http://$MSB_IAG_SERVICE_HOST:$MSB_IAG_SERVICE_PORT|g" /etc/nginx/conf.d/nginx-http*.conf
+fi
-sed -i "s|msb-iag.onap|$MSB_ADDR|g" /etc/nginx/conf.d/nginx-http*.conf
-
-if [ ${ENABLE_ENCRYPT} = true ]; then
+if [ "${ENABLE_ENCRYPT}"x = "true"x ]; then
nginx -c /etc/nginx/conf.d/nginx-https.conf
else
nginx -c /etc/nginx/conf.d/nginx-http.conf
+++ /dev/null
-@REM\r
-@REM Copyright 2017 ZTE Corporation.\r
-@REM\r
-@REM Licensed under the Apache License, Version 2.0 (the "License");\r
-@REM you may not use this file except in compliance with the License.\r
-@REM You may obtain a copy of the License at\r
-@REM\r
-@REM http://www.apache.org/licenses/LICENSE-2.0\r
-@REM\r
-@REM Unless required by applicable law or agreed to in writing, software\r
-@REM distributed under the License is distributed on an "AS IS" BASIS,\r
-@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-@REM See the License for the specific language governing permissions and\r
-@REM limitations under the License.\r
-@REM\r
-\r
-@echo off\r
-title stopping engine-d-service\r
-\r
-set HOME=%~dp0\r
-set Main_Class="org.onap.holmes.rulemgt.RuleActiveApp"\r
-\r
-echo ================== engine-d-service info =============================================\r
-echo HOME=$HOME\r
-echo Main_Class=%Main_Class%\r
-echo ===============================================================================\r
-\r
-echo ### Stopping engine-d-service\r
-cd /d %HOME%\r
-\r
-for /f "delims=" %%i in ('"%JAVA_HOME%\bin\jcmd"') do (\r
- call find_kill_process "%%i" %Main_Class%\r
-)\r
-exit
\ No newline at end of file
#user nobody;
-worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
+#error_log logs/error.log debug;
pid logs/nginx.pid;
location / {
root /usr/share/nginx/html;
- proxy_set_header Host $host;
+ proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
+#error_log logs/error.log debug;
pid logs/nginx.pid;
location / {
root /usr/share/nginx/html;
- proxy_set_header Host $host;
+ proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
if ($uri ~ "/api/holmes-rule-mgmt/(.*)") {
- proxy_pass https://msb-iag.onap$request_uri;
+ proxy_pass http://msb-iag.onap$request_uri;
break;
}
if ($uri ~ "/api/holmes-engine-mgmt/(.*)") {
- proxy_pass https://msb-iag.onap$request_uri;
+ proxy_pass http://msb-iag.onap$request_uri;
break;
}
}