@lobehub/chat 1.33.3 → 1.33.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.
Files changed (96) hide show
  1. package/.i18nrc.js +8 -2
  2. package/.releaserc.js +10 -1
  3. package/CHANGELOG.md +51 -16624
  4. package/changelog/CHANGELOG.v0.md +16621 -0
  5. package/changelog/v0.json +6064 -0
  6. package/changelog/v1.json +3347 -0
  7. package/docs/changelog/2024-11-25-november-providers.mdx +19 -0
  8. package/docs/changelog/2024-11-25-november-providers.zh-CN.mdx +17 -0
  9. package/docs/changelog/index.json +12 -0
  10. package/docs/changelog/schema.json +70 -0
  11. package/docs/self-hosting/advanced/auth/clerk.mdx +19 -23
  12. package/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx +5 -4
  13. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +2 -4
  14. package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +3 -5
  15. package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +2 -2
  16. package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +49 -44
  17. package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +42 -41
  18. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +29 -21
  19. package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +2 -1
  20. package/docs/self-hosting/advanced/auth.mdx +10 -10
  21. package/docs/self-hosting/advanced/auth.zh-CN.mdx +10 -10
  22. package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -1
  23. package/docs/self-hosting/advanced/model-list.mdx +1 -1
  24. package/docs/self-hosting/advanced/s3/cloudflare-r2.mdx +17 -12
  25. package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +33 -20
  26. package/docs/self-hosting/advanced/s3.mdx +31 -28
  27. package/docs/self-hosting/advanced/s3.zh-CN.mdx +1 -0
  28. package/docs/self-hosting/advanced/webrtc.mdx +1 -0
  29. package/docs/self-hosting/environment-variables/s3.mdx +4 -3
  30. package/docs/self-hosting/environment-variables/s3.zh-CN.mdx +1 -0
  31. package/docs/self-hosting/environment-variables.mdx +6 -9
  32. package/docs/self-hosting/platform/alibaba-cloud.mdx +1 -2
  33. package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -2
  34. package/docs/self-hosting/platform/btpanel.mdx +7 -13
  35. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +8 -13
  36. package/docs/self-hosting/platform/docker.zh-CN.mdx +2 -1
  37. package/docs/self-hosting/platform/netlify.zh-CN.mdx +2 -1
  38. package/docs/self-hosting/server-database/docker.mdx +18 -5
  39. package/docs/self-hosting/server-database/docker.zh-CN.mdx +9 -6
  40. package/docs/self-hosting/server-database/netlify.mdx +0 -1
  41. package/docs/self-hosting/server-database/railway.mdx +0 -1
  42. package/docs/self-hosting/server-database/repocloud.mdx +5 -2
  43. package/docs/self-hosting/server-database/repocloud.zh-CN.mdx +23 -3
  44. package/docs/self-hosting/server-database/sealos.mdx +3 -0
  45. package/docs/self-hosting/server-database/vercel.mdx +35 -32
  46. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +25 -25
  47. package/docs/self-hosting/server-database/zeabur.mdx +2 -2
  48. package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +3 -4
  49. package/docs/self-hosting/server-database.mdx +23 -8
  50. package/docs/self-hosting/start.mdx +8 -2
  51. package/docs/usage/features/database.zh-CN.mdx +1 -1
  52. package/docs/usage/foundation/text2image.mdx +1 -2
  53. package/docs/usage/foundation/text2image.zh-CN.mdx +1 -3
  54. package/docs/usage/providers/ai21.mdx +14 -15
  55. package/docs/usage/providers/ai21.zh-CN.mdx +1 -3
  56. package/docs/usage/providers/ai360.mdx +14 -15
  57. package/docs/usage/providers/ai360.zh-CN.mdx +1 -3
  58. package/docs/usage/providers/cloudflare.mdx +1 -1
  59. package/docs/usage/providers/fireworksai.mdx +19 -19
  60. package/docs/usage/providers/fireworksai.zh-CN.mdx +1 -3
  61. package/docs/usage/providers/github.mdx +22 -21
  62. package/docs/usage/providers/github.zh-CN.mdx +6 -6
  63. package/docs/usage/providers/hunyuan.mdx +17 -18
  64. package/docs/usage/providers/hunyuan.zh-CN.mdx +1 -3
  65. package/docs/usage/providers/siliconcloud.mdx +14 -15
  66. package/docs/usage/providers/siliconcloud.zh-CN.mdx +3 -5
  67. package/docs/usage/providers/spark.mdx +17 -18
  68. package/docs/usage/providers/spark.zh-CN.mdx +1 -3
  69. package/docs/usage/providers/upstage.mdx +14 -15
  70. package/docs/usage/providers/upstage.zh-CN.mdx +1 -3
  71. package/docs/usage/providers/wenxin.mdx +17 -18
  72. package/docs/usage/providers/wenxin.zh-CN.mdx +1 -3
  73. package/docs/usage/providers/zeroone.mdx +2 -2
  74. package/locales/ar/providers.json +3 -0
  75. package/locales/bg-BG/providers.json +3 -0
  76. package/locales/de-DE/providers.json +3 -0
  77. package/locales/en-US/providers.json +3 -0
  78. package/locales/es-ES/providers.json +3 -0
  79. package/locales/fa-IR/providers.json +3 -0
  80. package/locales/fr-FR/providers.json +3 -0
  81. package/locales/it-IT/providers.json +3 -0
  82. package/locales/ja-JP/providers.json +3 -0
  83. package/locales/ko-KR/providers.json +3 -0
  84. package/locales/nl-NL/providers.json +3 -0
  85. package/locales/pl-PL/providers.json +3 -0
  86. package/locales/pt-BR/providers.json +3 -0
  87. package/locales/ru-RU/providers.json +3 -0
  88. package/locales/tr-TR/providers.json +3 -0
  89. package/locales/vi-VN/providers.json +3 -0
  90. package/locales/zh-CN/providers.json +3 -0
  91. package/locales/zh-TW/providers.json +3 -0
  92. package/package.json +6 -1
  93. package/scripts/changelogWorkflow/buildStaticChangelog.ts +135 -0
  94. package/scripts/changelogWorkflow/const.ts +11 -0
  95. package/scripts/changelogWorkflow/index.ts +10 -0
  96. package/src/server/modules/AgentRuntime/index.ts +21 -219
