Skip to content

Commit

Permalink
云端录像支持集群代理
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjoge committed May 8, 2024
1 parent 4626b92 commit e82db02
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 27 deletions.
2 changes: 1 addition & 1 deletion script/cdvr/MyData/Config/ClusterServer.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Addr":"http://172.29.108.254/Api"}
{"Addr":null}
2 changes: 2 additions & 0 deletions script/cdvr/MyData/SettingConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
<SwaggerDoc>true</SwaggerDoc>
<DiskReserveSpace>3</DiskReserveSpace>
<CARsaPem></CARsaPem>
<WebUrl></WebUrl>
<Ver></Ver>
</Setting>
12 changes: 8 additions & 4 deletions script/cdvr/startcdvr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ echo "当前执行文件......$0"


source ../default_args.sh

unalias cp
RecordPath="/records"

###################################函数定义#######################################
Expand All @@ -24,7 +24,7 @@ function init_system_files_path()
if [[ -f "./MyData/SettingConfig.xml" ]]; then
rm -f $CDVR_DOCKER_PATH/SettingConfig.xml 2>/dev/null
echo "拷贝一份XML配置文件:cp ./MyData/SettingConfig.xml $CDVR_DOCKER_PATH/SettingConfig.xml"
cp ./MyData/SettingConfig.xml $CDVR_DOCKER_PATH/SettingConfig.xml
cp -f ./MyData/SettingConfig.xml $CDVR_DOCKER_PATH/SettingConfig.xml

