@lobehub/lobehub 2.0.0-next.332 → 2.0.0-next.334

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 (234) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/apps/desktop/src/main/const/dir.ts +3 -0
  3. package/apps/desktop/src/main/controllers/SystemCtr.ts +19 -0
  4. package/apps/desktop/src/main/controllers/__tests__/SystemCtr.test.ts +1 -0
  5. package/apps/desktop/src/main/menus/impls/macOS.test.ts +1 -0
  6. package/changelog/v1.json +21 -0
  7. package/docs/changelog/2023-09-09-plugin-system.mdx +3 -2
  8. package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -4
  9. package/docs/changelog/2023-11-19-tts-stt.mdx +3 -2
  10. package/docs/changelog/2023-12-22-dalle-3.mdx +5 -2
  11. package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +2 -2
  12. package/docs/changelog/2024-02-08-sso-oauth.mdx +2 -2
  13. package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +3 -2
  14. package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +2 -2
  15. package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +3 -2
  16. package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +2 -2
  17. package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +3 -2
  18. package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +5 -4
  19. package/docs/changelog/2024-09-13-openai-o1-models.mdx +2 -2
  20. package/docs/changelog/2024-09-20-artifacts.mdx +3 -2
  21. package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +2 -2
  22. package/docs/changelog/2024-10-27-pin-assistant.mdx +3 -2
  23. package/docs/changelog/2024-11-06-share-text-json.mdx +4 -2
  24. package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +2 -2
  25. package/docs/changelog/2024-11-25-november-providers.mdx +2 -2
  26. package/docs/changelog/2024-11-27-forkable-chat.mdx +2 -2
  27. package/docs/changelog/2025-01-03-user-profile.mdx +2 -2
  28. package/docs/changelog/2025-01-22-new-ai-provider.mdx +2 -2
  29. package/docs/changelog/2025-02-02-deepseek-r1.mdx +4 -4
  30. package/docs/development/basic/add-new-authentication-providers.mdx +4 -0
  31. package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +4 -0
  32. package/docs/development/basic/add-new-image-model.mdx +4 -0
  33. package/docs/development/basic/add-new-image-model.zh-CN.mdx +4 -0
  34. package/docs/development/basic/architecture.mdx +4 -0
  35. package/docs/development/basic/architecture.zh-CN.mdx +4 -0
  36. package/docs/development/basic/chat-api.mdx +4 -0
  37. package/docs/development/basic/chat-api.zh-CN.mdx +4 -0
  38. package/docs/development/basic/comfyui-development.mdx +3 -1
  39. package/docs/development/basic/contributing-guidelines.mdx +4 -0
  40. package/docs/development/basic/contributing-guidelines.zh-CN.mdx +4 -0
  41. package/docs/development/basic/feature-development-frontend.mdx +11 -3
  42. package/docs/development/basic/feature-development-frontend.zh-CN.mdx +11 -3
  43. package/docs/development/basic/feature-development.mdx +14 -5
  44. package/docs/development/basic/feature-development.zh-CN.mdx +14 -5
  45. package/docs/development/basic/folder-structure.mdx +7 -0
  46. package/docs/development/basic/folder-structure.zh-CN.mdx +7 -0
  47. package/docs/development/basic/resources.mdx +4 -0
  48. package/docs/development/basic/resources.zh-CN.mdx +4 -0
  49. package/docs/development/basic/setup-development.mdx +4 -0
  50. package/docs/development/basic/setup-development.zh-CN.mdx +4 -0
  51. package/docs/development/basic/test.mdx +4 -0
  52. package/docs/development/basic/test.zh-CN.mdx +4 -0
  53. package/docs/development/basic/work-with-server-side-database.mdx +5 -5
  54. package/docs/development/basic/work-with-server-side-database.zh-CN.mdx +5 -5
  55. package/docs/development/internationalization/add-new-locale.mdx +4 -0
  56. package/docs/development/internationalization/add-new-locale.zh-CN.mdx +4 -0
  57. package/docs/development/internationalization/internationalization-implementation.mdx +4 -0
  58. package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +4 -0
  59. package/docs/development/others/lighthouse.mdx +4 -0
  60. package/docs/development/others/lighthouse.zh-CN.mdx +4 -0
  61. package/docs/development/start.mdx +4 -0
  62. package/docs/development/start.zh-CN.mdx +4 -0
  63. package/docs/development/state-management/state-management-intro.mdx +4 -2
  64. package/docs/development/state-management/state-management-intro.zh-CN.mdx +4 -2
  65. package/docs/development/state-management/state-management-selectors.mdx +6 -1
  66. package/docs/development/state-management/state-management-selectors.zh-CN.mdx +6 -1
  67. package/docs/development/tests/integration-testing.zh-CN.mdx +4 -0
  68. package/docs/self-hosting/advanced/analytics.mdx +2 -2
  69. package/docs/self-hosting/advanced/auth/better-auth/apple.mdx +132 -0
  70. package/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdx +127 -0
  71. package/docs/self-hosting/advanced/auth/better-auth/auth0.mdx +111 -0
  72. package/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdx +107 -0
  73. package/docs/self-hosting/advanced/auth/better-auth/authelia.mdx +66 -0
  74. package/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdx +62 -0
  75. package/docs/self-hosting/advanced/auth/better-auth/authentik.mdx +67 -0
  76. package/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdx +63 -0
  77. package/docs/self-hosting/advanced/auth/better-auth/casdoor.mdx +62 -0
  78. package/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdx +58 -0
  79. package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdx +59 -0
  80. package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdx +55 -0
  81. package/docs/self-hosting/advanced/auth/better-auth/cognito.mdx +88 -0
  82. package/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdx +85 -0
  83. package/docs/self-hosting/advanced/auth/better-auth/feishu.mdx +73 -0
  84. package/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdx +69 -0
  85. package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdx +86 -0
  86. package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdx +83 -0
  87. package/docs/self-hosting/advanced/auth/better-auth/github.mdx +93 -0
  88. package/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdx +90 -0
  89. package/docs/self-hosting/advanced/auth/better-auth/google.mdx +80 -0
  90. package/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdx +77 -0
  91. package/docs/self-hosting/advanced/auth/better-auth/keycloak.mdx +77 -0
  92. package/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdx +74 -0
  93. package/docs/self-hosting/advanced/auth/better-auth/logto.mdx +64 -0
  94. package/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdx +60 -0
  95. package/docs/self-hosting/advanced/auth/better-auth/microsoft.mdx +113 -0
  96. package/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdx +109 -0
  97. package/docs/self-hosting/advanced/auth/better-auth/okta.mdx +67 -0
  98. package/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdx +63 -0
  99. package/docs/self-hosting/advanced/auth/better-auth/wechat.mdx +77 -0
  100. package/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdx +72 -0
  101. package/docs/self-hosting/advanced/auth/better-auth/zitadel.mdx +73 -0
  102. package/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdx +69 -0
  103. package/docs/self-hosting/advanced/auth/clerk.mdx +2 -2
  104. package/docs/self-hosting/advanced/auth/legacy.mdx +106 -0
  105. package/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx +101 -0
  106. package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +3 -2
  107. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +3 -2
  108. package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +3 -2
  109. package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +5 -2
  110. package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +2 -0
  111. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +3 -2
  112. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +2 -2
  113. package/docs/self-hosting/advanced/auth/next-auth/github.mdx +3 -2
  114. package/docs/self-hosting/advanced/auth/next-auth/google.mdx +10 -12
  115. package/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx +3 -2
  116. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +2 -2
  117. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +3 -2
  118. package/docs/self-hosting/advanced/auth/next-auth/okta.mdx +3 -2
  119. package/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx +1 -3
  120. package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +2 -2
  121. package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +3 -2
  122. package/docs/self-hosting/advanced/auth.mdx +86 -139
  123. package/docs/self-hosting/advanced/auth.zh-CN.mdx +84 -135
  124. package/docs/self-hosting/advanced/desktop.mdx +9 -3
  125. package/docs/self-hosting/advanced/desktop.zh-CN.mdx +9 -3
  126. package/docs/self-hosting/advanced/feature-flags.mdx +3 -2
  127. package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
  128. package/docs/self-hosting/advanced/model-list.mdx +2 -2
  129. package/docs/self-hosting/advanced/observability/grafana.mdx +4 -2
  130. package/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx +2 -1
  131. package/docs/self-hosting/advanced/observability/langfuse.mdx +3 -2
  132. package/docs/self-hosting/advanced/online-search.mdx +4 -6
  133. package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +2 -2
  134. package/docs/self-hosting/advanced/settings-url-share.mdx +3 -2
  135. package/docs/self-hosting/advanced/upstream-sync.mdx +3 -4
  136. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +0 -2
  137. package/docs/self-hosting/environment-variables/analytics.mdx +3 -2
  138. package/docs/self-hosting/environment-variables/auth.mdx +5 -12
  139. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +2 -9
  140. package/docs/self-hosting/environment-variables/basic.mdx +3 -10
  141. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
  142. package/docs/self-hosting/environment-variables/model-provider.mdx +3 -4
  143. package/docs/self-hosting/environment-variables/s3.mdx +2 -2
  144. package/docs/self-hosting/environment-variables.mdx +2 -3
  145. package/docs/self-hosting/examples/azure-openai.mdx +2 -3
  146. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
  147. package/docs/self-hosting/examples/ollama.mdx +3 -2
  148. package/docs/self-hosting/faq/no-v1-suffix.mdx +4 -4
  149. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +3 -2
  150. package/docs/self-hosting/faq/vercel-ai-image-timeout.mdx +2 -2
  151. package/docs/self-hosting/migration/v2/breaking-changes.mdx +73 -0
  152. package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +71 -0
  153. package/docs/self-hosting/platform/alibaba-cloud.mdx +2 -7
  154. package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -6
  155. package/docs/self-hosting/platform/btpanel.mdx +4 -2
  156. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +2 -2
  157. package/docs/self-hosting/platform/docker-compose.mdx +3 -3
  158. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +0 -1
  159. package/docs/self-hosting/platform/docker.mdx +2 -11
  160. package/docs/self-hosting/platform/docker.zh-CN.mdx +0 -8
  161. package/docs/self-hosting/platform/netlify.mdx +5 -17
  162. package/docs/self-hosting/platform/netlify.zh-CN.mdx +3 -17
  163. package/docs/self-hosting/platform/railway.mdx +3 -7
  164. package/docs/self-hosting/platform/railway.zh-CN.mdx +1 -7
  165. package/docs/self-hosting/platform/repocloud.mdx +3 -7
  166. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +1 -6
  167. package/docs/self-hosting/platform/sealos.mdx +2 -7
  168. package/docs/self-hosting/platform/sealos.zh-CN.mdx +1 -6
  169. package/docs/self-hosting/platform/tencentcloud-lighthouse.mdx +2 -7
  170. package/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx +1 -6
  171. package/docs/self-hosting/platform/vercel.mdx +4 -9
  172. package/docs/self-hosting/platform/vercel.zh-CN.mdx +3 -8
  173. package/docs/self-hosting/platform/zeabur.mdx +2 -11
  174. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +1 -10
  175. package/docs/self-hosting/server-database/docker-compose.mdx +11 -19
  176. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +12 -21
  177. package/docs/self-hosting/server-database/docker.mdx +9 -24
  178. package/docs/self-hosting/server-database/docker.zh-CN.mdx +7 -24
  179. package/docs/self-hosting/server-database/dokploy.mdx +27 -25
  180. package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +23 -21
  181. package/docs/self-hosting/server-database/netlify.mdx +2 -2
  182. package/docs/self-hosting/server-database/netlify.zh-CN.mdx +2 -2
  183. package/docs/self-hosting/server-database/railway.mdx +2 -2
  184. package/docs/self-hosting/server-database/repocloud.mdx +2 -2
  185. package/docs/self-hosting/server-database/sealos.mdx +2 -2
  186. package/docs/self-hosting/server-database/vercel.mdx +19 -72
  187. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +17 -68
  188. package/docs/self-hosting/server-database/zeabur.mdx +2 -2
  189. package/docs/self-hosting/server-database.mdx +1 -19
  190. package/docs/self-hosting/server-database.zh-CN.mdx +0 -17
  191. package/docs/self-hosting/start.mdx +2 -2
  192. package/docs/self-hosting/start.zh-CN.mdx +2 -2
  193. package/locales/ar/common.json +1 -0
  194. package/locales/bg-BG/common.json +1 -0
  195. package/locales/de-DE/common.json +1 -0
  196. package/locales/en-US/common.json +1 -0
  197. package/locales/en-US/desktop-onboarding.json +1 -0
  198. package/locales/es-ES/common.json +1 -0
  199. package/locales/fa-IR/common.json +1 -0
  200. package/locales/fr-FR/common.json +1 -0
  201. package/locales/it-IT/common.json +1 -0
  202. package/locales/ja-JP/common.json +1 -0
  203. package/locales/ko-KR/common.json +1 -0
  204. package/locales/nl-NL/common.json +1 -0
  205. package/locales/pl-PL/common.json +1 -0
  206. package/locales/pt-BR/common.json +1 -0
  207. package/locales/ru-RU/common.json +1 -0
  208. package/locales/tr-TR/common.json +1 -0
  209. package/locales/vi-VN/common.json +1 -0
  210. package/locales/zh-CN/common.json +1 -0
  211. package/locales/zh-CN/desktop-onboarding.json +1 -0
  212. package/locales/zh-TW/common.json +1 -0
  213. package/package.json +2 -2
  214. package/packages/builtin-tool-cloud-sandbox/src/systemRole.ts +62 -2
  215. package/packages/const/src/url.ts +6 -0
  216. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/index.ts +2 -0
  217. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/multi-tasks-with-summary.json +234 -0
  218. package/packages/conversation-flow/src/__tests__/parse.test.ts +25 -0
  219. package/packages/conversation-flow/src/transformation/ContextTreeBuilder.ts +15 -0
  220. package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +20 -0
  221. package/packages/types/src/serverConfig.ts +0 -1
  222. package/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx +39 -1
  223. package/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx +34 -14
  224. package/src/app/[variants]/(mobile)/me/(home)/features/useCategory.tsx +16 -9
  225. package/src/app/[variants]/layout.tsx +0 -4
  226. package/src/envs/app.ts +0 -13
  227. package/src/features/User/UserPanel/useMenu.tsx +18 -9
  228. package/src/hooks/usePlatform.test.ts +5 -0
  229. package/src/hooks/usePlatform.ts +1 -0
  230. package/src/locales/default/common.ts +1 -0
  231. package/src/locales/default/desktop-onboarding.ts +1 -0
  232. package/src/server/globalConfig/index.ts +1 -2
  233. package/src/services/electron/system.ts +4 -0
  234. package/src/store/serverConfig/selectors.ts +0 -1
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Deploying LobeChat with Docker Compose
3
3
  description: >-