@@ -20,15 +20,19 @@ tags:
20
20
  </div>
21
21
 
22
22
  <Callout type="info">
23
- 本文已经假定你了解了 LobeChat 服务端数据库版本(下简称 DB 版)的部署基本原理和流程,因此只包含核心环境变量配置的内容。如果你还不了解 LobeChat DB 版的部署原理,请先查阅 [使用服务端数据库部署](/zh/docs/self-hosting/server-database) 。
24
- 此外,针对国内的腾讯云储存桶用户,可查询[配置腾讯云 COS 存储服务](/zh/docs/self-hosting/advanced/s3/tencent-cloud)。
23
+ 本文已经假定你了解了 LobeChat 服务端数据库版本(下简称 DB
24
+ 版)的部署基本原理和流程,因此只包含核心环境变量配置的内容。如果你还不了解 LobeChat DB
25
+ 版的部署原理,请先查阅 [使用服务端数据库部署](/zh/docs/self-hosting/server-database) 。
26
+ 此外,针对国内的腾讯云储存桶用户,可查询[配置腾讯云 COS
27
+ 存储服务](/zh/docs/self-hosting/advanced/s3/tencent-cloud)。
25
28
  </Callout>
26
29
 
27
30
  <Callout type="warning">
28
31
  由于无法使用 Docker 环境变量暴露 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,使用 Docker / Docker Compose
29
32
  部署 LobeChat 时,你不能使用 Clerk 作为登录鉴权服务。
30
33
 
31
- 如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。
34
+ 如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。
35
+
32
36
  </Callout>
33
37
 
34
38
  ## 在 Linux 服务器上部署
@@ -83,10 +87,10 @@ AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com
83
87
  S3_ACCESS_KEY_ID=xxxxxxxxxx
84
88
  S3_SECRET_ACCESS_KEY=xxxxxxxxxx
85
89
  # 用于 S3 API 访问的域名
86
- S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com
90
+ S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com
87
91
  S3_BUCKET=lobechat
88
92
  # 用于外网访问 S3 的公共域名,需配置 CORS
89
- S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
93
+ S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
90
94
  # S3_REGION=ap-chengdu # 如果需要指定地域
91
95
 
92
96
  # 其他环境变量,视需求而定
@@ -163,7 +167,6 @@ $ docker run -it -d --name lobe-chat-database -p 3210:3210 \
163
167
  ,将会走到自身容器的 `localhost`,此时请尝试用 `host.docker.internal` 替代 `localhost`
164
168
  </Callout>
165
169
 
