@lobehub/chat 0.119.8 → 0.119.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,35 @@
1
- name: '🐛 反馈缺陷 Bug Report'
2
- description: '反馈一个问题缺陷 | Report an bug'
1
+ name: '🐛 Bug Report'
2
+ description: 'Report an bug'
3
3
  title: '[Bug] '
4
- labels: '🐛 Bug'
4
+ labels: ['🐛 Bug']
5
5
  body:
6
6
  - type: dropdown
7
7
  attributes:
8
- label: '💻 系统环境 | Operating System'
8
+ label: '💻 Operating System'
9
9
  options:
10
10
  - Windows
11
11
  - macOS
12
12
  - Ubuntu
13
13
  - Other Linux
14
+ - iOS
15
+ - Android
14
16
  - Other
15
17
  validations:
16
18
  required: true
17
19
  - type: dropdown
18
20
  attributes:
19
- label: '🌐 浏览器 | Browser'
21
+ label: '📦 Environment'
22
+ options:
23
+ - Official Preview
24
+ - Vercel / Zeabur / Sealos
25
+ - Docker
26
+ - Other
27
+ validations:
28
+ required: true
29
+
30
+ - type: dropdown
31
+ attributes:
32
+ label: '🌐 Browser'
20
33
  options:
21
34
  - Chrome
22
35
  - Edge
@@ -27,19 +40,19 @@ body:
27
40
  required: true
28
41
  - type: textarea
29
42
  attributes:
30
- label: '🐛 问题描述 | Bug Description'
43
+ label: '🐛 Bug Description'
31
44
  description: A clear and concise description of the bug.
32
45
  validations:
33
46
  required: true
34
47
  - type: textarea
35
48
  attributes:
36
- label: '🚦 期望结果 | Expected Behavior'
49
+ label: '🚦 Expected Behavior'
37
50
  description: A clear and concise description of what you expected to happen.
38
51
  - type: textarea
39
52
  attributes:
40
- label: '📷 复现步骤 | Recurrence Steps'
53
+ label: '📷 Recurrence Steps'
41
54
  description: A clear and concise description of how to recurrence.
42
55
  - type: textarea
43
56
  attributes:
44
- label: '📝 补充信息 | Additional Information'
57
+ label: '📝 Additional Information'
45
58
  description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
@@ -0,0 +1,59 @@
1
+ name: '🐛 反馈缺陷'
2
+ description: '反馈一个问题缺陷'
3
+ title: '[Bug] '
4
+ labels: ['🐛 Bug']
5
+ body:
6
+ - type: dropdown
7
+ attributes:
8
+ label: '💻 系统环境'
9
+ options:
10
+ - Windows
11
+ - macOS
12
+ - Ubuntu
13
+ - Other Linux
14
+ - iOS
15
+ - Android
16
+ - Other
17
+ validations:
18
+ required: true
19
+
20
+ - type: dropdown
21
+ attributes:
22
+ label: '📦 部署环境'
23
+ options:
24
+ - Official Preview
25
+ - Vercel / Zeabur / Sealos
26
+ - Docker
27
+ - Other
28
+ validations:
29
+ required: true
30
+
31
+ - type: dropdown
32
+ attributes:
33
+ label: '🌐 浏览器'
34
+ options:
35
+ - Chrome
36
+ - Edge
37
+ - Safari
38
+ - Firefox
39
+ - Other
40
+ validations:
41
+ required: true
42
+ - type: textarea
43
+ attributes:
44
+ label: '🐛 问题描述'
45
+ description: 请提供一个清晰且简洁的问题描述。
46
+ validations:
47
+ required: true
48
+ - type: textarea
49
+ attributes:
50
+ label: '🚦 期望结果'
51
+ description: 请提供一个清晰且简洁的描述,说明您期望发生什么。
52
+ - type: textarea
53
+ attributes:
54
+ label: '📷 复现步骤'
55
+ description: 请提供一个清晰且简洁的描述,说明如何复现问题。
56
+ - type: textarea
57
+ attributes:
58
+ label: '📝 补充信息'
59
+ description: 如果您的问题需要进一步说明,或者您遇到的问题无法在一个简单的示例中复现,请在这里添加更多信息。
@@ -1,21 +1,21 @@
1
- name: '🌠 功能需求 Feature Request'
2
- description: '需求或建议 | Suggest an idea'
1
+ name: '🌠 Feature Request'
2
+ description: 'Suggest an idea'
3
3
  title: '[Request] '
