@lobehub/chat 1.90.4 → 1.91.1

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 (297) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/changelog/v1.json +21 -0
  3. package/docs/changelog/2023-09-09-plugin-system.mdx +2 -3
  4. package/docs/changelog/2023-11-14-gpt4-vision.mdx +4 -6
  5. package/docs/changelog/2023-11-19-tts-stt.mdx +2 -3
  6. package/docs/changelog/2023-12-22-dalle-3.mdx +2 -5
  7. package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +2 -2
  8. package/docs/changelog/2024-02-08-sso-oauth.mdx +2 -2
  9. package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +2 -3
  10. package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +2 -2
  11. package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +2 -3
  12. package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +2 -2
  13. package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +2 -3
  14. package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +4 -5
  15. package/docs/changelog/2024-09-13-openai-o1-models.mdx +2 -2
  16. package/docs/changelog/2024-09-20-artifacts.mdx +2 -3
  17. package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +2 -2
  18. package/docs/changelog/2024-10-27-pin-assistant.mdx +2 -3
  19. package/docs/changelog/2024-11-06-share-text-json.mdx +2 -4
  20. package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +2 -2
  21. package/docs/changelog/2024-11-25-november-providers.mdx +2 -2
  22. package/docs/changelog/2024-11-27-forkable-chat.mdx +2 -2
  23. package/docs/changelog/2025-01-03-user-profile.mdx +2 -2
  24. package/docs/changelog/2025-01-22-new-ai-provider.mdx +2 -2
  25. package/docs/changelog/2025-02-02-deepseek-r1.mdx +4 -4
  26. package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +1 -2
  27. package/docs/development/basic/chat-api.mdx +2 -4
  28. package/docs/development/basic/chat-api.zh-CN.mdx +2 -4
  29. package/docs/development/internationalization/internationalization-implementation.mdx +10 -10
  30. package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +10 -10
  31. package/docs/self-hosting/advanced/analytics.mdx +2 -2
  32. package/docs/self-hosting/advanced/auth/clerk.mdx +2 -2
  33. package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +2 -3
  34. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +2 -3
  35. package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +2 -3
  36. package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +4 -7
  37. package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +0 -3
  38. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +2 -3
  39. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +2 -2
  40. package/docs/self-hosting/advanced/auth/next-auth/github.mdx +2 -3
  41. package/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx +12 -6
  42. package/docs/self-hosting/advanced/auth/next-auth/keycloak.zh-CN.mdx +5 -1
  43. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +8 -14
  44. package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +6 -12
  45. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +2 -3
  46. package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +2 -2
  47. package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +2 -3
  48. package/docs/self-hosting/advanced/auth.mdx +2 -3
  49. package/docs/self-hosting/advanced/desktop.mdx +2 -1
  50. package/docs/self-hosting/advanced/desktop.zh-CN.mdx +1 -3
  51. package/docs/self-hosting/advanced/feature-flags.mdx +2 -3
  52. package/docs/self-hosting/advanced/knowledge-base.mdx +4 -3
  53. package/docs/self-hosting/advanced/model-list.mdx +11 -10
  54. package/docs/self-hosting/advanced/model-list.zh-CN.mdx +10 -9
  55. package/docs/self-hosting/advanced/observability/langfuse.mdx +2 -3
  56. package/docs/self-hosting/advanced/online-search.mdx +11 -10
  57. package/docs/self-hosting/advanced/online-search.zh-CN.mdx +7 -7
  58. package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +2 -2
  59. package/docs/self-hosting/advanced/settings-url-share.mdx +2 -3
  60. package/docs/self-hosting/advanced/upstream-sync.mdx +2 -3
  61. package/docs/self-hosting/advanced/webrtc.mdx +2 -2
  62. package/docs/self-hosting/environment-variables/analytics.mdx +2 -3
  63. package/docs/self-hosting/environment-variables/auth.mdx +2 -3
  64. package/docs/self-hosting/environment-variables/basic.mdx +4 -5
  65. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +2 -2
  66. package/docs/self-hosting/environment-variables/model-provider.mdx +2 -3
  67. package/docs/self-hosting/environment-variables/s3.mdx +3 -5
  68. package/docs/self-hosting/environment-variables.mdx +2 -2
  69. package/docs/self-hosting/examples/azure-openai.mdx +2 -2
  70. package/docs/self-hosting/examples/ollama.mdx +2 -3
  71. package/docs/self-hosting/faq/no-v1-suffix.mdx +4 -4
  72. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +2 -3
  73. package/docs/self-hosting/platform/alibaba-cloud.mdx +2 -3
  74. package/docs/self-hosting/platform/btpanel.mdx +5 -5
  75. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +4 -3
  76. package/docs/self-hosting/platform/docker-compose.mdx +2 -3
  77. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +0 -2
  78. package/docs/self-hosting/platform/docker.mdx +2 -2
  79. package/docs/self-hosting/platform/netlify.mdx +2 -4
  80. package/docs/self-hosting/platform/netlify.zh-CN.mdx +2 -2
  81. package/docs/self-hosting/platform/railway.mdx +2 -3
  82. package/docs/self-hosting/platform/repocloud.mdx +2 -3
  83. package/docs/self-hosting/platform/sealos.mdx +2 -2
  84. package/docs/self-hosting/platform/tencentcloud-lighthouse.mdx +2 -3
  85. package/docs/self-hosting/platform/vercel.mdx +2 -3
  86. package/docs/self-hosting/platform/zeabur.mdx +2 -2
  87. package/docs/self-hosting/server-database/docker-compose.mdx +65 -44
  88. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +48 -55
  89. package/docs/self-hosting/server-database/docker.mdx +2 -2
  90. package/docs/self-hosting/server-database/docker.zh-CN.mdx +2 -2
  91. package/docs/self-hosting/server-database/dokploy.mdx +4 -5
  92. package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +137 -138
  93. package/docs/self-hosting/server-database/netlify.mdx +2 -2
  94. package/docs/self-hosting/server-database/netlify.zh-CN.mdx +2 -2
  95. package/docs/self-hosting/server-database/railway.mdx +2 -2
  96. package/docs/self-hosting/server-database/repocloud.mdx +2 -2
  97. package/docs/self-hosting/server-database/sealos.mdx +4 -5
  98. package/docs/self-hosting/server-database/sealos.zh-CN.mdx +18 -20
  99. package/docs/self-hosting/server-database/vercel.mdx +5 -3
  100. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +2 -2
  101. package/docs/self-hosting/server-database/zeabur.mdx +2 -2
  102. package/docs/self-hosting/server-database.mdx +1 -1
  103. package/docs/self-hosting/server-database.zh-CN.mdx +2 -1
  104. package/docs/self-hosting/start.mdx +2 -2
  105. package/docs/self-hosting/start.zh-CN.mdx +2 -2
  106. package/docs/usage/agents/agent-organization.mdx +2 -2
  107. package/docs/usage/agents/concepts.mdx +4 -5
  108. package/docs/usage/agents/concepts.zh-CN.mdx +2 -2
  109. package/docs/usage/agents/custom-agent.mdx +3 -4
  110. package/docs/usage/agents/custom-agent.zh-CN.mdx +1 -1
  111. package/docs/usage/agents/model.mdx +5 -5
  112. package/docs/usage/agents/model.zh-CN.mdx +3 -5
  113. package/docs/usage/agents/prompt.mdx +4 -5
  114. package/docs/usage/agents/topics.mdx +3 -4
  115. package/docs/usage/agents/topics.zh-CN.mdx +1 -1
  116. package/docs/usage/features/agent-market.mdx +3 -11
  117. package/docs/usage/features/agent-market.zh-CN.mdx +2 -7
  118. package/docs/usage/features/artifacts.mdx +2 -2
  119. package/docs/usage/features/auth.mdx +2 -3
  120. package/docs/usage/features/cot.mdx +2 -2
  121. package/docs/usage/features/database.mdx +2 -2
  122. package/docs/usage/features/knowledge-base.mdx +4 -3
  123. package/docs/usage/features/knowledge-base.zh-CN.mdx +2 -1
  124. package/docs/usage/features/local-llm.mdx +2 -3
  125. package/docs/usage/features/mobile.mdx +2 -2
  126. package/docs/usage/features/more.mdx +2 -3
  127. package/docs/usage/features/multi-ai-providers.mdx +2 -3
  128. package/docs/usage/features/plugin-system.mdx +3 -11
  129. package/docs/usage/features/plugin-system.zh-CN.mdx +1 -8
  130. package/docs/usage/features/pwa.mdx +4 -4
  131. package/docs/usage/features/pwa.zh-CN.mdx +2 -1
  132. package/docs/usage/features/text-to-image.mdx +3 -11
  133. package/docs/usage/features/text-to-image.zh-CN.mdx +3 -10
  134. package/docs/usage/features/theme.mdx +2 -3
  135. package/docs/usage/features/tts.mdx +3 -11
  136. package/docs/usage/features/tts.zh-CN.mdx +1 -8
  137. package/docs/usage/features/vision.mdx +3 -11
  138. package/docs/usage/features/vision.zh-CN.mdx +1 -8
  139. package/docs/usage/foundation/basic.mdx +2 -3
  140. package/docs/usage/foundation/share.mdx +2 -3
  141. package/docs/usage/foundation/text2image.mdx +2 -2
  142. package/docs/usage/foundation/translate.mdx +2 -2
  143. package/docs/usage/foundation/tts-stt.mdx +2 -2
  144. package/docs/usage/foundation/vision.mdx +2 -3
  145. package/docs/usage/plugins/basic-usage.mdx +2 -3
  146. package/docs/usage/plugins/custom-plugin.mdx +2 -2
  147. package/docs/usage/plugins/development.mdx +2 -4
  148. package/docs/usage/plugins/store.mdx +2 -2
  149. package/docs/usage/providers/ai21.mdx +2 -2
  150. package/docs/usage/providers/anthropic.mdx +2 -3
  151. package/docs/usage/providers/anthropic.zh-CN.mdx +2 -2
  152. package/docs/usage/providers/azure.mdx +2 -3
  153. package/docs/usage/providers/azureai.mdx +4 -2
  154. package/docs/usage/providers/azureai.zh-CN.mdx +2 -1
  155. package/docs/usage/providers/baichuan.mdx +2 -3
  156. package/docs/usage/providers/bedrock.mdx +2 -3
  157. package/docs/usage/providers/cloudflare.mdx +3 -2
  158. package/docs/usage/providers/deepseek.mdx +2 -2
  159. package/docs/usage/providers/fireworksai.mdx +2 -2
  160. package/docs/usage/providers/giteeai.mdx +2 -2
  161. package/docs/usage/providers/github.mdx +1 -1
  162. package/docs/usage/providers/github.zh-CN.mdx +1 -1
  163. package/docs/usage/providers/google.mdx +2 -3
  164. package/docs/usage/providers/groq.mdx +2 -2
  165. package/docs/usage/providers/hunyuan.mdx +2 -2
  166. package/docs/usage/providers/infiniai.zh-CN.mdx +3 -1
  167. package/docs/usage/providers/internlm.mdx +2 -2
  168. package/docs/usage/providers/jina.mdx +4 -3
  169. package/docs/usage/providers/jina.zh-CN.mdx +2 -2
  170. package/docs/usage/providers/lmstudio.mdx +2 -2
  171. package/docs/usage/providers/lmstudio.zh-CN.mdx +2 -4
  172. package/docs/usage/providers/minimax.mdx +2 -3
  173. package/docs/usage/providers/minimax.zh-CN.mdx +2 -2
  174. package/docs/usage/providers/mistral.mdx +2 -3
  175. package/docs/usage/providers/modelscope.mdx +4 -0
  176. package/docs/usage/providers/modelscope.zh-CN.mdx +4 -0
  177. package/docs/usage/providers/moonshot.mdx +2 -3
  178. package/docs/usage/providers/novita.mdx +2 -3
  179. package/docs/usage/providers/novita.zh-CN.mdx +2 -2
  180. package/docs/usage/providers/nvidia.mdx +3 -2
  181. package/docs/usage/providers/ollama/gemma.mdx +2 -3
  182. package/docs/usage/providers/ollama/gemma.zh-CN.mdx +2 -2
  183. package/docs/usage/providers/ollama.mdx +2 -2
  184. package/docs/usage/providers/openai.mdx +5 -5
  185. package/docs/usage/providers/openai.zh-CN.mdx +3 -3
  186. package/docs/usage/providers/openrouter.mdx +2 -3
  187. package/docs/usage/providers/perplexity.mdx +2 -2
  188. package/docs/usage/providers/ppio.mdx +5 -6
  189. package/docs/usage/providers/ppio.zh-CN.mdx +6 -6
  190. package/docs/usage/providers/qiniu.mdx +6 -6
  191. package/docs/usage/providers/qiniu.zh-CN.mdx +2 -1
  192. package/docs/usage/providers/qwen.mdx +2 -4
  193. package/docs/usage/providers/sambanova.mdx +2 -1
  194. package/docs/usage/providers/sensenova.mdx +2 -2
  195. package/docs/usage/providers/siliconcloud.mdx +2 -2
  196. package/docs/usage/providers/stepfun.mdx +2 -3
  197. package/docs/usage/providers/taichu.mdx +2 -3
  198. package/docs/usage/providers/togetherai.mdx +2 -2
  199. package/docs/usage/providers/vllm.mdx +15 -12
  200. package/docs/usage/providers/vllm.zh-CN.mdx +9 -7
  201. package/docs/usage/providers/volcengine.mdx +16 -14
  202. package/docs/usage/providers/wenxin.mdx +2 -2
  203. package/docs/usage/providers/xai.mdx +2 -2
  204. package/docs/usage/providers/zeroone.mdx +2 -3
  205. package/docs/usage/providers/zeroone.zh-CN.mdx +2 -2
  206. package/docs/usage/providers/zhipu.mdx +2 -3
  207. package/docs/usage/providers/zhipu.zh-CN.mdx +1 -1
  208. package/docs/usage/providers.mdx +2 -3
  209. package/docs/usage/start.mdx +2 -3
  210. package/docs/usage/tools-calling/anthropic.mdx +2 -2
  211. package/docs/usage/tools-calling/anthropic.zh-CN.mdx +2 -2
  212. package/docs/usage/tools-calling/google.mdx +2 -2
  213. package/docs/usage/tools-calling/google.zh-CN.mdx +4 -4
  214. package/docs/usage/tools-calling/groq.zh-CN.mdx +2 -2
  215. package/docs/usage/tools-calling/openai.mdx +2 -2
  216. package/docs/usage/tools-calling/openai.zh-CN.mdx +2 -2
  217. package/package.json +1 -1
  218. package/packages/web-crawler/src/crawImpl/exa.ts +93 -0
  219. package/packages/web-crawler/src/crawImpl/firecrawl.ts +97 -0
  220. package/packages/web-crawler/src/crawImpl/index.ts +6 -0
  221. package/packages/web-crawler/src/crawImpl/tavily.ts +94 -0
  222. package/src/app/(backend)/webapi/user/avatar/[id]/[image]/route.ts +1 -1
  223. package/src/app/[variants]/(main)/repos/[id]/_layout/Mobile.tsx +7 -7
  224. package/src/config/aiModels/deepseek.ts +1 -0
  225. package/src/config/aiModels/hunyuan.ts +1 -0
  226. package/src/config/aiModels/mistral.ts +1 -2
  227. package/src/config/aiModels/modelscope.ts +3 -3
  228. package/src/config/aiModels/novita.ts +23 -22
  229. package/src/config/aiModels/openrouter.ts +1 -0
  230. package/src/config/aiModels/qwen.ts +11 -11
  231. package/src/config/aiModels/siliconcloud.ts +7 -6
  232. package/src/config/aiModels/vertexai.ts +2 -2
  233. package/src/config/aiModels/wenxin.ts +1 -2
  234. package/src/config/modelProviders/baichuan.ts +3 -0
  235. package/src/config/modelProviders/fireworksai.ts +3 -0
  236. package/src/config/modelProviders/giteeai.ts +3 -0
  237. package/src/config/modelProviders/github.ts +1 -2
  238. package/src/config/modelProviders/groq.ts +0 -3
  239. package/src/config/modelProviders/hunyuan.ts +3 -0
  240. package/src/config/modelProviders/infiniai.ts +0 -3
  241. package/src/config/modelProviders/internlm.ts +3 -0
  242. package/src/config/modelProviders/minimax.ts +3 -4
  243. package/src/config/modelProviders/modelscope.ts +3 -3
  244. package/src/config/modelProviders/moonshot.ts +0 -7
  245. package/src/config/modelProviders/novita.ts +3 -0
  246. package/src/config/modelProviders/openrouter.ts +0 -4
  247. package/src/config/modelProviders/perplexity.ts +0 -3
  248. package/src/config/modelProviders/qiniu.ts +0 -3
  249. package/src/config/modelProviders/qwen.ts +0 -3
  250. package/src/config/modelProviders/sensenova.ts +3 -0
  251. package/src/config/modelProviders/siliconcloud.ts +0 -3
  252. package/src/config/modelProviders/spark.ts +0 -5
  253. package/src/config/modelProviders/stepfun.ts +3 -6
  254. package/src/config/modelProviders/taichu.ts +3 -0
  255. package/src/config/modelProviders/tencentcloud.ts +3 -0
  256. package/src/config/modelProviders/togetherai.ts +3 -0
  257. package/src/config/modelProviders/upstage.ts +3 -0
  258. package/src/config/modelProviders/wenxin.ts +3 -4
  259. package/src/config/modelProviders/xai.ts +0 -3
  260. package/src/config/modelProviders/zhipu.ts +3 -0
  261. package/src/database/client/migrations.json +10 -0
  262. package/src/database/migrations/0023_remove_param_and_doubao.sql +6 -0
  263. package/src/database/migrations/meta/0014_snapshot.json +182 -539
  264. package/src/database/migrations/meta/0016_snapshot.json +182 -539
  265. package/src/database/migrations/meta/0023_snapshot.json +5340 -0
  266. package/src/database/migrations/meta/_journal.json +7 -0
  267. package/src/database/repositories/dataImporter/__tests__/fixtures/with-client-id.json +13 -58
  268. package/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx +1 -8
  269. package/src/features/ChatInput/ActionBar/Model/index.tsx +8 -16
  270. package/src/features/ChatInput/ActionBar/Search/Controls.tsx +4 -12
  271. package/src/features/ChatInput/ActionBar/Search/FCSearchModel.tsx +1 -7
  272. package/src/features/ChatInput/ActionBar/Search/index.tsx +2 -4
  273. package/src/features/ModelSwitchPanel/index.tsx +1 -4
  274. package/src/libs/model-runtime/anthropic/index.test.ts +4 -2
  275. package/src/libs/model-runtime/utils/streams/anthropic.ts +12 -11
  276. package/src/libs/model-runtime/utils/streams/openai.ts +6 -4
  277. package/src/libs/model-runtime/utils/streams/protocol.ts +1 -1
  278. package/src/libs/model-runtime/utils/streams/spark.test.ts +1 -1
  279. package/src/libs/model-runtime/utils/streams/spark.ts +1 -2
  280. package/src/middleware.ts +1 -1
  281. package/src/server/services/search/impls/bocha/index.ts +124 -0
  282. package/src/server/services/search/impls/bocha/type.ts +47 -0
  283. package/src/server/services/search/impls/exa/index.ts +129 -0
  284. package/src/server/services/search/impls/exa/type.ts +39 -0
  285. package/src/server/services/search/impls/firecrawl/index.ts +128 -0
  286. package/src/server/services/search/impls/firecrawl/type.ts +35 -0
  287. package/src/server/services/search/impls/index.ts +31 -0
  288. package/src/server/services/search/impls/jina/index.ts +109 -0
  289. package/src/server/services/search/impls/jina/type.ts +26 -0
  290. package/src/server/services/search/impls/tavily/index.ts +124 -0
  291. package/src/server/services/search/impls/tavily/type.ts +36 -0
  292. package/src/server/services/user/index.ts +3 -4
  293. package/src/services/__tests__/assistant.test.ts +4 -6
  294. package/src/services/__tests__/tool.test.ts +3 -1
  295. package/src/store/user/slices/auth/selectors.ts +1 -1
  296. package/src/store/user/slices/common/action.test.ts +1 -1
  297. package/src/tools/web-browsing/index.ts +1 -7
