https://blog.iamtsm.cn c10d193615 feat: docker suppose coturn image
feat: push to dockerhub shell update
fix: docker-compose.yml bugs
2023-08-10 18:31:43 +08:00
2023-08-10 18:31:43 +08:00
2023-08-10 18:31:43 +08:00
2023-08-10 18:31:43 +08:00
doc
2023-04-24 13:05:54 +08:00
2023-08-05 01:50:49 +08:00
2023-06-02 00:16:39 +08:00
2023-06-02 00:16:39 +08:00
2023-07-16 12:40:44 +08:00

tl-rtc-file-tool【始于文件传输不止于文件传输】

体验地址 DockerHub EN-DOC

QQ群: 624214498

目录

背景 20年毕设的题目相关整理出来的

简介 tl webrtc datachannel filetools用webrt在web端传输文件支持传输超大文件。

优点 分片传输跨终端不限平台方便使用内网不限速局域网最高到过70多M/s支持私有部署支持多文件拖拽发送网页文件预览

扩展 扩展了许多丰富的小功能,如本地屏幕录制,远程屏幕共享(无延迟),远程音视频通话(无延迟),直播(无延迟)密码房间oss云存储中继服务设置webrtc检测webrtc统计文字传输(群聊,私聊)公共聊天远程画板AI聊天框丰富的后台管理实时执行日志展示机器人告警通知等功能... 等等

准备 (必须步骤)

1.安装node-14.21.x或14.21.x以上npm后进入项目目录运行下面命令

`cd svr/`

`npm install`

2.首次运行/自行开发页面,用下面两个命令之一即可

`npm run build:dev`  (如果你需要自己开发/修改前端页面,用这个命令)

`npm run build:pro`  (不需要开发/修改前端页面,用这个命令)

3.修改 tlrtcfile.env 配置文件

配置websocket (必须步骤)

修改 tlrtcfile.env 中相应websocket配置

## websocket服务端口
tl_rtc_file_ws_port=8444

## websocket服务地址
## "ws://域名 或者 ip:port 或者 域名:port"
## socket ip  填局域网ip/公网ip, 局域网ip只能在局域网访问公网ip可在公网访问
tl_rtc_file_ws_host=ws://127.0.0.1:8444

启动 (必须步骤)

启动以下两个服务, 选一种模式启动即可两者的区别就是https环境启动才可以使用音视频,直播,屏幕共享功能,其他功能不影响

http模式启动后访问 http://你的机器ip:9092 即可

api服务: `npm run http-api`

socket服务 : `npm run http-socket`

https模式启动后访问 https://你的机器ip:9092 即可

api服务: `npm run https-api`

socket服务 : `npm run https-socket`

配置数据库 (非必须步骤)

修改 tlrtcfile.env 中的数据库相关配置即可

## 是否开启数据库
tl_rtc_file_db_open=false
## 数据库地址
tl_rtc_file_db_mysql_host=mysql
## 数据库端口
tl_rtc_file_db_mysql_port=3306
## 数据库名称
tl_rtc_file_db_mysql_dbName=webchat
## 数据库用户名
tl_rtc_file_db_mysql_user=tlrtcfile
## 数据库密码
tl_rtc_file_db_mysql_password=tlrtcfile

管理后台 (非必须步骤)

前提 : 需要开启数据库配置

修改 tlrtcfile.env 中的管理后台相关配置即可, 启动后,输入配置的房间号,输入密码,即可进入管理后台

## 管理后台房间号
tl_rtc_file_manage_room=tlrtcfile
## 管理后台密码
tl_rtc_file_manage_password=tlrtcfile

企微通知 (非必须步骤)

修改 tlrtcfile.env 中的企业微信通知相关配置即可

# ## 企业微信通知开关
tl_rtc_file_notify_open=false
## 企业微信通知机器人KEY正常通知如果有多个key逗号分隔
tl_rtc_file_notify_qiwei_normal=
## 企业微信通知机器人KEY错误通知如果有多个key逗号分隔
tl_rtc_file_notify_qiwei_error=

OSS云存储 (非必须步骤)

修改 tlrtcfile.env 中的OSS存储相关配置即可

## oss-seafile存储库ID
tl_rtc_file_oss_seafile_repoid=
## oss-seafile地址
tl_rtc_file_oss_seafile_host=
## oss-seafile用户名
tl_rtc_file_oss_seafile_username=
## oss-seafile密码
tl_rtc_file_oss_seafile_password=

## oss-alyun存储accessKey
tl_rtc_file_oss_alyun_AccessKey=
## oss-aly存储SecretKey
tl_rtc_file_oss_alyun_Secretkey=
## oss-aly存储bucket
tl_rtc_file_oss_alyun_bucket=