4
- labels: '🌠 Feature Request'
4
+ labels: ['🌠 Feature Request']
5
5
  body:
6
6
  - type: textarea
7
7
  attributes:
8
- label: '🥰 需求描述 | Feature Description'
8
+ label: '🥰 Feature Description'
9
9
  description: Please add a clear and concise description of the problem you are seeking to solve with this feature request.
10
10
  validations:
11
11
  required: true
12
12
  - type: textarea
13
13
  attributes:
14
- label: '🧐 解决方案 | Proposed Solution'
14
+ label: '🧐 Proposed Solution'
15
15
  description: Describe the solution you'd like in a clear and concise manner.
16
16
  validations:
17
17
  required: true
18
18
  - type: textarea
19
19
  attributes:
20
- label: '📝 补充信息 | Additional Information'
20
+ label: '📝 Additional Information'
21
21
  description: Add any other context about the problem here.
@@ -0,0 +1,21 @@
1
+ name: '🌠 功能需求'
2
+ description: '提出需求或建议'
3
+ title: '[Request] '
4
+ labels: ['🌠 功能需求']
5
+ body:
6
+ - type: textarea
7
+ attributes:
8
+ label: '🥰 需求描述'
9
+ description: 请添加一个清晰且简洁的问题描述,阐述您希望通过这个功能需求解决的问题。
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ attributes:
14
+ label: '🧐 解决方案'
15
+ description: 请清晰且简洁地描述您想要的解决方案。
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ attributes:
20
+ label: '📝 补充信息'
21
+ description: 在这里添加关于问题的任何其他背景信息。
@@ -0,0 +1,4 @@
1
+ contact_links:
2
+ - name: Questions and ideas | 问题和想法
3
+ url: https://github.com/lobehub/lobe-chat/discussions/new/choose
4
+ about: Please post questions, and ideas in discussions. | 请在讨论区发布问题和想法。
@@ -7,6 +7,7 @@
7
7
  - [ ] ♻️ refactor
8
8
  - [ ] 💄 style
9
9
  - [ ] 🔨 chore
10
+ - [ ] ⚡️ perf
10
11
  - [ ] 📝 docs
11
12
 
