Browse Source

更新docker,更新readme

pull/174/head
648540858 3 years ago
parent
commit
77bf85342b
  1. 131
      DOCKERFILE
  2. 6
      README.md
  3. 9
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java
  4. 2
      src/main/resources/application-dev.yml

131
DOCKERFILE

@ -1,32 +1,131 @@
FROM ubuntu:19.10 FROM ubuntu:20.04 AS build
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
EXPOSE 18080/tcp EXPOSE 18080/tcp
EXPOSE 5060/tcp EXPOSE 5060/tcp
EXPOSE 5060/udp
EXPOSE 6379/tcp
EXPOSE 18081/tcp
EXPOSE 80/tcp
EXPOSE 1935/tcp
EXPOSE 554/tcp
EXPOSE 554/udp
EXPOSE 30000-30500/tcp
EXPOSE 30000-30500/udp
ENV LC_ALL zh_CN.UTF-8
# 使用了自己的settings.xml作为maven的源,加快打包速度 # 使用了自己的settings.xml作为maven的源,加快打包速度
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends openjdk-11-jre git maven nodejs npm && \ DEBIAN_FRONTEND="noninteractive" && \
cd /home && \ apt-get install -y --no-install-recommends openjdk-11-jre git maven nodejs npm build-essential tcl language-pack-zh-hans \
git clone https://github.com/648540858/wiki.git && \ cmake curl vim ca-certificates tzdata libmysqlclient-dev redis-server libssl-dev libx264-dev libfaac-dev ffmpeg
cp wiki/config/settings.xml /usr/share/maven/conf/ && \ WORKDIR /home
git clone https://github.com/648540858/wvp-GB28181.git && \
cd /home/wvp-GB28181/web_src && \ RUN git clone https://gitee.com/18010473990/maven.git && \
npm install npm -g && \ cp maven/settings.xml /usr/share/maven/conf/ && \
npm install nrm -g && \ git clone https://gitee.com/18010473990/wvp-GB28181.git && \
nrm use taobao && \ git clone https://gitee.com/18010473990/wvp-pro-assist.git
npm install && \ # 编译前端界面
WORKDIR /home/wvp-GB28181/web_src
RUN npm install && \
npm run build && \ npm run build && \
mkdir -p /opt/wvp/config && \ mkdir -p /opt/wvp/config && \
cd /home/wvp-GB28181 && \ mkdir -p /opt/assist/config && \
mvn compile && \ cp /home/wvp-GB28181/src/main/resources/application-dev.yml /opt/wvp/config/application.yml && \
cp /home/wvp-pro-assist/src/main/resources/application-dev.yml /opt/assist/config/application.yml
RUN npm install && \
npm run build && \
mkdir -p /opt/wvp/config && \
cp /home/wvp-GB28181/src/main/resources/application-dev.yml /opt/wvp/config/application.yml
# wvp打包
WORKDIR /home/wvp-GB28181
RUN mvn compile && \
mvn package && \ mvn package && \
cp /home/wvp-GB28181/target/wvp-1.5.10.RELEASE.jar /opt/wvp/ && \ cp /home/wvp-GB28181/target/wvp*.jar /opt/wvp/
rm -rf /home/wiki && \
# wvp 录像管理打包
WORKDIR /home/wvp-pro-assist
RUN mvn compile && \
mvn package && \
cp /home/wvp-pro-assist/target/*.jar /opt/assist/
# zlm打包
WORKDIR /home
RUN mkdir -p /opt/media && \
git clone --depth=1 https://gitee.com/xia-chu/ZLMediaKit && \
cd ZLMediaKit && git submodule update --init --recursive && \
mkdir -p build release/linux/Release/ &&\
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \
cp -r ../release/linux/Release/* /opt/media && \
mkdir -p /opt/media/www/record
# 清理
RUN rm -rf /home/wiki && \
rm -rf /home/wvp-GB28181 && \ rm -rf /home/wvp-GB28181 && \
apt-get autoremove -y git maven nodejs npm && \ apt-get autoremove -y git maven nodejs npm && \
apt-get clean -y && \ apt-get clean -y && \
rm -rf /var/lib/apt/lists/*dic rm -rf /var/lib/apt/lists/*dic
WORKDIR /opt/wvp WORKDIR /opt/wvp
RUN echo '#!/bin/bash' > run.sh && \
echo 'echo ${WVP_IP}' >> run.sh && \
echo 'echo ${WVP_CONFIG}' >> run.sh && \
echo 'redis-server --daemonize yes --bind 0.0.0.0' >> run.sh && \
echo 'cd /opt/assist' >> run.sh && \
echo 'nohup java -jar *.jar --userSettings.record=/opt/media/www/record/ &' >> run.sh && \
echo 'nohup /opt/media/MediaServer -d -m 3 &' >> run.sh && \
echo 'cd /opt/wvp' >> run.sh && \
echo 'if [${WVP_CONFIG}]; then' >> run.sh && \
echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \
echo 'else' >> run.sh && \
echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 --media.ip=127.0.0.1 --media.sdp-ip=${WVP_IP} --sip.ip=${WVP_IP} --media.stream-ip=${WVP_IP}' >> run.sh && \
echo 'fi' >> run.sh
RUN chmod +x run.sh
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
EXPOSE 18080/tcp
EXPOSE 5060/tcp
EXPOSE 5060/udp
CMD java -jar wvp-1.5.10.RELEASE.jar --spring.config.location=/opt/wvp/config/application.yml EXPOSE 6379/tcp
EXPOSE 18081/tcp
EXPOSE 80/tcp
EXPOSE 1935/tcp
EXPOSE 554/tcp
EXPOSE 554/udp
EXPOSE 30000-30500/tcp
EXPOSE 30000-30500/udp
ENV LC_ALL zh_CN.UTF-8
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" && \
apt-get install -y --no-install-recommends openjdk-11-jre tcl language-pack-zh-hans \
ca-certificates tzdata libmysqlclient21 redis-server libssl1.1 libx264-155 libfaac0 ffmpeg && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*dic
WORKDIR /opt/wvp
COPY --from=build /opt /opt
CMD ["sh", "run.sh"]

6
README.md

@ -13,7 +13,13 @@ WEB VIDEO PLATFORM是一个基于GB28181-2016标准实现的开箱即用的网
流媒体服务基于ZLMediaKit-https://github.com/xiongziliang/ZLMediaKit 流媒体服务基于ZLMediaKit-https://github.com/xiongziliang/ZLMediaKit
前端页面基于MediaServerUI进行修改. 前端页面基于MediaServerUI进行修改.
# 快速体验
```shell
docker pull 648540858/wvp_pro
docker run --env WVP_IP="你的IP" -it -p 18080:18080 -p 30000-30500:30000-30500/udp -p 30000-30500:30000-30500/tcp -p 80:80 -p 5060:5060 -p 5060:5060/udp wvp_pro
```
docker使用详情查看:[https://hub.docker.com/r/648540858/wvp_pro](https://hub.docker.com/r/648540858/wvp_pro)
# 应用场景: # 应用场景:
支持浏览器无插件播放摄像头视频。 支持浏览器无插件播放摄像头视频。
支持摄像机、平台、NVR等设备接入。 支持摄像机、平台、NVR等设备接入。

9
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java

@ -87,12 +87,8 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor {
// 未携带授权头或者密码错误 回复401 // 未携带授权头或者密码错误 回复401
if (authorhead == null ) { if (authorhead == null ) {
if (authorhead == null) { logger.info("[{}] 未携带授权头 回复401", requestAddress);
logger.info("[{}] 未携带授权头 回复401", requestAddress);
} else if (!passwordCorrect) {
logger.info("[{}] 密码错误 回复401", requestAddress);
}
response = getMessageFactory().createResponse(Response.UNAUTHORIZED, request); response = getMessageFactory().createResponse(Response.UNAUTHORIZED, request);
new DigestServerAuthenticationHelper().generateChallenge(getHeaderFactory(), response, sipConfig.getDomain()); new DigestServerAuthenticationHelper().generateChallenge(getHeaderFactory(), response, sipConfig.getDomain());
}else { }else {
@ -100,6 +96,7 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor {
// 注册失败 // 注册失败
response = getMessageFactory().createResponse(Response.FORBIDDEN, request); response = getMessageFactory().createResponse(Response.FORBIDDEN, request);
response.setReasonPhrase("wrong password"); response.setReasonPhrase("wrong password");
logger.info("[{}] 密码错误 回复403", requestAddress);
}else { }else {
// 携带授权头并且密码正确 // 携带授权头并且密码正确
response = getMessageFactory().createResponse(Response.OK, request); response = getMessageFactory().createResponse(Response.OK, request);

2
src/main/resources/application-dev.yml

@ -52,7 +52,7 @@ sip:
#zlm 默认服务器配置 #zlm 默认服务器配置
media: media:
# [必须修改] zlm服务器的内网IP # [必须修改] zlm服务器的内网IP
ip: 192.168.0.100 ip: 127.0.0.1
# [必须修改] zlm服务器的http.port # [必须修改] zlm服务器的http.port
http-port: 80 http-port: 80
# [可选] zlm服务器的hook.admin_params=secret # [可选] zlm服务器的hook.admin_params=secret

Loading…
Cancel
Save