## oss-txyun存储accessKey
tl_rtc_file_oss_txyun_AccessKey=
## oss-txyunt存储SecretKey
tl_rtc_file_oss_txyun_Secretkey=
## oss-txyun存储bucket
tl_rtc_file_oss_txyun_bucket=

## oss-qiniuyun存储accessKey
tl_rtc_file_oss_qiniuyun_AccessKey=
## oss-qiniuyunt存储SecretKey
tl_rtc_file_oss_qiniuyun_Secretkey==
## oss-qiniuyun存储bucket
tl_rtc_file_oss_qiniuyun_bucket=

Chat-GPT (非必须步骤)

修改 tlrtcfile.env 中的openai相关配置即可

## openai-key如果有多个key逗号分隔
tl_rtc_file_openai_keys=

配置turnserver (局域网非必须步骤,公网必须步骤)

目前有两种形式去生成使用turn服务的帐号密码一种是固定帐号密码 (优先推荐),一种是有效期帐号密码。选一种方式即可

ubuntu示例:

安装coturn  `sudo apt-get install coturn`

有效帐号密码 : docker/coturn/turnserver-with-secret-user.conf

1. 修改 `listening-device`, `listening-ip`, `external-ip`, `static-auth-secret`, `realm` 几个字段即可

2. 启动turnserver 

`turnserver -c  /这个地方路径填完整/conf/turn/turnserver-with-secret-user.conf`

固定帐号密码 : docker/coturn/turnserver-with-fixed-user.conf

1. 修改 `listening-device`, `listening-ip`, `external-ip`, `user`, `realm` 几个字段即可

2. 生成用户 

`turnadmin -a -u 帐号 -p 密码 -r 这个地方填配置文件中的relam`

3. 启动turnserver  

`turnserver -c  /这个地方路径填完整/docker/coturn/turnserver-with-secret-user.conf`

部署好coturn后在对应的 tlrtcfile.env 配置中设置好webrtc相关信息即可

## webrtc-stun中继服务地址
tl_rtc_file_webrtc_stun_host=
## webrtc-turn中继服务地址
tl_rtc_file_webrtc_turn_host=
## webrtc中继服务用户名
tl_rtc_file_webrtc_turn_username=tlrtcfile
## webrtc中继服务密码
tl_rtc_file_webrtc_turn_credential=tlrtcfile
## webrtc中继服务Secret
tl_rtc_file_webrtc_turn_secret=tlrtcfile
## webrtc中继服务帐号过期时间 (毫秒)
tl_rtc_file_webrtc_turn_expire=86400000

Docker

目前支持 官方镜像自行打包镜像,使用官方镜像目前支持两种操作方式 docker脚本启动docker-compose启动

和自行在 服务器/电脑部署 不同的是docke环境默认开启数据库coturn服务无须过多额外操作启动即可用。

使用官方镜像(docker脚本启动) :

按需修改好 tlrtcfile.env 配置 (或使用默认配置也可) 后,进入 bin/ 目录执行脚本 auto-pull-and-start-docker.sh

1. chmod +x ./auto-pull-and-start-docker.sh

2. ./auto-pull-and-start-docker.sh

使用官方镜像(docker-compose启动) :

按需修改好 tlrtcfile.env 配置 (或使用默认配置也可) 后,在主目录执行

docker-compose --profile=http up -d

自行打包启动镜像(docker-compose打包启动) :

确认修改好 tlrtcfile.env 配置文件 (或使用默认配置也可) 后, 进入 docker/ 目录后执行

docker-compose -f docker-compose-build-code.yml up -d

其他形式部署

除了上面的手动安装docker官方镜像docker自己打包镜像之外还支持自动脚本托管平台一键部署等

下载项目后,可以进入 bin/ 目录,选择对应的系统脚本,直接执行即可

ubuntu自动脚本

1. chmod +x ./ubuntu/*.sh

2. cd ubuntu/

3. ./auto-check-install-http.sh 或者 ./auto-check-install-https.sh

windows自动脚本

windows/auto-check-install-http.bat 或者 windows/auto-check-install-https.bat 

zeabur平台一键部署

Deploy on Zeabur

概述图

image

License

免责声明

免责声明

Description
WebRTC P2P在线网络媒体流工具(用于文件、视频、屏幕、直播、文本),具有管理和统计监控功能。
Readme MIT 33 MiB
Languages
JavaScript 68.4%
HTML 17.3%
TypeScript 4%
CSS 3.6%
Shell 3.3%
Other 3.4%