Skip to content

Commit 749cdf1

Browse files
committed
feat: v0.02-release
1 parent 92efa2b commit 749cdf1

File tree

419 files changed

+51233
-26621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

419 files changed

+51233
-26621
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ node_modules
3232

3333
dist/
3434

35+
system-dist/
36+
37+
web-dist/
38+
3539
tmp/
3640

3741
.VSCodeCounter/
3842

39-
electron-dist/
43+
.idea/

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,80 @@
11
<p align="center">
2-
<img src="web-v2-res/image/tlrtcapp-logo.svg" alt="TL-RTC-APP Logo">
2+
<img src="web-res/image/tlrtcapp-logo.svg" alt="TL-RTC-APP Logo">
33
</p>
44

5-
### Preview
6-
7-
<img src="web-v2-res/image/homepage.png" alt="homepage">
8-
9-
## Prerequisites
10-
11-
1. Install Node.js environment
12-
13-
2. Install MySQL environment
14-
15-
3. Install Redis environment
5+
<p align="center">
6+
<img src="web-res/image/channel-chat.png" alt="TL-RTC-APP Channel Chat">
7+
</p>
168

17-
## Installation Steps
9+
### Installation Steps
1810

1911
1. Clone the repository:
2012

2113
```bash
2214
git clone https://github.com/tl-open-source/tl-rtc-app.git
2315
```
24-
2. Navigate to the project directory:
16+
17+
2. Navigate into the project directory:
2518

2619
```bash
2720
cd tl-rtc-app
2821
```
22+
2923
3. Install dependencies:
3024

3125
```bash
3226
npm install
3327
```
3428

35-
## Usage Instructions
36-
1. Start the application - Api
29+
4. Install pm2 globally:
3730

3831
```bash
39-
npm run http-api
32+
npm install pm2 -g
33+
```
34+
35+
5. Start the super admin API service:
4036

37+
```bash
38+
pm2 start npm --name=tl-rtc-app-super-api -- run http-super-api
39+
```
4140
or
4241

43-
npm run https-api
42+
```bash
43+
pm2 start npm --name=tl-rtc-app-super-api -- run https-super-api
4444
```
4545

46-
2. Start the application - Socket
46+
6. Start the API service:
4747

4848
```bash
49-
npm run http-socket
49+
pm2 start npm --name=tl-rtc-app-api -- run http-api
50+
```
51+
or
5052

53+
```bash
54+
pm2 start npm --name=tl-rtc-app-api -- run https-api
55+
```
56+
57+
7. Start the Socket service:
58+
59+
```bash
60+
pm2 start npm --name=tl-rtc-app-socket -- run http-socket
61+
```
5162
or
5263

53-
npm run https-socket
64+
```bash
65+
pm2 start npm --name=tl-rtc-app-socket -- run https-socket
5466
```
5567

56-
3. Open your browser and visit `http://localhost:9096`.
68+
### Usage
69+
70+
1. Open your browser and visit `http://localhost:9096` (default).
71+
72+
2. Use the admin panel for managing the IM application at `http://localhost:9098` (default).
73+
74+
### License
75+
76+
This project is licensed under the MIT License. For more information, please refer to the [LICENSE](LICENSE) file.
5777

58-
## License
59-
This project is licensed under the MIT License. For more details, please refer to the [LICENSE](LICENSE) file.
78+
### Disclaimer
6079

61-
## Disclaimer
6280
For more details, please refer to the [DISCLAIMER](DISCLAIMER) file.

README_ZH.md

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
<p align="center">
2-
<img src="web-v2-res/image/tlrtcapp-logo.svg" alt="TL-RTC-APP Logo">
2+
<img src="web-res/image/tlrtcapp-logo.svg" alt="TL-RTC-APP Logo">
33
</p>
44

5-
### 预览
6-
7-
<img src="web-v2-res/image/homepage.png" alt="homepage">
8-
9-
### 准备
10-
11-
1. 安装nodejs环境
12-
13-
2. 安装mysql环境
5+
<p align="center">
6+
<img src="web-res/image/channel-chat.png" alt="TL-RTC-APP Channel Chat">
7+
</p>
148

15-
3. 安装redis环境
169

1710
### 安装步骤
1811