166
-
167
170
  [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
168
171
  [docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobe-chat-database?color=45cc11&labelColor=black&style=flat-square
169
172
  [docker-release-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
@@ -11,4 +11,3 @@ tags:
11
11
  # Deploy LobeChat with Database on Netlify
12
12
 
13
13
  TODO
14
-
@@ -11,4 +11,3 @@ tags:
11
11
  # Deploy LobeChat with Database on Railway
12
12
 
13
13
  TODO
14
-
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Deploy LobeChat with Database on RepoCloud
3
- description: Learn how to deploy LobeChat on RepoCloud with ease, including: database, authentication and S3 storage service.
3
+ description: >-
4
+ Learn how to deploy LobeChat on RepoCloud with ease, including database,
5
+ authentication and S3 storage service.
4
6
  tags:
5
7
  - Deploy LobeChat
6
8
  - RepoCloud Deployment
@@ -15,7 +17,8 @@ If you want to deploy LobeChat Database Edition on RepoCloud, you can follow the
15
17
  ## RepoCloud Deployment Process
16
18
 
17
19
  <Steps>
18
- ### Prepare your OpenAI API Key
20
+
21
+ ### Prepare your OpenAI API Key
19
22
 
20
23
  Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key.
21
24
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: 在 RepoCloud 上部署 LobeChat 数据库版
3
- description: 学习如何在RepoCloud上部署LobeChat应用,包括准备OpenAI API Key、点击部署按钮、绑定自定义域名等操作。
3
+ description: 学习如何在 RepoCloud 上部署 LobeChat 应用,包括准备 OpenAI API Key、点击部署按钮、绑定自定义域名等操作。
4
4
  tags:
5
5
  - RepoCloud
6
6
  - LobeChat
@@ -9,6 +9,26 @@ tags:
9
9
  - 自定义域名
10
10
  ---
11
11
 
12
- # 使用 RepoCloud 部署 LobeChat 数据库版
12
+ # RepoCloud 上部署 LobeChat 数据库版
13
13
 
14
- TODO
14
+ 如果您想在RepoCloud上部署LobeChat数据库版,可以按照以下步骤进行操作:
15
+
16
+ ## RepoCloud部署流程
17
+
18
+ <Steps>
19
+
20
+ ### 准备您的 OpenAI API 密钥
21
+
22
+ 请访问 [OpenAI API密钥](https://platform.openai.com/account/api-keys) 获取您的OpenAI API密钥。
23
+
24
+ ### 一键部署
25
+
26
+ [![部署到RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248)
27
+
28
+ ### 部署完成后,您可以开始使用
29
+
30
+ ### 绑定自定义域名(可选)
31
+
32
+ 您可以使用RepoCloud提供的子域名,或选择绑定自定义域名。目前,RepoCloud提供的域名尚未被污染,大多数地区可以直接连接。
33
+
34
+ </Steps>
@@ -10,3 +10,6 @@ tags:
10
10
  - Custom Domain Binding
11
11
  ---
12
12
 
13
+ # Deploy LobeChat on SealOS
14
+
15
+ TODO
@@ -15,6 +15,7 @@ tags:
15
15
  This article will detail how to deploy the server database version of LobeChat on Vercel, including: 1) database configuration; 2) identity authentication service configuration; 3) steps for setting up the S3 storage service.
16
16
 
17
17
  <Callout type={'warning'}>
18
+
18
19
  Before proceeding, please make sure of the following:
19
20
 
20
21
  - Export all data, as after deploying the server-side database, existing user data cannot be automatically migrated and can only be manually imported after backup!
@@ -42,7 +43,7 @@ In Vercel's deployment environment variables, add `DATABASE_URL` and other envir
42
43
 
43
44
  <Tabs items={['Serverless Postgres', 'Node Postgres']}>
44
45
 
45
- <Tab>
46
+ <Tab>
46
47
 
47
48
  <Callout type={'warning'}>
48
49
  Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to
@@ -68,8 +69,8 @@ An example of filling in Vercel is as follows:
68
69
 
69
70
  </Tab>
70
71
 
71
- <Tab>
72
- Variables to be filled for Node Postgres are as follows:
72
+ <Tab>
73
+ Variables to be filled for Node Postgres are as follows:
73
74
 
74
75
  ```shell
75
76
  # Node Postgres DB Url
@@ -93,10 +94,12 @@ An example of filling in Vercel is as follows:
93
94
 
94
95
  </Tabs>
95
96
 
96
- <Callout type={'info'}>
97
- If you wish to enable SSL when connecting to the database, please refer to the
98
- [link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)
99
- for setup instructions.
97
+ <Callout type={'info'}>
98
+
99
+ If you wish to enable SSL when connecting to the database, please refer to the
100
+ [link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)
101
+ for setup instructions.
102
+
100
103
  </Callout>
101
104
 
102
105
  ### Add the `KEY_VAULTS_SECRET` Environment Variable
@@ -125,9 +128,11 @@ The server-side database needs to be paired with a user authentication service t
125
128
 
126
129
  Go to [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key.
127
130
 
128
- <Callout type={'info'}>
129
- If you are not familiar with Clerk, you can refer to [Authentication
130
- Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk.
131
+ <Callout type={'info'}>
132
+
133
+ If you are not familiar with Clerk, you can refer to [Authentication
134
+ Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk.
135
+
131
136
  </Callout>
132
137
 
133
138
  ### Add Public and Private Key Environment Variables in Vercel
@@ -166,29 +171,25 @@ We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notificat
166
171
 
167
172
  Fill in the endpoint with the URL of your Vercel project, such as `https://your-project.vercel.app/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create.
168
173
 
169
- <Callout type={'warning'}>
170
- The `https://` in the URL is essential to maintain the integrity of the URL.
171
- </Callout>
174
+ <Callout type={'warning'}>
172
175
 
173
- <Image
174
- alt={'Configure URL and user events when adding Clerk Webhooks'}
175
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'}>
176
+ The `https://` in the URL is essential to maintain the integrity of the URL.
176
177
 
177
- >
178
+ </Callout>
178
179
 
179
- </Image>
180
+ <Image
181
+ alt={'Configure URL and user events when adding Clerk Webhooks'}
182
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'}
183
+ />
180
184
 
181
185
  ### Add Webhook Secret to Vercel Environment Variables
182
186
 
183
187
  After creation, you can find the secret of this Webhook in the bottom right corner:
184
188
 
185
189
  <Image
186
- alt={'View Clerk Webhooks secret'}
187
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}>
188
-
189
- >
190
-
191
- </Image>
190
+ alt={'View Clerk Webhooks secret'}
191
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}
192
+ />
192
193
 