4
- Learn how to deploy the LobeChat service using Docker Compose, including configuration tutorials for various services.
5
-
4
+ Learn how to deploy the LobeChat service using Docker Compose, including
5
+ configuration tutorials for various services.
6
6
  tags:
7
7
  - Docker Compose
8
8
  - LobeChat
@@ -20,15 +20,6 @@ tags:
20
20
  [![][docker-pulls-shield]][docker-pulls-link]
21
21
  </div>
22
22
 
23
- <Callout type="warning">
24
- **Note on Docker Deployment Limitations**
25
- The Docker and Docker Compose deployment options do not support injecting the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` through environment variables, which prevents enabling the Clerk authentication service. Recommended alternatives include:
26
-
27
- - Hosting deployment via Vercel
28
-
29
- - Running a local image build process
30
- </Callout>
31
-
32
23
  ## Quick Start
33
24
 
34
25
  <Callout type="info">
@@ -246,15 +237,15 @@ The script supports the following deployment modes; please choose the appropriat
246
237
  - Choose the access protocol: `http` or `https`
247
238
  - Regenerate secure keys: We highly recommend regenerating the secure keys; if you lack the key generation library required by the script, we suggest referring to the [Custom Deployment](#custom-deployment) section for key modifications.
248
239
 
249
- <Callout type="warning">
250
- The following issues may impede access to your service:
240
+ <Callout type="warning">
241
+ The following issues may impede access to your service:
251
242
 
252
- - The domain configuration here must match the reverse proxy configuration in step `1`.
243
+ - The domain configuration here must match the reverse proxy configuration in step `1`.
253
244
 
254
- - If you are using Cloudflare for domain resolution and have activated `full proxy`, please use the `https` protocol.
245
+ - If you are using Cloudflare for domain resolution and have activated `full proxy`, please use the `https` protocol.
255
246
 
256
- - If you have used the HTTPS protocol, ensure that your domain certificate is correctly configured; one-click deployment does not support self-signed certificates by default.
257
- </Callout>
247
+ - If you have used the HTTPS protocol, ensure that your domain certificate is correctly configured; one-click deployment does not support self-signed certificates by default.
248
+ </Callout>
258
249
 
259
250
  ### Check Configuration Generation Report
260
251
 
@@ -701,12 +692,14 @@ environment:
701
692
  ```