12
13
  #### 🔀 变更说明 | Description of Change
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.119.9](https://github.com/lobehub/lobe-chat/compare/v0.119.8...v0.119.9)
6
+
7
+ <sup>Released on **2024-01-08**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Fix ChatInput fullscreen display not correct.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Fix ChatInput fullscreen display not correct, closes [#982](https://github.com/lobehub/lobe-chat/issues/982) ([e4012c4](https://github.com/lobehub/lobe-chat/commit/e4012c4))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 0.119.8](https://github.com/lobehub/lobe-chat/compare/v0.119.7...v0.119.8)
6
31
 
7
32
  <sup>Released on **2024-01-07**</sup>
@@ -0,0 +1,70 @@
1
+ # Frequently Asked Questions
2
+
3
+ ## When using a proxy(e.g. Surge), I encounter the `UNABLE_TO_VERIFY_LEAF_SIGNATURE` error
4
+
5
+ ### Problem Description
6
+
7
+ When making network requests during private deployment, certificate validation errors may occur. The error messages may be as follows:
8
+
9
+ ```
10
+ [TypeError: fetch failed] {
11
+ cause: [Error: unable to verify the first certificate] {
12
+ code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
13
+ }
14
+ }
15
+ ```
16
+
17
+ Or:
18
+
19
+ ```
20
+ {
21
+ "endpoint": "https://api.openai.com/v1",
22
+ "error": {
23
+ "cause": {
24
+ "code": "UNABLE_TO_VERIFY_LEAF_SIGNATURE"
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ This problem typically occurs when using a proxy server with a self-signed certificate or a man-in-the-middle certificate that is not trusted by Node.js by default.
31
+
32
+ ### Solution
33
+
34
+ To resolve this issue, you can add an environment variable to bypass Node.js certificate validation when starting the application. The specific approach is to include `NODE_TLS_REJECT_UNAUTHORIZED=0` in the startup command. For example:
35
+
36
+ ```bash
37
+ NODE_TLS_REJECT_UNAUTHORIZED=0 npm run start
38
+ ```
39
+
40
+ Alternatively, when running in a Docker container, you can set the environment variable in the Dockerfile or docker-compose.yml:
41
+
42
+ ```dockerfile
43
+ # In the Dockerfile
44
+ ENV NODE_TLS_REJECT_UNAUTHORIZED=0
45
+ ```
46
+
47
+ ```yaml
48
+ # In the docker-compose.yml
49
+ environment:
50
+ - NODE_TLS_REJECT_UNAUTHORIZED=0
51
+ ```
52
+
53
+ Example Docker run command:
54
+
55
+ ```bash
56
+ docker run -e NODE_TLS_REJECT_UNAUTHORIZED=0 <other parameters> <image name>
57
+ ```
58
+
59
+ Please note that this method reduces security because it allows Node.js to accept unverified certificates. Therefore, it is only recommended for use in private deployments with fully trusted network environments, and the default certificate validation settings should be restored after resolving the certificate issue.
60
+
61
+ ### More Secure Alternatives
62
+
63
+ If possible, it is recommended to address certificate issues using the following methods:
64
+
65
+ 1. Ensure that all man-in-the-middle certificates are correctly installed on the proxy server and the corresponding clients.
66
+ 2. Replace self-signed or man-in-the-middle certificates with valid certificates issued by trusted certificate authorities.
67
+ 3. Properly configure the certificate chain in the code to ensure that Node.js can validate to the root certificate.
68
+
69
+ Implementing these methods can resolve certificate validation issues without sacrificing security.
70
+
@@ -0,0 +1,69 @@
1
+ # 常见问题
2
+
3
+ ## 使用代理中转请求时(例如:Surge),报 `UNABLE_TO_VERIFY_LEAF_SIGNATURE` 错误
4
+
5
+ ### 问题描述
6
+
7
+ 在私有化部署时,进行网络请求可能会遇到证书验证错误。错误信息可能如下:
8
+
9
+ ```
10
+ [TypeError: fetch failed] {
11
+ cause: [Error: unable to verify the first certificate] {
12
+ code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
13
+ }
14
+ }
15
+ ```
16
+
17
+ 或者是:
18
+
19
+ ```
20
+ {
21
+ "endpoint": "https://api.openai.com/v1",
22
+ "error": {
23
+ "cause": {
24
+ "code": "UNABLE_TO_VERIFY_LEAF_SIGNATURE"
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ 这个问题通常出现在使用代理服务器时,代理服务器使用的自签名证书或中间人证书不被 Node.js 默认信任。
31
+
32
+ ### 解决方案
33
+
34
+ 要解决这个问题,可以在启动应用时添加环境变量,跳过 Node.js 的证书验证。具体做法是在启动命令中加入 `NODE_TLS_REJECT_UNAUTHORIZED=0`。例如:
35
+
36
+ ```bash
37
+ NODE_TLS_REJECT_UNAUTHORIZED=0 npm run start
38
+ ```
39
+
40
+ 或者在 Docker 容器中运行时,可以在 Dockerfile 或者 docker-compose.yml 中设置环境变量:
41
+
42
+ ```dockerfile
43
+ # 在 Dockerfile 中
44
+ ENV NODE_TLS_REJECT_UNAUTHORIZED=0
45
+ ```
46
+
47
+ ```yaml
48
+ # 在 docker-compose.yml 中
49
+ environment:
50
+ - NODE_TLS_REJECT_UNAUTHORIZED=0
51
+ ```
52
+
53
+ Docker 运行命令示例:
54
+
55
+ ```bash
56
+ docker run -e NODE_TLS_REJECT_UNAUTHORIZED=0 <其他参数> <镜像名>
57
+ ```
58
+
59
+ 请注意,这种方法会降低安全性,因为它允许 Node.js 接受未经验证的证书。因此,仅建议在完全信任网络环境的私有化部署中使用,且需要在解决证书问题后恢复默认的证书验证设置。
60
+
61
+ ### 更安全的替代方案
62
+
63
+ 如果可能,建议通过以下方法解决证书问题:
64
+
65
+ 1. 确保所有的中间人证书都被正确地安装在代理服务器和相应的客户端上。
66
+ 2. 使用有效的、由受信任的证书颁发机构签发的证书替换自签名或中间人证书。
67
+ 3. 在代码中正确配置证书链,确保 Node.js 可以验证到根证书。
68
+
69
+ 采用这些方法可以在不牺牲安全性的前提下解决证书验证问题。
package/docs/Home.md CHANGED
@@ -25,10 +25,11 @@ LobeChat is a open-source, extensible ([Function Calling][fc-url]), high-perform
25
25
 
26
26
  ### 🛳 Self-Hosting
27
27
 
28
- - [Environment Variables](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable) | [环境变量](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN)
29
28
  - [Docker Deployment Guide](https://github.com/lobehub/lobe-chat/wiki/Docker-Deployment) | [Docker 部署指引](https://github.com/lobehub/lobe-chat/wiki/Docker-Deployment.zh-CN)
30
29
  - [Deploying with Azure OpenAI](https://github.com/lobehub/lobe-chat/wiki/Deploy-with-Azure-OpenAI) | [使用 Azure OpenAI 部署](https://github.com/lobehub/lobe-chat/wiki/Deploy-with-Azure-OpenAI.zh-CN)
30
+ - [Environment Variables](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable) | [环境变量](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN)
31
31
  - [Upstream Sync](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync) | [自部署保持更新](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync.zh-CN)
32
+ - [Common Error](https://github.com/lobehub/lobe-chat/wiki/Common-Error) | [常见问题](https://github.com/lobehub/lobe-chat/wiki/Common-Error.zh-CN)
32
33
  - [Data Statistics](https://github.com/lobehub/lobe-chat/wiki/Analytics) | [数据统计](https://github.com/lobehub/lobe-chat/wiki/Analytics.zh-CN)
33
34
 
34
35
  <br/>
package/docs/_Sidebar.md CHANGED
@@ -15,10 +15,11 @@
15
15
 
16
16
  #### 🛳 Self-Hosting
17
17
 
18
- - [Environment Variables](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable) | [中文](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN)
19
18
  - [Docker Deployment Guide](https://github.com/lobehub/lobe-chat/wiki/Docker-Deployment) | [Docker 部署指引](https://github.com/lobehub/lobe-chat/wiki/Docker-Deployment.zh-CN)
20
19
  - [Deploying with Azure OpenAI](https://github.com/lobehub/lobe-chat/wiki/Deploy-with-Azure-OpenAI) | [使用 Azure OpenAI 部署](https://github.com/lobehub/lobe-chat/wiki/Deploy-with-Azure-OpenAI.zh-CN)
20
+ - [Environment Variables](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable) | [环境变量](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN)
21
21
  - [Upstream Sync](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync) | [自部署保持更新](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync.zh-CN)
22
+ - [Common Error](https://github.com/lobehub/lobe-chat/wiki/Common-Error) | [常见问题](https://github.com/lobehub/lobe-chat/wiki/Common-Error.zh-CN)
22
23
  - [Data Statistics](https://github.com/lobehub/lobe-chat/wiki/Analytics) | [数据统计](https://github.com/lobehub/lobe-chat/wiki/Analytics.zh-CN)
23
24
 
24
25
  #### ⌨️ Development
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.119.8",
3
+ "version": "0.119.9",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -153,7 +153,7 @@
153
153
  "@types/ua-parser-js": "^0.7",
154
154
  "@types/uuid": "^9",
155
155
  "@umijs/lint": "^4",
156
- "@vitest/coverage-v8": "1.1.1",
156
+ "@vitest/coverage-v8": "^1.1.3",
157
157
  "commitlint": "^18",
158
158
  "consola": "^3",
159
159
  "dpdm": "^3",
@@ -177,7 +177,7 @@
177
177
  "typescript": "^5",
178
178
  "unified": "^11",
179
179
  "unist-util-visit": "^5",
180
- "vitest": "1.1.1",
180
+ "vitest": "^1.1.3",
181
181
  "vitest-canvas-mock": "^0.3.3"
182
182
  },
183
183
  "publishConfig": {
@@ -47,11 +47,11 @@ const Conversation = memo<ConversationProps>(({ chatInput, mobile }) => {
47
47
  const fontSize = useGlobalStore((s) => settingsSelectors.currentSettings(s).fontSize);
48
48
  const { styles } = useStyles(fontSize);
49
49
 
50
- // init conversation
51
50
  const init = useInitConversation();
52
51
 
53
52
  return (
54
- <Flexbox data-id={'conversation'} flex={1}>
53
+ // relative is required, ChatInput's absolute position needs it
54
+ <Flexbox flex={1} style={{ position: 'relative' }}>
55
55
  <div className={styles}>
56
56
  {init ? <ChatList mobile={mobile} /> : <SkeletonList mobile={mobile} />}
57
57
  </div>
@@ -19,12 +19,6 @@ vi.mock('@/services/plugin', () => ({
19
19
  },
20
20
  }));
21
21
 
22
- // Mock necessary modules and functions
23
- vi.mock('antd', () => ({
24
- notification: {
25
- error: vi.fn(),
26
- },
27
- }));
28
22
  // Mock i18next
29
23
  vi.mock('i18next', () => ({
30
24
  t: vi.fn((key) => key),
@@ -179,6 +173,8 @@ describe('useToolStore:pluginStore', () => {
179
173
 
180
174
  describe('installPlugin', () => {
181
175
  it('should install a plugin with valid manifest', async () => {
176
+ vi.spyOn(notification, 'error');
177
+
182
178
  const pluginIdentifier = 'plugin1';
183
179
 
184
180
  const originalUpdateInstallLoadingState = useToolStore.getState().updateInstallLoadingState;
@@ -253,6 +249,8 @@ describe('useToolStore:pluginStore', () => {
253
249
 
254
250
  const error = new TypeError('noManifest');
255
251
 
252
+ // Mock necessary modules and functions
253
+ vi.spyOn(notification, 'error');
256
254
  (pluginService.getPluginManifest as Mock).mockRejectedValue(error);
257
255
 
258
256
  useToolStore.setState({
@@ -1,15 +0,0 @@
1
- name: '😇 疑问或帮助 Help Wanted'
2
- description: '疑问或需要帮助 | Need help'
3
- title: '[Question] '
4
- labels: '😇 Help Wanted'
5
- body:
6
- - type: textarea
7
- attributes:
8
- label: '🧐 问题描述 | Proposed Solution'
9
- description: A clear and concise description of the proplem.
10
- validations:
11
- required: true
12
- - type: textarea
13
- attributes:
14
- label: '📝 补充信息 | Additional Information'
15
- description: Add any other context about the problem here.
@@ -1,7 +0,0 @@
1
- ---
2
- name: '📝 其他 Other'
3
- about: '其他问题 | Other issues'
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
- ---