@@ -61,7 +61,8 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN
61
61
  - [域名模式](#域名模式):支持局域网 / 公网在使用反向代理下的 `http/https` 访问,适用于个人或团队日常使用;
62
62
 
63
63
  <Callout type="info">
64
- 在脚本的选项提示 `(选项1/选项2)[选项1]` 中:`(选项1 / 选项2)` 代表可以选择的选项,`[选项1]`代表默认选项,直接回车即可选择默认选项。
64
+ 在脚本的选项提示 `(选项1/选项2)[选项1]` 中:`(选项1 / 选项2)`
65
+ 代表可以选择的选项,`[选项1]`代表默认选项,直接回车即可选择默认选项。
65
66
  </Callout>
66
67
 
67
68
  ### 本地模式
@@ -75,9 +76,7 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN
75
76
 
76
77
  你需要在脚本运行结束后查看配置生成报告,包括 Casdoor 管理员的帐号、用户账号和它们的初始登录密码。
77
78
 
78
- <Callout type="warning">
79
- 请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。
80
- </Callout>
79
+ <Callout type="warning">请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。</Callout>
81
80
 
82
81
  ```log
83
82
  安全密钥生成结果如下:
@@ -123,8 +122,7 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN
123
122
 
124
123
  ### 访问应用
125
124
 
126
- 通过 [http://localhost:3210](http://localhost:3210) 访问你的 LobeChat 服务。
127
- 应用的账号密码在步骤`2`的报告中。
125
+ 通过 [http://localhost:3210](http://localhost:3210) 访问你的 LobeChat 服务。应用的账号密码在步骤`2`的报告中。
128
126
  </Steps>
129
127
 
130
128
  ### 端口模式
@@ -141,9 +139,7 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN
141
139
 
142
140
  你需要在脚本运行结束后查看配置生成报告,包括 Casdoor 管理员的帐号、用户账号和它们的初始登录密码。
143
141
 
144
- <Callout type="warning">
145
- 请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。
146
- </Callout>
142
+ <Callout type="warning">请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。</Callout>
147
143
 
148
144
  ```log
149
145
  安全密钥生成结果如下:
@@ -188,8 +184,7 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN
188
184
 
189
185
  ### 访问应用
190
186
 
191
- 你可以通过 `http://your_server_ip:3210` 访问你的 LobeChat 服务。
192
- 应用的账号密码在步骤`2`的报告中。
187
+ 你可以通过 `http://your_server_ip:3210` 访问你的 LobeChat 服务。应用的账号密码在步骤`2`的报告中。
193
188
 
194
189
  <Callout type="warning">
195
190
  请注意,如果你的服务能够被公网访问,我们强烈建议你参考 [文档](https://lobehub.com/docs/self-hosting/advanced/auth/next-auth/casdoor) 关闭注册功能。
@@ -239,23 +234,21 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN
239
234
  - 选择访问协议:`http` 或 `https`
240
235
  - 安全密钥重新生成:我们强烈建议你重新生成安全密钥,如果你缺少脚本所需的密钥生成库,我们建议你参考 [自定义部署](#自定义部署) 章节对密钥进行修改。
241
236
 
242
- <Callout type="warning">
243
- 以下问题可能导致你的服务无法正常访问:
237
+ <Callout type="warning">
238
+ 以下问题可能导致你的服务无法正常访问:
244
239
 
245
- - 此处的域名配置需要与步骤`1`中的反向代理配置保持一致。
240
+ - 此处的域名配置需要与步骤`1`中的反向代理配置保持一致。
246
241
 
247
- - 如果你使用 Cloudflare 的域名解析服务并开启了 `全程代理`,请使用 `https` 协议。
242
+ - 如果你使用 Cloudflare 的域名解析服务并开启了 `全程代理`,请使用 `https` 协议。
248
243
 
249
- - 如果你使用了 HTTPS 协议,请确保你的域名证书已经正确配置,一键部署默认不支持自签发证书。
250
- </Callout>
244
+ - 如果你使用了 HTTPS 协议,请确保你的域名证书已经正确配置,一键部署默认不支持自签发证书。
245
+ </Callout>
251
246
 
252
247
  ### 查看配置生成报告
253
248
 
254
249
  你需要在脚本运行结束后查看配置生成报告,包括 Casdoor 管理员的初始登录密码。
255
250
 
256
- <Callout type="warning">
257
- 请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。
258
- </Callout>
251
+ <Callout type="warning">请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。</Callout>
259
252
 
260
253
  ```log
261
254
  安全密钥生成结果如下:
@@ -309,8 +302,7 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN
309
302
 
310
303
  ## 自定义部署
311
304
 
312
- 该章节主要为你介绍在不同的网络环境下自定义部署 LobeChat 服务必须要修改的配置。
313
- 在开始前,你可以先下载 [Docker Compose 配置文件](https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml) 以及 [环境变量配置文件](https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/.env.zh-CN.example)。
305
+ 该章节主要为你介绍在不同的网络环境下自定义部署 LobeChat 服务必须要修改的配置。在开始前,你可以先下载 [Docker Compose 配置文件](https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml) 以及 [环境变量配置文件](https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/.env.zh-CN.example)。
314
306
 
315
307
  ```sh
316
308
  curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml
@@ -319,7 +311,8 @@ mv .env.zh-CN.example .env
319
311
  ```
320
312
 
321
313
  <Callout type="info">
322
- 本章节并不包含所有完整变量,剩余的变量可以查阅 [使用服务端数据库部署](/zh/docs/self-hosting/server-database) 。
314
+ 本章节并不包含所有完整变量,剩余的变量可以查阅
315
+ [使用服务端数据库部署](/zh/docs/self-hosting/server-database) 。
323
316
  </Callout>
324
317
 
325
318
  ### 预备知识
@@ -331,8 +324,7 @@ mv .env.zh-CN.example .env
331
324
  - 支持 S3 协议的对象存储服务
332
325
  - 受 LobeChat 支持的 SSO 登录鉴权服务
333
326
 
334
- 这些服务可以通过自建或者在线云服务组合搭配,以满足不同层次的部署需求。
335
- 本文中,我们提供了完全基于开源自建服务的 Docker Compose 配置,你可以直接使用这份配置文件来启动 LobeChat 数据库版本,也可以对之进行修改以适应你的需求。
327
+ 这些服务可以通过自建或者在线云服务组合搭配,以满足不同层次的部署需求。本文中,我们提供了完全基于开源自建服务的 Docker Compose 配置,你可以直接使用这份配置文件来启动 LobeChat 数据库版本,也可以对之进行修改以适应你的需求。
336
328
 
337
329
  我们默认使用 [MinIO](https://github.com/minio/minio) 作为本地 S3 对象存储服务,使用 [Casdoor](https://github.com/casdoor/casdoor) 作为本地鉴权服务。
338
330
 
@@ -352,8 +344,7 @@ mv .env.zh-CN.example .env
352
344
  AUTH_CASDOOR_ISSUER=https://auth.example.com
353
345
  ```
354
346
 
355
- 该配置会影响 LobeChat 的登录鉴权服务,你需要确保 Casdoor 服务的地址正确。
356
- 你可以在 [常见问题](#常见问题) 中找到该配置错误的常见现象及解决方案。
347
+ 该配置会影响 LobeChat 的登录鉴权服务,你需要确保 Casdoor 服务的地址正确。你可以在 [常见问题](#常见问题) 中找到该配置错误的常见现象及解决方案。
357
348
 
358
349
  - 同时,你也需要在 Casdoor 中允许回调地址为 LobeChat 的地址:
359
350
 
@@ -412,6 +403,7 @@ lobe-chat | [auth][error] r3: "response" is not a conform Authorization Ser
412
403
  - 请参考 [域名模式](#域名模式) 章节中的反向代理配置注意事项。
413
404
 
414
405
  - 一个直接的排查方式,你可以直接访问 `https://auth.example.com/.well-known/openid-configuration`,如果
406
+
415
407
  - 返回了非 JSON 格式的数据,则说明你的反向代理配置错误。
416
408
  - 如果返回的 JSON 格式数据中的 `"issuer": "URL"` 字段不是你配置的 `https://auth.example.com`,则说明你的环境变量配置错误。
417
409
 
@@ -493,9 +485,8 @@ lobe-chat | [auth][error] TypeError: fetch failed
493
485
  适用于已经在生产环境下使用 `logto` 作为登录鉴权服务的用户
494
486
 
495
487
  <Callout type="info">
496
- 由于使用[Logto](https://logto.io/)
497
- 作为登录鉴权服务存在比较大的不稳定性。
498
- 因此,下文基于发布到 IP 模式的教程,实现了使用 Casdoor 作为鉴权服务提供商的域名发布方案。
488
+ 由于使用[Logto](https://logto.io/) 作为登录鉴权服务存在比较大的不稳定性。 因此,下文基于发布到 IP
489
+ 模式的教程,实现了使用 Casdoor 作为鉴权服务提供商的域名发布方案。
499
490
  本文剩余部分也将以其为例进行说明。如果你使用其他诸如 Logto
500
491
  等其他登录鉴权服务,流程应当相近,但请注意不同的登录鉴权服务的端口配置可能有所差异。
501
492
  </Callout>
@@ -527,44 +518,49 @@ docker compose up -d
527
518
  接下来,修改配置文件以实现域名发布
528
519
 
529
520
  1. 修改 `docker-compose.yml` 文件
521
+
530
522
  1. 修改 `minio`的`MINIO_API_CORS_ALLOW_ORIGIN`字段。
523
+
531
524
  ```yaml
532
- 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com'
525
+ 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com'
533
526
  ```
527
+
534
528
  2. 修改`casdoor`的`origin`字段。
529
+
535
530
  ```yaml
536
- origin: 'https://auth.example.com'
531
+ origin: 'https://auth.example.com'
537
532
  ```
533
+
538
534
  3. 修改`lobe`的`environment`字段。
535
+
539
536
  ```yaml
540
- # - 'APP_URL=http://localhost:3210'
541
- - 'APP_URL=https://lobe.example.com'
537
+ # - 'APP_URL=http://localhost:3210'
538
+ - 'APP_URL=https://lobe.example.com'
542
539
 
543
- - 'NEXT_AUTH_SSO_PROVIDERS=casdoor'
544
- - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
545
- - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
546
- # - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth'
547
- - 'AUTH_URL=https://lobe.example.com/api/auth'
540
+ - 'NEXT_AUTH_SSO_PROVIDERS=casdoor'
541
+ - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
542
+ - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
543
+ # - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth'
544
+ - 'AUTH_URL=https://lobe.example.com/api/auth'
548
545
 
549
- # - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}'
550
- - 'AUTH_CASDOOR_ISSUER=https://auth.example.com'
546
+ # - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}'
547
+ - 'AUTH_CASDOOR_ISSUER=https://auth.example.com'
551
548
 
552
- - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}'
553
- # - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}'
554
- - 'S3_ENDPOINT=https://minio.example.com'
549
+ - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}'
550
+ # - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}'
551
+ - 'S3_ENDPOINT=https://minio.example.com'
555
552
 
556
- - 'S3_BUCKET=${MINIO_LOBE_BUCKET}'
557
- # - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}'
558
- - 'S3_PUBLIC_DOMAIN=https://minio.example.com'
553
+ - 'S3_BUCKET=${MINIO_LOBE_BUCKET}'
554
+ # - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}'
555
+ - 'S3_PUBLIC_DOMAIN=https://minio.example.com'
559
556
 
560
- - 'S3_ENABLE_PATH_STYLE=1'
561
- - 'LLM_VISION_IMAGE_USE_BASE64=1'
557
+ - 'S3_ENABLE_PATH_STYLE=1'
558
+ - 'LLM_VISION_IMAGE_USE_BASE64=1'
562
559
  ```
560
+
563
561
  2. 修改 `.env` 文件
564
562
 
565
- <Callout type="info">
566
- 为了安全起见,修改 `.env` 文件中的 ROOT USER 的字段
567
- </Callout>
563
+ <Callout type="info">为了安全起见,修改 `.env` 文件中的 ROOT USER 的字段</Callout>
568
564
 
569
565
  ```sh
570
566
  # MinIO S3 configuration
@@ -666,13 +662,11 @@ docker compose up -d # 重新启动
666
662
  # HTTP_PROXY=http://localhost:7890
667
663
  # HTTPS_PROXY=http://localhost:7890
668
664
 
669
-
670
665
  # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
671
666
  # OPENAI_API_KEY=sk-xxxx
672
667
  # OPENAI_PROXY_URL=https://api.openai.com/v1
673
668
  # OPENAI_MODEL_LIST=...
674
669
 
675
-
676
670
  # ===========================
677
671
  # ====== Preset config ======
678
672
  # ===========================
@@ -697,7 +691,6 @@ MINIO_ROOT_PASSWORD=Crj1570768
697
691
  MINIO_LOBE_BUCKET=lobe
698
692
  S3_ACCESS_KEY_ID=dB6Uq9CYZPdWSZouPyEd
699
693
  S3_SECRET_ACCESS_KEY=aPBW8CVULkh8bw1GatlT0GjLihcXHLNwRml4pieS
700
-
701
694
  ```
702
695
 
703
696
  - `docker-compose.yml`
@@ -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
5
- and local machines.
4
+ Learn how to deploy the LobeChat server database version using Docker on Linux and local machines.
5
+
6
6
  tags:
7
7
  - LobeChat
8
8
  - Docker
@@ -55,8 +55,8 @@ tags:
55
55
  </Callout>
56
56
 
57
57
  <Callout type="warning">
58
- 以上指令得到的 pg
59
- 实例并没有指定持久化存储位置,因此仅用于测试 / 演示,生产环境请自行配置持久化存储。
58
+ 以上指令得到的 pg 实例并没有指定持久化存储位置,因此仅用于测试 /
59
+ 演示,生产环境请自行配置持久化存储。
60
60
  </Callout>
61
61
 
62
62
  ### 创建名为 `lobe-chat.env` 文件用于存放环境变量:
@@ -1,8 +1,8 @@
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:
5
- database, authentication and S3 storage service.
4
+ Learn how to deploy LobeChat with database on Dokploy with ease, including: database, authentication and S3 storage service.
5
+
6
6
  tags:
7
7
  - Deploy LobeChat
8
8
  - Vercel Deployment
@@ -32,7 +32,7 @@ curl -sSL https://dokploy.com/install.sh | sh
32
32
 
33
33
  ### Configure S3 Storage Service
34
34
 
35
- In the server-side database, we need to configure the S3 storage service to store files. For detailed configuration instructions, please refer to the section [Configure S3 Storage Service](https://lobehub.com/docs/self-hosting/server-database/vercel#3-configure-s-3-storage-service) in the Vercel deployment guide。After the configuration is complete, you will obtain the following environment variables:
35
+ In the server-side database, we need to configure the S3 storage service to store files. For detailed configuration instructions, please refer to the section [Configure S3 Storage Service](https://lobehub.com/docs/self-hosting/server-database/vercel#3-configure-s-3-storage-service) in the Vercel deployment guide。After the configuration is complete, you will obtain the following environment variables:
36
36
 
37
37
  ```shell
38
38
  S3_ACCESS_KEY_ID=
@@ -59,8 +59,7 @@ Enter the previously created Project, click on Create Service, and select Databa
59
59
 
60
60
  ![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f)
61
61
 
62
- Enter the created database and set an unused port in External Credentials to allow external access; otherwise, LobeChat will not be able to connect to the database.
63
- You can view the Postgres database connection URL in External Host, as shown below:
62
+ Enter the created database and set an unused port in External Credentials to allow external access; otherwise, LobeChat will not be able to connect to the database. You can view the Postgres database connection URL in External Host, as shown below:
64
63
 
65
64
  ```shell
66
65
  postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres
@@ -1,138 +1,137 @@
1
- ---
2
- title: 在 Dokploy 上部署 LobeChat 的服务端数据库版本
3
- description: 本文详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat,包括数据库配置、身份验证服务配置的设置步骤。
4
- tags:
5
- - 服务端数据库
6
- - Postgres
7
- - Clerk
8
- - Dokploy部署
9
- - 数据库配置
10
- - 身份验证服务
11
- - 环境变量配置
12
- ---
13
-
14
- # 在 Dokploy 上部署服务端数据库版
15
-
16
- 本文将详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat。
17
-
18
- ## 一、准备工作
19
-
20
- ### 部署 Dokploy 并进行相关设置
21
-
22
- ```shell
23
- curl -sSL https://dokploy.com/install.sh | sh
24
- ```
25
-
26
- 1. 在 Dokploy 的 Settings / Git 处根据提示将 Github 绑定到 Dokploy
27
-
28
- ![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996)
29
-
30
- 2. 进入 Projects 界面创建一个 Project
31
-
32
- ![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e)
33
-
34
- ### 配置 S3 存储服务
35
-
36
- 在服务端数据库中我们需要配置 S3 存储服务来存储文件,详细配置教程请参考 使用 Vercel 部署中 [配置 S3 储存服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#%E4%B8%89%E3%80%81-%E9%85%8D%E7%BD%AE-s-3-%E5%AD%98%E5%82%A8%E6%9C%8D%E5%8A%A1)。配置完成后你将获得以下环境变量:
37
-
38
- ```shell
39
- S3_ACCESS_KEY_ID=
40
- S3_SECRET_ACCESS_KEY=
41
- S3_ENDPOINT=
42
- S3_BUCKET=
43
- S3_PUBLIC_DOMAIN=
44
- S3_ENABLE_PATH_STYLE=
45
- ```
46
-
47
- ### 配置 Clerk 身份验证服务
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#二、-配置身份验证服务)
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
- ```
56
-
57
- ## 二、在 Dokploy 上部署数据库
58
-
59
- 进入前面创建的 Project,点击 Create Service 选择 Database,在 Database 界面选择 PostgreSQL ,然后设置数据库名、用户、密码,在 Docker image 中填入 `pgvector/pgvector:pg17` 最后点击 Create 创建数据库。
60
-
61
- ![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f)
62
-
63
- 进入创建的数据库,在 External Credentials 设置一个未被占用的端口,使其能能通过外部访问,否则 LobeChat 将无法连接到该数据库。
64
- 你可以在 External Host 查看 Postgres 数据库连接 URL ,如下:
65
-
66
- ```shell
67
- postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres
68
- ```
69
-
70
- 最后点击 Deploy 部署数据库
71
-
72
- ![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e)
73
-
74
- ## 在 Dokploy 上部署 LobeChat
75
-
76
- 点击 Create Service 选择 Application,创建 LobeChat 应用
77
-
78
- ![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c)
79
-
80
- 进入创建的 LobeChat 应用,选择你 fork 的 lobe-chat 项目及分支,点击 Save 保存
81
-
82
- ![](https://github.com/user-attachments/assets/2bb4c09d-75bb-4c46-bb2f-faf538308305)
83
-
84
- 切换到 Environment ,在其中填入环境变量,点击保存。
85
-
86
- ![](https://github.com/user-attachments/assets/0f79c266-cce5-4936-aabd-4c8f19196d91)
87
-
88
- ```shell
89
- # 构建所必需的环境变量
90
- NIXPACKS_PKGS="bun"
91
- NIXPACKS_INSTALL_CMD="pnpm install"
92
- NIXPACKS_BUILD_CMD="NODE_OPTIONS='--max-old-space-size=8192' pnpm run build"
93
- NIXPACKS_START_CMD="pnpm start"
94
-
95
- APP_URL=
96
-
97
- # 指定服务模式为 server
98
- NEXT_PUBLIC_SERVICE_MODE=server
99
-
100
- # Postgres 数据库相关配置
101
- DATABASE_DRIVER=node
102
- DATABASE_URL=
103
-
104
- # 你可以使用 openssl rand -base64 32 生成一个随机的 32 位字符串作为密钥。
105
- KEY_VAULTS_SECRET=
106
-
107
- # Clerk 相关配置
108
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
109
- CLERK_SECRET_KEY=
110
- CLERK_WEBHOOK_SECRET=
111
-
112
- # S3 相关配置
113
- S3_ACCESS_KEY_ID=
114
- S3_SECRET_ACCESS_KEY=
115
- S3_ENDPOINT=
116
- S3_BUCKET=
117
- S3_PUBLIC_DOMAIN=
118
- S3_ENABLE_PATH_STYLE=
119
-
120
- # OpenAI 相关配置
121
- OPENAI_API_KEY=
122
- OPENAI_MODEL_LIST=
123
- OPENAI_PROXY_URL=
124
- ```
125
-
126
- 添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息
127
-
128
- ![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec)
129
-
130
- 部署成功后在 Domains 页面,为你的 LobeChat 应用绑定自己的域名并申请证书。
131
-
132
- ![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7)
133
-
134
- ## 验证 LobeChat 是否正常工作
135
-
136
- 进入你的 LobeChat 网址,如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~
137
-
138
- ![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26)
1
+ ---
2
+ title: 在 Dokploy 上部署 LobeChat 的服务端数据库版本
3
+ description: 本文详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat,包括数据库配置、身份验证服务配置的设置步骤。
4
+ tags:
5
+ - 服务端数据库
6
+ - Postgres
7
+ - Clerk
8
+ - Dokploy部署
9
+ - 数据库配置
10
+ - 身份验证服务
11
+ - 环境变量配置
12
+ ---
13
+
14
+ # 在 Dokploy 上部署服务端数据库版
15
+
16
+ 本文将详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat。
17
+
18
+ ## 一、准备工作
19
+
20
+ ### 部署 Dokploy 并进行相关设置
21
+
22
+ ```shell
23
+ curl -sSL https://dokploy.com/install.sh | sh
24
+ ```
25
+
26
+ 1. 在 Dokploy 的 Settings / Git 处根据提示将 Github 绑定到 Dokploy
27
+
28
+ ![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996)
29
+
30
+ 2. 进入 Projects 界面创建一个 Project
31
+
32
+ ![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e)
33
+
34
+ ### 配置 S3 存储服务
35
+
36
+ 在服务端数据库中我们需要配置 S3 存储服务来存储文件,详细配置教程请参考 使用 Vercel 部署中 [配置 S3 储存服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#%E4%B8%89%E3%80%81-%E9%85%8D%E7%BD%AE-s-3-%E5%AD%98%E5%82%A8%E6%9C%8D%E5%8A%A1)。配置完成后你将获得以下环境变量:
37
+
38
+ ```shell
39
+ S3_ACCESS_KEY_ID=
40
+ S3_SECRET_ACCESS_KEY=
41
+ S3_ENDPOINT=
42
+ S3_BUCKET=
43
+ S3_PUBLIC_DOMAIN=
44
+ S3_ENABLE_PATH_STYLE=
45
+ ```
46
+
47
+ ### 配置 Clerk 身份验证服务
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#二、-配置身份验证服务)
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
+ ```
56
+
57
+ ## 二、在 Dokploy 上部署数据库
58
+
59
+ 进入前面创建的 Project,点击 Create Service 选择 Database,在 Database 界面选择 PostgreSQL ,然后设置数据库名、用户、密码,在 Docker image 中填入 `pgvector/pgvector:pg17` 最后点击 Create 创建数据库。
60
+
61
+ ![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f)
62
+
63
+ 进入创建的数据库,在 External Credentials 设置一个未被占用的端口,使其能能通过外部访问,否则 LobeChat 将无法连接到该数据库。你可以在 External Host 查看 Postgres 数据库连接 URL ,如下:
64
+
65
+ ```shell
66
+ postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres
67
+ ```
68
+
69
+ 最后点击 Deploy 部署数据库
70
+
71
+ ![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e)
72
+
73
+ ## 在 Dokploy 上部署 LobeChat
74
+
75
+ 点击 Create Service 选择 Application,创建 LobeChat 应用
76
+
77
+ ![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c)
78
+
79
+ 进入创建的 LobeChat 应用,选择你 fork 的 lobe-chat 项目及分支,点击 Save 保存
80
+
81
+ ![](https://github.com/user-attachments/assets/2bb4c09d-75bb-4c46-bb2f-faf538308305)
82
+
83
+ 切换到 Environment ,在其中填入环境变量,点击保存。
84
+
85
+ ![](https://github.com/user-attachments/assets/0f79c266-cce5-4936-aabd-4c8f19196d91)
86
+
87
+ ```shell
88
+ # 构建所必需的环境变量
89
+ NIXPACKS_PKGS="bun"
90
+ NIXPACKS_INSTALL_CMD="pnpm install"
91
+ NIXPACKS_BUILD_CMD="NODE_OPTIONS='--max-old-space-size=8192' pnpm run build"
92
+ NIXPACKS_START_CMD="pnpm start"
93
+
94
+ APP_URL=
95
+
96
+ # 指定服务模式为 server
97
+ NEXT_PUBLIC_SERVICE_MODE=server
98
+
99
+ # Postgres 数据库相关配置
100
+ DATABASE_DRIVER=node
101
+ DATABASE_URL=
102
+
103
+ # 你可以使用 openssl rand -base64 32 生成一个随机的 32 位字符串作为密钥。
104
+ KEY_VAULTS_SECRET=
105
+
106
+ # Clerk 相关配置
107
+ NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
108
+ CLERK_SECRET_KEY=
109
+ CLERK_WEBHOOK_SECRET=
110
+
111
+ # S3 相关配置
112
+ S3_ACCESS_KEY_ID=
113
+ S3_SECRET_ACCESS_KEY=
114
+ S3_ENDPOINT=
115
+ S3_BUCKET=
116
+ S3_PUBLIC_DOMAIN=
117
+ S3_ENABLE_PATH_STYLE=
118
+
119
+ # OpenAI 相关配置
120
+ OPENAI_API_KEY=
121
+ OPENAI_MODEL_LIST=
122
+ OPENAI_PROXY_URL=
123
+ ```
124
+
125
+ 添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息
126
+
127
+ ![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec)
128
+
129
+ 部署成功后在 Domains 页面,为你的 LobeChat 应用绑定自己的域名并申请证书。
130
+
131
+ ![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7)
132
+
133
+ ## 验证 LobeChat 是否正常工作
134
+
135
+ 进入你的 LobeChat 网址,如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~
136
+
137
+ ![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26)
@@ -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,
5
- authentication and S3 storage service.
4
+ Learn how to deploy LobeChat on Netlify with ease, including: database, authentication and S3 storage service.
5
+
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,
5
- authentication and S3 storage service.
4
+ Learn how to deploy LobeChat on Railway with ease, including: database, authentication and S3 storage service.
5
+
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,
5
- authentication and S3 storage service.
4
+ Learn how to deploy LobeChat on RepoCloud with ease, including database, authentication and S3 storage service.
5
+
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
5
- set up LobeChat and start using it efficiently.
4
+ Learn how to deploy LobeChat on Sealos with ease. Follow the provided steps to set up LobeChat and start using it efficiently.
5
+
6
6
  tags:
7
7
  - Deploy LobeChat
8
8
  - Sealos Deployment
@@ -90,9 +90,8 @@ Fill in the following three required parameters:
90
90
 
91
91
  **Step 3**:Click the `Save changes` button to save the configuration.
92
92
 
93
- **Step 4**:Now, access the Lobe Chat database version through `https://<lobe-chat-db-public-address>`, click the avatar in the upper left corner, and then click the [Log in / Sign up] button.
93
+ **Step 4**:Now, access the Lobe Chat database version through `https://<lobe-chat-db-public-address>`, click the avatar in the upper left corner, and then click the \[Log in / Sign up] button.
94
94
 
95
- **Step 5**:Next, you will be redirected to the Logto login page, click the [Create account] button to register an account.
95
+ **Step 5**:Next, you will be redirected to the Logto login page, click the \[Create account] button to register an account.
96
96
 
97
97
  **Step 6**:After registration, you can use Logto to login to the Lobe Chat database version.
98
-