702
693
 
703
694
  **How it works:**
695
+
704
696
  - `APP_URL`: Used for browser/client access, OAuth callbacks, webhooks, etc. (goes through CDN/proxy)
705
697
  - `INTERNAL_APP_URL`: Used for internal server-to-server communication (bypasses CDN/proxy)
706
698
 
707
699
  If `INTERNAL_APP_URL` is not set, it defaults to `APP_URL`.
708
700
 
709
701
  **Configuration options:**
702
+
710
703
  - `http://localhost:3210` - If using Docker with host network mode
711
704
  - `http://lobe:3210` - If using Docker network with service name
712
705
  - `http://127.0.0.1:3210` - Alternative localhost address
@@ -726,7 +719,7 @@ For convenience, here is a summary of example configuration files required for t
726
719
  # HTTP_PROXY=http://localhost:7890
727
720
  # HTTPS_PROXY=http://localhost:7890
728
721
 
729
- # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
722
+ # Other environment variables, as needed. You can refer to the environment variables configuration for the client version.
730
723
  # OPENAI_API_KEY=sk-xxxx
731
724
  # OPENAI_PROXY_URL=https://api.openai.com/v1
732
725
  # OPENAI_MODEL_LIST=...
@@ -808,7 +801,6 @@ services:
808
801
  command: >