193
194
  The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`:
194
195
 
@@ -212,9 +213,9 @@ By completing these steps, you have successfully configured the Clerk authentica
212
213
  In the server-side database, we need to configure the S3 storage service to store files.
213
214
 
214
215
  <Callout type={'info'}>
215
- In this article, S3 refers to a compatible S3 storage solution, which supports object storage
216
- systems that comply with the Amazon S3 API. Common examples include Cloudflare R2, Alibaba Cloud
217
- OSS, etc., all of which support S3-compatible APIs.
216
+
217
+ In this article, S3 refers to a compatible S3 storage solution, which supports object storage systems that comply with the Amazon S3 API. Common examples include Cloudflare R2, Alibaba Cloud OSS, etc., all of which support S3-compatible APIs.
218
+
218
219
  </Callout>
219
220
 
220
221
  <Steps>
@@ -338,7 +339,7 @@ In R2, you can find the CORS configuration in the bucket settings:
338
339
  <Image
339
340
  alt={'Cloudflare R2 CORS settings'}
340
341
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'}
341
- ></Image>
342
+ />
342
343
 
343
344
  Add a CORS rule to allow requests from your domain (in this case, `https://your-project.vercel.app`):
344
345
 
@@ -382,12 +383,14 @@ After configuring the environment variables, you need to redeploy the latest com
382
383
  If you click on the login button in the top left corner and the login popup appears normally, then you have successfully configured it. Enjoy using it\~
383
384
 
384
385
  <Image
385
- alt={'User login popup'}
386
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}/>
386
+ alt={'User login popup'}
387
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}
388
+ />
387
389
 
388
390
  <Image
389
- alt={'Login successful state'}
390
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}/>
391
+ alt={'Login successful state'}
392
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}
393
+ />
391
394
 
392
395
  </Steps>
393
396
 
@@ -17,10 +17,10 @@ tags:
17
17
  本文将详细介绍如何在 Vercel 中部署服务端数据库版 LobeChat,包括: 1)数据库配置;2)身份验证服务配置;3) S3 存储服务的设置步骤。
18
18
 
19
19
  <Callout type={'warning'}>
20
- 进行后续操作前,请务必确认以下事项:
21
- - 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入!
22
- - 环境变量中的`ACCESS_CODE`未设置或已清除!
23
- - 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题!
20
+ 进行后续操作前,请务必确认以下事项: -
21
+ 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入! -
22
+ 环境变量中的`ACCESS_CODE`未设置或已清除! -
23
+ 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题!
24
24
  </Callout>
25
25
 
26
26
  ## 一、 配置数据库
@@ -61,7 +61,7 @@ tags:
61
61
 
62
62
  在 Vercel 中填写的示例如下:
63
63
 
64
- <Image alt={'添加 Serverless Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'}></Image>
64
+ <Image alt={'添加 Serverless Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'}/>
65
65
 
