From 2c3331a59160c1adc124a43e00f005134f8901d3 Mon Sep 17 00:00:00 2001 From: CanisMinor Date: Wed, 8 Jan 2025 21:32:57 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Update=20Remark=20(#5340)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✨ feat: Update Remark * 📝 docs: Update seo * 🔧 chore: Fix deps * 🔧 chore: Update ui version * 📝 docs: Update docs * ✨ feat: Update @lobehub/ui to 1.163.0 --- .remarkrc.mdx.js | 6 + docs/changelog/2023-09-09-plugin-system.mdx | 5 + .../2023-09-09-plugin-system.zh-CN.mdx | 5 + docs/changelog/2023-11-14-gpt4-vision.mdx | 6 + .../2023-11-14-gpt4-vision.zh-CN.mdx | 6 + docs/changelog/2023-11-19-tts-stt.mdx | 6 + docs/changelog/2023-11-19-tts-stt.zh-CN.mdx | 7 + docs/changelog/2023-12-22-dalle-3.mdx | 6 + docs/changelog/2023-12-22-dalle-3.zh-CN.mdx | 4 + docs/changelog/2024-02-08-sso-oauth.mdx | 6 + docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx | 6 + docs/changelog/2024-02-14-ollama.mdx | 6 + docs/changelog/2024-02-14-ollama.zh-CN.mdx | 5 + docs/changelog/2024-06-19-lobe-chat-v1.mdx | 6 + .../2024-06-19-lobe-chat-v1.zh-CN.mdx | 5 + docs/changelog/2024-07-19-gpt-4o-mini.mdx | 5 + .../2024-07-19-gpt-4o-mini.zh-CN.mdx | 4 + .../2024-08-02-lobe-chat-database-docker.mdx | 6 + ...-08-02-lobe-chat-database-docker.zh-CN.mdx | 5 + ...4-08-21-file-upload-and-knowledge-base.mdx | 6 + ...1-file-upload-and-knowledge-base.zh-CN.mdx | 5 + .../changelog/2024-09-13-openai-o1-models.mdx | 6 + .../2024-09-13-openai-o1-models.zh-CN.mdx | 6 + docs/changelog/2024-09-20-artifacts.mdx | 6 + docs/changelog/2024-09-20-artifacts.zh-CN.mdx | 6 + docs/changelog/2024-10-27-pin-assistant.mdx | 5 + .../2024-10-27-pin-assistant.zh-CN.mdx | 4 + docs/changelog/2024-11-06-share-text-json.mdx | 4 + .../2024-11-06-share-text-json.zh-CN.mdx | 4 + .../2024-11-25-november-providers.mdx | 7 + .../2024-11-25-november-providers.zh-CN.mdx | 7 + docs/changelog/2024-11-27-forkable-chat.mdx | 4 + .../2024-11-27-forkable-chat.zh-CN.mdx | 5 + docs/changelog/2025-01-03-user-profile.mdx | 5 + .../2025-01-03-user-profile.zh-CN.mdx | 5 +- docs/self-hosting/advanced/auth.mdx | 27 +- docs/self-hosting/advanced/auth.zh-CN.mdx | 29 +- docs/self-hosting/advanced/auth/clerk.mdx | 66 ++- .../advanced/auth/clerk.zh-CN.mdx | 60 +-- .../advanced/auth/next-auth/auth0.mdx | 89 ++-- .../advanced/auth/next-auth/auth0.zh-CN.mdx | 87 ++-- .../advanced/auth/next-auth/authelia.mdx | 76 ++-- .../auth/next-auth/authelia.zh-CN.mdx | 75 ++-- .../advanced/auth/next-auth/authentik.mdx | 57 ++- .../auth/next-auth/authentik.zh-CN.mdx | 55 ++- .../advanced/auth/next-auth/casdoor.mdx | 149 ++++--- .../advanced/auth/next-auth/casdoor.zh-CN.mdx | 145 ++++--- .../auth/next-auth/cloudflare-zero-trust.mdx | 49 ++- .../next-auth/cloudflare-zero-trust.zh-CN.mdx | 47 +- .../advanced/auth/next-auth/github.mdx | 119 ++---- .../advanced/auth/next-auth/github.zh-CN.mdx | 113 ++--- .../advanced/auth/next-auth/logto.mdx | 65 ++- .../advanced/auth/next-auth/logto.zh-CN.mdx | 65 ++- .../auth/next-auth/microsoft-entra-id.mdx | 85 ++-- .../next-auth/microsoft-entra-id.zh-CN.mdx | 73 ++-- .../advanced/auth/next-auth/wechat.mdx | 27 +- .../advanced/auth/next-auth/wechat.zh-CN.mdx | 29 +- .../advanced/auth/next-auth/zitadel.mdx | 104 ++--- .../advanced/auth/next-auth/zitadel.zh-CN.mdx | 102 ++--- .../advanced/feature-flags.zh-CN.mdx | 30 +- docs/self-hosting/advanced/knowledge-base.mdx | 17 +- .../advanced/knowledge-base.zh-CN.mdx | 15 +- .../advanced/model-list.zh-CN.mdx | 10 +- docs/self-hosting/advanced/s3.mdx | 64 ++- docs/self-hosting/advanced/s3.zh-CN.mdx | 61 ++- .../advanced/s3/cloudflare-r2.mdx | 133 +++--- .../advanced/s3/cloudflare-r2.zh-CN.mdx | 131 +++--- .../advanced/s3/tencent-cloud.mdx | 54 +-- .../advanced/s3/tencent-cloud.zh-CN.mdx | 71 ++-- .../advanced/settings-url-share.mdx | 12 +- .../advanced/settings-url-share.zh-CN.mdx | 38 +- docs/self-hosting/advanced/upstream-sync.mdx | 162 ++++--- .../advanced/upstream-sync.zh-CN.mdx | 158 ++++--- docs/self-hosting/advanced/webrtc.mdx | 35 +- docs/self-hosting/advanced/webrtc.zh-CN.mdx | 45 +- docs/self-hosting/environment-variables.mdx | 12 +- .../environment-variables.zh-CN.mdx | 4 + .../environment-variables/analytics.zh-CN.mdx | 3 - .../environment-variables/auth.zh-CN.mdx | 2 +- .../environment-variables/basic.mdx | 26 +- .../environment-variables/basic.zh-CN.mdx | 30 +- .../environment-variables/model-provider.mdx | 2 +- .../model-provider.zh-CN.mdx | 2 +- .../self-hosting/environment-variables/s3.mdx | 7 +- .../environment-variables/s3.zh-CN.mdx | 12 +- docs/self-hosting/examples/azure-openai.mdx | 21 +- .../examples/azure-openai.zh-CN.mdx | 19 +- docs/self-hosting/examples/ollama.mdx | 15 +- docs/self-hosting/examples/ollama.zh-CN.mdx | 15 +- docs/self-hosting/platform/alibaba-cloud.mdx | 12 +- .../platform/alibaba-cloud.zh-CN.mdx | 12 +- docs/self-hosting/platform/btpanel.mdx | 5 +- docs/self-hosting/platform/btpanel.zh-CN.mdx | 6 +- docs/self-hosting/platform/docker-compose.mdx | 160 ++++--- .../platform/docker-compose.zh-CN.mdx | 160 ++++--- docs/self-hosting/platform/docker.mdx | 179 ++++---- docs/self-hosting/platform/docker.zh-CN.mdx | 211 +++++---- docs/self-hosting/platform/netlify.mdx | 138 ++---- docs/self-hosting/platform/netlify.zh-CN.mdx | 130 ++---- docs/self-hosting/platform/railway.mdx | 13 +- docs/self-hosting/platform/railway.zh-CN.mdx | 13 +- docs/self-hosting/platform/repocloud.mdx | 13 +- .../self-hosting/platform/repocloud.zh-CN.mdx | 13 +- docs/self-hosting/platform/sealos.mdx | 13 +- docs/self-hosting/platform/sealos.zh-CN.mdx | 13 +- docs/self-hosting/platform/vercel.mdx | 15 +- docs/self-hosting/platform/vercel.zh-CN.mdx | 15 +- docs/self-hosting/platform/zeabur.mdx | 61 ++- docs/self-hosting/platform/zeabur.zh-CN.mdx | 61 ++- docs/self-hosting/server-database.mdx | 70 ++- docs/self-hosting/server-database.zh-CN.mdx | 71 ++-- .../server-database/docker-compose.mdx | 115 ++--- .../server-database/docker-compose.zh-CN.mdx | 115 ++--- docs/self-hosting/server-database/docker.mdx | 172 ++++---- .../server-database/docker.zh-CN.mdx | 178 ++++---- docs/self-hosting/server-database/dokploy.mdx | 19 +- .../server-database/dokploy.zh-CN.mdx | 152 ++++--- .../server-database/repocloud.mdx | 16 +- .../server-database/repocloud.zh-CN.mdx | 20 +- docs/self-hosting/server-database/vercel.mdx | 401 +++++++----------- .../server-database/vercel.zh-CN.mdx | 342 ++++++--------- docs/self-hosting/server-database/zeabur.mdx | 44 +- .../server-database/zeabur.zh-CN.mdx | 42 +- docs/self-hosting/start.mdx | 5 +- docs/self-hosting/start.zh-CN.mdx | 2 +- docs/usage/agents/agent-organization.mdx | 26 +- .../usage/agents/agent-organization.zh-CN.mdx | 26 +- docs/usage/agents/concepts.mdx | 8 +- docs/usage/agents/concepts.zh-CN.mdx | 8 +- docs/usage/agents/custom-agent.mdx | 4 +- docs/usage/agents/custom-agent.zh-CN.mdx | 4 +- docs/usage/agents/model.mdx | 8 +- docs/usage/agents/model.zh-CN.mdx | 12 +- docs/usage/agents/prompt.mdx | 11 +- docs/usage/agents/prompt.zh-CN.mdx | 11 +- docs/usage/agents/topics.mdx | 4 +- docs/usage/agents/topics.zh-CN.mdx | 4 +- docs/usage/features/agent-market.mdx | 4 +- docs/usage/features/agent-market.zh-CN.mdx | 4 +- docs/usage/features/auth.mdx | 6 +- docs/usage/features/auth.zh-CN.mdx | 6 +- docs/usage/features/database.mdx | 6 +- docs/usage/features/database.zh-CN.mdx | 6 +- docs/usage/features/local-llm.mdx | 8 +- docs/usage/features/local-llm.zh-CN.mdx | 8 +- docs/usage/features/mobile.mdx | 6 +- docs/usage/features/mobile.zh-CN.mdx | 6 +- docs/usage/features/multi-ai-providers.mdx | 14 +- .../features/multi-ai-providers.zh-CN.mdx | 14 +- docs/usage/features/plugin-system.mdx | 19 +- docs/usage/features/plugin-system.zh-CN.mdx | 19 +- docs/usage/features/pwa.mdx | 36 +- docs/usage/features/pwa.zh-CN.mdx | 36 +- docs/usage/features/text-to-image.mdx | 4 +- docs/usage/features/text-to-image.zh-CN.mdx | 4 +- docs/usage/features/theme.mdx | 7 +- docs/usage/features/theme.zh-CN.mdx | 7 +- docs/usage/features/tts.mdx | 10 +- docs/usage/features/tts.zh-CN.mdx | 10 +- docs/usage/features/vision.mdx | 4 +- docs/usage/features/vision.zh-CN.mdx | 4 +- docs/usage/foundation/basic.mdx | 25 +- docs/usage/foundation/basic.zh-CN.mdx | 22 +- docs/usage/foundation/share.mdx | 16 +- docs/usage/foundation/share.zh-CN.mdx | 16 +- docs/usage/foundation/text2image.mdx | 15 +- docs/usage/foundation/text2image.zh-CN.mdx | 15 +- docs/usage/foundation/translate.mdx | 16 +- docs/usage/foundation/translate.zh-CN.mdx | 16 +- docs/usage/foundation/tts-stt.mdx | 15 +- docs/usage/foundation/tts-stt.zh-CN.mdx | 15 +- docs/usage/foundation/vision.mdx | 20 +- docs/usage/foundation/vision.zh-CN.mdx | 20 +- docs/usage/plugins/basic-usage.mdx | 37 +- docs/usage/plugins/basic-usage.zh-CN.mdx | 37 +- docs/usage/plugins/development.mdx | 108 ++--- docs/usage/plugins/development.zh-CN.mdx | 110 ++--- docs/usage/plugins/store.mdx | 12 +- docs/usage/plugins/store.zh-CN.mdx | 12 +- docs/usage/providers.mdx | 7 +- docs/usage/providers.zh-CN.mdx | 7 +- docs/usage/providers/ai21.mdx | 50 +-- docs/usage/providers/ai21.zh-CN.mdx | 50 +-- docs/usage/providers/ai360.mdx | 50 +-- docs/usage/providers/ai360.zh-CN.mdx | 56 +-- docs/usage/providers/anthropic.mdx | 68 +-- docs/usage/providers/anthropic.zh-CN.mdx | 66 +-- docs/usage/providers/azure.mdx | 72 +--- docs/usage/providers/azure.zh-CN.mdx | 67 +-- docs/usage/providers/baichuan.mdx | 50 +-- docs/usage/providers/baichuan.zh-CN.mdx | 48 +-- docs/usage/providers/bedrock.mdx | 125 ++---- docs/usage/providers/bedrock.zh-CN.mdx | 123 ++---- docs/usage/providers/cloudflare.mdx | 73 ++-- docs/usage/providers/cloudflare.zh-CN.mdx | 69 ++- docs/usage/providers/deepseek.mdx | 76 ++-- docs/usage/providers/deepseek.zh-CN.mdx | 74 ++-- docs/usage/providers/fireworksai.mdx | 66 +-- docs/usage/providers/fireworksai.zh-CN.mdx | 62 +-- docs/usage/providers/gemini.mdx | 66 +-- docs/usage/providers/gemini.zh-CN.mdx | 66 +-- docs/usage/providers/giteeai.mdx | 69 ++- docs/usage/providers/giteeai.zh-CN.mdx | 65 +-- docs/usage/providers/github.mdx | 64 +-- docs/usage/providers/github.zh-CN.mdx | 63 +-- docs/usage/providers/groq.mdx | 41 +- docs/usage/providers/groq.zh-CN.mdx | 39 +- docs/usage/providers/hunyuan.mdx | 58 +-- docs/usage/providers/hunyuan.zh-CN.mdx | 56 +-- docs/usage/providers/internlm.mdx | 59 +-- docs/usage/providers/internlm.zh-CN.mdx | 55 +-- docs/usage/providers/minimax.mdx | 74 ++-- docs/usage/providers/minimax.zh-CN.mdx | 70 +-- docs/usage/providers/mistral.mdx | 60 +-- docs/usage/providers/mistral.zh-CN.mdx | 58 +-- docs/usage/providers/moonshot.mdx | 58 +-- docs/usage/providers/moonshot.zh-CN.mdx | 56 +-- docs/usage/providers/novita.mdx | 63 +-- docs/usage/providers/novita.zh-CN.mdx | 61 +-- docs/usage/providers/ollama.mdx | 166 +++----- docs/usage/providers/ollama.zh-CN.mdx | 166 +++----- docs/usage/providers/ollama/gemma.mdx | 41 +- docs/usage/providers/ollama/gemma.zh-CN.mdx | 42 +- docs/usage/providers/ollama/qwen.mdx | 49 +-- docs/usage/providers/ollama/qwen.zh-CN.mdx | 39 +- docs/usage/providers/openai.mdx | 98 ++--- docs/usage/providers/openai.zh-CN.mdx | 91 ++-- docs/usage/providers/openrouter.mdx | 132 +++--- docs/usage/providers/openrouter.zh-CN.mdx | 98 ++--- docs/usage/providers/perplexity.mdx | 50 +-- docs/usage/providers/perplexity.zh-CN.mdx | 50 +-- docs/usage/providers/qwen.mdx | 78 ++-- docs/usage/providers/qwen.zh-CN.mdx | 76 ++-- docs/usage/providers/sensenova.mdx | 69 ++- docs/usage/providers/sensenova.zh-CN.mdx | 65 +-- docs/usage/providers/siliconcloud.mdx | 50 +-- docs/usage/providers/siliconcloud.zh-CN.mdx | 50 +-- docs/usage/providers/spark.mdx | 60 +-- docs/usage/providers/spark.zh-CN.mdx | 58 +-- docs/usage/providers/stepfun.mdx | 52 +-- docs/usage/providers/stepfun.zh-CN.mdx | 52 +-- docs/usage/providers/taichu.mdx | 50 +-- docs/usage/providers/taichu.zh-CN.mdx | 48 +-- docs/usage/providers/togetherai.mdx | 58 +-- docs/usage/providers/togetherai.zh-CN.mdx | 58 +-- docs/usage/providers/upstage.mdx | 52 +-- docs/usage/providers/upstage.zh-CN.mdx | 50 +-- docs/usage/providers/wenxin.mdx | 64 +-- docs/usage/providers/wenxin.zh-CN.mdx | 60 +-- docs/usage/providers/xai.mdx | 59 +-- docs/usage/providers/xai.zh-CN.mdx | 57 +-- docs/usage/providers/zeroone.mdx | 70 +-- docs/usage/providers/zeroone.zh-CN.mdx | 70 +-- docs/usage/providers/zhipu.mdx | 52 +-- docs/usage/providers/zhipu.zh-CN.mdx | 52 +-- docs/usage/start.mdx | 22 +- docs/usage/start.zh-CN.mdx | 21 +- docs/usage/tools-calling.mdx | 9 + docs/usage/tools-calling.zh-CN.mdx | 128 +++--- docs/usage/tools-calling/anthropic.mdx | 69 +-- docs/usage/tools-calling/anthropic.zh-CN.mdx | 77 +--- docs/usage/tools-calling/google.mdx | 39 +- docs/usage/tools-calling/google.zh-CN.mdx | 41 +- docs/usage/tools-calling/groq.mdx | 9 + docs/usage/tools-calling/groq.zh-CN.mdx | 114 ++--- docs/usage/tools-calling/moonshot.mdx | 9 + docs/usage/tools-calling/openai.mdx | 63 +-- docs/usage/tools-calling/openai.zh-CN.mdx | 65 +-- package.json | 81 ++-- scripts/mdxWorkflow/index.ts | 7 + .../(mobile)/me/(home)/features/Header.tsx | 3 +- .../(mobile)/me/data/features/Header.tsx | 2 +- .../(mobile)/me/profile/features/Header.tsx | 2 +- .../(mobile)/me/settings/features/Header.tsx | 2 +- src/app/(main)/@nav/_layout/Mobile.tsx | 3 +- .../features/SystemRole/SystemRoleContent.tsx | 3 +- .../TopicListContent/ByTimeMode/GroupItem.tsx | 4 +- .../_layout/Desktop/ChatHeader/Main.tsx | 3 +- .../_layout/Desktop/ChatHeader/index.tsx | 2 +- .../Mobile/ChatHeader/ChatHeaderTitle.tsx | 3 +- .../_layout/Mobile/ChatHeader/index.tsx | 2 +- .../@session/_layout/Mobile/SessionHeader.tsx | 3 +- .../chat/settings/_layout/Desktop/Header.tsx | 2 +- .../chat/settings/_layout/Mobile/Header.tsx | 2 +- .../features/InfoSidebar/SuggestionItem.tsx | 14 +- .../discover/(list)/_layout/Desktop/Nav.tsx | 2 +- .../discover/(list)/_layout/Mobile/Header.tsx | 3 +- .../discover/_layout/Desktop/Header.tsx | 2 +- .../components/VirtuosoGridList/index.tsx | 14 +- .../discover/search/_layout/Mobile/Header.tsx | 2 +- .../features/KnowledgeBase/EmptyStatus.tsx | 34 +- .../evals/evaluation/EvaluationList/index.tsx | 2 +- .../sync/features/DeviceInfo/SystemIcon.tsx | 2 + .../Branding/ProductLogo/Custom.tsx | 39 +- .../BrowserIcon/components/Brave.tsx | 56 --- .../BrowserIcon/components/Chrome.tsx | 14 - .../BrowserIcon/components/Chromium.tsx | 14 - .../BrowserIcon/components/Edge.tsx | 36 -- .../BrowserIcon/components/Firefox.tsx | 38 -- .../BrowserIcon/components/Opera.tsx | 19 - .../BrowserIcon/components/Safari.tsx | 23 - .../BrowserIcon/components/Samsung.tsx | 21 - src/components/BrowserIcon/index.tsx | 49 +-- src/components/BubblesLoading/index.tsx | 54 ++- .../FunctionModal/createModalHooks.ts | 9 +- src/components/StopLoading.tsx | 17 +- .../ChatInput/Desktop/InputArea/index.tsx | 4 +- src/features/InitClientDB/EnableModal.tsx | 4 +- .../{PGliteSVG.tsx => PGliteIcon.tsx} | 28 +- src/features/ShareModal/ShareImage/index.tsx | 54 ++- src/features/ShareModal/ShareJSON/Preview.tsx | 4 +- src/features/ShareModal/ShareJSON/index.tsx | 86 ++-- src/features/ShareModal/ShareText/Preview.tsx | 5 +- src/features/ShareModal/ShareText/index.tsx | 87 ++-- src/features/ShareModal/index.tsx | 2 +- src/features/ShareModal/style.ts | 30 ++ src/utils/colorUtils.ts | 2 +- 317 files changed, 5344 insertions(+), 8205 deletions(-) create mode 100644 .remarkrc.mdx.js delete mode 100644 src/components/BrowserIcon/components/Brave.tsx delete mode 100644 src/components/BrowserIcon/components/Chrome.tsx delete mode 100644 src/components/BrowserIcon/components/Chromium.tsx delete mode 100644 src/components/BrowserIcon/components/Edge.tsx delete mode 100644 src/components/BrowserIcon/components/Firefox.tsx delete mode 100644 src/components/BrowserIcon/components/Opera.tsx delete mode 100644 src/components/BrowserIcon/components/Safari.tsx delete mode 100644 src/components/BrowserIcon/components/Samsung.tsx rename src/features/InitClientDB/{PGliteSVG.tsx => PGliteIcon.tsx} (64%) diff --git a/.remarkrc.mdx.js b/.remarkrc.mdx.js new file mode 100644 index 000000000000..22af1dc8a10a --- /dev/null +++ b/.remarkrc.mdx.js @@ -0,0 +1,6 @@ +const config = require('@lobehub/lint').remarklint; + +module.exports = { + ...config, + plugins: ['remark-mdx', ...config.plugins], +}; diff --git a/docs/changelog/2023-09-09-plugin-system.mdx b/docs/changelog/2023-09-09-plugin-system.mdx index b1ad1e858f9e..9ef28b4b006f 100644 --- a/docs/changelog/2023-09-09-plugin-system.mdx +++ b/docs/changelog/2023-09-09-plugin-system.mdx @@ -4,6 +4,11 @@ description: >- Discover how the LobeChat plugin ecosystem enhances the utility and flexibility of the LobeChat assistant, along with the development resources and plugin development guidelines provided. +tags: + - LobeChat + - Plugins + - Real-time Information + - Voice Options --- # Supported Plugin System diff --git a/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx b/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx index a9cb9ce79f20..2e43186c8acb 100644 --- a/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx +++ b/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat 插件生态系统 - 功能扩展与开发资源 description: 了解 LobeChat 插件生态系统如何增强 LobeChat 助手的实用性和灵活性,以及提供的开发资源和插件开发指南。 +tags: + - LobeChat + - 插件系统 + - 实时信息 + - 第三方服务 --- # 支持插件系统 diff --git a/docs/changelog/2023-11-14-gpt4-vision.mdx b/docs/changelog/2023-11-14-gpt4-vision.mdx index bc92396e5f89..e62c5941a597 100644 --- a/docs/changelog/2023-11-14-gpt4-vision.mdx +++ b/docs/changelog/2023-11-14-gpt4-vision.mdx @@ -7,6 +7,12 @@ description: >- capabilities, allowing users to upload or drag and drop images. The assistant will recognize the content and engage in intelligent dialogue, creating a more intelligent and diverse chat environment. +tags: + - Visual Recognition + - LobeChat + - GPT-4 Vision + - Google Gemini Pro + - Multimodal Interaction --- # Supported Models for Visual Recognition diff --git a/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx b/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx index 3b9400b461b8..8aeca20562d8 100644 --- a/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx +++ b/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx @@ -1,6 +1,12 @@ --- title: LobeChat 支持多模态交互:视觉识别助力智能对话 description: LobeChat 支持多种具有视觉识别能力的大语言模型,用户可上传或拖拽图片,助手将识别内容并展开智能对话,打造更智能、多元化的聊天场景。 +tags: + - 视觉识别 + - 多模态交互 + - LobeChat + - GPT-4 + - Google Gemini Pro --- # 支持模型视觉识别 diff --git a/docs/changelog/2023-11-19-tts-stt.mdx b/docs/changelog/2023-11-19-tts-stt.mdx index eb622b94c636..8d3124f55943 100644 --- a/docs/changelog/2023-11-19-tts-stt.mdx +++ b/docs/changelog/2023-11-19-tts-stt.mdx @@ -4,6 +4,12 @@ description: >- LobeChat supports Text-to-Speech (TTS) and Speech-to-Text (STT) technologies, offering high-quality voice options for a personalized communication experience. Learn more about Lobe TTS Toolkit. +tags: + - TTS + - STT + - Voice Conversations + - LobeChat + - Audio Technology --- # Supporting TTS & STT Voice Conversations diff --git a/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx b/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx index 5a400a3ad07b..9a7c789c2431 100644 --- a/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx +++ b/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx @@ -1,6 +1,13 @@ --- title: LobeChat 文生图:文本转图片生成技术 description: LobeChat 支持文字转语音(TTS)和语音转文字(STT)技术,提供高品质声音选项,个性化交流体验。了解更多关于 Lobe TTS 工具包。 +tags: + - TTS + - STT + - 语音会话 + - LobeChat + - 文字转语音 + - 语音转文字 --- # 支持 TTS & STT 语音会话 diff --git a/docs/changelog/2023-12-22-dalle-3.mdx b/docs/changelog/2023-12-22-dalle-3.mdx index 0c672ab6a6b5..fc1d742b5cff 100644 --- a/docs/changelog/2023-12-22-dalle-3.mdx +++ b/docs/changelog/2023-12-22-dalle-3.mdx @@ -6,6 +6,12 @@ description: >- assistant for creative purposes. By utilizing AI tools such as DALL-E 3, MidJourney, and Pollinations, assistants can turn your ideas into images, making the creative process more intimate and immersive. +tags: + - Text-to-Image + - LobeChat + - AI Tools + - DALL-E 3 + - MidJourney --- # Support for Text-to-Image Generation diff --git a/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx b/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx index 714f699dc186..c14d1d988762 100644 --- a/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +++ b/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx @@ -3,6 +3,10 @@ title: LobeChat 文生图:文本转图片生成技术 description: >- LobeChat 现在支持最新的文本到图片生成技术,让用户可以在与助手对话中直接调用文生图工具进行创作。利用 DALL-E 3、MidJourney 和 Pollinations 等 AI 工具,助手们可以将你的想法转化为图像,让创作过程更私密和沉浸式。 +tags: + - Text to Image + - 文生图 + - AI 创作 --- # 支持 Text to Image 文生图 diff --git a/docs/changelog/2024-02-08-sso-oauth.mdx b/docs/changelog/2024-02-08-sso-oauth.mdx index ce5c6da21788..1b4768efa428 100644 --- a/docs/changelog/2024-02-08-sso-oauth.mdx +++ b/docs/changelog/2024-02-08-sso-oauth.mdx @@ -3,6 +3,12 @@ title: LobeChat Supports Multi-User Management with Clerk and Next-Auth description: >- LobeChat offers various user authentication and management solutions, including Clerk and Next-Auth, to meet the diverse needs of different users. +tags: + - User Management + - Next-Auth + - Clerk + - Authentication + - Multi-Factor Authentication --- # Support for Multi-User Management with Clerk and Next-Auth diff --git a/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx b/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx index c350532af46f..55e74a791231 100644 --- a/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx +++ b/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx @@ -1,6 +1,12 @@ --- title: LobeChat 支持 Clerk 与 Next-Auth 多用户管理支持 description: LobeChat 提供 Clerk 和 Next-Auth 等多种用户认证和管理方案,以满足不同用户的需求。 +tags: + - 用户管理 + - 身份验证 + - next-auth + - Clerk + - 多因素认证 --- # 支持 Clerk 与 Next-Auth 多用户管理支持 diff --git a/docs/changelog/2024-02-14-ollama.mdx b/docs/changelog/2024-02-14-ollama.mdx index e8dd6a3a0345..906cc8efddaa 100644 --- a/docs/changelog/2024-02-14-ollama.mdx +++ b/docs/changelog/2024-02-14-ollama.mdx @@ -1,6 +1,12 @@ --- title: LobeChat Supports Ollama for Local Large Language Model (LLM) Calls description: LobeChat v0.127.0 supports using Ollama to call local large language models. +tags: + - Ollama AI + - LobeChat + - Local LLMs + - AI Conversations + - GPT-4 --- # Support for Ollama Calls to Local Large Language Models 🦙 diff --git a/docs/changelog/2024-02-14-ollama.zh-CN.mdx b/docs/changelog/2024-02-14-ollama.zh-CN.mdx index 2ef53e3eaea2..565c2a7e92f3 100644 --- a/docs/changelog/2024-02-14-ollama.zh-CN.mdx +++ b/docs/changelog/2024-02-14-ollama.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat 支持 Ollama 调用本地大语言模型(LLM) description: LobeChat vLobeChat v0.127.0 支持 Ollama 调用本地大语言模型。 +tags: + - Ollama AI + - LobeChat + - 大语言模型 + - AI 对话 --- # 支持 Ollama 调用本地大语言模型 🦙 diff --git a/docs/changelog/2024-06-19-lobe-chat-v1.mdx b/docs/changelog/2024-06-19-lobe-chat-v1.mdx index ae476363b0b6..ac59cfdb757d 100644 --- a/docs/changelog/2024-06-19-lobe-chat-v1.mdx +++ b/docs/changelog/2024-06-19-lobe-chat-v1.mdx @@ -4,6 +4,12 @@ description: >- LobeChat 1.0 brings a brand-new architecture and features for server-side databases and user authentication management, opening up new possibilities. On this basis, LobeChat Cloud has entered beta testing. +tags: + - LobeChat + - Version 1.0 + - Server-Side Database + - User Authentication + - Cloud Beta Testing --- # LobeChat 1.0: New Architecture and New Possibilities diff --git a/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx b/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx index 1fc936e07710..af6097695448 100644 --- a/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +++ b/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx @@ -3,6 +3,11 @@ title: LobeChat 1.0:新的架构与新的可能 description: >- LobeChat 1.0 带来了服务端数据库、用户鉴权管理的全新架构与特性,开启了新的可能 。在此基础上, LobeChat Cloud 开启 Beta 版测试。 +tags: + - LobeChat + - 服务端数据库 + - 用户鉴权 + - Beta 测试 --- # LobeChat 1.0:新的架构与新的可能 diff --git a/docs/changelog/2024-07-19-gpt-4o-mini.mdx b/docs/changelog/2024-07-19-gpt-4o-mini.mdx index b35fcc007dac..1a2b6e62fb8e 100644 --- a/docs/changelog/2024-07-19-gpt-4o-mini.mdx +++ b/docs/changelog/2024-07-19-gpt-4o-mini.mdx @@ -4,6 +4,11 @@ description: >- LobeChat v1.6 has been released with support for GPT-4o mini, while LobeChat Cloud services have been fully upgraded to provide users with a more powerful AI conversation experience. +tags: + - LobeChat + - GPT-4o Mini + - AI Conversation + - Cloud Service --- # GPT-4o Mini Makes a Stunning Debut, Ushering in a New GPT-4 Era 🚀 diff --git a/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx b/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx index b813eac1e364..fde0f598f267 100644 --- a/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +++ b/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx @@ -3,6 +3,10 @@ title: LobeChat 全面进入 GPT-4 时代:GPT-4o mini 正式上线 description: >- LobeChat v1.6 重磅发布 GPT-4o mini 支持,同时 LobeChat Cloud 服务全面升级默认模型,为用户带来更强大的 AI 对话体验。 +tags: + - LobeChat + - GPT-4o mini + - AI 对话服务 --- # GPT-4o mini 震撼登场,开启全新 GPT-4 时代 🚀 diff --git a/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx b/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx index 2dcf984993e4..baae9f8d393b 100644 --- a/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +++ b/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx @@ -4,6 +4,12 @@ description: >- LobeChat v1.8.0 launches the official database Docker image, supporting cloud data synchronization and user management, along with comprehensive self-deployment documentation. +tags: + - LobeChat + - Docker Image + - Cloud Deployment + - Database + - Postgres --- # LobeChat Database Docker Image: The Final Piece of the Cloud Deployment Puzzle diff --git a/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx b/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx index b49a42b6e280..3148b25084ca 100644 --- a/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx +++ b/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat Database Docker 镜像正式发布 description: LobeChat v1.8.0 推出官方数据库 Docker 镜像,支持云端数据同步与用户管理,并提供完整的自部署文档指南。 +tags: + - LobeChat + - Docker 镜像 + - 云端部署 + - 数据库 --- # LobeChat Database Docker 镜像:云端部署的最后一块拼图 diff --git a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx index 12c998a05d49..7535a10c3ee7 100644 --- a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +++ b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx @@ -6,6 +6,12 @@ description: >- LobeChat introduces a brand new knowledge base feature that supports all types of file management, intelligent vectorization, and file dialogue, making knowledge management and information retrieval easier and smarter. +tags: + - LobeChat + - Knowledge Base + - File Management + - Open Source + - Cloud Version --- # Major Release of Knowledge Base Feature: A Revolution in Intelligent File Management and Dialogue diff --git a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx index 81ac80e4d45c..cdb3f23564dc 100644 --- a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx +++ b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat 重磅发布知识库功能:打造智能文件管理与对话新体验 description: LobeChat 推出全新知识库功能,支持全类型文件管理、智能向量化和文件对话,让知识管理和信息检索更轻松、更智能。 +tags: + - LobeChat + - 知识库 + - 文件管理 + - 智能处理 --- # 知识库功能重磅发布:智能文件管理与对话的革新 diff --git a/docs/changelog/2024-09-13-openai-o1-models.mdx b/docs/changelog/2024-09-13-openai-o1-models.mdx index 2b82cf024756..6cb27260e991 100644 --- a/docs/changelog/2024-09-13-openai-o1-models.mdx +++ b/docs/changelog/2024-09-13-openai-o1-models.mdx @@ -3,6 +3,12 @@ title: LobeChat Perfectly Adapts to OpenAI O1 Series Models description: >- LobeChat v1.17.0 now supports OpenAI's latest o1-preview and o1-mini models, bringing users enhanced coding and mathematical capabilities. +tags: + - OpenAI O1 + - LobeChat + - AI Models + - Code Writing + - Mathematical Problem Solving --- # OpenAI O1 Series Models Now Available on LobeChat diff --git a/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx b/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx index b7571d712fbf..9b1e5e565479 100644 --- a/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx +++ b/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx @@ -1,6 +1,12 @@ --- title: LobeChat 完美适配 OpenAI O1 系列模型 description: LobeChat v1.17.0 现已支持 OpenAI 最新发布的 o1-preview 和 o1-mini 模型,为用户带来更强大的代码和数学能力。 +tags: + - OpenAI O1 + - LobeChat + - AI 模型 + - 代码编写 + - 数学问题 --- # OpenAI O1 系列模型现已登陆 LobeChat diff --git a/docs/changelog/2024-09-20-artifacts.mdx b/docs/changelog/2024-09-20-artifacts.mdx index 5b8d601cc9ac..3e571c4b269c 100644 --- a/docs/changelog/2024-09-20-artifacts.mdx +++ b/docs/changelog/2024-09-20-artifacts.mdx @@ -4,6 +4,12 @@ description: >- LobeChat v1.19 brings significant updates, including full feature support for Claude Artifacts, a brand new discovery page design, and support for GitHub Models providers, greatly enhancing the capabilities of the AI assistant. +tags: + - LobeChat + - AI Assistant + - Artifacts + - GitHub Models + - Interactive Experience --- # Major Update: LobeChat Enters the Era of Artifacts diff --git a/docs/changelog/2024-09-20-artifacts.zh-CN.mdx b/docs/changelog/2024-09-20-artifacts.zh-CN.mdx index 6b70dd4e020f..801466498ad1 100644 --- a/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +++ b/docs/changelog/2024-09-20-artifacts.zh-CN.mdx @@ -3,6 +3,12 @@ title: 重磅更新:LobeChat 迎来 Artifacts 时代 description: >- LobeChat v1.19 带来了重大更新,包括 Claude Artifacts 完整特性支持、全新的发现页面设计,以及 GitHub Models 服务商支持,让 AI 助手的能力得到显著提升。 +tags: + - LobeChat + - Artifacts + - AI 助手 + - 更新 + - GitHub Models --- # 重磅更新:LobeChat 迎来 Artifacts 时代 diff --git a/docs/changelog/2024-10-27-pin-assistant.mdx b/docs/changelog/2024-10-27-pin-assistant.mdx index 9b13bba51427..d65f66dff36a 100644 --- a/docs/changelog/2024-10-27-pin-assistant.mdx +++ b/docs/changelog/2024-10-27-pin-assistant.mdx @@ -4,6 +4,11 @@ description: >- LobeChat v1.26.0 launches the persistent assistant sidebar feature, supporting quick key switching for easy access to frequently used assistants, significantly enhancing efficiency. +tags: + - Persistent Assistant + - Sidebar Feature + - User Experience + - Workflow Optimization --- # Persistent Assistant Sidebar: Creating a More Convenient Conversation Experience diff --git a/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx b/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx index 1b7f84ddd1b4..2971ad514bdc 100644 --- a/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx +++ b/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx @@ -1,6 +1,10 @@ --- title: LobeChat 新增助手常驻侧边栏功能 description: LobeChat v1.26.0 推出助手常驻侧边栏功能,支持快捷键切换,让高频使用的助手触手可及,大幅提升使用效率。 +tags: + - 助手常驻侧边栏 + - 对话体验 + - 工作效率 --- # 助手常驻侧边栏:打造更便捷的对话体验 diff --git a/docs/changelog/2024-11-06-share-text-json.mdx b/docs/changelog/2024-11-06-share-text-json.mdx index 8fed3949d87b..e8f1948d268c 100644 --- a/docs/changelog/2024-11-06-share-text-json.mdx +++ b/docs/changelog/2024-11-06-share-text-json.mdx @@ -5,6 +5,10 @@ description: >- and OpenAI format JSON, making it easy to convert conversation content into note materials, development debugging data, and training corpora, significantly enhancing the reusability of conversation content. +tags: + - Text Format Export + - Markdown Export + - OpenAI JSON --- # Upgraded Conversation Sharing: Support for Text Format Export diff --git a/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx b/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx index dfc222da5d0f..90f78831a64d 100644 --- a/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +++ b/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx @@ -3,6 +3,10 @@ title: LobeChat 支持分享对话为文本格式(Markdown/JSON) description: >- LobeChat v1.28.0 新增 Markdown 和 OpenAI 格式 JSON 导出支持,让对话内容能轻松转化为笔记素材、开发调试数据和训练语料,显著提升对话内容的复用价值。 +tags: + - 对话内容 + - Markdown导出 + - OpenAI JSON --- # 对话内容分享升级:支持文本格式导出 diff --git a/docs/changelog/2024-11-25-november-providers.mdx b/docs/changelog/2024-11-25-november-providers.mdx index ce4b4182a871..79496caafada 100644 --- a/docs/changelog/2024-11-25-november-providers.mdx +++ b/docs/changelog/2024-11-25-november-providers.mdx @@ -3,6 +3,13 @@ title: New Model Providers Added to LobeChat in November description: >- LobeChat model providers now support Gitee AI, InternLM (ShuSheng PuYu), xAI, and Cloudflare WorkersAI +tags: + - LobeChat + - AI Model Providers + - Gitee AI + - InternLM + - xAI + - Cloudflare Workers AI --- # New Model Providers Added to LobeChat in November 🎉 diff --git a/docs/changelog/2024-11-25-november-providers.zh-CN.mdx b/docs/changelog/2024-11-25-november-providers.zh-CN.mdx index 0b2d77ab51f6..27219ba868f7 100644 --- a/docs/changelog/2024-11-25-november-providers.zh-CN.mdx +++ b/docs/changelog/2024-11-25-november-providers.zh-CN.mdx @@ -1,6 +1,13 @@ --- title: LobeChat 11 月新增模型服务 description: 'LobeChat 模型服务新增支持 Gitee AI, InternLM (书生浦语), xAI, Cloudflare WorkersAI' +tags: + - LobeChat + - AI模型服务 + - Gitee AI + - InternLM + - xAI + - Cloudflare Workers AI --- # LobeChat 11 月新增模型服务支持 🎉 diff --git a/docs/changelog/2024-11-27-forkable-chat.mdx b/docs/changelog/2024-11-27-forkable-chat.mdx index d50d49397272..2fe7a4658afa 100644 --- a/docs/changelog/2024-11-27-forkable-chat.mdx +++ b/docs/changelog/2024-11-27-forkable-chat.mdx @@ -3,6 +3,10 @@ title: LobeChat Supports Branching Conversations description: >- LobeChat now allows you to create new conversation branches from any message, freeing your thoughts. +tags: + - Branching Conversations + - LobeChat + - Chat Features --- # Exciting Launch of Branching Conversations Feature 🎉 diff --git a/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx b/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx index 07581558181b..7033bd4a9171 100644 --- a/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx +++ b/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat 支持分支对话 description: LobeChat 现已支持从任意消息创建新的对话分支,让您的思维不再受限 +tags: + - LobeChat + - 分支对话 + - 对话功能 + - 用户体验 --- # 重磅推出分支对话功能 🎉 diff --git a/docs/changelog/2025-01-03-user-profile.mdx b/docs/changelog/2025-01-03-user-profile.mdx index e22ac1b49010..38d23643863f 100644 --- a/docs/changelog/2025-01-03-user-profile.mdx +++ b/docs/changelog/2025-01-03-user-profile.mdx @@ -3,6 +3,11 @@ title: LobeChat Supports User Data Statistics and Activity Sharing description: >- LobeChat now supports multi-dimensional user data statistics and activity sharing +tags: + - LobeChat + - User Statistics + - Activity Sharing + - AI Data --- # User Data Statistics and Activity Sharing 💯 diff --git a/docs/changelog/2025-01-03-user-profile.zh-CN.mdx b/docs/changelog/2025-01-03-user-profile.zh-CN.mdx index 171edb99bab5..65df51b3f56a 100644 --- a/docs/changelog/2025-01-03-user-profile.zh-CN.mdx +++ b/docs/changelog/2025-01-03-user-profile.zh-CN.mdx @@ -1,6 +1,10 @@ --- title: LobeChat 支持用户数据统计与活跃度分享 description: LobeChat 现已支持多维度用户数据统计与活跃度分享 +tags: + - 用户数据统计 + - 活跃度分享 + - LobeChat --- # 用户数据统计与活跃度分享 💯 @@ -23,4 +27,3 @@ description: LobeChat 现已支持多维度用户数据统计与活跃度分享 1. 需要使用 `PgLite` 或 `数据库` 模式 2. 点击个人头像进入「账户管理」-「数据统计」页面 - diff --git a/docs/self-hosting/advanced/auth.mdx b/docs/self-hosting/advanced/auth.mdx index 7d4d8614981c..5dd539eef62e 100644 --- a/docs/self-hosting/advanced/auth.mdx +++ b/docs/self-hosting/advanced/auth.mdx @@ -27,28 +27,29 @@ By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CL Before using NextAuth, please set the following variables in LobeChat's environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. | -| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` | -| `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. | +| Environment Variable | Type | Description | +| ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. | +| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` | +| `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. | Currently supported identity verification services include: - + + + + + - + + + + diff --git a/docs/self-hosting/advanced/auth.zh-CN.mdx b/docs/self-hosting/advanced/auth.zh-CN.mdx index a5599a2cf539..008b401fddf5 100644 --- a/docs/self-hosting/advanced/auth.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth.zh-CN.mdx @@ -24,28 +24,29 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全 在使用 NextAuth 之前,请先在 LobeChat 的环境变量中设置以下变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | -| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 | +| 环境变量 | 类型 | 描述 | +| ------------------------- | -- | ------------------------------------------------------------------------------------------------------------ | +| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 | +| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | +| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 | 目前支持的身份验证服务有: - + + + + + - + + + + @@ -57,7 +58,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全 顺序为 SSO 提供商的显示顺序。 -| SSO 提供商 | 值 | +| SSO 提供商 | 值 | | --------------------- | ----------------------- | | Auth0 | `auth0` | | Authenlia | `authenlia` | diff --git a/docs/self-hosting/advanced/auth/clerk.mdx b/docs/self-hosting/advanced/auth/clerk.mdx index b8a658d9f6b5..0e98c8c4a47d 100644 --- a/docs/self-hosting/advanced/auth/clerk.mdx +++ b/docs/self-hosting/advanced/auth/clerk.mdx @@ -11,67 +11,51 @@ tags: # Configure Clerk Authentication Service -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. +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. ## Get Environment Variables + ### Add Public and Private Key Environment Variables -### Add Public and Private Key Environment Variables + Add `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on the "API Keys" in the menu and copy the corresponding values to get these environment variables. -Add `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on the "API Keys" in the menu and copy the corresponding values to get these environment variables. + {'Find -{'Find + The environment variables required for this step are as follows: -The environment variables required for this step are as follows: + ```shell + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx + CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx + ``` -```shell -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx -CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -``` + ### Create and Configure Webhook in Clerk -### Create and Configure Webhook in Clerk + Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store the changes in the user lifecycle (create, update, delete). We achieve this by using the Webhook provided by Clerk. -Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store the changes in the user lifecycle (create, update, delete). We achieve this by using the Webhook provided by Clerk. + 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. -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. + {'Add -{'Add + Fill in your project URL in the endpoint, such as `https://your-project.com/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create. -Fill in your project URL in the endpoint, such as `https://your-project.com/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create. + + The `https://` in the URL is essential to maintain the integrity of the URL. + - + {'Configure -The `https://` in the URL is essential to maintain the integrity of the URL. + ### Add Webhook Secret to Environment Variables - + After creating, you can find the secret of this Webhook in the bottom right corner: -{'Configure + {'View -### Add Webhook Secret to Environment Variables - -After creating, you can find the secret of this Webhook in the bottom right corner: - -{'View - -The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`: - -```shell -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` + The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`: + ```shell + CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx + ``` By following these steps, you have successfully configured the Clerk authentication service. diff --git a/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx b/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx index 27e06d5749fd..a31bb6e322dd 100644 --- a/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx @@ -10,63 +10,49 @@ tags: # 配置 Clerk 身份验证服务 -前往 [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。 +前往 [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。 ## 获取环境变量 + ### 添加公、私钥环境变量 -### 添加公、私钥环境变量 + 添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值获取该环境变量。 -添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值获取该环境变量。 + {'在 -{'在 + 此步骤所需的环境变量如下: -此步骤所需的环境变量如下: + ```shell + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx + CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx + ``` -```shell -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx -CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -``` + ### 在 Clerk 中创建并配置 Webhook -### 在 Clerk 中创建并配置 Webhook + 由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。 -由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。 + 我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。 -我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。 + {'Clerk -{'Clerk + 在 endppint 中填写你的项目 URL,如 `https://your-project.com/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。 -在 endppint 中填写你的项目 URL,如 `https://your-project.com/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。 + URL 的`https://`不可缺失,须保持 URL 的完整性 -URL的`https://`不可缺失,须保持URL的完整性 + {'添加 -{'添加 + ### 将 Webhook 秘钥添加到环境变量 -### 将 Webhook 秘钥添加到环境变量 + 创建完毕后,可以在右下角找到该 Webhook 的秘钥: -创建完毕后,可以在右下角找到该 Webhook 的秘钥: + {'查看 -{'查看 - -这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`: - -```shell -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` + 这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`: + ```shell + CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx + ``` 这样,你已经成功配置了 Clerk 身份验证服务。 diff --git a/docs/self-hosting/advanced/auth/next-auth/auth0.mdx b/docs/self-hosting/advanced/auth/next-auth/auth0.mdx index c35ef562849c..f61418cc3b85 100644 --- a/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/auth0.mdx @@ -19,74 +19,53 @@ tags: ### Create Auth0 Application -Register and log in to [Auth0][auth0-client-page], click on the "Applications" in the left navigation bar to switch to the application management interface, and click "Create Application" in the upper right corner to create an application. + Register and log in to [Auth0][auth0-client-page], click on the "Applications" in the left navigation bar to switch to the application management interface, and click "Create Application" in the upper right corner to create an application. -Create Auth0 Application S1 + Create Auth0 Application S1 -Fill in the application name you want to display to the organization users, choose any application type, and click "Create". + Fill in the application name you want to display to the organization users, choose any application type, and click "Create". -Create Auth0 Application S2 + Create Auth0 Application S2 -After successful creation, click on the corresponding application to enter the application details page, switch to the "Settings" tab, and you can see the corresponding configuration information. + After successful creation, click on the corresponding application to enter the application details page, switch to the "Settings" tab, and you can see the corresponding configuration information. -Create Auth0 Application S3 + Create Auth0 Application S3 -In the application configuration page, you also need to configure Allowed Callback URLs, where you should fill in: + In the application configuration page, you also need to configure Allowed Callback URLs, where you should fill in: -```bash -http(s)://your-domain/api/auth/callback/auth0 -``` + ```bash + http(s)://your-domain/api/auth/callback/auth0 + ``` -Create Auth0 Application S4 + Create Auth0 Application S4 - - You can fill in or modify Allowed Callback URLs after deployment, but make sure the filled URL is - consistent with the deployed URL. - + + You can fill in or modify Allowed Callback URLs after deployment, but make sure the filled URL is + consistent with the deployed URL. + -### Add Users + ### Add Users -Click on the "Users Management" in the left navigation bar to enter the user management interface, where you can create users for your organization to log in to LobeChat. + Click on the "Users Management" in the left navigation bar to enter the user management interface, where you can create users for your organization to log in to LobeChat. -Add Users + Add Users -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. | -| `AUTH_AUTH0_ID` | Required | Client ID of the Auth0 application | -| `AUTH_AUTH0_SECRET` | Required | Client Secret of the Auth0 application | -| `AUTH_AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` | -| `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. | + | `AUTH_AUTH0_ID` | Required | Client ID of the Auth0 application | + | `AUTH_AUTH0_SECRET` | Required | Client Secret of the Auth0 application | + | `AUTH_AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` | + | `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variable#auth0). - - + @@ -102,19 +81,13 @@ If your enterprise or organization already has a unified identity authentication Auth0 supports single sign-on services such as Azure Active Directory, Slack, Google Workspace, Office 365, Zoom, and more. For a detailed list of supported services, please refer to [this link][auth0-sso-integrations]. -Connecting to an Existing Single Sign-On Service +Connecting to an Existing Single Sign-On Service ### Configuring Social Login If your enterprise or organization needs to support external user logins, you can configure social login services in Authentication -> Social. -Configuring Social Login +Configuring Social Login Configuring social login services by default allows anyone to authenticate, which may lead to diff --git a/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx index a8305a1a179c..36296fa31755 100644 --- a/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx @@ -15,73 +15,52 @@ tags: ### 创建 Auth0 应用 -注册并登录 [Auth0](https://manage.auth0.com/dashboard),点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。 + 注册并登录 [Auth0](https://manage.auth0.com/dashboard),点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。 -创建 Auth0 应用 S1 + 创建 Auth0 应用 S1 -填写你想向组织用户显示的应用名称,可选择任意应用类型,点击「Create」。 + 填写你想向组织用户显示的应用名称,可选择任意应用类型,点击「Create」。 -创建 Auth0 应用 S2 + 创建 Auth0 应用 S2 -创建成功后,点击相应的应用,进入应用详情页,切换到「Settings」标签页,就可以看到相应的配置信息 + 创建成功后,点击相应的应用,进入应用详情页,切换到「Settings」标签页,就可以看到相应的配置信息 -创建 Auth0 应用 S3 + 创建 Auth0 应用 S3 -在应用配置页面中,还需要配置 Allowed Callback URLs,在此处填写: + 在应用配置页面中,还需要配置 Allowed Callback URLs,在此处填写: -```bash -http(s)://your-domain/api/auth/callback/auth0 -``` + ```bash + http(s)://your-domain/api/auth/callback/auth0 + ``` -创建 Auth0 应用 S4 + 创建 Auth0 应用 S4 - - 可以在部署后再填写或修改 Allowed Callback URLs,但是务必保证填写的 URL 与部署的 URL 一致 - + + 可以在部署后再填写或修改 Allowed Callback URLs,但是务必保证填写的 URL 与部署的 URL 一致 + -### 新增用户 + ### 新增用户 -点击左侧导航栏的「Users Management」,进入用户管理界面,可以为你的组织新建用户,用以登录 LobeChat + 点击左侧导航栏的「Users Management」,进入用户管理界面,可以为你的组织新建用户,用以登录 LobeChat -新增用户 + 新增用户 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 | -| `AUTH_AUTH0_ID` | 必选 | Auth0 应用程序的 Client ID | -| `AUTH_AUTH0_SECRET` | 必选 | Auth0 应用程序的 Client Secret | -| `AUTH_AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain,`https://example.auth0.com` | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 | + | `AUTH_AUTH0_ID` | 必选 | Auth0 应用程序的 Client ID | + | `AUTH_AUTH0_SECRET` | 必选 | Auth0 应用程序的 Client Secret | + | `AUTH_AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain,`https://example.auth0.com` | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#auth-0) 可查阅相关变量详情。 - - + @@ -96,19 +75,13 @@ http(s)://your-domain/api/auth/callback/auth0 Auth0 支持 Azure Active Directory / Slack / Google Workspace / Office 365 / Zoom 等单点登录服务,详细支持列表可参考 [这里](https://marketplace.auth0.com/features/sso-integrations) -Connecting to an Existing Single Sign-On Service +Connecting to an Existing Single Sign-On Service ### 配置社交登录 如果你的企业或组织需要支持外部人员登录,可以在 Authentication -> Social 中,配置社交登录服务。 -Configuring Social Login +Configuring Social Login 配置社交登录服务默认会允许所有人通过认证,这可能会导致 LobeChat 被外部人员滥用。 diff --git a/docs/self-hosting/advanced/auth/next-auth/authelia.mdx b/docs/self-hosting/advanced/auth/next-auth/authelia.mdx index a666405d0b99..f599ba08a36b 100644 --- a/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/authelia.mdx @@ -17,54 +17,54 @@ tags: ## Authelia Configuration Flow -### Create an Authelia Identity Provider + ### Create an Authelia Identity Provider -We assume you are already familiar with using Authelia. Let's say your LobeChat instance is deployed at https://lobe.example.com/. Note that currently only localhost supports HTTP access; other domains need to enable TLS, otherwise Authelia will actively interrupt authentication by default. + We assume you are already familiar with using Authelia. Let's say your LobeChat instance is deployed at [https://lobe.example.com/](https://lobe.example.com/). Note that currently only localhost supports HTTP access; other domains need to enable TLS, otherwise Authelia will actively interrupt authentication by default. -Now, let's open and edit the configuration file of your Authelia instance: + Now, let's open and edit the configuration file of your Authelia instance: -Add a new lobe-chat item under identity_providers -> oidc: + Add a new lobe-chat item under `identity_providers` -> `oidc`: -```yaml -identity_providers: - oidc: - ... - ## The other portions of the mandatory OpenID Connect 1.0 configuration go here. - ## See: https://www.authelia.com/c/oidc - - id: lobe-chat - description: LobeChat - secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'. - public: false - authorization_policy: two_factor - redirect_uris: - - https://chat.example.com/api/auth/callback/authelia - scopes: - - openid - - profile - - email - userinfo_signing_algorithm: none -``` + ```yaml + identity_providers: + oidc: + ... + ## The other portions of the mandatory OpenID Connect 1.0 configuration go here. + ## See: https://www.authelia.com/c/oidc + - id: lobe-chat + description: LobeChat + secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'. + public: false + authorization_policy: two_factor + redirect_uris: + - https://chat.example.com/api/auth/callback/authelia + scopes: + - openid + - profile + - email + userinfo_signing_algorithm: none + ``` -Make sure to replace secret and redirect_urls with your own values. Note! The secret configured in Authelia is ciphertext, i.e., a salted hash value. Its corresponding plaintext needs to be filled in LobeChat later. + Make sure to replace secret and `redirect_urls` with your own values. Note! The secret configured in Authelia is ciphertext, i.e., a salted hash value. Its corresponding plaintext needs to be filled in LobeChat later. -Save the configuration file and restart the Authelia service. Now we have completed the Authelia configuration. + Save the configuration file and restart the Authelia service. Now we have completed the Authelia configuration. -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. | -| `AUTH_AUTHELIA_ID` | Required | The id just configured in Authelia, example value is lobe-chat | -| `AUTH_AUTHELIA_SECRET` | Required | The plaintext corresponding to the secret just configured in Authelia, example value is insecure_secret | -| `AUTH_AUTHELIA_ISSUER` | Required | Your Authelia URL, for example https://sso.example.com | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth verification. It only needs to be set when the default generated redirect address is incorrect. https://chat.example.com/api/auth | + | Environment Variable | Type | Description | + | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. | + | `AUTH_AUTHELIA_ID` | Required | The id just configured in Authelia, example value is lobe-chat | + | `AUTH_AUTHELIA_SECRET` | Required | The plaintext corresponding to the secret just configured in Authelia, example value is `insecure_secret` | + | `AUTH_AUTHELIA_ISSUER` | Required | Your Authelia URL, for example [https://sso.example.com](https://sso.example.com) | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth verification. It only needs to be set when the default generated redirect address is incorrect. [https://chat.example.com/api/auth](https://chat.example.com/api/auth) | - - Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authelia) for details about the variables. - + + Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authelia) for details about the variables. + diff --git a/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx index 906a992cc6b8..19e6dd89266e 100644 --- a/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx @@ -14,56 +14,55 @@ tags: ## Authelia 配置流程 -### 创建 Authelia 提供应用 + ### 创建 Authelia 提供应用 -我们现在默认您已经了解了如何使用 Authelia。假设您的 LobeChat 实例部署在 `https://lobe.example.com/` 中。注意,目前只有 `localhost` 支持 HTTP 访问,其他域名需要启用 TLS,否则 Authelia 默认将主动中断身份认证。 + 我们现在默认您已经了解了如何使用 Authelia。假设您的 LobeChat 实例部署在 `https://lobe.example.com/` 中。注意,目前只有 `localhost` 支持 HTTP 访问,其他域名需要启用 TLS,否则 Authelia 默认将主动中断身份认证。 -现在,我们打开 Authelia 实例的配置文件进行编辑: + 现在,我们打开 Authelia 实例的配置文件进行编辑: -在 `identity_providers`-> `oidc` 下新增一个 `lobe-chat` 的项目: + 在 `identity_providers`-> `oidc` 下新增一个 `lobe-chat` 的项目: -```yaml -... -identity_providers: - oidc: - ... - ## The other portions of the mandatory OpenID Connect 1.0 configuration go here. - ## See: https://www.authelia.com/c/oidc - - id: lobe-chat - description: LobeChat - secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'. - public: false - authorization_policy: two_factor - redirect_uris: - - https://chat.example.com/api/auth/callback/authelia - scopes: - - openid - - profile - - email - userinfo_signing_algorithm: none -``` + ```yaml + ... + identity_providers: + oidc: + ... + ## The other portions of the mandatory OpenID Connect 1.0 configuration go here. + ## See: https://www.authelia.com/c/oidc + - id: lobe-chat + description: LobeChat + secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'. + public: false + authorization_policy: two_factor + redirect_uris: + - https://chat.example.com/api/auth/callback/authelia + scopes: + - openid + - profile + - email + userinfo_signing_algorithm: none + ``` -请您确保 `secret` 和 `redirect_urls` 替换成您自己的值。注意!Authelia 中配置 `secret` 是密文,即加盐哈希值。其对应的明文稍后需要填写在 lobeChat 中。 + 请您确保 `secret` 和 `redirect_urls` 替换成您自己的值。注意!Authelia 中配置 `secret` 是密文,即加盐哈希值。其对应的明文稍后需要填写在 lobeChat 中。 -保存配置文件,然后重启 Authelia 服务。现在我们完成了 Authelia 的配置工作。 + 保存配置文件,然后重启 Authelia 服务。现在我们完成了 Authelia 的配置工作。 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authelia 请填写 `authelia`。 | -| `AUTH_AUTHELIA_ID` | 必选 | 刚刚在 Authelia 配置的 `id`,示例值是 `lobe-chat` | -| `AUTH_AUTHELIA_SECRET` | 必选 | 刚刚在 Authelia 配置的 `secret` 对应的明文,示例值是 `insecure_secret` | -| `AUTH_AUTHELIA_ISSUER` | 必选 | 您的 Authelia 的网址,例如 `https://sso.example.com` | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------------ | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authelia 请填写 `authelia`。 | + | `AUTH_AUTHELIA_ID` | 必选 | 刚刚在 Authelia 配置的 `id`,示例值是 `lobe-chat` | + | `AUTH_AUTHELIA_SECRET` | 必选 | 刚刚在 Authelia 配置的 `secret` 对应的明文,示例值是 `insecure_secret` | + | `AUTH_AUTHELIA_ISSUER` | 必选 | 您的 Authelia 的网址,例如 `https://sso.example.com` | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Authelia) 可查阅相关变量详情。 - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/authentik.mdx b/docs/self-hosting/advanced/auth/next-auth/authentik.mdx index fdd6dde35008..e2bc3092c96f 100644 --- a/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/authentik.mdx @@ -19,52 +19,47 @@ tags: ### Create an Authentik Application Provider -In your Authentik instance, use the administrator account to go to **Admin Interface** -> **Applications** -> **Providers** and create a new provider. + In your Authentik instance, use the administrator account to go to **Admin Interface** -> **Applications** -> **Providers** and create a new provider. -Select **OAuth2/OpenID Provider** as the provider type. Fill in the provider name, select the authentication flow and authorization flow. + Select **OAuth2/OpenID Provider** as the provider type. Fill in the provider name, select the authentication flow and authorization flow. -In the `Redirect URL/Origin (regex)` field, fill in: + In the `Redirect URL/Origin (regex)` field, fill in: -```bash -https://your-domain/api/auth/callback/authentik -``` + ```bash + https://your-domain/api/auth/callback/authentik + ``` - - - You can fill in or modify the `Redirect URL/Origin (regex)` later, but make sure the filled in - URL matches the deployed URL. - Replace `your-domain` with your own domain name - + + - You can fill in or modify the `Redirect URL/Origin (regex)` later, but make sure the filled in + URL matches the deployed URL. - Replace `your-domain` with your own domain name + -Create Authentik Provider + Create Authentik Provider -Click **Done** + Click **Done** -After the creation is successful, click **Applications** on the left -> **Create**, fill in the name and Slug, select the provider created in the previous step, and click **Create**. + After the creation is successful, click **Applications** on the left -> **Create**, fill in the name and Slug, select the provider created in the previous step, and click **Create**. -After the application provider is created, click the corresponding provider to enter the details page, click **Edit**, and save the `Client ID` and `Client Secret`. + After the application provider is created, click the corresponding provider to enter the details page, click **Edit**, and save the `Client ID` and `Client Secret`. -Copy the URL of `OpenID Configuration Issuer` and save it. + Copy the URL of `OpenID Configuration Issuer` and save it. -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. | -| `AUTH_AUTHENTIK_ID` | Required | The Client ID from the Authentik application provider details page | -| `AUTH_AUTHENTIK_SECRET` | Required | The Client Secret from the Authentik application provider details page | -| `AUTH_AUTHENTIK_ISSUER` | Required | The OpenID Configuration Issuer from the Authentik application provider details page | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. | + | `AUTH_AUTHENTIK_ID` | Required | The Client ID from the Authentik application provider details page | + | `AUTH_AUTHENTIK_SECRET` | Required | The Client Secret from the Authentik application provider details page | + | `AUTH_AUTHENTIK_ISSUER` | Required | The OpenID Configuration Issuer from the Authentik application provider details page | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` | Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authentik) for details about the variables. - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx index ca5f708dc9d7..e3624c934fa4 100644 --- a/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx @@ -16,50 +16,45 @@ tags: ### 创建 Authentik 提供应用 -在你的 Authentik 实例中使用管理员账号进入 管理员界面 -> 应用程序 -> 提供程序 创建一个新的提供程序。 + 在你的 Authentik 实例中使用管理员账号进入 管理员界面 -> 应用程序 -> 提供程序 创建一个新的提供程序。 -选择 OAuth2/OpenID Provider 作为提供程序类型。填写提供程序的名称,选择身份流程和授权流程。 + 选择 OAuth2/OpenID Provider 作为提供程序类型。填写提供程序的名称,选择身份流程和授权流程。 -在 `重定向 URL/Origin(正则)` 处填写: + 在 `重定向 URL/Origin(正则)` 处填写: -```bash -https://your-domain/api/auth/callback/authentik -``` + ```bash + https://your-domain/api/auth/callback/authentik + ``` - - - 可以之后再填写或修改 `重定向 URL/Origin(正则)`,但是务必保证填写的 URL 与部署的 URL 一致。 - - your-domain 请替换为自己的域名 - + + - 可以之后再填写或修改 `重定向 URL/Origin(正则)`,但是务必保证填写的 URL 与部署的 URL 一致。 - + your-domain 请替换为自己的域名 + -创建 Authentik 提供程序 + 创建 Authentik 提供程序 -点击「完成」 + 点击「完成」 -创建成功后,点击左侧的「应用程序」-> 创建,填写名称和 Slug ,提供程序选择上一步创建的提供程序,点击「创建」。 + 创建成功后,点击左侧的「应用程序」-> 创建,填写名称和 Slug ,提供程序选择上一步创建的提供程序,点击「创建」。 -提供程序创建成功后,点击相应的提供程序,进入详情页,点击「编辑」,将 `客户端 ID` 和 `客户端 Secret` 保存下来。复制 `OpenID 配置颁发者` 的 URL,保存下来。 + 提供程序创建成功后,点击相应的提供程序,进入详情页,点击「编辑」,将 `客户端 ID` 和 `客户端 Secret` 保存下来。复制 `OpenID 配置颁发者` 的 URL,保存下来。 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 | -| `AUTH_AUTHENTIK_ID` | 必选 | Authentik 提供程序详情页的 客户端 ID | -| `AUTH_AUTHENTIK_SECRET` | 必选 | Authentik 提供程序详情页的 客户端 Secret | -| `AUTH_AUTHENTIK_ISSUER` | 必选 | Authentik 提供程序详情页的 OpenID 配置颁发者 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 | + | `AUTH_AUTHENTIK_ID` | 必选 | Authentik 提供程序详情页的 客户端 ID | + | `AUTH_AUTHENTIK_SECRET` | 必选 | Authentik 提供程序详情页的 客户端 Secret | + | `AUTH_AUTHENTIK_ISSUER` | 必选 | Authentik 提供程序详情页的 OpenID 配置颁发者 | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Authentik) 可查阅相关变量详情。 - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx b/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx index 64389a567279..b16989425da3 100644 --- a/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx @@ -33,93 +33,92 @@ If you are deploying using a public network, the following assumptions apply: - You privately deploy Casdoor, and its domain is `https://lobe-auth-api.example.com`. + ### Create a Casdoor Application -### Create a Casdoor Application - -Access your privately deployed Casdoor WebUI (default is `http://localhost:8000/`) to enter the console. The default account is `admin`, and the password is `123`. - -Go to `Authentication` -> `Applications`, create a `LobeChat` application or directly modify the built-in `built-in` application. You can explore other fields, but you must configure at least the following fields: - -- Name, Display Name: `LobeChat` -- Redirect URLs: - - Local Development Environment: `http://localhost:3210/api/auth/callback/casdoor` - - Local Network IP Deployment: `http://LOBECHAT_IP:3210/api/auth/callback/casdoor` - - Public Network Environment: `https://lobe.example.com/api/auth/callback/casdoor` - -There are also some optional fields that can enhance user experience: - -- Logo: `https://lobehub.com/icon-192x192.png` -- Form CSS, Form CSS (Mobile): - -```html - -``` -Then, copy the `Client ID` and `Client Secret` and save them. + #parent-area + > main + > div + > div.login-content + > div.login-panel + > div.login-form + > div + > div + > button { + box-shadow: none !important; + border-radius: 10px !important; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; + border: 1px solid #eee !important; + } -### Configure Environment Variables + @media (max-width: 640px) { + .login-panel { + padding: 40px 0 0 0; + box-shadow: none; + } + } -Set the obtained `Client ID` and `Client Secret` as `AUTH_CASDOOR_ID` and `AUTH_CASDOOR_SECRET` in the LobeChat environment variables. + + ``` -Configure `AUTH_CASDOOR_ISSUER` in the LobeChat environment variables as follows: + Then, copy the `Client ID` and `Client Secret` and save them. -- `http://localhost:8000/` if you are in a local development environment. -- `http://CASDOOR_IP:8000/` if you are privately deploying Casdoor in a local network. -- `https://lobe-auth-api.example.com/` if you are deploying Casdoor in a public network environment. + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + Set the obtained `Client ID` and `Client Secret` as `AUTH_CASDOOR_ID` and `AUTH_CASDOOR_SECRET` in the LobeChat environment variables. -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | A key for encrypting Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32`. | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. Fill in `casdoor` for using Casdoor. | -| `AUTH_CASDOOR_ID` | Required | The client ID from the Casdoor application details page. | -| `AUTH_CASDOOR_SECRET` | Required | The client secret from the Casdoor application details page. | -| `AUTH_CASDOOR_ISSUER` | Required | The OpenID Connect issuer for the Casdoor provider. | -| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification and needs to be set only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` | + Configure `AUTH_CASDOOR_ISSUER` in the LobeChat environment variables as follows: - - Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#casdoor) for - details on related variables. - + - `http://localhost:8000/` if you are in a local development environment. + - `http://CASDOOR_IP:8000/` if you are privately deploying Casdoor in a local network. + - `https://lobe-auth-api.example.com/` if you are deploying Casdoor in a public network environment. + + When deploying LobeChat, you need to configure the following environment variables: + + | Environment Variable | Type | Description | + | ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | A key for encrypting Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32`. | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. Fill in `casdoor` for using Casdoor. | + | `AUTH_CASDOOR_ID` | Required | The client ID from the Casdoor application details page. | + | `AUTH_CASDOOR_SECRET` | Required | The client secret from the Casdoor application details page. | + | `AUTH_CASDOOR_ISSUER` | Required | The OpenID Connect issuer for the Casdoor provider. | + | `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification and needs to be set only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` | + + Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#casdoor) for + details on related variables. + diff --git a/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx index 3bf3b1e7574a..cff4e9a98532 100644 --- a/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx @@ -30,92 +30,91 @@ tags: - 你私有部署 Casdoor,其域名为 `https://lobe-auth-api.example.com`。 + ### 创建 Casdoor 应用 -### 创建 Casdoor 应用 - -访问你私有部署的 Casdoor WebUI(默认为 `http://localhost:8000/`) 进入控制台,默认账号为 `admin`,密码为 `123`。 - -前往 `身份认证` -> `应用`,创建一个 `LobeChat` 应用或直接修改内置的 `built-in` 应用,其他字段可以自行探索,但你至少需要配置以下字段: - -- 名称、显示名称:`LobeChat` -- 重定向 URLs: - - 本地开发环境:`http://localhost:3210/api/auth/callback/casdoor` - - 局域网 IP 部署:`http://LOBECHAT_IP:3210/api/auth/callback/casdoor` - - 公网环境:`https://lobe.example.com/api/auth/callback/casdoor` - -还有一些不必需但是可以提高用户体验的字段: - -- Logo:`https://lobehub.com/icon-192x192.png` -- 表单 CSS、表单 CSS(移动端): - -```html - -``` -随后,复制 `客户端 ID` 和 `客户端密钥`,并保存。 + #parent-area + > main + > div + > div.login-content + > div.login-panel + > div.login-form + > div + > div + > button { + box-shadow: none !important; + border-radius: 10px !important; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; + border: 1px solid #eee !important; + } + + @media (max-width: 640px) { + .login-panel { + padding: 40px 0 0 0; + box-shadow: none; + } + } + + + ``` -### 配置环境变量 + 随后,复制 `客户端 ID` 和 `客户端密钥`,并保存。 -将获取到的 `客户端 ID` 和 `客户端`,设为 LobeChat 环境变量中的 `AUTH_CASDOOR_ID` 和 `AUTH_CASDOOR_SECRET`。 + ### 配置环境变量 -配置 LobeChat 环境变量中 `AUTH_CASDOOR_ISSUER` 为: + 将获取到的 `客户端 ID` 和 `客户端`,设为 LobeChat 环境变量中的 `AUTH_CASDOOR_ID` 和 `AUTH_CASDOOR_SECRET`。 -- `http://localhost:8000/`,若你是本地开发环境 -- `http://CASDOOR_IP:8000/`,若你是局域网私有部署的 Casdoor -- `https://lobe-auth-api.example.com/`,若你是公网环境部署的 Casdoor + 配置 LobeChat 环境变量中 `AUTH_CASDOOR_ISSUER` 为: -在部署 LobeChat 时,你需要配置以下环境变量: + - `http://localhost:8000/`,若你是本地开发环境 + - `http://CASDOOR_IP:8000/`,若你是局域网私有部署的 Casdoor + - `https://lobe-auth-api.example.com/`,若你是公网环境部署的 Casdoor -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Casdoor 请填写 `casdoor`。 | -| `AUTH_CASDOOR_ID` | 必选 | Casdoor 应用详情页的客户端 ID | -| `AUTH_CASDOOR_SECRET` | 必选 | Casdoor 应用详情页的客户端密钥 | -| `AUTH_CASDOOR_ISSUER` | 必选 | Casdoor 提供程序的 OpenID Connect 颁发者。 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` | + 在部署 LobeChat 时,你需要配置以下环境变量: + + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------------ | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Casdoor 请填写 `casdoor`。 | + | `AUTH_CASDOOR_ID` | 必选 | Casdoor 应用详情页的客户端 ID | + | `AUTH_CASDOOR_SECRET` | 必选 | Casdoor 应用详情页的客户端密钥 | + | `AUTH_CASDOOR_ISSUER` | 必选 | Casdoor 提供程序的 OpenID Connect 颁发者。 | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#casdoor) 可查阅相关变量详情。 - - + 部署成功后,用户将可以通过 Casdoor 身份认证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx b/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx index 46cb1af6109d..1a33ce9e18f0 100644 --- a/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx @@ -17,49 +17,48 @@ tags: ## Cloudflare Zero Trust Configuration Flow -### Creating an Application in Cloudflare Zero Trust + ### Creating an Application in Cloudflare Zero Trust -We assume you are already familiar with using the Cloudflare Zero Trust platform and that your LobeChat instance is deployed at `https://chat.example.com`. + We assume you are already familiar with using the Cloudflare Zero Trust platform and that your LobeChat instance is deployed at `https://chat.example.com`. -First, we need to visit `https://one.dash.cloudflare.com/` and navigate to `Access - Applications`. + First, we need to visit `https://one.dash.cloudflare.com/` and navigate to `Access - Applications`. -![image](https://github.com/user-attachments/assets/4d671a7c-5d94-4c4b-b4fd-71a5a0e9d227) + ![image](https://github.com/user-attachments/assets/4d671a7c-5d94-4c4b-b4fd-71a5a0e9d227) -Now, on the current page, click `Add an application` and select `SaaS`. + Now, on the current page, click `Add an application` and select `SaaS`. -![image](https://github.com/user-attachments/assets/3da4c8c4-88c6-40a9-8005-6a0a44aa3b1f) + ![image](https://github.com/user-attachments/assets/3da4c8c4-88c6-40a9-8005-6a0a44aa3b1f) -In the `Application` text box, enter the application name, such as `LobeChat SSO`. Then click `Select OIDC`, followed by clicking `Add application`. + In the `Application` text box, enter the application name, such as `LobeChat SSO`. Then click `Select OIDC`, followed by clicking `Add application`. -![image](https://github.com/user-attachments/assets/16cd9aef-c87b-48a4-95c0-b666082e7515) + ![image](https://github.com/user-attachments/assets/16cd9aef-c87b-48a4-95c0-b666082e7515) -At this point, you have successfully created a SaaS application named `LobeChat SSO` in Cloudflare Zero Trust. + At this point, you have successfully created a SaaS application named `LobeChat SSO` in Cloudflare Zero Trust. -Next, we need to enter `https://chat.example.com/api/auth/callback/cloudflare-zero-trust` in the `Redirect URLs` field (note that `chat.example.com` should be replaced with your instance's address). + Next, we need to enter `https://chat.example.com/api/auth/callback/cloudflare-zero-trust` in the `Redirect URLs` field (note that `chat.example.com` should be replaced with your instance's address). -![image](https://github.com/user-attachments/assets/433fdce4-0af5-417f-b80d-163c2d4f02f6) + ![image](https://github.com/user-attachments/assets/433fdce4-0af5-417f-b80d-163c2d4f02f6) -Finally, scroll down the page and record the following three values: `Client secret`, `Client ID`, and `Issuer`. You will need these for setting the environment variables when deploying LobeChat. + Finally, scroll down the page and record the following three values: `Client secret`, `Client ID`, and `Issuer`. You will need these for setting the environment variables when deploying LobeChat. -![image](https://github.com/user-attachments/assets/2dd3cde5-fa0d-4f52-b82b-28d9e89379a0) + ![image](https://github.com/user-attachments/assets/2dd3cde5-fa0d-4f52-b82b-28d9e89379a0) -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `cloudflare-zero-trust` for Cloudflare Zero Trust. | -| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | Required | The Client ID from the Cloudflare Zero Trust application provider details page | -| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | Required | The Client Secret from the Cloudflare Zero Trust application provider details page | -| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | Required | The OpenID Configuration Issuer from the Cloudflare Zero Trust application provider details page | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ----------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `cloudflare-zero-trust` for Cloudflare Zero Trust. | + | `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | Required | The Client ID from the Cloudflare Zero Trust application provider details page | + | `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | Required | The Client Secret from the Cloudflare Zero Trust application provider details page | + | `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | Required | The OpenID Configuration Issuer from the Cloudflare Zero Trust application provider details page | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` | Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Cloudflare%20Zero%20Trust) for details about the variables. - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx index 8100b23c400f..492cccc476ac 100644 --- a/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx @@ -16,47 +16,46 @@ tags: ## Cloudflare Zero Trust 配置流程 -### 在 Cloudflare Zero Trust 中创建应用 + ### 在 Cloudflare Zero Trust 中创建应用 -我们现在默认您已经了解了如何使用 Cloudflare Zero Trust 平台且假设您的 LobeChat 实例部署在 `https://chat.example.com` 中。 + 我们现在默认您已经了解了如何使用 Cloudflare Zero Trust 平台且假设您的 LobeChat 实例部署在 `https://chat.example.com` 中。 -首先我们需要访问 `https://one.dash.cloudflare.com/` 并前往 `Access - Applications` 中。 + 首先我们需要访问 `https://one.dash.cloudflare.com/` 并前往 `Access - Applications` 中。 -![image](https://github.com/user-attachments/assets/4d671a7c-5d94-4c4b-b4fd-71a5a0e9d227) + ![image](https://github.com/user-attachments/assets/4d671a7c-5d94-4c4b-b4fd-71a5a0e9d227) -现在,在所在页面点击 `Add an application` 并选择 `SaaS`。 + 现在,在所在页面点击 `Add an application` 并选择 `SaaS`。 -![image](https://github.com/user-attachments/assets/3da4c8c4-88c6-40a9-8005-6a0a44aa3b1f) + ![image](https://github.com/user-attachments/assets/3da4c8c4-88c6-40a9-8005-6a0a44aa3b1f) -在 `Application` 文本框内填入应用名称,如:`LobeChat SSO`,然后点击 `Select OIDC` 后点击 `Add applicaiton` + 在 `Application` 文本框内填入应用名称,如:`LobeChat SSO`,然后点击 `Select OIDC` 后点击 `Add applicaiton` -![image](https://github.com/user-attachments/assets/16cd9aef-c87b-48a4-95c0-b666082e7515) + ![image](https://github.com/user-attachments/assets/16cd9aef-c87b-48a4-95c0-b666082e7515) -至此您已成功在 Clouflare Zero Trust 中创建了一个名为 `LobeChat SSO` 的 SaaS 应用。 + 至此您已成功在 Clouflare Zero Trust 中创建了一个名为 `LobeChat SSO` 的 SaaS 应用。 -接下来我们需要在 `Redirect URLs` 中填入 `https://chat.example.com/api/auth/callback/cloudflare-zero-trust`(注意此处的 `chat.example.com` 需要替换为您的实例地址) ![image](https://github.com/user-attachments/assets/433fdce4-0af5-417f-b80d-163c2d4f02f6) + 接下来我们需要在 `Redirect URLs` 中填入 `https://chat.example.com/api/auth/callback/cloudflare-zero-trust`(注意此处的 `chat.example.com` 需要替换为您的实例地址) ![image](https://github.com/user-attachments/assets/433fdce4-0af5-417f-b80d-163c2d4f02f6) -最后我们将页面往下滚动,您将需要记录以下三个值 `Client secret`, `Client ID` 及 `Issuer` 以备后续部署 LobeChat 环境变量使用。 + 最后我们将页面往下滚动,您将需要记录以下三个值 `Client secret`, `Client ID` 及 `Issuer` 以备后续部署 LobeChat 环境变量使用。 -![image](https://github.com/user-attachments/assets/2dd3cde5-fa0d-4f52-b82b-28d9e89379a0) + ![image](https://github.com/user-attachments/assets/2dd3cde5-fa0d-4f52-b82b-28d9e89379a0) -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Cloudflare Zero Trust 请填写 `cloudflare-zero-trust`。 | -| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client ID`,示例值是 `lobe-chat` | -| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client secret`,示例值是 `insecure_secret` | -| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | 必选 | 在 Cloudflare Zero Trust 生成的 `Issuer`,例如 `https://example.cloudflareaccess.com/cdn-cgi/access/sso/oidc/7db0f` | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ----------------------------------- | -- | ------------------------------------------------------------------------------------------------------------ | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Cloudflare Zero Trust 请填写 `cloudflare-zero-trust`。 | + | `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client ID`,示例值是 `lobe-chat` | + | `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client secret`,示例值是 `insecure_secret` | + | `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | 必选 | 在 Cloudflare Zero Trust 生成的 `Issuer`,例如 `https://example.cloudflareaccess.com/cdn-cgi/access/sso/oidc/7db0f` | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Cloudflare%20Zero%20Trust) 可查阅相关变量详情。 - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/github.mdx b/docs/self-hosting/advanced/auth/next-auth/github.mdx index 4fac6487d2cc..66f635f1d061 100644 --- a/docs/self-hosting/advanced/auth/next-auth/github.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/github.mdx @@ -19,79 +19,52 @@ tags: ### Create a Github Provider -Click [here][github-create-app] to create a new Github App. - -Fill in the Github App name, Homepage URL, and Callback URL. - -Create a Github Provider - -Set the webhook callback URL according to your needs. - -Fill in other fields - -Set the permission to read email addresses. - -Set required permissions -Set permission to read email addresses - -Set whether it is accessible publicly or only accessible to yourself. - -Set whether it is accessible publicly or only accessible to yourself - -Click "Create Github App". - -After successful creation, click "Generate a new client secret" to create a client secret. - -Create a new client secret - -After successful creation, save the `Client ID` and `Client Secret`. - -Create a new client secret - -### Configure Environment Variables - -When deploying LobeChat, you need to configure the following environment variables: - -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. | -| `AUTH_GITHUB_ID` | Required | Client ID in the Github App details page. | -| `AUTH_GITHUB_SECRET` | Required | Client Secret in the Github App details page. | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` | - - - Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#github) for detailed - information on these variables. - + Click [here][github-create-app] to create a new Github App. + + Fill in the Github App name, Homepage URL, and Callback URL. + + Create a Github Provider + + Set the webhook callback URL according to your needs. + + Fill in other fields + + Set the permission to read email addresses. + + Set required permissions + + Set permission to read email addresses + + Set whether it is accessible publicly or only accessible to yourself. + + Set whether it is accessible publicly or only accessible to yourself + + Click "Create Github App". + + After successful creation, click "Generate a new client secret" to create a client secret. + + Create a new client secret + + After successful creation, save the `Client ID` and `Client Secret`. + + Create a new client secret + + ### Configure Environment Variables + + When deploying LobeChat, you need to configure the following environment variables: + + | Environment Variable | Type | Description | + | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. | + | `AUTH_GITHUB_ID` | Required | Client ID in the Github App details page. | + | `AUTH_GITHUB_SECRET` | Required | Client Secret in the Github App details page. | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` | + + + Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#github) for detailed + information on these variables. + diff --git a/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx index 96996d7c81ab..3417cd7acfb0 100644 --- a/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx @@ -16,78 +16,51 @@ tags: ### 创建 Github 提供应用 -点击 [这里](https://github.com/settings/apps/new) 创建一个新的 Github App。 - -填写 Github App name、Homepage URL、Callbak URL - -创建 Github 提供程序 -按照自己所需设置Webhook回调地址 - -填写其他字段 - -设置读取邮件地址权限 - -设置所需权限 -设置读取邮件地址权限 - -设置公开访问还是仅自己访问 - -设置公开访问还是仅自己访问 - -点击「Create Github App」 - -创建成功后,点击「Generate a new client secret」创建客户端Secret - -创建新的客户端密钥 - -创建成功后, 将 `客户端 ID` 和 `客户端 Secret` 保存下来。 - -创建新的客户端密钥 - -### 配置环境变量 - -在部署 LobeChat 时,你需要配置以下环境变量: - -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 | -| `AUTH_GITHUB_ID` | 必选 | Github App详情页的 客户端 ID | -| `AUTH_GITHUB_SECRET` | 必选 | Github App详情页的 客户端 Secret | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + 点击 [这里](https://github.com/settings/apps/new) 创建一个新的 Github App。 + + 填写 Github App name、Homepage URL、Callbak URL + + 创建 Github 提供程序 + + 按照自己所需设置 Webhook 回调地址 + + 填写其他字段 + + 设置读取邮件地址权限 + + 设置所需权限 + + 设置读取邮件地址权限 + + 设置公开访问还是仅自己访问 + + 设置公开访问还是仅自己访问 + + 点击「Create Github App」 + + 创建成功后,点击「Generate a new client secret」创建客户端 Secret + + 创建新的客户端密钥 + + 创建成功后, 将 `客户端 ID` 和 `客户端 Secret` 保存下来。 + + 创建新的客户端密钥 + + ### 配置环境变量 + + 在部署 LobeChat 时,你需要配置以下环境变量: + + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 | + | `AUTH_GITHUB_ID` | 必选 | Github App 详情页的 客户端 ID | + | `AUTH_GITHUB_SECRET` | 必选 | Github App 详情页的 客户端 Secret | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#github) 可查阅相关变量详情。 - - + -部署成功后,用户将可以通过Github身份认证并使用 LobeChat。 +部署成功后,用户将可以通过 Github 身份认证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/auth/next-auth/logto.mdx b/docs/self-hosting/advanced/auth/next-auth/logto.mdx index 549864b6274d..d9509d5ee2c0 100644 --- a/docs/self-hosting/advanced/auth/next-auth/logto.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/logto.mdx @@ -31,52 +31,43 @@ If you are using Logto Cloud, assume its endpoint domain is `https://example.log ### Create Logto Application -Access your privately deployed Logto WebUI or [Logto Cloud](http://cloud.logto.io/) to enter the console, and create a `Next.js (App Router)` application under `Applications` with any name. + Access your privately deployed Logto WebUI or [Logto Cloud](http://cloud.logto.io/) to enter the console, and create a `Next.js (App Router)` application under `Applications` with any name. -### Configure Logto + ### Configure Logto -Set the `Redirect URI` to `https://lobe.example.com/api/auth/callback/logto` and the `Post sign-out redirect URI` to `https://lobe.example.com/`. + Set the `Redirect URI` to `https://lobe.example.com/api/auth/callback/logto` and the `Post sign-out redirect URI` to `https://lobe.example.com/`. -Set `CORS allowed origins` to `https://lobe.example.com`. + Set `CORS allowed origins` to `https://lobe.example.com`. -Configure Logto + Configure Logto -After successful creation, save the `Client ID` and `Client Secret`. + After successful creation, save the `Client ID` and `Client Secret`. -### Configure Environment Variables + ### Configure Environment Variables -Configure Environment Variables + Configure Environment Variables -Set the obtained `Client ID` and `Client Secret` as `AUTH_LOGTO_ID` and `AUTH_LOGTO_SECRET` in the LobeChat environment variables. + Set the obtained `Client ID` and `Client Secret` as `AUTH_LOGTO_ID` and `AUTH_LOGTO_SECRET` in the LobeChat environment variables. -Configure `AUTH_LOGTO_ISSUER` in the LobeChat environment variables as follows: + Configure `AUTH_LOGTO_ISSUER` in the LobeChat environment variables as follows: -- `https://lobe-auth-api.example.com/oidc` if you are using a privately deployed Logto -- `https://example.logto.app/oidc` if you are using Logto Cloud + - `https://lobe-auth-api.example.com/oidc` if you are using a privately deployed Logto + - `https://example.logto.app/oidc` if you are using Logto Cloud -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. For Logto, enter `logto`. | -| `AUTH_LOGTO_ID` | Required | The Client ID from the Logto App details page | -| `AUTH_LOGTO_SECRET` | Required | The Client Secret from the Logto App details page | -| `AUTH_LOGTO_ISSUER` | Required | OpenID Connect issuer of the Logto provider | -| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification, needed only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. For Logto, enter `logto`. | + | `AUTH_LOGTO_ID` | Required | The Client ID from the Logto App details page | + | `AUTH_LOGTO_SECRET` | Required | The Client Secret from the Logto App details page | + | `AUTH_LOGTO_ISSUER` | Required | OpenID Connect issuer of the Logto provider | + | `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification, needed only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` | Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#logto) for details on related variables. - - + ### Troubleshooting @@ -84,22 +75,22 @@ When deploying LobeChat, you need to configure the following environment variabl If you encounter issues during the Logto deployment process, refer to the following common problems: - `Only roles with the xxx attribute may create roles`: -Check your database user's permissions and ensure that the user in your Logto database has the `admin` role to create roles. + Check your database user's permissions and ensure that the user in your Logto database has the `admin` role to create roles. - Error executing `logto db seed` on third-party databases like `Neon`: -Try using the `logto db seed --encrypt-base-role` command. + Try using the `logto db seed --encrypt-base-role` command. - Database seeding failed: -Try skipping the seeding process with the `--skip-seed` parameter. + Try skipping the seeding process with the `--skip-seed` parameter. - `Error: role xxx already exists`: -Delete the existing role in the database. + Delete the existing role in the database. - Database migration failed after a version upgrade: -Try using the command `npx @logto/cli db alteration deploy $version` (e.g., `npx @logto/cli db alteration deploy 1.22.0`). + Try using the command `npx @logto/cli db alteration deploy $version` (e.g., `npx @logto/cli db alteration deploy 1.22.0`). - I am using Docker deployment and want a one-click upgrade: -Execute the custom command in the container: `sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start` + Execute the custom command in the container: `sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start` After successful deployment, users will be able to authenticate via Logto and use LobeChat. diff --git a/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx index a97d2031a118..6c43209b0af7 100644 --- a/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx @@ -28,52 +28,43 @@ tags: ### 创建 Logto 应用 -访问你私有部署的 Logto WebUI 或者 [Logto Cloud](http://cloud.logto.io/) 进入控制台,在 `Applications` 里创建一个 `Next.js (App Router)` 应用,名称随意 + 访问你私有部署的 Logto WebUI 或者 [Logto Cloud](http://cloud.logto.io/) 进入控制台,在 `Applications` 里创建一个 `Next.js (App Router)` 应用,名称随意 -### 配置 Logto + ### 配置 Logto -配置 `Redirect URI` 为 `https://lobe.example.com/api/auth/callback/logto`,`Post sign-out redirect URI` 为 `https://lobe.example.com/` + 配置 `Redirect URI` 为 `https://lobe.example.com/api/auth/callback/logto`,`Post sign-out redirect URI` 为 `https://lobe.example.com/` -配置 `CORS allowed origins` 为 `https://lobe.example.com` + 配置 `CORS allowed origins` 为 `https://lobe.example.com` -配置 Logto + 配置 Logto -创建成功后, 将 `Client ID` 和 `Client Secret` 保存下来。 + 创建成功后, 将 `Client ID` 和 `Client Secret` 保存下来。 -### 配置环境变量 + ### 配置环境变量 -配置环境变量 + 配置环境变量 -将获取到的 `Client ID` 和 `Client Secret`,设为 LobeChat 环境变量中的 `AUTH_LOGTO_ID` 和 `AUTH_LOGTO_SECRET`。 + 将获取到的 `Client ID` 和 `Client Secret`,设为 LobeChat 环境变量中的 `AUTH_LOGTO_ID` 和 `AUTH_LOGTO_SECRET`。 -配置 LobeChat 环境变量中 `AUTH_LOGTO_ISSUER` 为: + 配置 LobeChat 环境变量中 `AUTH_LOGTO_ISSUER` 为: -- `https://lobe-auth-api.example.com/oidc`,若你是私有部署的 Logto -- `https://example.logto.app/oidc`,若你是使用的 Logto Cloud + - `https://lobe-auth-api.example.com/oidc`,若你是私有部署的 Logto + - `https://example.logto.app/oidc`,若你是使用的 Logto Cloud -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Logto 请填写 `logto`。 | -| `AUTH_LOGTO_ID` | 必选 | Logto App 详情页的 Client ID | -| `AUTH_LOGTO_SECRET` | 必选 | Logto App 详情页的 Client Secret | -| `AUTH_LOGTO_ISSUER` | 必选 | Logto 提供程序的 OpenID Connect 颁发者 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------------ | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Logto 请填写 `logto`。 | + | `AUTH_LOGTO_ID` | 必选 | Logto App 详情页的 Client ID | + | `AUTH_LOGTO_SECRET` | 必选 | Logto App 详情页的 Client Secret | + | `AUTH_LOGTO_ISSUER` | 必选 | Logto 提供程序的 OpenID Connect 颁发者 | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#logto) 可查阅相关变量详情。 - - + ### 故障排除 @@ -81,21 +72,21 @@ tags: 若你在部署 Logto 过程中遇到问题,可以参考以下常见问题: - `Only roles with the xxx attribute may create roles`: -请检查你的数据库用户权限,确保你的 Logto 数据库中的用户具有 `admin` 角色,以便创建角色。 + 请检查你的数据库用户权限,确保你的 Logto 数据库中的用户具有 `admin` 角色,以便创建角色。 - 在第三方数据库例如 `Neon` 上执行`logto db seed`出错: -尝试使用`logto db seed --encrypt-base-role`命令。 + 尝试使用`logto db seed --encrypt-base-role`命令。 - 数据库播种失败: -请尝试使用`--skip-seed`参数跳过播种。 + 请尝试使用`--skip-seed`参数跳过播种。 - `Error: role xxx already exists`: -在数据库中删除已存在的角色即可。 + 在数据库中删除已存在的角色即可。 - 版本升级后,数据库迁移失败: -请尝试使用` npx @logto/cli db alteration deploy $version`命令(例如`npx @logto/cli db alteration deploy 1.22.0`) + 请尝试使用` npx @logto/cli db alteration deploy $version`命令 (例如`npx @logto/cli db alteration deploy 1.22.0`) - 我使用 docker 部署 希望一键升级: -在容器中执行自定义命令:`sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start` + 在容器中执行自定义命令:`sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start` 部署成功后,用户将可以通过 Logto 身份认证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx index 6a6ca7bf2a5a..a16c4b542236 100644 --- a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx @@ -18,72 +18,59 @@ tags: ### Create a Microsoft Entra ID Application -In your [Microsoft Azure Portal][microsoft-azure-portal], go to Microsoft Entra ID -> App registrations -> New registration to create a new application. + In your [Microsoft Azure Portal][microsoft-azure-portal], go to Microsoft Entra ID -> App registrations -> New registration to create a new application. -Fill in the desired application name to be displayed to organizational users, choose the account types you wish to support, and if only internal users are supported, select `Accounts in this organizational directory only (Default Directory only - Single tenant)`. + Fill in the desired application name to be displayed to organizational users, choose the account types you wish to support, and if only internal users are supported, select `Accounts in this organizational directory only (Default Directory only - Single tenant)`. -In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter: + In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter: -```bash -https://your-domain/api/auth/callback/microsoft-entra-id -``` + ```bash + https://your-domain/api/auth/callback/microsoft-entra-id + ``` - - - You can fill in or modify the Redirect URIs after registering, but make sure the URL you enter - matches the deployed URL. - Please replace "your-domain" with your own domain. - - -App Register + + - You can fill in or modify the Redirect URIs after registering, but make sure the URL you enter + matches the deployed URL. - Please replace "your-domain" with your own domain. + -Click on "Register". + App Register -After successfully creating the application, click on the corresponding application to enter the application details page, and switch to the "Overview" tab to view the corresponding configuration information. + Click on "Register". -App Overview + After successfully creating the application, click on the corresponding application to enter the application details page, and switch to the "Overview" tab to view the corresponding configuration information. -Go to "Certificates & secrets", select the "Client secrets" tab, click on "New client secret", fill in the description, select the expiration time, and click on "Add" to create a new client secret. + App Overview -Create App Client Secret + Go to "Certificates & secrets", select the "Client secrets" tab, click on "New client secret", fill in the description, select the expiration time, and click on "Add" to create a new client secret. - - Please make sure to save your client secret as this is your only chance to view it. - + Create App Client Secret -### Add Users + + Please make sure to save your client secret as this is your only chance to view it. + -Go back to the "Microsoft Entra ID" interface, enter "Users", click on "New user", fill in the user information, and click on "Create" to create a user for using LobeChat. + ### Add Users -### Configure Environment Variables + Go back to the "Microsoft Entra ID" interface, enter "Users", click on "New user", fill in the user information, and click on "Create" to create a user for using LobeChat. -When deploying LobeChat, you need to configure the following environment variables: + ### Configure Environment Variables -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `microsoft-entra-id` for Microsoft Entra ID. | -| `AUTH_MICROSOFT_ENTRA_ID_ID` | Required | Client ID of the Microsoft Entra ID application. | -| `AUTH_MICROSOFT_ENTRA_ID_SECRET` | Required | Client Secret of the Microsoft Entra ID application. | -| `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` | + When deploying LobeChat, you need to configure the following environment variables: - - You can refer to [📘 environment - variables](/docs/self-hosting/environment-variable#microsoft-entra-id) for details on related - variables. - + | Environment Variable | Type | Description | + | ----------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `microsoft-entra-id` for Microsoft Entra ID. | + | `AUTH_MICROSOFT_ENTRA_ID_ID` | Required | Client ID of the Microsoft Entra ID application. | + | `AUTH_MICROSOFT_ENTRA_ID_SECRET` | Required | Client Secret of the Microsoft Entra ID application. | + | `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` | + + You can refer to [📘 environment + variables](/docs/self-hosting/environment-variable#microsoft-entra-id) for details on related + variables. + diff --git a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx index 276268abebf6..5df442de8663 100644 --- a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx @@ -17,68 +17,55 @@ tags: ### 创建 Microsoft Entra ID 应用 -在你的 [Microsoft Azure Portal][microsoft-azure-portal] 进入 Microsoft Entra ID -> App registrations -> New registration 创建一个新的应用。 + 在你的 [Microsoft Azure Portal][microsoft-azure-portal] 进入 Microsoft Entra ID -> App registrations -> New registration 创建一个新的应用。 -填写你想向组织用户显示的应用名称,选择你期望支持的账户类型,如果只支持内部用户请选择 `Accounts in this organizational directory only (Default Directory only - Single tenant)`。 + 填写你想向组织用户显示的应用名称,选择你期望支持的账户类型,如果只支持内部用户请选择 `Accounts in this organizational directory only (Default Directory only - Single tenant)`。 -在 `Redirect URI (optional)` 中,应用类型选择 `Web`,Callback URL, 处填写: + 在 `Redirect URI (optional)` 中,应用类型选择 `Web`,Callback URL, 处填写: -```bash -https://your-domain/api/auth/callback/microsoft-entra-id -``` + ```bash + https://your-domain/api/auth/callback/microsoft-entra-id + ``` - - - 可以在 Register 后再填写或修改 Redirect URIs,但是务必保证填写的 URL 与部署的 URL 一致。 - - your-domain 请填写自己的域名 - + + - 可以在 Register 后再填写或修改 Redirect URIs,但是务必保证填写的 URL 与部署的 URL 一致。 - + your-domain 请填写自己的域名 + -App Register + App Register -点击「Register」 + 点击「Register」 -创建成功后,点击相应的应用,进入应用详情页,切换到「Overview」标签页,就可以看到相应的配置信息。 + 创建成功后,点击相应的应用,进入应用详情页,切换到「Overview」标签页,就可以看到相应的配置信息。 -App Overview + App Overview -进入「Certificates & secrets」,选择「Client secrets」标签,点击「New client secret」,填写描述,选择过期时间,点击「Add」,创建一个新的客户端密钥。 + 进入「Certificates & secrets」,选择「Client secrets」标签,点击「New client secret」,填写描述,选择过期时间,点击「Add」,创建一个新的客户端密钥。 -Create App Client Secret + Create App Client Secret -请务必保存好你的客户端密钥,因为这是你唯一的机会查看它。 + 请务必保存好你的客户端密钥,因为这是你唯一的机会查看它。 -### 新增用户 + ### 新增用户 -回到「Microsoft Entra ID」界面,进入「Users」,点击「New user」,填写用户信息,点击「Create」,创建用户以使用 LobeChat。 + 回到「Microsoft Entra ID」界面,进入「Users」,点击「New user」,填写用户信息,点击「Create」,创建用户以使用 LobeChat。 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `microsoft-entra-id`。 | -| `AUTH_MICROSOFT_ENTRA_ID_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID | -| `AUTH_MICROSOFT_ENTRA_ID_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret | -| `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ----------------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `microsoft-entra-id`。 | + | `AUTH_MICROSOFT_ENTRA_ID_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID | + | `AUTH_MICROSOFT_ENTRA_ID_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret | + | `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#microsoft-entra-id) 可查阅相关变量详情。 - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/wechat.mdx b/docs/self-hosting/advanced/auth/next-auth/wechat.mdx index bff736904ede..adc9e8444710 100644 --- a/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/wechat.mdx @@ -18,28 +18,27 @@ tags: ### Create a Wechat Application -Click [here](https://open.weixin.qq.com/cgi-bin/index) and then click "Management Center", "Website Application", and "Create Website Application" in sequence. + Click [here](https://open.weixin.qq.com/cgi-bin/index) and then click "Management Center", "Website Application", and "Create Website Application" in sequence. -Fill in the information as required by the official website prompts and submit for review. + Fill in the information as required by the official website prompts and submit for review. -After successful creation, click "Application Details" to obtain the AppID and AppSecret. + After successful creation, click "Application Details" to obtain the AppID and AppSecret. -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. | -| `WECHAT_CLIENT_ID` | Required | Client ID from the Wechat website application details page | -| `WECHAT_CLIENT_SECRET` | Required | Client Secret from the Wechat website application details page | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. | + | `WECHAT_CLIENT_ID` | Required | Client ID from the Wechat website application details page | + | `WECHAT_CLIENT_SECRET` | Required | Client Secret from the Wechat website application details page | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` | Go to [📘 Environment Variables](/en/docs/self-hosting/environment-variables/auth#wechat) for more details about related variables. - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx index 24e25ad136ea..8c710c27d686 100644 --- a/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx @@ -11,33 +11,32 @@ tags: # 配置微信身份验证服务 -##微信配置流程 +\## 微信配置流程 ### 创建微信网站应用 -点击 [这里](https://open.weixin.qq.com/cgi-bin/index) 依次点击“管理中心”、“网站应用”、“创建网站应用” + 点击 [这里](https://open.weixin.qq.com/cgi-bin/index) 依次点击 “管理中心”、“网站应用”、“创建网站应用” -按照管网提示要求填写信息并提交审核。 + 按照管网提示要求填写信息并提交审核。 -创建成功后,点击“应用详情”,可获知AppID和AppSecret。 + 创建成功后,点击 “应用详情”,可获知 AppID 和 AppSecret。 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 | -| `WECHAT_CLIENT_ID` | 必选 |微信网站应用详情页的 客户端 ID | -| `WECHAT_CLIENT_SECRET` | 必选 |微信网站应用详情页的 客户端 Secret | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 | + | `WECHAT_CLIENT_ID` | 必选 | 微信网站应用详情页的 客户端 ID | + | `WECHAT_CLIENT_SECRET` | 必选 | 微信网站应用详情页的 客户端 Secret | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#wechat) 可查阅相关变量详情。 - - + 部署成功后,用户将可以通过微信开放平台身份认证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx b/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx index cb2395680e65..f9a0747c6417 100644 --- a/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx @@ -17,99 +17,65 @@ tags: ### Create ZITADEL Application -Log in to the console of your ZITADEL instance using an account with at least a [`Project Owner` role](https://zitadel.com/docs/guides/manage/console/managers#roles), navigate to (or [create](https://zitadel.com/docs/guides/manage/console/projects#create-a-project)) the project you'd like to host your application in, and click the **New** button to create an application. + Log in to the console of your ZITADEL instance using an account with at least a [`Project Owner` role](https://zitadel.com/docs/guides/manage/console/managers#roles), navigate to (or [create](https://zitadel.com/docs/guides/manage/console/projects#create-a-project)) the project you'd like to host your application in, and click the **New** button to create an application. -Create ZITADEL Application S1 + Create ZITADEL Application S1 -Fill in the name, choose **Web** as the application type, and click **Continue**. + Fill in the name, choose **Web** as the application type, and click **Continue**. -Create ZITADEL Application S2 + Create ZITADEL Application S2 -Choose **Code** as the authentication method. + Choose **Code** as the authentication method. -Create ZITADEL Application S3 + Create ZITADEL Application S3 -In the **Redirect URIs** field, fill in: + In the **Redirect URIs** field, fill in: -``` -http(s)://your-domain/api/auth/callback/zitadel -``` + ``` + http(s)://your-domain/api/auth/callback/zitadel + ``` -Create ZITADEL Application S4 + Create ZITADEL Application S4 - - - You can fill in or modify redirect URIs after creating the application, but make sure the filled - URL is consistent with the deployed URL. + + - You can fill in or modify redirect URIs after creating the application, but make sure the filled + URL is consistent with the deployed URL. -- Replace `http(s)://your-domain` with the actual URL that LobeChat is deployed to. + - Replace `http(s)://your-domain` with the actual URL that LobeChat is deployed to. + - - -Confirm the configuration and click **Create**. + Confirm the configuration and click **Create**. -Create ZITADEL Application S5 + Create ZITADEL Application S5 -Save the **ClientId** and **ClientSecret** for later use. + Save the **ClientId** and **ClientSecret** for later use. -Create ZITADEL Application S6 + Create ZITADEL Application S6 -In the application settings page, navigate to the **Token Settings** tab, enable **User Info inside ID Token** option, and click **Save**. + In the application settings page, navigate to the **Token Settings** tab, enable **User Info inside ID Token** option, and click **Save**. -Create ZITADEL Application S7 + Create ZITADEL Application S7 -Navigate to the **URLs** tab, and save the **issuer** URL. + Navigate to the **URLs** tab, and save the **issuer** URL. -Create ZITADEL Application S8 + Create ZITADEL Application S8 -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. | -| `AUTH_ZITADEL_ID` | Required | Client ID (`ClientId` as shown in ZITADEL) of the ZITADEL application | -| `AUTH_ZITADEL_SECRET` | Required | Client Secret (`ClientSecret` as shown in ZITADEL) of the ZITADEL application | -| `AUTH_ZITADEL_ISSUER` | Required | Issuer URL of the ZITADEL application | -| `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. | + | `AUTH_ZITADEL_ID` | Required | Client ID (`ClientId` as shown in ZITADEL) of the ZITADEL application | + | `AUTH_ZITADEL_SECRET` | Required | Client Secret (`ClientSecret` as shown in ZITADEL) of the ZITADEL application | + | `AUTH_ZITADEL_ISSUER` | Required | Issuer URL of the ZITADEL application | + | `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variables/auth#zitadel). - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx index 5599247c4c02..499afb9cc5d1 100644 --- a/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx @@ -14,98 +14,64 @@ tags: ### 创建 ZITADEL 应用 -使用具有 [`Project Owner` 角色](https://zitadel.com/docs/guides/manage/console/managers#roles)的账户登录到 ZITADEL 实例控制台,进入(或[创建](https://zitadel.com/docs/guides/manage/console/projects#create-a-project))该应用所属的项目,点击「创建」按钮创建应用。 + 使用具有 [`Project Owner` 角色](https://zitadel.com/docs/guides/manage/console/managers#roles)的账户登录到 ZITADEL 实例控制台,进入(或[创建](https://zitadel.com/docs/guides/manage/console/projects#create-a-project))该应用所属的项目,点击「创建」按钮创建应用。 -创建 ZITADEL 应用 1 + 创建 ZITADEL 应用 1 -填写应用名称,应用类型选择「Web」,点击「继续」。 + 填写应用名称,应用类型选择「Web」,点击「继续」。 -创建 ZITADEL 应用 2 + 创建 ZITADEL 应用 2 -选择「Code」作为身份验证方式。 + 选择「Code」作为身份验证方式。 -创建 ZITADEL 应用 3 + 创建 ZITADEL 应用 3 -在「重定向 URLs」字段中填写: + 在「重定向 URLs」字段中填写: -``` -http(s)://your-domain/api/auth/callback/zitadel -``` + ``` + http(s)://your-domain/api/auth/callback/zitadel + ``` -创建 ZITADEL 应用 4 + 创建 ZITADEL 应用 4 - - - 可以创建应用后再填写或修改重定向 URL,但请确保填写的 URL 与部署的 URL 一致。 + + - 可以创建应用后再填写或修改重定向 URL,但请确保填写的 URL 与部署的 URL 一致。 -- 请将 `http(s)://your-domain` 替换为 LobeChat 部署的实际 URL。 + - 请将 `http(s)://your-domain` 替换为 LobeChat 部署的实际 URL。 + - + 确认配置并点击「创建」。 -确认配置并点击「创建」。 + 创建 ZITADEL 应用 5 -创建 ZITADEL 应用 5 + 记录下「ClientId」和「ClientSecret」备用。 -记录下「ClientId」和「ClientSecret」备用。 + 创建 ZITADEL 应用 6 -创建 ZITADEL 应用 6 + 在应用设置页面中,切换到「令牌设置」选项卡,勾选「在 ID Token 中包含用户信息」选项,点击「保存」。 -在应用设置页面中,切换到「令牌设置」选项卡,勾选「在 ID Token 中包含用户信息」选项,点击「保存」。 + 创建 ZITADEL 应用 7 -创建 ZITADEL 应用 7 + 切换到「URLs」选项卡,记录下「issuer」URL。 -切换到「URLs」选项卡,记录下「issuer」URL。 + 创建 ZITADEL 应用 8 -创建 ZITADEL 应用 8 + ### 配置环境变量 -### 配置环境变量 + 部署 LobeChat 时,您需要配置以下环境变量: -部署 LobeChat 时,您需要配置以下环境变量: - -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 为 LobeChat 选择单点登录提供程序。对于 ZITADEL,请填写 `zitadel`。 | -| `AUTH_ZITADEL_ID` | 必选 | ZITADEL 应用的 Client ID(`ClientId`)。 | -| `AUTH_ZITADEL_SECRET` | 必选 | ZITADEL 应用的 Client Secret(`ClientSecret`)。 | -| `AUTH_ZITADEL_ISSUER` | 必选 | ZITADEL 应用的 OpenID Connect 颁发者(issuer)URL。 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 中执行 OAuth 认证的回调地址。仅当默认地址不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ----------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 为 LobeChat 选择单点登录提供程序。对于 ZITADEL,请填写 `zitadel`。 | + | `AUTH_ZITADEL_ID` | 必选 | ZITADEL 应用的 Client ID(`ClientId`)。 | + | `AUTH_ZITADEL_SECRET` | 必选 | ZITADEL 应用的 Client Secret(`ClientSecret`)。 | + | `AUTH_ZITADEL_ISSUER` | 必选 | ZITADEL 应用的 OpenID Connect 颁发者(issuer)URL。 | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 中执行 OAuth 认证的回调地址。仅当默认地址不正确时才需要设置。`https://example.com/api/auth` | 您可以在 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#zitadel) 中查看相关变量的详细信息。 - - + 部署成功后,用户将能够通过 ZITADEL 中配置的用户进行身份验证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/feature-flags.zh-CN.mdx b/docs/self-hosting/advanced/feature-flags.zh-CN.mdx index a3933fe93a55..14f5a08db4b0 100644 --- a/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +++ b/docs/self-hosting/advanced/feature-flags.zh-CN.mdx @@ -28,20 +28,20 @@ tags: 关键字,你需要手动控制所有的功能标志(否则它们会采用对应的默认值)。 -| 配置项 | 解释 | 默认值 | -| ------------------------- | -------------------------------- | ------ | -| `webrtc_sync` | 启用 WebRTC 同步功能。 | 关闭 | -| `language_model_settings` | 启用语言模型设置。 | 开启 | -| `openai_api_key` | 允许用户自定义 OpenAI API Key。 | 开启 | -| `openai_proxy_url` | 允许用户自定义 OpenAI 代理 URL。 | 开启 | -| `create_session` | 允许用户创建会话。 | 开启 | -| `edit_agent` | 允许用户编辑助手。 | 开启 | -| `dalle` | 启用 DALL-E 功能。 | 开启 | -| `check_updates` | 允许检查更新。 | 开启 | -| `welcome_suggest` | 显示欢迎建议。 | 开启 | -| `market` | 启用助手市场功能。 | 开启 | -| `speech_to_text` | 启用语音转文本功能。 | 开启 | -| `knowledge_base` | 启用知识库功能。 | 开启 | -| `clerk_sign_up` | 启用Clerk注册功能。 | 开启 | +| 配置项 | 解释 | 默认值 | +| ------------------------- | ----------------------- | --- | +| `webrtc_sync` | 启用 WebRTC 同步功能。 | 关闭 | +| `language_model_settings` | 启用语言模型设置。 | 开启 | +| `openai_api_key` | 允许用户自定义 OpenAI API Key。 | 开启 | +| `openai_proxy_url` | 允许用户自定义 OpenAI 代理 URL。 | 开启 | +| `create_session` | 允许用户创建会话。 | 开启 | +| `edit_agent` | 允许用户编辑助手。 | 开启 | +| `dalle` | 启用 DALL-E 功能。 | 开启 | +| `check_updates` | 允许检查更新。 | 开启 | +| `welcome_suggest` | 显示欢迎建议。 | 开启 | +| `market` | 启用助手市场功能。 | 开启 | +| `speech_to_text` | 启用语音转文本功能。 | 开启 | +| `knowledge_base` | 启用知识库功能。 | 开启 | +| `clerk_sign_up` | 启用 Clerk 注册功能。 | 开启 | 你可以随时检查 [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) 以获取最新的特性标志列表。 diff --git a/docs/self-hosting/advanced/knowledge-base.mdx b/docs/self-hosting/advanced/knowledge-base.mdx index 219bf38af4c7..f1bbd2f24c0a 100644 --- a/docs/self-hosting/advanced/knowledge-base.mdx +++ b/docs/self-hosting/advanced/knowledge-base.mdx @@ -1,3 +1,16 @@ +--- +title: LobeChat Knowledge Base / File Upload +description: >- + Explore LobeChat's file upload and knowledge base management features with + core components. +tags: + - LobeChat + - File Upload + - Knowledge Base + - PostgreSQL + - OpenAI Embedding +--- + # Knowledge Base / File Upload LobeChat supports file upload and knowledge base management. This feature relies on the following core technical components. Understanding these components will help you successfully deploy and maintain the knowledge base system. @@ -32,9 +45,7 @@ S3 (or S3-compatible storage services) is used for storing uploaded files. OpenAI's Embedding service is used to convert text into vector representations. - -LobeChat currently uses OpenAI's `text-embedding-3-small` model by default. Ensure your API Key has access to this model. - + LobeChat currently uses OpenAI's `text-embedding-3-small` model by default. Ensure your API Key has access to this model. - **Purpose**: Generate vector representations for semantic search diff --git a/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx b/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx index 075fa57d6581..59cecf36dfce 100644 --- a/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +++ b/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx @@ -1,3 +1,14 @@ +--- +title: LobeChat 知识库 / 文件上传 +description: 了解 LobeChat 的文件上传和知识库管理核心组件,助力成功部署。 +tags: + - LobeChat + - 文件上传 + - 知识库管理 + - PostgreSQL + - OpenAI +--- + # 知识库 / 文件上传 LobeChat 支持文件上传 / 知识库管理。该功能依赖于以下核心技术组件,了解这些组件将有助于你成功部署和维护知识库系统。 @@ -32,9 +43,7 @@ S3(或兼容 S3 协议的存储服务)用于存储上传的文件。 OpenAI 的嵌入(Embedding)服务用于将文本转化为向量表示。 - -LobeChat 当前默认使用 OpenAI `text-embedding-3-small` 模型,请确保你的 API Key 可以访问该模型。 - + LobeChat 当前默认使用 OpenAI `text-embedding-3-small` 模型,请确保你的 API Key 可以访问该模型。 - **用途**:生成文本的向量表示,用于语义搜索 diff --git a/docs/self-hosting/advanced/model-list.zh-CN.mdx b/docs/self-hosting/advanced/model-list.zh-CN.mdx index 6ade0e71e676..657b1a3cbf9b 100644 --- a/docs/self-hosting/advanced/model-list.zh-CN.mdx +++ b/docs/self-hosting/advanced/model-list.zh-CN.mdx @@ -42,8 +42,8 @@ id=displayName 目前支持的扩展能力有: -| --- | 描述 | -| -------- | ------------------------------------ | -| `fc` | 函数调用(function calling) | -| `vision` | 视觉识别 | -| `file` | 文件上传(比较hack,不建议日常使用) | +| --- | 描述 | +| -------- | ---------------------- | +| `fc` | 函数调用(function calling) | +| `vision` | 视觉识别 | +| `file` | 文件上传(比较 hack,不建议日常使用) | diff --git a/docs/self-hosting/advanced/s3.mdx b/docs/self-hosting/advanced/s3.mdx index 9c5fe3b995bf..9d22d8aa55c0 100644 --- a/docs/self-hosting/advanced/s3.mdx +++ b/docs/self-hosting/advanced/s3.mdx @@ -26,60 +26,55 @@ The best practice in this area is to use a file storage service (S3) to store im ### `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY` -These are the two keys required by all S3 compatible storage services to access the S3 storage service, not detailed here. + These are the two keys required by all S3 compatible storage services to access the S3 storage service, not detailed here. -### `S3_ENDPOINT` + ### `S3_ENDPOINT` -The request endpoint of the storage bucket. Note that this link should not contain the name of the storage bucket. + The request endpoint of the storage bucket. Note that this link should not contain the name of the storage bucket. - - `S3_ENDPOINT` must remove the suffix path, otherwise the uploaded files will not be accessible - + + `S3_ENDPOINT` must remove the suffix path, otherwise the uploaded files will not be accessible + -For example, for Cloudflare: + For example, for Cloudflare: -```shell -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -``` + ```shell + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + ``` -### `S3_BUCKET` and `S3_REGION` + ### `S3_BUCKET` and `S3_REGION` -The name and region of the storage bucket. `S3_BUCKET` is required to specify the name of the storage bucket. `S3_REGION` is optional and is used to specify the region of the storage bucket. Generally, it does not need to be added, but some service providers may require configuration. + The name and region of the storage bucket. `S3_BUCKET` is required to specify the name of the storage bucket. `S3_REGION` is optional and is used to specify the region of the storage bucket. Generally, it does not need to be added, but some service providers may require configuration. -### `S3_SET_ACL` + ### `S3_SET_ACL` -Whether to set the ACL to `public-read` when uploading files. This option is enabled by default. If the service provider does not support setting individual ACLs for files (i.e., all files inherit the ACL of the storage bucket), enabling this option may cause request errors. Set `S3_SET_ACL` to `0` to disable it. + Whether to set the ACL to `public-read` when uploading files. This option is enabled by default. If the service provider does not support setting individual ACLs for files (i.e., all files inherit the ACL of the storage bucket), enabling this option may cause request errors. Set `S3_SET_ACL` to `0` to disable it. -### `S3_PUBLIC_DOMAIN` + ### `S3_PUBLIC_DOMAIN` -The public access domain of the storage bucket, used to access files in the storage bucket. This address needs to be **publicly readable**. The reason is that when OpenAI's gpt-4o and other vision models recognize images, OpenAI will try to download this image link on their servers. Therefore, this link must be publicly accessible. If it is a private link, OpenAI will not be able to access the image and thus will not be able to recognize the image content properly. + The public access domain of the storage bucket, used to access files in the storage bucket. This address needs to be **publicly readable**. The reason is that when OpenAI's gpt-4o and other vision models recognize images, OpenAI will try to download this image link on their servers. Therefore, this link must be publicly accessible. If it is a private link, OpenAI will not be able to access the image and thus will not be able to recognize the image content properly. - - Additionally, since this access domain is often a separate URL, it needs to be configured to allow - cross-origin access to the site. Otherwise, cross-origin issues will occur in the browser. - + + Additionally, since this access domain is often a separate URL, it needs to be configured to allow + cross-origin access to the site. Otherwise, cross-origin issues will occur in the browser. + -### `S3_ENABLE_PATH_STYLE` + ### `S3_ENABLE_PATH_STYLE` -Whether to enable the `path-style` access mode of S3. This option is disabled by default. If your S3 service provider uses `path-style`, set `S3_ENABLE_PATH_STYLE` to `1` to enable it. + Whether to enable the `path-style` access mode of S3. This option is disabled by default. If your S3 service provider uses `path-style`, set `S3_ENABLE_PATH_STYLE` to `1` to enable it. + `path-style` and `virtual-host` are different ways to access buckets and objects in S3, with different URL structures and domain name resolutions. -`path-style` and `virtual-host` are different ways to access buckets and objects in S3, with different URL structures and domain name resolutions. - -Assuming the domain name of the S3 service provider is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are as follows: + Assuming the domain name of the S3 service provider is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are as follows: -- path-style: `s3.example.net/mybucket/config.env` -- virtual-host: `mybucket.s3.example.net/config.env` - - + - path-style: `s3.example.net/mybucket/config.env` + - virtual-host: `mybucket.s3.example.net/config.env` + - -Common S3 cloud service providers often default to the `virtual-host` mode, while self-deployed services like Minio default to using `path-style`. Therefore, if you use Minio as the S3 service, you need to set `S3_ENABLE_PATH_STYLE=1`. - - - + Common S3 cloud service providers often default to the `virtual-host` mode, while self-deployed services like Minio default to using `path-style`. Therefore, if you use Minio as the S3 service, you need to set `S3_ENABLE_PATH_STYLE=1`. + ## S3 Configuration Guide @@ -88,6 +83,7 @@ Currently, the S3 configuration tutorials included in the documentation are: + diff --git a/docs/self-hosting/advanced/s3.zh-CN.mdx b/docs/self-hosting/advanced/s3.zh-CN.mdx index c8a10265d61e..e3f3de3adeb4 100644 --- a/docs/self-hosting/advanced/s3.zh-CN.mdx +++ b/docs/self-hosting/advanced/s3.zh-CN.mdx @@ -12,7 +12,7 @@ tags: LobeChat 在 [很早以前](https://x.com/lobehub/status/1724289575672291782) 就支持了多模态的 AI 会话,其中涉及到图片上传给大模型的功能。在客户端数据库方案中,图片文件直接以二进制数据存储在浏览器 IndexedDB 数据库,但在服务端数据库中这个方案并不可行。因为在 Postgres 中直接存储文件类二进制数据会大大浪费宝贵的数据库存储空间,并拖慢计算性能。 -这块最佳实践是使用文件存储服务(S3)来存储图片文件,同时 S3 也是文件上传/知识库功能所依赖的大容量静态文件存储方案。 +这块最佳实践是使用文件存储服务(S3)来存储图片文件,同时 S3 也是文件上传 / 知识库功能所依赖的大容量静态文件存储方案。 在本文档库中,S3 所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 @@ -24,58 +24,52 @@ LobeChat 在 [很早以前](https://x.com/lobehub/status/1724289575672291782) ### `S3_ACCESS_KEY_ID` 与 `S3_SECRET_ACCESS_KEY` -所有 S3 兼容存储服务都需要的两个密钥,用于访问 S3 存储服务,不详细展开。 + 所有 S3 兼容存储服务都需要的两个密钥,用于访问 S3 存储服务,不详细展开。 -### `S3_ENDPOINT` + ### `S3_ENDPOINT` -存储桶的请求端点, 注意此处链接不应该包含存储桶的名称。 + 存储桶的请求端点, 注意此处链接不应该包含存储桶的名称。 -`S3_ENDPOINT`必须删除后缀路径,否则会无法访问所上传文件 + `S3_ENDPOINT`必须删除后缀路径,否则会无法访问所上传文件 -例如 Cloudflare 为: + 例如 Cloudflare 为: -```shell -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -``` + ```shell + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + ``` -### `S3_BUCKET` 和 `S3_REGION` + ### `S3_BUCKET` 和 `S3_REGION` -存储桶的名称和区域,`S3_BUCKET` 是必须的,用于指定存储桶的名称。 `S3_REGION` 是可选的,用于指定存储桶的区域,一般来说不需要添加,但某些服务商则需要配置。 + 存储桶的名称和区域,`S3_BUCKET` 是必须的,用于指定存储桶的名称。 `S3_REGION` 是可选的,用于指定存储桶的区域,一般来说不需要添加,但某些服务商则需要配置。 -### `S3_SET_ACL` + ### `S3_SET_ACL` -是否在上传文件时设置 ACL 为 `public-read`。该选项默认启用。如果服务商不支持为文件设置单独的 ACL(即所有文件继承存储桶的 ACL),启用此选项可能会导致请求错误,将 `S3_SET_ACL` 设置为 `0` 即可关闭。 + 是否在上传文件时设置 ACL 为 `public-read`。该选项默认启用。如果服务商不支持为文件设置单独的 ACL(即所有文件继承存储桶的 ACL),启用此选项可能会导致请求错误,将 `S3_SET_ACL` 设置为 `0` 即可关闭。 -### `S3_PUBLIC_DOMAIN` + ### `S3_PUBLIC_DOMAIN` -存储桶对外的访问域名,用于访问存储桶中的文件,这个地址需要**允许互联网可读**。 原因是 OpenAI 的 gpt-4o 等视觉模型识别图片时,OpenAI 会尝试在他们的服务器中下载这个图片链接,因此这个链接必须是公开可访问的,如果是私有的链接,OpenAI 将无法访问到这个图片,进而无法正常识别到图片内容。 + 存储桶对外的访问域名,用于访问存储桶中的文件,这个地址需要**允许互联网可读**。 原因是 OpenAI 的 gpt-4o 等视觉模型识别图片时,OpenAI 会尝试在他们的服务器中下载这个图片链接,因此这个链接必须是公开可访问的,如果是私有的链接,OpenAI 将无法访问到这个图片,进而无法正常识别到图片内容。 此外,由于该访问域名往往是一个独立的网址,因此需要配置允许站点的跨域访问,否则会在浏览器中出现跨域问题。 + - - -### `S3_ENABLE_PATH_STYLE` - -是否启用 S3 的 `path-style` 访问模式。此选项默认禁用。如果您的 S3 服务提供商使用 `path-style`,请将 `S3_ENABLE_PATH_STYLE` 设置为 `1` 以启用它。 + ### `S3_ENABLE_PATH_STYLE` - - -`path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样 + 是否启用 S3 的 `path-style` 访问模式。此选项默认禁用。如果您的 S3 服务提供商使用 `path-style`,请将 `S3_ENABLE_PATH_STYLE` 设置为 `1` 以启用它。 -假设 S3 服务商的域名是 s3.example.net ,bucket为mybucket,object为config.env,具体区别如下: + + `path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样 -- path-style : `s3.example.net/mybucket/config.env` -- virtual-host : `mybucket.s3.example.net/config.env` + 假设 S3 服务商的域名是 s3.example.net ,bucket 为 mybucket,object 为 config.env,具体区别如下: - - - - -常见的 S3 Cloud 服务商往往默认采用 `virtual-host` 模式,而自部署服务 minio 则默认使用的是 `path-style`。 因此如果你使用了 minio 作为 S3 服务,你需要设置 `S3_ENABLE_PATH_STYLE=1` 。 - - + - path-style : `s3.example.net/mybucket/config.env` + - virtual-host : `mybucket.s3.example.net/config.env` + + + 常见的 S3 Cloud 服务商往往默认采用 `virtual-host` 模式,而自部署服务 minio 则默认使用的是 `path-style`。 因此如果你使用了 minio 作为 S3 服务,你需要设置 `S3_ENABLE_PATH_STYLE=1` 。 + ## S3 配置指南 @@ -84,6 +78,7 @@ S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + diff --git a/docs/self-hosting/advanced/s3/cloudflare-r2.mdx b/docs/self-hosting/advanced/s3/cloudflare-r2.mdx index 52e219cdeddb..28aaf881b9e1 100644 --- a/docs/self-hosting/advanced/s3/cloudflare-r2.mdx +++ b/docs/self-hosting/advanced/s3/cloudflare-r2.mdx @@ -14,118 +14,89 @@ We need to configure an S3 storage service in the server-side database to store ## Configuration Steps + ### Configure and Obtain S3 Bucket -### Configure and Obtain S3 Bucket + You need to go to your S3 service provider (such as AWS S3, Cloudflare R2, etc.) and create a new storage bucket. The following is an example using Cloudflare R2 to guide you through the creation process. -You need to go to your S3 service provider (such as AWS S3, Cloudflare R2, etc.) and create a new storage bucket. The following is an example using Cloudflare R2 to guide you through the creation process. + The interface of Cloudflare R2 is shown below: -The interface of Cloudflare R2 is shown below: + {'Cloudflare -{'Cloudflare + When creating the bucket, specify its name and then click create. -When creating the bucket, specify its name and then click create. + {'Create -{'Create + ### Obtain Environment Variables for the Bucket -### Obtain Environment Variables for the Bucket + In the settings of the R2 storage bucket, you can view the bucket configuration information: -In the settings of the R2 storage bucket, you can view the bucket configuration information: + {'View -{'View + The corresponding environment variables are: -The corresponding environment variables are: + ```shell + # Bucket name + S3_BUCKET=lobechat + # Request endpoint of the bucket (note that the path in this link includes the bucket name, which must be removed, or use the link provided on the page for applying S3 API token) + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # Access domain of the bucket + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + ``` -```shell -# Bucket name -S3_BUCKET=lobechat -# Request endpoint of the bucket (note that the path in this link includes the bucket name, which must be removed, or use the link provided on the page for applying S3 API token) -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# Access domain of the bucket -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -``` + + `S3_ENDPOINT` must have its path removed, otherwise uploaded files cannot be accessed. + - - `S3_ENDPOINT` must have its path removed, otherwise uploaded files cannot be accessed. - + ### Obtain S3 Key Environment Variables -### Obtain S3 Key Environment Variables + 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: -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: + {'View -{'View + Click the button in the upper right corner to create an API token and enter the create API Token page. -Click the button in the upper right corner to create an API token and enter the create API Token page. + {'Create -{'Create + 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. -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. + {'Configure -{'Configure + After creation, you can see the corresponding S3 API token. -After creation, you can see the corresponding S3 API token. + {'Copy -{'Copy + The corresponding environment variables are: -The corresponding environment variables are: + ```shell + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + ``` -```shell -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -``` + ### Configure Cross-Origin Resource Sharing (CORS) -### Configure Cross-Origin Resource Sharing (CORS) + Since S3 storage services are often on a separate domain, cross-origin access needs to be configured. -Since S3 storage services are often on a separate domain, cross-origin access needs to be configured. + In R2, you can find the CORS configuration in the settings of the storage bucket: -In R2, you can find the CORS configuration in the settings of the storage bucket: + {'Cross-Origin -{'Cross-Origin + Add a CORS rule to allow requests from your domain (in the previous section, it is `https://your-project.vercel.app`): -Add a CORS rule to allow requests from your domain (in the previous section, it is `https://your-project.vercel.app`): + {'Configure -{'Configure - -Example configuration is as follows: - -```json -[ - { - "AllowedOrigins": ["https://your-project.vercel.app"], - "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], - "AllowedHeaders": ["*"] - } -] -``` + Example configuration is as follows: -After configuration, click save. + ```json + [ + { + "AllowedOrigins": ["https://your-project.vercel.app"], + "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], + "AllowedHeaders": ["*"] + } + ] + ``` + After configuration, click save. ## Overview of Environment Variables diff --git a/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx b/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx index 83819e7de5b3..a0de1f88abd2 100644 --- a/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx +++ b/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx @@ -15,121 +15,92 @@ tags: ## 配置步骤 + ### 配置并获取 S3 存储桶 -### 配置并获取 S3 存储桶 + 你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。 -你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。 + 下图是 Cloudflare R2 的界面: -下图是 Cloudflare R2 的界面: + {'Cloudflare -{'Cloudflare + 创建存储桶时将指定其名称,然后点击创建。 -创建存储桶时将指定其名称,然后点击创建。 + {'R2 -{'R2 + ### 获取存储桶相关环境变量 -### 获取存储桶相关环境变量 + 在 R2 存储桶的设置中,可以看到桶配置的信息: -在 R2 存储桶的设置中,可以看到桶配置的信息: + {'查看存储桶的相关信息'} -{'查看存储桶的相关信息'} + 其对应的环境变量为: -其对应的环境变量为: + ```shell + # 存储桶的名称 + S3_BUCKET=lobechat + # 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接) + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # 存储桶对外的访问域名 + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + ``` -```shell -# 存储桶的名称 -S3_BUCKET=lobechat -# 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接) -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# 存储桶对外的访问域名 -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -``` + `S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件 -`S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件 + ### 获取 S3 密钥环境变量 -### 获取 S3 密钥环境变量 + 你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥: -你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥: + {'查看存储桶的访问秘钥'} -{'查看存储桶的访问秘钥'} + 点击右上角按钮创建 API token,进入创建 API Token 页面 -点击右上角按钮创建 API token,进入创建 API Token 页面 + {'创建对应 -{'创建对应 + 鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。 -鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。 + {'配置 -{'配置 + 创建完成后,就可以看到对应的 S3 API token -创建完成后,就可以看到对应的 S3 API token + {'复制 -{'复制 + 其对应的环境变量为: -其对应的环境变量为: + ```shell + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + ``` -```shell -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -``` + ### 配置跨域 -### 配置跨域 + 由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。 -由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。 + 在 R2 中,你可以在存储桶的设置中找到跨域配置: -在 R2 中,你可以在存储桶的设置中找到跨域配置: + {'Cloudflare -{'Cloudflare + 添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求: -添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求: + {'配置允许你的站点域名'} -{'配置允许你的站点域名'} - -示例配置如下: - -```json -[ - { - "AllowedOrigins": ["https://your-project.vercel.app"], - "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], - "AllowedHeaders": ["*"] - } -] -``` + 示例配置如下: -配置后点击保存即可。 + ```json + [ + { + "AllowedOrigins": ["https://your-project.vercel.app"], + "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], + "AllowedHeaders": ["*"] + } + ] + ``` + 配置后点击保存即可。 ## 环境变量一览 -URL的`https://`不可缺失,须保持URL的完整性 +URL 的`https://`不可缺失,须保持 URL 的完整性 ```shell # S3 秘钥 diff --git a/docs/self-hosting/advanced/s3/tencent-cloud.mdx b/docs/self-hosting/advanced/s3/tencent-cloud.mdx index 21ae7b1a16e0..eed8a276d442 100644 --- a/docs/self-hosting/advanced/s3/tencent-cloud.mdx +++ b/docs/self-hosting/advanced/s3/tencent-cloud.mdx @@ -19,58 +19,44 @@ We need to configure S3 storage service for file storage in the server-side data ### Configure and Obtain S3 Bucket -Create a new bucket on [Tencent Cloud COS](https://console.cloud.tencent.com/cos/bucket): + Create a new bucket on [Tencent Cloud COS](https://console.cloud.tencent.com/cos/bucket): -{'Tencent + {'Tencent -Name the bucket (e.g., 'lobe'). Choose 'Public Read, Private Write', select any region, and keep other settings default. + Name the bucket (e.g., 'lobe'). Choose 'Public Read, Private Write', select any region, and keep other settings default. -{'COS + {'COS -### Get Bucket-related Environment Variables + ### Get Bucket-related Environment Variables -View bucket information in COS bucket overview: + View bucket information in COS bucket overview: -{'View + {'View -Corresponding environment variables: + Corresponding environment variables: -```shell -S3_BUCKET=lobe-130xxxxxx2 -S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com -S3_REGION=ap-chengdu -S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com -``` + ```shell + S3_BUCKET=lobe-130xxxxxx2 + S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com + S3_REGION=ap-chengdu + S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com + ``` Note: `S3_ENDPOINT` should be `https://cos.ap-chengdu.myqcloud.com`, not `https://lobe-130xxxxxx2.cos.ap-chengdu.myqcloud.com` Include `https://` in the URL + - + ### Configure CORS -### Configure CORS + Add the following in 'Security Management - CORS Settings': -Add the following in 'Security Management - CORS Settings': + {'Configure -{'Configure - -### Get S3 Keys - -Create a new SecretId and SecretKey at [Tencent Cloud API Key Management](https://console.cloud.tencent.com/cam/capi). Use as `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`. + ### Get S3 Keys + Create a new SecretId and SecretKey at [Tencent Cloud API Key Management](https://console.cloud.tencent.com/cam/capi). Use as `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`. ### Additional Notes diff --git a/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx b/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx index 5292bb00c89d..ed7a3ae0ce63 100644 --- a/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx +++ b/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx @@ -15,65 +15,50 @@ tags: ## 配置步骤 + ### 配置并获取 S3 存储桶 -### 配置并获取 S3 存储桶 + 你需要首先前往 [腾讯云 COS](https://console.cloud.tencent.com/cos/bucket) 并创建一个新的存储桶(Bucket): -你需要首先前往 [腾讯云 COS](https://console.cloud.tencent.com/cos/bucket) 并创建一个新的存储桶(Bucket): + {'腾讯云 -{'腾讯云 + 创建存储桶时将指定其名称,下文以 `lobe` 为例。选择 `公有读私有写`,地域随意,其余配置一概默认即可,然后点击创建。 -创建存储桶时将指定其名称,下文以 `lobe` 为例。选择 `公有读私有写`,地域随意,其余配置一概默认即可,然后点击创建。 + {'COS -{'COS + ### 获取存储桶相关环境变量 -### 获取存储桶相关环境变量 + 在 COS 存储桶的概览设置中,可以看到桶配置的信息: -在 COS 存储桶的概览设置中,可以看到桶配置的信息: + {'查看存储桶的相关信息'} -{'查看存储桶的相关信息'} + 其对应的环境变量为: -其对应的环境变量为: + ```shell + # 存储桶的名称 + S3_BUCKET=lobe-130xxxxxx2 + # 存储桶的请求端点,注意没有前面的桶名 + S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com + # 桶的区域 + S3_REGION=ap-chengdu + # 存储桶对外的访问域名 + S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com + ``` -```shell -# 存储桶的名称 -S3_BUCKET=lobe-130xxxxxx2 -# 存储桶的请求端点,注意没有前面的桶名 -S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com -# 桶的区域 -S3_REGION=ap-chengdu -# 存储桶对外的访问域名 -S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com -``` + + 请注意,`S3_ENDPOINT` 的值为 `https://cos.ap-chengdu.myqcloud.com`,而不是 `https://lobe-130xxxxxx2.cos.ap-chengdu.myqcloud.com` - -请注意,`S3_ENDPOINT` 的值为 `https://cos.ap-chengdu.myqcloud.com`,而不是 `https://lobe-130xxxxxx2.cos.ap-chengdu.myqcloud.com` + 且此处 URL 的 `https://` 不可缺失,须保持 URL 的完整性 + -且此处 URL 的 `https://` 不可缺失,须保持 URL 的完整性 + ### 配置跨域 - + 在左侧 `安全管理 - 跨域访问 CORS 设置` 中,添加以下配置并保存: -### 配置跨域 + {'配置跨域'} -在左侧 `安全管理 - 跨域访问 CORS 设置` 中,添加以下配置并保存: - -{'配置跨域'} - -### 获取 S3 秘钥 - -前往 [腾讯云 API 密钥管理](https://console.cloud.tencent.com/cam/capi) 创建一个新的 SecretId 和 SecretKey,填写为 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 即可。 + ### 获取 S3 秘钥 + 前往 [腾讯云 API 密钥管理](https://console.cloud.tencent.com/cam/capi) 创建一个新的 SecretId 和 SecretKey,填写为 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 即可。 ### 附加说明 diff --git a/docs/self-hosting/advanced/settings-url-share.mdx b/docs/self-hosting/advanced/settings-url-share.mdx index c12a09ac26d8..80e121be3d6a 100644 --- a/docs/self-hosting/advanced/settings-url-share.mdx +++ b/docs/self-hosting/advanced/settings-url-share.mdx @@ -139,9 +139,9 @@ export type UserModelProviderConfig = Record; - Type `ProviderConfig` -| Property name | Type | Description | -| ------------------- | -------- | ------------------------------------------- | ------------------------------ | -| autoFetchModelLists | boolean | Whether to automatically fetch model lists. | -| enabled | boolean | Whether the model provider is enabled. | -| enabledModels | string[] | null | The IDs of the enabled models. | -| fetchOnClient | boolean | Whether to fetch on the client. | +| Property name | Type | Description | | +| ------------------- | --------- | ------------------------------------------- | ------------------------------ | +| autoFetchModelLists | boolean | Whether to automatically fetch model lists. | | +| enabled | boolean | Whether the model provider is enabled. | | +| enabledModels | string\[] | null | The IDs of the enabled models. | +| fetchOnClient | boolean | Whether to fetch on the client. | | diff --git a/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx b/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx index 14f47b5fc715..e372e7117fd5 100644 --- a/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +++ b/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx @@ -30,7 +30,7 @@ https://lobehub.com/?settings= https://lobehub.com/?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}} ``` -JSON格式的设置示例: +JSON 格式的设置示例: ```json { @@ -70,7 +70,7 @@ console.log(url); - 参数及其类型 -| 参数名称 | 类型 | +| 参数名称 | 类型 | | ---------- | -------------------------- | | anthropic | `OpenAICompatibleKeyVault` | | azure | `AzureOpenAIKeyVault` | @@ -90,25 +90,25 @@ console.log(url); - Type `OpenAICompatibleKeyVault` -| 参数 | 类型 | 描述 | -| ------- | ------ | ----------------- | +| 参数 | 类型 | 描述 | +| ------- | ------ | ----------- | | apiKey | string | 模型的 API 密钥。 | -| baseURL | string | 模型API端点。 | +| baseURL | string | 模型 API 端点。 | - Type `AzureOpenAIKeyVault` -| 参数 | 类型 | 描述 | -| ---------- | ------ | -------------------------- | +| 参数 | 类型 | 描述 | +| ---------- | ------ | ---------------------- | | apiVersion | string | Azure OpenAI 的 API 版本。 | -| apiKey | string | 模型的 API 密钥。 | -| baseURL | string | 模型API端点。 | +| apiKey | string | 模型的 API 密钥。 | +| baseURL | string | 模型 API 端点。 | - Type `AWSBedrockKeyVault` -| 参数 | 类型 | 描述 | -| --------------- | ------ | --------------------------- | +| 参数 | 类型 | 描述 | +| --------------- | ------ | --------------------- | | accessKeyId | string | AWS Bedrock 的访问密钥 ID。 | -| region | string | AWS Bedrock 的区域。 | +| region | string | AWS Bedrock 的区域。 | | secretAccessKey | string | AWS Bedrock 的访问密钥。 | ### languageModel @@ -117,7 +117,7 @@ console.log(url); export type UserModelProviderConfig = Record; ``` -| 参数名称 | 类型 | +| 参数名称 | 类型 | | ---------- | ---------------- | | anthropic | `ProviderConfig` | | azure | `ProviderConfig` | @@ -137,9 +137,9 @@ export type UserModelProviderConfig = Record; - 类型 `ProviderConfig` -| 参数 | TS 类型 | 描述 | -| ------------------- | -------- | -------------------------------------------- | -| autoFetchModelLists | boolean | 是否自动获取模型列表。 | -| enabled | boolean | 是否启用该模型。 | -| enabledModels | string[] | 启用的模型的 ID。 | -| fetchOnClient | boolean | 是否在客户端发起请求,默认在服务端发起请求。 | +| 参数 | TS 类型 | 描述 | +| ------------------- | --------- | ---------------------- | +| autoFetchModelLists | boolean | 是否自动获取模型列表。 | +| enabled | boolean | 是否启用该模型。 | +| enabledModels | string\[] | 启用的模型的 ID。 | +| fetchOnClient | boolean | 是否在客户端发起请求,默认在服务端发起请求。 | diff --git a/docs/self-hosting/advanced/upstream-sync.mdx b/docs/self-hosting/advanced/upstream-sync.mdx index 4fb124dc70ae..92877b723730 100644 --- a/docs/self-hosting/advanced/upstream-sync.mdx +++ b/docs/self-hosting/advanced/upstream-sync.mdx @@ -30,27 +30,15 @@ If you deployed your project according to the one-click deployment steps in the After forking the project, due to Github's limitations, you need to manually enable Workflows on the Actions page of your forked project and start the Upstream Sync Action. Once enabled, you can set up automatic updates to occur every hour. -Enable Automatic Updates S1 +Enable Automatic Updates S1 -Enable Automatic Updates S2 +Enable Automatic Updates S2 If you encounter a sync failure, you need to manually click "Update Branch" once. -GitHub Action Sync Failure +GitHub Action Sync Failure -Manually Sync 'Update Branch' +Manually Sync 'Update Branch' ## `B` Docker Deployment @@ -59,34 +47,33 @@ Upgrading the Docker deployment version is very simple, you just need to redeplo ### Stop and Remove the Current Running LobeChat Container -Assuming the LobeChat container is named `lobe-chat`, use the following commands to stop and remove the currently running LobeChat container: + Assuming the LobeChat container is named `lobe-chat`, use the following commands to stop and remove the currently running LobeChat container: -```fish -docker stop lobe-chat -docker rm lobe-chat -``` + ```fish + docker stop lobe-chat + docker rm lobe-chat + ``` -### Pull the Latest LobeChat Image + ### Pull the Latest LobeChat Image -Use the following command to pull the latest Docker image for LobeChat: + Use the following command to pull the latest Docker image for LobeChat: -```fish -docker pull lobehub/lobe-chat -``` + ```fish + docker pull lobehub/lobe-chat + ``` -### Restart the Docker Container + ### Restart the Docker Container -Redeploy the LobeChat container using the newly pulled image: - -```fish -docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + Redeploy the LobeChat container using the newly pulled image: + ```fish + docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` Ensure that you have sufficient permissions to stop and remove the container before executing these commands, and that Docker has sufficient permissions to pull the new image. @@ -94,80 +81,77 @@ Ensure that you have sufficient permissions to stop and remove the container bef **If I redeploy, will I lose my local chat records?** -No need to worry, you won't. All of LobeChat's chat records are stored in your local browser. Therefore, when redeploying LobeChat using Docker, your chat records will not be lost. - + No need to worry, you won't. All of LobeChat's chat records are stored in your local browser. Therefore, when redeploying LobeChat using Docker, your chat records will not be lost. If you wish to automate the above steps, you can follow the method below and use Crontab scheduling to complete it. The specific steps are as follows. + ### Write automatic update scripts and configuration files -### Write automatic update scripts and configuration files - -First, create a `lobe.env` configuration file with various environment variables, for example: + First, create a `lobe.env` configuration file with various environment variables, for example: -```env -OPENAI_API_KEY=sk-xxxx -OPENAI_PROXY_URL=https://api-proxy.com/v1 -ACCESS_CODE=arthals2333 -OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision -``` + ```env + OPENAI_API_KEY=sk-xxxx + OPENAI_PROXY_URL=https://api-proxy.com/v1 + ACCESS_CODE=arthals2333 + OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision + ``` -Then, you can use the following script to automate the update: + Then, you can use the following script to automate the update: -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# Set up proxy (optional) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + # Set up proxy (optional) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# Pull the latest image and store the output in a variable -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # Pull the latest image and store the output in a variable + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# Check if the pull command was executed successfully -if [ $? -ne 0 ]; then - exit 1 -fi + # Check if the pull command was executed successfully + if [ $? -ne 0 ]; then + exit 1 + fi -# Check if the output contains a specific string -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # Check if the output contains a specific string + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -# If the image is already up to date, do nothing -if [ $? -eq 0 ]; then - exit 0 -fi + # If the image is already up to date, do nothing + if [ $? -eq 0 ]; then + exit 0 + fi -echo "Detected lobe-chat update" + echo "Detected lobe-chat update" -# Remove the old container -echo "Removed: $(docker rm -f lobe-chat)" + # Remove the old container + echo "Removed: $(docker rm -f lobe-chat)" -# Run the new container(Please change the path to the env file) -echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)" + # Run the new container(Please change the path to the env file) + echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)" -# Print the update time and version -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # Print the update time and version + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -# Clean up unused images -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` - - - This script can be used in Crontab, but please ensure that your Crontab can find the correct - Docker command. It is recommended to use absolute paths. - + # Clean up unused images + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -Configure Crontab to execute the script every 5 minutes: + + This script can be used in Crontab, but please ensure that your Crontab can find the correct + Docker command. It is recommended to use absolute paths. + -### Configure Crontab to automatically execute scripts + Configure Crontab to execute the script every 5 minutes: -The following command configures Crontab to execute scripts every 5 minutes, or as often as you like: + ### Configure Crontab to automatically execute scripts -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + The following command configures Crontab to execute scripts every 5 minutes, or as often as you like: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` diff --git a/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx b/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx index 41396dd63331..60340f8e6bcf 100644 --- a/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +++ b/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx @@ -25,27 +25,15 @@ tags: 当你 Fork 了项目后,由于 Github 的限制,你需要手动在你 Fork 的项目的 Actions 页面启用 Workflows,并启动 Upstream Sync Action。启用后,你可以设置每小时进行一次自动更新。 -启动自动更新 S1 +启动自动更新 S1 -启动自动更新 S2 +启动自动更新 S2 如果你遇到了同步失败的情况,你需要手动重新点一次 「Update Branch」。 -GitHub Action 同步失败 +GitHub Action 同步失败 -手动同步 「Update Branch」 +手动同步 「Update Branch」 ## `B` Docker 部署 @@ -54,34 +42,33 @@ Docker 部署版本的升级非常简单,只需要重新部署 LobeChat 的最 ### 停止并删除当前运行的 LobeChat 容器 -假设 LobeChat 容器的名称是 `lobe-chat`,使用以下指令停止并删除当前运行的 LobeChat 容器: + 假设 LobeChat 容器的名称是 `lobe-chat`,使用以下指令停止并删除当前运行的 LobeChat 容器: -```fish -docker stop lobe-chat -docker rm lobe-chat -``` + ```fish + docker stop lobe-chat + docker rm lobe-chat + ``` -### 拉取最新的 LobeChat 镜像 + ### 拉取最新的 LobeChat 镜像 -使用以下命令拉取 LobeChat 的最新 Docker 镜像: + 使用以下命令拉取 LobeChat 的最新 Docker 镜像: -```fish -docker pull lobehub/lobe-chat -``` + ```fish + docker pull lobehub/lobe-chat + ``` -### 重新启动 Docker 容器 + ### 重新启动 Docker 容器 -使用新拉取的镜像重新部署 LobeChat 容器: - -```fish -docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + 使用新拉取的镜像重新部署 LobeChat 容器: + ```fish + docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` 确保在执行这些命令之前,您有足够的权限来停止和删除容器,并且 Docker 有足够的权限来拉取新的镜像。 @@ -89,77 +76,74 @@ docker run -d -p 3210:3210 \ **重新部署的话,我本地的聊天记录会丢失吗?** -放心,不会的。LobeChat 的聊天记录全部都存储在你的本地浏览器中。因此使用 Docker 重新部署 LobeChat 时,你的聊天记录并不会丢失。 - + 放心,不会的。LobeChat 的聊天记录全部都存储在你的本地浏览器中。因此使用 Docker 重新部署 LobeChat 时,你的聊天记录并不会丢失。 如果你希望自动化执行以上步骤,你可以参照下面的方法,利用 Crontab 定时来完成。具体步骤如下。 + ### 撰写自动更新脚本、配置文件 -### 撰写自动更新脚本、配置文件 - -首先,新建一个 `lobe.env` 配置文件,内容为各种环境变量,例如: + 首先,新建一个 `lobe.env` 配置文件,内容为各种环境变量,例如: -```env -OPENAI_API_KEY=sk-xxxx -OPENAI_PROXY_URL=https://api-proxy.com/v1 -ACCESS_CODE=arthals2333 -OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision -``` + ```env + OPENAI_API_KEY=sk-xxxx + OPENAI_PROXY_URL=https://api-proxy.com/v1 + ACCESS_CODE=arthals2333 + OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision + ``` -然后,你可以使用以下脚本来自动更新: + 然后,你可以使用以下脚本来自动更新: -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# 设置代理(可选) -# export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + # 设置代理(可选) + # export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# 拉取最新的镜像并将输出存储在变量中 -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # 拉取最新的镜像并将输出存储在变量中 + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# 检查拉取命令是否成功执行 -if [ $? -ne 0 ]; then - exit 1 -fi + # 检查拉取命令是否成功执行 + if [ $? -ne 0 ]; then + exit 1 + fi -# 检查输出中是否包含特定的字符串 -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # 检查输出中是否包含特定的字符串 + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -# 如果镜像已经是最新的,则不执行任何操作 -if [ $? -eq 0 ]; then - exit 0 -fi + # 如果镜像已经是最新的,则不执行任何操作 + if [ $? -eq 0 ]; then + exit 0 + fi -echo "Detected lobe-chat update" + echo "Detected lobe-chat update" -# 删除旧的容器 -echo "Removed: $(docker rm -f lobe-chat)" + # 删除旧的容器 + echo "Removed: $(docker rm -f lobe-chat)" -# 运行新的容器(请将env配置文件地址改为你的实际地址) -echo "Started: $(docker run -d --network=host --env-file path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)" + # 运行新的容器(请将env配置文件地址改为你的实际地址) + echo "Started: $(docker run -d --network=host --env-file path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)" -# 打印更新的时间和版本 -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # 打印更新的时间和版本 + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -# 清理不再使用的镜像 -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` - - - 此脚本可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。 - + # 清理不再使用的镜像 + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -### 配置 Crontab 自动执行脚本 + + 此脚本可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。 + -以下命令可以配置 Crontab 每 5 分钟执行一次脚本,你也可以根据需要调整执行频率: + ### 配置 Crontab 自动执行脚本 -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + 以下命令可以配置 Crontab 每 5 分钟执行一次脚本,你也可以根据需要调整执行频率: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` diff --git a/docs/self-hosting/advanced/webrtc.mdx b/docs/self-hosting/advanced/webrtc.mdx index 25903615c3bb..ddd2c71625dd 100644 --- a/docs/self-hosting/advanced/webrtc.mdx +++ b/docs/self-hosting/advanced/webrtc.mdx @@ -22,38 +22,31 @@ WebRTC (Web Real-Time Communication) is a technology that enables peer-to-peer c To use the WebRTC synchronization feature in LobeChat, you need to complete the following steps: + ### Deploy Signaling Server -### Deploy Signaling Server + Deploy a WebRTC signaling server with one click using the Zeabur platform: -Deploy a WebRTC signaling server with one click using the Zeabur platform: + [![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx) -[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx) + Alternatively, you can view the [source code](https://github.com/lobehub/y-webrtc-signaling) and deploy it on your own. -Alternatively, you can view the [source code](https://github.com/lobehub/y-webrtc-signaling) and deploy it on your own. + After deployment, you will receive a URL, for example: `https://my-signaling-server.zeabur.app`. -After deployment, you will receive a URL, for example: `https://my-signaling-server.zeabur.app`. + ### Enable WebRTC Sync in the Deployment Instance -### Enable WebRTC Sync in the Deployment Instance + The WebRTC sync feature in LobeChat is hidden by default and needs to be enabled by adding the environment variable `FEATURE_FLAGS=+webrtc_sync`. -The WebRTC sync feature in LobeChat is hidden by default and needs to be enabled by adding the environment variable `FEATURE_FLAGS=+webrtc_sync`. + ### Configure WebRTC Sync Settings in LobeChat -### Configure WebRTC Sync Settings in LobeChat + 1. Open LobeChat settings -> Data Sync + 2. Enter the signaling server address in the WebRTC sync section; + 3. Set the sync channel name and password -1. Open LobeChat settings -> Data Sync -2. Enter the signaling server address in the WebRTC sync section; -3. Set the sync channel name and password + {'LobeChat -{'LobeChat - -### Repeat the Above Configuration on Devices that Need to Sync - -Ensure all devices use the same signaling server, channel name, and password. Once configured, the devices should automatically start syncing data. + ### Repeat the Above Configuration on Devices that Need to Sync + Ensure all devices use the same signaling server, channel name, and password. Once configured, the devices should automatically start syncing data. ## Limitations and Known Issues diff --git a/docs/self-hosting/advanced/webrtc.zh-CN.mdx b/docs/self-hosting/advanced/webrtc.zh-CN.mdx index a9fd2c3d8e20..3ddc3c4b8c8a 100644 --- a/docs/self-hosting/advanced/webrtc.zh-CN.mdx +++ b/docs/self-hosting/advanced/webrtc.zh-CN.mdx @@ -10,45 +10,38 @@ tags: ## WebRTC 简介 -WebRTC (Web Real-Time Communication) 是一项实现浏览器之间点对点通信的技术。在 LobeChat 中,我们实验性地基于 WebRTC 和 YJS 实现了设备间的实时数据同步,无需依赖传统的服务器数据库。这种方案具有高度隐私性、零冲突性,并能提供实时会话同步体验。 +WebRTC (Web Real-Time Communication) 是一项实现浏览器之间点对点通信的技术。在 LobeChat 中,我们实验性地基于 WebRTC 和 YJS 实现了设备间的实时数据同步,无需依赖传统的服务器数据库。这种方案具有高度隐私性、零冲突性,并能提供实时会话同步体验。 ## 配置 WebRTC 并实现同步 -要使用 LobeChat 的 WebRTC 同步功能,需要完成以下步骤: +要使用 LobeChat 的 WebRTC 同步功能,需要完成以下步骤: + ### 部署信令服务器 -### 部署信令服务器 + 使用 Zeabur 平台一键部署 WebRTC 信令服务器: -使用 Zeabur 平台一键部署 WebRTC 信令服务器: + [![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx) -[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx) + 或者查看 [源码](https://github.com/lobehub/y-webrtc-signaling) 自行部署。 -或者查看 [源码](https://github.com/lobehub/y-webrtc-signaling) 自行部署。 + 部署完成后,可以得到一个 URL,例如:`https://my-signaling-server.zeabur.app`。 -部署完成后,可以得到一个 URL,例如:`https://my-signaling-server.zeabur.app`。 + ### 在部署实例中开启 WebRTC 同步 -### 在部署实例中开启 WebRTC 同步 + LobeChat 默认隐藏了 WebRTC 同步功能,需要通过添加环境变量 `FEATURE_FLAGS=+webrtc_sync` 来开启 WebRTC 同步特性。 -LobeChat 默认隐藏了 WebRTC 同步功能,需要通过添加环境变量 `FEATURE_FLAGS=+webrtc_sync` 来开启 WebRTC 同步特性。 + ### 配置 LobeChat 的 WebRTC 同步设置 -### 配置 LobeChat 的 WebRTC 同步设置 + 1. 打开 LobeChat 设置 -> 数据同步 + 2. 在 WebRTC 同步中填写信令服务器地址; + 3. 设置同步频道名称和密码 -1. 打开 LobeChat 设置 -> 数据同步 -2. 在 WebRTC 同步中填写信令服务器地址; -3. 设置同步频道名称和密码 + {'LobeChat -{'LobeChat - -### 在需要同步的设备上重复以上配置 - -确保所有设备使用相同的信令服务器、频道名称和密码,完成配置后,设备间应该可以开始自动同步数据。 + ### 在需要同步的设备上重复以上配置 + 确保所有设备使用相同的信令服务器、频道名称和密码,完成配置后,设备间应该可以开始自动同步数据。 ## 使用局限性和已知问题 @@ -67,17 +60,17 @@ WebRTC 要求设备同时在线才能进行同步,这意味着无法在一台 由于 WebRTC 的实现机制,其点对点通信对于网络要求非常苛刻,我们的很多用户反馈: -- 在 PC 上可以互相同步、 手机 sim 卡无法和 PC 同步、但是换成和PC一样的WIFI可以和 PC 同步; +- 在 PC 上可以互相同步、 手机 sim 卡无法和 PC 同步、但是换成和 PC 一样的 WIFI 可以和 PC 同步; - 任何切换网络都无法同步; ### 稳定性与性能问题 - 部分用户报告在 Firefox 浏览器上遇到 ICE 连接失败的问题:[WebRTC Data Sync Feedback](https://github.com/lobehub/lobe-chat/issues/1683#issuecomment-2094745907) -- 对于超长文本或大量对话记录,同步过程可能变慢或不稳定:[当模型输出超长对话时,对话末尾会出现同步相关的内容标签,导致同步失败](https://github.com/lobehub/lobe-chat/issues/1962) +- 对于超长文本或大量对话记录,同步过程可能变慢或不稳定:[当模型输出超长对话时,对话末尾会出现同步相关的内容标签,导致同步失败](https://github.com/lobehub/lobe-chat/issues/1962) ## 我们的建议 -鉴于以上原因,我们建议用户将 WebRTC 同步功能视为实验性功能,并定期备份重要数据。 +鉴于以上原因,我们建议用户将 WebRTC 同步功能视为实验性功能,并定期备份重要数据。 目前我们已经发布了更稳定、更用户友好的服务端数据库同步方案([部署指南](/zh/docs/self-hosting/advanced/server-database)),我们建议用户优先考虑使用服务端数据库同步方案。 diff --git a/docs/self-hosting/environment-variables.mdx b/docs/self-hosting/environment-variables.mdx index d5fe17f20197..51d5fc50b182 100644 --- a/docs/self-hosting/environment-variables.mdx +++ b/docs/self-hosting/environment-variables.mdx @@ -16,15 +16,19 @@ LobeChat provides some additional configuration options when deployed, which can + + + + -## Building a Custom Image with Overridden NEXT_PUBLIC Variables +## Building a Custom Image with Overridden `NEXT_PUBLIC` Variables -If you need to override NEXT_PUBLIC environment variables, you can build a custom Docker image using GitHub Actions without forking the entire LobeChat repository. Here's a guide on how to do this: +If you need to override `NEXT_PUBLIC` environment variables, you can build a custom Docker image using GitHub Actions without forking the entire LobeChat repository. Here's a guide on how to do this: 1. Create a new GitHub repository for your custom build. @@ -82,10 +86,10 @@ jobs: NEXT_PUBLIC_SERVICE_MODE=${{ secrets.NEXT_PUBLIC_SERVICE_MODE }} ``` -4. In your GitHub Repository settings > Secrets and variables > Actions > Repository secrets, add any NEXT_PUBLIC variables you want to override +4. In your GitHub Repository settings > Secrets and variables > Actions > Repository secrets, add any `NEXT_PUBLIC` variables you want to override 5. Set "Read and write" permissions for workflows in Repository settings > Actions > General > Workflow permissions. 6. To build your custom image, go to the "Actions" tab in your GitHub repository and manually trigger the "Build Custom LobeChat Image" workflow. -This approach allows you to create a custom build with your desired NEXT_PUBLIC variables without maintaining a full fork of the LobeChat repository. You can trigger a new build whenever you need to update your custom image. +This approach allows you to create a custom build with your desired `NEXT_PUBLIC` variables without maintaining a full fork of the LobeChat repository. You can trigger a new build whenever you need to update your custom image. diff --git a/docs/self-hosting/environment-variables.zh-CN.mdx b/docs/self-hosting/environment-variables.zh-CN.mdx index b492e15f2017..a6f76ec61243 100644 --- a/docs/self-hosting/environment-variables.zh-CN.mdx +++ b/docs/self-hosting/environment-variables.zh-CN.mdx @@ -14,8 +14,12 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境 + + + + diff --git a/docs/self-hosting/environment-variables/analytics.zh-CN.mdx b/docs/self-hosting/environment-variables/analytics.zh-CN.mdx index df02c2d86b1b..98067382994d 100644 --- a/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/analytics.zh-CN.mdx @@ -77,6 +77,3 @@ tags: - 描述:Umami 脚本的网址,默认为 Umami Cloud 提供的脚本网址 - 默认值:`https://analytics.umami.is/script.js` - 示例:`https://umami.your-site.com/script.js` - -[posthog-analytics-url]: https://posthog.com -[umami-analytics-url]: https://umami.is diff --git a/docs/self-hosting/environment-variables/auth.zh-CN.mdx b/docs/self-hosting/environment-variables/auth.zh-CN.mdx index a92e16a7d3d6..3aa77411dae5 100644 --- a/docs/self-hosting/environment-variables/auth.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/auth.zh-CN.mdx @@ -47,7 +47,7 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相 - 默认值: `-` - 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P` -#### \`AUTH_AUTH_SECRET +#### `AUTH_AUTH_SECRET` - 类型:必选 - 描述: Auth0 应用程序的 Client Secret diff --git a/docs/self-hosting/environment-variables/basic.mdx b/docs/self-hosting/environment-variables/basic.mdx index bfdccfa5e103..5bd0882df22c 100644 --- a/docs/self-hosting/environment-variables/basic.mdx +++ b/docs/self-hosting/environment-variables/basic.mdx @@ -54,22 +54,22 @@ When using the `turn` mode, the API Keys will be retrieved in a polling manner a The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the LobeChat default agent. It supports various data types and structures, including key-value pairs, nested fields, array values, and more. The table below provides detailed information on the configuration options, examples, and corresponding explanations for the `DEFAULT_AGENT_CONFIG` environment variable: -| Configuration Type | Example | Explanation | -| --- | --- | --- | -| Basic Key-Value Pair | `model=gpt-4` | Set the model to `gpt-4`. | -| Nested Field | `tts.sttLocale=en-US` | Set the language locale for the text-to-speech service to `en-US`. | -| Array | `plugins=search-engine,lobe-image-designer` | Enable the `search-engine` and `lobe-image-designer` plugins. | -| Chinese Comma | `plugins=search-engine,lobe-image-designer` | Same as above, demonstrating support for Chinese comma separation. | -| Multiple Configurations | `model=glm-4;provider=zhipu` | Set the model to `glm-4` and the model provider to `zhipu`. | -| Numeric Value | `params.max_tokens=300`, `chatConfig.historyCount=5` | Set the maximum tokens to `300`, Set the number of historical messages to 5. | -| Boolean Value | `chatConfig.enableAutoCreateTopic=true`, `chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | Enable automatic topic creation, History length compression threshold, number of historical records. | -| Special Characters | `inputTemplate="Hello; I am a bot;"` | Set the input template to `Hello; I am a bot;`. | -| Error Handling | `model=gpt-4;maxToken` | Ignore invalid entry `maxToken` and only parse `model=gpt-4`. | -| Value Override | `model=gpt-4;model=gpt-4-1106-preview` | If a key is repeated, use the value that appears last; in this case, the value of `model` is `gpt-4-1106-preview`. | +| Configuration Type | Example | Explanation | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| Basic Key-Value Pair | `model=gpt-4` | Set the model to `gpt-4`. | +| Nested Field | `tts.sttLocale=en-US` | Set the language locale for the text-to-speech service to `en-US`. | +| Array | `plugins=search-engine,lobe-image-designer` | Enable the `search-engine` and `lobe-image-designer` plugins. | +| Chinese Comma | `plugins=search-engine,lobe-image-designer` | Same as above, demonstrating support for Chinese comma separation. | +| Multiple Configurations | `model=glm-4;provider=zhipu` | Set the model to `glm-4` and the model provider to `zhipu`. | +| Numeric Value | `params.max_tokens=300`, `chatConfig.historyCount=5` | Set the maximum tokens to `300`, Set the number of historical messages to 5. | +| Boolean Value | `chatConfig.enableAutoCreateTopic=true`, `chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | Enable automatic topic creation, History length compression threshold, number of historical records. | +| Special Characters | `inputTemplate="Hello; I am a bot;"` | Set the input template to `Hello; I am a bot;`. | +| Error Handling | `model=gpt-4;maxToken` | Ignore invalid entry `maxToken` and only parse `model=gpt-4`. | +| Value Override | `model=gpt-4;model=gpt-4-1106-preview` | If a key is repeated, use the value that appears last; in this case, the value of `model` is `gpt-4-1106-preview`. | Further reading: -- [[RFC] 022 - Default Assistant Parameters Configuration via Environment Variables](https://github.com/lobehub/lobe-chat/discussions/913) +- [\[RFC\] 022 - Default Assistant Parameters Configuration via Environment Variables](https://github.com/lobehub/lobe-chat/discussions/913) ### `FEATURE_FLAGS` diff --git a/docs/self-hosting/environment-variables/basic.zh-CN.mdx b/docs/self-hosting/environment-variables/basic.zh-CN.mdx index 59b5b94ccc2f..82ad02ef8852 100644 --- a/docs/self-hosting/environment-variables/basic.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/basic.zh-CN.mdx @@ -50,22 +50,22 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境 `DEFAULT_AGENT_CONFIG` 用于配置 LobeChat 默认助理的默认配置。它支持多种数据类型和结构,包括键值对、嵌套字段、数组值等。下表详细说明了 `DEFAULT_AGENT_CONFIG` 环境变量的配置项、示例以及相应解释: -| 配置项类型 | 示例 | 解释 | -| --- | --- | --- | -| 基本键值对 | `model=gpt-4` | 设置模型为 `gpt-4`。 | -| 嵌套字段 | `tts.sttLocale=en-US` | 设置文本到语音服务的语言区域为 `en-US`。 | -| 数组 | `plugins=search-engine,lobe-image-designer` | 启用 `search-engine` 和 `lobe-image-designer` 插件。 | -| 中文逗号 | `plugins=search-engine,lobe-image-designer` | 同上,演示支持中文逗号分隔。 | -| 多个配置项 | `model=glm-4;provider=zhipu` | 设置模型为 `glm-4` 且模型服务商为 `zhipu`。 | -| 数字值 | `params.max_tokens=300`, `chatConfig.historyCount=5` | 设置最大令牌数为 `300`,设置历史消息条数为5。 | -| 布尔值 | `chatConfig.enableAutoCreateTopic=true`,`chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | 启用自动创建主题,历史长度压缩阈值,历史记录条数。 | -| 特殊字符 | `inputTemplate="Hello; I am a bot;"` | 设置输入模板为 `Hello; I am a bot;`。 | -| 错误处理 | `model=gpt-4;maxToken` | 忽略无效条目 `maxToken`,仅解析出 `model=gpt-4`。 | -| 值覆盖 | `model=gpt-4;model=gpt-4-1106-preview` | 如果键重复,使用最后一次出现的值,此处 `model` 的值为 `gpt-4-1106-preview`。 | +| 配置项类型 | 示例 | 解释 | +| ----- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | +| 基本键值对 | `model=gpt-4` | 设置模型为 `gpt-4`。 | +| 嵌套字段 | `tts.sttLocale=en-US` | 设置文本到语音服务的语言区域为 `en-US`。 | +| 数组 | `plugins=search-engine,lobe-image-designer` | 启用 `search-engine` 和 `lobe-image-designer` 插件。 | +| 中文逗号 | `plugins=search-engine,lobe-image-designer` | 同上,演示支持中文逗号分隔。 | +| 多个配置项 | `model=glm-4;provider=zhipu` | 设置模型为 `glm-4` 且模型服务商为 `zhipu`。 | +| 数字值 | `params.max_tokens=300`, `chatConfig.historyCount=5` | 设置最大令牌数为 `300`,设置历史消息条数为 5。 | +| 布尔值 | `chatConfig.enableAutoCreateTopic=true`,`chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | 启用自动创建主题,历史长度压缩阈值,历史记录条数。 | +| 特殊字符 | `inputTemplate="Hello; I am a bot;"` | 设置输入模板为 `Hello; I am a bot;`。 | +| 错误处理 | `model=gpt-4;maxToken` | 忽略无效条目 `maxToken`,仅解析出 `model=gpt-4`。 | +| 值覆盖 | `model=gpt-4;model=gpt-4-1106-preview` | 如果键重复,使用最后一次出现的值,此处 `model` 的值为 `gpt-4-1106-preview`。 | 相关阅读: -- [[RFC] 022 - 环境变量配置默认助手参数](https://github.com/lobehub/lobe-chat/discussions/913) +- [\[RFC\] 022 - 环境变量配置默认助手参数](https://github.com/lobehub/lobe-chat/discussions/913) ### `FEATURE_FLAGS` @@ -91,14 +91,14 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境 ### `SSRF_ALLOW_PRIVATE_IP_ADDRESS` - 类型:可选 -- 描述:是否允许连接私有IP地址。在可信环境中可以设置为true来关闭SSRF防护。 +- 描述:是否允许连接私有 IP 地址。在可信环境中可以设置为 true 来关闭 SSRF 防护。 - 默认值:`0` - 示例:`1` or `0` ### `SSRF_ALLOW_IP_ADDRESS_LIST` - 类型:可选 -- 描述:允许连接的私有IP地址列表,多个IP地址时使用逗号分隔。当 `SSRF_ALLOW_PRIVATE_IP_ADDRESS` 为 `0` 时才会生效。 +- 描述:允许连接的私有 IP 地址列表,多个 IP 地址时使用逗号分隔。当 `SSRF_ALLOW_PRIVATE_IP_ADDRESS` 为 `0` 时才会生效。 - 默认值:- - 示例:`198.18.1.62,224.0.0.3` diff --git a/docs/self-hosting/environment-variables/model-provider.mdx b/docs/self-hosting/environment-variables/model-provider.mdx index 71ff9d7be87f..43142ba7aefa 100644 --- a/docs/self-hosting/environment-variables/model-provider.mdx +++ b/docs/self-hosting/environment-variables/model-provider.mdx @@ -482,7 +482,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the ### `AI21_API_KEY` - Type: Required -- Description: This is the API key you applied from AI21_API_KEY service +- Description: This is the API key you applied from `AI21_API_KEY` service - Default: - - Example: `xxxxxx...xxxxxx` diff --git a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx index 24f9b56df4c9..24c8a5cd78e7 100644 --- a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx @@ -430,7 +430,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, ### `AI360_API_KEY` - 类型:必选 -- 描述:这是你在 360智脑 服务平台申请的 API 密钥 +- 描述:这是你在 360 智脑 服务平台申请的 API 密钥 - 默认值:- - 示例:`xxxxxx...xxxxxx` diff --git a/docs/self-hosting/environment-variables/s3.mdx b/docs/self-hosting/environment-variables/s3.mdx index a5bce868f269..6a619a1a19e7 100644 --- a/docs/self-hosting/environment-variables/s3.mdx +++ b/docs/self-hosting/environment-variables/s3.mdx @@ -75,11 +75,10 @@ LobeChat supports multimodal AI sessions, including the ability to upload unstru `path-style` and `virtual-host` are different methods of accessing buckets and objects in S3, with differences in URL structure and domain name resolution. -Assuming the S3 service provider's domain is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are: - -- path-style: `s3.example.net/mybucket/config.env` -- virtual-host: `mybucket.s3.example.net/config.env` + Assuming the S3 service provider's domain is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are: + - path-style: `s3.example.net/mybucket/config.env` + - virtual-host: `mybucket.s3.example.net/config.env` ### `LLM_VISION_IMAGE_USE_BASE64` diff --git a/docs/self-hosting/environment-variables/s3.zh-CN.mdx b/docs/self-hosting/environment-variables/s3.zh-CN.mdx index 711842d48f6e..99d19f8dbd8f 100644 --- a/docs/self-hosting/environment-variables/s3.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/s3.zh-CN.mdx @@ -10,7 +10,7 @@ tags: # 配置 S3 存储服务 -LobeChat 支持多模态的 AI 会话,包括将图片、文件等非结构化数据上传给大模型的功能。为了优化存储和性能,我们使用 S3 兼容的文件存储服务来存储图片文件和支持文件上传/知识库功能。 +LobeChat 支持多模态的 AI 会话,包括将图片、文件等非结构化数据上传给大模型的功能。为了优化存储和性能,我们使用 S3 兼容的文件存储服务来存储图片文件和支持文件上传 / 知识库功能。 ## 核心环境变量 @@ -71,14 +71,12 @@ LobeChat 支持多模态的 AI 会话,包括将图片、文件等非结构化 - 示例:`1` + `path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样 -`path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样 - -假设 S3 服务商的域名是 s3.example.net ,bucket为mybucket,object为config.env,具体区别如下: - -- path-style : `s3.example.net/mybucket/config.env` -- virtual-host : `mybucket.s3.example.net/config.env` + 假设 S3 服务商的域名是 s3.example.net ,bucket 为 mybucket,object 为 config.env,具体区别如下: + - path-style : `s3.example.net/mybucket/config.env` + - virtual-host : `mybucket.s3.example.net/config.env` ### `LLM_VISION_IMAGE_USE_BASE64` diff --git a/docs/self-hosting/examples/azure-openai.mdx b/docs/self-hosting/examples/azure-openai.mdx index 30ce886e271f..d79867f0a831 100644 --- a/docs/self-hosting/examples/azure-openai.mdx +++ b/docs/self-hosting/examples/azure-openai.mdx @@ -19,17 +19,14 @@ LobeChat supports using [Azure OpenAI](https://learn.microsoft.com/zh-cn/azure/a Click in the bottom left corner "Actions" - "Settings", then switch to the "Language Model" tab and enable the "Azure OpenAI" switch to start using Azure OpenAI. -Configuring in the Interface +Configuring in the Interface You can fill in the corresponding configuration items as needed: - **API Key**: The API key you applied for on the Azure OpenAI account page, which can be found in the "Keys and Endpoints" section. - **API Address**: Azure API address, which can be found in the "Keys and Endpoints" section when checking resources in the Azure portal. - **Azure API Version**: The API version of Azure, following the format YYYY-MM-DD. Refer to the [latest version](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions). -- ** Model List**: set your model list +- \*\* Model List\*\*: set your model list After completing the configuration of the above fields, click "Check". If it prompts "Check passed", it means the configuration was successful. @@ -37,10 +34,10 @@ After completing the configuration of the above fields, click "Check". If it pro If you want the deployed version to be pre-configured with Azure OpenAI for end users to use directly, you need to configure the following environment variables during deployment: -| Environment Variable | Type | Description | Default Value | Example | -| --- | --- | --- | --- | --- | -| `AZURE_API_KEY` | Required | This is the API key you obtained from the Azure OpenAI account page | - | `c55168be3874490ef0565d9779ecd5a6` | -| `AZURE_ENDPOINT` | Required | Azure API address, can be found in the "Keys and Endpoints" section when checking resources in the Azure portal | - | `https://docs-test-001.openai.azure.com` | -| `AZURE_API_VERSION` | Required | Azure API version, following the format YYYY-MM-DD | 2023-08-01-preview | `-`, see [latest version](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions) | -| `AZURE_MODEL_LIST` | Required | Used to control the model list, use `+` to add a model, use `-` to hide a model, use `id->deplymentName=displayName` to customize the display name of a model, separated by commas. Definition syntax rules see [Model List](/docs/self-hosting/advanced/model-list) | - | `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` or `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>` | -| `ACCESS_CODE` | Optional | Add a password to access LobeChat. You can set a long password to prevent brute force attacks. When this value is separated by commas, it becomes an array of passwords | - | `awCT74` or `e3@09!` or `code1,code2,code3` | +| Environment Variable | Type | Description | Default Value | Example | +| -------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------- | +| `AZURE_API_KEY` | Required | This is the API key you obtained from the Azure OpenAI account page | - | `c55168be3874490ef0565d9779ecd5a6` | +| `AZURE_ENDPOINT` | Required | Azure API address, can be found in the "Keys and Endpoints" section when checking resources in the Azure portal | - | `https://docs-test-001.openai.azure.com` | +| `AZURE_API_VERSION` | Required | Azure API version, following the format YYYY-MM-DD | 2023-08-01-preview | `-`, see [latest version](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions) | +| `AZURE_MODEL_LIST` | Required | Used to control the model list, use `+` to add a model, use `-` to hide a model, use `id->deplymentName=displayName` to customize the display name of a model, separated by commas. Definition syntax rules see [Model List](/docs/self-hosting/advanced/model-list) | - | `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` or `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>` | +| `ACCESS_CODE` | Optional | Add a password to access LobeChat. You can set a long password to prevent brute force attacks. When this value is separated by commas, it becomes an array of passwords | - | `awCT74` or `e3@09!` or `code1,code2,code3` | diff --git a/docs/self-hosting/examples/azure-openai.zh-CN.mdx b/docs/self-hosting/examples/azure-openai.zh-CN.mdx index 31700ece81fd..f875ccac7651 100644 --- a/docs/self-hosting/examples/azure-openai.zh-CN.mdx +++ b/docs/self-hosting/examples/azure-openai.zh-CN.mdx @@ -19,10 +19,7 @@ LobeChat 支持使用 [Azure OpenAI](https://learn.microsoft.com/zh-cn/azure/ai- 点击左下角「操作」 -「设置」,切到 「语言模型」 Tab 后通过开启「Azure OpenAI」开关,即可开启使用 Azure OpenAI。 -在界面中配置 +在界面中配置 你按需填写相应的配置项: @@ -39,10 +36,10 @@ LobeChat 支持使用 [Azure OpenAI](https://learn.microsoft.com/zh-cn/azure/ai- 如果你希望部署的版本直接配置好 Azure OpenAI,让终端用户直接使用,那么你需要在部署时配置以下环境变量: -| 环境变量 | 类型 | 描述 | 默认值 | 示例 | -| --- | --- | --- | --- | --- | -| `AZURE_API_KEY` | 必选 | 这是你在 Azure OpenAI 账户页面申请的 API 密钥 | - | `c55168be3874490ef0565d9779ecd5a6` | -| `AZURE_ENDPOINT` | 必选 | Azure API 地址,从 Azure 门户检查资源时,可在 “密钥和终结点” 部分中找到此值 | - | `https://docs-test-001.openai.azure.com` | -| `AZURE_API_VERSION` | 必选 | Azure 的 API 版本,遵循 YYYY-MM-DD 格式 | 2023-08-01-preview | `-`,查阅[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions) | -| `AZURE_MODEL_LIST` | 必选 | 用来控制模型列表,使用 `模型名->部署名=展示名` 来自定义模型的展示名,用英文逗号隔开。支持扩展能力,其余语法规则详见 [模型列表](/zh/docs/self-hosting/advanced/model-list) | - | `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` 或 `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>` | -| `ACCESS_CODE` | 可选 | 添加访问 LobeChat 的密码,你可以设置一个长密码以防被爆破,该值用逗号分隔时为密码数组 | - | `awCT74` 或 `e3@09!` or `code1,code2,code3` | +| 环境变量 | 类型 | 描述 | 默认值 | 示例 | +| ------------------- | -- | --------------------------------------------------------------------------------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------- | +| `AZURE_API_KEY` | 必选 | 这是你在 Azure OpenAI 账户页面申请的 API 密钥 | - | `c55168be3874490ef0565d9779ecd5a6` | +| `AZURE_ENDPOINT` | 必选 | Azure API 地址,从 Azure 门户检查资源时,可在 “密钥和终结点” 部分中找到此值 | - | `https://docs-test-001.openai.azure.com` | +| `AZURE_API_VERSION` | 必选 | Azure 的 API 版本,遵循 YYYY-MM-DD 格式 | 2023-08-01-preview | `-`,查阅[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions) | +| `AZURE_MODEL_LIST` | 必选 | 用来控制模型列表,使用 `模型名->部署名=展示名` 来自定义模型的展示名,用英文逗号隔开。支持扩展能力,其余语法规则详见 [模型列表](/zh/docs/self-hosting/advanced/model-list) | - | `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` 或 `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>` | +| `ACCESS_CODE` | 可选 | 添加访问 LobeChat 的密码,你可以设置一个长密码以防被爆破,该值用逗号分隔时为密码数组 | - | `awCT74` 或 `e3@09!` or `code1,code2,code3` | diff --git a/docs/self-hosting/examples/ollama.mdx b/docs/self-hosting/examples/ollama.mdx index 1ff70552d956..bb5f60121a05 100644 --- a/docs/self-hosting/examples/ollama.mdx +++ b/docs/self-hosting/examples/ollama.mdx @@ -40,13 +40,13 @@ When you first initiate Ollama, it is configured to allow access only from the l ### Ollama Environment Variables -| Environment Variable | Description | Default Value | Additional Information | -| --- | --- | --- | --- | -| `OLLAMA_HOST` | Specifies the host and port for binding | "127.0.0.1:11434" | Use "0.0.0.0:port" to make the service accessible from any machine | -| `OLLAMA_ORIGINS` | Comma-separated list of permitted cross-origin sources | Restricted to local access | Set to "\*" to avoid CORS, please set on demand | -| `OLLAMA_MODELS` | Path to the directory where models are located | "~/.ollama/models" or "/usr/share/ollama/.ollama/models" | Can be customized based on requirements | -| `OLLAMA_KEEP_ALIVE` | Duration that the model stays loaded in GPU memory | "5m" | Dynamically loading and unloading models can reduce GPU load but may increase disk I/O | -| `OLLAMA_DEBUG` | Enable additional debugging logs by setting to 1 | Typically disabled | | +| Environment Variable | Description | Default Value | Additional Information | +| -------------------- | ------------------------------------------------------ | --------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `OLLAMA_HOST` | Specifies the host and port for binding | "127.0.0.1:11434" | Use "0.0.0.0:port" to make the service accessible from any machine | +| `OLLAMA_ORIGINS` | Comma-separated list of permitted cross-origin sources | Restricted to local access | Set to "\*" to avoid CORS, please set on demand | +| `OLLAMA_MODELS` | Path to the directory where models are located | "\~/.ollama/models" or "/usr/share/ollama/.ollama/models" | Can be customized based on requirements | +| `OLLAMA_KEEP_ALIVE` | Duration that the model stays loaded in GPU memory | "5m" | Dynamically loading and unloading models can reduce GPU load but may increase disk I/O | +| `OLLAMA_DEBUG` | Enable additional debugging logs by setting to 1 | Typically disabled | | ### Setting environment variables on Windows @@ -90,6 +90,7 @@ If Ollama is run as a systemd service, environment variables should be set using ``` 3. Save and exit. + 4. Reload `systemd` and restart Ollama: ```bash diff --git a/docs/self-hosting/examples/ollama.zh-CN.mdx b/docs/self-hosting/examples/ollama.zh-CN.mdx index e7e82af5c483..2ce219204bc5 100644 --- a/docs/self-hosting/examples/ollama.zh-CN.mdx +++ b/docs/self-hosting/examples/ollama.zh-CN.mdx @@ -38,13 +38,13 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 ### Ollama 环境变量 -| 环境变量 | 描述 | 默认值 | 附加说明 | -| --- | --- | --- | --- | -| `OLLAMA_HOST` | 绑定的主机和端口 | "127.0.0.1:11434" | 设置 0.0.0.0:端口号 可以指定所有人访问特定端口 | -| `OLLAMA_ORIGINS` | 允许的跨域源列表,逗号分隔 | 仅本地访问 | 设置 "\*" 可以避免 CORS 跨域错误,按需设置 | -| `OLLAMA_MODELS` | 模型存放的路径 | "~/.ollama/models" 或 "/usr/share/ollama/.ollama/models" | 按需指定 | -| `OLLAMA_KEEP_ALIVE` | 模型在显存中保持加载的持续时间 | "5m" | 按需加载和释放显存可以有效降低显卡压力,但会增加硬盘读写 | -| `OLLAMA_DEBUG` | 设置为 1 以启用额外的调试日志 | 默认关闭 | | +| 环境变量 | 描述 | 默认值 | 附加说明 | +| ------------------- | ---------------- | -------------------------------------------------------- | ----------------------------- | +| `OLLAMA_HOST` | 绑定的主机和端口 | "127.0.0.1:11434" | 设置 0.0.0.0: 端口号 可以指定所有人访问特定端口 | +| `OLLAMA_ORIGINS` | 允许的跨域源列表,逗号分隔 | 仅本地访问 | 设置 "\*" 可以避免 CORS 跨域错误,按需设置 | +| `OLLAMA_MODELS` | 模型存放的路径 | "\~/.ollama/models" 或 "/usr/share/ollama/.ollama/models" | 按需指定 | +| `OLLAMA_KEEP_ALIVE` | 模型在显存中保持加载的持续时间 | "5m" | 按需加载和释放显存可以有效降低显卡压力,但会增加硬盘读写 | +| `OLLAMA_DEBUG` | 设置为 1 以启用额外的调试日志 | 默认关闭 | | ### 在 Windows 上设置环境变量 @@ -88,6 +88,7 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 ``` 3. 保存并退出。 + 4. 重载`systemd`并重启 Ollama: ```bash diff --git a/docs/self-hosting/platform/alibaba-cloud.mdx b/docs/self-hosting/platform/alibaba-cloud.mdx index eead36e8deca..c0cc3ec92a94 100644 --- a/docs/self-hosting/platform/alibaba-cloud.mdx +++ b/docs/self-hosting/platform/alibaba-cloud.mdx @@ -18,17 +18,15 @@ If you want to deploy LobeChat on Alibaba Cloud, you can follow the steps below: ## Alibaba Cloud Deployment Process + ### Prepare your API Key -### Prepare your API Key + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. Or go to [Tongyi Qianwen API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) to get your API Key. -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. Or go to [Tongyi Qianwen API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) to get your API Key. + ### One-click to deploy -### One-click to deploy - -[![][deploy-button-image]][deploy-link] - -### Once deployed, you can start using it + [![][deploy-button-image]][deploy-link] + ### Once deployed, you can start using it [deploy-button-image]: https://service-info-public.oss-cn-hangzhou.aliyuncs.com/computenest-en.svg diff --git a/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx b/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx index b8bf26d6e2a1..b7395f167cc7 100644 --- a/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +++ b/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx @@ -15,17 +15,15 @@ tags: ## 阿里云 部署流程 + ### 准备好你的 API Key -### 准备好你的 API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key 或 前往 [通义千问 API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) 获取你的通义千问 API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key 或 前往 [通义千问 API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) 获取你的通义千问 API Key + ### 点击下方按钮进行部署 -### 点击下方按钮进行部署 - -[![][deploy-button-image]][deploy-link] - -### 部署完毕后,即可开始使用 + [![][deploy-button-image]][deploy-link] + ### 部署完毕后,即可开始使用 [deploy-button-image]: https://service-info-public.oss-cn-hangzhou.aliyuncs.com/computenest-en.svg diff --git a/docs/self-hosting/platform/btpanel.mdx b/docs/self-hosting/platform/btpanel.mdx index c6163aea6e6c..53cebc1e5e7e 100644 --- a/docs/self-hosting/platform/btpanel.mdx +++ b/docs/self-hosting/platform/btpanel.mdx @@ -21,10 +21,11 @@ To install aaPanel, go to the [aaPanel](https://www.aapanel.com/new/download.htm 2. The first time you will be prompted to install the `Docker` and `Docker Compose` services, click Install Now. If it is already installed, please ignore it. ![install2](https://github.com/user-attachments/assets/e269bd27-d323-43ba-811b-c0f5e4137903) -3. After the installation is complete, find `LobeChat` in `One-Click Install` and click `install` +3. After the installation is complete, find `LobeChat` in `One-Click Install` and click `install`\ ![install-LobeChat](https://github.com/user-attachments/assets/9f989104-bb8e-4acd-9721-6b1db1017d2b) -4. configure basic information such as the domain name, OpenAI API key, and port to complete the installation Note: The domain name is optional, if the domain name is filled, it can be managed through [Website]--> [Proxy Project], and you do not need to check [Allow external access] after filling in the domain name, otherwise you need to check it before you can access it through the port ![addLobeChat](https://github.com/user-attachments/assets/f0b2e72d-9eee-46a8-b094-4834b78764df) +4. configure basic information such as the domain name, OpenAI API key, and port to complete the installation Note: The domain name is optional, if the domain name is filled, it can be managed through \[Website]--> \[Proxy Project], and you do not need to check \[Allow external access] after filling in the domain name, otherwise you need to check it before you can access it through the port ![addLobeChat](https://github.com/user-attachments/assets/f0b2e72d-9eee-46a8-b094-4834b78764df) + 5. After installation, enter the domain name or IP+ port set in the previous step in the browser to access. - Name: application name, default `LobeChat-random characters` diff --git a/docs/self-hosting/platform/btpanel.zh-CN.mdx b/docs/self-hosting/platform/btpanel.zh-CN.mdx index f7b168dd641f..8f088d2fca41 100644 --- a/docs/self-hosting/platform/btpanel.zh-CN.mdx +++ b/docs/self-hosting/platform/btpanel.zh-CN.mdx @@ -13,7 +13,7 @@ tags: ## 前提 -- 仅适用于宝塔面板9.2.0及以上版本 +- 仅适用于宝塔面板 9.2.0 及以上版本 - 安装宝塔面板,前往[宝塔面板](https://www.bt.cn/new/download.html)官网,选择正式版的脚本下载安装 ## 部署 @@ -35,8 +35,8 @@ tags: - OpenAI API 密钥:请输入您的 Open API 密钥 - OpenAI 代理 URL:默认为官方地址 - OpenAI 模型列表:输入使用的模型 -- CPU 核心数限制:0为不限制,根据实际需要设置 -- 内存限制:0为不限制,根据实际需要设置 +- CPU 核心数限制:0 为不限制,根据实际需要设置 +- 内存限制:0 为不限制,根据实际需要设置 5. 提交后面板会自动进行应用初始化,大概需要`1-3`分钟,初始化完成后即可访问。 diff --git a/docs/self-hosting/platform/docker-compose.mdx b/docs/self-hosting/platform/docker-compose.mdx index 66cc38cd2037..4934b73ebca4 100644 --- a/docs/self-hosting/platform/docker-compose.mdx +++ b/docs/self-hosting/platform/docker-compose.mdx @@ -15,124 +15,114 @@ tags: # Docker Compose Deployment Guide
+ [![][docker-release-shield]][docker-release-link] -[![][docker-release-shield]][docker-release-link] - -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
We provide a [Docker image][docker-release-link] for deploying the LobeChat service on your private device. + ### Install Docker Container Environment -### Install Docker Container Environment - -(Skip this step if already installed) - - - - - -```fish -$ apt install docker.io -``` - - - - - -```fish -$ yum install docker -``` - - + (Skip this step if already installed) - + + + ```fish + $ apt install docker.io + ``` + -### Run Docker Compose Deployment Command + + ```fish + $ yum install docker + ``` + + -When using `docker-compose`, the configuration file is as follows: + ### Run Docker Compose Deployment Command -```yml -version: '3.8' + When using `docker-compose`, the configuration file is as follows: -services: - lobe-chat: - image: lobehub/lobe-chat - container_name: lobe-chat - restart: always - ports: - - '3210:3210' - environment: - OPENAI_API_KEY: sk-xxxx - OPENAI_PROXY_URL: https://api-proxy.com/v1 - ACCESS_CODE: lobe66 -``` + ```yml + version: '3.8' -Run the following command to start the Lobe Chat service: + services: + lobe-chat: + image: lobehub/lobe-chat + container_name: lobe-chat + restart: always + ports: + - '3210:3210' + environment: + OPENAI_API_KEY: sk-xxxx + OPENAI_PROXY_URL: https://api-proxy.com/v1 + ACCESS_CODE: lobe66 + ``` -```bash -$ docker-compose up -d -``` + Run the following command to start the Lobe Chat service: -### Crontab Automatic Update Script (Optional) + ```bash + $ docker-compose up -d + ``` -Similarly, you can use the following script to automatically update Lobe Chat. When using `Docker Compose`, no additional configuration of environment variables is required. + ### Crontab Automatic Update Script (Optional) -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + Similarly, you can use the following script to automatically update Lobe Chat. When using `Docker Compose`, no additional configuration of environment variables is required. -# Set proxy (optional) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# Pull the latest image and store the output in a variable -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # Set proxy (optional) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# Check if the pull command was executed successfully -if [ $? -ne 0 ]; then - exit 1 -fi + # Pull the latest image and store the output in a variable + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# Check if the output contains a specific string -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # Check if the pull command was executed successfully + if [ $? -ne 0 ]; then + exit 1 + fi -# If the image is already up to date, do nothing -if [ $? -eq 0 ]; then - exit 0 -fi + # Check if the output contains a specific string + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -echo "Detected Lobe-Chat update" + # If the image is already up to date, do nothing + if [ $? -eq 0 ]; then + exit 0 + fi -# Remove the old container -echo "Removed: $(docker rm -f Lobe-Chat)" + echo "Detected Lobe-Chat update" -# You may need to navigate to the directory where `docker-compose.yml` is located first -# cd /path/to/docker-compose-folder + # Remove the old container + echo "Removed: $(docker rm -f Lobe-Chat)" -# Run the new container -echo "Started: $(docker-compose up)" + # You may need to navigate to the directory where `docker-compose.yml` is located first + # cd /path/to/docker-compose-folder -# Print the update time and version -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # Run the new container + echo "Started: $(docker-compose up)" -# Clean up unused images -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` + # Print the update time and version + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. + # Clean up unused images + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -Configure Crontab to execute the script every 5 minutes: + This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + Configure Crontab to execute the script every 5 minutes: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat diff --git a/docs/self-hosting/platform/docker-compose.zh-CN.mdx b/docs/self-hosting/platform/docker-compose.zh-CN.mdx index ac281712c24d..3694ddd79718 100644 --- a/docs/self-hosting/platform/docker-compose.zh-CN.mdx +++ b/docs/self-hosting/platform/docker-compose.zh-CN.mdx @@ -12,122 +12,112 @@ tags: # Docker Compose 部署指引
+ [![](https://img.shields.io/docker/v/lobehub/lobe-chat?color=369eff\&label=docker\&labelColor=black\&logo=docker\&logoColor=white\&style=flat-square)](https://hub.docker.com/r/lobehub/lobe-chat) -[![](https://img.shields.io/docker/v/lobehub/lobe-chat?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square)](https://hub.docker.com/r/lobehub/lobe-chat) - -[![](https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff&labelColor=black&style=flat-square)](https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff&labelColor=black&style=flat-square) - -[![](https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square)](https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square) + [![](https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff\&labelColor=black\&style=flat-square)](https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff\&labelColor=black\&style=flat-square) + [![](https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11\&labelColor=black\&style=flat-square)](https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11\&labelColor=black\&style=flat-square)
我们提供了 [Docker 镜像](https://hub.docker.com/r/lobehub/lobe-chat) ,供你在自己的私有设备上部署 LobeChat 服务。 + ### 安装 Docker 容器环境 -### 安装 Docker 容器环境 - -(如果已安装,请跳过此步) - - - - - -```fish -$ apt install docker.io -``` - - - - - -```fish -$ yum install docker -``` - - + (如果已安装,请跳过此步) - + + + ```fish + $ apt install docker.io + ``` + -### 运行 Docker Compose 部署指令 + + ```fish + $ yum install docker + ``` + + -使用 `docker-compose` 时配置文件如下: + ### 运行 Docker Compose 部署指令 -```yml -version: '3.8' + 使用 `docker-compose` 时配置文件如下: -services: - lobe-chat: - image: lobehub/lobe-chat - container_name: lobe-chat - restart: always - ports: - - '3210:3210' - environment: - OPENAI_API_KEY: sk-xxxx - OPENAI_PROXY_URL: https://api-proxy.com/v1 - ACCESS_CODE: lobe66 -``` + ```yml + version: '3.8' -运行以下命令启动 Lobe Chat 服务: + services: + lobe-chat: + image: lobehub/lobe-chat + container_name: lobe-chat + restart: always + ports: + - '3210:3210' + environment: + OPENAI_API_KEY: sk-xxxx + OPENAI_PROXY_URL: https://api-proxy.com/v1 + ACCESS_CODE: lobe66 + ``` -```bash -$ docker-compose up -d -``` + 运行以下命令启动 Lobe Chat 服务: -### Crontab 自动更新脚本(可选) + ```bash + $ docker-compose up -d + ``` -类似地,你可以使用以下脚本来自动更新 Lobe Chat,使用 `Docker Compose` 时,环境变量无需额外配置。 + ### Crontab 自动更新脚本(可选) -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + 类似地,你可以使用以下脚本来自动更新 Lobe Chat,使用 `Docker Compose` 时,环境变量无需额外配置。 -# Set proxy (optional) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# Pull the latest image and store the output in a variable -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # Set proxy (optional) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# Check if the pull command was executed successfully -if [ $? -ne 0 ]; then - exit 1 -fi + # Pull the latest image and store the output in a variable + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# Check if the output contains a specific string -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # Check if the pull command was executed successfully + if [ $? -ne 0 ]; then + exit 1 + fi -# If the image is already up to date, do nothing -if [ $? -eq 0 ]; then - exit 0 -fi + # Check if the output contains a specific string + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -echo "Detected Lobe-Chat update" + # If the image is already up to date, do nothing + if [ $? -eq 0 ]; then + exit 0 + fi -# Remove the old container -echo "Removed: $(docker rm -f Lobe-Chat)" + echo "Detected Lobe-Chat update" -# You may need to navigate to the directory where `docker-compose.yml` is located first -# cd /path/to/docker-compose-folder + # Remove the old container + echo "Removed: $(docker rm -f Lobe-Chat)" -# Run the new container -echo "Started: $(docker-compose up)" + # You may need to navigate to the directory where `docker-compose.yml` is located first + # cd /path/to/docker-compose-folder -# Print the update time and version -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # Run the new container + echo "Started: $(docker-compose up)" -# Clean up unused images -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` + # Print the update time and version + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. + # Clean up unused images + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -Configure Crontab to execute the script every 5 minutes: + This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + Configure Crontab to execute the script every 5 minutes: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` diff --git a/docs/self-hosting/platform/docker.mdx b/docs/self-hosting/platform/docker.mdx index 3b8fc8fb6031..bc50015d5033 100644 --- a/docs/self-hosting/platform/docker.mdx +++ b/docs/self-hosting/platform/docker.mdx @@ -16,10 +16,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
We provide a [Docker image][docker-release-link] for you to deploy the LobeChat service on your private device. @@ -27,138 +26,134 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat ### Install Docker Container Environment -(If already installed, skip this step) + (If already installed, skip this step) ```fish $ apt install docker.io ``` - - + ```fish $ yum install docker ``` + + - - - - -### Docker Command Deployment - -Use the following command to start the LobeChat service with one click: + ### Docker Command Deployment -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + Use the following command to start the LobeChat service with one click: -Command explanation: + ```fish + $ docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` -- The default port mapping is `3210`, please ensure it is not occupied or manually change the port mapping. + Command explanation: -- Replace `sk-xxxx` in the above command with your OpenAI API Key. + - The default port mapping is `3210`, please ensure it is not occupied or manually change the port mapping. -- For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/docs/self-hosting/environment-variables) section. + - Replace `sk-xxxx` in the above command with your OpenAI API Key. - - Since the official Docker image build takes about half an hour, if you see the "update available" - prompt after deployment, you can wait for the image to finish building before deploying again. - + - For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/docs/self-hosting/environment-variables) section. - - The official Docker image does not have a password set. It is strongly recommended to add a - password to enhance security, otherwise you may encounter situations like [My API Key was - stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123). - + + Since the official Docker image build takes about half an hour, if you see the "update available" + prompt after deployment, you can wait for the image to finish building before deploying again. + - - Note that when the **deployment architecture is inconsistent with the image**, you need to - cross-compile **Sharp**, see [Sharp - Cross-Compilation](https://sharp.pixelplumbing.com/install#cross-platform) for details. - + + The official Docker image does not have a password set. It is strongly recommended to add a + password to enhance security, otherwise you may encounter situations like [My API Key was + stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123). + -#### Using a Proxy Address + + Note that when the **deployment architecture is inconsistent with the image**, you need to + cross-compile **Sharp**, see [Sharp + Cross-Compilation](https://sharp.pixelplumbing.com/install#cross-platform) for details. + -If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable: + #### Using a Proxy Address -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable: -### Crontab Automatic Update Script (Optional) + ```fish + $ docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` -If you want to automatically obtain the latest image, you can follow these steps. + ### Crontab Automatic Update Script (Optional) -First, create a `lobe.env` configuration file with various environment variables, for example: + If you want to automatically obtain the latest image, you can follow these steps. -```env -OPENAI_API_KEY=sk-xxxx -OPENAI_PROXY_URL=https://api-proxy.com/v1 -ACCESS_CODE=arthals2333 -OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision -``` + First, create a `lobe.env` configuration file with various environment variables, for example: -Then, you can use the following script to automate the update: + ```env + OPENAI_API_KEY=sk-xxxx + OPENAI_PROXY_URL=https://api-proxy.com/v1 + ACCESS_CODE=arthals2333 + OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision + ``` -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + Then, you can use the following script to automate the update: -# Set up proxy (optional) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# Pull the latest image and store the output in a variable -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # Set up proxy (optional) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# Check if the pull command was executed successfully -if [ $? -ne 0 ]; then - exit 1 -fi + # Pull the latest image and store the output in a variable + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# Check if the output contains a specific string -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # Check if the pull command was executed successfully + if [ $? -ne 0 ]; then + exit 1 + fi -# If the image is already up to date, do nothing -if [ $? -eq 0 ]; then - exit 0 -fi + # Check if the output contains a specific string + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -echo "Detected Lobe-Chat update" + # If the image is already up to date, do nothing + if [ $? -eq 0 ]; then + exit 0 + fi -# Remove the old container -echo "Removed: $(docker rm -f Lobe-Chat)" + echo "Detected Lobe-Chat update" -# Run the new container -echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)" + # Remove the old container + echo "Removed: $(docker rm -f Lobe-Chat)" -# Print the update time and version -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # Run the new container + echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)" -# Clean up unused images -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` + # Print the update time and version + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -This script can be used in Crontab, but please ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. + # Clean up unused images + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -Configure Crontab to execute the script every 5 minutes: + This script can be used in Crontab, but please ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + Configure Crontab to execute the script every 5 minutes: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat diff --git a/docs/self-hosting/platform/docker.zh-CN.mdx b/docs/self-hosting/platform/docker.zh-CN.mdx index f0de6c82dc99..66feb8c0c7c8 100644 --- a/docs/self-hosting/platform/docker.zh-CN.mdx +++ b/docs/self-hosting/platform/docker.zh-CN.mdx @@ -15,10 +15,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
我们提供了 [Docker 镜像][docker-release-link],供你在自己的私有设备上部署 LobeChat 服务。 @@ -28,138 +27,134 @@ tags: ### 安装 Docker 容器环境 -(如果已安装,请跳过此步) + (如果已安装,请跳过此步) ```fish $ apt install docker.io ``` - - + ```fish $ yum install docker ``` + + - - - + ### Docker 指令部署 -### Docker 指令部署 + 使用以下命令即可使用一键启动 LobeChat 服务: -使用以下命令即可使用一键启动 LobeChat 服务: + ```fish + $ docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + 指令说明: -指令说明: - -- 默认映射端口为 `3210`, 请确保未被占用或手动更改端口映射 -- 使用你的 OpenAI API Key 替换上述命令中的 `sk-xxxx` ,获取 API Key 的方式详见最后一节。 - - - LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) - 部分 - + - 默认映射端口为 `3210`, 请确保未被占用或手动更改端口映射 + - 使用你的 OpenAI API Key 替换上述命令中的 `sk-xxxx` ,获取 API Key 的方式详见最后一节。 - - 由于官方的 Docker - 镜像构建大约需要半小时左右,如果在更新部署后会出现「存在更新」的提示,可以等待镜像构建完成后再次部署。 - + + LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) + 部分 + - - 官方 Docker 镜像中未设定密码,强烈建议添加密码以提升安全性,否则你可能会遇到 [My API Key was - stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123) 这样的情况 - + + 由于官方的 Docker + 镜像构建大约需要半小时左右,如果在更新部署后会出现「存在更新」的提示,可以等待镜像构建完成后再次部署。 + - - 注意,当**部署架构与镜像的不一致时**,需要对 **Sharp** 进行交叉编译,详见 [Sharp - 交叉编译](https://sharp.pixelplumbing.com/install#cross-platform) - + + 官方 Docker 镜像中未设定密码,强烈建议添加密码以提升安全性,否则你可能会遇到 [My API Key was + stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123) 这样的情况 + -#### 使用代理地址 + + 注意,当**部署架构与镜像的不一致时**,需要对 **Sharp** 进行交叉编译,详见 [Sharp + 交叉编译](https://sharp.pixelplumbing.com/install#cross-platform) + -如果你需要通过代理使用 OpenAI 服务,你可以使用 `OPENAI_PROXY_URL` 环境变量来配置代理地址: + #### 使用代理地址 -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + 如果你需要通过代理使用 OpenAI 服务,你可以使用 `OPENAI_PROXY_URL` 环境变量来配置代理地址: -### Crontab 自动更新脚本(可选) + ```fish + $ docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` -如果你想自动获得最新的镜像,你可以如下操作。 + ### Crontab 自动更新脚本(可选) -首先,新建一个 `lobe.env` 配置文件,内容为各种环境变量,例如: + 如果你想自动获得最新的镜像,你可以如下操作。 -```env -OPENAI_API_KEY=sk-xxxx -OPENAI_PROXY_URL=https://api-proxy.com/v1 -ACCESS_CODE=arthals2333 -OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision -``` + 首先,新建一个 `lobe.env` 配置文件,内容为各种环境变量,例如: -然后,你可以使用以下脚本来自动更新: + ```env + OPENAI_API_KEY=sk-xxxx + OPENAI_PROXY_URL=https://api-proxy.com/v1 + ACCESS_CODE=arthals2333 + OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision + ``` -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + 然后,你可以使用以下脚本来自动更新: -# 设置代理(可选) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# 拉取最新的镜像并将输出存储在变量中 -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # 设置代理(可选) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# 检查拉取命令是否成功执行 -if [ $? -ne 0 ]; then - exit 1 -fi + # 拉取最新的镜像并将输出存储在变量中 + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# 检查输出中是否包含特定的字符串 -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # 检查拉取命令是否成功执行 + if [ $? -ne 0 ]; then + exit 1 + fi -# 如果镜像已经是最新的,则不执行任何操作 -if [ $? -eq 0 ]; then - exit 0 -fi + # 检查输出中是否包含特定的字符串 + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -echo "Detected Lobe-Chat update" + # 如果镜像已经是最新的,则不执行任何操作 + if [ $? -eq 0 ]; then + exit 0 + fi -# 删除旧的容器 -echo "Removed: $(docker rm -f Lobe-Chat)" + echo "Detected Lobe-Chat update" -# 运行新的容器 -echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)" + # 删除旧的容器 + echo "Removed: $(docker rm -f Lobe-Chat)" -# 打印更新的时间和版本 -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # 运行新的容器 + echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)" -# 清理不再使用的镜像 -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` + # 打印更新的时间和版本 + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -此脚本可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。 + # 清理不再使用的镜像 + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -配置 Crontab,每 5 分钟执行一次脚本: + 此脚本可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。 -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + 配置 Crontab,每 5 分钟执行一次脚本: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` ## 获取 OpenAI API Key @@ -172,31 +167,17 @@ API Key 是使用 LobeChat 进行大语言模型会话的必要信息,本节 - 注册完毕后,前往 [API Keys](https://platform.openai.com/api-keys) 页面,点击 `Create new secret key` 创建新的 API Key: + #### 步骤 1:打开创建窗口 -#### 步骤 1:打开创建窗口 - -{'打开创建窗口'} - -#### 步骤 2:创建 API Key + {'打开创建窗口'} -{'创建 + #### 步骤 2:创建 API Key -#### 步骤 3:获取 API Key + {'创建 -{'获取 + #### 步骤 3:获取 API Key + {'获取 将此 API Key 填写到 LobeChat 的 API Key 配置中,即可开始使用。 @@ -211,8 +192,8 @@ API Key 是使用 LobeChat 进行大语言模型会话的必要信息,本节 如果你发现注册 OpenAI 账户或者绑定外币信用卡比较麻烦,可以考虑借助一些知名的 OpenAI 第三方代理商来获取 API Key,这可以有效降低获取 OpenAI API Key 的门槛。但与此同时,一旦使用三方服务,你可能也需要承担潜在的风险,请根据你自己的实际情况自行决策。以下是常见的第三方模型代理商列表,供你参考: -| Logo | 服务商 | 特性说明 | Proxy 代理地址 | 链接 | -| --- | --- | --- | --- | --- | +| Logo | 服务商 | 特性说明 | Proxy 代理地址 | 链接 | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------------- | ------------------------- | ----------------------------- | | | **AiHubMix** | 使用 OpenAI 企业接口,全站模型价格为官方 **86 折**(含 GPT-4 、Cluade 3.5 等) | `https://aihubmix.com/v1` | [获取](https://lobe.li/CnsM6fH) | diff --git a/docs/self-hosting/platform/netlify.mdx b/docs/self-hosting/platform/netlify.mdx index f20084b5f2b1..7b86e482e7d7 100644 --- a/docs/self-hosting/platform/netlify.mdx +++ b/docs/self-hosting/platform/netlify.mdx @@ -22,129 +22,79 @@ If you want to deploy LobeChat on Netlify, you can follow these steps: ### Fork the LobeChat Repository -Click the Fork button to fork the LobeChat repository to your GitHub account. + Click the Fork button to fork the LobeChat repository to your GitHub account. -### Prepare your OpenAI API Key + ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to obtain your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to obtain your OpenAI API Key. -### Import to Netlify Workspace + ### Import to Netlify Workspace - - After testing, it is currently not supported to have a one-click deployment button similar to - Vercel/Zeabur. The reason is unknown. Therefore, manual import is required. - + + After testing, it is currently not supported to have a one-click deployment button similar to + Vercel/Zeabur. The reason is unknown. Therefore, manual import is required. + -Click "Import from git" + Click "Import from git" -{'Click + {'Click -Then click "Deploy with Github" and authorize Netlify to access your GitHub account. + Then click "Deploy with Github" and authorize Netlify to access your GitHub account. -{'Authorize + {'Authorize -Next, select the LobeChat project: + Next, select the LobeChat project: -{'Select + {'Select -### Configure Site Name and Environment Variables + ### Configure Site Name and Environment Variables -In this step, you need to configure your site, including the site name, build command, and publish directory. Fill in your site name in the "Site Name" field. If there are no special requirements, you do not need to modify the remaining configurations as we have already set the default configurations. + In this step, you need to configure your site, including the site name, build command, and publish directory. Fill in your site name in the "Site Name" field. If there are no special requirements, you do not need to modify the remaining configurations as we have already set the default configurations. -{'Configure + {'Configure -Click the "Add environment variables" button to add site environment variables: + Click the "Add environment variables" button to add site environment variables: -{'Add + {'Add -Taking OpenAI as an example, the environment variables you need to add are as follows: + Taking OpenAI as an example, the environment variables you need to add are as follows: -| Environment Variable | Type | Description | Example | -| --- | --- | --- | --- | -| `OPENAI_API_KEY` | Required | This is the API key you applied for on the OpenAI account page | `sk-xxxxxx...xxxxxx` | -| `ACCESS_CODE` | Required | Add a password to access this service. You can set a long password to prevent brute force attacks. When this value is separated by commas, it becomes an array of passwords | `awCT74` or `e3@09!` or `code1,code2,code3` | -| `OPENAI_PROXY_URL` | Optional | If you manually configure the OpenAI interface proxy, you can use this configuration to override the default OpenAI API request base URL | `https://aihubmix.com/v1`, default value: `https://api.openai.com/v1` | + | Environment Variable | Type | Description | Example | + | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | + | `OPENAI_API_KEY` | Required | This is the API key you applied for on the OpenAI account page | `sk-xxxxxx...xxxxxx` | + | `ACCESS_CODE` | Required | Add a password to access this service. You can set a long password to prevent brute force attacks. When this value is separated by commas, it becomes an array of passwords | `awCT74` or `e3@09!` or `code1,code2,code3` | + | `OPENAI_PROXY_URL` | Optional | If you manually configure the OpenAI interface proxy, you can use this configuration to override the default OpenAI API request base URL | `https://aihubmix.com/v1`, default value: `https://api.openai.com/v1` | - - For a complete list of environment variables supported by LobeChat, please refer to the [📘 - Environment Variables](/docs/self-hosting/environment-variables) - + + For a complete list of environment variables supported by LobeChat, please refer to the [📘 + Environment Variables](/docs/self-hosting/environment-variables) + -Afteradding the variables, finally click "Deploy lobe-chat" to enter the deployment phase + Afteradding the variables, finally click "Deploy lobe-chat" to enter the deployment phase -{'Environment + {'Environment -### Wait for Deployment to Complete + ### Wait for Deployment to Complete -After clicking deploy, you will enter the site details page, where you can click the "Deploying your site" in blue or the "Building" in yellow to view the deployment progress. + After clicking deploy, you will enter the site details page, where you can click the "Deploying your site" in blue or the "Building" in yellow to view the deployment progress. -{'Netlify + {'Netlify -Upon entering the deployment details, you will see the following interface, indicating that your LobeChat is currently being deployed. Simply wait for the deployment to complete. + Upon entering the deployment details, you will see the following interface, indicating that your LobeChat is currently being deployed. Simply wait for the deployment to complete. -{'LobeChat + {'LobeChat -During the deployment and build process: + During the deployment and build process: -{'Deployment - -### Deployment Successful, Start Using + {'Deployment -If your Deploy Log in the interface looks like the following, it means your LobeChat has been successfully deployed. - -{'Deployment + ### Deployment Successful, Start Using -At this point, you can click on "Open production deploy" to access your LobeChat site. + If your Deploy Log in the interface looks like the following, it means your LobeChat has been successfully deployed. + + {'Deployment + + At this point, you can click on "Open production deploy" to access your LobeChat site. {'Access diff --git a/docs/self-hosting/platform/netlify.zh-CN.mdx b/docs/self-hosting/platform/netlify.zh-CN.mdx index 3760bb95e107..0078a80ebb2f 100644 --- a/docs/self-hosting/platform/netlify.zh-CN.mdx +++ b/docs/self-hosting/platform/netlify.zh-CN.mdx @@ -20,126 +20,76 @@ tags: ### Fork LobeChat 仓库 -点击 Fork 按钮,将 LobeChat 仓库 Fork 到你的 GitHub 账号下。 + 点击 Fork 按钮,将 LobeChat 仓库 Fork 到你的 GitHub 账号下。 -### 准备好你的 OpenAI API Key + ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 在 Netlify 工作台导入 + ### 在 Netlify 工作台导入 -经过测试,暂不支持类似 Vercel/Zeabur 的一键部署按钮,原因未知。因此需要手动导入 + 经过测试,暂不支持类似 Vercel/Zeabur 的一键部署按钮,原因未知。因此需要手动导入 -点击 「Import from git」 + 点击 「Import from git」 -{'在 + {'在 -然后点击 「Deploy with Github」,并授权 Netlify 访问你的 GitHub 账号 + 然后点击 「Deploy with Github」,并授权 Netlify 访问你的 GitHub 账号 -{'授权 + {'授权 -然后选择 LobeChat 项目: + 然后选择 LobeChat 项目: -{'选择 + {'选择 -### 配置站点名称与环境变量 + ### 配置站点名称与环境变量 -在这一步,你需要配置你的站点,包括站点名称、构建命令、发布目录等。在「Site Name」字段填写上你的站点名称。其余配置如果没有特殊要求,无需修改,我们已经设定好了默认配置。 + 在这一步,你需要配置你的站点,包括站点名称、构建命令、发布目录等。在「Site Name」字段填写上你的站点名称。其余配置如果没有特殊要求,无需修改,我们已经设定好了默认配置。 -{'配置 + {'配置 -点击 「Add environment variables」按钮,添加站点环境变量: + 点击 「Add environment variables」按钮,添加站点环境变量: -{'添加 + {'添加 -以配置 OpenAI 为例,你需要添加的环境变量如下: + 以配置 OpenAI 为例,你需要添加的环境变量如下: -| 环境变量 | 类型 | 描述 | 示例 | -| --- | --- | --- | --- | -| `OPENAI_API_KEY` | 必选 | 这是你在 OpenAI 账户页面申请的 API 密钥 | `sk-xxxxxx...xxxxxx` | -| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个长密码以防被爆破,该值用逗号分隔时为密码数组 | `awCT74` 或 `e3@09!` or `code1,code2,code3` | -| `OPENAI_PROXY_URL` | 可选 | 如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL | `https://aihubmix.com/v1` ,默认值:`https://api.openai.com/v1` | + | 环境变量 | 类型 | 描述 | 示例 | + | ------------------ | -- | ------------------------------------------------------- | ---------------------------------------------------------- | + | `OPENAI_API_KEY` | 必选 | 这是你在 OpenAI 账户页面申请的 API 密钥 | `sk-xxxxxx...xxxxxx` | + | `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个长密码以防被爆破,该值用逗号分隔时为密码数组 | `awCT74` 或 `e3@09!` or `code1,code2,code3` | + | `OPENAI_PROXY_URL` | 可选 | 如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL | `https://aihubmix.com/v1` ,默认值:`https://api.openai.com/v1` | - - LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) - 部分 - + + LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) + 部分 + -添加完成后,最后点击「Deploy lobe-chat」 进入部署阶段。 + 添加完成后,最后点击「Deploy lobe-chat」 进入部署阶段。 -{'环境变量添加完成'} + {'环境变量添加完成'} -### 等待部署完成 + ### 等待部署完成 -点击部署后,会进入站点详情页面,你可以点击青色字样的「Deploying your site」或者 「Building」 黄色标签查看部署进度。 + 点击部署后,会进入站点详情页面,你可以点击青色字样的「Deploying your site」或者 「Building」 黄色标签查看部署进度。 -{'Netlify + {'Netlify -进入部署详情,你会看到下述界面,这意味着你的 LobeChat 正在部署中,只需等待部署完成即可。 + 进入部署详情,你会看到下述界面,这意味着你的 LobeChat 正在部署中,只需等待部署完成即可。 -{'LobeChat + {'LobeChat -部署构建过程中: + 部署构建过程中: -{'部署构建中'} + {'部署构建中'} -### 部署成功,开始使用 + ### 部署成功,开始使用 -如果你的界面中的 Deploy Log 如下所示,意味着你的 LobeChat 部署成功了。 - -{'部署成功'} + 如果你的界面中的 Deploy Log 如下所示,意味着你的 LobeChat 部署成功了。 -此时,你可以点击「Open production deploy」,即可访问你的 LobeChat 站点 + {'部署成功'} + + 此时,你可以点击「Open production deploy」,即可访问你的 LobeChat 站点 {'访问你的 diff --git a/docs/self-hosting/platform/railway.mdx b/docs/self-hosting/platform/railway.mdx index f312329f8651..3c6d683a5fc5 100644 --- a/docs/self-hosting/platform/railway.mdx +++ b/docs/self-hosting/platform/railway.mdx @@ -20,16 +20,15 @@ If you want to deploy LobeChat on Railway, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### Click the button below to deploy + ### Click the button below to deploy -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/FB6HrV?referralCode=9bD9mT) + [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/FB6HrV?referralCode=9bD9mT) -### Once deployed, you can start using it + ### Once deployed, you can start using it -### Bind a custom domain (optional) - -You can use the subdomain provided by Railway, or choose to bind a custom domain. Currently, the domains provided by Railway have not been contaminated, and most regions can connect directly. + ### Bind a custom domain (optional) + You can use the subdomain provided by Railway, or choose to bind a custom domain. Currently, the domains provided by Railway have not been contaminated, and most regions can connect directly. diff --git a/docs/self-hosting/platform/railway.zh-CN.mdx b/docs/self-hosting/platform/railway.zh-CN.mdx index 57fb29a21ace..4f466ede0160 100644 --- a/docs/self-hosting/platform/railway.zh-CN.mdx +++ b/docs/self-hosting/platform/railway.zh-CN.mdx @@ -19,16 +19,15 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/FB6HrV?referralCode=9bD9mT) + [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/FB6HrV?referralCode=9bD9mT) -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -你可以使用 Railway 提供的子域名,也可以选择绑定自定义域名。目前 Railway 提供的域名还未被污染,大多数地区都可以直连。 + ### 绑定自定义域名(可选) + 你可以使用 Railway 提供的子域名,也可以选择绑定自定义域名。目前 Railway 提供的域名还未被污染,大多数地区都可以直连。 diff --git a/docs/self-hosting/platform/repocloud.mdx b/docs/self-hosting/platform/repocloud.mdx index 2b07870c4942..a0bf8bc08aa8 100644 --- a/docs/self-hosting/platform/repocloud.mdx +++ b/docs/self-hosting/platform/repocloud.mdx @@ -20,18 +20,17 @@ If you want to deploy LobeChat on RepoCloud, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### One-click to deploy + ### One-click to deploy -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### Once deployed, you can start using it + ### Once deployed, you can start using it -### Bind a custom domain (optional) - -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. + ### Bind a custom domain (optional) + 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. [deploy-button-image]: https://d16t0pc4846x52.cloudfront.net/deploy.svg diff --git a/docs/self-hosting/platform/repocloud.zh-CN.mdx b/docs/self-hosting/platform/repocloud.zh-CN.mdx index 0bdaabccef2a..58d0e8097ee1 100644 --- a/docs/self-hosting/platform/repocloud.zh-CN.mdx +++ b/docs/self-hosting/platform/repocloud.zh-CN.mdx @@ -18,18 +18,17 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -你可以使用 RepoCloud 提供的子域名,也可以选择绑定自定义域名。目前 RepoCloud 提供的域名还未被污染,大多数地区都可以直连。 + ### 绑定自定义域名(可选) + 你可以使用 RepoCloud 提供的子域名,也可以选择绑定自定义域名。目前 RepoCloud 提供的域名还未被污染,大多数地区都可以直连。 [deploy-button-image]: https://d16t0pc4846x52.cloudfront.net/deploy.svg diff --git a/docs/self-hosting/platform/sealos.mdx b/docs/self-hosting/platform/sealos.mdx index 440510e444aa..8ad9dae019f1 100644 --- a/docs/self-hosting/platform/sealos.mdx +++ b/docs/self-hosting/platform/sealos.mdx @@ -19,18 +19,17 @@ If you want to deploy LobeChat on SealOS, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### Click the button below to deploy + ### Click the button below to deploy -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### After deployment, you can start using it + ### After deployment, you can start using it -### Bind a custom domain (optional) - -You can use the subdomain provided by SealOS, or choose to bind a custom domain. Currently, the domains provided by SealOS have not been contaminated, and can be directly accessed in most regions. + ### Bind a custom domain (optional) + You can use the subdomain provided by SealOS, or choose to bind a custom domain. Currently, the domains provided by SealOS have not been contaminated, and can be directly accessed in most regions. [deploy-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg diff --git a/docs/self-hosting/platform/sealos.zh-CN.mdx b/docs/self-hosting/platform/sealos.zh-CN.mdx index b0bf457a1ea7..9896d9a5adcb 100644 --- a/docs/self-hosting/platform/sealos.zh-CN.mdx +++ b/docs/self-hosting/platform/sealos.zh-CN.mdx @@ -18,18 +18,17 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -你可以使用 SealOS 提供的子域名,也可以选择绑定自定义域名。目前 SealOS 提供的域名还未被污染,大多数地区都可以直连。 + ### 绑定自定义域名(可选) + 你可以使用 SealOS 提供的子域名,也可以选择绑定自定义域名。目前 SealOS 提供的域名还未被污染,大多数地区都可以直连。 [deploy-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg diff --git a/docs/self-hosting/platform/vercel.mdx b/docs/self-hosting/platform/vercel.mdx index a521cf70d63d..0c9efe23c6cb 100644 --- a/docs/self-hosting/platform/vercel.mdx +++ b/docs/self-hosting/platform/vercel.mdx @@ -20,20 +20,19 @@ If you want to deploy LobeChat on Vercel, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### Click the button below to deploy + ### Click the button below to deploy -[![](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat&env=OPENAI_API_KEY,ACCESS_CODE&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys&project-name=lobe-chat&repository-name=lobe-chat) + [![](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat\&env=OPENAI_API_KEY,ACCESS_CODE\&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website\&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys\&project-name=lobe-chat\&repository-name=lobe-chat) -Simply log in with your GitHub account, and remember to fill in `OPENAI_API_KEY` (required) and `ACCESS_CODE` (recommended) in the environment variables page. + Simply log in with your GitHub account, and remember to fill in `OPENAI_API_KEY` (required) and `ACCESS_CODE` (recommended) in the environment variables page. -### After deployment, you can start using it + ### After deployment, you can start using it -### Bind a custom domain (optional) - -Vercel's assigned domain DNS may be polluted in some regions, so binding a custom domain can establish a direct connection. + ### Bind a custom domain (optional) + Vercel's assigned domain DNS may be polluted in some regions, so binding a custom domain can establish a direct connection. ## Automatic Synchronization of Updates diff --git a/docs/self-hosting/platform/vercel.zh-CN.mdx b/docs/self-hosting/platform/vercel.zh-CN.mdx index 60fc6d012509..acf68749bbe4 100644 --- a/docs/self-hosting/platform/vercel.zh-CN.mdx +++ b/docs/self-hosting/platform/vercel.zh-CN.mdx @@ -19,20 +19,19 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -直接使用 GitHub 账号登录即可,记得在环境变量页填入 `OPENAI_API_KEY` (必填) and `ACCESS_CODE`(推荐); + 直接使用 GitHub 账号登录即可,记得在环境变量页填入 `OPENAI_API_KEY` (必填) and `ACCESS_CODE`(推荐); -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -Vercel 分配的域名 DNS 在某些区域被污染了,绑定自定义域名即可直连。 + ### 绑定自定义域名(可选) + Vercel 分配的域名 DNS 在某些区域被污染了,绑定自定义域名即可直连。 ## 自动同步更新 diff --git a/docs/self-hosting/platform/zeabur.mdx b/docs/self-hosting/platform/zeabur.mdx index d6a4705a3e4b..50baf76ffc58 100644 --- a/docs/self-hosting/platform/zeabur.mdx +++ b/docs/self-hosting/platform/zeabur.mdx @@ -19,23 +19,19 @@ If you want to deploy LobeChat on Zeabur, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### Click the button below to deploy + ### Click the button below to deploy -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### Once deployed, you can start using it + ### Once deployed, you can start using it -### Bind a custom domain (optional) - -You can use the subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly. + ### Bind a custom domain (optional) + You can use the subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly. -[deploy-button-image]: https://zeabur.com/button.svg -[deploy-link]: https://zeabur.com/templates/VZGGTI - # Deploy LobeChat with Zeabur as serverless function > Note: There are still issues with [middlewares and rewrites of next.js on Zeabur](https://github.com/lobehub/lobe-chat/pull/2775?notification_referrer_id=NT_kwDOAdi2DrQxMDkyODQ4MDc2NTozMDk3OTU5OA#issuecomment-2146713899), use at your own risk! @@ -45,40 +41,41 @@ Since Zeabur does NOT officially support FREE users deploy containerized service ## Zeabur Deployment Process + ### Fork LobeChat -### Fork LobeChat - -### Add Zeabur pack config file + ### Add Zeabur pack config file -Add a `zbpack.json` configuration file with the following content to the root dir of your fork: + Add a `zbpack.json` configuration file with the following content to the root dir of your fork: -```json -{ - "ignore_dockerfile": true, - "serverless": true -} -``` + ```json + { + "ignore_dockerfile": true, + "serverless": true + } + ``` -### Prepare your OpenAI API Key - -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + ### Prepare your OpenAI API Key -### Login to your [Zeabur dashboard](https://dash.zeabur.com) + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -If you do not already have an account, you will need to register one. + ### Login to your [Zeabur dashboard](https://dash.zeabur.com) -### Create a project and service + If you do not already have an account, you will need to register one. -Create a project, then create a service under this project. + ### Create a project and service -### Link your fork of LobeChat to the just created Zeabur service. + Create a project, then create a service under this project. -When adding service, choose github. This may triger a oAuth depend on varies factors like how you login to Zeabur and if you have already authorized Zeabur to access all your repos + ### Link your fork of LobeChat to the just created Zeabur service. -### Bind a custom domain (optional) + When adding service, choose github. This may triger a oAuth depend on varies factors like how you login to Zeabur and if you have already authorized Zeabur to access all your repos -You can create a subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly. + ### Bind a custom domain (optional) -### Zeabur shall start auto build and you should be able to access it by the domain of your choice after a while. + You can create a subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly. + ### Zeabur shall start auto build and you should be able to access it by the domain of your choice after a while. + +[deploy-button-image]: https://zeabur.com/button.svg +[deploy-link]: https://zeabur.com/templates/VZGGTI diff --git a/docs/self-hosting/platform/zeabur.zh-CN.mdx b/docs/self-hosting/platform/zeabur.zh-CN.mdx index 00ee9aa46375..8b6fc7e2100b 100644 --- a/docs/self-hosting/platform/zeabur.zh-CN.mdx +++ b/docs/self-hosting/platform/zeabur.zh-CN.mdx @@ -18,23 +18,19 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -你可以使用 Zeabur 提供的子域名,也可以选择绑定自定义域名。目前 Zeabur 提供的域名还未被污染,大多数地区都可以直连。 + ### 绑定自定义域名(可选) + 你可以使用 Zeabur 提供的子域名,也可以选择绑定自定义域名。目前 Zeabur 提供的域名还未被污染,大多数地区都可以直连。 -[deploy-button-image]: https://zeabur.com/button.svg -[deploy-link]: https://zeabur.com/templates/VZGGTI - # 使用 Zeabur 将 LobeChat 部署为无服务器函数 > **注意:** 仍然存在关于 [Zeabur 上 next.js 的中间件和重写问题](https://github.com/lobehub/lobe-chat/pull/2775?notification_referrer_id=NT_kwDOAdi2DrQxMDkyODQ4MDc2NTozMDk3OTU5OA#issuecomment-2146713899),请自担风险! @@ -44,40 +40,41 @@ tags: ## Zeabur 部署流程 + ### Fork LobeChat -### Fork LobeChat - -### 添加 Zeabur 打包配置文件 + ### 添加 Zeabur 打包配置文件 -在您的分支的根目录下添加一个 `zbpack.json` 配置文件,内容如下: + 在您的分支的根目录下添加一个 `zbpack.json` 配置文件,内容如下: -```json -{ - "ignore_dockerfile": true, - "serverless": true -} -``` + ```json + { + "ignore_dockerfile": true, + "serverless": true + } + ``` -### 准备您的 OpenAI API 密钥 + ### 准备您的 OpenAI API 密钥 -前往 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。 + 前往 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。 -### 登录到您的 [Zeabur 仪表板](https://dash.zeabur.com) + ### 登录到您的 [Zeabur 仪表板](https://dash.zeabur.com) -如果您尚未拥有一个账号,您需要注册一个。 + 如果您尚未拥有一个账号,您需要注册一个。 -### 创建项目与服务。 + ### 创建项目与服务。 -创建一个项目,并再这个项目下新建一个服务。 + 创建一个项目,并再这个项目下新建一个服务。 -### 将您的 LobeChat 分支链接到刚创建的 Zeabur 服务。 + ### 将您的 LobeChat 分支链接到刚创建的 Zeabur 服务。 -在添加服务时,选择 github。这可能会触发一个 oAuth,取决于诸如您如何登录到 Zeabur以及您是否已经授权 Zeabur 访问所有您的存储库等各种因素。 + 在添加服务时,选择 github。这可能会触发一个 oAuth,取决于诸如您如何登录到 Zeabur 以及您是否已经授权 Zeabur 访问所有您的存储库等各种因素。 -### 绑定自定义域名(可选) + ### 绑定自定义域名(可选) -您可以创建 Zeabur 提供的子域名,或选择绑定自定义域名。目前,Zeabur 提供的域名尚未受到污染,大多数地区可以直接连接。 - -### Zeabur 将开始自动构建,您应该可以在一段时间后通过您选择的域名访问它。 + 您可以创建 Zeabur 提供的子域名,或选择绑定自定义域名。目前,Zeabur 提供的域名尚未受到污染,大多数地区可以直接连接。 + ### Zeabur 将开始自动构建,您应该可以在一段时间后通过您选择的域名访问它。 + +[deploy-button-image]: https://zeabur.com/button.svg +[deploy-link]: https://zeabur.com/templates/VZGGTI diff --git a/docs/self-hosting/server-database.mdx b/docs/self-hosting/server-database.mdx index d995f10efe08..44c86a4ef810 100644 --- a/docs/self-hosting/server-database.mdx +++ b/docs/self-hosting/server-database.mdx @@ -47,58 +47,56 @@ Before deployment, make sure you have a Postgres database instance ready. You ca Since we support file-based conversations/knowledge base conversations, we need to install the `pgvector` plugin for Postgres. This plugin provides vector search capabilities and is a key component for LobeChat to implement RAG. -### `NEXT_PUBLIC_SERVICE_MODE` + ### `NEXT_PUBLIC_SERVICE_MODE` -LobeChat supports both client-side and server-side databases, so we provide an environment variable for switching modes, which is `NEXT_PUBLIC_SERVICE_MODE`, with a default value of `client`. + LobeChat supports both client-side and server-side databases, so we provide an environment variable for switching modes, which is `NEXT_PUBLIC_SERVICE_MODE`, with a default value of `client`. -For server-side database deployment scenarios, you need to set `NEXT_PUBLIC_SERVICE_MODE` to `server`. + For server-side database deployment scenarios, you need to set `NEXT_PUBLIC_SERVICE_MODE` to `server`. - - In the official `lobe-chat-database` Docker image, this environment variable is already set to - `server` by default. Therefore, if you deploy using the Docker image, you do not need to configure - this environment variable again. - - - -Since environment variables starting with `NEXT_PUBLIC` take effect in the front-end code, they cannot be modified through container runtime injection. (Refer to the `next.js` documentation [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables)). This is why we chose to create a separate DB version image. - -If you need to modify variables with the `NEXT_PUBLIC` prefix in a Docker deployment, you must build the image yourself and inject your own `NEXT_PUBLIC` prefixed environment variables during the build. + + In the official `lobe-chat-database` Docker image, this environment variable is already set to + `server` by default. Therefore, if you deploy using the Docker image, you do not need to configure + this environment variable again. + - + + Since environment variables starting with `NEXT_PUBLIC` take effect in the front-end code, they cannot be modified through container runtime injection. (Refer to the `next.js` documentation [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables)). This is why we chose to create a separate DB version image. -### `DATABASE_URL` + If you need to modify variables with the `NEXT_PUBLIC` prefix in a Docker deployment, you must build the image yourself and inject your own `NEXT_PUBLIC` prefixed environment variables during the build. + -The core of configuring the database is to add the `DATABASE_URL` environment variable and fill in the Postgres database connection URL you have prepared. The typical format of the database connection URL is `postgres://username:password@host:port/database`. + ### `DATABASE_URL` - - If you want to enable SSL when connecting to the database, please refer to the - [documentation](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) - for setup instructions. - + The core of configuring the database is to add the `DATABASE_URL` environment variable and fill in the Postgres database connection URL you have prepared. The typical format of the database connection URL is `postgres://username:password@host:port/database`. -### `DATABASE_DRIVER` + + If you want to enable SSL when connecting to the database, please refer to the + [documentation](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) + for setup instructions. + -The `DATABASE_DRIVER` environment variable is used to distinguish between the two types of Postgres database instances, with values of `node` or `neon`. + ### `DATABASE_DRIVER` -To streamline deployment, we have set default values based on the characteristics of different platforms: + The `DATABASE_DRIVER` environment variable is used to distinguish between the two types of Postgres database instances, with values of `node` or `neon`. -- On the Vercel platform, `DATABASE_DRIVER` defaults to `neon`; -- In our provided Docker image `lobe-chat-database`, `DATABASE_DRIVER` defaults to `node`. + To streamline deployment, we have set default values based on the characteristics of different platforms: -Therefore, if you follow the standard deployment methods below, you do not need to manually configure the `DATABASE_DRIVER` environment variable: + - On the Vercel platform, `DATABASE_DRIVER` defaults to `neon`; + - In our provided Docker image `lobe-chat-database`, `DATABASE_DRIVER` defaults to `node`. -- Vercel + Serverless Postgres -- Docker image + Node Postgres + Therefore, if you follow the standard deployment methods below, you do not need to manually configure the `DATABASE_DRIVER` environment variable: -### `KEY_VAULTS_SECRET` + - Vercel + Serverless Postgres + - Docker image + Node Postgres -Considering that users will store sensitive information such as their API Key and baseURL in the database, we need a key to encrypt this information to prevent leakage in case of a database breach. Hence, the `KEY_VAULTS_SECRET` environment variable is used to encrypt sensitive information like user-stored apikeys. + ### `KEY_VAULTS_SECRET` - - You can generate a random 32-character string as the value of `KEY_VAULTS_SECRET` using `openssl - rand -base64 32`. - + Considering that users will store sensitive information such as their API Key and baseURL in the database, we need a key to encrypt this information to prevent leakage in case of a database breach. Hence, the `KEY_VAULTS_SECRET` environment variable is used to encrypt sensitive information like user-stored apikeys. + + You can generate a random 32-character string as the value of `KEY_VAULTS_SECRET` using `openssl + rand -base64 32`. + ## Configuring Authentication Services @@ -107,7 +105,7 @@ In the server-side database mode, we need an authentication service to distingui ### Clerk -[Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) is an authentication SaaS service that provides out-of-the-box authentication capabilities with high productization, low integration costs, and a great user experience. For those who offer SaaS products, Clerk is a good choice. Our official [LobeChat Cloud](https://lobechat.com) uses Clerk as the authentication service. +[Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) is an authentication SaaS service that provides out-of-the-box authentication capabilities with high productization, low integration costs, and a great user experience. For those who offer SaaS products, Clerk is a good choice. Our official [LobeChat Cloud](https://lobechat.com) uses Clerk as the authentication service. The integration of Clerk is relatively simple, requiring only the configuration of these environment variables: diff --git a/docs/self-hosting/server-database.zh-CN.mdx b/docs/self-hosting/server-database.zh-CN.mdx index 8f0c966d0d36..fc8a0c94e224 100644 --- a/docs/self-hosting/server-database.zh-CN.mdx +++ b/docs/self-hosting/server-database.zh-CN.mdx @@ -15,7 +15,7 @@ tags: LobeChat 默认使用客户端数据库(IndexedDB),同时也支持使用服务端数据库(下简称 DB 版)。LobeChat 采用了 Postgres 作为后端存储数据库。 - PostgreSQL是一种强大的开源关系型数据库管理系统,具备高度扩展性和标准SQL支持。它提供了丰富的数据类型、并发处理、数据完整性、安全性及可编程性,适用于复杂应用和大规模数据管理。 + PostgreSQL 是一种强大的开源关系型数据库管理系统,具备高度扩展性和标准 SQL 支持。它提供了丰富的数据类型、并发处理、数据完整性、安全性及可编程性,适用于复杂应用和大规模数据管理。 本文将从框架角度介绍在任何一个平台中部署 DB 版 LobeChat 的流程和原理,让你知其然也知其所以然,最后可以根据自己的实际情况进行部署。 @@ -41,59 +41,56 @@ LobeChat 默认使用客户端数据库(IndexedDB),同时也支持使用 两者的配置方式在环境变量的取值上会略有一点区别,其他方面是一样的。 -同时,由于我们支持了文件对话/知识库对话的能力,因此我们需要为 Postgres 安装 `pgvector` 插件,该插件提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。 +同时,由于我们支持了文件对话 / 知识库对话的能力,因此我们需要为 Postgres 安装 `pgvector` 插件,该插件提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。 + ### `NEXT_PUBLIC_SERVICE_MODE` -### `NEXT_PUBLIC_SERVICE_MODE` + LobeChat 同时支持了客户端数据库和服务端数据库,因此我们提供了一个环境变量用于切换模式,这个变量为 `NEXT_PUBLIC_SERVICE_MODE`,该值默认为 `client`。 -LobeChat 同时支持了客户端数据库和服务端数据库,因此我们提供了一个环境变量用于切换模式,这个变量为 `NEXT_PUBLIC_SERVICE_MODE`,该值默认为 `client`。 + 针对服务端数据库部署场景,你需要将 `NEXT_PUBLIC_SERVICE_MODE` 设置为 `server`。 -针对服务端数据库部署场景,你需要将 `NEXT_PUBLIC_SERVICE_MODE` 设置为 `server`。 + + 在官方的 `lobe-chat-database` Docker 镜像中,已经默认将该环境变量设为 `server`,因此如果你使用 + Docker 镜像部署,则无需再配置该环境变量。 + - - 在官方的 `lobe-chat-database` Docker 镜像中,已经默认将该环境变量设为 `server`,因此如果你使用 - Docker 镜像部署,则无需再配置该环境变量。 - + + 由于 `NEXT_PUBLIC` 开头的环境变量是在前端代码中生效的,而因此无法通过容器运行时注入进行修改。 (`next.js`的参考文档 [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables) ) 这也是为什么我们选择再打一个 DB 版镜像的原因。 - - 由于 `NEXT_PUBLIC` 开头的环境变量是在前端代码中生效的,而因此无法通过容器运行时注入进行修改。 (`next.js`的参考文档 [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables) ) 这也是为什么我们选择再打一个 DB 版镜像的原因。 + 如果你需要在 Docker 部署中修改 `NEXT_PUBLIC` 前缀的变量,你必须自行构建镜像,在 build 时就把自己的 `NEXT_PUBLIC` 开头的环境变量打进去。 + -如果你需要在 Docker 部署中修改 `NEXT_PUBLIC` 前缀的变量,你必须自行构建镜像,在 build 时就把自己的 `NEXT_PUBLIC` 开头的环境变量打进去。 + ### `DATABASE_URL` - + 配置数据库,核心是添加 `DATABASE_URL` 环境变量,将你准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。 -### `DATABASE_URL` + + 如果希望连接数据库时启用 SSL + ,请自行参考[文档](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置 + -配置数据库,核心是添加 `DATABASE_URL` 环境变量,将你准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。 + ### `DATABASE_DRIVER` - - 如果希望连接数据库时启用 SSL - ,请自行参考[文档](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置 - + `DATABASE_DRIVER` 环境变量用于区分两种 Postgres 数据库实例,`DATABASE_DRIVER` 的取值为 `node` 或 `neon`。 -### `DATABASE_DRIVER` + 为提升部署便捷性,我们根据不同的平台特点设置了默认值: -`DATABASE_DRIVER` 环境变量用于区分两种 Postgres 数据库实例,`DATABASE_DRIVER` 的取值为 `node` 或 `neon`。 + - 在 Vercel 平台下,`DATABASE_DRIVER` 默认为 `neon`; + - 在我们提供的 Docker 镜像 `lobe-chat-database` 中,`DATABASE_DRIVER` 默认为 `node`。 -为提升部署便捷性,我们根据不同的平台特点设置了默认值: + 因此如果你采用了以下标准的部署方式,你无需手动配置 `DATABASE_DRIVER` 环境变量: -- 在 Vercel 平台下,`DATABASE_DRIVER` 默认为 `neon`; -- 在我们提供的 Docker 镜像 `lobe-chat-database` 中,`DATABASE_DRIVER` 默认为 `node`。 + - Vercel + Serverless Postgres + - Docker 镜像 + Node Postgres -因此如果你采用了以下标准的部署方式,你无需手动配置 `DATABASE_DRIVER` 环境变量: + ### `KEY_VAULTS_SECRET` -- Vercel + Serverless Postgres -- Docker 镜像 + Node Postgres - -### `KEY_VAULTS_SECRET` - -考虑到用户会存储自己的 API Key 和 baseURL 等敏感信息到数据库中,因此我们需要一个密钥来加密这些信息,避免数据库被爆破/脱库时这些关键信息被泄露。 因此有了 `KEY_VAULTS_SECRET` 环境变量,用于加密用户存储的 apikey 等敏感信息。 - - - 你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为 `KEY_VAULTS_SECRET` 的值。 - + 考虑到用户会存储自己的 API Key 和 baseURL 等敏感信息到数据库中,因此我们需要一个密钥来加密这些信息,避免数据库被爆破 / 脱库时这些关键信息被泄露。 因此有了 `KEY_VAULTS_SECRET` 环境变量,用于加密用户存储的 apikey 等敏感信息。 + + 你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为 `KEY_VAULTS_SECRET` 的值。 + ## 配置身份验证服务 @@ -102,7 +99,7 @@ LobeChat 同时支持了客户端数据库和服务端数据库,因此我们 ### Clerk -[Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) 是一个身份验证 SaaS 服务,提供了开箱即用的身份验证能力,产品化程度很高,集成成本较低,体验很好。对于提供 SaaS 化产品的诉求来说,Clerk 是一个不错的选择。我们官方提供的 [LobeChat Cloud](https://lobechat.com),就是使用了 Clerk 作为身份验证服务。 +[Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) 是一个身份验证 SaaS 服务,提供了开箱即用的身份验证能力,产品化程度很高,集成成本较低,体验很好。对于提供 SaaS 化产品的诉求来说,Clerk 是一个不错的选择。我们官方提供的 [LobeChat Cloud](https://lobechat.com),就是使用了 Clerk 作为身份验证服务。 Clerk 的集成也相对简单,只需要配置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、 `CLERK_SECRET_KEY` 和 `CLERK_WEBHOOK_SECRET` 环境变量即可,这三个环境变量可以在 Clerk 控制台中获取。 @@ -132,7 +129,7 @@ NextAuth 是一个开源的身份验证库,支持多种身份验证提供商 LobeChat 在 [很早以前](https://x.com/lobehub/status/1724289575672291782) 就支持了多模态的 AI 会话,其中涉及到图片上传给大模型的功能。在客户端数据库方案中,图片文件直接以二进制数据存储在浏览器 IndexedDB 数据库,但在服务端数据库中这个方案并不可行。因为在 Postgres 中直接存储文件类二进制数据会大大浪费宝贵的数据库存储空间,并拖慢计算性能。 -这块最佳实践是使用文件存储服务(S3)来存储图片文件,同时 S3 也是文件上传/知识库功能所依赖的大容量静态文件存储方案。 +这块最佳实践是使用文件存储服务(S3)来存储图片文件,同时 S3 也是文件上传 / 知识库功能所依赖的大容量静态文件存储方案。 在本文档库中,S3 所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 diff --git a/docs/self-hosting/server-database/docker-compose.mdx b/docs/self-hosting/server-database/docker-compose.mdx index 69dd7901580f..723f20ffbdc9 100644 --- a/docs/self-hosting/server-database/docker-compose.mdx +++ b/docs/self-hosting/server-database/docker-compose.mdx @@ -15,10 +15,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
@@ -32,8 +31,7 @@ tags: Due to the inability to expose `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` using Docker environment variables, you cannot use Clerk as a login authentication service when deploying LobeChat with Docker / Docker Compose. -If you need Clerk as a login authentication service, consider deploying with Vercel or building your own image. - + If you need Clerk as a login authentication service, consider deploying with Vercel or building your own image. In general, to fully run the LobeChat database version, you need at least the following four services: @@ -62,47 +60,46 @@ To facilitate a quick start, this section uses the `docker-compose/local` direct ### One-click Startup Script -Create a new directory named `lobe-chat-db` to store your configuration files and subsequent database files. + Create a new directory named `lobe-chat-db` to store your configuration files and subsequent database files. -```sh -mkdir lobe-chat-db -cd lobe-chat-db -``` + ```sh + mkdir lobe-chat-db + cd lobe-chat-db + ``` -We provide a one-click startup script `setup.sh`, which can automatically use the default configuration and start the service: + We provide a one-click startup script `setup.sh`, which can automatically use the default configuration and start the service: -```sh -bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -``` + ```sh + bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f + ``` -### Start Docker - -```sh -docker compose up -d -``` + ### Start Docker -The default login account is the default account of Casdoor, with the username `admin`. You can find the password in the `init_data.json` file that is downloaded during setup. Note that the secret might fail to generate, please check the shell output. + ```sh + docker compose up -d + ``` -### Check Logs + The default login account is the default account of Casdoor, with the username `admin`. You can find the password in the `init_data.json` file that is downloaded during setup. Note that the secret might fail to generate, please check the shell output. -```sh -docker logs -f lobe-chat -``` + ### Check Logs -If you see the following logs in the container, it means the startup was successful: + ```sh + docker logs -f lobe-chat + ``` -```log -[Database] Start to migration... -✅ database migration pass. -------------------------------------- - ▲ Next.js 14.x.x - - Local: http://localhost:3210 - - Network: http://0.0.0.0:3210 + If you see the following logs in the container, it means the startup was successful: - ✓ Starting... - ✓ Ready in 95ms -``` + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://localhost:3210 + - Network: http://0.0.0.0:3210 + ✓ Starting... + ✓ Ready in 95ms + ``` At this point, you have successfully deployed the LobeChat database version, and you can access your LobeChat service at `http://localhost:3210`. @@ -220,10 +217,9 @@ And the service ports that do not require reverse proxy: Please note that CORS cross-domain is configured internally in MinIO / Logto services. Do not configure CORS additionally in your reverse proxy, as this will cause errors. -For MinIO not on port 443, the Host must be `$http_host` (with port number), otherwise a 403 error will occur: `proxy_set_header Host $http_host`. - -If you need to configure an SSL certificate, please configure it uniformly in the outer Nginx reverse proxy and not in MinIO. + For MinIO not on port 443, the Host must be `$http_host` (with port number), otherwise a 403 error will occur: `proxy_set_header Host $http_host`. + If you need to configure an SSL certificate, please configure it uniformly in the outer Nginx reverse proxy and not in MinIO. ### Configuration Files @@ -269,8 +265,7 @@ This article uses Logto as an example to explain the configuration process. If y Please remember to configure the CORS cross-domain settings for the corresponding login authentication service provider to ensure LobeChat can access the authentication service properly. -In this article, you need to allow cross-domain requests from `https://lobe.example.com`. - + In this article, you need to allow cross-domain requests from `https://lobe.example.com`. You first need to visit the WebUI for configuration: @@ -286,26 +281,17 @@ You first need to visit the WebUI for configuration: 4. Set `CORS allowed origins` to `https://lobe.example.com`. - Configuring Logto + Configuring Logto 5. Obtain `App ID` and `App secrets`, and fill them into your `.env` file under `AUTH_LOGTO_ID` and `AUTH_LOGTO_SECRET`. 6. Set `AUTH_LOGTO_ISSUER` in your `.env` file to `https://lobe-auth-api.example.com/oidc`. - Configuring Logto Environment Variables + Configuring Logto Environment Variables 7. Optionally, in the left panel under `Sign-in experience`, you can disable `Enable user registration` in `Sign-up and sign-in - Advanced Options` to prevent users from registering on their own. If you disable user registration, you will need to manually add users in the left panel under `User Management`. - Disable User Registration + Disable User Registration 8. Restart the LobeChat service: @@ -325,10 +311,9 @@ This article uses MinIO as an example to explain the configuration process. If y Please remember to configure the CORS cross-domain settings for the corresponding S3 service provider to ensure LobeChat can access the S3 service properly. -In this article, you need to allow cross-domain requests from `https://lobe.example.com`. This can be configured in MinIO WebUI under `Configuration - API - Cors Allow Origin`, or in the Docker Compose under `minio - environment - MINIO_API_CORS_ALLOW_ORIGIN`. - -If you use the second method (which is also the default method) for configuration, you will not be able to configure it in MinIO WebUI anymore. + In this article, you need to allow cross-domain requests from `https://lobe.example.com`. This can be configured in MinIO WebUI under `Configuration - API - Cors Allow Origin`, or in the Docker Compose under `minio - environment - MINIO_API_CORS_ALLOW_ORIGIN`. + If you use the second method (which is also the default method) for configuration, you will not be able to configure it in MinIO WebUI anymore. You first need to visit the WebUI for configuration: @@ -340,29 +325,17 @@ You first need to visit the WebUI for configuration: 2. In the left panel under Administer / Buckets, click `Create Bucket`, enter `lobe` (which corresponds to your `S3_BUCKET` environment variable), and then click `Create`. - Create MinIO Bucket + Create MinIO Bucket 3. Select your bucket, click Summary - Access Policy, edit, choose `Custom`, input the content from `minio-bucket-config.json` (see appendix), and save (assuming your bucket name is `lobe`): - Select MinIO Bucket Policy + Select MinIO Bucket Policy - Configure MinIO Bucket Policy + Configure MinIO Bucket Policy 4. In the left panel under User / Access Keys, click `Create New Access Key`, without any extra modifications, and fill the generated `Access Key` and `Secret Key` into your `.env` file under `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`. - Create MinIO Access Key + Create MinIO Access Key 5. Restart the LobeChat service: diff --git a/docs/self-hosting/server-database/docker-compose.zh-CN.mdx b/docs/self-hosting/server-database/docker-compose.zh-CN.mdx index 9f28b74ac013..3789cb075abf 100644 --- a/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +++ b/docs/self-hosting/server-database/docker-compose.zh-CN.mdx @@ -13,10 +13,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
@@ -29,8 +28,7 @@ tags: 由于无法使用 Docker 环境变量暴露 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,使用 Docker / Docker Compose 部署 LobeChat 时,你不能使用 Clerk 作为登录鉴权服务。 -如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。 - + 如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。 一般来讲,想要完整的运行 LobeChat 数据库版本,你需要至少拥有如下四个服务 @@ -58,47 +56,46 @@ tags: ### 一键启动脚本 -新建一个 `lobe-chat-db` 目录,用于存放你的配置文件和后续的数据库文件。 + 新建一个 `lobe-chat-db` 目录,用于存放你的配置文件和后续的数据库文件。 -```sh -mkdir lobe-chat-db -cd lobe-chat-db -``` + ```sh + mkdir lobe-chat-db + cd lobe-chat-db + ``` -我们提供了一个一键启动脚本 `setup.sh`,可以自动使用默认配置并启动服务: + 我们提供了一个一键启动脚本 `setup.sh`,可以自动使用默认配置并启动服务: -```sh -bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -l zh_CN -``` + ```sh + bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -l zh_CN + ``` -### 启动 Docker - -```sh -docker compose up -d -``` + ### 启动 Docker -默认登录账号即 Casdoor 的默认账号,账号名 `admin`,密码 `123` + ```sh + docker compose up -d + ``` -### 检查日志 + 默认登录账号即 Casdoor 的默认账号,账号名 `admin`,密码 `123` -```sh -docker logs -f lobe-chat -``` + ### 检查日志 -如果你在容器中看到了以下日志,则说明已经启动成功: + ```sh + docker logs -f lobe-chat + ``` -```log -[Database] Start to migration... -✅ database migration pass. -------------------------------------- - ▲ Next.js 14.x.x - - Local: http://localhost:3210 - - Network: http://0.0.0.0:3210 + 如果你在容器中看到了以下日志,则说明已经启动成功: - ✓ Starting... - ✓ Ready in 95ms -``` + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://localhost:3210 + - Network: http://0.0.0.0:3210 + ✓ Starting... + ✓ Ready in 95ms + ``` 至此,你已经成功部署了 LobeChat 数据库版本,你可以通过 `http://localhost:3210` 访问你的 LobeChat 服务。 @@ -215,10 +212,9 @@ docker compose up -d 请务必注意,CORS 跨域是在 MinIO / Logto 服务端内部配置的,请勿在你的反向代理中额外配置 CORS,这会导致错误。 -对于 minio 非 443 端口时,Host 必须是 `$http_host`(带端口号),否则会 403 错误:`proxy_set_header Host $http_host`。 - -如果你需要配置 SSL 证书,请统一在外层的 Nginx 反向代理中配置,而不是在 MinIO 中配置。 + 对于 minio 非 443 端口时,Host 必须是 `$http_host`(带端口号),否则会 403 错误:`proxy_set_header Host $http_host`。 + 如果你需要配置 SSL 证书,请统一在外层的 Nginx 反向代理中配置,而不是在 MinIO 中配置。 ### 配置文件 @@ -264,8 +260,7 @@ docker compose up -d # 重新启动 请记得注意配置对应登录鉴权服务提供商的 CORS 跨域配置,以确保 LobeChat 能够正常访问登录鉴权服务。 -在本文中,你需要允许 `https://lobe.example.com` 的跨域请求。 - + 在本文中,你需要允许 `https://lobe.example.com` 的跨域请求。 你需要首先访问 WebUI 来进行配置: @@ -281,26 +276,17 @@ docker compose up -d # 重新启动 4. 配置 `CORS allowed origins` 为 `https://lobe.example.com` - 配置 Logto + 配置 Logto 5. 获取 `App ID` 和 `App secrets`,填入你的 `.env` 文件中的 `AUTH_LOGTO_ID` 和 `AUTH_LOGTO_SECRET` 中 6. 配置你的 `.env` 文件中 `AUTH_LOGTO_ISSUER` 为 `https://lobe-auth-api.example.com/oidc` - 配置 Logto 环境变量 + 配置 Logto 环境变量 7. 可选,在左侧 `Sign-in experience` 面板的 `Sign-up and sign-in - Advanced Options` 中关闭 `Enable user registration`,禁止用户自行注册。如果你禁止了用户自行注册,那么你只能在左侧 `User Management` 里手动添加用户。 - 关闭用户注册 + 关闭用户注册 8. 重启 LobeChat 服务: @@ -319,10 +305,9 @@ docker compose up -d # 重新启动 请记得注意配置对应 S3 服务商的 CORS 跨域配置,以确保 LobeChat 能够正常访问 S3 服务。 -在本文中,你需要允许 `https://lobe.example.com` 的跨域请求。这既可以在 MinIO WebUI 的 `Configuration - API - Cors Allow Origin` 中配置,也可以在 Docker Compose 中的 `minio - environment - MINIO_API_CORS_ALLOW_ORIGIN` 中配置。 - -如果你使用第二种方法(这也是默认的方法)进行配置,你将无法再在 MinIO WebUI 中配置。 + 在本文中,你需要允许 `https://lobe.example.com` 的跨域请求。这既可以在 MinIO WebUI 的 `Configuration - API - Cors Allow Origin` 中配置,也可以在 Docker Compose 中的 `minio - environment - MINIO_API_CORS_ALLOW_ORIGIN` 中配置。 + 如果你使用第二种方法(这也是默认的方法)进行配置,你将无法再在 MinIO WebUI 中配置。 你需要首先访问 WebUI 来进行配置: @@ -334,29 +319,17 @@ docker compose up -d # 重新启动 2. 在左侧面板 Administer / Buckets 中点击 `Create Bucket`,输入 `lobe`(对应你的 `S3_BUCKET` 环境变量),然后点击 `Create` - 创建 MinIO 桶 + 创建 MinIO 桶 3. 选中你的桶,点击 Summary - Access Policy,编辑,选择 `Custom`,输入 `minio-bucket-config.json` 中的内容(见附录)并保存(同样默认你的桶名为 `lobe`): - 选中 MinIO 桶策略 + 选中 MinIO 桶策略 - 配置 MinIO 桶策略 + 配置 MinIO 桶策略 4. 在左侧面板 User / Access Keys 处,点击 `Create New Access Key`,无需额外修改,将生成的 `Access Key` 和 `Secret Key` 填入你的 `.env` 文件中的 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 中 - 创建 MinIO 访问密钥 + 创建 MinIO 访问密钥 5. 重启 LobeChat 服务: diff --git a/docs/self-hosting/server-database/docker.mdx b/docs/self-hosting/server-database/docker.mdx index 91ddbd013bad..f4f38a7fe3c3 100644 --- a/docs/self-hosting/server-database/docker.mdx +++ b/docs/self-hosting/server-database/docker.mdx @@ -15,10 +15,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
@@ -32,8 +31,7 @@ tags: 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. -If you do need Clerk as an authentication service, you might consider deploying using Vercel or building your own image. - + If you do need Clerk as an authentication service, you might consider deploying using Vercel or building your own image. ## Deploying on a Linux Server @@ -41,89 +39,87 @@ If you do need Clerk as an authentication service, you might consider deploying Here is the process for deploying the LobeChat server database version on a Linux server: - -### Create a Postgres Database Instance - -Please create a Postgres database instance with the PGVector plugin according to your needs, for example: - -```sh -docker network create pg - -docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 -``` - -The above command will create a PG instance named `my-postgres` on the network `pg`, where `pgvector/pgvector:pg16` is a Postgres 16 image with the pgvector plugin installed by default. - - - The pgvector plugin provides vector search capabilities for Postgres, which is an important - component for LobeChat to implement RAG. - - - - The above command does not specify a persistent storage location for the pg instance, so it is - only for testing/demonstration purposes. Please configure persistent storage for production - environments. - - -### Create a file named `lobe-chat.env` to store environment variables: - -```shell -# Website domain -APP_URL=https://your-prod-domain.com - -# DB required environment variables -KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= -# Postgres database connection string -# Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container name -DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres - -# NEXT_AUTH related, can use auth0, Azure AD, GitHub, Authentik, zitadel, etc. If you have other access requirements, feel free to submit a PR -NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 -NEXT_AUTH_SSO_PROVIDERS=auth0 -NEXTAUTH_URL=https://your-prod-domain.com/api/auth -AUTH_AUTH0_ID=xxxxxx -AUTH_AUTH0_SECRET=cSX_xxxxx -AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com - -# S3 related -S3_ACCESS_KEY_ID=xxxxxxxxxx -S3_SECRET_ACCESS_KEY=xxxxxxxxxx -S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com -S3_BUCKET=lobechat -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com - -# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE. -# OPENAI_API_KEY=sk-xxxx -# OPENAI_PROXY_URL=https://api.openai.com/v1 -# OPENAI_MODEL_LIST=... -``` - -### Start the lobe-chat-database Docker image - -```sh -docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database -``` - -You can use the following command to check the logs: - -```sh -docker logs -f lobe-chat-database -``` - -If you see the following logs in the container, it means it has started successfully: - -```log -[Database] Start to migration... -✅ database migration pass. -------------------------------------- - ▲ Next.js 14.x.x - - Local: http://localhost:3210 - - Network: http://0.0.0.0:3210 - - ✓ Starting... - ✓ Ready in 95ms -``` - + ### Create a Postgres Database Instance + + Please create a Postgres database instance with the PGVector plugin according to your needs, for example: + + ```sh + docker network create pg + + docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 + ``` + + The above command will create a PG instance named `my-postgres` on the network `pg`, where `pgvector/pgvector:pg16` is a Postgres 16 image with the pgvector plugin installed by default. + + + The pgvector plugin provides vector search capabilities for Postgres, which is an important + component for LobeChat to implement RAG. + + + + The above command does not specify a persistent storage location for the pg instance, so it is + only for testing/demonstration purposes. Please configure persistent storage for production + environments. + + + ### Create a file named `lobe-chat.env` to store environment variables: + + ```shell + # Website domain + APP_URL=https://your-prod-domain.com + + # DB required environment variables + KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= + # Postgres database connection string + # Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container name + DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres + + # NEXT_AUTH related, can use auth0, Azure AD, GitHub, Authentik, zitadel, etc. If you have other access requirements, feel free to submit a PR + NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 + NEXT_AUTH_SSO_PROVIDERS=auth0 + NEXTAUTH_URL=https://your-prod-domain.com/api/auth + AUTH_AUTH0_ID=xxxxxx + AUTH_AUTH0_SECRET=cSX_xxxxx + AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com + + # S3 related + S3_ACCESS_KEY_ID=xxxxxxxxxx + S3_SECRET_ACCESS_KEY=xxxxxxxxxx + S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com + S3_BUCKET=lobechat + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + + # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE. + # OPENAI_API_KEY=sk-xxxx + # OPENAI_PROXY_URL=https://api.openai.com/v1 + # OPENAI_MODEL_LIST=... + ``` + + ### Start the lobe-chat-database Docker image + + ```sh + docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database + ``` + + You can use the following command to check the logs: + + ```sh + docker logs -f lobe-chat-database + ``` + + If you see the following logs in the container, it means it has started successfully: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://localhost:3210 + - Network: http://0.0.0.0:3210 + + ✓ Starting... + ✓ Ready in 95ms + ``` diff --git a/docs/self-hosting/server-database/docker.zh-CN.mdx b/docs/self-hosting/server-database/docker.zh-CN.mdx index d6e9d3103a67..a930d2750d6c 100644 --- a/docs/self-hosting/server-database/docker.zh-CN.mdx +++ b/docs/self-hosting/server-database/docker.zh-CN.mdx @@ -13,10 +13,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
@@ -31,8 +30,7 @@ tags: 由于无法使用 Docker 环境变量暴露 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,使用 Docker / Docker Compose 部署 LobeChat 时,你不能使用 Clerk 作为登录鉴权服务。 -如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。 - + 如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。 ## 在 Linux 服务器上部署 @@ -40,92 +38,90 @@ tags: 以下是在 Linux 服务器上部署 LobeChat DB 版的流程: - -### 创建 Postgres 数据库实例 - -请按照你自己的诉求创建一个带有 PGVector 插件的 Postgres 数据库实例,例如: - -```sh -docker network create pg - -docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 -``` - -上述指令会创建一个名为 `my-postgres`,并且网络为 `pg` 的 PG 实例,其中 `pgvector/pgvector:pg16` 是一个 Postgres 16 的镜像,且默认安装了 pgvector 插件。 - - - pgvector 插件为 Postgres 提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。 - - - - 以上指令得到的 pg - 实例并没有指定持久化存储位置,因此仅用于测试/演示,生产环境请自行配置持久化存储。 - - -### 创建名为 `lobe-chat.env` 文件用于存放环境变量: - -```shell -# 网站域名 -APP_URL=https://your-prod-domain.com - -# DB 必须的环境变量 -# 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成 -KEY_VAULTS_SECRET='jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=' -# Postgres 数据库连接字符串 -# 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器,请使用容器名 -DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres - -# NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、zitadel 等,如有其他接入诉求欢迎提 PR -NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 -NEXT_AUTH_SSO_PROVIDERS=auth0 -NEXTAUTH_URL=https://your-prod-domain.com/api/auth -AUTH_AUTH0_ID=xxxxxx -AUTH_AUTH0_SECRET=cSX_xxxxx -AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com - -# S3 相关 -S3_ACCESS_KEY_ID=xxxxxxxxxx -S3_SECRET_ACCESS_KEY=xxxxxxxxxx -# 用于 S3 API 访问的域名 -S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com -S3_BUCKET=lobechat -# 用于外网访问 S3 的公共域名,需配置 CORS -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -# S3_REGION=ap-chengdu # 如果需要指定地域 - -# 其他环境变量,视需求而定 -# OPENAI_API_KEY=sk-xxxx -# OPENAI_PROXY_URL=https://api.openai.com/v1 -# OPENAI_MODEL_LIST=... -# ... -``` - -### 启动 lobe-chat-database docker 镜像 - -```sh -docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database -``` - -你可以使用下述指令检查日志: - -```sh -docker logs -f lobe-chat-database -``` - -如果你在容器中看到了以下日志,则说明已经启动成功: - -```log -[Database] Start to migration... -✅ database migration pass. -------------------------------------- - ▲ Next.js 14.x.x - - Local: http://localhost:3210 - - Network: http://0.0.0.0:3210 - - ✓ Starting... - ✓ Ready in 95ms -``` - + ### 创建 Postgres 数据库实例 + + 请按照你自己的诉求创建一个带有 PGVector 插件的 Postgres 数据库实例,例如: + + ```sh + docker network create pg + + docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 + ``` + + 上述指令会创建一个名为 `my-postgres`,并且网络为 `pg` 的 PG 实例,其中 `pgvector/pgvector:pg16` 是一个 Postgres 16 的镜像,且默认安装了 pgvector 插件。 + + + pgvector 插件为 Postgres 提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。 + + + + 以上指令得到的 pg + 实例并没有指定持久化存储位置,因此仅用于测试 / 演示,生产环境请自行配置持久化存储。 + + + ### 创建名为 `lobe-chat.env` 文件用于存放环境变量: + + ```shell + # 网站域名 + APP_URL=https://your-prod-domain.com + + # DB 必须的环境变量 + # 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成 + KEY_VAULTS_SECRET='jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=' + # Postgres 数据库连接字符串 + # 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器,请使用容器名 + DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres + + # NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、zitadel 等,如有其他接入诉求欢迎提 PR + NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 + NEXT_AUTH_SSO_PROVIDERS=auth0 + NEXTAUTH_URL=https://your-prod-domain.com/api/auth + AUTH_AUTH0_ID=xxxxxx + AUTH_AUTH0_SECRET=cSX_xxxxx + AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com + + # S3 相关 + S3_ACCESS_KEY_ID=xxxxxxxxxx + S3_SECRET_ACCESS_KEY=xxxxxxxxxx + # 用于 S3 API 访问的域名 + S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com + S3_BUCKET=lobechat + # 用于外网访问 S3 的公共域名,需配置 CORS + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + # S3_REGION=ap-chengdu # 如果需要指定地域 + + # 其他环境变量,视需求而定 + # OPENAI_API_KEY=sk-xxxx + # OPENAI_PROXY_URL=https://api.openai.com/v1 + # OPENAI_MODEL_LIST=... + # ... + ``` + + ### 启动 lobe-chat-database docker 镜像 + + ```sh + docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database + ``` + + 你可以使用下述指令检查日志: + + ```sh + docker logs -f lobe-chat-database + ``` + + 如果你在容器中看到了以下日志,则说明已经启动成功: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://localhost:3210 + - Network: http://0.0.0.0:3210 + + ✓ Starting... + ✓ Ready in 95ms + ``` diff --git a/docs/self-hosting/server-database/dokploy.mdx b/docs/self-hosting/server-database/dokploy.mdx index 67d80cb25f91..849e403ad201 100644 --- a/docs/self-hosting/server-database/dokploy.mdx +++ b/docs/self-hosting/server-database/dokploy.mdx @@ -11,14 +11,19 @@ tags: --- # Deploying Server Database Version on Dokploy. + This article will detail how to deploy the server database version of LobeChat. + ## 1. Preparation Work + ### Deploy Dokploy and configure related settings. + ```shell curl -sSL https://dokploy.com/install.sh | sh ``` + 1. Connect your GitHub to Dokploy in the Settings / Git section according to the prompt. - + ![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996) 2. Enter the Projects interface to create a Project. @@ -26,7 +31,9 @@ curl -sSL https://dokploy.com/install.sh | sh ![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e) ### Configure S3 Storage Service + 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: + ```shell S3_ACCESS_KEY_ID= S3_SECRET_ACCESS_KEY= @@ -35,28 +42,36 @@ S3_BUCKET= S3_PUBLIC_DOMAIN= S3_ENABLE_PATH_STYLE= ``` + ### Configure the Clerk authentication service. + 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. + ```shell NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx ``` + ## 2. Deploying the database on Dokploy + Enter the previously created Project, click on Create Service, and select Database. In the Database interface, choose PostgreSQL, then set the database name, user, and password. In the Docker image field, enter `pgvector/pgvector:pg17`, and finally click Create to create the database. ![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f) 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: + ```shell postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres ``` + Finally, click Deploy to deploy the database. ![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e) ## Deploy LobeChat on Dokploy. + Click "Create Service", select "Application", and create the LobeChat application. ![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c) @@ -106,6 +121,7 @@ OPENAI_API_KEY= OPENAI_MODEL_LIST= OPENAI_PROXY_URL= ``` + After adding the environment variables and saving, click Deploy to initiate the deployment. You can check the deployment progress and log information under Deployments. ![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec) @@ -115,6 +131,7 @@ After a successful deployment, bind your own domain to your LobeChat application ![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7) ## Check if LobeChat is working properly. + Go to your LobeChat website, and if you click on the login button in the upper left corner and the login pop-up appears normally, it means you have configured it successfully. Enjoy it to the fullest! ![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26) diff --git a/docs/self-hosting/server-database/dokploy.zh-CN.mdx b/docs/self-hosting/server-database/dokploy.zh-CN.mdx index 3c7a2b8cbfee..61c0055e27e3 100644 --- a/docs/self-hosting/server-database/dokploy.zh-CN.mdx +++ b/docs/self-hosting/server-database/dokploy.zh-CN.mdx @@ -10,67 +10,82 @@ tags: - 身份验证服务 - 环境变量配置 --- - -# 在 Dokploy 上部署服务端数据库版 -本文将详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat。 -## 一、准备工作 -### 部署 Dokploy 并进行相关设置 -```shell -curl -sSL https://dokploy.com/install.sh | sh -``` -1. 在 Dokploy 的 Settings / Git 处根据提示将 Github 绑定到 Dokploy - -![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996) - -2. 进入 Projects 界面创建一个 Project - -![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e) - -### 配置 S3 存储服务 -在服务端数据库中我们需要配置 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)。配置完成后你将获得以下环境变量: -```shell + +# 在 Dokploy 上部署服务端数据库版 + +本文将详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat。 + +## 一、准备工作 + +### 部署 Dokploy 并进行相关设置 + +```shell +curl -sSL https://dokploy.com/install.sh | sh +``` + +1. 在 Dokploy 的 Settings / Git 处根据提示将 Github 绑定到 Dokploy + +![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996) + +2. 进入 Projects 界面创建一个 Project + +![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e) + +### 配置 S3 存储服务 + +在服务端数据库中我们需要配置 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)。配置完成后你将获得以下环境变量: + +```shell S3_ACCESS_KEY_ID= S3_SECRET_ACCESS_KEY= S3_ENDPOINT= S3_BUCKET= S3_PUBLIC_DOMAIN= -S3_ENABLE_PATH_STYLE= -``` -### 配置 Clerk 身份验证服务 -获取 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、`CLERK_SECRET_KEY` 、`CLERK_WEBHOOK_SECRET` 这三个环境变量,Clerk的详细配置流程请参考 使用 Vercel 部署中 [配置身份验证服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#二、-配置身份验证服务) -```shell +S3_ENABLE_PATH_STYLE= +``` + +### 配置 Clerk 身份验证服务 + +获取 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、`CLERK_SECRET_KEY` 、`CLERK_WEBHOOK_SECRET` 这三个环境变量,Clerk 的详细配置流程请参考 使用 Vercel 部署中 [配置身份验证服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#二、-配置身份验证服务) + +```shell NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` -## 二、在 Dokploy 上部署数据库 -进入前面创建的Project,点击 Create Service 选择 Database,在 Database 界面选择 PostgreSQL ,然后设置数据库名、用户、密码,在 Docker image 中填入 `pgvector/pgvector:pg17` 最后点击 Create 创建数据库。 - -![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f) - +CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx +``` + +## 二、在 Dokploy 上部署数据库 + +进入前面创建的 Project,点击 Create Service 选择 Database,在 Database 界面选择 PostgreSQL ,然后设置数据库名、用户、密码,在 Docker image 中填入 `pgvector/pgvector:pg17` 最后点击 Create 创建数据库。 + +![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f) + 进入创建的数据库,在 External Credentials 设置一个未被占用的端口,使其能能通过外部访问,否则 LobeChat 将无法连接到该数据库。 -你可以在 External Host 查看 Postgres 数据库连接 URL ,如下: -```shell -postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres -``` -最后点击 Deploy 部署数据库 - -![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e) - -## 在 Dokploy 上部署 LobeChat -点击 Create Service 选择 Application,创建 LobeChat 应用 - -![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c) - -进入创建的 LobeChat 应用,选择你 fork 的 lobe-chat 项目及分支,点击 Save 保存 - -![](https://github.com/user-attachments/assets/2bb4c09d-75bb-4c46-bb2f-faf538308305) - -切换到 Environment ,在其中填入环境变量,点击保存。 - -![](https://github.com/user-attachments/assets/0f79c266-cce5-4936-aabd-4c8f19196d91) - -```shell +你可以在 External Host 查看 Postgres 数据库连接 URL ,如下: + +```shell +postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres +``` + +最后点击 Deploy 部署数据库 + +![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e) + +## 在 Dokploy 上部署 LobeChat + +点击 Create Service 选择 Application,创建 LobeChat 应用 + +![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c) + +进入创建的 LobeChat 应用,选择你 fork 的 lobe-chat 项目及分支,点击 Save 保存 + +![](https://github.com/user-attachments/assets/2bb4c09d-75bb-4c46-bb2f-faf538308305) + +切换到 Environment ,在其中填入环境变量,点击保存。 + +![](https://github.com/user-attachments/assets/0f79c266-cce5-4936-aabd-4c8f19196d91) + +```shell # 构建所必需的环境变量 NIXPACKS_PKGS="pnpm bun" NIXPACKS_INSTALL_CMD="pnpm install" @@ -105,18 +120,19 @@ S3_ENABLE_PATH_STYLE= # OpenAI 相关配置 OPENAI_API_KEY= OPENAI_MODEL_LIST= -OPENAI_PROXY_URL= -``` -添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息 - -![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec) - -部署成功后在 Domains 页面,为你的 LobeChat 应用绑定自己的域名并申请证书。 - -![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7) - -## 验证 LobeChat 是否正常工作 -进入你的 LobeChat 网址,如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~ - -![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26) - +OPENAI_PROXY_URL= +``` + +添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息 + +![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec) + +部署成功后在 Domains 页面,为你的 LobeChat 应用绑定自己的域名并申请证书。 + +![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7) + +## 验证 LobeChat 是否正常工作 + +进入你的 LobeChat 网址,如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~ + +![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26) diff --git a/docs/self-hosting/server-database/repocloud.mdx b/docs/self-hosting/server-database/repocloud.mdx index 55e04e33ed77..ee95f9601f36 100644 --- a/docs/self-hosting/server-database/repocloud.mdx +++ b/docs/self-hosting/server-database/repocloud.mdx @@ -17,19 +17,17 @@ If you want to deploy LobeChat Database Edition on RepoCloud, you can follow the ## RepoCloud Deployment Process + ### Prepare your OpenAI API Key -### Prepare your OpenAI API Key + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + ### One-click to deploy -### One-click to deploy + [![Deploy to RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248) -[![Deploy to RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248) + ### Once deployed, you can start using it -### Once deployed, you can start using it - -### Bind a custom domain (optional) - -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. + ### Bind a custom domain (optional) + 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. diff --git a/docs/self-hosting/server-database/repocloud.zh-CN.mdx b/docs/self-hosting/server-database/repocloud.zh-CN.mdx index ae397c86216f..dd9bfbc7304c 100644 --- a/docs/self-hosting/server-database/repocloud.zh-CN.mdx +++ b/docs/self-hosting/server-database/repocloud.zh-CN.mdx @@ -11,24 +11,22 @@ tags: # 在 RepoCloud 上部署 LobeChat 数据库版 -如果您想在RepoCloud上部署LobeChat数据库版,可以按照以下步骤进行操作: +如果您想在 RepoCloud 上部署 LobeChat 数据库版,可以按照以下步骤进行操作: -## RepoCloud部署流程 +## RepoCloud 部署流程 + ### 准备您的 OpenAI API 密钥 -### 准备您的 OpenAI API 密钥 + 请访问 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。 -请访问 [OpenAI API密钥](https://platform.openai.com/account/api-keys) 获取您的OpenAI API密钥。 + ### 一键部署 -### 一键部署 + [![部署到 RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248) -[![部署到RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248) + ### 部署完成后,您可以开始使用 -### 部署完成后,您可以开始使用 - -### 绑定自定义域名(可选) - -您可以使用RepoCloud提供的子域名,或选择绑定自定义域名。目前,RepoCloud提供的域名尚未被污染,大多数地区可以直接连接。 + ### 绑定自定义域名(可选) + 您可以使用 RepoCloud 提供的子域名,或选择绑定自定义域名。目前,RepoCloud 提供的域名尚未被污染,大多数地区可以直接连接。 diff --git a/docs/self-hosting/server-database/vercel.mdx b/docs/self-hosting/server-database/vercel.mdx index 909b2448885f..29a50560399b 100644 --- a/docs/self-hosting/server-database/vercel.mdx +++ b/docs/self-hosting/server-database/vercel.mdx @@ -15,107 +15,90 @@ tags: 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. + Before proceeding, please make sure of the following: -Before proceeding, please make sure of the following: - -- 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! -- The `ACCESS_CODE` in the environment variables is either unset or cleared! -- 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! - + - 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! + - The `ACCESS_CODE` in the environment variables is either unset or cleared! + - 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! ## 1. Configure the Database + ### Prepare the Server Database Instance and Obtain the Connection URL -### Prepare the Server Database Instance and Obtain the Connection URL - -Before deployment, make sure you have prepared a Postgres database instance. You can choose one of the following methods: - -- `A.` Use Serverless Postgres instances like Vercel / Neon; -- `B.` Use self-deployed Postgres instances like Docker. - -The configuration for both methods is slightly different, and will be distinguished in the next step. + Before deployment, make sure you have prepared a Postgres database instance. You can choose one of the following methods: -### Add Environment Variables in Vercel + - `A.` Use Serverless Postgres instances like Vercel / Neon; + - `B.` Use self-deployed Postgres instances like Docker. -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`. - - - - - - - Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to - the `Node Postgres` Tab. - + The configuration for both methods is slightly different, and will be distinguished in the next step. -Variables to be filled for Serverless Postgres are as follows: + ### Add Environment Variables in Vercel -```shell -# Serverless Postgres DB Url -DATABASE_URL= + 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`. -# Specify service mode as server, otherwise it will not enter the server-side database -NEXT_PUBLIC_SERVICE_MODE=server -``` + + + + Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to + the `Node Postgres` Tab. + -An example of filling in Vercel is as follows: + Variables to be filled for Serverless Postgres are as follows: -{'Add + ```shell + # Serverless Postgres DB Url + DATABASE_URL= - + # Specify service mode as server, otherwise it will not enter the server-side database + NEXT_PUBLIC_SERVICE_MODE=server + ``` - - Variables to be filled for Node Postgres are as follows: + An example of filling in Vercel is as follows: -```shell -# Node Postgres DB Url -DATABASE_URL= + {'Add + -# Specify Postgres database driver as node -DATABASE_DRIVER=node + + Variables to be filled for Node Postgres are as follows: -# Specify service mode as server, otherwise it will not enter the server-side database -NEXT_PUBLIC_SERVICE_MODE=server -``` + ```shell + # Node Postgres DB Url + DATABASE_URL= -An example of filling in Vercel is as follows: + # Specify Postgres database driver as node + DATABASE_DRIVER=node -{'Add + # Specify service mode as server, otherwise it will not enter the server-side database + NEXT_PUBLIC_SERVICE_MODE=server + ``` - + An example of filling in Vercel is as follows: - + {'Add + + - If you wish to enable SSL when connecting to the database, please refer to the [link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) for setup instructions. + - + ### Add the `KEY_VAULTS_SECRET` Environment Variable -### Add the `KEY_VAULTS_SECRET` Environment Variable + 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`. -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`. + ```shell + KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= + ``` -```shell -KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= -``` + Make sure to add this to the Vercel environment variables as well. -Make sure to add this to the Vercel environment variables as well. - -### Add the `APP_URL` Environment Variable - -Finally, you need to add the `APP_URL` environment variable, which specifies the URL address of the LobeChat application. + ### Add the `APP_URL` Environment Variable + Finally, you need to add the `APP_URL` environment variable, which specifies the URL address of the LobeChat application. ## 2. Configure Authentication Service @@ -123,87 +106,63 @@ Finally, you need to add the `APP_URL` environment variable, which specifies the 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. + ### Prepare Clerk Authentication Service -### Prepare Clerk Authentication Service - -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. + 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. - If you are not familiar with Clerk, you can refer to [Authentication Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk. + -
- -### Add Public and Private Key Environment Variables in Vercel + ### Add Public and Private Key Environment Variables in Vercel -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. + 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. -{'Find + {'Find -The environment variables required for this step are as follows: + The environment variables required for this step are as follows: -```shell -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx -CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -``` + ```shell + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx + CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx + ``` -Add the above variables to Vercel: + Add the above variables to Vercel: -{'Add + {'Add -### Create and Configure Webhook in Clerk + ### Create and Configure Webhook in Clerk -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. + 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. -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. + 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. -{'Add + {'Add -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. + 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. - The `https://` in the URL is essential to maintain the integrity of the URL. + -
- -{'Configure - -### Add Webhook Secret to Vercel Environment Variables + {'Configure -After creation, you can find the secret of this Webhook in the bottom right corner: + ### Add Webhook Secret to Vercel Environment Variables -{'View + After creation, you can find the secret of this Webhook in the bottom right corner: -The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`: + {'View -```shell -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` + The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`: -Add it to Vercel's environment variables: + ```shell + CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx + ``` -{'Add + Add it to Vercel's environment variables: + {'Add 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 In the server-side database, we need to configure the S3 storage service to store files. - -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. - + 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. + ### Configure and Obtain S3 Bucket -### Configure and Obtain S3 Bucket + 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. -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. + The interface of Cloudflare R2 is shown below: -The interface of Cloudflare R2 is shown below: + {'Cloudflare -{'Cloudflare + When creating a storage bucket, specify its name and then click create. -When creating a storage bucket, specify its name and then click create. + {'Create -{'Create + ### Obtain Environment Variables for the Bucket -### Obtain Environment Variables for the Bucket + In the settings of the R2 storage bucket, you can view the bucket configuration information: -In the settings of the R2 storage bucket, you can view the bucket configuration information: + {'View -{'View + The corresponding environment variables are: -The corresponding environment variables are: + ```shell + # Storage bucket name + S3_BUCKET=lobechat + # 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) + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # Public access domain for the storage bucket + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + ``` -```shell -# Storage bucket name -S3_BUCKET=lobechat -# 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) -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# Public access domain for the storage bucket -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -``` + + `S3_ENDPOINT` must have its path removed, otherwise uploaded files will not be accessible + - - `S3_ENDPOINT` must have its path removed, otherwise uploaded files will not be accessible - + ### Obtain S3 Key Environment Variables -### Obtain S3 Key Environment Variables + 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: -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: + {'View -{'View + Click the button in the upper right corner to create an API token and enter the create API Token page. -Click the button in the upper right corner to create an API token and enter the create API Token page. + {'Create -{'Create + 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. -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. + {'Configure -{'Configure + After creation, you can see the corresponding S3 API token. -After creation, you can see the corresponding S3 API token. + {'Copy -{'Copy + The corresponding environment variables are: -The corresponding environment variables are: + ```shell + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + ``` -```shell -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -``` + ### Adding Corresponding Environment Variables in Vercel -### Adding Corresponding Environment Variables in Vercel + The steps to obtain the required environment variables may vary for different S3 service providers, but the obtained environment variables should be consistent: -The steps to obtain the required environment variables may vary for different S3 service providers, but the obtained environment variables should be consistent: + + The `https://` in the URL is essential and must be maintained for the completeness of the URL. + - - The `https://` in the URL is essential and must be maintained for the completeness of the URL. - + ```shell + # S3 Keys + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -```shell -# S3 Keys -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + # Bucket name + S3_BUCKET=lobechat + # Bucket request endpoint + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # Public domain for bucket access + S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com -# Bucket name -S3_BUCKET=lobechat -# Bucket request endpoint -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# Public domain for bucket access -S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com - -# Bucket region, such as us-west-1, generally not required, but some providers may need to configure -# S3_REGION=us-west-1 -``` - -Then, insert the above environment variables into Vercel's environment variables: + # Bucket region, such as us-west-1, generally not required, but some providers may need to configure + # S3_REGION=us-west-1 + ``` -{'Adding + Then, insert the above environment variables into Vercel's environment variables: -### Configuring Cross-Origin Resource Sharing (CORS) + {'Adding -Since S3 storage services are often on a separate domain, cross-origin access needs to be configured. + ### Configuring Cross-Origin Resource Sharing (CORS) -In R2, you can find the CORS configuration in the bucket settings: + Since S3 storage services are often on a separate domain, cross-origin access needs to be configured. -{'Cloudflare + In R2, you can find the CORS configuration in the bucket settings: -Add a CORS rule to allow requests from your domain (in this case, `https://your-project.vercel.app`): + {'Cloudflare -{'Configuring + Add a CORS rule to allow requests from your domain (in this case, `https://your-project.vercel.app`): -Example configuration: + {'Configuring -```json -[ - { - "AllowedOrigins": ["https://your-project.vercel.app"], - "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], - "AllowedHeaders": ["*"] - } -] -``` + Example configuration: -After configuring, click save. + ```json + [ + { + "AllowedOrigins": ["https://your-project.vercel.app"], + "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], + "AllowedHeaders": ["*"] + } + ] + ``` + After configuring, click save. ## Four, Deployment and Verification @@ -371,27 +296,17 @@ After completing the steps above, the configuration of the server-side database ### Redeploy the latest commit -After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete. - -{'Redeploy + After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete. -### Check if the features are working properly + {'Redeploy -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\~ + ### Check if the features are working properly -{'User + 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\~ -{'Login + {'User + {'Login ## Appendix diff --git a/docs/self-hosting/server-database/vercel.zh-CN.mdx b/docs/self-hosting/server-database/vercel.zh-CN.mdx index bbcc7a86531b..b26721be5132 100644 --- a/docs/self-hosting/server-database/vercel.zh-CN.mdx +++ b/docs/self-hosting/server-database/vercel.zh-CN.mdx @@ -17,37 +17,34 @@ tags: 本文将详细介绍如何在 Vercel 中部署服务端数据库版 LobeChat,包括: 1)数据库配置;2)身份验证服务配置;3) S3 存储服务的设置步骤。 - 进行后续操作前,请务必确认以下事项: - - 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入! - - 环境变量中的`ACCESS_CODE`未设置或已清除! - - 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题! + 进行后续操作前,请务必确认以下事项: + + - 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入! + - 环境变量中的`ACCESS_CODE`未设置或已清除! + - 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题! ## 一、 配置数据库 + ### 准备服务端数据库实例,获取连接 URL -### 准备服务端数据库实例,获取连接 URL - -在部署之前,请确保你已经准备好 Postgres 数据库实例,你可以选择以下任一方式: + 在部署之前,请确保你已经准备好 Postgres 数据库实例,你可以选择以下任一方式: -- `A.` 使用 Vercel / Neon 等 Serverless Postgres 实例; -- `B.` 使用 Docker 等自部署 Postgres 实例。 + - `A.` 使用 Vercel / Neon 等 Serverless Postgres 实例; + - `B.` 使用 Docker 等自部署 Postgres 实例。 -两者的配置方式略有不同,在下一步会有所区分。 + 两者的配置方式略有不同,在下一步会有所区分。 -### 在 Vercel 中添加环境变量 + ### 在 Vercel 中添加环境变量 -在 Vercel 的部署环境变量中,添加 `DATABASE_URL` 等环境变量,将上一步准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。 + 在 Vercel 的部署环境变量中,添加 `DATABASE_URL` 等环境变量,将上一步准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。 - - 请确认您的供应商所提供的 `Postgres` 类型,若为 `Node Postgres`,请切换到 `Node Postgres` Tab 。 - - +
Serverless Postgres 需要填写的变量如下: @@ -61,9 +58,8 @@ tags: 在 Vercel 中填写的示例如下: - {'添加 - - + {'添加 + Node Postgres 需要填写的变量如下: @@ -81,31 +77,28 @@ tags: 在 Vercel 中填写的示例如下: - {'添加 + {'添加 + + - + + 如果希望连接数据库时启用 SSL + ,请自行参考[链接](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置 + - + ### 添加 `KEY_VAULTS_SECRET` 环境变量 - - 如果希望连接数据库时启用 SSL - ,请自行参考[链接](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置 - - -### 添加 `KEY_VAULTS_SECRET` 环境变量 - -在完成数据库 DATABASE_URL 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为密钥。 - -```shell -KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= -``` + 在完成数据库 `DATABASE_URL` 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为密钥。 -同样需要将其添加到 Vercel 环境变量中。 + ```shell + KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= + ``` -### 添加 `APP_URL` 环境变量 + 同样需要将其添加到 Vercel 环境变量中。 -该部分最后需要添加 APP_URL 环境变量,用于指定LobeChat 应用的 URL 地址。 + ### 添加 `APP_URL` 环境变量 + 该部分最后需要添加 `APP_UR`L 环境变量,用于指定 LobeChat 应用的 URL 地址。 ## 二、 配置身份验证服务 @@ -113,81 +106,61 @@ KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= 服务端数据库需要搭配用户身份验证服务才可以正常使用。因此需要配置对应的身份验证服务。 + ### 准备 Clerk 身份验证服务 -### 准备 Clerk 身份验证服务 + 前往 [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。 -前往 [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。 + + 如果对 Clerk 不太了解,可以查阅 + [身份验证服务 - Clerk](/zh/docs/self-hosting/advanced/authentication#clerk) 了解 Clerk 的使用详情。 + - - 如果对 Clerk 不太了解,可以查阅 - [身份验证服务-Clerk](/zh/docs/self-hosting/advanced/authentication#clerk) 了解 Clerk 的使用详情。 - + ### 在 Vercel 中添加公、私钥环境变量 -### 在 Vercel 中添加公、私钥环境变量 + 在 Vercel 的部署环境变量中,添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值填入 Vercel 的环境变量中。 -在 Vercel 的部署环境变量中,添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值填入 Vercel 的环境变量中。 + {'在 -{'在 + 此步骤所需的环境变量如下: -此步骤所需的环境变量如下: + ```shell + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx + CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx + ``` -```shell -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx -CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -``` - -添加上述变量到 Vercel 中: - -{'在 + 添加上述变量到 Vercel 中: -### 在 Clerk 中创建并配置 Webhook + {'在 -由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。 + ### 在 Clerk 中创建并配置 Webhook -我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。 + 由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。 -{'Clerk + 我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。 -在 endppint 中填写你的 Vercel 项目的 URL,如 `https://your-project.vercel.app/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。 + {'Clerk -URL的`https://`不可缺失,须保持URL的完整性 + 在 endppint 中填写你的 Vercel 项目的 URL,如 `https://your-project.vercel.app/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。 -{'添加 + URL 的`https://`不可缺失,须保持 URL 的完整性 -### 将 Webhook 秘钥添加到 Vercel 环境变量 + {'添加 -创建完毕后,可以在右下角找到该 Webhook 的秘钥: + ### 将 Webhook 秘钥添加到 Vercel 环境变量 -{'查看 + 创建完毕后,可以在右下角找到该 Webhook 的秘钥: -这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`: + {'查看 -```shell -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` + 这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`: -将其添加到 Vercel 的环境变量中: + ```shell + CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx + ``` -{'在 + 将其添加到 Vercel 的环境变量中: + {'在 这样,你已经成功配置了 Clerk 身份验证服务。接下来我们将配置 S3 存储服务。 @@ -197,149 +170,118 @@ CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx 在服务端数据库中我们需要配置 S3 存储服务来存储文件。 - 在本文,S3所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 Cloudflare + 在本文,S3 所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 Cloudflare R2 、阿里云 OSS 等均支持 S3 兼容 API。 + ### 配置并获取 S3 存储桶 - ### 配置并获取 S3 存储桶 + 你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。 - 你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。 + 下图是 Cloudflare R2 的界面: - 下图是 Cloudflare R2 的界面: + {'Cloudflare - {'Cloudflare + 创建存储桶时将指定其名称,然后点击创建。 - 创建存储桶时将指定其名称,然后点击创建。 - {'R2 + {'R2 - ### 获取存储桶相关环境变量 + ### 获取存储桶相关环境变量 - 在 R2 存储桶的设置中,可以看到桶配置的信息: + 在 R2 存储桶的设置中,可以看到桶配置的信息: - {'查看存储桶的相关信息'} + {'查看存储桶的相关信息'} -其对应的环境变量为: + 其对应的环境变量为: -```shell -# 存储桶的名称 -S3_BUCKET=lobechat -# 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接) -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# 存储桶对外的访问域名 -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -``` + ```shell + # 存储桶的名称 + S3_BUCKET=lobechat + # 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接) + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # 存储桶对外的访问域名 + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + ``` -`S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件 + `S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件 - ### 获取 S3 密钥环境变量 + ### 获取 S3 密钥环境变量 - 你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥: + 你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥: - {'查看存储桶的访问秘钥'} + {'查看存储桶的访问秘钥'} - 点击右上角按钮创建 API token,进入创建 API Token 页面 + 点击右上角按钮创建 API token,进入创建 API Token 页面 - {'创建对应 + {'创建对应 - 鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。 + 鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。 - {'配置 + {'配置 - 创建完成后,就可以看到对应的 S3 API token + 创建完成后,就可以看到对应的 S3 API token - {'复制 + {'复制 - 其对应的环境变量为: + 其对应的环境变量为: -```shell -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -``` - -### 在 Vercel 中添加对应的环境变量 + ```shell + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + ``` - 不同 S3 服务商获取所需环境变量的步骤可能有所不同,但最终获得到的环境变量应该都是一致的: + ### 在 Vercel 中添加对应的环境变量 -URL的`https://`不可缺失,须保持URL的完整性 + 不同 S3 服务商获取所需环境变量的步骤可能有所不同,但最终获得到的环境变量应该都是一致的: -```shell -# S3 秘钥 -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + URL 的`https://`不可缺失,须保持 URL 的完整性 -# 存储桶的名称 -S3_BUCKET=lobechat -# 存储桶的请求端点 -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# 存储桶对外的访问域名 -S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com + ```shell + # S3 秘钥 + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -# 桶的区域,如 us-west-1,一般来说不需要添加,但某些服务商则需要配置 -# S3_REGION=us-west-1 -``` + # 存储桶的名称 + S3_BUCKET=lobechat + # 存储桶的请求端点 + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # 存储桶对外的访问域名 + S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com -然后将上述环境变量填入 Vercel 的环境变量中: + # 桶的区域,如 us-west-1,一般来说不需要添加,但某些服务商则需要配置 + # S3_REGION=us-west-1 + ``` - {'在 + 然后将上述环境变量填入 Vercel 的环境变量中: - ### 配置跨域 + {'在 - 由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。 + ### 配置跨域 - 在 R2 中,你可以在存储桶的设置中找到跨域配置: + 由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。 - {'Cloudflare + 在 R2 中,你可以在存储桶的设置中找到跨域配置: - 添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求: + {'Cloudflare - {'配置允许你的站点域名'} + 添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求: -示例配置如下: + {'配置允许你的站点域名'} -```json -[ - { - "AllowedOrigins": ["https://your-project.vercel.app"], - "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], - "AllowedHeaders": ["*"] - } -] -``` + 示例配置如下: -配置后点击保存即可。 + ```json + [ + { + "AllowedOrigins": ["https://your-project.vercel.app"], + "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], + "AllowedHeaders": ["*"] + } + ] + ``` + 配置后点击保存即可。 ## 四、部署并验证 @@ -349,27 +291,17 @@ S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com ### 重新部署最新的 commit -配置好环境变量后,你需要重新部署最新的 commit,并等待部署完成。 - -{'重新部署最新的 + 配置好环境变量后,你需要重新部署最新的 commit,并等待部署完成。 -### 检查功能是否正常 + {'重新部署最新的 -如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~ + ### 检查功能是否正常 -{'用户登录弹窗'} + 如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~ -{'登录成功状态'} + {'用户登录弹窗'} + {'登录成功状态'} ## 附录 diff --git a/docs/self-hosting/server-database/zeabur.mdx b/docs/self-hosting/server-database/zeabur.mdx index e5e4fa411adb..5f9dc5503c19 100644 --- a/docs/self-hosting/server-database/zeabur.mdx +++ b/docs/self-hosting/server-database/zeabur.mdx @@ -32,47 +32,45 @@ The template on Zeabur includes 4 services: Here is the process for deploying the LobeChat server database version on Zeabur: + ### Go to the template page on Zeabur -### Go to the template page on Zeabur + Go to the [LobeChat Database template page](https://zeabur.com/templates/RRSPSD) on Zeabur and click on the "Deploy" button. -Go to the [LobeChat Database template page](https://zeabur.com/templates/RRSPSD) on Zeabur and click on the "Deploy" button. + ### Fill in the required environment variables -### Fill in the required environment variables + After you click on the "Deploy" button, you will see a modal pop-up where you can fill in the required environment variables. -After you click on the "Deploy" button, you will see a modal pop-up where you can fill in the required environment variables. + Here are the environment variables you need to fill in: -Here are the environment variables you need to fill in: + - OpenAI API key: Your OpenAI API key to get responses from OpenAI. -- OpenAI API key: Your OpenAI API key to get responses from OpenAI. + - LobeChat Domain: A free subdomain with `.zeabur.app` suffix. -- LobeChat Domain: A free subdomain with `.zeabur.app` suffix. + - MinIO Public Domain: A free subdomain with `.zeabur.app` suffix for yout MinIO web port to enable public access for the uploaded files. -- MinIO Public Domain: A free subdomain with `.zeabur.app` suffix for yout MinIO web port to enable public access for the uploaded files. + - Logto Console Domain: A free subdomain with `.zeabur.app` suffix for your Logto console. -- Logto Console Domain: A free subdomain with `.zeabur.app` suffix for your Logto console. + - Logto API Domain: A free subdomain with `.zeabur.app` suffix for your Logto api. -- Logto API Domain: A free subdomain with `.zeabur.app` suffix for your Logto api. + ### Select a region and deploy -### Select a region and deploy + After you fill all the required environment variables, select a region where you want to deploy your LobeChat Database and click on the "Deploy" button. -After you fill all the required environment variables, select a region where you want to deploy your LobeChat Database and click on the "Deploy" button. + You will see another modal pop-up where you can see the deployment progress. -You will see another modal pop-up where you can see the deployment progress. + ### Configure Logto -### Configure Logto + After the deployment is done, you need to configure your Logto service to enable authrization. -After the deployment is done, you need to configure your Logto service to enable authrization. + Access your Logto console with the console domain you just binded, and then create a `Next.js 14(App router)` application to get the client ID and client secret, and fill in the cors and callback URLs. You can check [this document](../advanced/auth.mdx) for a more detailed guide. -Access your Logto console with the console domain you just binded, and then create a `Next.js 14(App router)` application to get the client ID and client secret, and fill in the cors and callback URLs. You can check [this document](../advanced/auth.mdx) for a more detailed guide. + Fill in those variables into your LobeChat service on Zeabur, here is a more detailed guide for [editing environment variables on Zeabur](https://zeabur.com/docs/deploy/variables). -Fill in those variables into your LobeChat service on Zeabur, here is a more detailed guide for [editing environment variables on Zeabur](https://zeabur.com/docs/deploy/variables). + For detailed configuration of Logto, refer to [this document](/docs/self-hosting/advanced/auth/next-auth/logto). -For detailed configuration of Logto, refer to [this document](/docs/self-hosting/advanced/auth/next-auth/logto). + ### Access your LobeChat Instance -### Access your LobeChat Instance - -Press on the `LobeChat-Database` and you can see the public domain you just created, click on it to access your LobeChat Database. - -You can also bind a custom domain for your services if you want, here is a guide on how to [bind a custom domain on Zeabur](https://zeabur.com/docs/deploy/domain-binding). + Press on the `LobeChat-Database` and you can see the public domain you just created, click on it to access your LobeChat Database. + You can also bind a custom domain for your services if you want, here is a guide on how to [bind a custom domain on Zeabur](https://zeabur.com/docs/deploy/domain-binding). diff --git a/docs/self-hosting/server-database/zeabur.zh-CN.mdx b/docs/self-hosting/server-database/zeabur.zh-CN.mdx index b1c572c4ef52..a1d7fab2ae83 100644 --- a/docs/self-hosting/server-database/zeabur.zh-CN.mdx +++ b/docs/self-hosting/server-database/zeabur.zh-CN.mdx @@ -29,41 +29,39 @@ tags: 这里是在 Zeabur 上部署 LobeChat 服务器数据库版的流程: + ### 前往 Zeabur 上的模板页面 -### 前往 Zeabur 上的模板页面 + 前往 [Zeabur 上的 LobeChat 数据库模板页面](https://zeabur.com/templates/RRSPSD) 并点击 "Deploy" 按钮。 -前往 [Zeabur 上的 LobeChat 数据库模板页面](https://zeabur.com/templates/RRSPSD) 并点击 "Deploy" 按钮。 + ### 填写必要的环境变量 -### 填写必要的环境变量 + 在你点击 “部署 “按钮后,你会看到一个模态弹窗,你可以在这里填写必要的环境变量。 -在你点击“部署“按钮后,你会看到一个模态弹窗,你可以在这里填写必要的环境变量。 + 以下是你需要填写的环境变量: -以下是你需要填写的环境变量: + - OpenAI API key: 你的 OpenAI API key 用于获取模型的访问权限。 + - LobeChat Domain: 一个免费的 `.zeabur.app` 后缀的域名。 + - MinIO Public Domain: 一个免费的 `.zeabur.app` 后缀的域名为了暴露 MinIO 服务以公开访问资源。 + - Logto Console Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的控制台。 + - Logto API Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的 API。 -- OpenAI API key: 你的 OpenAI API key 用于获取模型的访问权限。 -- LobeChat Domain: 一个免费的 `.zeabur.app` 后缀的域名。 -- MinIO Public Domain: 一个免费的 `.zeabur.app` 后缀的域名为了暴露 MinIO 服务以公开访问资源。 -- Logto Console Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的控制台。 -- Logto API Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的 API。 + ### 选择一个区域并部署 -### 选择一个区域并部署 + 在你填写完所有必要的环境变量后,选择一个你想要部署 LobeChat 数据库的区域并点击 “部署” 按钮。 -在你填写完所有必要的环境变量后,选择一个你想要部署 LobeChat 数据库的区域并点击“部署”按钮。 + 你会看到另一个模态弹窗,你可以在这里看到部署的进度。 -你会看到另一个模态弹窗,你可以在这里看到部署的进度。 + ### 配置 Logto -### 配置 Logto + 当部署完成后,你会被自动导航到你在 Zeabur 控制台上刚刚创建的项目。你需要再进一步配置你的 Logto 服务。 -当部署完成后,你会被自动导航到你在 Zeabur 控制台上刚刚创建的项目。你需要再进一步配置你的 Logto 服务。 + 使用你刚绑定的域名来访问你的 Logto 控制台,创建一个新项目以获得对应的客户端 ID 与密钥,将它们填入你的 LobeChat 服务的变量中。关于如何填入变量,可以参照 [Zeabur 的官方文档](https://zeabur.com/docs/deploy/variables)。 -使用你刚绑定的域名来访问你的 Logto 控制台,创建一个新项目以获得对应的客户端 ID 与密钥,将它们填入你的 LobeChat 服务的变量中。关于如何填入变量,可以参照 [Zeabur 的官方文档](https://zeabur.com/docs/deploy/variables)。 + Logto 的详细配置可以参考[这篇文档](/zh/docs/self-hosting/advanced/auth/next-auth/logto)。 -Logto 的详细配置可以参考[这篇文档](/zh/docs/self-hosting/advanced/auth/next-auth/logto)。 + ### 访问你的 LobeChat -### 访问你的 LobeChat - -按下 `LobeChat-Database` 你会看到你刚刚创建的公共域名,点击它以访问你的 LobeChat 数据库。 - -你可以选择绑定一个自定义域名,这里有一个关于如何在 Zeabur 上[绑定自定义域名](https://zeabur.com/docs/deploy/domain-binding)的指南。 + 按下 `LobeChat-Database` 你会看到你刚刚创建的公共域名,点击它以访问你的 LobeChat 数据库。 + 你可以选择绑定一个自定义域名,这里有一个关于如何在 Zeabur 上[绑定自定义域名](https://zeabur.com/docs/deploy/domain-binding)的指南。 diff --git a/docs/self-hosting/start.mdx b/docs/self-hosting/start.mdx index c1af7e400f8e..4f5aa21e8a69 100644 --- a/docs/self-hosting/start.mdx +++ b/docs/self-hosting/start.mdx @@ -35,8 +35,5 @@ You can follow the guide below for quick deployment of LobeChat: For users who are already familiar with LobeChat or need cross-device synchronization, you can deploy a version with a server-side database to access a more complete and powerful LobeChat. - + diff --git a/docs/self-hosting/start.zh-CN.mdx b/docs/self-hosting/start.zh-CN.mdx index 914a06aca81e..35e2a92e0dc3 100644 --- a/docs/self-hosting/start.zh-CN.mdx +++ b/docs/self-hosting/start.zh-CN.mdx @@ -19,7 +19,7 @@ LobeChat 支持多种部署平台,包括 Vercel、Docker、 Docker Compose 和 ## 快速部署 -对于第一次了解 LobeChat 的用户,我们推荐使用客户端数据库的模式快速部署,该模式的优势是一行指令/一个按钮即可快捷完成部署,便于你快速上手与体验 LobeChat。 +对于第一次了解 LobeChat 的用户,我们推荐使用客户端数据库的模式快速部署,该模式的优势是一行指令 / 一个按钮即可快捷完成部署,便于你快速上手与体验 LobeChat。 你可以通过以下指南快速部署 LobeChat: diff --git a/docs/usage/agents/agent-organization.mdx b/docs/usage/agents/agent-organization.mdx index 477dcccec226..3ecdeff625d7 100644 --- a/docs/usage/agents/agent-organization.mdx +++ b/docs/usage/agents/agent-organization.mdx @@ -14,11 +14,7 @@ tags: # Assistant Organization Guide -{'Assistant +{'Assistant LobeChat provides a rich variety of AI assistant resources. Users can easily add various assistants through the assistant market, offering a wide range of application scenarios for AI applications. @@ -30,39 +26,27 @@ Firstly, LobeChat's AI assistants support organization through grouping. You can ### Assistant Settings -{'Assistant +{'Assistant - In the menu of an individual assistant, selecting the `Move to Group` option can quickly categorize the assistant into the specified group. - If you don't find the group you want, you can choose `Add Group` to quickly create a new group. ### Group Settings -{'Group +{'Group - In the group menu, you can quickly create a new assistant under that group. - Clicking the `Group Management` button allows you to `rename`, `delete`, `sort`, and perform other operations on all groups. ## Assistant Search -{'Assistant +{'Assistant - At the top of the assistant list, you can use the assistant search function to easily locate the assistant you need using keywords. ## Assistant Pinning -{'Assistant +{'Assistant - In the assistant menu, you can use the `Pin` function to pin the assistant to the top. - After pinning an assistant, a pinned area will appear at the top of the assistant list, displaying all pinned assistants. diff --git a/docs/usage/agents/agent-organization.zh-CN.mdx b/docs/usage/agents/agent-organization.zh-CN.mdx index 5ce6aa52e4e6..5bff869c49e5 100644 --- a/docs/usage/agents/agent-organization.zh-CN.mdx +++ b/docs/usage/agents/agent-organization.zh-CN.mdx @@ -12,11 +12,7 @@ tags: # 助手组织指南 -{'助手组织'} +{'助手组织'} LobeChat 提供了丰富的 AI 助手资源,用户可以通过助手市场方便地添加各类助手,为 AI 应用提供了广泛的应用场景。 @@ -28,39 +24,27 @@ LobeChat 提供了丰富的 AI 助手资源,用户可以通过助手市场方 ### 助手设置 -{'助手分组'} +{'助手分组'} - 在单个助手的菜单中,选择`移动到分组`选项可以快速将该助手归类到指定分组。 - 如果没有你想要的分组,可以选择`添加分组`,快速创建一个新的分组。 ### 分组设置 -{'分组菜单'} +{'分组菜单'} - 在分组菜单中,可以快速在该分组下新建助手 - 点击`分组管理`按钮可以对所有分组进行`重命名`、`删除`、`排序`等操作。 ## 助手搜索 -{'助手搜索'} +{'助手搜索'} - 在助手列表的顶部,您可以通过助手搜索功能,方便地使用关键词定位到您所需的助手。 ## 助手固定 -{'助手固定'} +{'助手固定'} - 在助手菜单中,你可以使用`固定`功能将该助手固定在顶部。 - 固定助手后,助手列表的上方将出现一个固定区域,显示所有已固定的助手列表。 diff --git a/docs/usage/agents/concepts.mdx b/docs/usage/agents/concepts.mdx index 358957978451..61cba7395093 100644 --- a/docs/usage/agents/concepts.mdx +++ b/docs/usage/agents/concepts.mdx @@ -21,8 +21,8 @@ In the official ChatGPT application, there is only the concept of "topics." As s {'ChatGPT However, in our usage, we have found that this model has many issues. For example, the information indexing of historical conversations is too scattered. Additionally, when dealing with repetitive tasks, it is difficult to have a stable entry point. For instance, if I want ChatGPT to help me translate a document, in this model, I would need to constantly create new topics and then set up the translation prompt I had previously created. When there are high-frequency tasks, this will result in a very inefficient interaction format. @@ -34,8 +34,8 @@ Therefore, in LobeChat, we have introduced the concept of **Agents**. An agent i {'Topics At the same time, we have integrated topics into each agent. The benefit of this approach is that each agent has an independent topic list. You can choose the corresponding agent based on the current task and quickly switch between historical conversation records. This method is more in line with users' habits in common chat software, improving interaction efficiency. diff --git a/docs/usage/agents/concepts.zh-CN.mdx b/docs/usage/agents/concepts.zh-CN.mdx index d76dcad0f2dd..cfee63f89762 100644 --- a/docs/usage/agents/concepts.zh-CN.mdx +++ b/docs/usage/agents/concepts.zh-CN.mdx @@ -18,8 +18,8 @@ tags: {'ChatGPT 但在我们的使用过程中其实会发现这种模式存在很多问题,比如历史对话的信息索引过于分散问题,同时当处理一些重复任务时很难有一个稳定的入口,比如我希望有一个稳定的入口可以让 ChatGPT 帮助我翻译文档,在这个模式下,我需要不断新建新的话题同时再设置我之前创建好的翻译 Prompt 设定,当有高频任务存在时,这将是一个效率很低的交互形式。 @@ -31,8 +31,8 @@ tags: {'「话题」与「助手」'} 与此同时,我们将话题索引到每个助手内部。这样做的好处是,每个助手都有一个独立的话题列表,你可以根据当前任务选择对应的助手,并快速切换历史对话记录。这种方式更符合用户对常见聊天软件的使用习惯,提高了交互的效率。 diff --git a/docs/usage/agents/custom-agent.mdx b/docs/usage/agents/custom-agent.mdx index c34eac5a68fe..34a36e2e9ef7 100644 --- a/docs/usage/agents/custom-agent.mdx +++ b/docs/usage/agents/custom-agent.mdx @@ -24,8 +24,8 @@ If you are a beginner in Prompt writing, you might want to browse the assistant {'Add ## `B` Create a custom assistant diff --git a/docs/usage/agents/custom-agent.zh-CN.mdx b/docs/usage/agents/custom-agent.zh-CN.mdx index 2011e0708e7b..62b6dc7a2a50 100644 --- a/docs/usage/agents/custom-agent.zh-CN.mdx +++ b/docs/usage/agents/custom-agent.zh-CN.mdx @@ -22,8 +22,8 @@ tags: {'通过角色市场添加'} ## `B` 通过新建自定义助手 diff --git a/docs/usage/agents/model.mdx b/docs/usage/agents/model.mdx index b5131fb0cad6..d1742a962e38 100644 --- a/docs/usage/agents/model.mdx +++ b/docs/usage/agents/model.mdx @@ -43,10 +43,10 @@ This parameter controls the randomness of the model's output. The higher the val ### `top_p` -Top_p is also a sampling parameter, but it differs from temperature in its sampling method. Before outputting, the model generates a bunch of tokens, and these tokens are ranked based on their quality. In the top-p sampling mode, the candidate word list is dynamic, and tokens are selected from the tokens based on a percentage. Top_p introduces randomness in token selection, allowing other high-scoring tokens to have a chance of being selected, rather than always choosing the highest-scoring one. +`top_p` is also a sampling parameter, but it differs from temperature in its sampling method. Before outputting, the model generates a bunch of tokens, and these tokens are ranked based on their quality. In the top-p sampling mode, the candidate word list is dynamic, and tokens are selected from the tokens based on a percentage. Top\_p introduces randomness in token selection, allowing other high-scoring tokens to have a chance of being selected, rather than always choosing the highest-scoring one. - Top\_p is similar to randomness, and it is generally not recommended to change it together with + `top_p` is similar to randomness, and it is generally not recommended to change it together with the randomness of temperature. @@ -75,5 +75,5 @@ It is a mechanism that penalizes frequently occurring new vocabulary in the text - `-2.0` When the morning news started broadcasting, I found that my TV now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now **(The highest frequency word is "now", accounting for 44.79%)** - `-1.0` He always watches the news in the early morning, in front of the TV watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch **(The highest frequency word is "watch", accounting for 57.69%)** - `0.0` When the morning sun poured into the small diner, a tired postman appeared at the door, carrying a bag of letters in his hands. The owner warmly prepared a breakfast for him, and he started sorting the mail while enjoying his breakfast. **(The highest frequency word is "of", accounting for 8.45%)** -- `1.0` A girl in deep sleep was woken up by a warm ray of sunshine, she saw the first ray of morning light, surrounded by birdsong and flowers, everything was full of vitality. \_ (The highest frequency word is "of", accounting for 5.45%) -- `2.0` Every morning, he would sit on the balcony to have breakfast. Under the soft setting sun, everything looked very peaceful. However, one day, when he was about to pick up his breakfast, an optimistic little bird flew by, bringing him a good mood for the day. \_ (The highest frequency word is "of", accounting for 4.94%) +- `1.0` A girl in deep sleep was woken up by a warm ray of sunshine, she saw the first ray of morning light, surrounded by birdsong and flowers, everything was full of vitality. (The highest frequency word is "of", accounting for 5.45%) +- `2.0` Every morning, he would sit on the balcony to have breakfast. Under the soft setting sun, everything looked very peaceful. However, one day, when he was about to pick up his breakfast, an optimistic little bird flew by, bringing him a good mood for the day. (The highest frequency word is "of", accounting for 4.94%) diff --git a/docs/usage/agents/model.zh-CN.mdx b/docs/usage/agents/model.zh-CN.mdx index 95264e4f4e91..a9659fae5801 100644 --- a/docs/usage/agents/model.zh-CN.mdx +++ b/docs/usage/agents/model.zh-CN.mdx @@ -41,9 +41,9 @@ LLM 看似很神奇,但本质还是一个概率问题,神经网络根据输 ### `top_p` -核采样 top_p 也是采样参数,跟 temperature 不一样的采样方式。模型在输出之前,会生成一堆 token,这些 token 根据质量高低排名,核采样模式中候选词列表是动态的,从 tokens 里按百分比选择候选词。 top_p 为选择 token 引入了随机性,让其他高分的 token 有被选择的机会,不会总是选最高分的。 +核采样 `top_p` 也是采样参数,跟 temperature 不一样的采样方式。模型在输出之前,会生成一堆 token,这些 token 根据质量高低排名,核采样模式中候选词列表是动态的,从 tokens 里按百分比选择候选词。 top\_p 为选择 token 引入了随机性,让其他高分的 token 有被选择的机会,不会总是选最高分的。 -top\_p 与随机性类似,一般来说不建议和随机性 temperature 一起更改 +`top_p` 与随机性类似,一般来说不建议和随机性 temperature 一起更改
@@ -67,8 +67,8 @@ Presence Penalty 参数可以看作是对生成文本中重复内容的一种惩 是一种机制,通过对文本中频繁出现的新词汇施加惩罚,以减少模型重复同一词语的可能性,值越大,越有可能降低重复字词。 -- `-2.0` 当早间新闻开始播出,我发现我家电视现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在 _(频率最高的词是 “现在”,占比 44.79%)_ -- `-1.0` 他总是在清晨看新闻,在电视前看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看 _(频率最高的词是 “看”,占比 57.69%)_ +- `-2.0` 当早间新闻开始播出,我发现我家电视现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在 *(频率最高的词是 “现在”,占比 44.79%)* +- `-1.0` 他总是在清晨看新闻,在电视前看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看 *(频率最高的词是 “看”,占比 57.69%)* - `0.0` 当清晨的阳光洒进小餐馆时,一名疲倦的邮递员出现在门口,他的手中提着一袋信件。店主热情地为他准备了一份早餐,他在享用早餐的同时开始整理邮件。**(频率最高的词是 “的”,占比 8.45%)** -- `1.0` 一个深度睡眠的女孩被一阵温暖的阳光唤醒,她看到了早晨的第一缕阳光,周围是鸟语花香,一切都充满了生机。_(频率最高的词是 “的”,占比 5.45%)_ -- `2.0` 每天早上,他都会在阳台上坐着吃早餐。在柔和的夕阳照耀下,一切看起来都非常宁静。然而有一天,当他准备端起早餐的时候,一只乐观的小鸟飞过,给他带来了一天的好心情。 _(频率最高的词是 “的”,占比 4.94%)_ +- `1.0` 一个深度睡眠的女孩被一阵温暖的阳光唤醒,她看到了早晨的第一缕阳光,周围是鸟语花香,一切都充满了生机。*(频率最高的词是 “的”,占比 5.45%)* +- `2.0` 每天早上,他都会在阳台上坐着吃早餐。在柔和的夕阳照耀下,一切看起来都非常宁静。然而有一天,当他准备端起早餐的时候,一只乐观的小鸟飞过,给他带来了一天的好心情。 *(频率最高的词是 “的”,占比 4.94%)* diff --git a/docs/usage/agents/prompt.mdx b/docs/usage/agents/prompt.mdx index 6d38cf6b787e..9a9e09413b45 100644 --- a/docs/usage/agents/prompt.mdx +++ b/docs/usage/agents/prompt.mdx @@ -30,7 +30,7 @@ Generative AI is very useful, but it requires human guidance. In most cases, gen Let's look at a basic discussion prompt example: -> _"What are the most urgent environmental issues facing our planet, and what actions can individuals take to help address these issues?"_ +> *"What are the most urgent environmental issues facing our planet, and what actions can individuals take to help address these issues?"* We can convert it into a simple prompt for the assistant to answer the following questions: placed at the front. @@ -54,17 +54,16 @@ The second prompt generates longer output and better structure. The use of the t There are several ways to improve the quality and effectiveness of prompts: -- **Be Clear About Your Needs:** The model's output will strive to meet your needs, so if your needs are not clear, the output may not meet expectations. -- **Use Correct Grammar and Spelling:** The model will try to mimic your language style, so if your language style is problematic, the output may also be problematic. -- **Provide Sufficient Contextual Information:** The model will generate output based on the contextual information you provide, so if the information is insufficient, it may not produce the desired results. - + - **Be Clear About Your Needs:** The model's output will strive to meet your needs, so if your needs are not clear, the output may not meet expectations. + - **Use Correct Grammar and Spelling:** The model will try to mimic your language style, so if your language style is problematic, the output may also be problematic. + - **Provide Sufficient Contextual Information:** The model will generate output based on the contextual information you provide, so if the information is insufficient, it may not produce the desired results. After formulating effective prompts for discussing issues, you now need to refine the generated results. This may involve adjusting the output to fit constraints such as word count or combining concepts from different generated results. A simple method of iteration is to generate multiple outputs and review them to understand the concepts and structures being used. Once the outputs have been evaluated, you can select the most suitable ones and combine them into a coherent response. Another iterative method is to start small and **gradually expand**. This requires more than one prompt: an initial prompt for drafting the initial one or two paragraphs, followed by additional prompts to expand on the content already written. Here is a potential philosophical discussion prompt: -> _"Is mathematics an invention or a discovery? Use careful reasoning to explain your answer."_ +> *"Is mathematics an invention or a discovery? Use careful reasoning to explain your answer."* Add it to a simple prompt as follows: diff --git a/docs/usage/agents/prompt.zh-CN.mdx b/docs/usage/agents/prompt.zh-CN.mdx index 31578925bf49..5c2e7de6cf4e 100644 --- a/docs/usage/agents/prompt.zh-CN.mdx +++ b/docs/usage/agents/prompt.zh-CN.mdx @@ -24,7 +24,7 @@ tags: 让我们看一个基本的讨论问题的例子: -> _"我们星球面临的最紧迫的环境问题是什么,个人可以采取哪些措施来帮助解决这些问题?"_ +> *"我们星球面临的最紧迫的环境问题是什么,个人可以采取哪些措施来帮助解决这些问题?"* 我们可以将其转化为简单的助手提示,将回答以下问题:放在前面。 @@ -50,17 +50,16 @@ tags: 提升 prompt 质量和效果的方法主要有以下几点: -- **尽量明确你的需求:** 模型的输出会尽可能满足你的需求,所以如果你的需求不明确,输出可能会不如预期。 -- **使用正确的语法和拼写:** 模型会尽可能模仿你的语言风格,所以如果你的语言风格有问题,输出可能也会有问题。 -- **提供足够的上下文信息:** 模型会根据你提供的上下文信息生成输出,所以如果你提供的上下文信息不足,可能无法生成你想要的结果。 - + - **尽量明确你的需求:** 模型的输出会尽可能满足你的需求,所以如果你的需求不明确,输出可能会不如预期。 + - **使用正确的语法和拼写:** 模型会尽可能模仿你的语言风格,所以如果你的语言风格有问题,输出可能也会有问题。 + - **提供足够的上下文信息:** 模型会根据你提供的上下文信息生成输出,所以如果你提供的上下文信息不足,可能无法生成你想要的结果。 在为讨论问题制定有效的提示后,您现在需要细化生成的结果。这可能涉及到调整输出以符合诸如字数等限制,或将不同生成的结果的概念组合在一起。 迭代的一个简单方法是生成多个输出并查看它们,以了解正在使用的概念和结构。一旦评估了输出,您就可以选择最合适的输出并将它们组合成一个连贯的回答。另一种迭代的方法是逐步开始,然后**逐步扩展**。这需要不止一个提示:一个起始提示,用于撰写最初的一两段,然后是其他提示,以扩展已经写过的内容。以下是一个潜在的哲学讨论问题: -> _"数学是发明还是发现?用仔细的推理来解释你的答案。"_ +> *"数学是发明还是发现?用仔细的推理来解释你的答案。"* 将其添加到一个简单的提示中,如下所示: diff --git a/docs/usage/agents/topics.mdx b/docs/usage/agents/topics.mdx index 1c8f2965faa2..88048a8dfc9c 100644 --- a/docs/usage/agents/topics.mdx +++ b/docs/usage/agents/topics.mdx @@ -19,8 +19,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602496-fd72037a-735e-4cc2-aa56-2994bceaba81.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602496-fd72037a-735e-4cc2-aa56-2994bceaba81.png' +} /> - **Save Topic:** During a conversation, if you want to save the current context and start a new topic, you can click the save button next to the send button. diff --git a/docs/usage/agents/topics.zh-CN.mdx b/docs/usage/agents/topics.zh-CN.mdx index 2a903387f9e3..bdf15271bf5f 100644 --- a/docs/usage/agents/topics.zh-CN.mdx +++ b/docs/usage/agents/topics.zh-CN.mdx @@ -17,8 +17,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602496-fd72037a-735e-4cc2-aa56-2994bceaba81.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602496-fd72037a-735e-4cc2-aa56-2994bceaba81.png' +} /> - **保存话题:** 在聊天过程中,如果想要保存当前上下文并开启新的话题,可以点击发送按钮旁边的保存按钮。 diff --git a/docs/usage/features/agent-market.mdx b/docs/usage/features/agent-market.mdx index fca028fb494e..7d85c13a1742 100644 --- a/docs/usage/features/agent-market.mdx +++ b/docs/usage/features/agent-market.mdx @@ -19,8 +19,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png' +} /> In LobeChat's Assistant Market, creators can discover a vibrant and innovative community that brings together numerous carefully designed assistants. These assistants not only play a crucial role in work scenarios but also provide great convenience in the learning process. Our market is not just a showcase platform, but also a collaborative space. Here, everyone can contribute their wisdom and share their personally developed assistants. diff --git a/docs/usage/features/agent-market.zh-CN.mdx b/docs/usage/features/agent-market.zh-CN.mdx index 91d6927109bb..7b675cff25ba 100644 --- a/docs/usage/features/agent-market.zh-CN.mdx +++ b/docs/usage/features/agent-market.zh-CN.mdx @@ -18,8 +18,8 @@ tags: alt={'助手市场'} cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png' +} /> 在 LobeChat 的助手市场中,创作者们可以发现一个充满活力和创新的社区,它汇聚了众多精心设计的助手,这些助手不仅在工作场景中发挥着重要作用,也在学习过程中提供了极大的便利。我们的市场不仅是一个展示平台,更是一个协作的空间。在这里,每个人都可以贡献自己的智慧,分享个人开发的助手。 diff --git a/docs/usage/features/auth.mdx b/docs/usage/features/auth.mdx index ba9afb971952..d96c66631380 100644 --- a/docs/usage/features/auth.mdx +++ b/docs/usage/features/auth.mdx @@ -17,11 +17,7 @@ tags: # Support Multi-User Management -{'Identity +{'Identity In modern applications, user management and identity verification are essential functions. To meet the diverse needs of different users, LobeChat provides two main user authentication and management solutions: `next-auth` and `Clerk`. Whether you are looking for simple user registration and login or need advanced multi-factor authentication and user management, LobeChat can flexibly accommodate your requirements. diff --git a/docs/usage/features/auth.zh-CN.mdx b/docs/usage/features/auth.zh-CN.mdx index 983c0c7b4dc7..0055daf18856 100644 --- a/docs/usage/features/auth.zh-CN.mdx +++ b/docs/usage/features/auth.zh-CN.mdx @@ -12,11 +12,7 @@ tags: # 身份验证系统 / 多用户管理支持 -{'身份验证系统'} +{'身份验证系统'} 在现代应用中,用户管理和身份验证是至关重要的功能。为满足不同用户的多样化需求,LobeChat 提供了两种主要的用户认证和管理方案:`next-auth` 和 `Clerk`。无论您是追求简便的用户注册登录,还是需要更高级的多因素认证和用户管理,LobeChat 都可以灵活实现。 diff --git a/docs/usage/features/database.mdx b/docs/usage/features/database.mdx index 83ef17bd15a5..6153038d1da7 100644 --- a/docs/usage/features/database.mdx +++ b/docs/usage/features/database.mdx @@ -16,11 +16,7 @@ tags: # Local / Cloud Database -{'Local +{'Local In modern application development, the choice of data storage solution is crucial. To meet the needs of different users, LobeChat offers flexible configurations that support both local and server-side databases. Whether you prioritize data privacy and control or seek a convenient user experience, LobeChat can provide excellent solutions for you. diff --git a/docs/usage/features/database.zh-CN.mdx b/docs/usage/features/database.zh-CN.mdx index 172afcadc6d1..51cabe44ec3d 100644 --- a/docs/usage/features/database.zh-CN.mdx +++ b/docs/usage/features/database.zh-CN.mdx @@ -12,11 +12,7 @@ tags: # 本地 / 云端数据存储 -{'本地 +{'本地 在现代应用开发中,数据存储方案的选择至关重要。为了满足不同用户的需求,LobeChat 提供了同时支持本地数据库和服务端数据库的灵活配置。无论您是注重数据隐私与掌控,还是追求便捷的使用体验,LobeChat 都能为您提供卓越的解决方案。 diff --git a/docs/usage/features/local-llm.mdx b/docs/usage/features/local-llm.mdx index a84df3c9374f..e84620d101ec 100644 --- a/docs/usage/features/local-llm.mdx +++ b/docs/usage/features/local-llm.mdx @@ -15,12 +15,7 @@ tags: # Local Large Language Model (LLM) Support -{'Ollama +{'Ollama Available in >=0.127.0, currently only supports Docker deployment @@ -52,5 +47,6 @@ Now, let's embark on this exciting journey together! Through the collaboration o + diff --git a/docs/usage/features/local-llm.zh-CN.mdx b/docs/usage/features/local-llm.zh-CN.mdx index c48643a0519e..0fd5c6446209 100644 --- a/docs/usage/features/local-llm.zh-CN.mdx +++ b/docs/usage/features/local-llm.zh-CN.mdx @@ -7,12 +7,7 @@ tags: # 支持本地大语言模型(LLM) -{'Ollama +{'Ollama 在 >=v0.127.0 版本中可用,目前仅支持 Docker 部署 @@ -44,5 +39,6 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 + diff --git a/docs/usage/features/mobile.mdx b/docs/usage/features/mobile.mdx index d74d728daedf..e60894768295 100644 --- a/docs/usage/features/mobile.mdx +++ b/docs/usage/features/mobile.mdx @@ -13,11 +13,7 @@ tags: # Mobile Device Adaptation -{'Mobile +{'Mobile LobeChat has undergone a series of optimized designs for mobile devices to enhance the user's mobile experience. diff --git a/docs/usage/features/mobile.zh-CN.mdx b/docs/usage/features/mobile.zh-CN.mdx index 5b881eb7416c..16b189e107ac 100644 --- a/docs/usage/features/mobile.zh-CN.mdx +++ b/docs/usage/features/mobile.zh-CN.mdx @@ -12,11 +12,7 @@ tags: # 移动设备适配 -{'移动端设备适配'} +{'移动端设备适配'} LobeChat 针对移动设备进行了一系列的优化设计,以提升用户的移动体验。 diff --git a/docs/usage/features/multi-ai-providers.mdx b/docs/usage/features/multi-ai-providers.mdx index c212badb2601..9fa520bcafd5 100644 --- a/docs/usage/features/multi-ai-providers.mdx +++ b/docs/usage/features/multi-ai-providers.mdx @@ -18,12 +18,7 @@ tags: # Multi-Model Service Provider Support -{'Multi-Model +{'Multi-Model Available in version 0.123.0 and later @@ -52,15 +47,12 @@ At the same time, we are also planning to support more model service providers, ## Local Model Support -{'Local +{'Local To meet the specific needs of users, LobeChat also supports the use of local models based on [Ollama](https://ollama.ai), allowing users to flexibly use their own or third-party models. For more details, see [Local Model Support](/docs/usage/features/local-llm). + diff --git a/docs/usage/features/multi-ai-providers.zh-CN.mdx b/docs/usage/features/multi-ai-providers.zh-CN.mdx index 761f6e7f8c53..3ebb026cdb6a 100644 --- a/docs/usage/features/multi-ai-providers.zh-CN.mdx +++ b/docs/usage/features/multi-ai-providers.zh-CN.mdx @@ -18,12 +18,7 @@ tags: # 多模型服务商支持 -{'多模型服务商支持'} +{'多模型服务商支持'} 在 0.123.0 及以后版本中可用 @@ -52,15 +47,12 @@ tags: ## 本地模型支持 -{'本地模型支持'} +{'本地模型支持'} 为了满足特定用户的需求,LobeChat 还基于 [Ollama](https://ollama.ai) 支持了本地模型的使用,让用户能够更灵活地使用自己的或第三方的模型,详见 [本地模型支持](/zh/docs/usage/features/local-llm)。 + diff --git a/docs/usage/features/plugin-system.mdx b/docs/usage/features/plugin-system.mdx index 80165cf0bb69..f7420e90c3aa 100644 --- a/docs/usage/features/plugin-system.mdx +++ b/docs/usage/features/plugin-system.mdx @@ -20,8 +20,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png' +} /> The plugin ecosystem of LobeChat is an important extension of its core functionality, greatly enhancing the practicality and flexibility of the LobeChat assistant. @@ -67,20 +67,19 @@ The plugin system of LobeChat has now entered a stable stage, and we have basica ### ✅ Phase One of Plugins -Implementing the separation of plugins from the main body, splitting the plugins into independent repositories for maintenance, and implementing dynamic loading of plugins. [**#73**](https://github.com/lobehub/lobe-chat/issues/73) + Implementing the separation of plugins from the main body, splitting the plugins into independent repositories for maintenance, and implementing dynamic loading of plugins. [**#73**](https://github.com/lobehub/lobe-chat/issues/73) -### ✅ Phase Two of Plugins + ### ✅ Phase Two of Plugins -The security and stability of plugin usage, more accurate presentation of abnormal states, maintainability and developer-friendliness of the plugin architecture. [**#97**](https://github.com/lobehub/lobe-chat/issues/97) + The security and stability of plugin usage, more accurate presentation of abnormal states, maintainability and developer-friendliness of the plugin architecture. [**#97**](https://github.com/lobehub/lobe-chat/issues/97) -### ✅ Phase Three of Plugins + ### ✅ Phase Three of Plugins -Higher-level and improved customization capabilities, support for OpenAPI schema invocation, compatibility with ChatGPT plugins, and the addition of Midjourney plugins. [**#411**](https://github.com/lobehub/lobe-chat/discussions/#411) + Higher-level and improved customization capabilities, support for OpenAPI schema invocation, compatibility with ChatGPT plugins, and the addition of Midjourney plugins. [**#411**](https://github.com/lobehub/lobe-chat/discussions/#411) -### 💭 Phase Four of Plugins - -Comprehensive authentication, visual configuration of plugin definitions, Plugin SDK CLI, Python language development template, any other ideas? Join the discussion: [**#1310**](https://github.com/lobehub/lobe-chat/discussions/#1310) + ### 💭 Phase Four of Plugins + Comprehensive authentication, visual configuration of plugin definitions, Plugin SDK CLI, Python language development template, any other ideas? Join the discussion: [**#1310**](https://github.com/lobehub/lobe-chat/discussions/#1310) [chat-plugin-sdk]: https://github.com/lobehub/chat-plugin-sdk diff --git a/docs/usage/features/plugin-system.zh-CN.mdx b/docs/usage/features/plugin-system.zh-CN.mdx index 1313ab1ec65c..34cf99da7ecb 100644 --- a/docs/usage/features/plugin-system.zh-CN.mdx +++ b/docs/usage/features/plugin-system.zh-CN.mdx @@ -15,8 +15,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png' +} /> LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地增强了 LobeChat 助手的实用性和灵活性。 @@ -56,20 +56,19 @@ LobeChat 的插件系统目前已初步进入一个稳定阶段,我们已基 ### ✅ 插件一期 -实现插件与主体分离,将插件拆分为独立仓库维护,并实现插件的动态加载。 [**#73**](https://github.com/lobehub/lobe-chat/issues/73) + 实现插件与主体分离,将插件拆分为独立仓库维护,并实现插件的动态加载。 [**#73**](https://github.com/lobehub/lobe-chat/issues/73) -### ✅ 插件二期 + ### ✅ 插件二期 -插件的安全性与使用的稳定性,更加精准地呈现异常状态,插件架构的可维护性与开发者友好。[**#97**](https://github.com/lobehub/lobe-chat/issues/97) + 插件的安全性与使用的稳定性,更加精准地呈现异常状态,插件架构的可维护性与开发者友好。[**#97**](https://github.com/lobehub/lobe-chat/issues/97) -### ✅ 插件三期 + ### ✅ 插件三期 -更高阶与完善的自定义能力,支持 OpenAPI schema 调用、兼容 ChatGPT 插件、新增 Midjourney 插件。 [**#411**](https://github.com/lobehub/lobe-chat/discussions/#411) + 更高阶与完善的自定义能力,支持 OpenAPI schema 调用、兼容 ChatGPT 插件、新增 Midjourney 插件。 [**#411**](https://github.com/lobehub/lobe-chat/discussions/#411) -### 💭 插件四期 - -完善的鉴权、可视化配置插件定义、 Plugin SDK CLI 、 Python 语言研发模板、还有什么想法?欢迎参与讨论: [**#1310**](https://github.com/lobehub/lobe-chat/discussions/#1310) + ### 💭 插件四期 + 完善的鉴权、可视化配置插件定义、 Plugin SDK CLI 、 Python 语言研发模板、还有什么想法?欢迎参与讨论: [**#1310**](https://github.com/lobehub/lobe-chat/discussions/#1310) [chat-plugin-sdk]: https://github.com/lobehub/chat-plugin-sdk diff --git a/docs/usage/features/pwa.mdx b/docs/usage/features/pwa.mdx index 606093d61c6c..035238067c2d 100644 --- a/docs/usage/features/pwa.mdx +++ b/docs/usage/features/pwa.mdx @@ -14,12 +14,7 @@ tags: # Progressive Web App (PWA) -{'Progressive +{'Progressive We understand the importance of providing a seamless experience for users in today's multi-device environment. To achieve this, we have adopted Progressive Web App [PWA](https://support.google.com/chrome/answer/9658361) technology, which is a modern web technology that elevates web applications to a near-native app experience. Through PWA, LobeChat is able to provide a highly optimized user experience on both desktop and mobile devices, while maintaining lightweight and high performance characteristics. Visually and perceptually, we have also carefully designed it to ensure that its interface is indistinguishable from a native app, providing smooth animations, responsive layouts, and adaptation to different screen resolutions of various devices. @@ -33,15 +28,13 @@ If you are unfamiliar with the installation process of PWA, you can follow the s
+ ### Run Chrome or Edge browser on your computer -### Run Chrome or Edge browser on your computer + ### Visit the LobeChat webpage -### Visit the LobeChat webpage - -### In the top right corner of the address bar, click the Install icon - -### Follow the on-screen instructions to complete the PWA installation + ### In the top right corner of the address bar, click the Install icon + ### Follow the on-screen instructions to complete the PWA installation ## Running on Safari @@ -49,26 +42,19 @@ If you are unfamiliar with the installation process of PWA, you can follow the s Safari PWA requires macOS Ventura or later. The PWA installed by Safari does not require Safari to be open; you can directly open the PWA app. + ### Run Safari browser on your computer -### Run Safari browser on your computer - -### Visit the LobeChat webpage - -### In the top right corner of the address bar, click the Share icon + ### Visit the LobeChat webpage -### Click Add to Dock + ### In the top right corner of the address bar, click the Share icon -### Follow the on-screen instructions to complete the PWA installation + ### Click Add to Dock + ### Follow the on-screen instructions to complete the PWA installation The default installed LobeChat PWA icon has a black background, you can use cmd + i to paste the following image to replace it with a white background. -{'PWA +{'PWA diff --git a/docs/usage/features/pwa.zh-CN.mdx b/docs/usage/features/pwa.zh-CN.mdx index b7b5564ce006..0f8d597a569d 100644 --- a/docs/usage/features/pwa.zh-CN.mdx +++ b/docs/usage/features/pwa.zh-CN.mdx @@ -14,12 +14,7 @@ tags: # 渐进式 Web 应用(PWA) -{'渐进式 +{'渐进式 我们深知在当今多设备环境下为用户提供无缝体验的重要性。为此,我们采用了渐进式 Web 应用 [PWA](https://support.google.com/chrome/answer/9658361) 技术,这是一种能够将网页应用提升至接近原生应用体验的现代 Web 技术。通过 PWA,LobeChat 能够在桌面和移动设备上提供高度优化的用户体验,同时保持轻量级和高性能的特点。在视觉和感觉上,我们也经过精心设计,以确保它的界面与原生应用无差别,提供流畅的动画、响应式布局和适配不同设备的屏幕分辨率。 @@ -33,15 +28,13 @@ tags:
+ ### 在电脑上运行 Chrome 或 Edge 浏览器 -### 在电脑上运行 Chrome 或 Edge 浏览器 + ### 访问 LobeChat 网页 -### 访问 LobeChat 网页 - -### 在地址栏的右上角,单击 安装 图标 - -### 根据屏幕上的指示完成 PWA 的安装 + ### 在地址栏的右上角,单击 安装 图标 + ### 根据屏幕上的指示完成 PWA 的安装 ## Safari 浏览器上运行 @@ -49,26 +42,19 @@ tags: Safari PWA 需要 macOS Ventura 或更高版本。Safari 安装的 PWA 并不要求 Safari 是打开状态,可以直接打开 PWA 应用。 + ### 在电脑上运行 Safari 浏览器 -### 在电脑上运行 Safari 浏览器 - -### 访问 LobeChat 网页 - -### 在地址栏的右上角,单击 分享 图标 + ### 访问 LobeChat 网页 -### 点选 添加到程序坞 + ### 在地址栏的右上角,单击 分享 图标 -### 根据屏幕上的指示完成 PWA 的安装 + ### 点选 添加到程序坞 + ### 根据屏幕上的指示完成 PWA 的安装 默认安装的 LobeChat PWA 图标是黑色背景的,您可以在自行使用 cmd + i 粘贴如下图片替换为白色背景的。 -{'PWA +{'PWA diff --git a/docs/usage/features/text-to-image.mdx b/docs/usage/features/text-to-image.mdx index 01a7a2613c5c..0bc864f09c37 100644 --- a/docs/usage/features/text-to-image.mdx +++ b/docs/usage/features/text-to-image.mdx @@ -19,8 +19,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/297746445-0ff762b9-aa08-4337-afb7-12f932b6efbb.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/297746445-0ff762b9-aa08-4337-afb7-12f932b6efbb.png' +} /> Supporting the latest text-to-image generation technology, LobeChat now enables users to directly utilize the Text to Image tool during conversations with the assistant. By harnessing the capabilities of AI tools such as [DALL-E 3](https://openai.com/dall-e-3), [MidJourney](https://www.midjourney.com/), and [Pollinations](https://pollinations.ai/), assistants can now transform your ideas into images. This allows for a more private and immersive creative process. diff --git a/docs/usage/features/text-to-image.zh-CN.mdx b/docs/usage/features/text-to-image.zh-CN.mdx index c512847c0511..759a1a1afd36 100644 --- a/docs/usage/features/text-to-image.zh-CN.mdx +++ b/docs/usage/features/text-to-image.zh-CN.mdx @@ -19,8 +19,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/297746445-0ff762b9-aa08-4337-afb7-12f932b6efbb.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/297746445-0ff762b9-aa08-4337-afb7-12f932b6efbb.png' +} /> 支持最新的文本到图片生成技术,LobeChat 现在能够让用户在与助手对话中直接调用文成图工具进行创作。通过利用 [`DALL-E 3`](https://openai.com/dall-e-3)、[`MidJourney`](https://www.midjourney.com/) 和 [`Pollinations`](https://pollinations.ai/) 等 AI 工具的能力, 助手们现在可以将你的想法转化为图像。同时可以更私密和沉浸式的完成你的创造过程。 diff --git a/docs/usage/features/theme.mdx b/docs/usage/features/theme.mdx index 6172ff5659e8..1ed1fe7764a0 100644 --- a/docs/usage/features/theme.mdx +++ b/docs/usage/features/theme.mdx @@ -15,12 +15,7 @@ tags: # Custom Themes -{'Custom +{'Custom LobeChat places a strong emphasis on personalized user experiences in its interface design, and thus introduces flexible and diverse theme modes, including a light mode for daytime and a dark mode for nighttime. diff --git a/docs/usage/features/theme.zh-CN.mdx b/docs/usage/features/theme.zh-CN.mdx index 778cf2c2e191..ba7be03b50b4 100644 --- a/docs/usage/features/theme.zh-CN.mdx +++ b/docs/usage/features/theme.zh-CN.mdx @@ -12,12 +12,7 @@ tags: # 自定义主题 -{'自定义主题'} +{'自定义主题'} LobeChat 在界面设计上十分考虑用户的个性化体验,因此引入了灵活多变的主题模式,其中包括日间的亮色模式和夜间的深色模式。 diff --git a/docs/usage/features/tts.mdx b/docs/usage/features/tts.mdx index 755c784e41e3..a79d0418ca85 100644 --- a/docs/usage/features/tts.mdx +++ b/docs/usage/features/tts.mdx @@ -22,8 +22,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png' +} /> LobeChat supports Text-to-Speech (TTS) and Speech-to-Text (STT) technologies. Our application can convert text information into clear voice output, allowing users to interact with our conversational agents as if they were talking to a real person. Users can choose from a variety of voices and pair the appropriate audio with the assistant. Additionally, for users who prefer auditory learning or need to obtain information while busy, TTS provides an excellent solution. @@ -32,11 +32,7 @@ In LobeChat, we have carefully selected a series of high-quality voice options ( ## Lobe TTS -{'LobeTTS +{'LobeTTS [`@lobehub/tts`](https://tts.lobehub.com) is a high-quality TTS toolkit developed using the TS language, supporting usage in both server and browser environments. diff --git a/docs/usage/features/tts.zh-CN.mdx b/docs/usage/features/tts.zh-CN.mdx index 6b5a72d5179e..24550f44f07b 100644 --- a/docs/usage/features/tts.zh-CN.mdx +++ b/docs/usage/features/tts.zh-CN.mdx @@ -18,8 +18,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png' +} /> LobeChat 支持文字转语音(Text-to-Speech,TTS)和语音转文字(Speech-to-Text,STT)技术,我们的应用能够将文本信息转化为清晰的语音输出,用户可以像与真人交谈一样与我们的对话代理进行交流。用户可以从多种声音中选择,给助手搭配合适的音源。 同时,对于那些倾向于听觉学习或者想要在忙碌中获取信息的用户来说,TTS 提供了一个极佳的解决方案。 @@ -28,11 +28,7 @@ LobeChat 支持文字转语音(Text-to-Speech,TTS)和语音转文字(Spe ## Lobe TTS -{'LobeTTS +{'LobeTTS [`@lobehub/tts`](https://tts.lobehub.com) 是一个使用 TS 语言开发的,高质量 TTS 工具包,支持在服务端和浏览器中使用。 diff --git a/docs/usage/features/vision.mdx b/docs/usage/features/vision.mdx index bf14216087e9..9f764fcd6e36 100644 --- a/docs/usage/features/vision.mdx +++ b/docs/usage/features/vision.mdx @@ -19,8 +19,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png' +} /> LobeChat now supports large language models with visual recognition capabilities such as OpenAI's [`gpt-4-vision`](https://platform.openai.com/docs/guides/vision), Google Gemini Pro vision, and Zhipu GLM-4 Vision, enabling LobeChat to have multimodal interaction capabilities. Users can easily upload or drag and drop images into the chat box, and the assistant will be able to recognize the content of the images and engage in intelligent conversations based on them, creating more intelligent and diverse chat scenarios. diff --git a/docs/usage/features/vision.zh-CN.mdx b/docs/usage/features/vision.zh-CN.mdx index 1e2bf3b2ee4b..ad51446aa4dd 100644 --- a/docs/usage/features/vision.zh-CN.mdx +++ b/docs/usage/features/vision.zh-CN.mdx @@ -16,8 +16,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png' +} /> LobeChat 已经支持 OpenAI 的 [`gpt-4-vision`](https://platform.openai.com/docs/guides/vision) 、Google Gemini Pro vision、智谱 GLM-4 Vision 等具有视觉识别能力的大语言模型,这使得 LobeChat 具备了多模态交互的能力。用户可以轻松上传图片或者拖拽图片到对话框中,助手将能够识别图片内容,并在此基础上进行智能对话,构建更智能、更多元化的聊天场景。 diff --git a/docs/usage/foundation/basic.mdx b/docs/usage/foundation/basic.mdx index 015032b81e3c..5b35869c53ee 100644 --- a/docs/usage/foundation/basic.mdx +++ b/docs/usage/foundation/basic.mdx @@ -15,20 +15,13 @@ tags: # Basic Usage Guide for Conversations -{'Basic +{'Basic In general, the basic interaction with Large Language Models (LLMs) can be done through the fundamental functions provided in this area (as shown above). ## Basic Function Description -{'Basic +{'Basic 1. **Model Selection**: Choose the Large Language Model (LLM) to be used in the current conversation. For model settings, refer to [Model Providers](/docs/usage/providers). 2. **File/Image Upload**: When the selected model supports file or image recognition, users can upload files or images during the conversation with the model. @@ -40,16 +33,12 @@ In general, the basic interaction with Large Language Models (LLMs) can be done 8. **Start New Topic**: End the current conversation and start a new topic. For more information, refer to [Topic Usage](/docs/usage/agents/topics). 9. **Send Button**: Send the current input content to the model. The dropdown menu provides additional send operation options. -{'Send +{'Send - **Send Shortcut**: Set a shortcut to send messages and line breaks using the Enter key or ⌘ + - Enter key. - **Add an AI Message**: Manually add and edit a message input by an AI character in - the conversation context, which will not trigger a model response. - **Add a User Message**: Add - the current input content as a message input by the user character to the conversation context, - which will not trigger a model response. + Enter key. - **Add an AI Message**: Manually add and edit a message input by an AI character in + the conversation context, which will not trigger a model response. - **Add a User Message**: Add + the current input content as a message input by the user character to the conversation context, + which will not trigger a model response. diff --git a/docs/usage/foundation/basic.zh-CN.mdx b/docs/usage/foundation/basic.zh-CN.mdx index 1d6ecf37b55c..5c858e7a9a8a 100644 --- a/docs/usage/foundation/basic.zh-CN.mdx +++ b/docs/usage/foundation/basic.zh-CN.mdx @@ -17,23 +17,16 @@ tags: # 会话基本使用指南 -{'基本功能'} +{'基本功能'} 通常情况下,与大型语言模型 (LLMs) 的基本交互可以通过此区域(如上图)提供的基础功能进行。 ## 基本功能说明 -{'基本功能说明'} +{'基本功能说明'} 1. **模型选择**:选择当前对话所使用的大型语言模型 (LLM)。模型的设置详见[模型服务商](/zh/docs/usage/providers)。 -2. **文件/图片上传**:当所选模型支持文件或图片识别功能时,用户可以在与模型的对话中上传文件或图片。 +2. **文件 / 图片上传**:当所选模型支持文件或图片识别功能时,用户可以在与模型的对话中上传文件或图片。 3. **温度设置**:调节模型输出的随机性程度。数值越高,输出结果越随机。详细说明请参考[大语言模型指南](/zh/docs/usage/agents/model)。 4. **历史记录设置**:设定本次对话中模型需要记忆的聊天记录数量。历史记录越长,模型能够记忆的对话内容越多,但同时也会消耗更多的上下文 token。 5. **语音输入**:点击该按钮后,可以将语音转换为文字输入。有关详细信息,请参考[语音文字转换](/zh/docs/usage/foundation/tts-stt)。 @@ -42,15 +35,12 @@ tags: 8. **新建话题**:结束当前对话并开启一个新的对话主题。有关详细信息,请参考[话题使用](/zh/docs/usage/agents/topics)。 9. **发送按钮**:将当前输入内容发送至模型。下拉菜单提供额外的发送操作选项。 -{'发送按钮'} +{'发送按钮'} - **发送快捷键**:设置使用 Enter 键或 ⌘ + Enter 键发送消息和换行的快捷方式。 - - **添加一条AI消息**:在对话上下文中手动添加并编辑一条由 AI 角色输入的消息,该操作不会触发模型响应。 + **添加一条 AI 消息**:在对话上下文中手动添加并编辑一条由 AI 角色输入的消息,该操作不会触发模型响应。 - + **添加一条用户消息**:将当前输入内容作为用户角色输入的消息添加到对话上下文中,该操作不会触发模型响应。 diff --git a/docs/usage/foundation/share.mdx b/docs/usage/foundation/share.mdx index 25b438fee589..c981a980c267 100644 --- a/docs/usage/foundation/share.mdx +++ b/docs/usage/foundation/share.mdx @@ -14,20 +14,13 @@ tags: # Share Conversation Records -{'Share +{'Share By clicking the `Share` button in the top right corner of the chat window, you can share the current conversation records with others. LobeChat supports two sharing methods: `Screenshot Sharing` and `ShareGPT Sharing`. ## Screenshot Sharing -{'Screenshot +{'Screenshot The screenshot sharing feature will generate and save an image of the current conversation records, with the following options: @@ -38,9 +31,6 @@ The screenshot sharing feature will generate and save an image of the current co ## ShareGPT -{'ShareGPT +{'ShareGPT [ShareGPT](https://sharegpt.com/) is an AI conversation sharing platform that allows users to easily share their conversations with Large Language Models (LLMs). Users can generate a permanent link with just one click, making it convenient to share these conversations with friends or others. By integrating ShareGPT functionality, LobeChat can generate links for conversation records with just one click, making sharing easy. diff --git a/docs/usage/foundation/share.zh-CN.mdx b/docs/usage/foundation/share.zh-CN.mdx index c8be6fa65f88..397f4b41b3e3 100644 --- a/docs/usage/foundation/share.zh-CN.mdx +++ b/docs/usage/foundation/share.zh-CN.mdx @@ -11,20 +11,13 @@ tags: # 分享会话记录 -{'分享会话'} +{'分享会话'} 通过会话窗口右上角的`分享`按钮,您可以将当前会话记录分享给其他人。LobeChat 支持两种分享方式:`截图分享`和 `ShareGPT 分享`。 ## 截图分享 -{'截图分享'} +{'截图分享'} 截图分享功能将生成当前会话记录的图片并保存,其选项说明如下: @@ -35,9 +28,6 @@ tags: ## ShareGPT -{'ShareGPT +{'ShareGPT [ShareGPT](https://sharegpt.com/) 是一个 AI 对话分享平台,允许用户便捷地分享他们与大型语言模型 (LLM) 的对话。用户只需点击即可生成永久链接,方便与朋友或其他人分享这些对话。LobeChat 通过集成 ShareGPT 功能,可以一键将对话记录生成链接,方便分享。 diff --git a/docs/usage/foundation/text2image.mdx b/docs/usage/foundation/text2image.mdx index 767ba327a0d8..4e08631faa61 100644 --- a/docs/usage/foundation/text2image.mdx +++ b/docs/usage/foundation/text2image.mdx @@ -20,10 +20,7 @@ LobeChat supports text-to-image generation through a plugin mechanism. Currently If you have configured the OpenAI API, you can enable the DALL-E plugin directly in the assistant interface and input prompts in the conversation for AI to generate images for you. -{'DALL-E +{'DALL-E If the DALL-E plugin is not available, please check if the OpenAI API key has been correctly configured. @@ -31,10 +28,7 @@ If the DALL-E plugin is not available, please check if the OpenAI API key has be LobeChat also offers the Midjourney plugin, which generates images by calling the Midjourney API. Please install the Midjourney plugin in the plugin store beforehand. -{'Midjourney +{'Midjourney info For plugin installation, please refer to [Plugin Usage](/docs/usage/plugins/basic-usage) @@ -42,7 +36,4 @@ LobeChat also offers the Midjourney plugin, which generates images by calling th When using the Midjourney plugin for the first time, you will need to fill in your Midjourney API key in the plugin settings. -{'Midjourney +{'Midjourney diff --git a/docs/usage/foundation/text2image.zh-CN.mdx b/docs/usage/foundation/text2image.zh-CN.mdx index 0b586442a806..18434dc6dc8f 100644 --- a/docs/usage/foundation/text2image.zh-CN.mdx +++ b/docs/usage/foundation/text2image.zh-CN.mdx @@ -18,10 +18,7 @@ LobeChat 通过插件机制支持文本生成图片功能。目前,LobeChat 如果您已配置 OpenAI API,可以直接在助手界面启用 DALL-E 插件,并在对话中输入提示词,让 AI 为您生成图片。 -{'DALL-E +{'DALL-E 如果 DALL-E 插件不可用,请检查 OpenAI API 密钥是否已正确配置。 @@ -29,16 +26,10 @@ LobeChat 通过插件机制支持文本生成图片功能。目前,LobeChat LobeChat 还提供 Midjourney 插件,通过 API 调用 Midjourney 生成图片。请提前在插件商店中安装 Midjourney 插件。 -{'Midjourney +{'Midjourney 插件安装请参考[插件使用](/zh/docs/usage/plugins/basic-usage) 首次使用 Midjourney 插件时,您需要在插件设置中填写您的 Midjourney API 密钥。 -{'Midjourney +{'Midjourney diff --git a/docs/usage/foundation/translate.mdx b/docs/usage/foundation/translate.mdx index 43f8b76d1fb0..90f078db75b3 100644 --- a/docs/usage/foundation/translate.mdx +++ b/docs/usage/foundation/translate.mdx @@ -11,29 +11,19 @@ tags: # Translation of Conversation Records -{'Translation'} +{'Translation'} ## Translating Conversation Content LobeChat supports users to translate conversation content into a specified language with just one click. After selecting the target language, LobeChat will use a pre-set AI model for translation and display the translated results in real-time in the chat window. -{'Displaying +{'Displaying ## Translation Model Settings You can specify the model you wish to use as a translation assistant in the settings. -{'Setting +{'Setting - Open the `Settings` panel - Find the `Translation Settings` option under `System Assistants` diff --git a/docs/usage/foundation/translate.zh-CN.mdx b/docs/usage/foundation/translate.zh-CN.mdx index 5ba9784df0ca..3449ac5d07f3 100644 --- a/docs/usage/foundation/translate.zh-CN.mdx +++ b/docs/usage/foundation/translate.zh-CN.mdx @@ -10,29 +10,19 @@ tags: # 翻译会话记录 -{'翻译会话'} +{'翻译会话'} ## 翻译对话中的内容 LobeChat 支持用户一键将对话内容翻译成指定语言。选择目标语言后,LobeChat 将调用预先设置的 AI 模型进行翻译,并将翻译结果实时显示在聊天窗口中。 -{'显示会话翻译结果'} +{'显示会话翻译结果'} ## 翻译模型设置 你可以在设置中指定您希望使用的模型作为翻译助手。 -{'设置翻译模型'} +{'设置翻译模型'} - 打开`设置`面板 - 在`系统助手`中找到`翻译设置`选项 diff --git a/docs/usage/foundation/tts-stt.mdx b/docs/usage/foundation/tts-stt.mdx index a99925d86b41..59675a2dbfff 100644 --- a/docs/usage/foundation/tts-stt.mdx +++ b/docs/usage/foundation/tts-stt.mdx @@ -19,28 +19,19 @@ LobeChat supports text-to-speech conversion, allowing users to input content thr Select any content in the chat window, choose `Text-to-Speech`, and the AI will use the TTS model to read the text content aloud. -{'TTS'} +{'TTS'} ## Speech-to-Text (STT) Select the voice input feature in the input window, and LobeChat will convert your speech to text and input it into the text box. After completing the input, you can send it directly to the AI. -{'STT'} +{'STT'} ## Text-to-Speech Conversion Settings You can specify the model you want to use for text-to-speech conversion in the settings. -{'TTS +{'TTS - Open the `Settings` panel - Find the `Text-to-Speech` settings diff --git a/docs/usage/foundation/tts-stt.zh-CN.mdx b/docs/usage/foundation/tts-stt.zh-CN.mdx index b0f885d156b5..f5199c9cb27e 100644 --- a/docs/usage/foundation/tts-stt.zh-CN.mdx +++ b/docs/usage/foundation/tts-stt.zh-CN.mdx @@ -17,28 +17,19 @@ LobeChat 支持文字语音转换功能,允许用户通过语音输入内容 在对话窗口中选中任意内容,选择`文字转语音`,AI 将通过 TTS 模型对文本内容进行语音播报。 -{'TTS'} +{'TTS'} ## 语音转文字(STT) 在输入窗口中选择语音输入功能,LobeChat 将您的语音转换为文字并输入到文本框中,完成输入后可以直接发送给 AI。 -{'STT'} +{'STT'} ## 文字语音转换设置 你可以在设置中为文字语音转换功能指定您希望使用的模型。 -{'TTS +{'TTS - 打开`设置`面板 - 找到`文字转语音`设置 diff --git a/docs/usage/foundation/vision.mdx b/docs/usage/foundation/vision.mdx index 319bf9989b59..449e6af47b71 100644 --- a/docs/usage/foundation/vision.mdx +++ b/docs/usage/foundation/vision.mdx @@ -16,34 +16,22 @@ tags: The ecosystem of large language models that support visual recognition is becoming increasingly rich. Starting from `gpt-4-vision`, LobeChat now supports various large language models with visual recognition capabilities, enabling LobeChat to have multimodal interaction capabilities. -