809
802
  server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
810
803
 
811
-
812
804
  casdoor:
813
805
  image: casbin/casdoor
814
806
  container_name: lobe-casdoor
@@ -18,16 +18,6 @@ tags:
18
18
  [![][docker-pulls-shield]][docker-pulls-link]
19
19
  </div>
20
20
 
21
- <Callout type="warning">
22
- **Docker 部署限制说明**
23
- Docker 及 Docker Compose 部署方案不支持通过环境变量注入 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,
24
- 因此无法启用 Clerk 身份验证服务。建议替代方案:
25
-
26
- - 采用 Vercel 托管部署
27
-
28
- - 执行本地镜像构建流程
29
- </Callout>
30
-
31
21
  ## 快速启动
32
22
 
33
23
  <Callout type="info">
@@ -234,15 +224,15 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN
234
224
  - 选择访问协议:`http` 或 `https`
235
225
  - 安全密钥重新生成:我们强烈建议你重新生成安全密钥,如果你缺少脚本所需的密钥生成库,我们建议你参考 [自定义部署](#自定义部署) 章节对密钥进行修改。
236
226
 
237
- <Callout type="warning">
238
- 以下问题可能导致你的服务无法正常访问:
227
+ <Callout type="warning">
228
+ 以下问题可能导致你的服务无法正常访问:
239
229
 
240
- - 此处的域名配置需要与步骤`1`中的反向代理配置保持一致。
230
+ - 此处的域名配置需要与步骤`1`中的反向代理配置保持一致。
241
231
 
242
- - 如果你使用 Cloudflare 的域名解析服务并开启了 `全程代理`,请使用 `https` 协议。
232
+ - 如果你使用 Cloudflare 的域名解析服务并开启了 `全程代理`,请使用 `https` 协议。
243
233
 
244
- - 如果你使用了 HTTPS 协议,请确保你的域名证书已经正确配置,一键部署默认不支持自签发证书。
245
- </Callout>
234
+ - 如果你使用了 HTTPS 协议,请确保你的域名证书已经正确配置,一键部署默认不支持自签发证书。
235
+ </Callout>
246
236
 
247
237
  ### 查看配置生成报告
248
238
 
@@ -665,7 +655,7 @@ docker compose up -d # 重新启动
665
655
  #### 使用 `INTERNAL_APP_URL` 配置内部服务器通信
666
656
 
667
657
  <Callout type="info">
668
- 如果你在 CDN(如 Cloudflare)或反向代理后部署 LobeChat,你可以配置内部服务器到服务器通信以绕过 CDN/代理层,以获得更好的性能。
658
+ 如果你在 CDN(如 Cloudflare)或反向代理后部署 LobeChat,你可以配置内部服务器到服务器通信以绕过 CDN / 代理层,以获得更好的性能。
669
659
  </Callout>
670
660
 
671
661
  你可以配置 `INTERNAL_APP_URL` 环境变量:
@@ -677,12 +667,14 @@ environment:
677
667
  ```
678
668
 
679
669
  **工作原理:**
680
- - `APP_URL`:用于浏览器/客户端访问、OAuth 回调、webhook 等(通过 CDN/代理)
681
- - `INTERNAL_APP_URL`:用于内部服务器到服务器通信(绕过 CDN/代理)
670
+
671
+ - `APP_URL`:用于浏览器 / 客户端访问、OAuth 回调、webhook 等(通过 CDN / 代理)
672
+ - `INTERNAL_APP_URL`:用于内部服务器到服务器通信(绕过 CDN / 代理)
682
673
 
683
674
  如果未设置 `INTERNAL_APP_URL`,它将默认为 `APP_URL`。
684
675
 
685
676
  **配置选项:**
677
+
686
678
  - `http://localhost:3210` - 如果使用 Docker 主机网络模式
687
679
  - `http://lobe:3210` - 如果使用 Docker 网络与服务名称
688
680
  - `http://127.0.0.1:3210` - 备用本地主机地址
@@ -702,7 +694,7 @@ environment:
702
694
  # HTTP_PROXY=http://localhost:7890
703
695
  # HTTPS_PROXY=http://localhost:7890
704
696
 
705
- # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
697
+ # Other environment variables, as needed. You can refer to the environment variables configuration for the client version.
706
698
  # OPENAI_API_KEY=sk-xxxx
707
699
  # OPENAI_PROXY_URL=https://api.openai.com/v1
708
700
  # OPENAI_MODEL_LIST=...
@@ -784,7 +776,6 @@ services:
784
776
  command: >
785
777
  server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
786
778
 
787
-
788
779
  casdoor:
789
780
  image: casbin/casdoor
790
781
  container_name: lobe-casdoor
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Deploying LobeChat Database with Docker
3
3
  description: >-
4
- Learn how to deploy the LobeChat server database version using Docker on Linux and local machines.
5
-
4
+ Learn how to deploy the LobeChat server database version using Docker on Linux
5
+ and local machines.
6
6
  tags:
7
7
  - LobeChat
8
8
  - Docker
@@ -28,11 +28,6 @@ tags:
28
28
  Database](/docs/self-hosting/server-database) first.