66
66
  </Tab>
67
67
 
@@ -81,7 +81,7 @@ tags:
81
81
 
82
82
  在 Vercel 中填写的示例如下:
83
83
 
84
- <Image alt={'添加 Node Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'}></Image>
84
+ <Image alt={'添加 Node Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'}/>
85
85
 
86
86
  </Tab>
87
87
 
@@ -130,7 +130,7 @@ KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
130
130
  <Image
131
131
  alt={'在 Clerk 中找到对应的公私钥环境变量'}
132
132
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'}
133
- ></Image>
133
+ />
134
134
 
135
135
  此步骤所需的环境变量如下:
136
136
 
@@ -144,7 +144,7 @@ CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
144
144
  <Image
145
145
  alt={'在 Vercel 中添加 Clerk 公私钥环境变量'}
146
146
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'}
147
- ></Image>
147
+ />
148
148
 
149
149
  ### 在 Clerk 中创建并配置 Webhook
150
150
 
@@ -155,7 +155,7 @@ CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
155
155
  <Image
156
156
  alt={'Clerk 添加 Webhooks 端点'}
157
157
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'}
158
- ></Image>
158
+ />
159
159
 
160
160
  在 endppint 中填写你的 Vercel 项目的 URL,如 `https://your-project.vercel.app/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。
161
161
 
@@ -164,7 +164,7 @@ CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
164
164
  <Image
165
165
  alt={'添加 Clerk Webhooks 时,配置 URL 和用户事件'}
166
166
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'}
167
- ></Image>
167
+ />
168
168
 
169
169
  ### 将 Webhook 秘钥添加到 Vercel 环境变量
170
170
 
@@ -173,7 +173,7 @@ CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
173
173
  <Image
174
174
  alt={'查看 Clerk Webhooks 秘钥'}
175
175
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}
176
- ></Image>
176
+ />
177
177
 
178
178
  这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`:
179
179
 
@@ -186,7 +186,7 @@ CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
186
186
  <Image
187
187
  alt={'在 Vercel 中 添加 Clerk Webhooks 秘钥'}
188
188
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'}
189
- ></Image>
189
+ />
190
190
 
191
191
  </Steps>
192
192
 
@@ -212,13 +212,13 @@ CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
212
212
  <Image
213
213
  alt={'Cloudflare R2 存储界面'}
214
214
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
215
- ></Image>
215
+ />
216
216
 
217
217
  创建存储桶时将指定其名称,然后点击创建。
218
218
  <Image
219
219
  alt={'R2 创建存储桶'}
220
220
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'}
221
- ></Image>
221
+ />
222
222
 
223
223
  ### 获取存储桶相关环境变量
224
224
 
@@ -227,7 +227,7 @@ CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
227
227
  <Image
228
228
  alt={'查看存储桶的相关信息'}
229
229
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'}
230
- ></Image>
230
+ />
231
231
 
232
232
  其对应的环境变量为:
233
233
 
@@ -249,28 +249,28 @@ S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
249
249
  <Image
250
250
  alt={'查看存储桶的访问秘钥'}
251
251
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'}
252
- ></Image>
252
+ />
253
253
 
254
254
  点击右上角按钮创建 API token,进入创建 API Token 页面
255
255
 
256
256
  <Image
257
257
  alt={'创建对应 API token'}
258
258
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'}
259
- ></Image>
259
+ />
260
260
 
261
261
  鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。
262
262
 
263
263
  <Image
264
264
  alt={'配置 API token 权限'}
265
265
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'}
266
- ></Image>
266
+ />
267
267
 
268
268
  创建完成后,就可以看到对应的 S3 API token
269
269
 
270
270
  <Image
271
271
  alt={'复制 API token'}
272
272
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'}
273
- ></Image>
273
+ />
274
274
 
275
275
  其对应的环境变量为:
276
276
 
@@ -306,7 +306,7 @@ S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com
306
306
  <Image
307
307
  alt={'在 Vercel 中添加 S3 的环境变量'}
308
308
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/cd74152d-0ae8-44fd-b815-3307c56a3c18'}
309
- ></Image>
309
+ />
310
310
 
311
311
  ### 配置跨域
312
312
 
@@ -317,14 +317,14 @@ S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com
317
317
  <Image
318
318
  alt={'Cloudflare R2 的跨域设置'}
319
319
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'}
320
- ></Image>
320
+ />
321
321
 
322
322
  添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求:
323
323
 
324
324
  <Image
325
325
  alt={'配置允许你的站点域名'}
326
326
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'}
327
- ></Image>
327
+ />
328
328
 