else
echo "缺少./MyData/SettingConfig.xml文件...已退出安装!"
Expand All @@ -33,7 +33,7 @@ function init_system_files_path()
# 复制log4.config(第一次做完全复制,若有变动需要手动修改)
if [[ -f "./MyData/log4.config" ]]; then
echo "拷贝一份日志配置文件: ./MyData/log4.config $CDVR_DOCKER_PATH/log4.config"
cp -f ./MyData/log4.config $CDVR_DOCKER_PATH/log4.config
cp -f ./MyData/log4.config $CDVR_DOCKER_PATH/log4.config
else
echo "缺少./log4.config文件...已退出安装!"
exit 1
Expand All @@ -59,7 +59,7 @@ function init_system_files_path()
if [[ -f "./MyData/Config/ClusterServer.json" ]]; then
rm -f $CDVR_DOCKER_PATH/Config/ClusterServer.json 2>/dev/null
echo "拷贝ClusterServer.json:./MyData/Config/ClusterServer.json $CDVR_DOCKER_PATH/Config/ClusterServer.json"
cp ./MyData/Config/ClusterServer.json $CDVR_DOCKER_PATH/Config/ClusterServer.json
cp -f ./MyData/Config/ClusterServer.json $CDVR_DOCKER_PATH/Config/ClusterServer.json
else
echo "缺少./Config/ClusterServer.json文件...已退出安装!"
exit 1
Expand Down Expand Up @@ -92,6 +92,9 @@ function update_config(){

if [[ "$RTVS_NETWORK_HOST" == "true" ]]; then
RTVSIP="127.0.0.1"
updateXml $CDVR_DOCKER_PATH/SettingConfig.xml WebUrl "http://127.0.0.1:$CDVR_DOCKER_HTTP_PORT"
else
updateXml $CDVR_DOCKER_PATH/SettingConfig.xml WebUrl "http://$DOCKER_GATEWAY_HOST:$CDVR_DOCKER_HTTP_PORT"
fi


Expand All @@ -103,6 +106,7 @@ function update_config(){
updateXml $CDVR_DOCKER_PATH/SettingConfig.xml SwaggerDoc $SwaggerUI
updateXml $CDVR_DOCKER_PATH/SettingConfig.xml DiskReserveSpace $CDVR_KEEP_GB
updateXml $CDVR_DOCKER_PATH/SettingConfig.xml CARsaPem "/MyData/token2rsa.pem"
updateXml $CDVR_DOCKER_PATH/SettingConfig.xml Ver $RTVSWEB_VERSION


if [ ! -n "$ClusterServer" ] ;then
Expand Down
2 changes: 1 addition & 1 deletion script/clusterMyData/ClusterConf.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"Name":"视频OCX服务","Type":1001,"ReMark":"视频OCX服务,用于OCX控件和CS端。","TimeoutMsec":10000.0},{"Name":"视频WebSocket服务","Type":1002,"ReMark":"视频WebSocket服务,用于js控件软解模式和本地打包FMP4模式。","TimeoutMsec":10000.0},{"Name":"视频FMP4服务","Type":1003,"ReMark":"视频FMP4服务,用于JS控件FMP4模式","TimeoutMsec":10000.0},{"Name":"视频服务后端接口","Type":1004,"ReMark":"视频服务后端接口,一般为发起1078转RTMP使用。","TimeoutMsec":10000.0,"CanProxy":true,"CanAgentPort":true},{"Name":"视频GOV服务","Type":1005,"ReMark":"视频GOV服务,用于政府平台调用视频使用","TimeoutMsec":10000.0},{"Name":"视频HTTPS服务","Type":1006,"ReMark":"HTTPS代理服务,支持1002、1003、1004","TimeoutMsec":10000.0}]
[{"Name":"视频OCX服务","Type":1001,"ReMark":"视频OCX服务,用于OCX控件和CS端。","TimeoutMsec":10000.0},{"Name":"视频WebSocket服务","Type":1002,"ReMark":"视频WebSocket服务,用于js控件软解模式和本地打包FMP4模式。","TimeoutMsec":10000.0},{"Name":"视频FMP4服务","Type":1003,"ReMark":"视频FMP4服务,用于JS控件FMP4模式","TimeoutMsec":10000.0},{"Name":"视频服务后端接口","Type":1004,"ReMark":"视频服务后端接口,一般为发起1078转RTMP使用。","TimeoutMsec":10000.0,"CanProxy":true,"CanAgentPort":true},{"Name":"视频GOV服务","Type":1005,"ReMark":"视频GOV服务,用于政府平台调用视频使用","TimeoutMsec":10000.0},{"Name":"视频HTTPS服务","Type":1006,"ReMark":"HTTPS代理服务,支持1002、1003、1004","TimeoutMsec":10000.0},{"Name":"云端录像服务","Type":1007,"ReMark":"代理云端录像接口服务","TimeoutMsec":10000.0,"CanProxy":true,"CanAgentPort":true}]
2 changes: 1 addition & 1 deletion script/clusterMyData/ClusterConfVer.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"Type":1001,"NowVer":"1.3.12"},{"Type":1002,"NowVer":"1.3.12"},{"Type":1003,"NowVer":"1.3.12"},{"Type":1004,"NowVer":"1.3.12"},{"Type":1005,"NowVer":"1.3.12"},{"Type":1006,"NowVer":"1.3.12"}]
[{"Type":1001,"NowVer":"1.3.12"},{"Type":1002,"NowVer":"1.3.12"},{"Type":1003,"NowVer":"1.3.12"},{"Type":1004,"NowVer":"1.3.12"},{"Type":1005,"NowVer":"1.3.12"},{"Type":1006,"NowVer":"1.3.12"},{"Type":1007,"NowVer":"1.3.12"}]
1 change: 1 addition & 0 deletions script/grafana/docker_grafana_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function update_dburl()
echo "当前执行文件......$0"

source ../default_args.sh
unalias cp

IS_EXISTS_GRAFANA_IMAGE_NAME="false"
IS_EXISTS_GRAFANA_CONTAINER="false"
Expand Down
5 changes: 3 additions & 2 deletions script/influxdb/docker_influxdb_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ START_CONTAINER_CHECK_CURRENT=1
#传入表示映射出端口
#TSDB_Server_PORT
source ../default_args.sh
unalias cp

# ========================下载镜像======================================
for i in [ `docker images ` ]; do
Expand Down Expand Up @@ -36,8 +37,8 @@ if [[ $IS_EXISTS_INFLUXDB_CONTAINER == "false" ]]; then
fi
done
if [[ $IS_EXISTS_INFLUXDB_CONTAINER == "false" ]]; then
cp docker_influxdb_create_user.sh $TSDB_DOCKER_PATH/scripts/docker_influxdb_create_user.sh
cp influxdb.conf $TSDB_DOCKER_PATH/influxdb.conf
cp -f docker_influxdb_create_user.sh $TSDB_DOCKER_PATH/scripts/docker_influxdb_create_user.sh
cp -f influxdb.conf $TSDB_DOCKER_PATH/influxdb.conf
chmod a+x $TSDB_DOCKER_PATH/scripts/docker_influxdb_create_user.sh
if [[ -f "$TSDB_DOCKER_PATH/scripts/docker_influxdb_create_user.sh" ]]; then
echo "检查到influxdb容器尚未创建!"
Expand Down
5 changes: 3 additions & 2 deletions script/mysql/docker_mysql_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
echo "当前执行文件......$0"