29
29
  </Callout>
30
30
 
31
- <Callout type="warning">
32
- Due to the inability to expose `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` using Docker environment variables, you cannot use Clerk as an authentication service when deploying LobeChat using Docker / Docker Compose.
33
-
34
- If you do need Clerk as an authentication service, you might consider deploying using Vercel or building your own image.
35
- </Callout>
36
31
 
37
32
  ## Deploying on a Linux Server
38
33
 
@@ -74,13 +69,11 @@ Here is the process for deploying the LobeChat server database version on a Linu
74
69
  # Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container name
75
70
  DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres
76
71
 
77
- # NEXT_AUTH related, can use auth0, Azure AD, GitHub, Authentik, zitadel, etc. If you have other access requirements, feel free to submit a PR
78
- NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250
79
- NEXT_AUTH_SSO_PROVIDERS=auth0
80
- NEXTAUTH_URL=https://your-prod-domain.com/api/auth
81
- AUTH_AUTH0_ID=xxxxxx
82
- AUTH_AUTH0_SECRET=cSX_xxxxx
83
- AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com
72
+ # Authentication (Better Auth)
73
+ # Session encryption key (generate with: openssl rand -base64 32)
74
+ AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
75
+ # JWKS key for signing and verifying JWTs (generate at: https://lobehub.com/docs/self-hosting/environment-variables/auth#jwks_key)
76
+ JWKS_KEY='{"keys":[...]}'
84
77
 
