Compare commits

...

22 Commits

Author SHA1 Message Date
dexter
c6257a560f 修正AutoCloseAfter配置名 2022-04-27 10:31:52 +08:00
dexter
3b3ffc18aa Merge pull request #47 from dwdcth/3.0
3.0 去除windows arm64
2022-04-25 09:23:29 +08:00
dwdcth
938bd92dca ignore 2022-04-24 11:11:44 +08:00
dwdcth
0c10c07be1 去掉windows arm 2022-04-24 10:27:50 +08:00
dexter
65d6f5c33e Merge pull request #45 from dwdcth/HEAD
windows arm64
2022-04-24 09:39:35 +08:00
dwdcth
08c871653d windows arm64 2022-04-23 21:50:57 +08:00
dexter
8bae7cace2 自动编译修改go版本号到1.18 2022-04-22 19:42:04 +08:00
dexter
133bf6eaa3 更新gb插件和gateway插件 2022-04-22 19:34:26 +08:00
dexter
d2d09b0386 Merge pull request #41 from dwdcth/3.0
修复ci
2022-04-17 15:10:06 +08:00
banshan
668c1318c2 add arm 2022-04-17 14:46:00 +08:00
banshan
dc4cf67705 add arm 2022-04-17 14:39:33 +08:00
banshan
f3de8f2864 go.yml 2022-04-17 13:30:09 +08:00
dexter
9e876fb424 Update go.yml 2022-04-17 12:16:45 +08:00
dexter
7533d83ae7 Merge pull request #40 from dwdcth/3.0
goreleaser ci
2022-04-17 11:42:02 +08:00
dwdcth
69a61a77bd goreleaser ci 2022-04-13 16:54:34 +08:00
dexter
727d083079 Merge pull request #39 from dwdcth/3.0
替换图标
2022-04-10 10:50:43 +08:00
banshan
4d8f4db08b 替换新图标 2022-04-10 10:14:41 +08:00
banshan
c01e148f84 rename syso 2022-04-10 09:57:51 +08:00
dexter
8d0b344859 更新版本 2022-04-01 21:15:15 +08:00
dexter
0faada1a13 UI增加视频广场,GB彻底重写,rtsp修复bug,engine消除内存泄露 2022-02-24 11:35:04 +08:00
dexter
3ffa4ab8b6 Merge pull request #30 from pdnews/3.0
添加 Dockerfile,并更新 Readme
2022-02-02 09:21:13 +08:00
杨树海
ac742d07cf 添加 Dockerfile,并更新 Readme 2022-02-01 21:19:44 +08:00
11 changed files with 195 additions and 95 deletions

138
.github/workflows/go.yml vendored Normal file → Executable file
View File

@@ -3,90 +3,84 @@ name: Go
on:
create:
tags:
- v*
- v3*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: go build -o m7s_linux_x86_64
- name: Tar
run: tar -zcvf linux.tgz m7s_linux_x86_64 config.toml
- name: Deploy
uses: garygrossgarten/github-action-scp@release
with:
local: /home/runner/work/monibuca/monibuca/linux.tgz
remote: /opt/dexter/linux.tgz
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: "linux.tgz"
build2:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: go build -o m7s_x86_64.exe
- name: Tar
run: tar -zcvf windows.tgz m7s_x86_64.exe config.toml
- name: Deploy
uses: garygrossgarten/github-action-scp@release
with:
local: D:\\a\\monibuca\\monibuca\\windows.tgz
remote: /opt/dexter/windows.tgz
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: "windows.tgz"
build3:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set up Env
run: echo "version=${GITHUB_REF:11}" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.18
- name: Build
run: go build -o m7s_darwin_x86_64
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: runner.osgo{ { hashFiles('**/go.sum') } }
restore-keys: ${{ runner.os }}-go-
- name: Tar
run: tar -zcvf mac.tgz m7s_darwin_x86_64 config.toml
- name: Deploy
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy Windows
uses: garygrossgarten/github-action-scp@release
with:
local: /Users/runner/work/monibuca/monibuca/mac.tgz
remote: /opt/dexter/mac.tgz
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}
- name: Release
uses: softprops/action-gh-release@v1
local: dist/m7s_${{ env.version }}_windows_amd64.tar.gz
remote: /opt/dexter/windows.tgz
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}
- name: Deploy Mac
uses: garygrossgarten/github-action-scp@release
with:
files: "mac.tgz"
local: dist/m7s_${{ env.version }}_darwin_amd64.tar.gz
remote: /opt/dexter/mac.tgz
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}
- name: Deploy Mac arm64
uses: garygrossgarten/github-action-scp@release
with:
local: dist/m7s_${{ env.version }}_darwin_arm64.tar.gz
remote: /opt/dexter/mac_arm64.tgz
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}
- name: Deploy Linux
uses: garygrossgarten/github-action-scp@release
with:
local: dist/m7s_${{ env.version }}_linux_amd64.tar.gz
remote: /opt/dexter/linux.tgz
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}
- name: Deploy Linux arm64
uses: garygrossgarten/github-action-scp@release
with:
local: dist/m7s_${{ env.version }}_linux_arm64.tar.gz
remote: /opt/dexter/linux_arm64.tgz
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}