source ../default_args.sh
unalias cp

IS_EXISTS_MYSQL_IMAGE_NAME="false"
IS_EXISTS_MYSQL_IMAGE_TAG="false"
Expand Down Expand Up @@ -45,7 +46,7 @@ if [[ $IS_EXISTS_MYSQL_CONTAINER == "false" ]]; then
echo "检查到$MYSQL_DOCKER_CONTAINER_NAME容器尚未创建!"
echo "创建$MYSQL_DOCKER_CONTAINER_NAME容器......."
# 拷贝可执行文件并授权
cp docker_mysql_db_init.sh $MYSQL_DOCKER_PATH/scripts/docker_mysql_db_init.sh
cp -f docker_mysql_db_init.sh $MYSQL_DOCKER_PATH/scripts/docker_mysql_db_init.sh
chmod a+x $MYSQL_DOCKER_PATH/scripts/docker_mysql_db_init.sh
# 执行容器创建
if [[ -f "$MYSQL_DOCKER_PATH/scripts/docker_mysql_db_init.sh" ]]; then
Expand Down Expand Up @@ -127,7 +128,7 @@ fi
if [[ $IS_EXISTS_MYSQL_CONTAINER == "true" && $IS_EXISTS_MYSQL_CONTAINER_RUNGING == "true" ]]; then
if [[ -f "./docker_mysql_upgrade.sh" ]]; then
echo "检查到MySQL升级脚本,即将执行....."
cp docker_mysql_upgrade.sh $MYSQL_DOCKER_PATH/scripts/docker_mysql_upgrade.sh
cp -f docker_mysql_upgrade.sh $MYSQL_DOCKER_PATH/scripts/docker_mysql_upgrade.sh
chmod a+x $MYSQL_DOCKER_PATH/scripts/docker_mysql_upgrade.sh
echo "进入$MYSQL_DOCKER_CONTAINER_NAME容器执行升级脚本: docker exec -it $MYSQL_DOCKER_CONTAINER_NAME /bin/bash -c 'sh /etc/mysql/scripts/docker_mysql_upgrade.sh'"
# 进入容器并执行脚本:
Expand Down
3 changes: 2 additions & 1 deletion script/run_28181.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
echo "当前执行文件......$0"

source default_args.sh
unalias cp

if [ ! -n "$BeianAddress" ] ; then
BeianAddress=$IPADDRESS
Expand Down Expand Up @@ -51,7 +52,7 @@ function init_system_files_path()
# 复制log4.config
if [[ -f "./log4.config" ]]; then
echo "拷贝一份日志配置文件: ./log4.config $DOCKER_GBSIP_PATH/log4.config"
cp -f ./log4.config $DOCKER_GBSIP_PATH/log4.config
cp -f ./log4.config $DOCKER_GBSIP_PATH/log4.config
else
echo "缺少./log4.config文件...已退出安装!"
exit
Expand Down
1 change: 1 addition & 0 deletions script/run_attachment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
echo "当前执行文件......$0"

source default_args.sh
unalias cp

if [ ! -n "$LocWebFileUrl" ] ; then
LocWebFileUrl="http://$IPADDRESS:$DOCKER_ATTACHMENT_HTTP_PORT/alarmfiles"
Expand Down
3 changes: 2 additions & 1 deletion script/run_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
echo "当前执行文件......$0"

source default_args.sh
unalias cp



Expand Down Expand Up @@ -93,7 +94,7 @@ function init_system_files_path()
# 复制log4.config
if [[ -f "./log4.config" ]]; then
echo "拷贝一份日志配置文件: ./log4.config $DOCKER_CLUSTER_PATH/log4.config"
cp -f ./log4.config $DOCKER_CLUSTER_PATH/log4.config
cp -f ./log4.config $DOCKER_CLUSTER_PATH/log4.config
else
echo "缺少./log4.config文件...已退出安装!"
exit
Expand Down
1 change: 1 addition & 0 deletions script/run_gw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
echo "当前执行文件......$0"