85
78
  # S3 related
86
79
  S3_ACCESS_KEY_ID=xxxxxxxxxx
@@ -89,10 +82,6 @@ Here is the process for deploying the LobeChat server database version on a Linu
89
82
  S3_BUCKET=lobechat
90
83
  S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
91
84
 
92
- # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
93
- # OPENAI_API_KEY=sk-xxxx
94
- # OPENAI_PROXY_URL=https://api.openai.com/v1
95
- # OPENAI_MODEL_LIST=...
96
85
  ```
97
86
 
98
87
  ### Start the lobe-chat-database Docker image
@@ -141,13 +130,9 @@ The script command you need to execute is:
141
130
  $ docker run -it -d --name lobe-chat-database -p 3210:3210 \
142
131
  -e DATABASE_URL=postgres://postgres:mysecretpassword@host.docker.internal:5432/postgres \
143
132
  -e KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \
144
- -e NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 \
145
- -e NEXT_AUTH_SSO_PROVIDERS=auth0 \
146
- -e AUTH_AUTH0_ID=xxxxxx \
147
- -e AUTH_AUTH0_SECRET=cSX_xxxxx \
148
- -e AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com \
133
+ -e AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \
134
+ -e JWKS_KEY='{"keys":[...]}' \
149
135
  -e APP_URL=http://localhost:3210 \
150
- -e NEXTAUTH_URL=http://localhost:3210/api/auth \
151
136
  -e S3_ACCESS_KEY_ID=xxxxxxxxxx \
152
137
  -e S3_SECRET_ACCESS_KEY=xxxxxxxxxx \
153
138
  -e S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com \
@@ -26,12 +26,6 @@ tags:
26
26
  存储服务](/zh/docs/self-hosting/advanced/s3/tencent-cloud)。
27
27
  </Callout>
28
28
 
29
- <Callout type="warning">
30
- 由于无法使用 Docker 环境变量暴露 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,使用 Docker / Docker Compose
31
- 部署 LobeChat 时,你不能使用 Clerk 作为登录鉴权服务。
32
-
33
- 如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。
34
- </Callout>
35
29
 
36
30
  ## 在 Linux 服务器上部署
37
31
 
@@ -72,13 +66,11 @@ tags:
72
66
  # 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器,请使用容器名
73
67
  DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres
74
68
 
75
- # NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、zitadel 等,如有其他接入诉求欢迎提 PR
76
- NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250
77
- NEXT_AUTH_SSO_PROVIDERS=auth0
78
- NEXTAUTH_URL=https://your-prod-domain.com/api/auth
79
- AUTH_AUTH0_ID=xxxxxx
80
- AUTH_AUTH0_SECRET=cSX_xxxxx
81
- AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com
69
+ # 身份验证(Better Auth)
70
+ # 会话加密密钥(使用以下命令生成:openssl rand -base64 32)
71
+ AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
72
+ # JWKS 密钥,用于签名和验证 JWT(在此生成:https://lobehub.com/zh/docs/self-hosting/environment-variables/auth#jwks_key)
73
+ JWKS_KEY='{"keys":[...]}'
82
74
 
83
75
  # S3 相关
84
76
  S3_ACCESS_KEY_ID=xxxxxxxxxx
@@ -90,11 +82,6 @@ tags:
90
82
  S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
91
83
  # S3_REGION=ap-chengdu # 如果需要指定地域
92
84
 
93
- # 其他环境变量,视需求而定
94
- # OPENAI_API_KEY=sk-xxxx
95
- # OPENAI_PROXY_URL=https://api.openai.com/v1
96
- # OPENAI_MODEL_LIST=...
97
- # ...
98
85
  ```
99
86
 
100
87
  ### 启动 lobe-chat-database docker 镜像
@@ -143,13 +130,9 @@ LobeChat 的 DB 版也支持直接在本地的 Mac/Windows 本地使用。
143
130
  $ docker run -it -d --name lobe-chat-database -p 3210:3210 \
144
131
  -e DATABASE_URL=postgres://postgres:mysecretpassword@host.docker.internal:5432/postgres \
145
132
  -e KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \
146
- -e NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 \
147
- -e NEXT_AUTH_SSO_PROVIDERS=auth0 \
148
- -e AUTH_AUTH0_ID=xxxxxx \
149
- -e AUTH_AUTH0_SECRET=cSX_xxxxx \
150
- -e AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com \
133
+ -e AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \
134
+ -e JWKS_KEY='{"keys":[...]}' \
151
135
  -e APP_URL=http://localhost:3210 \