4
.gitignore vendored
View File

@@ -7,4 +7,6 @@ resource
node_modules
shutdown.bat
shutdown.sh
.m7s
.m7s
debug.go
dist/

View File

@@ -67,8 +67,16 @@ to submit your own plugin
|hls||✔|✔|
|ws-flv|||✔|
|webrtc|✔||✔
# Documentation
# Build & Test with docker
> development and testing only: IP and udp ports need to be exposed carefully in production.
```shell
docker build . -f dockerfile -t m7s:3.0
docker run --name m7s -p 1935:1935 -p 8081:8081 -p 8082:8082 -p 554:554 m7s:3.0
```
# Documentation
中文文档:
[http://docs.monibuca.com](http://docs.monibuca.com).

View File

@@ -47,6 +47,14 @@ bash <(curl -s -S -L https://monibuca.com/demo.sh)
功能强大的仪表盘可以直观的看到服务器运行的状态、消耗的资源、以及其他统计信息。用户可以利用控制台对服务器进行配置和控制。
# 在 Docker 中编译和测试
> 生产服务需要暴露IP和大量端口建议容器仅用于开发和测试
```shell
docker build . -f dockerfile -t m7s:3.0
docker run --name m7s -p 1935:1935 -p 8081:8081 -p 8082:8082 -p 554:554 m7s:3.0
```
# 交流微信群
进入网站首页上进行扫码

View File

@@ -4,7 +4,7 @@ EnableVideo = true
# 发布流默认过期时间单位秒
PublishTimeout = 60
# 自动关闭触发后延迟的秒数(期间内如果有新的订阅则取消触发关闭)
AutoCloseDelay = 10
AutoCloseAfter = 10
# RTP包乱序重排
RTPReorder = false
[Summary]

46
dockerfile Normal file
View File

@@ -0,0 +1,46 @@
FROM golang:1.17.0-alpine3.14 as builder
LABEL maintainer="yangshuhai@pdnews.cn"
WORKDIR /app
# 先装好基础依赖,减少在代码变化时的重复构建时间
RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.14/main" > /etc/apk/repositories
RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.14/community" >> /etc/apk/repositories
RUN apk add --no-cache --update autoconf automake make gcc g++
RUN go env -w GO111MODULE=on
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go get -d github.com/Monibuca/engine/v3@v3.4.7
RUN go get -d github.com/Monibuca/plugin-gateway/v3@v3.0.10
RUN go get -d github.com/Monibuca/plugin-gb28181/v3@v3.0.2
RUN go get -d github.com/Monibuca/plugin-hdl/v3@v3.0.5
RUN go get -d github.com/Monibuca/plugin-hls/v3@v3.0.6
RUN go get -d github.com/Monibuca/plugin-jessica/v3@v3.0.0
RUN go get -d github.com/Monibuca/plugin-logrotate/v3@v3.0.0
RUN go get -d github.com/Monibuca/plugin-record/v3@v3.0.0
RUN go get -d github.com/Monibuca/plugin-rtmp/v3@v3.0.1
RUN go get -d github.com/Monibuca/plugin-rtsp/v3@v3.0.7
RUN go get -d github.com/Monibuca/plugin-summary@v1.0.0
RUN go get -d github.com/Monibuca/plugin-ts/v3@v3.0.1
RUN go get -d github.com/Monibuca/plugin-webrtc/v3@v3.0.3
# 再复制代码进行编译,可节省大量构建时间
COPY . .
RUN go mod tidy
RUN GOOS=linux go build -o m7s
# 构建完成则将成品复制到新的镜像中,减小镜像大小,可以考虑添加 upx 进一步减少空间
FROM alpine:3.14
WORKDIR /app
COPY --from=builder /app/m7s /app/m7s
COPY config.toml /app/config.toml
RUN /app/m7s --help
EXPOSE 554
EXPOSE 1935
EXPOSE 5060
EXPOSE 8081
EXPOSE 8082
CMD ["/app/m7s", "-c", "/app/config.toml"]

14
go.mod
View File

@@ -3,20 +3,20 @@ module github.com/langhuihui/monibuca/v3
go 1.16
require (
github.com/Monibuca/engine/v3 v3.4.7
// github.com/Monibuca/plugin-ffmpeg v0.0.2
github.com/Monibuca/plugin-gateway/v3 v3.0.10
github.com/Monibuca/plugin-gb28181/v3 v3.0.2
github.com/Monibuca/plugin-hdl/v3 v3.0.5
github.com/Monibuca/engine/v3 v3.5.1
github.com/Monibuca/plugin-gateway/v3 v3.0.14
github.com/Monibuca/plugin-gb28181/v3 v3.0.8
github.com/Monibuca/plugin-hdl/v3 v3.0.7
github.com/Monibuca/plugin-hls/v3 v3.0.6
github.com/Monibuca/plugin-jessica/v3 v3.0.0
github.com/Monibuca/plugin-logrotate/v3 v3.0.0
github.com/Monibuca/plugin-record/v3 v3.0.0
github.com/Monibuca/plugin-rtmp/v3 v3.0.1
github.com/Monibuca/plugin-rtsp/v3 v3.0.7
github.com/Monibuca/plugin-rtmp/v3 v3.0.3
github.com/Monibuca/plugin-rtsp/v3 v3.0.8
github.com/Monibuca/plugin-summary v1.0.0
github.com/Monibuca/plugin-ts/v3 v3.0.1
github.com/Monibuca/plugin-webrtc/v3 v3.0.3
github.com/Monibuca/utils/v3 v3.0.6 // indirect
)
// replace github.com/Monibuca/plugin-ffmpeg => ../plugin-ffmpeg

30
go.sum
View File

@@ -4,14 +4,15 @@ github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
github.com/Monibuca/engine/v3 v3.1.0/go.mod h1:yz6cssED2VlYu+g/LrxseBB9pcvsLM/o2QXa4gVY650=
github.com/Monibuca/engine/v3 v3.4.1/go.mod h1:rgAUey5ziRhlh6WugWyA5fYKyGOvcwhtTMDk4sukE7E=
github.com/Monibuca/engine/v3 v3.4.5/go.mod h1:Dik9pFxU9TFI5vj8Sv5QXZM+ooCs2fm9P7Uhe4yYNkQ=
github.com/Monibuca/engine/v3 v3.4.7 h1:Umhn6Pxt04bNZ98A6W88PsSKK5hdmMnw9/gT1p9Mk18=
github.com/Monibuca/engine/v3 v3.4.7/go.mod h1:Dik9pFxU9TFI5vj8Sv5QXZM+ooCs2fm9P7Uhe4yYNkQ=
github.com/Monibuca/plugin-gateway/v3 v3.0.10 h1:lG3RoF6D7n1eqChiug1YzSof92Jn5mIQngNt50Acnso=
github.com/Monibuca/plugin-gateway/v3 v3.0.10/go.mod h1:Pw5seYubBswGoF4knryLbLp6qrkYPwg3a7ZupgOir/4=
github.com/Monibuca/plugin-gb28181/v3 v3.0.2 h1:kATCWXuCLHZZfSkRbkIRxbzaH5HU/HJzrHZtKDKENeE=
github.com/Monibuca/plugin-gb28181/v3 v3.0.2/go.mod h1:CkJw4xFfaAhL22NIsGO2bcKEf7SHWxwK6VJdk7M1X60=
github.com/Monibuca/plugin-hdl/v3 v3.0.5 h1:D7DO1a4wdNIQw5grcrSuIu2TMBTk7hTlNJjxEsMbvSE=
github.com/Monibuca/plugin-hdl/v3 v3.0.5/go.mod h1:ImBolaupuPvXGoWD5hOUUMvSPPuzrg2lzVWqhcXmdVA=
github.com/Monibuca/engine/v3 v3.5.0/go.mod h1:yNiVKeHxgv+Ez+f2RHXMkXoa5Oxv+G7Ch+MJdHi7ing=
github.com/Monibuca/engine/v3 v3.5.1 h1:3AX+FwxerMw3JuyGXIOd/1dYCjA3IzWLKH/zq/GWe20=
github.com/Monibuca/engine/v3 v3.5.1/go.mod h1:yNiVKeHxgv+Ez+f2RHXMkXoa5Oxv+G7Ch+MJdHi7ing=
github.com/Monibuca/plugin-gateway/v3 v3.0.14 h1:gCQyOmdhOSNi8SMPcm11eT2P/Qi1tPzOaAX450F/gK4=
github.com/Monibuca/plugin-gateway/v3 v3.0.14/go.mod h1:Pw5seYubBswGoF4knryLbLp6qrkYPwg3a7ZupgOir/4=
github.com/Monibuca/plugin-gb28181/v3 v3.0.8 h1:UMLoxZfIqsyV/vBldx0lt0LU5i2jvlMB8Yboms9vvKA=
github.com/Monibuca/plugin-gb28181/v3 v3.0.8/go.mod h1:EIu6vD1irPweLcA+1dC4k05wVe6ygYn6ErMfEx+UYPo=
github.com/Monibuca/plugin-hdl/v3 v3.0.7 h1:caNQwYzOVYgAxGksTEYVey9LW/7v1VlvgwSYqANHlZ0=
github.com/Monibuca/plugin-hdl/v3 v3.0.7/go.mod h1:ImBolaupuPvXGoWD5hOUUMvSPPuzrg2lzVWqhcXmdVA=
github.com/Monibuca/plugin-hls/v3 v3.0.6 h1:WfM9BeTnezQJK6WmC40A3yyxXXGFqJNMePvcjKtYa+M=
github.com/Monibuca/plugin-hls/v3 v3.0.6/go.mod h1:HRfFcEfpBZYrbtj4j46wLhYuAcZdTukzpw87CLf8FcE=
github.com/Monibuca/plugin-jessica/v3 v3.0.0 h1:ArSiHOHfcekBfUOJMFZ0IJSbP/B1TnvcC5gegTpcbDw=
@@ -20,10 +21,10 @@ github.com/Monibuca/plugin-logrotate/v3 v3.0.0 h1:lWLgfKx2tVmXomzmZNACDzl/8HCHAk
github.com/Monibuca/plugin-logrotate/v3 v3.0.0/go.mod h1:OltyTXYmIGyUaZap+/qyEm87HVmn14PzEUCtAmNAUUg=
github.com/Monibuca/plugin-record/v3 v3.0.0 h1:449s+La2O5in0jaIdA94iK3QIS1s+G73VQXeLUiciN0=
github.com/Monibuca/plugin-record/v3 v3.0.0/go.mod h1:71pviyOflKsNq+ijPKOgcsKqZkvZ91PzJxLJWPDzYe0=
github.com/Monibuca/plugin-rtmp/v3 v3.0.1 h1:ZnklWGgblcD2a+siTgK84VLm6rJ445VzFuZia1Gea4k=
github.com/Monibuca/plugin-rtmp/v3 v3.0.1/go.mod h1:subd/7X5wcPbt5PDc0tbJ9RqNkvnrLJGj05RsYw25A8=
github.com/Monibuca/plugin-rtsp/v3 v3.0.7 h1:+FwpYGOgkHOaW12LGAlzwV2C0MkHFjay9pt2yIUvJBY=
github.com/Monibuca/plugin-rtsp/v3 v3.0.7/go.mod h1:byXGE5BxFv0RpcoOjcQRt7B7mZvrgNuVpRn0kJtFIkU=
github.com/Monibuca/plugin-rtmp/v3 v3.0.3 h1:pXVmMwZ8yb2eoiOm3PGSCr7C9D6MtfTG4ghIH3oJte0=
github.com/Monibuca/plugin-rtmp/v3 v3.0.3/go.mod h1:subd/7X5wcPbt5PDc0tbJ9RqNkvnrLJGj05RsYw25A8=
github.com/Monibuca/plugin-rtsp/v3 v3.0.8 h1:wKGcTxwyZdG63AR5ZW9M5vYfUvMHY/iwmsq56XibEfQ=
github.com/Monibuca/plugin-rtsp/v3 v3.0.8/go.mod h1:byXGE5BxFv0RpcoOjcQRt7B7mZvrgNuVpRn0kJtFIkU=
github.com/Monibuca/plugin-summary v1.0.0 h1:tWL7KWw5mcep2jAhG3Gzd1DCiLSyCl3u3nmJtYkqGFA=
github.com/Monibuca/plugin-summary v1.0.0/go.mod h1:rpSCVcPrecGlgT+aoCYsA6MawsE6ELT2mMGYYlSfTWo=
github.com/Monibuca/plugin-ts/v3 v3.0.0/go.mod h1:S+sUqUbZTiRws/GHoxcVVQdhOcuUQUxoAGDeQOAgKw0=
@@ -32,14 +33,17 @@ github.com/Monibuca/plugin-ts/v3 v3.0.1/go.mod h1:Xndravs2PFGXHr4ZtAZ+azPBjDBBTB
github.com/Monibuca/plugin-webrtc/v3 v3.0.3 h1:MWIQEZwIlxlruEU5rxiH7KhhKyCp3fZf0qrxF2gFd7Y=
github.com/Monibuca/plugin-webrtc/v3 v3.0.3/go.mod h1:eH8O1nvkxpHJVmasyXK1r/oOsAuXdwQ8TvkyVLR5Crg=
github.com/Monibuca/utils/v3 v3.0.0/go.mod h1:RpNS95gapWs6gimwh8Xn2x72FN5tO7Powabj7dTFyvE=
github.com/Monibuca/utils/v3 v3.0.5 h1:w14x0HkWTbF4MmHbINLlOwe4VJNoSOeaQChMk5E/4es=
github.com/Monibuca/utils/v3 v3.0.5/go.mod h1:RpNS95gapWs6gimwh8Xn2x72FN5tO7Powabj7dTFyvE=
github.com/Monibuca/utils/v3 v3.0.6 h1:Ya1KjxmirzHnaLneOgbopzMm9NhJtZxD4XqePefOYZw=
github.com/Monibuca/utils/v3 v3.0.6/go.mod h1:RpNS95gapWs6gimwh8Xn2x72FN5tO7Powabj7dTFyvE=
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/agiledragon/gomonkey/v2 v2.2.0 h1:QJWqpdEhGV/JJy70sZ/LDnhbSlMrqHAWHcNOjz1kyuI=
github.com/agiledragon/gomonkey/v2 v2.2.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/aler9/gortsplib v0.0.0-20211212220644-6f374e396529 h1:j2tfs+eUubyZnuwmYWzK+IS681IixfUyD8bivz4sqAw=
github.com/aler9/gortsplib v0.0.0-20211212220644-6f374e396529/go.mod h1:fyQrQyHo8QvdR/h357tkv1g36VesZlzEPsdAu2VrHHc=
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM=
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII=
github.com/asticode/go-astikit v0.20.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
github.com/asticode/go-astits v1.10.0/go.mod h1:DkOWmBNQpnr9mv24KfZjq4JawCFX1FCqjLVGvO0DygQ=
github.com/cnotch/apirouter v0.0.0-20200731232942-89e243a791f3/go.mod h1:5deJPLON/x/s2dLOQfuKS0lenhOIT4xX0pvtN/OEIuY=

38
goreleaser.yml Executable file
View File

@@ -0,0 +1,38 @@
project_name: m7s
archives:
-
files:
- config.toml
builds:
- env: [CGO_ENABLED=0]
ignore:
- goos: windows
goarch: arm64
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
#dockers:
# - image_templates: ["ghcr.io/goreleaser/example:{{ .Version }}"]
# dockerfile: Dockerfile
# build_flag_templates:
# - --label=org.opencontainers.image.title={{ .ProjectName }}
# - --label=org.opencontainers.image.description={{ .ProjectName }}
# - --label=org.opencontainers.image.url=https://github.com/goreleaser/example
# - --label=org.opencontainers.image.source=https://github.com/goreleaser/example
# - --label=org.opencontainers.image.version={{ .Version }}
# - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
# - --label=org.opencontainers.image.revision={{ .FullCommit }}
# - --label=org.opencontainers.image.licenses=MIT
#nfpms:
# - maintainer: Carlos A Becker <root@carlosbecker.dev>
# description: Sample project.
# homepage: https://github.com/caarlos0/tasktimer
# license: MIT
# formats:
# - deb
# - rpm
# - apk

Binary file not shown.

BIN
monibuca_windows_amd64.syso Normal file

Binary file not shown.