|
21 | 21 |
|
22 | 22 | **qq交流群 : 624214498** |
23 | 23 |
|
24 | | -## 准备 |
| 24 | +## 准备 (必须步骤) |
25 | 25 |
|
26 | 26 | 安装node-14.x,npm后进入项目目录运行下面命令 |
27 | 27 |
|
|
40 | 40 | `npm run dev` (打包开发环境min) 或者 `npm run pro` 打包生产环境min |
41 | 41 |
|
42 | 42 |
|
43 | | -## 启动 |
| 43 | +## 启动 (必须步骤) |
44 | 44 |
|
45 | | -http形式启动以下两个服务 |
| 45 | +http形式启动以下两个服务, 选一种模式启动即可 |
46 | 46 |
|
47 | 47 | api服务: `npm run lapi` |
48 | 48 |
|
49 | 49 | socket服务 : `npm run lsocket` |
50 | 50 |
|
51 | | - 或者https形式启动一下两个服务 |
| 51 | +或者https形式启动一下两个服务 |
52 | 52 |
|
53 | 53 | api服务: `npm run sapi` |
54 | 54 |
|
55 | 55 | socket服务 : `npm run ssocket` |
56 | 56 |
|
57 | | -选一种模式启动即可 |
58 | 57 |
|
59 | | -## 配置数据库 (默认关闭) |
| 58 | +## 配置websocket (必须步骤) |
60 | 59 |
|
61 | | - 修改conf/cfg.json中相应数据库配置即可, 如open, dbName, host, port, user, pwd 等 |
| 60 | +修改cfg.json中相应ws配置,或者wss配置 |
62 | 61 |
|
| 62 | + "ws": { |
| 63 | + "port": 8444, #socket 端口 |
| 64 | + "host": "ws://127.0.0.1:8444", #socket ip |
| 65 | + "control_port": 8445, #远程控制socket 端口 |
| 66 | + "control_host": "ws://127.0.0.1:8445" #远程控制socket ip |
| 67 | + }, |
| 68 | + "wss" : { |
| 69 | + "port": 8444, |
| 70 | + "host": "wss://域名||ip:port", |
| 71 | + "control_port": 8445, |
| 72 | + "control_host": "wss://域名||ip:port" |
| 73 | + }, |
63 | 74 |
|
64 | | -## 配置websocket (ws/wss) |
| 75 | +## 配置数据库 (非必须步骤) |
65 | 76 |
|
66 | | - 修改conf/cfg.json中相应ws配置,或者wss配置 |
| 77 | +修改cfg.json中相应数据库配置 |
67 | 78 |
|
68 | | -## 配置turnserver (中继服务) |
| 79 | + "db": { |
| 80 | + "open": false, #是否开启数据库, 默认关闭 |
| 81 | + "mysql": { |
| 82 | + "host": "host地址", |
| 83 | + "port": 3306, |
| 84 | + "dbName": "数据库名称", |
| 85 | + "user": "用户名", |
| 86 | + "password": "密码", |
| 87 | + "other": { |
| 88 | + "sequelize": { |
| 89 | + "dialect": "mysql", |
| 90 | + "host": "host地址", |
| 91 | + "port": 3306, |
| 92 | + "logging": false, |
| 93 | + "pool": { |
| 94 | + "max": 5, |
| 95 | + "min": 0, |
| 96 | + "acquire": 30000, |
| 97 | + "idle": 10000 |
| 98 | + }, |
| 99 | + "timezone": "+08:00", |
| 100 | + "define": { |
| 101 | + "freezeTableName": true, |
| 102 | + "underscored": true, |
| 103 | + "charset": "utf8", |
| 104 | + "collate": "utf8_general_ci", |
| 105 | + "timestamps": false, |
| 106 | + "paranoid": true |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | + } |
| 111 | + } |
69 | 112 |
|
70 | | - ubuntu: |
| 113 | +## 配置turnserver (局域网非必须步骤,公网必须步骤) |
71 | 114 |
|
72 | | - 1. sudo apt-get install coturn #安装coturn |
| 115 | +ubuntu示例: |
73 | 116 |
|
74 | | - 2. cp conf/turn/turnserver.conf /etc/turnserver.conf #修改配置文件, 文件内容按需修改 |
| 117 | + 安装coturn `sudo apt-get install coturn` |
75 | 118 |
|
76 | | - 3. chomd +x bin/genTurnUser.sh && ./genTurnUser.sh #文件内容按需修改 |
| 119 | + 项目提供了一份配置文件模板在 : `conf/turn/turnserver.conf` |
77 | 120 |
|
78 | | - 4. chomd +x bin/startTurnServer.sh && ./startTurnServer.sh #启动turnserver,文件内容按需修改 |
| 121 | + 修改配置文件后复制一份 `cp conf/turn/turnserver.conf /etc/turnserver.conf` |
79 | 122 |
|
80 | | -## Docker |
| 123 | +示例用户和密码: tlrtcfile |
81 | 124 |
|
82 | | - 修改conf/cfg.json中的ws/wss的ip地址(有更好的办法可以反馈下) |
| 125 | + 生成用户 (turnadmin生成密码) `turnadmin -k -u tlrtcfile -r 你的域名` |
| 126 | + 或者 (自定义密码) `turnadmin -a -u tlrtcfile -p tlrtcfile -r 你的域名` |
| 127 | + 启动turnserver `turnserver -c /etc/turnserver.conf` |
83 | 128 |
|
84 | | - docker build -t iamtsm/tl-rtc-file . |
| 129 | + 可参考示例模板 : `bin/turnStart.sh` |
85 | 130 |
|
86 | | - docker run -p 9092:9092 -p 8444:8444 --name local -d iamtsm/tl-rtc-file |
87 | 131 |
|
88 | | - 访问 : http://localhost:9092 或者 http://本机ip:9092 |
| 132 | +## Docker (非必须步骤) |
89 | 133 |
|
90 | | -## 管理后台 |
| 134 | + 按需配置conf.json中的ws, 或者wss (需要填容器的ip,端口信息) |
91 | 135 |
|
92 | | - 前提 : 需要开启数据库配置 |
| 136 | + docker build -t tl-open-source/tl-rtc-file . |
93 | 137 |
|
94 | | - 修改conf/cfg.json中的manage的room和password,默认房间号和密码都是tlrtcfile |
| 138 | + docker run -p 9092:9092 -p 8444:8444 --name tl-rtc-file-local -d tl-open-source/tl-rtc-file |
95 | 139 |
|
96 | 140 | 访问 : http://localhost:9092 或者 http://本机ip:9092 |
97 | 141 |
|
98 | | - 输入配置的房间号,输入密码,即可进入管理后台 |
| 142 | +## 管理后台 (非必须步骤) |
| 143 | + |
| 144 | +前提 : 需要开启数据库配置 |
99 | 145 |
|
100 | | - ps : 如有需要配置企业微信通知,修改conf/cfg.json中的notify的qiwei数组,填入企业微信机器人的key即可 |
| 146 | +修改cfg.json中的manage的room和password,默认房间号和密码都是tlrtcfile |
101 | 147 |
|
102 | | -## Chat-GPT |
| 148 | + 访问 : http://localhost:9092 或者 http://本机ip:9092 |
| 149 | + |
| 150 | + 输入配置的房间号,输入密码,即可进入管理后台 |
103 | 151 |
|
104 | | - 修改conf/cfg.json中的openai.apiKeys,填写你自己openai账号生成的apiKey |
| 152 | + "manage": { |
| 153 | + "room": "tlrtcfile", |
| 154 | + "password": "tlrtcfile" |
| 155 | + }, |
| 156 | + |
| 157 | +## 企微通知 (非必须步骤) |
| 158 | + |
| 159 | +修改cfg.json中的notify的qiwei数组,填入企业微信机器人的key即可 |
| 160 | + |
| 161 | +normal : 正常通知, error : 系统报错通知 |
| 162 | + |
| 163 | + "notify": { |
| 164 | + "open": true, #是否开启企业微信通知 |
| 165 | + "qiwei": { |
| 166 | + "normal" : [ |
| 167 | + "key1", |
| 168 | + "key2" |
| 169 | + ], |
| 170 | + "error" : [ |
| 171 | + "key3", |
| 172 | + "key4" |
| 173 | + ] |
| 174 | + } |
| 175 | + }, |
| 176 | + |
| 177 | +## OSS云存储 (非必须步骤) |
| 178 | + |
| 179 | +修改cfg.json中的oss |
| 180 | + |
| 181 | + "oss": { |
| 182 | + "seafile": { |
| 183 | + "repoid": "", |
| 184 | + "host": "", |
| 185 | + "username": "帐号", |
| 186 | + "password": "密码" |
| 187 | + }, |
| 188 | + "alyun": { |
| 189 | + "AccessKey": "", |
| 190 | + "SecretKey": "", |
| 191 | + "bucket": "tl-rtc-file" |
| 192 | + }, |
| 193 | + "txyun": { |
| 194 | + "AccessKey": "", |
| 195 | + "SecretKey": "", |
| 196 | + "bucket": "tl-rtc-file" |
| 197 | + }, |
| 198 | + "qiniuyun": { |
| 199 | + "AccessKey": "", |
| 200 | + "SecretKey": "", |
| 201 | + "bucket": "tl-rtc-file" |
| 202 | + } |
| 203 | + }, |
| 204 | + |
| 205 | +## Chat-GPT (非必须步骤) |
| 206 | + |
| 207 | +修改cfg.json中的openai.apiKeys,填写你自己openai账号生成的apiKey |
| 208 | + |
| 209 | + "openai": { |
| 210 | + "apiKeys": [ |
| 211 | + |
| 212 | + ] |
| 213 | + }, |
105 | 214 |
|
106 | 215 | ## 概述图 |
107 | 216 |
|
108 | 217 |  |
109 | 218 |
|
110 | 219 | ## License |
111 | 220 |
|
112 | | -MIT License |
113 | | - |
114 | | -Copyright (c) 2022 iamtsm |
115 | | - |
116 | | -Permission is hereby granted, free of charge, to any person obtaining a copy |
117 | | -of this software and associated documentation files (the "Software"), to deal |
118 | | -in the Software without restriction, including without limitation the rights |
119 | | -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
120 | | -copies of the Software, and to permit persons to whom the Software is |
121 | | -furnished to do so, subject to the following conditions: |
122 | | - |
123 | | -The above copyright notice and this permission notice shall be included in all |
124 | | -copies or substantial portions of the Software. |
125 | | - |
126 | | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
127 | | -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
128 | | -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
129 | | -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
130 | | -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
131 | | -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
132 | | -SOFTWARE. |
133 | | - |
| 221 | +### MIT License Copyright (c) 2022 iamtsm |
134 | 222 |
|
135 | 223 | ## 免责声明 |
136 | 224 |
|
|
0 commit comments