152
- -e NEXTAUTH_URL=http://localhost:3210/api/auth \
153
136
  -e S3_ACCESS_KEY_ID=xxxxxxxxxx \
154
137
  -e S3_SECRET_ACCESS_KEY=xxxxxxxxxx \
155
138
  -e S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com \
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  title: Deploy LobeChat with database on Dokploy
3
3
  description: >-
4
- Learn how to deploy LobeChat with database on Dokploy with ease, including: database, authentication and S3 storage service.
5
-
4
+ Learn how to deploy LobeChat with database on Dokploy with ease, including:
5
+ database, authentication and S3 storage service.
6
6
  tags:
7
7
  - Deploy LobeChat
8
- - Vercel Deployment
9
- - OpenAI API Key
10
- - Custom Domain Binding
8
+ - Dokploy Deployment
9
+ - Better Auth
10
+ - S3 Storage
11
11
  ---
12
12
 
13
13
  # Deploying Server Database Version on Dokploy.
@@ -43,15 +43,27 @@ S3_PUBLIC_DOMAIN=
43
43
  S3_ENABLE_PATH_STYLE=
44
44
  ```
45
45
 
46
- ### Configure the Clerk authentication service.
46
+ ### Configure KEY_VAULTS_SECRET Environment Variable
47
47
 
48
- Obtain the three environment variables: `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`, `CLERK_SECRET_KEY`, and `CLERK_WEBHOOK_SECRET`. For detailed configuration steps for Clerk, please refer to the section [Configure Authentication Service](https://lobehub.com/docs/self-hosting/server-database/vercel#2-configure-authentication-service) in the Vercel deployment guide.
48
+ `KEY_VAULTS_SECRET` is used to encrypt sensitive information such as API keys stored by users. Click the button below to generate:
49
49
 
50
- ```shell
51
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
52
- CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
53
- CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
54
- ```
50
+ <GenerateSecret envName="KEY_VAULTS_SECRET" />
51
+
52
+ ### Configure authentication environment variables
53
+
54
+ Prepare the following authentication environment variables (powered by [Better Auth](https://www.better-auth.com)):
55
+
56
+ Click the button below to generate `AUTH_SECRET` (session encryption key):
57
+
58
+ <GenerateSecret envName="AUTH_SECRET" />
59
+
60
+ You also need to configure the `JWKS_KEY` environment variable for signing and verifying JWTs. Click the button below to generate:
61
+
62
+ <GenerateJWKSKey />
63
+
64
+ <Callout type={'info'}>
65
+ For advanced features like SSO providers, magic link login, and email verification, see [Authentication Service](/docs/self-hosting/advanced/auth).
66
+ </Callout>
55
67
 
56
68
  ## 2. Deploying the database on Dokploy
57
69
 
@@ -92,20 +104,14 @@ NIXPACKS_START_CMD="pnpm start"
92
104
 
93
105
  APP_URL=
94
106
 
95
- # Set the service mode to server
96
- NEXT_PUBLIC_SERVICE_MODE=server
97
-
98
107
  # Configuration related to Postgres database
99
108
  DATABASE_DRIVER=node
100
109
  DATABASE_URL=
101
110
 
102
- # You can use openssl rand -base64 32 to generate a random 32-character string as a key.
111
+ # Use the values generated above
103
112
  KEY_VAULTS_SECRET=
104
-
105
- # Clerk related configuration
106
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
107
- CLERK_SECRET_KEY=
108
- CLERK_WEBHOOK_SECRET=
113
+ AUTH_SECRET=
114
+ JWKS_KEY=
109
115
 
110
116
  # S3 related configuration
111
117
  S3_ACCESS_KEY_ID=
@@ -115,10 +121,6 @@ S3_BUCKET=
115
121
  S3_PUBLIC_DOMAIN=
116
122
  S3_ENABLE_PATH_STYLE=
117
123
 
118
- # OpenAI related configuration
119
- OPENAI_API_KEY=
120
- OPENAI_MODEL_LIST=
121
- OPENAI_PROXY_URL=
122
124
  ```
123
125
 
124
126
  After adding the environment variables and saving, click Deploy to initiate the deployment. You can check the deployment progress and log information under Deployments.
@@ -4,7 +4,7 @@ description: 本文详细介绍如何在 Dokploy 中部署服务端数据库版
4
4
  tags:
5
5
  - 服务端数据库
6
6
  - Postgres
7
- - Clerk
7
+ - Better Auth
8
8
  - Dokploy部署
9
9
  - 数据库配置
10
10
  - 身份验证服务
@@ -44,15 +44,27 @@ S3_PUBLIC_DOMAIN=
44
44
  S3_ENABLE_PATH_STYLE=