@@ -34,28 +27,50 @@
3427
npm install
3528
```
3629

37-
### 使用说明
38-
1. 启动应用 - Api
30+
4. 安装pm2:
3931

4032
```bash
41-
npm run http-api
33+
npm install pm2 -g
34+
```
35+
36+
5. 启动后台管理服务:
4237

38+
```bash
39+
pm2 start npm --name=tl-rtc-app-super-api -- run http-super-api
40+
```
4341
或者
4442

45-
npm run https-api
43+
```bash
44+
pm2 start npm --name=tl-rtc-app-super-api -- run https-super-api
4645
```
4746

48-
2. 启动应用 - Socket
47+
6. 启动Api服务:
48+
49+
```bash
50+
pm2 start npm --name=tl-rtc-app-api -- run http-api
51+
```
52+
或者
4953

5054
```bash
51-
npm run http-socket
55+
pm2 start npm --name=tl-rtc-app-api -- run https-api
56+
```
5257

58+
7. 启动Socket服务:
59+
60+
```bash
61+
pm2 start npm --name=tl-rtc-app-socket -- run http-socket
62+
```
5363
或者
5464

55-
npm run https-socket
65+
```bash
66+
pm2 start npm --name=tl-rtc-app-socket -- run https-socket
5667
```
57-
58-
3. 打开浏览器并访问 `http://localhost:9096`
68+
69+
### 使用说明
70+
71+
1. 打开浏览器并访问 `http://localhost:9096` (默认)。
72+
73+
2. 通过管理端应用进行IM应用管理 `http://localhost:9098` (默认)。
5974

6075

6176
### 许可证

conf/env_config.js

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const path = require("path");
22
const dotEnv = require("dotenv");
3+
const fs = require("fs");
4+
const { exec } = require("child_process");
35

46
/**
57
* 从.env文件中加载环境变量
@@ -44,23 +46,68 @@ const get_env_config = function () {
4446
value = value === 'true'
4547
}
4648

47-
//openai keys转换为数组
48-
if(key === 'openai_keys'){
49-
value = value.split(',')
50-
}
51-
52-
//企业微信通知 keys转换为数组
53-
if(key === 'notify_qiwei_normal' || key === 'notify_qiwei_error'){
54-
value = value.split(',')
55-
}
56-
5749
defaultConfJson[key] = value
5850
})
5951

6052
return defaultConfJson
6153
}
6254

55+
/**
56+
* 设置环境变量
57+
* @param {*} key 配置项的键名(不含 tl_rtc_app_ 前缀)
58+
* @param {*} value 配置项的新值
59+
*/
60+
const set_env_config = function (key, value) {
61+
// 构建完整的环境变量名
62+
const fullKey = `tl_rtc_app_${key}`;
63+
64+
// 获取 .env 文件路径
65+
const envFilePath = path.resolve(__dirname, "../tlrtcapp.env");
66+
67+
try {
68+
// 读取 .env 文件内容
69+
let envContent = fs.readFileSync(envFilePath, 'utf8');
70+
71+
// 准备正则表达式,匹配键值对
72+
const regex = new RegExp(`^${fullKey}=.*$`, 'm');
73+
74+
// 检查键是否存在
75+
if (regex.test(envContent)) {
76+
// 如果键存在,则替换其值
77+
envContent = envContent.replace(regex, `${fullKey}=${value}`);
78+
} else {
79+
// 如果键不存在,则在文件末尾添加
80+
console.error(`Config not found: ${fullKey}`);
81+
return {
82+
success: false,
83+
message: `Config not found: ${fullKey}`
84+
}
85+
}
86+
87+
// 写入更新后的内容
88+
fs.writeFileSync(envFilePath, envContent, 'utf8');
89+
90+
// 更新当前进程中的环境变量
91+
process.env[fullKey] = value;
92+
93+
console.log(`Config updated: ${fullKey}=${value}`);
94+
95+
return {
96+
success: true,
97+
message: `Config updated: ${fullKey}=${value}`
98+
}
99+
} catch (error) {
100+
console.error(`Failed to update config ${fullKey}:`, error)
101+
return {
102+
success: false,
103+
message: `Failed to update config ${fullKey}: ${error}`
104+
}
105+
}
106+
}
107+
108+
63109
module.exports = {
64110
get_env_config,
65-
load_env_config
111+
load_env_config,
112+
set_env_config,
66113
}

conf/skin/dark.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conf/skin/light.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulp-obfuscator.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
replaceVarsMap: {
3+
"tl-rtc-app-": "TL-RTC-APP-SDK-",
4+
},
5+
};

0 commit comments

Comments
 (0)