source default_args.sh
unalias cp


function updateXml()
Expand Down
17 changes: 9 additions & 8 deletions script/run_rtvs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ echo "当前执行文件......$0"


source default_args.sh
unalias cp

##################################临时变量定义##################################
DOCKER_RUN_ID=0
Expand Down Expand Up @@ -122,7 +123,7 @@ function init_system_files_path()
# 复制nginx.conf文件
if [[ -f "./nginx/nginx.conf" ]]; then
echo "拷贝一份nginx.conf:cp ./nginx/nginx.conf $DOCKER_NGINX_PATH/nginx.conf"
cp ./nginx/nginx.conf $DOCKER_NGINX_PATH/nginx.conf
cp -f ./nginx/nginx.conf $DOCKER_NGINX_PATH/nginx.conf
else
echo "缺少./nginx/nginx.conf文件...已退出安装!"
exit 1
Expand All @@ -135,7 +136,7 @@ function init_system_files_path()
# 复制未加密nginx.conf文件
if [[ -f "./nginx/nginx_nowss.conf" ]]; then
echo "拷贝一份nginx_nowss.conf:cp ./nginx/nginx_nowss.conf $DOCKER_NGINX_PATH/nginx.conf"
cp ./nginx/nginx_nowss.conf $DOCKER_NGINX_PATH/nginx.conf
cp -f ./nginx/nginx_nowss.conf $DOCKER_NGINX_PATH/nginx.conf
else
echo "缺少./nginx/nginx_nowss.conf文件...已退出安装!"
exit 1
Expand All @@ -153,7 +154,7 @@ function init_system_files_path()
if [[ -f "./rtvsMyData/VersionConfig.xml" ]]; then
rm -f $DOCKER_RTVSWEB_PATH/VersionConfig.xml 2>/dev/null
echo "拷贝一份XML配置文件:cp ./rtvsMyData/VersionConfig.xml $DOCKER_RTVSWEB_PATH/VersionConfig.xml"
cp ./rtvsMyData/VersionConfig.xml $DOCKER_RTVSWEB_PATH/VersionConfig.xml
cp -f ./rtvsMyData/VersionConfig.xml $DOCKER_RTVSWEB_PATH/VersionConfig.xml
else
echo "缺少./rtvsMyData/VersionConfig.xml文件...已退出安装!"
exit 1
Expand All @@ -162,7 +163,7 @@ function init_system_files_path()
if [[ -f "./rtvsMyData/SettingConfig.xml" ]]; then
rm -f $DOCKER_RTVSWEB_PATH/SettingConfig.xml 2>/dev/null
echo "拷贝一份XML配置文件:cp ./rtvsMyData/SettingConfig.xml $DOCKER_RTVSWEB_PATH/SettingConfig.xml"
cp ./rtvsMyData/SettingConfig.xml $DOCKER_RTVSWEB_PATH/SettingConfig.xml
cp -f ./rtvsMyData/SettingConfig.xml $DOCKER_RTVSWEB_PATH/SettingConfig.xml

