From 4d34d51f404a4024b2d0e6d68142adf2a2c4ca72 Mon Sep 17 00:00:00 2001 From: "https://blog.iamtsm.cn" <1905333456@qq.com> Date: Wed, 16 Aug 2023 20:25:51 +0800 Subject: [PATCH] feat: audio room feat: show room type feat: update doc fix: socket default host port err fix: log err --- README.md | 247 ++++++++------- doc/README_EN.md | 337 +++++++++------------ svr/conf/cfg.json | 2 +- svr/res/css/index.css | 15 + svr/res/index.html | 74 ++++- svr/res/js/audioShare.js | 192 ++++++++++++ svr/res/js/comm.js | 17 ++ svr/res/js/index.js | 200 +++++++++++- svr/res/js/language.js | 18 ++ svr/res/js/videoShare.js | 2 +- svr/src/bussiness/manage/settingPage.js | 5 + svr/src/bussiness/notify/notifyHandler.js | 31 ++ svr/src/controller/comm/comm.js | 2 +- svr/src/dao/room/room.js | 1 + svr/src/socket/rtcConstant.js | 4 + svr/src/socket/rtcCreateJoin/createJoin.js | 8 +- svr/src/socket/rtcMessage/message.js | 22 ++ svr/static/layui/font-ext/demo_index.html | 98 +++++- svr/static/layui/font-ext/iconfont.css | 22 +- svr/static/layui/font-ext/iconfont.js | 2 +- svr/static/layui/font-ext/iconfont.json | 28 ++ svr/static/layui/font-ext/iconfont.ttf | Bin 36356 -> 37592 bytes svr/static/layui/font-ext/iconfont.woff | Bin 21284 -> 22144 bytes svr/static/layui/font-ext/iconfont.woff2 | Bin 18196 -> 18840 bytes 24 files changed, 997 insertions(+), 330 deletions(-) create mode 100644 svr/res/js/audioShare.js diff --git a/README.md b/README.md index 38bf8d7..113ac7b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ [](https://github.com/iamtsm/tl-rtc-file/) [](https://github.com/iamtsm/tl-rtc-file/) -
体验地址 | DockerHub | @@ -16,171 +15,125 @@ ## 目录 -- [背景-简介](#背景-简介) -- [优点-扩展](#优点-扩展) -- [修改配置](#修改配置) +- [背景](#背景) +- [优点](#优点) +- [部署前必看](#部署前必看) - [自行部署](#自行部署) - [安装环境](#安装环境) - - [准备启动](#准备启动) - - [配置数据库 (非必须步骤)](#配置数据库-非必须步骤) - - [管理后台 (非必须步骤)](#管理后台-非必须步骤) - - [企微通知 (非必须步骤)](#企微通知-非必须步骤) - - [OSS云存储 (非必须步骤)](#oss云存储-非必须步骤) - - [Chat-GPT (非必须步骤)](#chat-gpt-非必须步骤) - - [配置turnserver (局域网非必须步骤,公网必须步骤)](#配置turnserver-局域网非必须步骤公网必须步骤) -- [Docker部署](#Docker部署) + - [启动服务](#启动服务) +- [docker部署](#docker部署) + - [docker一键脚本启动](#docker一键脚本启动) + - [docker-compose命令启动](#docker-compose启动) + - [自行打包镜像启动](#自行打包启动镜像) - [其他形式部署](#其他形式部署) +- [配置数据库 (非必须步骤)](#配置数据库-非必须步骤) +- [管理后台 (非必须步骤)](#管理后台-非必须步骤) +- [企微通知 (非必须步骤)](#企微通知-非必须步骤) +- [OSS云存储 (非必须步骤)](#oss云存储-非必须步骤) +- [Chat-GPT (非必须步骤)](#chat-gpt-非必须步骤) +- [配置turnserver (局域网非必须步骤,公网必须步骤)](#配置turnserver-局域网非必须步骤公网必须步骤) - [概述图](#概述图) - [License](#license) - [免责声明](#免责声明) -### 背景-简介 +## 背景 20年毕设的题目相关整理出来的,用webrt在web端传输文件,支持传输超大文件。 -### 优点-扩展 +## 优点 分片传输,跨终端,不限平台,方便使用,内网不限速(局域网最高到过70多M/s),支持私有部署,支持多文件拖拽发送,网页文件预览。 扩展了许多丰富的小功能,如本地屏幕录制,远程屏幕共享(无延迟),远程音视频通话(无延迟),直播(无延迟),密码房间,oss云存储,中继服务设置,webrtc检测,webrtc统计,文字传输(群聊,私聊),公共聊天,远程画板,AI聊天框,丰富的后台管理,实时执行日志展示,机器人告警通知等功能... 等等 -## 修改配置 +## 部署前必看 无论是自行部署,还是docker部署,还是其他脚本部署,都需要先行修改 `tlrtcfile.env` 中相应配置,再执行下面操作,且后续还需修改配置,需要重启服务 +当然,你也可以不修改配置,使用默认的配置,但是默认的配置仅限于可以在localhost测试使用,其他人访问不到也使用不了。所以如果是需要部署到服务器上给局域网或者公网其他用户使用,就必须按需设置好 `tlrtcfile.env` + + ## 自行部署 #### 安装环境 -1.安装node-14.21.x或14.21.x以上,npm后,进入项目目录运行下面命令 +安装node-14.21.x或14.21.x以上,npm后,进入项目目录运行下面命令 ``` cd svr/ + npm install ``` -2.首次运行/自行开发页面,用下面两个命令之一即可 +首次运行执行一次下面的命令 -`npm run build:dev` (如果你需要自己开发/修改前端页面,用这个命令) -`npm run build:pro` (不需要开发/修改前端页面,用这个命令) +``` +npm run build:pro +``` -3.修改 `tlrtcfile.env` 配置文件 +如果你需要自己开发/修改前端页面,用这个命令,不需要开发页面就跳过这一个 -#### 准备启动 +``` +npm run build:dev +``` + +#### 启动服务 启动以下两个服务, 选一种模式启动即可,两者的区别就是,https环境启动才可以使用音视频,直播,屏幕共享功能,其他功能不影响 -http模式启动后,访问 http://你的机器ip:9092 即可 +http模式启动后,访问 `http://你的机器ip:9092` -- api服务: `npm run http-api` -- socket服务 : `npm run http-socket` +- 启动api服务 和 socket服务 -https模式启动后,访问 https://你的机器ip:9092 即可 +``` +npm run http-api -- api服务: `npm run https-api` -- socket服务 : `npm run https-socket` - -#### 配置数据库 (非必须步骤) - -修改 `tlrtcfile.env` 中的数据库相关配置即可 - -#### 企微通知 (非必须步骤) - -修改 `tlrtcfile.env` 中的企业微信通知相关配置即可 - -#### OSS云存储 (非必须步骤) - -修改 `tlrtcfile.env` 中的OSS存储相关配置即可 - -#### Chat-GPT (非必须步骤) - -修改 `tlrtcfile.env` 中的openai相关配置即可 - -#### 管理后台 (非必须步骤) - -前提 : 需要开启数据库配置 - -修改 `tlrtcfile.env` 中的管理后台相关配置即可, 启动后,输入配置的房间号,输入密码,即可进入管理后台 - -#### 配置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 +npm run http-socket +``` -## Docker +或者使用https模式启动,访问 `https://你的机器ip:9092` + +- 启动api服务 和 socket服务 + +``` +npm run https-api + +npm run https-socket +``` + +## docker部署 目前支持 `官方镜像` 和 `自行打包镜像`,使用官方镜像目前支持两种操作方式 `docker脚本启动`,`docker-compose启动` +#### docker一键脚本启动 -和 `自行部署` 操作/配置上的差异有下面两点。 - -- [x] docker环境默认开启数据库,coturn服务 - -- [x] docker环境需要挂载coturn的配置,项目基础配置(tlrtcfile.env) - -由于是内置coturn和mysql服务,所以这两个相应的配置(可以在docker-compose.yml中找到具体配置文件位置),也需要在启动前修改好。 - -#### 使用官方镜像(docker脚本启动) : - -按需修改好 `tlrtcfile.env` 配置 (或使用默认配置也可) 后,进入 `bin/` 目录执行脚本 `auto-pull-and-start-docker.sh` +进入 `bin/` 目录执行脚本 `auto-pull-and-start-docker.sh` ``` chmod +x ./auto-pull-and-start-docker.sh + ./auto-pull-and-start-docker.sh ``` +#### docker-compose启动 -#### 使用官方镜像(docker-compose启动) : +根据你的 `Docker Compose` 版本在 `主目录` 执行如下对应的命令 -按需修改好 `tlrtcfile.env` 配置 (或使用默认配置也可) 后,根据你的`Docker Compose`版本在主目录执行如下对应的命令 - -- 对于`Docker Compose V1` +- 对于 `Docker Compose V1` ``` docker-compose --profile=http up -d ``` -- 对于`Docker Compose V2` +- 对于 `Docker Compose V2` ``` docker compose --profile=http up -d ``` -#### 自行打包启动镜像(docker-compose打包启动) : +#### 自行打包启动镜像 -确认修改好 `tlrtcfile.env` 配置文件 (或使用默认配置也可) 后, 进入 `docker/` 目录后根据你的`Docker Compose`版本在主目录执行如下对应的命令 +进入 `docker/` 目录后根据你的 `Docker Compose` 版本在主目录执行如下对应的命令 -- 对于`Docker Compose V1` +- 对于 `Docker Compose V1` ``` docker-compose -f docker-compose-build-code.yml up -d ``` -- 对于`Docker Compose V2` +- 对于 `Docker Compose V2` ``` docker compose -f docker-compose-build-code.yml up -d ``` @@ -191,32 +144,36 @@ docker compose -f docker-compose-build-code.yml up -d 下载项目后,可以进入 `bin/` 目录,选择对应的系统脚本,直接执行即可,会自动检测安装环境,自动安装依赖,自动启动服务 -**注意 : 执行之前可以先修改好 tlrtcfile.env 配置,如使用默认配置,后续修改需要重启两个服务才能生效**,重启可以先执行 `停止服务脚本`,然后再次执行 `自动脚本` 即可 - #### ubuntu自动脚本 (比如ubuntu16) +- 如果脚本没有执行权限,执行一下下面的命令 ``` chmod +x ./ubuntu16/*.sh +``` -cd ubuntu16/ - +- 使用 `http` 方式则是执行这个脚本 +``` ./auto-check-install-http.sh ``` -使用https方式则是执行这个脚本 + +- 或者使用 `https` 方式则是执行这个脚本 ``` ./auto-check-install-https.sh ``` -停止服务脚本 : + +- 停止服务脚本 : ``` ./auto-stop.sh ``` #### windows自动脚本 +- 使用 `http` 方式则是执行这个脚本 ``` windows/auto-check-install-http.bat ``` -或者使用https方式则是执行这个脚本 + +- 或者使用https方式则是执行这个脚本 ``` windows/auto-check-install-https.bat ``` @@ -226,6 +183,68 @@ windows/auto-check-install-https.bat [](https://zeabur.com/templates/898TLE?referralCode=iamtsm) +## 其他配置项 +#### 配置数据库 (非必须步骤) + +需要自行安装mysql数据库,新建一个数据库名称为 `webchat`,然后修改 `tlrtcfile.env` 中的数据库相关配置即可 + +#### 企微通知 (非必须步骤) + +如果需要设置一些访问通知,错误告警通知,可以在企业微信建立机器人后,每一个机器人会有一个key,修改 `tlrtcfile.env` 中的企业微信通知相关配置即可 + +#### OSS云存储 (非必须步骤) + +目前支持对接了seafile存储,后续会逐步支持阿里云,腾讯云,七牛云,自己的服务器等存储方式。 修改 `tlrtcfile.env` 中的OSS存储相关配置即可 + +#### Chat-GPT (非必须步骤) + +对接了openai的接口,内置了一个聊天对话框, 修改 `tlrtcfile.env` 中的openai相关配置即可 + +#### 管理后台 (非必须步骤) + +前提 : 需要开启数据库配置 + +修改 `tlrtcfile.env` 中的管理后台相关配置即可, 启动后,输入配置的房间号,输入密码,即可进入管理后台 + +#### 配置turnserver (局域网非必须步骤,公网必须步骤) + +目前有两种形式去生成使用turn服务的帐号密码,一种是固定帐号密码 (优先推荐),一种是有效期帐号密码。**选一种方式即可** ,以下以ubuntu示例 + +安装coturn + +``` +sudo apt-get install coturn +``` + +有效帐号密码模式配置文件 : `docker/coturn/turnserver-with-secret-user.conf` + +- 修改配置文件字段 +``` +`listening-device`, `listening-ip`, `external-ip`, `static-auth-secret`, `realm` +``` +- 启动turnserver + +``` +turnserver -c /这个地方路径填完整/conf/turn/turnserver-with-secret-user.conf +``` + +固定帐号密码模式配置文件 : `docker/coturn/turnserver-with-fixed-user.conf` + +- 修改配置文件字段 +``` +`listening-device`, `listening-ip`, `external-ip`, `user`, `realm` +``` +- 生成用户 +``` +turnadmin -a -u 帐号 -p 密码 -r 这个地方填配置文件中的relam +``` +- 启动turnserver +``` +turnserver -c /这个地方路径填完整/docker/coturn/turnserver-with-secret-user.conf +``` + +部署好coturn后,在对应的 `tlrtcfile.env` 配置中设置好webrtc相关信息即可 + ## 概述图  diff --git a/doc/README_EN.md b/doc/README_EN.md index 9056264..5c69734 100644 --- a/doc/README_EN.md +++ b/doc/README_EN.md @@ -1,4 +1,4 @@ -# tl-rtc-file-tool【Beyond File Transfer, Beyond Imagination】 +# tl-rtc-file-tool (tl webrtc file tools) [](https://webrtc.org.cn/) [](https://github.com/iamtsm/tl-rtc-file/) @@ -7,283 +7,232 @@ [](https://github.com/iamtsm/tl-rtc-file/)
-Experience | +Demo | DockerHub | -EN-DOC +EN-DOC | QQ Group: +624214498
-QQ Group: 624214498
- ## Table of Contents - [Background](#background) -- [Introduction](#introduction) - [Advantages](#advantages) -- [Extensions](#extensions) -- [Preparation (Essential Steps)](#preparation-essential-steps) -- [Configure Websocket (Essential Steps)](#configure-websocket-essential-steps) -- [Startup (Essential Steps)](#startup-essential-steps) -- [Configure Database (Non-Essential Steps)](#configure-database-non-essential-steps) -- [Admin Panel (Non-Essential Steps)](#admin-panel-non-essential-steps) -- [WeChat Work Notification (Non-Essential Steps)](#wechat-work-notification-non-essential-steps) -- [OSS Cloud Storage (Non-Essential Steps)](#oss-cloud-storage-non-essential-steps) -- [Chat-GPT (Non-Essential Steps)](#chat-gpt-non-essential-steps) -- [Configure Turn Server (LAN Non-Essential Steps, Internet Essential Steps)](#configure-turn-server-lan-non-essential-steps-internet-essential-steps) -- [Docker](#docker) +- [Pre-deployment Considerations](#pre-deployment-considerations) +- [Self-Deployment](#self-deployment) + - [Installing Dependencies](#installing-dependencies) + - [Starting the Service](#starting-the-service) +- [Docker Deployment](#docker-deployment) + - [One-Click Docker Script](#one-click-docker-script) + - [Using docker-compose](#using-docker-compose) + - [Self-Building and Starting the Image](#self-building-and-starting-the-image) - [Other Deployment Methods](#other-deployment-methods) +- [Configuring the Database (Optional)](#configuring-the-database-optional) +- [Admin Panel (Optional)](#admin-panel-optional) +- [WeChat Notifications (Optional)](#wechat-notifications-optional) +- [OSS Cloud Storage (Optional)](#oss-cloud-storage-optional) +- [Chat-GPT (Optional)](#chat-gpt-optional) +- [Configuring turnserver (Optional for LAN, Required for WAN)](#configuring-turnserver-optional-for-lan-required-for-wan) - [Overview Diagram](#overview-diagram) - [License](#license) - [Disclaimer](#disclaimer) -#### Background: Consolidated from the topic of the 20th-year graduation project +## Background -#### Introduction: (tl webrtc datachannel filetools) Transferring files on the web using WebRTC, supporting the transfer of very large files. +This project was developed based on the topic of the graduation project in 2020. It allows file transfer using WebRTC in web applications and supports transferring large files. -#### Advantages: Fragmented transmission, cross-device, cross-platform, easy to use, unlimited speed within the intranet (up to over 70MB/s in the LAN), supports private deployment, supports multi-file drag-and-drop sending, web file preview. +## Advantages -#### Extensions: Extends many rich features, such as local screen recording, remote screen sharing (no delay), remote audio and video calls (no delay), live streaming (no delay), password-protected rooms, OSS cloud storage, relay service settings, WebRTC detection, WebRTC statistics, text transmission (group chat, private chat), public chat, remote whiteboard, AI chatbox, rich backend management, real-time execution log display, robot alert notifications, and more... +Fragmented transmission, cross-platform, platform-independent, easy to use, no speed limit in the local network (up to over 70 MB/s in the LAN), supports private deployment, supports drag-and-drop sending of multiple files, web file preview. Many additional features have been added, such as local screen recording, remote screen sharing (zero-latency), remote audio and video calls (zero-latency), live streaming (zero-latency), password-protected rooms, OSS cloud storage, relay service settings, WebRTC detection, WebRTC statistics, text transmission (group chat, private chat), public chat, remote whiteboard, AI chatbox, feature-rich admin panel, real-time execution log display, robot alert notifications, and more. -## Preparation (Essential Steps) +## Pre-deployment Considerations -1. Install node-14.21.x or higher and npm, then run the following command in the project directory: +Whether it's self-deployment, Docker deployment, or other script deployments, you need to modify the corresponding configurations in `tlrtcfile.env` before performing the following operations. Further configuration modifications and service restarts are required. + +Of course, you can also use the default configurations without modifications, but the default configurations are only suitable for testing on localhost. They won't be accessible to others, making it impossible for others to use. Therefore, if you intend to deploy on a server for local network or public network users, you must configure `tlrtcfile.env` accordingly. + +## Self-Deployment +#### Installing Dependencies + +Install Node.js 14.21.x or above, and npm. Then, navigate to the project directory and run the following command: ``` cd svr/ + npm install ``` -2. For the first run or self-development of the page, use either of the following commands: +For the first run, execute the following command: +``` +npm run build:pro +``` +If you need to develop or modify the frontend pages, use this command. If not, you can skip this step: +``` +npm run build:dev +``` -`npm run build:dev` (Use this command if you need to develop/modifty the frontend page) -`npm run build:pro` (Use this command if you don't need to develop/modifty the frontend page) +#### Starting the Service -3. Modify the `tlrtcfile.env` configuration file. +Start the following two services. Choose one mode to start. The only difference between them is that the HTTPS mode is required to use features like audio/video streaming, live streaming, and screen sharing. Other features are not affected. -## Configure Websocket (Essential Steps) +After starting in HTTP mode, access the service at `http://your_machine_ip:9092`. -Modify the corresponding websocket configurations in `tlrtcfile.env`: +- Start the API and socket services: +``` +npm run http-api +npm run http-socket +``` - ## Websocket server port - tl_rtc_file_socket_port=8444 +Or, start in HTTPS mode and access the service at `https://your_machine_ip:9092`. - ## Websocket server address - ## "domain or ip:port or domain:port" - tl_rtc_file_socket_host=127.0.0.1 +- Start the API and socket services: +``` +npm run https-api +npm run https-socket +``` -## Startup (Essential Steps) +## Docker Deployment -Start the following two services. Choose one mode to start, and the difference between them is that the HTTPS environment is required for audio, video, live streaming, and screen sharing features. Other features are not affected. +Currently, both `official images` and `self-built images` are supported. For official images, there are two ways to operate: `docker script startup` and `docker-compose startup`. -After starting in HTTP mode, access http://your_machine_ip:9092. - -- API service: `npm run http-api` -- Socket service: `npm run http-socket` - -After starting in HTTPS mode, access https://your_machine_ip:9092. - -- API service: `npm run https-api` -- Socket service: `npm run https-socket` - -## Configure Database (Non-Essential Steps) - -Modify the database-related configurations in `tlrtcfile.env`: - - ## Enable database - tl_rtc_file_db_open=false - ## Database address - tl_rtc_file_db_mysql_host=mysql - ## Database port - tl_rtc_file_db_mysql_port=3306 - ## Database name - tl_rtc_file_db_mysql_dbName=webchat - ## Database username - tl_rtc_file_db_mysql_user=tlrtcfile - ## Database password - tl_rtc_file_db_mysql_password=tlrtcfile - -## Admin Panel (Non-Essential Steps) - -Prerequisite: Database configuration must be enabled. - -Modify the admin panel-related configurations in `tlrtcfile.env`. After starting, enter the configured room number and password to access the admin panel: - - ## Admin panel room number - tl_rtc_file_manage_room=tlrtcfile - ## Admin panel password - tl_rtc_file_manage_password=tlrtcfile - -## WeChat Work Notification (Non-Essential Steps) - -Modify the WeChat Work notification-related configurations in `tlrtcfile.env`: - - ## WeChat Work notification switch - tl_rtc_file_notify_open=false - ## WeChat Work notification robot KEY, normal notifications, comma-separated if multiple keys - tl_rtc_file_notify_qiwei_normal= - ## WeChat Work notification robot KEY, error notifications, comma-separated if multiple keys - tl_rtc_file_notify_qiwei_error= - -## OSS Cloud Storage (Non-Essential Steps) - -Modify the OSS storage-related configurations in `tlrtcfile.env`: - - ## oss-seafile storage repository ID - tl_rtc_file_oss_seafile_repoid= - ## oss-seafile address - tl_rtc_file_oss_seafile_host= - ## oss-seafile username - tl_rtc_file_oss_seafile_username= - ## oss-seafile password - tl_rtc_file_oss_seafile_password= - - ## - - oss-alyun storage accessKey - tl_rtc_file_oss_alyun_AccessKey= - ## oss-aly storage SecretKey - tl_rtc_file_oss_alyun_Secretkey= - ## oss-aly storage bucket - tl_rtc_file_oss_alyun_bucket= - - ## oss-txyun storage accessKey - tl_rtc_file_oss_txyun_AccessKey= - ## oss-txyun storage SecretKey - tl_rtc_file_oss_txyun_Secretkey= - ## oss-txyun storage bucket - tl_rtc_file_oss_txyun_bucket= - - ## oss-qiniuyun storage accessKey - tl_rtc_file_oss_qiniuyun_AccessKey= - ## oss-qiniuyun storage SecretKey - tl_rtc_file_oss_qiniuyun_Secretkey== - ## oss-qiniuyun storage bucket - tl_rtc_file_oss_qiniuyun_bucket= - -## Chat-GPT (Non-Essential Steps) - -Modify the OpenAI-related configurations in `tlrtcfile.env`: - - ## openai-key, comma-separated if multiple keys - tl_rtc_file_openai_keys= - -## Configure Turn Server (LAN Non-Essential Steps, Internet Essential Steps) - -Currently, there are two ways to generate and use Turn server accounts and passwords: fixed accounts and passwords (recommended), and time-limited accounts and passwords. **Choose one method**: - -Example for Ubuntu: - -- Install coturn: `sudo apt-get install coturn` - -Valid accounts and passwords: `docker/coturn/turnserver-with-secret-user.conf` - -1. Modify the fields `listening-device`, `listening-ip`, `external-ip`, `static-auth-secret`, and `realm`. -2. Start turnserver: - `turnserver -c /path/to/complete/conf/turn/turnserver-with-secret-user.conf` - -Fixed accounts and passwords: `docker/coturn/turnserver-with-fixed-user.conf` - -1. Modify the fields `listening-device`, `listening-ip`, `external-ip`, `user`, and `realm`. -2. Generate users: - `turnadmin -a -u username -p password -r realm_from_config_file` -3. Start turnserver: - `turnserver -c /path/to/complete/docker/coturn/turnserver-with-secret-user.conf` - -After deploying coturn, set up WebRTC-related information in the corresponding `tlrtcfile.env` configuration: - - ## webrtc-stun relay service address - tl_rtc_file_webrtc_stun_host= - ## webrtc-turn relay service address - tl_rtc_file_webrtc_turn_host= - ## webrtc relay service username - tl_rtc_file_webrtc_turn_username=tlrtcfile - ## webrtc relay service password - tl_rtc_file_webrtc_turn_credential=tlrtcfile - ## webrtc relay service secret - tl_rtc_file_webrtc_turn_secret=tlrtcfile - ## webrtc relay service account expiration time (milliseconds) - tl_rtc_file_webrtc_turn_expire=86400000 - -## Docker - -Currently, support is provided for `official images` and `self-packaged images`. Using official images supports two methods: `docker script startup` and `docker-compose startup`. - -Unlike self-deployment on a server/computer, the Docker environment by default starts the database and coturn services, requiring minimal additional steps for setup. - -### Using Official Images (Docker Script Startup): - -After modifying the `tlrtcfile.env` configuration as needed (or using the default configuration), navigate to the `bin/` directory and execute the `auto-pull-and-start-docker.sh` script: +#### One-Click Docker Script +Navigate to the `bin/` directory and execute the `auto-pull-and-start-docker.sh` script: ``` chmod +x ./auto-pull-and-start-docker.sh ./auto-pull-and-start-docker.sh ``` -### Using Official Images (Docker-Compose Startup): +#### Using docker-compose -After modifying the `tlrtcfile.env` configuration as needed (or using the default configuration), execute the following command based on your `Docker Compose` version in the main directory: +In the main directory, execute the corresponding command based on your Docker Compose version: -- For `Docker Compose V1`: +- For Docker Compose V1: ``` docker-compose --profile=http up -d ``` -- For `Docker Compose V2`: +- For Docker Compose V2: ``` docker compose --profile=http up -d ``` -### Self-Packaged Image (Docker-Compose Self-Packaged Startup): +#### Self-Building and Starting the Image -After confirming the modification of the `tlrtcfile.env` configuration file (or using the default configuration), navigate to the `docker/` directory and execute the following command based on your `Docker Compose` version in the main directory: +Navigate to the `docker/` directory and execute the corresponding command based on your Docker Compose version: -- For `Docker Compose V1`: +- For Docker Compose V1: ``` docker-compose -f docker-compose-build-code.yml up -d ``` -- For `Docker Compose V2`: +- For Docker Compose V2: ``` docker compose -f docker-compose-build-code.yml up -d ``` ## Other Deployment Methods -In addition to the above manual installation, Docker official images, and self-packaged images, there are also options for automatic scripts and one-click deployment on hosting platforms. +In addition to the manual installation, Docker official images, and self-built Docker images, there are other methods such as automatic scripts and one-click deployments on hosting platforms. -After downloading the project, navigate to the `bin/` directory and select the appropriate system script to execute. The script will automatically detect the installation environment, install dependencies, and start the services automatically. +After downloading the project, navigate to the `bin/` directory and choose the appropriate system script to execute. It will automatically detect the environment, install dependencies, and start the service. -**Note: Before executing the script, you can modify the configuration first. If you're using the default configuration, you'll need to restart both services for the changes to take effect. To do this, execute the `Stop Services` script and then run the `Automatic Script` again.** - -### Ubuntu Automatic Script (e.g., ubuntu16): +#### Automatic script for Ubuntu (e.g., Ubuntu 16) +- If the script doesn't have execution permission, run the following command: ``` chmod +x ./ubuntu16/*.sh +``` -cd ubuntu16/ - +- If using HTTP, execute this script: +``` ./auto-check-install-http.sh ``` -For HTTPS, use this script: + +- If using HTTPS, execute this script: ``` ./auto-check-install-https.sh ``` -Stop Services Script: + +- To stop the service: ``` ./auto-stop.sh ``` -### Windows Automatic Script: +#### Automatic script for Windows +- If using HTTP, execute this script: ``` windows/auto-check-install-http.bat ``` -For HTTPS, use this script: + +- If using HTTPS, execute this script: ``` windows/auto-check-install-https.bat ``` -### Zeabur One-Click Deployment Platform +#### One-Click Deployment on Zeabur Platform [](https://zeabur.com/templates/898TLE?referralCode=iamtsm) +## Other Configuration Options + +#### Configuring the Database (Optional) + +You need to install MySQL database manually, create a database named `webchat`, and then modify the database-related configurations in `tlrtcfile.env`. + +#### Admin Panel (Optional) + +Prerequisite: Database configuration must be enabled. + +Modify the admin panel-related configurations in `tlrtcfile.env`. After starting, enter the configured room number and password to access the admin panel. + +#### WeChat Notifications (Optional) + +If you need to set up notification for access and error alerts, you can create a WeChat Work robot and get an API key. Modify the WeChat notification configurations in `tlrtcfile.env`. + +#### OSS Cloud Storage (Optional) + +The project currently supports Seafile storage integration, and future updates will include support for Alibaba Cloud, Tencent Cloud, Qiniu Cloud, and self-hosted server storage methods. Modify the OSS storage configurations in `tlrtcfile.env`. + +#### Chat-GPT (Optional) + +Integrated with the OpenAI API, this project includes a chat dialog. Modify the OpenAI configurations in `tlrtcfile.env`. + +#### Configuring turnserver (Optional for LAN, Required for WAN) + +There are two ways to generate TURN server credentials: fixed credentials (recommended) and time-limited credentials. Choose one method. The following example uses Ubuntu. + +Install coturn: +``` +sudo apt-get install coturn +``` + +For time-limited credentials, modify the configuration file `docker/coturn/turnserver-with-secret-user.conf`. + +- Modify the fields in the configuration file: +``` +`listening-device`, `listening-ip`, `external-ip`, `static-auth-secret`, `realm` +``` +- Start the turnserver: +``` +turnserver -c /path/to/conf/turn/turnserver-with-secret-user.conf +``` + +For fixed credentials, modify the configuration file `docker/coturn/turnserver-with-fixed-user.conf`. + +- Modify the fields in the configuration file: +``` +`listening-device`, `listening-ip`, `external-ip`, `user`, `realm` +``` +- Generate a user: +``` +turnadmin -a -u username -p password -r realm_in_config_file +``` +- Start the turnserver: +``` +turnserver -c /path/to/docker/coturn/turnserver-with-secret-user.conf +``` + +After setting up coturn, configure the WebRTC-related information in the corresponding `tlrtcfile.env` configuration. + ## Overview Diagram  diff --git a/svr/conf/cfg.json b/svr/conf/cfg.json index 466706a..fa6aa29 100644 --- a/svr/conf/cfg.json +++ b/svr/conf/cfg.json @@ -1,5 +1,5 @@ { - "version": "10.4.2", + "version": "10.4.3", "socket": { "port": "请到 tlrtcfile.env 中进行配置", "host": "请到 tlrtcfile.env 中进行配置" diff --git a/svr/res/css/index.css b/svr/res/css/index.css index 2331b95..79ea321 100644 --- a/svr/res/css/index.css +++ b/svr/res/css/index.css @@ -1203,4 +1203,19 @@ body { /** 765px以上 */ @media screen and (min-width: 765px) { +} + +/** 语音连麦动画覆盖 */ +@keyframes layui-scale-spring { + 0% { + transform: scale(.3); + } + 80% { + opacity: .8; + transform: scale(0.8); + } + 100% { + opacity: 0; + transform: scale(0.6); + } } \ No newline at end of file diff --git a/svr/res/index.html b/svr/res/index.html index 9990c31..73cf179 100644 --- a/svr/res/index.html +++ b/svr/res/index.html @@ -98,6 +98,10 @@ v-show="isLiveShare && owner"> {{lang.living}}: {{liveShareTimes < 10 ? '0' + liveShareTimes : liveShareTimes}}{{lang.second}} + + {{lang.audioing}}: {{audioShareTimes < 10 ? '0' + audioShareTimes : + audioShareTimes}}{{lang.second}} @@ -208,7 +212,10 @@ {{lang.chat_comm}} + style="right: 2px; top: 2px; width: 7px; height: 7px;position: relative;"> + + + + + +@font-face {
font-family: 'iconfont';
- src: url('iconfont.woff2?t=1690027853800') format('woff2'),
- url('iconfont.woff?t=1690027853800') format('woff'),
- url('iconfont.ttf?t=1690027853800') format('truetype');
+ src: url('iconfont.woff2?t=1692112288946') format('woff2'),
+ url('iconfont.woff?t=1692112288946') format('woff'),
+ url('iconfont.ttf?t=1692112288946') format('truetype');
}