329
329
  示例配置如下:
330
330
 
@@ -354,7 +354,7 @@ S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com
354
354
  <Image
355
355
  alt={'重新部署最新的 commit'}
356
356
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'}
357
- ></Image>
357
+ />
358
358
 
359
359
  ### 检查功能是否正常
360
360
 
@@ -363,12 +363,12 @@ S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com
363
363
  <Image
364
364
  alt={'用户登录弹窗'}
365
365
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}
366
- ></Image>
366
+ />
367
367
 
368
368
  <Image
369
369
  alt={'登录成功状态'}
370
370
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}
371
- ></Image>
371
+ />
372
372
 
373
373
  </Steps>
374
374
 
@@ -21,6 +21,7 @@ tags:
21
21
  </Callout>
22
22
 
23
23
  The template on Zeabur includes 4 services:
24
+
24
25
  - Logto for authrization.
25
26
  - PostgreSQL with Vector plugin for data storage and indexing.
26
27
  - MinIO for image storage.
@@ -62,8 +63,7 @@ You will see another modal pop-up where you can see the deployment progress.
62
63
 
63
64
  After the deployment is done, you need to configure your Logto service to enable authrization.
64
65
 
65
- Access your Logto console with the console domain you just binded, and then create a `Next.js 14(App router)` application to get the client ID and client secret, and fill in the cors and callback URLs.
66
- You can check [this document](../advanced/auth.mdx) for a more detailed guide.
66
+ Access your Logto console with the console domain you just binded, and then create a `Next.js 14(App router)` application to get the client ID and client secret, and fill in the cors and callback URLs. You can check [this document](../advanced/auth.mdx) for a more detailed guide.
67
67
 