else
echo "缺少./rtvsMyData/SettingConfig.xml文件...已退出安装!"
Expand All @@ -171,7 +172,7 @@ function init_system_files_path()
# 复制log4.config(第一次做完全复制,若有变动需要手动修改)
if [[ -f "./rtvsMyData/log4.config" ]]; then
echo "拷贝一份日志配置文件: ./rtvsMyData/log4.config $DOCKER_RTVSWEB_PATH/log4.config"
cp -f ./rtvsMyData/log4.config $DOCKER_RTVSWEB_PATH/log4.config
cp -f ./rtvsMyData/log4.config $DOCKER_RTVSWEB_PATH/log4.config
else
echo "缺少./log4.config文件...已退出安装!"
exit 1
Expand Down Expand Up @@ -210,7 +211,7 @@ function init_system_files_path()
if [[ -f "./rtvsMyData/Config/ClusterServer.json" ]]; then
rm -f $DOCKER_RTVSWEB_PATH/Config/ClusterServer.json 2>/dev/null
echo "拷贝ClusterServer.json:./rtvsMyData/Config/ClusterServer.json $DOCKER_RTVSWEB_PATH/Config/ClusterServer.json"
cp ./rtvsMyData/Config/ClusterServer.json $DOCKER_RTVSWEB_PATH/Config/ClusterServer.json
cp -f ./rtvsMyData/Config/ClusterServer.json $DOCKER_RTVSWEB_PATH/Config/ClusterServer.json
else
echo "缺少./Config/ClusterServer.json文件...已退出安装!"
exit 1
Expand Down Expand Up @@ -325,7 +326,7 @@ function docker_mysql_checkAndInstall(){
#创建数据库表检查
echo "正在进行MYSQL数据库表检查"
cd mysql
cp docker_mysql_create_table.sh $MYSQL_DOCKER_PATH/scripts/docker_mysql_create_table.sh
cp -f docker_mysql_create_table.sh $MYSQL_DOCKER_PATH/scripts/docker_mysql_create_table.sh
chmod a+x $MYSQL_DOCKER_PATH/scripts/docker_mysql_create_table.sh
docker exec -it $MYSQL_DOCKER_CONTAINER_NAME /bin/bash -c "sh /etc/mysql/scripts/docker_mysql_create_table.sh"
rm -f $MYSQL_DOCKER_PATH/scripts/docker_mysql_create_table.sh
Expand Down Expand Up @@ -359,7 +360,7 @@ function docker_mysql_install_test()
echo "脚本执行Mysql信息验证:..."
if [[ -f "./docker_mysql_validator.sh" ]]; then
# 复制脚本到验证路径并授权
cp docker_mysql_validator.sh $MYSQL_DOCKER_PATH/scripts/docker_mysql_validator.sh
cp -f docker_mysql_validator.sh $MYSQL_DOCKER_PATH/scripts/docker_mysql_validator.sh
chmod a+x $MYSQL_DOCKER_PATH/scripts/docker_mysql_validator.sh
# 进入容器执行脚本
docker exec -it $MYSQL_DOCKER_CONTAINER_NAME /bin/bash -c "sh /etc/mysql/scripts/docker_mysql_validator.sh"
Expand Down
13 changes: 7 additions & 6 deletions script/webrtc/docker_mediasoup_install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /bin/bash

source ../default_args.sh
unalias cp

#替换文件字符串
#参数1.文件 2.查找字符串 3.替换字符串
Expand Down Expand Up @@ -210,34 +211,34 @@ function init_base(){
update=0
if [ ! -f "$WEBRTC_DOCKER_PATH/config.js" ]; then
update=1
cp config.js.tmp $WEBRTC_DOCKER_PATH/config.js
cp -f config.js.tmp $WEBRTC_DOCKER_PATH/config.js
else
diff config.js.tmp $WEBRTC_DOCKER_PATH/config.js
if [ $? -ne 0 ]; then
update=1
cp config.js.tmp $WEBRTC_DOCKER_PATH/config.js
cp -f config.js.tmp $WEBRTC_DOCKER_PATH/config.js
fi
fi

if [ ! -f "$WEBRTC_DOCKER_PATH/source/server.js" ]; then
update=1
cp server.js $WEBRTC_DOCKER_PATH/source/server.js
cp -f server.js $WEBRTC_DOCKER_PATH/source/server.js
else
diff server.js $WEBRTC_DOCKER_PATH/source/server.js
if [ $? -ne 0 ]; then
update=1
cp server.js $WEBRTC_DOCKER_PATH/source/server.js
cp -f server.js $WEBRTC_DOCKER_PATH/source/server.js
fi
fi

if [ ! -f "$WEBRTC_DOCKER_PATH/source/lib/Room.js" ]; then
update=1
cp Room.js $WEBRTC_DOCKER_PATH/source/lib/Room.js
cp -f Room.js $WEBRTC_DOCKER_PATH/source/lib/Room.js
else
diff Room.js $WEBRTC_DOCKER_PATH/source/lib/Room.js
if [ $? -ne 0 ]; then
update=1
cp Room.js $WEBRTC_DOCKER_PATH/source/lib/Room.js
cp -f Room.js $WEBRTC_DOCKER_PATH/source/lib/Room.js
fi
fi
if [[ $update -eq 1 ]]; then
Expand Down

0 comments on commit e82db02

Please sign in to comment.