45
45
  ```
46
46
 
47
- ### 配置 Clerk 身份验证服务
47
+ ### 配置 KEY_VAULTS_SECRET 环境变量
48
48
 
49
- 获取 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、`CLERK_SECRET_KEY` 、`CLERK_WEBHOOK_SECRET` 这三个环境变量,Clerk 的详细配置流程请参考 使用 Vercel 部署中 [配置身份验证服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#二、-配置身份验证服务)
49
+ `KEY_VAULTS_SECRET` 用于加密用户存储的 API Key 等敏感信息。点击下方按钮一键生成:
50
50
 
51
- ```shell
52
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
53
- CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
54
- CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
55
- ```
51
+ <GenerateSecret envName="KEY_VAULTS_SECRET" />
52
+
53
+ ### 配置身份验证环境变量
54
+
55
+ 准备以下身份验证环境变量(基于 [Better Auth](https://www.better-auth.com)):
56
+
57
+ 点击下方按钮一键生成 `AUTH_SECRET`(会话加密密钥):
58
+
59
+ <GenerateSecret envName="AUTH_SECRET" />
60
+
61
+ 同时需要配置 `JWKS_KEY` 环境变量,用于签名和验证 JWT。点击下方按钮一键生成:
62
+
63
+ <GenerateJWKSKey />
64
+
65
+ <Callout type={'info'}>
66
+ 如需 SSO 登录、魔法链接登录、邮箱验证等高级功能,请参阅 [身份验证服务](/zh/docs/self-hosting/advanced/auth)。
67
+ </Callout>
56
68
 
57
69
  ## 二、在 Dokploy 上部署数据库
58
70
 
@@ -93,20 +105,14 @@ NIXPACKS_START_CMD="pnpm start"
93
105
 
94
106
  APP_URL=
95
107
 
96
- # 指定服务模式为 server
97
- NEXT_PUBLIC_SERVICE_MODE=server
98
-
99
108
  # Postgres 数据库相关配置
100
109
  DATABASE_DRIVER=node
101
110
  DATABASE_URL=
102
111
 
103
- # 你可以使用 openssl rand -base64 32 生成一个随机的 32 位字符串作为密钥。
112
+ # 使用上方生成的值
104
113
  KEY_VAULTS_SECRET=
105
-
106
- # Clerk 相关配置
107
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
108
- CLERK_SECRET_KEY=
109
- CLERK_WEBHOOK_SECRET=
114
+ AUTH_SECRET=
115
+ JWKS_KEY=
110
116
 
111
117
  # S3 相关配置
112
118
  S3_ACCESS_KEY_ID=
@@ -116,10 +122,6 @@ S3_BUCKET=
116
122
  S3_PUBLIC_DOMAIN=
117
123
  S3_ENABLE_PATH_STYLE=
118
124
 
119
- # OpenAI 相关配置
120
- OPENAI_API_KEY=
121
- OPENAI_MODEL_LIST=
122
- OPENAI_PROXY_URL=
123
125
  ```
124
126
 
125
127
  添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Deploy LobeChat with Database on Netlify
3
3
  description: >-
4
- Learn how to deploy LobeChat on Netlify with ease, including: database, authentication and S3 storage service.
5
-
4
+ Learn how to deploy LobeChat on Netlify with ease, including: database,
5
+ authentication and S3 storage service.
6
6
  tags:
7
7
  - Deploy LobeChat
8
8
  - Netlify Deployment
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: 在 Netlify 上部署 LobeChat 服务端数据库版
3
3
  description: >-
4
- 学习如何在 Netlify 上部署 LobeChat,包括 Fork 仓库、准备 OpenAI API Key、导入到 Netlify 工作台、配置站点名称与环境变量等步骤。
5
-
4
+ 学习如何在 Netlify 上部署 LobeChat,包括 Fork 仓库、准备 OpenAI API Key、导入到 Netlify
5
+ 工作台、配置站点名称与环境变量等步骤。
6
6
  tags:
7
7
  - Netlify
8
8
  - LobeChat
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Deploy LobeChat with Database on Railway
3
3
  description: >-
4
- Learn how to deploy LobeChat on Railway with ease, including: database, authentication and S3 storage service.
5
-
4
+ Learn how to deploy LobeChat on Railway with ease, including: database,
5
+ authentication and S3 storage service.
6
6
  tags:
7
7
  - Deploy LobeChat
8
8
  - Railway Deployment
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Deploy LobeChat with Database on RepoCloud
3
3
  description: >-
4
- Learn how to deploy LobeChat on RepoCloud with ease, including database, authentication and S3 storage service.
5
-
4
+ Learn how to deploy LobeChat on RepoCloud with ease, including database,
5
+ authentication and S3 storage service.
6
6
  tags:
7
7
  - Deploy LobeChat
8
8
  - RepoCloud Deployment
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Deploy Lobe Chat Database Version on Sealos
3
3
  description: >-
4
- Learn how to deploy LobeChat on Sealos with ease. Follow the provided steps to set up LobeChat and start using it efficiently.
5
-
4
+ Learn how to deploy LobeChat on Sealos with ease. Follow the provided steps to
5
+ set up LobeChat and start using it efficiently.
6
6
  tags:
7
7
  - Deploy LobeChat
8
8
  - Sealos Deployment