68
68
  Fill in those variables into your LobeChat service on Zeabur, here is a more detailed guide for [editing environment variables on Zeabur](https://zeabur.com/docs/deploy/variables).
69
69
 
@@ -18,6 +18,7 @@ tags:
18
18
  </Callout>
19
19
 
20
20
  在 Zeabur 的模板中总共包含有以下四个服务:
21
+
21
22
  - Logto 提供身份校验
22
23
  - 带有 Vector 插件的 PostgreSQL 来做数据存储和向量化
23
24
  - MinIO 作为对象存储
@@ -53,11 +54,9 @@ tags:
53
54
 
54
55
  ### 配置 Logto
55
56
 
56
- 当部署完成后,你会被自动导航到你在 Zeabur 控制台上刚刚创建的项目。
57
- 你需要再进一步配置你的 Logto 服务。
57
+ 当部署完成后,你会被自动导航到你在 Zeabur 控制台上刚刚创建的项目。你需要再进一步配置你的 Logto 服务。
58
58
 
59
- 使用你刚绑定的域名来访问你的 Logto 控制台,创建一个新项目以获得对应的客户端 ID 与密钥,将它们填入你的 LobeChat 服务的变量中。
60
- 关于如何填入变量,可以参照 [Zeabur 的官方文档](https://zeabur.com/docs/deploy/variables)。
59
+ 使用你刚绑定的域名来访问你的 Logto 控制台,创建一个新项目以获得对应的客户端 ID 与密钥,将它们填入你的 LobeChat 服务的变量中。关于如何填入变量,可以参照 [Zeabur 的官方文档](https://zeabur.com/docs/deploy/variables)。
61
60
 
62
61
  Logto 的详细配置可以参考[这篇文档](/zh/docs/self-hosting/advanced/auth/next-auth/logto)。
63
62
 
@@ -13,7 +13,10 @@ tags:
13
13
  LobeChat defaults to using a client-side database (IndexedDB) but also supports deploying a server-side database. LobeChat uses Postgres as the backend storage database.
14
14
 
15
15
  <Callout>
16
- PostgreSQL is a powerful open-source relational database management system with high scalability and standard SQL support. It provides rich data types, concurrency control, data integrity, security, and programmability, making it suitable for complex applications and large-scale data management.
16
+ PostgreSQL is a powerful open-source relational database management system with high scalability
17
+ and standard SQL support. It provides rich data types, concurrency control, data integrity,
18
+ security, and programmability, making it suitable for complex applications and large-scale data
19
+ management.
17
20
  </Callout>
18
21
 
19
22
  This guide will introduce the process and principles of deploying the server-side database version of LobeChat on any platform from a framework perspective, so you can understand both the what and the why, and then deploy according to your specific needs.
@@ -37,7 +40,9 @@ Before deployment, make sure you have a Postgres database instance ready. You ca
37
40
  - `A.` Use Serverless Postgres instances like Vercel/Neon;
38
41
  - `B.` Use self-deployed Postgres instances like Docker/Railway/Zeabur, collectively referred to as Node Postgres instances;
39
42
 
40
- <Callout>There is a slight difference in the way they are configured in terms of environment variables.</Callout>
43
+ <Callout>
44
+ There is a slight difference in the way they are configured in terms of environment variables.
45
+ </Callout>
41
46
 
42
47
  Since we support file-based conversations/knowledge base conversations, we need to install the `pgvector` plugin for Postgres. This plugin provides vector search capabilities and is a key component for LobeChat to implement RAG.
43
48
 
@@ -49,13 +54,16 @@ LobeChat supports both client-side and server-side databases, so we provide an e
49
54
  For server-side database deployment scenarios, you need to set `NEXT_PUBLIC_SERVICE_MODE` to `server`.
50
55
 
51
56
  <Callout type={'info'}>
52
- In the official `lobe-chat-database` Docker image, this environment variable is already set to `server` by default. Therefore, if you deploy using the Docker image, you do not need to configure this environment variable again.
57
+ In the official `lobe-chat-database` Docker image, this environment variable is already set to
58
+ `server` by default. Therefore, if you deploy using the Docker image, you do not need to configure
59
+ this environment variable again.
53
60
  </Callout>
54
61
 
55
62
  <Callout type={'tip'}>
56
63
  Since environment variables starting with `NEXT_PUBLIC` take effect in the front-end code, they cannot be modified through container runtime injection. (Refer to the `next.js` documentation [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables)). This is why we chose to create a separate DB version image.
57
64
 
58
65
  If you need to modify variables with the `NEXT_PUBLIC` prefix in a Docker deployment, you must build the image yourself and inject your own `NEXT_PUBLIC` prefixed environment variables during the build.
66
+
59
67
  </Callout>
60
68
 
61
69
  ### `DATABASE_URL`
@@ -63,7 +71,9 @@ If you need to modify variables with the `NEXT_PUBLIC` prefix in a Docker deploy
63
71
  The core of configuring the database is to add the `DATABASE_URL` environment variable and fill in the Postgres database connection URL you have prepared. The typical format of the database connection URL is `postgres://username:password@host:port/database`.
64
72
 
65
73
  <Callout type={'info'}>
66
- If you want to enable SSL when connecting to the database, please refer to the [documentation](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) for setup instructions.
74
+ If you want to enable SSL when connecting to the database, please refer to the
75
+ [documentation](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)
76
+ for setup instructions.
67
77
  </Callout>
68
78
 
69
79
  ### `DATABASE_DRIVER`
@@ -85,7 +95,8 @@ Therefore, if you follow the standard deployment methods below, you do not need
85
95
  Considering that users will store sensitive information such as their API Key and baseURL in the database, we need a key to encrypt this information to prevent leakage in case of a database breach. Hence, the `KEY_VAULTS_SECRET` environment variable is used to encrypt sensitive information like user-stored apikeys.
86
96
 
87
97
  <Callout type={'info'}>
88
- You can generate a random 32-character string as the value of `KEY_VAULTS_SECRET` using `openssl rand -base64 32`.
98
+ You can generate a random 32-character string as the value of `KEY_VAULTS_SECRET` using `openssl
99
+ rand -base64 32`.
89
100
  </Callout>
90
101
 
91
102
  </Steps>
@@ -104,7 +115,8 @@ The integration of Clerk is relatively simple, requiring only the configuration
104
115
  - `CLERK_WEBHOOK_SECRET`, which is generated by following these instructions: [Configure Clerk Authentication Service](/docs/self-hosting/advanced/auth/clerk#create-and-configure-webhook-in-clerk).
105
116
 
106
117
  <Callout type={'tip'}>
107
- In Vercel deployment mode, we recommend using Clerk as the authentication service for a better user experience.
118
+ In Vercel deployment mode, we recommend using Clerk as the authentication service for a better
119
+ user experience.
108
120
  </Callout>
109
121
 
110
122
  However, this type of authentication relies on Clerk's official service, so there may be some limitations in certain scenarios:
@@ -122,7 +134,8 @@ NextAuth is an open-source authentication library that supports multiple identit
122
134
  For information on configuring NextAuth, you can refer to the [Authentication](/docs/self-hosting/advanced/authentication) documentation.
123
135
 
124
136
  <Callout type={'tip'}>
125
- In the official Docker image `lobe-chat-database`, we recommend using NextAuth as the authentication service.
137
+ In the official Docker image `lobe-chat-database`, we recommend using NextAuth as the
138
+ authentication service.
126
139
  </Callout>
127
140
 
128
141
  ## Configuring S3 Storage Service
@@ -132,7 +145,9 @@ LobeChat has supported multimodal AI conversations since [a long time ago](https
132
145
  The best practice in this area is to use a file storage service (S3) to store image files, which is also the storage solution relied upon for subsequent file uploads/knowledge base functions.
133
146
 
134
147
  <Callout type={'info'}>
135
- In this documentation, S3 refers to a compatible S3 storage solution, which supports the Amazon S3 API-compatible object storage system. Common examples include Cloudflare R2, Alibaba Cloud OSS, and self-deployable Minio, all of which support the S3-compatible API.
148
+ In this documentation, S3 refers to a compatible S3 storage solution, which supports the Amazon S3
149
+ API-compatible object storage system. Common examples include Cloudflare R2, Alibaba Cloud OSS,
150
+ and self-deployable Minio, all of which support the S3-compatible API.
136
151
  </Callout>
137
152
 
138
153
  For detailed configuration guidelines on S3, please refer to [S3 Object Storage](/docs/self-hosting/advanced/s3) for more information.
@@ -11,6 +11,7 @@ tags:
11
11
  - Docker Compose
12
12
  - Alibaba Cloud
13
13
  ---
14
+
14
15
  # Build Your Own Lobe Chat
15
16
 
16
17
  LobeChat supports various deployment platforms, including Vercel, Docker, and Docker Compose. You can choose a deployment platform that suits you to build your own Lobe Chat.
@@ -24,7 +25,9 @@ You can follow the guide below for quick deployment of LobeChat:
24
25
  <PlatformCards urlPrefix={'platform'} />
25
26
 
26
27
  <Callout>
27
- In the client-side database mode, data is stored locally on the user's device, without cross-device synchronization, and does not support advanced features such as file uploads and knowledge base.
28
+ In the client-side database mode, data is stored locally on the user's device, without
29
+ cross-device synchronization, and does not support advanced features such as file uploads and
30
+ knowledge base.
28
31
  </Callout>
29
32
 
30
33
  ## Advanced Mode: Server-Side Database
@@ -32,5 +35,8 @@ You can follow the guide below for quick deployment of LobeChat:
32
35
  For users who are already familiar with LobeChat or need cross-device synchronization, you can deploy a version with a server-side database to access a more complete and powerful LobeChat.
33
36
 
34
37
  <Cards>
35
- <Card href={'/docs/self-hosting/server-database'} title={'Server-Side Database Deployment Guide'} />
38
+ <Card
39
+ href={'/docs/self-hosting/server-database'}
40
+ title={'Server-Side Database Deployment Guide'}
41
+ />
36
42
  </Cards>
@@ -51,4 +51,4 @@ tags:
51
51
 
52
52
  服务端数据库方案则适合那些希望简化数据管理流程,享受便捷使用体验的用户。通过服务端数据库与用户身份验证,LobeChat 能够确保数据的安全性与高效性。如果您希望了解如何配置服务端数据库,请参考我们的[详细文档](/zh/docs/self-hosting/advanced/server-database)。
53
53
 
54
- 无论选择本地数据库还是服务端数据库,LobeChat 都能为你提供卓越的用户体验。
54
+ 无论选择本地数据库还是服务端数据库,LobeChat 都能为你提供卓越的用户体验。
@@ -37,8 +37,7 @@ LobeChat also offers the Midjourney plugin, which generates images by calling th
37
37
  />
38
38
 
39
39
  <Callout type={'info'}>
40
- info For plugin installation, please refer to [Plugin
41
- Usage](/docs/usage/plugins/basic-usage)
40
+ info For plugin installation, please refer to [Plugin Usage](/docs/usage/plugins/basic-usage)
42
41
  </Callout>
43
42
 
44
43
  When using the Midjourney plugin for the first time, you will need to fill in your Midjourney API key in the plugin settings.
@@ -34,9 +34,7 @@ LobeChat 还提供 Midjourney 插件,通过 API 调用 Midjourney 生成图片
34
34
  src={'https://github.com/user-attachments/assets/5f526846-02cd-4dbc-b6e3-a603fa5ac8e7'}
35
35
  />
36
36
 
37
- <Callout type={'info'}>
38
- 插件安装请参考[插件使用](/zh/docs/usage/plugins/basic-usage)
39
- </Callout>
37
+ <Callout type={'info'}>插件安装请参考[插件使用](/zh/docs/usage/plugins/basic-usage)</Callout>
40
38
 
41
39
  首次使用 Midjourney 插件时,您需要在插件设置中填写您的 Midjourney API 密钥。
42
40