@lobehub/chat 1.14.3 → 1.14.5
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.
- package/CHANGELOG.md +50 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/docker-compose/.env.example +1 -1
- package/docker-compose/.env.zh-CN.example +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/github.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +74 -0
- package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +78 -0
- package/docs/self-hosting/environment-variables/auth.mdx +21 -0
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +31 -8
- package/docs/self-hosting/server-database/docker-compose.mdx +31 -10
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +32 -11
- package/package.json +2 -2
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Tags.tsx +1 -1
- package/src/app/(main)/chat/(workspace)/features/ShareButton/Preview.tsx +1 -1
- package/src/app/(main)/chat/@session/features/SessionListContent/List/Item/index.tsx +1 -1
- package/src/app/(main)/settings/llm/ProviderList/Azure/index.tsx +1 -14
- package/src/app/(main)/settings/llm/ProviderList/Bedrock/index.tsx +1 -10
- package/src/app/(main)/settings/llm/ProviderList/Ollama/index.tsx +0 -2
- package/src/app/(main)/settings/llm/ProviderList/OpenAI/index.tsx +0 -3
- package/src/app/(main)/settings/llm/ProviderList/providers.tsx +28 -174
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +17 -17
- package/src/app/(main)/settings/llm/components/ProviderModelList/CustomModelOption.tsx +1 -1
- package/src/app/(main)/settings/llm/components/ProviderModelList/Option.tsx +1 -1
- package/src/app/(main)/settings/tts/features/{const.ts → const.tsx} +6 -3
- package/src/components/ModelSelect/index.tsx +15 -5
- package/src/const/url.ts +1 -0
- package/src/features/AgentSetting/AgentTTS/options.tsx +19 -0
- package/src/features/Conversation/Extras/Assistant.tsx +1 -1
- package/src/libs/next-auth/sso-providers/cloudflare-zero-trust.ts +1 -1
- package/src/components/ModelIcon/index.tsx +0 -114
- package/src/components/ModelProviderIcon/index.tsx +0 -148
- package/src/components/ModelTag/ModelIcon.tsx +0 -105
- package/src/components/ModelTag/index.tsx +0 -13
- package/src/features/AgentSetting/AgentTTS/options.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.14.5](https://github.com/lobehub/lobe-chat/compare/v1.14.4...v1.14.5)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-08-28**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: No user name if Cloudflare Zero Trust with onetimepin.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: No user name if Cloudflare Zero Trust with onetimepin, closes [#3649](https://github.com/lobehub/lobe-chat/issues/3649) ([5bfee5a](https://github.com/lobehub/lobe-chat/commit/5bfee5a))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 1.14.4](https://github.com/lobehub/lobe-chat/compare/v1.14.3...v1.14.4)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-08-28**</sup>
|
|
33
|
+
|
|
34
|
+
#### 💄 Styles
|
|
35
|
+
|
|
36
|
+
- **misc**: Move model and provider icon components to `@lobehub/icons`.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### Styles
|
|
44
|
+
|
|
45
|
+
- **misc**: Move model and provider icon components to `@lobehub/icons`, closes [#3634](https://github.com/lobehub/lobe-chat/issues/3634) ([5c7e17a](https://github.com/lobehub/lobe-chat/commit/5c7e17a))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 1.14.3](https://github.com/lobehub/lobe-chat/compare/v1.14.2...v1.14.3)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-08-27**</sup>
|
package/README.md
CHANGED
|
@@ -275,11 +275,11 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
275
275
|
3. Use the above answers as evidence to logically and coherently provide a final answer to your question, assisted by visual charts.
|
|
276
276
|
|
|
277
277
|
Please tell me what issue you would like to explore?<br/>`backtracking-questions` `thinking-strategies` `problem-analysis` |
|
|
278
|
+
\| [Unreal Engine Master](https://chat-preview.lobehub.com/market?agent=unreal-engine-master)<br/><sup>By **[thedivergentai](https://github.com/thedivergentai)** on **2024-08-27**</sup> | Unreal Game Development Companion<br/>`game-development` `unreal-engine` `software-engineering` |
|
|
278
279
|
\| [TypeScript Solution Architect](https://chat-preview.lobehub.com/market?agent=typescript-developer)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2024-08-24**</sup> | Expert in TypeScript, Node.js, Vue.js 3, Nuxt.js 3, Express.js, React.js, and modern UI libraries.<br/>`type-script` `java-script` `web-development` `coding-standards` `best-practices` |
|
|
279
280
|
\| [Variable Name Conversion Expert](https://chat-preview.lobehub.com/market?agent=variable-name-conversion)<br/><sup>By **[zengyishou](https://github.com/zengyishou)** on **2024-08-21**</sup> | In software development, naming variables is a common yet relatively time-consuming task. This assistant can automatically convert Chinese variable names into English variable names that conform to camelCase, PascalCase, snake_case, kebab-case, and constant naming conventions based on specific naming rules. This not only improves code readability but also alleviates the frustration of variable naming.<br/>`software-development` `variable-naming` `chinese-to-english` `code-standards` `automatic-conversion` |
|
|
280
|
-
\| [Prompt Engineering Expert](https://chat-preview.lobehub.com/market?agent=ai-prompts-assistant)<br/><sup>By **[cyicz123](https://github.com/cyicz123)** on **2024-08-12**</sup> | Specializing in prompt optimization and design<br/>`prompt-engineering` `ai-interaction` `writing` `optimization` `consulting` |
|
|
281
281
|
|
|
282
|
-
> 📊 Total agents: [<kbd>**
|
|
282
|
+
> 📊 Total agents: [<kbd>**319**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
283
283
|
|
|
284
284
|
<!-- AGENT LIST -->
|
|
285
285
|
|
package/README.zh-CN.md
CHANGED
|
@@ -263,11 +263,11 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
263
263
|
3. 将上述回答作为论据,有逻辑、条理地,使用可视化图表辅助对你的问题进行最终作答。
|
|
264
264
|
|
|
265
265
|
请告诉我你想要探讨的问题是什么?<br/>`后退提问` `思考策略` `问题分析` |
|
|
266
|
+
\| [虚幻引擎大师](https://chat-preview.lobehub.com/market?agent=unreal-engine-master)<br/><sup>By **[thedivergentai](https://github.com/thedivergentai)** on **2024-08-27**</sup> | 虚幻游戏开发助手<br/>`游戏开发` `虚幻引擎` `软件工程` |
|
|
266
267
|
\| [TypeScript 解决方案架构师](https://chat-preview.lobehub.com/market?agent=typescript-developer)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2024-08-24**</sup> | 精通 TypeScript、Node.js、Vue.js 3、Nuxt.js 3、Express.js、React.js 和现代 UI 库。<br/>`类型脚本` `java-script` `网页开发` `编码标准` `最佳实践` |
|
|
267
268
|
\| [开发变量名转换专家](https://chat-preview.lobehub.com/market?agent=variable-name-conversion)<br/><sup>By **[zengyishou](https://github.com/zengyishou)** on **2024-08-21**</sup> | 在软件开发过程中,命名变量是一项常见却相对耗时的任务。本助手能够根据特定的命名规则自动将中文变量名转换为符合小驼峰、大驼峰、下划线、横线以及常量命名规范的英文变量名。这不仅提高了代码的可读性,还解决了变量命名的苦恼。<br/>`软件开发` `变量命名` `中文转英文` `代码规范` `自动转换` |
|
|
268
|
-
\| [提示工程专家](https://chat-preview.lobehub.com/market?agent=ai-prompts-assistant)<br/><sup>By **[cyicz123](https://github.com/cyicz123)** on **2024-08-12**</sup> | 专精 Prompt 优化与设计<br/>`提示工程` `ai交互` `写作` `优化` `咨询` |
|
|
269
269
|
|
|
270
|
-
> 📊 Total agents: [<kbd>**
|
|
270
|
+
> 📊 Total agents: [<kbd>**319**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
271
271
|
|
|
272
272
|
<!-- AGENT LIST -->
|
|
273
273
|
|
|
@@ -12,7 +12,7 @@ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
|
|
|
12
12
|
# Here we take Logto as an example
|
|
13
13
|
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
|
14
14
|
NEXT_AUTH_SSO_PROVIDERS=logto
|
|
15
|
-
NEXTAUTH_URL=https://lobe
|
|
15
|
+
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
16
16
|
LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
|
|
17
17
|
LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
|
|
18
18
|
LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
|
@@ -12,7 +12,7 @@ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
|
|
|
12
12
|
# 这里以 Logto 为例
|
|
13
13
|
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
|
14
14
|
NEXT_AUTH_SSO_PROVIDERS=logto
|
|
15
|
-
NEXTAUTH_URL=https://lobe
|
|
15
|
+
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
16
16
|
LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
|
|
17
17
|
LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
|
|
18
18
|
LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
|
@@ -89,7 +89,7 @@ When deploying LobeChat, you need to configure the following environment variabl
|
|
|
89
89
|
| `NEXTAUTH_URL` | Optional | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` |
|
|
90
90
|
|
|
91
91
|
<Callout type={'tip'}>
|
|
92
|
-
Go to [📘 Environment Variables](/docs/self-hosting/environment-
|
|
92
|
+
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#github) for detailed
|
|
93
93
|
information on these variables.
|
|
94
94
|
</Callout>
|
|
95
95
|
</Steps>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 在 LobeChat 中配置 Github 身份验证服务
|
|
3
|
-
description: 学习如何在 LobeChat 中配置Github身份验证服务,包括创建新的Github App、设置权限和环境变量。
|
|
3
|
+
description: 学习如何在 LobeChat 中配置 Github 身份验证服务,包括创建新的 Github App、设置权限和环境变量。
|
|
4
4
|
tags:
|
|
5
5
|
- Github 身份验证
|
|
6
6
|
- Github App
|
|
@@ -16,9 +16,9 @@ tags:
|
|
|
16
16
|
<Steps>
|
|
17
17
|
### 创建 Github 提供应用
|
|
18
18
|
|
|
19
|
-
点击[这里](https://github.com/settings/apps/new) 创建一个新的 Github App。
|
|
19
|
+
点击 [这里](https://github.com/settings/apps/new) 创建一个新的 Github App。
|
|
20
20
|
|
|
21
|
-
填写Github App name、Homepage URL、Callbak URL
|
|
21
|
+
填写 Github App name、Homepage URL、Callbak URL
|
|
22
22
|
|
|
23
23
|
<Image
|
|
24
24
|
alt="创建 Github 提供程序"
|
|
@@ -85,7 +85,7 @@ tags:
|
|
|
85
85
|
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
|
86
86
|
|
|
87
87
|
<Callout type={'tip'}>
|
|
88
|
-
前往 [📘 环境变量](/docs/self-hosting/environment-
|
|
88
|
+
前往 [📘 环境变量](/docs/self-hosting/environment-variables/auth#github) 可查阅相关变量详情。
|
|
89
89
|
|
|
90
90
|
</Callout>
|
|
91
91
|
</Steps>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configuring Logto Authentication Service in LobeChat
|
|
3
|
+
description: >-
|
|
4
|
+
Learn how to configure Logto authentication service in LobeChat, including
|
|
5
|
+
deployment, creation, setting permissions, and environment variables.
|
|
6
|
+
tags:
|
|
7
|
+
- Logto Authentication
|
|
8
|
+
- Environment Variable Configuration
|
|
9
|
+
- Single Sign-On
|
|
10
|
+
- LobeChat
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Configuring Logto Authentication Service
|
|
14
|
+
|
|
15
|
+
[Logto](https://github.com/logto-io/logto) is an open-source authentication service with a simple and beautiful interface, rich in features and easy to use. You can choose to use the official Logto Cloud or opt for a private deployment of Logto.
|
|
16
|
+
|
|
17
|
+
<Callout type={'tip'}>
|
|
18
|
+
|
|
19
|
+
If you want to deploy Logto privately, we recommend using Docker Compose to deploy it together with the LobeChat database version. In this case, LobeChat can share the same Postgres instance with it.
|
|
20
|
+
|
|
21
|
+
</Callout>
|
|
22
|
+
|
|
23
|
+
## Logto Configuration Process
|
|
24
|
+
|
|
25
|
+
The following assumes your LobeChat database version domain is `https://lobe.example.com`.
|
|
26
|
+
|
|
27
|
+
If you are using a privately deployed Logto, assume its endpoint domain is `https://lobe-auth-api.example.com`.
|
|
28
|
+
|
|
29
|
+
If you are using Logto Cloud, assume its endpoint domain is `https://example.logto.app`.
|
|
30
|
+
|
|
31
|
+
<Steps>
|
|
32
|
+
### Create Logto Application
|
|
33
|
+
|
|
34
|
+
Access your privately deployed Logto WebUI or [Logto Cloud](http://cloud.logto.io/) to enter the console, and create a `Next.js (App Router)` application under `Applications` with any name.
|
|
35
|
+
|
|
36
|
+
### Configure Logto
|
|
37
|
+
|
|
38
|
+
Set the `Redirect URI` to `https://lobe.example.com/api/auth/callback/logto` and the `Post sign-out redirect URI` to `https://lobe.example.com/`.
|
|
39
|
+
|
|
40
|
+
Set `CORS allowed origins` to `https://lobe.example.com`.
|
|
41
|
+
|
|
42
|
+
<Image alt="Configure Logto" inStep src="https://github.com/user-attachments/assets/5b816379-c07b-40ea-bde4-df16e2e4e523" />
|
|
43
|
+
|
|
44
|
+
After successful creation, save the `Client ID` and `Client Secret`.
|
|
45
|
+
|
|
46
|
+
### Configure Environment Variables
|
|
47
|
+
|
|
48
|
+
<Image alt="Configure Environment Variables" inStep src="https://github.com/user-attachments/assets/15af6d94-af4f-4aa9-bbab-7a46e9f9e837" />
|
|
49
|
+
|
|
50
|
+
Set the obtained `Client ID` and `Client Secret` as `LOGTO_CLIENT_ID` and `LOGTO_CLIENT_SECRET` in the LobeChat environment variables.
|
|
51
|
+
|
|
52
|
+
Configure `LOGTO_ISSUER` in the LobeChat environment variables as follows:
|
|
53
|
+
|
|
54
|
+
- `https://lobe-auth-api.example.com/oidc` if you are using a privately deployed Logto
|
|
55
|
+
- `https://example.logto.app/oidc` if you are using Logto Cloud
|
|
56
|
+
|
|
57
|
+
When deploying LobeChat, you need to configure the following environment variables:
|
|
58
|
+
|
|
59
|
+
| Environment Variable | Type | Description |
|
|
60
|
+
| ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32` |
|
|
62
|
+
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. For Logto, enter `logto`. |
|
|
63
|
+
| `LOGTO_CLIENT_ID` | Required | The Client ID from the Logto App details page |
|
|
64
|
+
| `LOGTO_CLIENT_SECRET` | Required | The Client Secret from the Logto App details page |
|
|
65
|
+
| `LOGTO_ISSUER` | Required | OpenID Connect issuer of the Logto provider |
|
|
66
|
+
| `NEXTAUTH_URL` | Optional | This URL specifies the callback address for Auth.js during OAuth verification, needed only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` |
|
|
67
|
+
|
|
68
|
+
<Callout type={'tip'}>
|
|
69
|
+
Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#logto) for details on related variables.
|
|
70
|
+
|
|
71
|
+
</Callout>
|
|
72
|
+
</Steps>
|
|
73
|
+
|
|
74
|
+
<Callout type={'info'}>After successful deployment, users will be able to authenticate via Logto and use LobeChat.</Callout>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在 LobeChat 中配置 Logto 身份验证服务
|
|
3
|
+
description: 学习如何在 LobeChat 中配置 Logto 身份验证服务,包括部署、创建、设置权限和环境变量。
|
|
4
|
+
tags:
|
|
5
|
+
- Logto 身份验证
|
|
6
|
+
- 环境变量配置
|
|
7
|
+
- 单点登录
|
|
8
|
+
- LobeChat
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# 配置 Logto 身份验证服务
|
|
12
|
+
|
|
13
|
+
[Logto](https://github.com/logto-io/logto) 是一个开源的身份验证服务,界面简洁美观、功能配置丰富且易于上手,你即可以选择使用其官方提供的 Logto Cloud,也可以选择私有部署 Logto。
|
|
14
|
+
|
|
15
|
+
<Callout type={'tip'}>
|
|
16
|
+
若你想要私有部署 Logto,我们建议你将之与 LobeChat 数据库版本一同使用 Docker Compose 部署,此时 LobeChat 可以与之共用同一个 Postgres 实例。
|
|
17
|
+
</Callout>
|
|
18
|
+
|
|
19
|
+
## Logto 配置流程
|
|
20
|
+
|
|
21
|
+
下文假设你的 LobeChat 数据库版本域名为 `https://lobe.example.com`。
|
|
22
|
+
|
|
23
|
+
若你是私有部署的 Logto,假设其 endpoint 域名为 `https://lobe-auth-api.example.com`。
|
|
24
|
+
|
|
25
|
+
若你是使用的 Logto Cloud,假设其 endpoint 域名为 `https://example.logto.app`。
|
|
26
|
+
|
|
27
|
+
<Steps>
|
|
28
|
+
### 创建 Logto 应用
|
|
29
|
+
|
|
30
|
+
访问你私有部署的 Logto WebUI 或者 [Logto Cloud](http://cloud.logto.io/) 进入控制台,在 `Applications` 里创建一个 `Next.js (App Router)` 应用,名称随意
|
|
31
|
+
|
|
32
|
+
### 配置 Logto
|
|
33
|
+
|
|
34
|
+
配置 `Redirect URI` 为 `https://lobe.example.com/api/auth/callback/logto`,`Post sign-out redirect URI` 为 `https://lobe.example.com/`
|
|
35
|
+
|
|
36
|
+
配置 `CORS allowed origins` 为 `https://lobe.example.com`
|
|
37
|
+
|
|
38
|
+
<Image
|
|
39
|
+
alt="配置 Logto"
|
|
40
|
+
inStep
|
|
41
|
+
src="https://github.com/user-attachments/assets/5b816379-c07b-40ea-bde4-df16e2e4e523"
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
创建成功后, 将 `Client ID` 和 `Client Secret` 保存下来。
|
|
45
|
+
|
|
46
|
+
### 配置环境变量
|
|
47
|
+
|
|
48
|
+
<Image
|
|
49
|
+
alt="配置环境变量"
|
|
50
|
+
inStep
|
|
51
|
+
src="https://github.com/user-attachments/assets/15af6d94-af4f-4aa9-bbab-7a46e9f9e837"
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
将获取到的 `Client ID` 和 `Client Secret`,设为 LobeChat 环境变量中的 `LOGTO_CLIENT_ID` 和 `LOGTO_CLIENT_SECRETT`。
|
|
55
|
+
|
|
56
|
+
配置 LobeChat 环境变量中 `LOGTO_ISSUER` 为:
|
|
57
|
+
|
|
58
|
+
- `https://lobe-auth-api.example.com/oidc`,若你是私有部署的 Logto
|
|
59
|
+
- `https://example.logto.app/oidc`,若你是使用的 Logto Cloud
|
|
60
|
+
|
|
61
|
+
在部署 LobeChat 时,你需要配置以下环境变量:
|
|
62
|
+
|
|
63
|
+
| 环境变量 | 类型 | 描述 |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
|
66
|
+
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Logto 请填写 `logto`。 |
|
|
67
|
+
| `LOGTO_CLIENT_ID` | 必选 | Logto App 详情页的 Client ID |
|
|
68
|
+
| `LOGTO_CLIENT_SECRET` | 必选 | Logto App 详情页的 Client Secret |
|
|
69
|
+
| `LOGTO_ISSUER` | 必选 | Logto 提供程序的 OpenID Connect 颁发者 |
|
|
70
|
+
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` |
|
|
71
|
+
|
|
72
|
+
<Callout type={'tip'}>
|
|
73
|
+
前往 [📘 环境变量](/docs/self-hosting/environment-variables/auth#logto) 可查阅相关变量详情。
|
|
74
|
+
|
|
75
|
+
</Callout>
|
|
76
|
+
</Steps>
|
|
77
|
+
|
|
78
|
+
<Callout type={'info'}>部署成功后,用户将可以通过 Logto 身份认证并使用 LobeChat。</Callout>
|
|
@@ -194,6 +194,27 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
|
194
194
|
- Default: `-`
|
|
195
195
|
- Example: `https://your-instance-abc123.zitadel.cloud`
|
|
196
196
|
|
|
197
|
+
#### `LOGTO_CLIENT_ID`
|
|
198
|
+
|
|
199
|
+
- Type: Required
|
|
200
|
+
- Description: The Client ID of the Logto application. You can find it in the Logto console for private deployment or [Logto Cloud](http://cloud.logto.io/) depending on the deployment mode.
|
|
201
|
+
- Default value: `-`
|
|
202
|
+
- Example: `123456789012345678@your-project`
|
|
203
|
+
|
|
204
|
+
#### `LOGTO_CLIENT_SECRET`
|
|
205
|
+
|
|
206
|
+
- Type: Required
|
|
207
|
+
- Description: The Client Secret of the Logto application.
|
|
208
|
+
- Default value: `-`
|
|
209
|
+
- Example: `9QF1n5ATzU7Z3mHp2Iw4gKX8kY6oR7uW1DnKcV3LqX2jF6iG3fBmJ1kV7nS5zE6A`
|
|
210
|
+
|
|
211
|
+
#### `LOGTO_ISSUER`
|
|
212
|
+
|
|
213
|
+
- Type: Required
|
|
214
|
+
- Description: The OpenID Connect issuer of the Logto application. You can find it in the Logto console for private deployment or [Logto Cloud](http://cloud.logto.io/) depending on the deployment mode.
|
|
215
|
+
- Default value: `-`
|
|
216
|
+
- Example: `https://lobe-auth-api.example.com/oidc`
|
|
217
|
+
|
|
197
218
|
<Callout>
|
|
198
219
|
Currently, we only support providers above. If you need to use other identity verification service
|
|
199
220
|
providers, you can submit a [feature
|
|
@@ -157,17 +157,17 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
|
157
157
|
|
|
158
158
|
#### `GITHUB_CLIENT_ID`
|
|
159
159
|
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
160
|
+
- 类型:必选
|
|
161
|
+
- 描述: Github 应用的客户端 ID。您可以在[这里](https://github.com/settings/apps)访问,并导航到应用程序设置以查看。
|
|
162
|
+
- 默认值: `-`
|
|
163
|
+
- 示例: `abd94200333283550508`
|
|
164
164
|
|
|
165
165
|
#### `GITHUB_CLIENT_SECRET`
|
|
166
166
|
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
167
|
+
- 类型:必选
|
|
168
|
+
- 描述: Github应用的客户端密钥。
|
|
169
|
+
- 默认值: `-`
|
|
170
|
+
- 示例: `dd262976ac0931d947e104891586a053f3d3750b`
|
|
171
171
|
|
|
172
172
|
### ZITADEL
|
|
173
173
|
|
|
@@ -192,6 +192,29 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
|
192
192
|
- 默认值:`-`
|
|
193
193
|
- 示例:`https://your-instance-abc123.zitadel.cloud`
|
|
194
194
|
|
|
195
|
+
### Logto
|
|
196
|
+
|
|
197
|
+
#### `LOGTO_CLIENT_ID`
|
|
198
|
+
|
|
199
|
+
- 类型:必选
|
|
200
|
+
- 描述:Logto 应用程序的 Client ID。您可以在根据部署模式,在私有部署的 Logto 控制台或 [Logto Cloud](http://cloud.logto.io/) 中找到。
|
|
201
|
+
- 默认值:`-`
|
|
202
|
+
- 示例:`123456789012345678@your-project`
|
|
203
|
+
|
|
204
|
+
#### `LOGTO_CLIENT_SECRET`
|
|
205
|
+
|
|
206
|
+
- 类型:必选
|
|
207
|
+
- 描述:Logto 应用程序的 Client Secret。
|
|
208
|
+
- 默认值:`-`
|
|
209
|
+
- 示例:`9QF1n5ATzU7Z3mHp2Iw4gKX8kY6oR7uW1DnKcV3LqX2jF6iG3fBmJ1kV7nS5zE6A`
|
|
210
|
+
|
|
211
|
+
#### `LOGTO_ISSUER`
|
|
212
|
+
|
|
213
|
+
- 类型:必选
|
|
214
|
+
- 描述:Logto 应用程序的 OpenID Connect 颁发者(issuer)。根据部署模式,您可以在私有部署的 Logto 控制台或 [Logto Cloud](http://cloud.logto.io/) 中找到。
|
|
215
|
+
- 默认值:`-`
|
|
216
|
+
- 示例:`https://lobe-auth-api.example.com/oidc`
|
|
217
|
+
|
|
195
218
|
<Callout>
|
|
196
219
|
如果您需要使用其他身份验证服务提供商,可以提交
|
|
197
220
|
[功能请求](https://github.com/lobehub/lobe-chat/issues/new/choose) 或 Pull Request。
|
|
@@ -141,7 +141,7 @@ You have successfully deployed the LobeChat database version, and you can access
|
|
|
141
141
|
If you encounter issues, please check the Docker logs and console logs, and follow the detailed troubleshooting guide later in the document.
|
|
142
142
|
|
|
143
143
|
```sh
|
|
144
|
-
docker logs -f lobe-
|
|
144
|
+
docker logs -f lobe-database
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
If you see the following logs in the container, it indicates that it has started successfully:
|
|
@@ -214,7 +214,7 @@ Refer to the example configurations in the appendix of this article.
|
|
|
214
214
|
You can check the logs using the following command:
|
|
215
215
|
|
|
216
216
|
```sh
|
|
217
|
-
docker logs -f lobe-
|
|
217
|
+
docker logs -f lobe-database
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
<Callout type="tip">
|
|
@@ -257,17 +257,26 @@ You need to first access the WebUI for configuration:
|
|
|
257
257
|
|
|
258
258
|
4. Set `CORS allowed origins` to `https://lobe.example.com`.
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
<Image
|
|
261
|
+
alt="Configure Logto"
|
|
262
|
+
src="https://github.com/user-attachments/assets/5b816379-c07b-40ea-bde4-df16e2e4e523"
|
|
263
|
+
/>
|
|
261
264
|
|
|
262
265
|
5. Obtain `Client ID` and `Client Secret`, and fill them into your `.env` file under `LOGTO_CLIENT_ID` and `LOGTO_CLIENT_SECRET`.
|
|
263
266
|
|
|
264
267
|
6. Set `LOGTO_ISSUER` in your `.env` file to `https://lobe-auth-api.example.com/oidc`.
|
|
265
268
|
|
|
266
|
-
|
|
269
|
+
<Image
|
|
270
|
+
alt="Configure environment variables"
|
|
271
|
+
src="https://github.com/user-attachments/assets/15af6d94-af4f-4aa9-bbab-7a46e9f9e837"
|
|
272
|
+
/>
|
|
267
273
|
|
|
268
274
|
7. Optional: In the left panel under `Sign-in experience`, in `Sign-up and sign-in - Advanced Options`, disable `Enable user registration` to prohibit user self-registration. If you disable user self-registration, you can only manually add users in the left panel under `User Management`.
|
|
269
275
|
|
|
270
|
-
|
|
276
|
+
<Image
|
|
277
|
+
alt="Disable user registration"
|
|
278
|
+
src="https://github.com/user-attachments/assets/6b2e6f7b-fec5-41c6-864a-a1add40f74a0"
|
|
279
|
+
/>
|
|
271
280
|
|
|
272
281
|
8. Restart the LobeChat service:
|
|
273
282
|
|
|
@@ -302,17 +311,29 @@ You need to first access the WebUI for configuration:
|
|
|
302
311
|
|
|
303
312
|
2. In the left panel under Administer / Buckets, click `Create Bucket`, enter `lobe` (corresponding to your `S3_BUCKET` environment variable), and then click `Create`.
|
|
304
313
|
|
|
305
|
-
|
|
314
|
+
<Image
|
|
315
|
+
alt="Create a bucket"
|
|
316
|
+
src="https://github.com/user-attachments/assets/79f44a13-00d3-4302-a6bc-5f4c6cdbffab"
|
|
317
|
+
/>
|
|
306
318
|
|
|
307
319
|
3. Select your bucket, click Summary - Access Policy, edit, choose `Custom`, and input the content from `minio-bucket-config.json` (see appendix) and save (again, assuming your bucket name is `lobe`):
|
|
308
320
|
|
|
309
|
-
|
|
321
|
+
<Image
|
|
322
|
+
alt="Select MinIO bucket policy"
|
|
323
|
+
src="https://github.com/user-attachments/assets/57032a82-7604-45d3-ba12-884af6fbcb7c"
|
|
324
|
+
/>
|
|
310
325
|
|
|
311
|
-
|
|
326
|
+
<Image
|
|
327
|
+
alt="Configure MinIO bucket policy"
|
|
328
|
+
src="https://github.com/user-attachments/assets/d8109f4e-71fc-4ba8-8402-ede92669d5e0"
|
|
329
|
+
/>
|
|
312
330
|
|
|
313
331
|
4. In the left panel under User / Access Keys, click `Create New Access Key`, make no additional modifications, and fill the generated `Access Key` and `Secret Key` into your `.env` file under `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`.
|
|
314
332
|
|
|
315
|
-
|
|
333
|
+
<Image
|
|
334
|
+
alt="Create a new access key"
|
|
335
|
+
src="https://github.com/user-attachments/assets/72f02ce5-9991-425b-9864-9113ee1ed6bf"
|
|
336
|
+
/>
|
|
316
337
|
|
|
317
338
|
5. Restart the LobeChat service:
|
|
318
339
|
|
|
@@ -343,7 +364,7 @@ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
|
|
|
343
364
|
# Here we take Logto as an example
|
|
344
365
|
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
|
345
366
|
NEXT_AUTH_SSO_PROVIDERS=logto
|
|
346
|
-
NEXTAUTH_URL=https://lobe
|
|
367
|
+
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
347
368
|
LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
|
|
348
369
|
LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
|
|
349
370
|
LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
|
@@ -64,7 +64,7 @@ docker compose up -d
|
|
|
64
64
|
|
|
65
65
|
1. 打开 `http://localhost:3002`,访问 Logto WebUI,注册管理员账号
|
|
66
66
|
|
|
67
|
-
2. 创建一个 `Next.js (App Router)`
|
|
67
|
+
2. 创建一个 `Next.js (App Router)` 应用,添加以下配置:
|
|
68
68
|
|
|
69
69
|
- `Redirect URI` 为 `http://localhost:3210/api/auth/callback/logto`
|
|
70
70
|
- `Post sign-out redirect URI` 为 `http://localhost:3210/`
|
|
@@ -139,7 +139,7 @@ docker compose up -d
|
|
|
139
139
|
如果你遇到问题,请尝试查看 Docker 日志和控制台日志,并根据后文的详细指引进行排查。
|
|
140
140
|
|
|
141
141
|
```sh
|
|
142
|
-
docker logs -f lobe-
|
|
142
|
+
docker logs -f lobe-database
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
如果你在容器中看到了以下日志,则说明已经启动成功:
|
|
@@ -211,7 +211,7 @@ docker logs -f lobe-chat-database
|
|
|
211
211
|
你可以使用下述指令检查日志:
|
|
212
212
|
|
|
213
213
|
```sh
|
|
214
|
-
docker logs -f lobe-
|
|
214
|
+
docker logs -f lobe-database
|
|
215
215
|
```
|
|
216
216
|
|
|
217
217
|
<Callout type="tip">
|
|
@@ -253,17 +253,26 @@ docker compose up -d # 重新启动
|
|
|
253
253
|
|
|
254
254
|
4. 配置 `CORS allowed origins` 为 `https://lobe.example.com`
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
<Image
|
|
257
|
+
alt="配置 Logto"
|
|
258
|
+
src="https://github.com/user-attachments/assets/5b816379-c07b-40ea-bde4-df16e2e4e523"
|
|
259
|
+
/>
|
|
257
260
|
|
|
258
261
|
5. 获取 `Client ID` 和 `Client Secret`,填入你的 `.env` 文件中的 `LOGTO_CLIENT_ID` 和 `LOGTO_CLIENT_SECRETT` 中
|
|
259
262
|
|
|
260
263
|
6. 配置你的 `.env` 文件中 `LOGTO_ISSUER` 为 `https://lobe-auth-api.example.com/oidc`
|
|
261
264
|
|
|
262
|
-
|
|
265
|
+
<Image
|
|
266
|
+
alt="配置 Logto 环境变量"
|
|
267
|
+
src="https://github.com/user-attachments/assets/15af6d94-af4f-4aa9-bbab-7a46e9f9e837"
|
|
268
|
+
/>
|
|
263
269
|
|
|
264
270
|
7. 可选,在左侧 `Sign-in experience` 面板的 `Sign-up and sign-in - Advanced Options` 中关闭 `Enable user registration`,禁止用户自行注册。如果你禁止了用户自行注册,那么你只能在左侧 `User Management` 里手动添加用户。
|
|
265
271
|
|
|
266
|
-
|
|
272
|
+
<Image
|
|
273
|
+
alt="关闭用户注册"
|
|
274
|
+
src="https://github.com/user-attachments/assets/6b2e6f7b-fec5-41c6-864a-a1add40f74a0"
|
|
275
|
+
/>
|
|
267
276
|
|
|
268
277
|
8. 重启 LobeChat 服务:
|
|
269
278
|
|
|
@@ -297,17 +306,29 @@ docker compose up -d # 重新启动
|
|
|
297
306
|
|
|
298
307
|
2. 在左侧面板 Administer / Buckets 中点击 `Create Bucket`,输入 `lobe`(对应你的 `S3_BUCKET` 环境变量),然后点击 `Create`
|
|
299
308
|
|
|
300
|
-
|
|
309
|
+
<Image
|
|
310
|
+
alt="创建 MinIO 桶"
|
|
311
|
+
src="https://github.com/user-attachments/assets/79f44a13-00d3-4302-a6bc-5f4c6cdbffab"
|
|
312
|
+
/>
|
|
301
313
|
|
|
302
314
|
3. 选中你的桶,点击 Summary - Access Policy,编辑,选择 `Custom`,输入 `minio-bucket-config.json` 中的内容(见附录)并保存(同样默认你的桶名为 `lobe`):
|
|
303
315
|
|
|
304
|
-
|
|
316
|
+
<Image
|
|
317
|
+
alt="选中 MinIO 桶策略"
|
|
318
|
+
src="https://github.com/user-attachments/assets/57032a82-7604-45d3-ba12-884af6fbcb7c"
|
|
319
|
+
/>
|
|
305
320
|
|
|
306
|
-
|
|
321
|
+
<Image
|
|
322
|
+
alt="配置 MinIO 桶策略"
|
|
323
|
+
src="https://github.com/user-attachments/assets/d8109f4e-71fc-4ba8-8402-ede92669d5e0"
|
|
324
|
+
/>
|
|
307
325
|
|
|
308
326
|
4. 在左侧面板 User / Access Keys 处,点击 `Create New Access Key`,无需额外修改,将生成的 `Access Key` 和 `Secret Key` 填入你的 `.env` 文件中的 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 中
|
|
309
327
|
|
|
310
|
-
|
|
328
|
+
<Image
|
|
329
|
+
alt="创建 MinIO 访问密钥"
|
|
330
|
+
src="https://github.com/user-attachments/assets/72f02ce5-9991-425b-9864-9113ee1ed6bf"
|
|
331
|
+
/>
|
|
311
332
|
|
|
312
333
|
5. 重启 LobeChat 服务:
|
|
313
334
|
|
|
@@ -338,7 +359,7 @@ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
|
|
|
338
359
|
# 这里以 Logto 为例
|
|
339
360
|
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
|
340
361
|
NEXT_AUTH_SSO_PROVIDERS=logto
|
|
341
|
-
NEXTAUTH_URL=https://lobe
|
|
362
|
+
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
342
363
|
LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
|
|
343
364
|
LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
|
|
344
365
|
LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.5",
|
|
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",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@langchain/community": "^0.2.31",
|
|
120
120
|
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
|
121
121
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
|
122
|
-
"@lobehub/icons": "^1.
|
|
122
|
+
"@lobehub/icons": "^1.30.0",
|
|
123
123
|
"@lobehub/tts": "^1.24.3",
|
|
124
124
|
"@lobehub/ui": "^1.149.2",
|
|
125
125
|
"@neondatabase/serverless": "^0.9.4",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ModelTag } from '@lobehub/icons';
|
|
1
2
|
import isEqual from 'fast-deep-equal';
|
|
2
3
|
import { memo } from 'react';
|
|
3
4
|
import { Flexbox } from 'react-layout-kit';
|
|
4
5
|
|
|
5
|
-
import ModelTag from '@/components/ModelTag';
|
|
6
6
|
import ModelSwitchPanel from '@/features/ModelSwitchPanel';
|
|
7
7
|
import { useAgentStore } from '@/store/agent';
|
|
8
8
|
import { agentSelectors } from '@/store/agent/selectors';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ModelTag } from '@lobehub/icons';
|
|
1
2
|
import { Avatar, ChatHeaderTitle, Markdown } from '@lobehub/ui';
|
|
2
3
|
import { LobeChat } from '@lobehub/ui/brand';
|
|
3
4
|
import { memo } from 'react';
|
|
@@ -5,7 +6,6 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
6
|
import { Flexbox } from 'react-layout-kit';
|
|
6
7
|
|
|
7
8
|
import pkg from '@/../package.json';
|
|
8
|
-
import ModelTag from '@/components/ModelTag';
|
|
9
9
|
import ChatList from '@/features/Conversation/components/ChatList';
|
|
10
10
|
import { useAgentStore } from '@/store/agent';
|
|
11
11
|
import { agentSelectors } from '@/store/agent/selectors';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ModelTag } from '@lobehub/icons';
|
|
1
2
|
import { memo, useMemo, useState } from 'react';
|
|
2
3
|
import { Flexbox } from 'react-layout-kit';
|
|
3
4
|
import { shallow } from 'zustand/shallow';
|
|
4
5
|
|
|
5
|
-
import ModelTag from '@/components/ModelTag';
|
|
6
6
|
import { useAgentStore } from '@/store/agent';
|
|
7
7
|
import { agentSelectors } from '@/store/agent/selectors';
|
|
8
8
|
import { useChatStore } from '@/store/chat';
|