@lobehub/chat 1.44.3 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.remarkrc.mdx.js +6 -0
- package/CHANGELOG.md +25 -0
- package/changelog/v1.json +9 -0
- package/docs/changelog/2023-09-09-plugin-system.mdx +5 -0
- package/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx +5 -0
- package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -0
- package/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx +6 -0
- package/docs/changelog/2023-11-19-tts-stt.mdx +6 -0
- package/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx +7 -0
- package/docs/changelog/2023-12-22-dalle-3.mdx +6 -0
- package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +4 -0
- package/docs/changelog/2024-02-08-sso-oauth.mdx +6 -0
- package/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx +6 -0
- package/docs/changelog/2024-02-14-ollama.mdx +6 -0
- package/docs/changelog/2024-02-14-ollama.zh-CN.mdx +5 -0
- package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +6 -0
- package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +5 -0
- package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +5 -0
- package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +4 -0
- package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +6 -0
- package/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx +5 -0
- package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +6 -0
- package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx +5 -0
- package/docs/changelog/2024-09-13-openai-o1-models.mdx +6 -0
- package/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx +6 -0
- package/docs/changelog/2024-09-20-artifacts.mdx +6 -0
- package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +6 -0
- package/docs/changelog/2024-10-27-pin-assistant.mdx +5 -0
- package/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx +4 -0
- package/docs/changelog/2024-11-06-share-text-json.mdx +4 -0
- package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +4 -0
- package/docs/changelog/2024-11-25-november-providers.mdx +7 -0
- package/docs/changelog/2024-11-25-november-providers.zh-CN.mdx +7 -0
- package/docs/changelog/2024-11-27-forkable-chat.mdx +4 -0
- package/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx +5 -0
- package/docs/changelog/2025-01-03-user-profile.mdx +5 -0
- package/docs/changelog/2025-01-03-user-profile.zh-CN.mdx +4 -1
- package/docs/self-hosting/advanced/auth/clerk.mdx +25 -41
- package/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx +23 -37
- package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +31 -58
- package/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx +30 -57
- package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +38 -38
- package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +37 -38
- package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +26 -31
- package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +25 -30
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +74 -75
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +72 -73
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +24 -25
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +23 -24
- package/docs/self-hosting/advanced/auth/next-auth/github.mdx +46 -73
- package/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +43 -70
- package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +28 -37
- package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +28 -37
- package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +36 -49
- package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +30 -43
- package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +13 -14
- package/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx +14 -15
- package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +35 -69
- package/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx +34 -68
- package/docs/self-hosting/advanced/auth.mdx +14 -13
- package/docs/self-hosting/advanced/auth.zh-CN.mdx +15 -14
- package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +15 -15
- package/docs/self-hosting/advanced/knowledge-base.mdx +14 -3
- package/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +12 -3
- package/docs/self-hosting/advanced/model-list.zh-CN.mdx +5 -5
- package/docs/self-hosting/advanced/s3/cloudflare-r2.mdx +52 -81
- package/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx +51 -80
- package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +20 -34
- package/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx +28 -43
- package/docs/self-hosting/advanced/s3.mdx +30 -34
- package/docs/self-hosting/advanced/s3.zh-CN.mdx +28 -33
- package/docs/self-hosting/advanced/settings-url-share.mdx +6 -6
- package/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +19 -19
- package/docs/self-hosting/advanced/upstream-sync.mdx +73 -89
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +71 -87
- package/docs/self-hosting/advanced/webrtc.mdx +14 -21
- package/docs/self-hosting/advanced/webrtc.zh-CN.mdx +19 -26
- package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +0 -3
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +1 -1
- package/docs/self-hosting/environment-variables/basic.mdx +13 -13
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +15 -15
- package/docs/self-hosting/environment-variables/model-provider.mdx +1 -1
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +1 -1
- package/docs/self-hosting/environment-variables/s3.mdx +3 -4
- package/docs/self-hosting/environment-variables/s3.zh-CN.mdx +5 -7
- package/docs/self-hosting/environment-variables.mdx +8 -4
- package/docs/self-hosting/environment-variables.zh-CN.mdx +4 -0
- package/docs/self-hosting/examples/azure-openai.mdx +9 -12
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +8 -11
- package/docs/self-hosting/examples/ollama.mdx +8 -7
- package/docs/self-hosting/examples/ollama.zh-CN.mdx +8 -7
- package/docs/self-hosting/platform/alibaba-cloud.mdx +5 -7
- package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +5 -7
- package/docs/self-hosting/platform/btpanel.mdx +3 -2
- package/docs/self-hosting/platform/btpanel.zh-CN.mdx +3 -3
- package/docs/self-hosting/platform/docker-compose.mdx +75 -85
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +75 -85
- package/docs/self-hosting/platform/docker.mdx +87 -92
- package/docs/self-hosting/platform/docker.zh-CN.mdx +96 -115
- package/docs/self-hosting/platform/netlify.mdx +44 -94
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +40 -90
- package/docs/self-hosting/platform/railway.mdx +6 -7
- package/docs/self-hosting/platform/railway.zh-CN.mdx +6 -7
- package/docs/self-hosting/platform/repocloud.mdx +6 -7
- package/docs/self-hosting/platform/repocloud.zh-CN.mdx +6 -7
- package/docs/self-hosting/platform/sealos.mdx +6 -7
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +6 -7
- package/docs/self-hosting/platform/vercel.mdx +7 -8
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +7 -8
- package/docs/self-hosting/platform/zeabur.mdx +29 -32
- package/docs/self-hosting/platform/zeabur.zh-CN.mdx +29 -32
- package/docs/self-hosting/server-database/docker-compose.mdx +44 -71
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +44 -71
- package/docs/self-hosting/server-database/docker.mdx +84 -88
- package/docs/self-hosting/server-database/docker.zh-CN.mdx +87 -91
- package/docs/self-hosting/server-database/dokploy.mdx +18 -1
- package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +84 -68
- package/docs/self-hosting/server-database/repocloud.mdx +7 -9
- package/docs/self-hosting/server-database/repocloud.zh-CN.mdx +9 -11
- package/docs/self-hosting/server-database/vercel.mdx +158 -243
- package/docs/self-hosting/server-database/vercel.zh-CN.mdx +137 -205
- package/docs/self-hosting/server-database/zeabur.mdx +21 -23
- package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +20 -22
- package/docs/self-hosting/server-database.mdx +34 -36
- package/docs/self-hosting/server-database.zh-CN.mdx +34 -37
- package/docs/self-hosting/start.mdx +1 -4
- package/docs/self-hosting/start.zh-CN.mdx +1 -1
- package/docs/usage/agents/agent-organization.mdx +5 -21
- package/docs/usage/agents/agent-organization.zh-CN.mdx +5 -21
- package/docs/usage/agents/concepts.mdx +4 -4
- package/docs/usage/agents/concepts.zh-CN.mdx +4 -4
- package/docs/usage/agents/custom-agent.mdx +2 -2
- package/docs/usage/agents/custom-agent.zh-CN.mdx +2 -2
- package/docs/usage/agents/model.mdx +4 -4
- package/docs/usage/agents/model.zh-CN.mdx +6 -6
- package/docs/usage/agents/prompt.mdx +5 -6
- package/docs/usage/agents/prompt.zh-CN.mdx +5 -6
- package/docs/usage/agents/topics.mdx +2 -2
- package/docs/usage/agents/topics.zh-CN.mdx +2 -2
- package/docs/usage/features/agent-market.mdx +2 -2
- package/docs/usage/features/agent-market.zh-CN.mdx +2 -2
- package/docs/usage/features/auth.mdx +1 -5
- package/docs/usage/features/auth.zh-CN.mdx +1 -5
- package/docs/usage/features/database.mdx +1 -5
- package/docs/usage/features/database.zh-CN.mdx +1 -5
- package/docs/usage/features/local-llm.mdx +2 -6
- package/docs/usage/features/local-llm.zh-CN.mdx +2 -6
- package/docs/usage/features/mobile.mdx +1 -5
- package/docs/usage/features/mobile.zh-CN.mdx +1 -5
- package/docs/usage/features/multi-ai-providers.mdx +3 -11
- package/docs/usage/features/multi-ai-providers.zh-CN.mdx +3 -11
- package/docs/usage/features/plugin-system.mdx +9 -10
- package/docs/usage/features/plugin-system.zh-CN.mdx +9 -10
- package/docs/usage/features/pwa.mdx +11 -25
- package/docs/usage/features/pwa.zh-CN.mdx +11 -25
- package/docs/usage/features/text-to-image.mdx +2 -2
- package/docs/usage/features/text-to-image.zh-CN.mdx +2 -2
- package/docs/usage/features/theme.mdx +1 -6
- package/docs/usage/features/theme.zh-CN.mdx +1 -6
- package/docs/usage/features/tts.mdx +3 -7
- package/docs/usage/features/tts.zh-CN.mdx +3 -7
- package/docs/usage/features/vision.mdx +2 -2
- package/docs/usage/features/vision.zh-CN.mdx +2 -2
- package/docs/usage/foundation/basic.mdx +7 -18
- package/docs/usage/foundation/basic.zh-CN.mdx +6 -16
- package/docs/usage/foundation/share.mdx +3 -13
- package/docs/usage/foundation/share.zh-CN.mdx +3 -13
- package/docs/usage/foundation/text2image.mdx +3 -12
- package/docs/usage/foundation/text2image.zh-CN.mdx +3 -12
- package/docs/usage/foundation/translate.mdx +3 -13
- package/docs/usage/foundation/translate.zh-CN.mdx +3 -13
- package/docs/usage/foundation/tts-stt.mdx +3 -12
- package/docs/usage/foundation/tts-stt.zh-CN.mdx +3 -12
- package/docs/usage/foundation/vision.mdx +4 -16
- package/docs/usage/foundation/vision.zh-CN.mdx +4 -16
- package/docs/usage/plugins/basic-usage.mdx +7 -30
- package/docs/usage/plugins/basic-usage.zh-CN.mdx +7 -30
- package/docs/usage/plugins/development.mdx +30 -78
- package/docs/usage/plugins/development.zh-CN.mdx +31 -79
- package/docs/usage/plugins/store.mdx +2 -10
- package/docs/usage/plugins/store.zh-CN.mdx +2 -10
- package/docs/usage/providers/ai21.mdx +17 -33
- package/docs/usage/providers/ai21.zh-CN.mdx +17 -33
- package/docs/usage/providers/ai360.mdx +17 -33
- package/docs/usage/providers/ai360.zh-CN.mdx +20 -36
- package/docs/usage/providers/anthropic.mdx +23 -45
- package/docs/usage/providers/anthropic.zh-CN.mdx +22 -44
- package/docs/usage/providers/azure.mdx +21 -51
- package/docs/usage/providers/azure.zh-CN.mdx +19 -48
- package/docs/usage/providers/baichuan.mdx +16 -34
- package/docs/usage/providers/baichuan.zh-CN.mdx +15 -33
- package/docs/usage/providers/bedrock.mdx +38 -87
- package/docs/usage/providers/bedrock.zh-CN.mdx +37 -86
- package/docs/usage/providers/cloudflare.mdx +25 -48
- package/docs/usage/providers/cloudflare.zh-CN.mdx +24 -45
- package/docs/usage/providers/deepseek.mdx +25 -51
- package/docs/usage/providers/deepseek.zh-CN.mdx +24 -50
- package/docs/usage/providers/fireworksai.mdx +23 -43
- package/docs/usage/providers/fireworksai.zh-CN.mdx +21 -41
- package/docs/usage/providers/gemini.mdx +20 -46
- package/docs/usage/providers/gemini.zh-CN.mdx +20 -46
- package/docs/usage/providers/giteeai.mdx +24 -45
- package/docs/usage/providers/giteeai.zh-CN.mdx +22 -43
- package/docs/usage/providers/github.mdx +19 -45
- package/docs/usage/providers/github.zh-CN.mdx +19 -44
- package/docs/usage/providers/groq.mdx +12 -29
- package/docs/usage/providers/groq.zh-CN.mdx +11 -28
- package/docs/usage/providers/hunyuan.mdx +19 -39
- package/docs/usage/providers/hunyuan.zh-CN.mdx +18 -38
- package/docs/usage/providers/internlm.mdx +21 -38
- package/docs/usage/providers/internlm.zh-CN.mdx +19 -36
- package/docs/usage/providers/minimax.mdx +24 -50
- package/docs/usage/providers/minimax.zh-CN.mdx +22 -48
- package/docs/usage/providers/mistral.mdx +21 -39
- package/docs/usage/providers/mistral.zh-CN.mdx +20 -38
- package/docs/usage/providers/moonshot.mdx +20 -38
- package/docs/usage/providers/moonshot.zh-CN.mdx +19 -37
- package/docs/usage/providers/novita.mdx +20 -43
- package/docs/usage/providers/novita.zh-CN.mdx +19 -42
- package/docs/usage/providers/ollama/gemma.mdx +12 -29
- package/docs/usage/providers/ollama/gemma.zh-CN.mdx +12 -30
- package/docs/usage/providers/ollama/qwen.mdx +17 -32
- package/docs/usage/providers/ollama/qwen.zh-CN.mdx +12 -27
- package/docs/usage/providers/ollama.mdx +67 -99
- package/docs/usage/providers/ollama.zh-CN.mdx +67 -99
- package/docs/usage/providers/openai.mdx +42 -56
- package/docs/usage/providers/openai.zh-CN.mdx +39 -52
- package/docs/usage/providers/openrouter.mdx +48 -84
- package/docs/usage/providers/openrouter.zh-CN.mdx +31 -67
- package/docs/usage/providers/perplexity.mdx +16 -34
- package/docs/usage/providers/perplexity.zh-CN.mdx +16 -34
- package/docs/usage/providers/qwen.mdx +26 -52
- package/docs/usage/providers/qwen.zh-CN.mdx +25 -51
- package/docs/usage/providers/sensenova.mdx +24 -45
- package/docs/usage/providers/sensenova.zh-CN.mdx +22 -43
- package/docs/usage/providers/siliconcloud.mdx +17 -33
- package/docs/usage/providers/siliconcloud.zh-CN.mdx +17 -33
- package/docs/usage/providers/spark.mdx +20 -40
- package/docs/usage/providers/spark.zh-CN.mdx +19 -39
- package/docs/usage/providers/stepfun.mdx +17 -35
- package/docs/usage/providers/stepfun.zh-CN.mdx +17 -35
- package/docs/usage/providers/taichu.mdx +16 -34
- package/docs/usage/providers/taichu.zh-CN.mdx +15 -33
- package/docs/usage/providers/togetherai.mdx +18 -40
- package/docs/usage/providers/togetherai.zh-CN.mdx +18 -40
- package/docs/usage/providers/upstage.mdx +18 -34
- package/docs/usage/providers/upstage.zh-CN.mdx +17 -33
- package/docs/usage/providers/wenxin.mdx +22 -42
- package/docs/usage/providers/wenxin.zh-CN.mdx +20 -40
- package/docs/usage/providers/xai.mdx +21 -38
- package/docs/usage/providers/xai.zh-CN.mdx +20 -37
- package/docs/usage/providers/zeroone.mdx +22 -48
- package/docs/usage/providers/zeroone.zh-CN.mdx +22 -48
- package/docs/usage/providers/zhipu.mdx +17 -35
- package/docs/usage/providers/zhipu.zh-CN.mdx +18 -34
- package/docs/usage/providers.mdx +1 -6
- package/docs/usage/providers.zh-CN.mdx +1 -6
- package/docs/usage/start.mdx +4 -18
- package/docs/usage/start.zh-CN.mdx +2 -19
- package/docs/usage/tools-calling/anthropic.mdx +18 -51
- package/docs/usage/tools-calling/anthropic.zh-CN.mdx +22 -55
- package/docs/usage/tools-calling/google.mdx +16 -23
- package/docs/usage/tools-calling/google.zh-CN.mdx +17 -24
- package/docs/usage/tools-calling/groq.mdx +9 -0
- package/docs/usage/tools-calling/groq.zh-CN.mdx +44 -70
- package/docs/usage/tools-calling/moonshot.mdx +9 -0
- package/docs/usage/tools-calling/openai.mdx +19 -44
- package/docs/usage/tools-calling/openai.zh-CN.mdx +20 -45
- package/docs/usage/tools-calling.mdx +9 -0
- package/docs/usage/tools-calling.zh-CN.mdx +60 -68
- package/package.json +42 -41
- package/scripts/mdxWorkflow/index.ts +7 -0
- package/src/app/(main)/(mobile)/me/(home)/features/Header.tsx +2 -1
- package/src/app/(main)/(mobile)/me/data/features/Header.tsx +1 -1
- package/src/app/(main)/(mobile)/me/profile/features/Header.tsx +1 -1
- package/src/app/(main)/(mobile)/me/settings/features/Header.tsx +1 -1
- package/src/app/(main)/@nav/_layout/Mobile.tsx +2 -1
- package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/SystemRoleContent.tsx +2 -1
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ByTimeMode/GroupItem.tsx +2 -2
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +2 -1
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/index.tsx +1 -1
- package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/ChatHeaderTitle.tsx +2 -1
- package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/index.tsx +1 -1
- package/src/app/(main)/chat/@session/_layout/Mobile/SessionHeader.tsx +2 -1
- package/src/app/(main)/chat/settings/_layout/Desktop/Header.tsx +1 -1
- package/src/app/(main)/chat/settings/_layout/Mobile/Header.tsx +1 -1
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/SuggestionItem.tsx +8 -6
- package/src/app/(main)/discover/(list)/_layout/Desktop/Nav.tsx +1 -1
- package/src/app/(main)/discover/(list)/_layout/Mobile/Header.tsx +2 -1
- package/src/app/(main)/discover/_layout/Desktop/Header.tsx +1 -1
- package/src/app/(main)/discover/components/VirtuosoGridList/index.tsx +9 -5
- package/src/app/(main)/discover/search/_layout/Mobile/Header.tsx +1 -1
- package/src/app/(main)/files/(content)/@menu/features/KnowledgeBase/EmptyStatus.tsx +21 -13
- package/src/app/(main)/repos/[id]/evals/evaluation/EvaluationList/index.tsx +1 -1
- package/src/app/(main)/settings/sync/features/DeviceInfo/SystemIcon.tsx +2 -0
- package/src/components/Branding/ProductLogo/Custom.tsx +19 -20
- package/src/components/BrowserIcon/index.tsx +19 -30
- package/src/components/BubblesLoading/index.tsx +31 -23
- package/src/components/FunctionModal/createModalHooks.ts +6 -3
- package/src/components/StopLoading.tsx +10 -7
- package/src/features/ChatInput/Desktop/InputArea/index.tsx +2 -2
- package/src/features/InitClientDB/EnableModal.tsx +2 -2
- package/src/features/InitClientDB/{PGliteSVG.tsx → PGliteIcon.tsx} +17 -11
- package/src/features/ShareModal/ShareImage/index.tsx +32 -22
- package/src/features/ShareModal/ShareJSON/Preview.tsx +2 -2
- package/src/features/ShareModal/ShareJSON/index.tsx +49 -37
- package/src/features/ShareModal/ShareText/Preview.tsx +4 -1
- package/src/features/ShareModal/ShareText/index.tsx +49 -38
- package/src/features/ShareModal/index.tsx +1 -1
- package/src/features/ShareModal/style.ts +30 -0
- package/src/utils/colorUtils.ts +1 -1
- package/src/components/BrowserIcon/components/Brave.tsx +0 -56
- package/src/components/BrowserIcon/components/Chrome.tsx +0 -14
- package/src/components/BrowserIcon/components/Chromium.tsx +0 -14
- package/src/components/BrowserIcon/components/Edge.tsx +0 -36
- package/src/components/BrowserIcon/components/Firefox.tsx +0 -38
- package/src/components/BrowserIcon/components/Opera.tsx +0 -19
- package/src/components/BrowserIcon/components/Safari.tsx +0 -23
- package/src/components/BrowserIcon/components/Samsung.tsx +0 -21
@@ -17,19 +17,17 @@ If you want to deploy LobeChat Database Edition on RepoCloud, you can follow the
|
|
17
17
|
## RepoCloud Deployment Process
|
18
18
|
|
19
19
|
<Steps>
|
20
|
+
### Prepare your OpenAI API Key
|
20
21
|
|
21
|
-
|
22
|
+
Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key.
|
22
23
|
|
23
|
-
|
24
|
+
### One-click to deploy
|
24
25
|
|
25
|
-
|
26
|
+
[](https://repocloud.io/details/?app_id=248)
|
26
27
|
|
27
|
-
|
28
|
+
### Once deployed, you can start using it
|
28
29
|
|
29
|
-
###
|
30
|
-
|
31
|
-
### Bind a custom domain (optional)
|
32
|
-
|
33
|
-
You can use the subdomain provided by RepoCloud, or choose to bind a custom domain. Currently, the domains provided by RepoCloud have not been contaminated, and most regions can connect directly.
|
30
|
+
### Bind a custom domain (optional)
|
34
31
|
|
32
|
+
You can use the subdomain provided by RepoCloud, or choose to bind a custom domain. Currently, the domains provided by RepoCloud have not been contaminated, and most regions can connect directly.
|
35
33
|
</Steps>
|
@@ -11,24 +11,22 @@ tags:
|
|
11
11
|
|
12
12
|
# 在 RepoCloud 上部署 LobeChat 数据库版
|
13
13
|
|
14
|
-
如果您想在RepoCloud上部署LobeChat数据库版,可以按照以下步骤进行操作:
|
14
|
+
如果您想在 RepoCloud 上部署 LobeChat 数据库版,可以按照以下步骤进行操作:
|
15
15
|
|
16
|
-
## RepoCloud部署流程
|
16
|
+
## RepoCloud 部署流程
|
17
17
|
|
18
18
|
<Steps>
|
19
|
+
### 准备您的 OpenAI API 密钥
|
19
20
|
|
20
|
-
|
21
|
+
请访问 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。
|
21
22
|
|
22
|
-
|
23
|
+
### 一键部署
|
23
24
|
|
24
|
-
|
25
|
+
[](https://repocloud.io/details/?app_id=248)
|
25
26
|
|
26
|
-
|
27
|
+
### 部署完成后,您可以开始使用
|
27
28
|
|
28
|
-
###
|
29
|
-
|
30
|
-
### 绑定自定义域名(可选)
|
31
|
-
|
32
|
-
您可以使用RepoCloud提供的子域名,或选择绑定自定义域名。目前,RepoCloud提供的域名尚未被污染,大多数地区可以直接连接。
|
29
|
+
### 绑定自定义域名(可选)
|
33
30
|
|
31
|
+
您可以使用 RepoCloud 提供的子域名,或选择绑定自定义域名。目前,RepoCloud 提供的域名尚未被污染,大多数地区可以直接连接。
|
34
32
|
</Steps>
|
@@ -15,107 +15,90 @@ 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
|
+
Before proceeding, please make sure of the following:
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
-
|
22
|
-
- The `ACCESS_CODE` in the environment variables is either unset or cleared!
|
23
|
-
- When configuring the environment variables required for the server-side database, make sure to fill in all of them before deployment, otherwise you may encounter database migration issues!
|
24
|
-
|
20
|
+
- 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!
|
21
|
+
- The `ACCESS_CODE` in the environment variables is either unset or cleared!
|
22
|
+
- When configuring the environment variables required for the server-side database, make sure to fill in all of them before deployment, otherwise you may encounter database migration issues!
|
25
23
|
</Callout>
|
26
24
|
|
27
25
|
## 1. Configure the Database
|
28
26
|
|
29
27
|
<Steps>
|
28
|
+
### Prepare the Server Database Instance and Obtain the Connection URL
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
Before deployment, make sure you have prepared a Postgres database instance. You can choose one of the following methods:
|
34
|
-
|
35
|
-
- `A.` Use Serverless Postgres instances like Vercel / Neon;
|
36
|
-
- `B.` Use self-deployed Postgres instances like Docker.
|
37
|
-
|
38
|
-
The configuration for both methods is slightly different, and will be distinguished in the next step.
|
30
|
+
Before deployment, make sure you have prepared a Postgres database instance. You can choose one of the following methods:
|
39
31
|
|
40
|
-
|
32
|
+
- `A.` Use Serverless Postgres instances like Vercel / Neon;
|
33
|
+
- `B.` Use self-deployed Postgres instances like Docker.
|
41
34
|
|
42
|
-
|
43
|
-
|
44
|
-
<Tabs items={['Serverless Postgres', 'Node Postgres']}>
|
45
|
-
|
46
|
-
<Tab>
|
47
|
-
|
48
|
-
<Callout type={'warning'}>
|
49
|
-
Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to
|
50
|
-
the `Node Postgres` Tab.
|
51
|
-
</Callout>
|
35
|
+
The configuration for both methods is slightly different, and will be distinguished in the next step.
|
52
36
|
|
53
|
-
|
37
|
+
### Add Environment Variables in Vercel
|
54
38
|
|
55
|
-
|
56
|
-
# Serverless Postgres DB Url
|
57
|
-
DATABASE_URL=
|
39
|
+
In Vercel's deployment environment variables, add `DATABASE_URL` and other environment variables, and fill in the Postgres database connection URL prepared in the previous step. The typical format for the database connection URL is `postgres://username:password@host:port/database`.
|
58
40
|
|
59
|
-
|
60
|
-
|
61
|
-
|
41
|
+
<Tabs items={['Serverless Postgres', 'Node Postgres']}>
|
42
|
+
<Tab>
|
43
|
+
<Callout type={'warning'}>
|
44
|
+
Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to
|
45
|
+
the `Node Postgres` Tab.
|
46
|
+
</Callout>
|
62
47
|
|
63
|
-
|
48
|
+
Variables to be filled for Serverless Postgres are as follows:
|
64
49
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
/>
|
50
|
+
```shell
|
51
|
+
# Serverless Postgres DB Url
|
52
|
+
DATABASE_URL=
|
69
53
|
|
70
|
-
|
54
|
+
# Specify service mode as server, otherwise it will not enter the server-side database
|
55
|
+
NEXT_PUBLIC_SERVICE_MODE=server
|
56
|
+
```
|
71
57
|
|
72
|
-
|
73
|
-
Variables to be filled for Node Postgres are as follows:
|
58
|
+
An example of filling in Vercel is as follows:
|
74
59
|
|
75
|
-
|
76
|
-
|
77
|
-
DATABASE_URL=
|
60
|
+
<Image alt={'Add Serverless Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'} />
|
61
|
+
</Tab>
|
78
62
|
|
79
|
-
|
80
|
-
|
63
|
+
<Tab>
|
64
|
+
Variables to be filled for Node Postgres are as follows:
|
81
65
|
|
82
|
-
|
83
|
-
|
84
|
-
|
66
|
+
```shell
|
67
|
+
# Node Postgres DB Url
|
68
|
+
DATABASE_URL=
|
85
69
|
|
86
|
-
|
70
|
+
# Specify Postgres database driver as node
|
71
|
+
DATABASE_DRIVER=node
|
87
72
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
/>
|
73
|
+
# Specify service mode as server, otherwise it will not enter the server-side database
|
74
|
+
NEXT_PUBLIC_SERVICE_MODE=server
|
75
|
+
```
|
92
76
|
|
93
|
-
|
77
|
+
An example of filling in Vercel is as follows:
|
94
78
|
|
95
|
-
|
79
|
+
<Image alt={'Add Node Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'} />
|
80
|
+
</Tab>
|
81
|
+
</Tabs>
|
96
82
|
|
97
83
|
<Callout type={'info'}>
|
98
|
-
|
99
84
|
If you wish to enable SSL when connecting to the database, please refer to the
|
100
85
|
[link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)
|
101
86
|
for setup instructions.
|
87
|
+
</Callout>
|
102
88
|
|
103
|
-
|
89
|
+
### Add the `KEY_VAULTS_SECRET` Environment Variable
|
104
90
|
|
105
|
-
|
91
|
+
After adding the `DATABASE_URL` environment variable for the database, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information such as apikeys stored by users. You can generate a random 32-character string as the key using `openssl rand -base64 32`.
|
106
92
|
|
107
|
-
|
93
|
+
```shell
|
94
|
+
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
95
|
+
```
|
108
96
|
|
109
|
-
|
110
|
-
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
111
|
-
```
|
97
|
+
Make sure to add this to the Vercel environment variables as well.
|
112
98
|
|
113
|
-
|
114
|
-
|
115
|
-
### Add the `APP_URL` Environment Variable
|
116
|
-
|
117
|
-
Finally, you need to add the `APP_URL` environment variable, which specifies the URL address of the LobeChat application.
|
99
|
+
### Add the `APP_URL` Environment Variable
|
118
100
|
|
101
|
+
Finally, you need to add the `APP_URL` environment variable, which specifies the URL address of the LobeChat application.
|
119
102
|
</Steps>
|
120
103
|
|
121
104
|
## 2. Configure Authentication Service
|
@@ -123,87 +106,63 @@ Finally, you need to add the `APP_URL` environment variable, which specifies the
|
|
123
106
|
The server-side database needs to be paired with a user authentication service to function properly. Therefore, the corresponding authentication service needs to be configured.
|
124
107
|
|
125
108
|
<Steps>
|
109
|
+
### Prepare Clerk Authentication Service
|
126
110
|
|
127
|
-
|
128
|
-
|
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.
|
111
|
+
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.
|
130
112
|
|
131
113
|
<Callout type={'info'}>
|
132
|
-
|
133
114
|
If you are not familiar with Clerk, you can refer to [Authentication
|
134
115
|
Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk.
|
116
|
+
</Callout>
|
135
117
|
|
136
|
-
|
137
|
-
|
138
|
-
### Add Public and Private Key Environment Variables in Vercel
|
118
|
+
### Add Public and Private Key Environment Variables in Vercel
|
139
119
|
|
140
|
-
In Vercel's deployment environment variables, add the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on "API Keys" in the menu, then copy the corresponding values and paste them into Vercel's environment variables.
|
120
|
+
In Vercel's deployment environment variables, add the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on "API Keys" in the menu, then copy the corresponding values and paste them into Vercel's environment variables.
|
141
121
|
|
142
|
-
<Image
|
143
|
-
alt={'Find the corresponding public and private key environment variables in Clerk'}
|
144
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'}
|
145
|
-
/>
|
122
|
+
<Image alt={'Find the corresponding public and private key environment variables in Clerk'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'} />
|
146
123
|
|
147
|
-
The environment variables required for this step are as follows:
|
124
|
+
The environment variables required for this step are as follows:
|
148
125
|
|
149
|
-
```shell
|
150
|
-
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
151
|
-
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
152
|
-
```
|
126
|
+
```shell
|
127
|
+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
128
|
+
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
129
|
+
```
|
153
130
|
|
154
|
-
Add the above variables to Vercel:
|
131
|
+
Add the above variables to Vercel:
|
155
132
|
|
156
|
-
<Image
|
157
|
-
alt={'Add Clerk public and private key environment variables in Vercel'}
|
158
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'}
|
159
|
-
/>
|
133
|
+
<Image alt={'Add Clerk public and private key environment variables in Vercel'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'} />
|
160
134
|
|
161
|
-
### Create and Configure Webhook in Clerk
|
135
|
+
### Create and Configure Webhook in Clerk
|
162
136
|
|
163
|
-
Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store data in the database when there are changes in the user's lifecycle (create, update, delete). We achieve this requirement through the Webhook provided by Clerk.
|
137
|
+
Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store data in the database when there are changes in the user's lifecycle (create, update, delete). We achieve this requirement through the Webhook provided by Clerk.
|
164
138
|
|
165
|
-
We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's information changes.
|
139
|
+
We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's information changes.
|
166
140
|
|
167
|
-
<Image
|
168
|
-
alt={'Add Webhooks endpoint in Clerk'}
|
169
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'}
|
170
|
-
/>
|
141
|
+
<Image alt={'Add Webhooks endpoint in Clerk'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'} />
|
171
142
|
|
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.
|
143
|
+
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.
|
173
144
|
|
174
145
|
<Callout type={'warning'}>
|
175
|
-
|
176
146
|
The `https://` in the URL is essential to maintain the integrity of the URL.
|
147
|
+
</Callout>
|
177
148
|
|
178
|
-
|
179
|
-
|
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
|
-
/>
|
184
|
-
|
185
|
-
### Add Webhook Secret to Vercel Environment Variables
|
149
|
+
<Image alt={'Configure URL and user events when adding Clerk Webhooks'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'} />
|
186
150
|
|
187
|
-
|
151
|
+
### Add Webhook Secret to Vercel Environment Variables
|
188
152
|
|
189
|
-
|
190
|
-
alt={'View Clerk Webhooks secret'}
|
191
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}
|
192
|
-
/>
|
153
|
+
After creation, you can find the secret of this Webhook in the bottom right corner:
|
193
154
|
|
194
|
-
|
155
|
+
<Image alt={'View Clerk Webhooks secret'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'} />
|
195
156
|
|
196
|
-
|
197
|
-
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
198
|
-
```
|
157
|
+
The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`:
|
199
158
|
|
200
|
-
|
159
|
+
```shell
|
160
|
+
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
161
|
+
```
|
201
162
|
|
202
|
-
|
203
|
-
alt={'Add Clerk Webhooks secret in Vercel'}
|
204
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'}
|
205
|
-
/>
|
163
|
+
Add it to Vercel's environment variables:
|
206
164
|
|
165
|
+
<Image alt={'Add Clerk Webhooks secret in Vercel'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'} />
|
207
166
|
</Steps>
|
208
167
|
|
209
168
|
By completing these steps, you have successfully configured the Clerk authentication service. Next, we will configure the S3 storage service.
|
@@ -213,155 +172,121 @@ By completing these steps, you have successfully configured the Clerk authentica
|
|
213
172
|
In the server-side database, we need to configure the S3 storage service to store files.
|
214
173
|
|
215
174
|
<Callout type={'info'}>
|
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
|
-
|
175
|
+
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.
|
219
176
|
</Callout>
|
220
177
|
|
221
178
|
<Steps>
|
179
|
+
### Configure and Obtain S3 Bucket
|
222
180
|
|
223
|
-
|
181
|
+
You need to go to your S3 service provider (such as AWS S3, Cloudflare R2, etc.) and create a new storage bucket. The following steps will use Cloudflare R2 as an example to explain the creation process.
|
224
182
|
|
225
|
-
|
183
|
+
The interface of Cloudflare R2 is shown below:
|
226
184
|
|
227
|
-
|
185
|
+
<Image alt={'Cloudflare R2 Storage Interface'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'} />
|
228
186
|
|
229
|
-
|
230
|
-
alt={'Cloudflare R2 Storage Interface'}
|
231
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
|
232
|
-
/>
|
187
|
+
When creating a storage bucket, specify its name and then click create.
|
233
188
|
|
234
|
-
|
189
|
+
<Image alt={'Create Storage Bucket in R2'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'} />
|
235
190
|
|
236
|
-
|
237
|
-
alt={'Create Storage Bucket in R2'}
|
238
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'}
|
239
|
-
/>
|
191
|
+
### Obtain Environment Variables for the Bucket
|
240
192
|
|
241
|
-
|
193
|
+
In the settings of the R2 storage bucket, you can view the bucket configuration information:
|
242
194
|
|
243
|
-
|
195
|
+
<Image alt={'View Storage Bucket Information'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'} />
|
244
196
|
|
245
|
-
|
246
|
-
alt={'View Storage Bucket Information'}
|
247
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'}
|
248
|
-
/>
|
197
|
+
The corresponding environment variables are:
|
249
198
|
|
250
|
-
|
199
|
+
```shell
|
200
|
+
# Storage bucket name
|
201
|
+
S3_BUCKET=lobechat
|
202
|
+
# Storage bucket request endpoint (note that the path in this link includes the bucket name, which must be removed, or use the link provided on the S3 API token application page)
|
203
|
+
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
204
|
+
# Public access domain for the storage bucket
|
205
|
+
S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
|
206
|
+
```
|
251
207
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
# Storage bucket request endpoint (note that the path in this link includes the bucket name, which must be removed, or use the link provided on the S3 API token application page)
|
256
|
-
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
257
|
-
# Public access domain for the storage bucket
|
258
|
-
S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
|
259
|
-
```
|
208
|
+
<Callout type={'warning'}>
|
209
|
+
`S3_ENDPOINT` must have its path removed, otherwise uploaded files will not be accessible
|
210
|
+
</Callout>
|
260
211
|
|
261
|
-
|
262
|
-
`S3_ENDPOINT` must have its path removed, otherwise uploaded files will not be accessible
|
263
|
-
</Callout>
|
212
|
+
### Obtain S3 Key Environment Variables
|
264
213
|
|
265
|
-
|
214
|
+
You need to obtain the access key for S3 so that the LobeChat server has permission to access the S3 storage service. In R2, you can configure the access key in the account details:
|
266
215
|
|
267
|
-
|
216
|
+
<Image alt={'View Storage Bucket Access Key'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'} />
|
268
217
|
|
269
|
-
|
270
|
-
alt={'View Storage Bucket Access Key'}
|
271
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'}
|
272
|
-
/>
|
218
|
+
Click the button in the upper right corner to create an API token and enter the create API Token page.
|
273
219
|
|
274
|
-
|
220
|
+
<Image alt={'Create Corresponding API Token'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'} />
|
275
221
|
|
276
|
-
|
277
|
-
alt={'Create Corresponding API Token'}
|
278
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'}
|
279
|
-
/>
|
222
|
+
Since our server-side database needs to read and write to the S3 storage service, the permission needs to be set to `Object Read and Write`, then click create.
|
280
223
|
|
281
|
-
|
224
|
+
<Image alt={'Configure API Token Permissions'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'} />
|
282
225
|
|
283
|
-
|
284
|
-
alt={'Configure API Token Permissions'}
|
285
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'}
|
286
|
-
/>
|
226
|
+
After creation, you can see the corresponding S3 API token.
|
287
227
|
|
288
|
-
|
228
|
+
<Image alt={'Copy API Token'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'} />
|
289
229
|
|
290
|
-
|
291
|
-
alt={'Copy API Token'}
|
292
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'}
|
293
|
-
/>
|
230
|
+
The corresponding environment variables are:
|
294
231
|
|
295
|
-
|
232
|
+
```shell
|
233
|
+
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
234
|
+
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
235
|
+
```
|
296
236
|
|
297
|
-
|
298
|
-
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
299
|
-
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
300
|
-
```
|
237
|
+
### Adding Corresponding Environment Variables in Vercel
|
301
238
|
|
302
|
-
|
239
|
+
The steps to obtain the required environment variables may vary for different S3 service providers, but the obtained environment variables should be consistent:
|
303
240
|
|
304
|
-
|
241
|
+
<Callout type={'warning'}>
|
242
|
+
The `https://` in the URL is essential and must be maintained for the completeness of the URL.
|
243
|
+
</Callout>
|
305
244
|
|
306
|
-
|
307
|
-
|
308
|
-
|
245
|
+
```shell
|
246
|
+
# S3 Keys
|
247
|
+
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
248
|
+
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
309
249
|
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
250
|
+
# Bucket name
|
251
|
+
S3_BUCKET=lobechat
|
252
|
+
# Bucket request endpoint
|
253
|
+
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
254
|
+
# Public domain for bucket access
|
255
|
+
S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com
|
314
256
|
|
315
|
-
# Bucket
|
316
|
-
|
317
|
-
|
318
|
-
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
319
|
-
# Public domain for bucket access
|
320
|
-
S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com
|
321
|
-
|
322
|
-
# Bucket region, such as us-west-1, generally not required, but some providers may need to configure
|
323
|
-
# S3_REGION=us-west-1
|
324
|
-
```
|
325
|
-
|
326
|
-
Then, insert the above environment variables into Vercel's environment variables:
|
257
|
+
# Bucket region, such as us-west-1, generally not required, but some providers may need to configure
|
258
|
+
# S3_REGION=us-west-1
|
259
|
+
```
|
327
260
|
|
328
|
-
|
329
|
-
alt={'Adding S3 environment variables in Vercel'}
|
330
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/cd74152d-0ae8-44fd-b815-3307c56a3c18'}
|
331
|
-
/>
|
261
|
+
Then, insert the above environment variables into Vercel's environment variables:
|
332
262
|
|
333
|
-
|
263
|
+
<Image alt={'Adding S3 environment variables in Vercel'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/cd74152d-0ae8-44fd-b815-3307c56a3c18'} />
|
334
264
|
|
335
|
-
|
265
|
+
### Configuring Cross-Origin Resource Sharing (CORS)
|
336
266
|
|
337
|
-
|
267
|
+
Since S3 storage services are often on a separate domain, cross-origin access needs to be configured.
|
338
268
|
|
339
|
-
|
340
|
-
alt={'Cloudflare R2 CORS settings'}
|
341
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'}
|
342
|
-
/>
|
269
|
+
In R2, you can find the CORS configuration in the bucket settings:
|
343
270
|
|
344
|
-
|
271
|
+
<Image alt={'Cloudflare R2 CORS settings'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'} />
|
345
272
|
|
346
|
-
|
347
|
-
alt={'Configuring allowed site domain'}
|
348
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'}
|
349
|
-
/>
|
273
|
+
Add a CORS rule to allow requests from your domain (in this case, `https://your-project.vercel.app`):
|
350
274
|
|
351
|
-
|
275
|
+
<Image alt={'Configuring allowed site domain'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'} />
|
352
276
|
|
353
|
-
|
354
|
-
[
|
355
|
-
{
|
356
|
-
"AllowedOrigins": ["https://your-project.vercel.app"],
|
357
|
-
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
|
358
|
-
"AllowedHeaders": ["*"]
|
359
|
-
}
|
360
|
-
]
|
361
|
-
```
|
277
|
+
Example configuration:
|
362
278
|
|
363
|
-
|
279
|
+
```json
|
280
|
+
[
|
281
|
+
{
|
282
|
+
"AllowedOrigins": ["https://your-project.vercel.app"],
|
283
|
+
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
|
284
|
+
"AllowedHeaders": ["*"]
|
285
|
+
}
|
286
|
+
]
|
287
|
+
```
|
364
288
|
|
289
|
+
After configuring, click save.
|
365
290
|
</Steps>
|
366
291
|
|
367
292
|
## Four, Deployment and Verification
|
@@ -371,27 +296,17 @@ After completing the steps above, the configuration of the server-side database
|
|
371
296
|
<Steps>
|
372
297
|
### Redeploy the latest commit
|
373
298
|
|
374
|
-
After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete.
|
375
|
-
|
376
|
-
<Image
|
377
|
-
alt={'Redeploy the latest commit'}
|
378
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'}
|
379
|
-
/>
|
299
|
+
After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete.
|
380
300
|
|
381
|
-
|
301
|
+
<Image alt={'Redeploy the latest commit'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'} />
|
382
302
|
|
383
|
-
|
303
|
+
### Check if the features are working properly
|
384
304
|
|
385
|
-
|
386
|
-
alt={'User login popup'}
|
387
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}
|
388
|
-
/>
|
305
|
+
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\~
|
389
306
|
|
390
|
-
<Image
|
391
|
-
alt={'Login successful state'}
|
392
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}
|
393
|
-
/>
|
307
|
+
<Image alt={'User login popup'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'} />
|
394
308
|
|
309
|
+
<Image alt={'Login successful state'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'} />
|
395
310
|
</Steps>
|
396
311
|
|
397
312
|
## Appendix
|