🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
📝 docs: update Better Auth documentation (#11679)
YuTengjing3110e2c356c0
diff --git a/docs/changelog/2023-09-09-plugin-system.mdx b/docs/changelog/2023-09-09-plugin-system.mdxindex a8dd3a26ce3..9ef28b4b006 100644--- a/docs/changelog/2023-09-09-plugin-system.mdx+++ b/docs/changelog/2023-09-09-plugin-system.mdx@@ -1,8 +1,9 @@---title: LobeChat Plugin Ecosystem - Functionality Extensions and Development Resourcesdescription: >-- 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.-+ 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- Pluginsdiff --git a/docs/changelog/2023-11-14-gpt4-vision.mdx b/docs/changelog/2023-11-14-gpt4-vision.mdxindex dac9d572b13..e62c5941a59 100644--- a/docs/changelog/2023-11-14-gpt4-vision.mdx+++ b/docs/changelog/2023-11-14-gpt4-vision.mdx@@ -1,10 +1,12 @@---title: >-- LobeChat Supports Multimodal Interaction: Visual Recognition Enhances Intelligent Dialogue-+ LobeChat Supports Multimodal Interaction: Visual Recognition Enhances+ Intelligent Dialoguedescription: >-- LobeChat supports various large language models with visual recognition 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.-+ LobeChat supports various large language models with visual recognition+ 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- LobeChatdiff --git a/docs/changelog/2023-11-19-tts-stt.mdx b/docs/changelog/2023-11-19-tts-stt.mdxindex ba3da585717..8d3124f5594 100644--- a/docs/changelog/2023-11-19-tts-stt.mdx+++ b/docs/changelog/2023-11-19-tts-stt.mdx@@ -1,8 +1,9 @@---title: LobeChat Text-to-Image Generation Technologydescription: >-- 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.-+ 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- STTdiff --git a/docs/changelog/2023-12-22-dalle-3.mdx b/docs/changelog/2023-12-22-dalle-3.mdxindex 0b7df74342e..fc1d742b5cf 100644--- a/docs/changelog/2023-12-22-dalle-3.mdx+++ b/docs/changelog/2023-12-22-dalle-3.mdx@@ -1,8 +1,11 @@---title: 'LobeChat Text-to-Image: Text-to-Image Generation Technology'description: >-- LobeChat now supports the latest text-to-image generation technology, allowing users to directly invoke the text-to-image tool during conversations with the 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.-+ LobeChat now supports the latest text-to-image generation technology, allowing+ users to directly invoke the text-to-image tool during conversations with the+ 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- LobeChatdiff --git a/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx b/docs/changelog/2023-12-22-dalle-3.zh-CN.mdxindex 875e9939dde..c14d1d98876 100644--- a/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx+++ b/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx@@ -1,8 +1,8 @@---title: LobeChat 文生图:文本转图片生成技术description: >-- LobeChat 现在支持最新的文本到图片生成技术,让用户可以在与助手对话中直接调用文生图工具进行创作。利用 DALL-E 3、MidJourney 和 Pollinations 等 AI 工具,助手们可以将你的想法转化为图像,让创作过程更私密和沉浸式。-+ LobeChat 现在支持最新的文本到图片生成技术,让用户可以在与助手对话中直接调用文生图工具进行创作。利用 DALL-E 3、MidJourney 和+ Pollinations 等 AI 工具,助手们可以将你的想法转化为图像,让创作过程更私密和沉浸式。tags:- Text to Image- 文生图diff --git a/docs/changelog/2024-02-08-sso-oauth.mdx b/docs/changelog/2024-02-08-sso-oauth.mdxindex cda1203cb1e..1b4768efa42 100644--- a/docs/changelog/2024-02-08-sso-oauth.mdx+++ b/docs/changelog/2024-02-08-sso-oauth.mdx@@ -1,8 +1,8 @@---title: LobeChat Supports Multi-User Management with Clerk and Next-Authdescription: >-- LobeChat offers various user authentication and management solutions, including Clerk and Next-Auth, to meet the diverse needs of different users.-+ 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-Authdiff --git a/docs/changelog/2024-06-19-lobe-chat-v1.mdx b/docs/changelog/2024-06-19-lobe-chat-v1.mdxindex b24bb8fd78b..ac59cfdb757 100644--- a/docs/changelog/2024-06-19-lobe-chat-v1.mdx+++ b/docs/changelog/2024-06-19-lobe-chat-v1.mdx@@ -1,8 +1,9 @@---title: 'LobeChat 1.0: New Architecture and New Possibilities'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.-+ 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.0diff --git a/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx b/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdxindex 7c0b81a6518..af609769544 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@@ -1,8 +1,8 @@---title: LobeChat 1.0:新的架构与新的可能description: >-- LobeChat 1.0 带来了服务端数据库、用户鉴权管理的全新架构与特性,开启了新的可能 。在此基础上, LobeChat Cloud 开启 Beta 版测试。-+ LobeChat 1.0 带来了服务端数据库、用户鉴权管理的全新架构与特性,开启了新的可能 。在此基础上, LobeChat Cloud 开启 Beta+ 版测试。tags:- LobeChat- 服务端数据库diff --git a/docs/changelog/2024-07-19-gpt-4o-mini.mdx b/docs/changelog/2024-07-19-gpt-4o-mini.mdxindex 6efd67f5b6a..1a2b6e62fb8 100644--- a/docs/changelog/2024-07-19-gpt-4o-mini.mdx+++ b/docs/changelog/2024-07-19-gpt-4o-mini.mdx@@ -1,8 +1,9 @@---title: 'LobeChat Fully Enters the GPT-4 Era: GPT-4o Mini Officially Launched'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.-+ 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 Minidiff --git a/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx b/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdxindex 94ff74c6dac..fde0f598f26 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@@ -1,8 +1,8 @@---title: LobeChat 全面进入 GPT-4 时代:GPT-4o mini 正式上线description: >-- LobeChat v1.6 重磅发布 GPT-4o mini 支持,同时 LobeChat Cloud 服务全面升级默认模型,为用户带来更强大的 AI 对话体验。-+ LobeChat v1.6 重磅发布 GPT-4o mini 支持,同时 LobeChat Cloud 服务全面升级默认模型,为用户带来更强大的 AI+ 对话体验。tags:- LobeChat- GPT-4o minidiff --git a/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx b/docs/changelog/2024-08-02-lobe-chat-database-docker.mdxindex 7280cb49a72..baae9f8d393 100644--- a/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx+++ b/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx@@ -1,8 +1,9 @@---title: LobeChat Database Docker Image Official Releasedescription: >-- LobeChat v1.8.0 launches the official database Docker image, supporting cloud data synchronization and user management, along with comprehensive self-deployment documentation.-+ 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 Imagediff --git a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdxindex b736ed3c8bc..7535a10c3ee 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@@ -1,10 +1,11 @@---title: >-- LobeChat Launches Knowledge Base Feature: A New Experience in Intelligent File Management and Dialogue-+ LobeChat Launches Knowledge Base Feature: A New Experience in Intelligent File+ Management and Dialoguedescription: >-- 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.-+ 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 Basediff --git a/docs/changelog/2024-09-13-openai-o1-models.mdx b/docs/changelog/2024-09-13-openai-o1-models.mdxindex 2ab2664fa4f..6cb27260e99 100644--- a/docs/changelog/2024-09-13-openai-o1-models.mdx+++ b/docs/changelog/2024-09-13-openai-o1-models.mdx@@ -1,8 +1,8 @@---title: LobeChat Perfectly Adapts to OpenAI O1 Series Modelsdescription: >-- LobeChat v1.17.0 now supports OpenAI's latest o1-preview and o1-mini models, bringing users enhanced coding and mathematical capabilities.-+ 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- LobeChatdiff --git a/docs/changelog/2024-09-20-artifacts.mdx b/docs/changelog/2024-09-20-artifacts.mdxindex 38c6f424756..3e571c4b269 100644--- a/docs/changelog/2024-09-20-artifacts.mdx+++ b/docs/changelog/2024-09-20-artifacts.mdx@@ -1,8 +1,9 @@---title: 'Major Update: LobeChat Enters the Era of Artifacts'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.-+ 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 Assistantdiff --git a/docs/changelog/2024-09-20-artifacts.zh-CN.mdx b/docs/changelog/2024-09-20-artifacts.zh-CN.mdxindex 77d91f67acc..801466498ad 100644--- a/docs/changelog/2024-09-20-artifacts.zh-CN.mdx+++ b/docs/changelog/2024-09-20-artifacts.zh-CN.mdx@@ -1,8 +1,8 @@---title: 重磅更新:LobeChat 迎来 Artifacts 时代description: >-- LobeChat v1.19 带来了重大更新,包括 Claude Artifacts 完整特性支持、全新的发现页面设计,以及 GitHub Models 服务商支持,让 AI 助手的能力得到显著提升。-+ LobeChat v1.19 带来了重大更新,包括 Claude Artifacts 完整特性支持、全新的发现页面设计,以及 GitHub Models+ 服务商支持,让 AI 助手的能力得到显著提升。tags:- LobeChat- Artifactsdiff --git a/docs/changelog/2024-10-27-pin-assistant.mdx b/docs/changelog/2024-10-27-pin-assistant.mdxindex 07b21b28c5a..d65f66dff36 100644--- a/docs/changelog/2024-10-27-pin-assistant.mdx+++ b/docs/changelog/2024-10-27-pin-assistant.mdx@@ -1,8 +1,9 @@---title: LobeChat Introduces Persistent Assistant Sidebar Featuredescription: >-- LobeChat v1.26.0 launches the persistent assistant sidebar feature, supporting quick key switching for easy access to frequently used assistants, significantly enhancing efficiency.-+ 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 Featurediff --git a/docs/changelog/2024-11-06-share-text-json.mdx b/docs/changelog/2024-11-06-share-text-json.mdxindex 9ed85579cce..e8f1948d268 100644--- a/docs/changelog/2024-11-06-share-text-json.mdx+++ b/docs/changelog/2024-11-06-share-text-json.mdx@@ -1,8 +1,10 @@---title: LobeChat Supports Sharing Conversations in Text Format (Markdown/JSON)description: >-- LobeChat v1.28.0 introduces support for exporting conversations in Markdown 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.-+ LobeChat v1.28.0 introduces support for exporting conversations in Markdown+ 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 Exportdiff --git a/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx b/docs/changelog/2024-11-06-share-text-json.zh-CN.mdxindex 5e01cdae1f1..90f78831a64 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@@ -1,8 +1,8 @@---title: LobeChat 支持分享对话为文本格式(Markdown/JSON)description: >-- LobeChat v1.28.0 新增 Markdown 和 OpenAI 格式 JSON 导出支持,让对话内容能轻松转化为笔记素材、开发调试数据和训练语料,显著提升对话内容的复用价值。-+ LobeChat v1.28.0 新增 Markdown 和 OpenAI 格式 JSON+ 导出支持,让对话内容能轻松转化为笔记素材、开发调试数据和训练语料,显著提升对话内容的复用价值。tags:- 对话内容- Markdown导出diff --git a/docs/changelog/2024-11-25-november-providers.mdx b/docs/changelog/2024-11-25-november-providers.mdxindex 8379924feb6..013272dc4f7 100644--- a/docs/changelog/2024-11-25-november-providers.mdx+++ b/docs/changelog/2024-11-25-november-providers.mdx@@ -1,8 +1,8 @@---title: New Model Providers Added to LobeChat in Novemberdescription: >-- LobeChat model providers now support Gitee AI, InternLM (ShuSheng PuYu), xAI, and Cloudflare WorkersAI-+ LobeChat model providers now support Gitee AI, InternLM (ShuSheng PuYu), xAI,+ and Cloudflare WorkersAItags:- LobeChat- AI Model Providersdiff --git a/docs/changelog/2024-11-27-forkable-chat.mdx b/docs/changelog/2024-11-27-forkable-chat.mdxindex c0f87d46a55..2fe7a4658af 100644--- a/docs/changelog/2024-11-27-forkable-chat.mdx+++ b/docs/changelog/2024-11-27-forkable-chat.mdx@@ -1,8 +1,8 @@---title: LobeChat Supports Branching Conversationsdescription: >-- LobeChat now allows you to create new conversation branches from any message, freeing your thoughts.-+ LobeChat now allows you to create new conversation branches from any message,+ freeing your thoughts.tags:- Branching Conversations- LobeChatdiff --git a/docs/changelog/2025-01-03-user-profile.mdx b/docs/changelog/2025-01-03-user-profile.mdxindex 6fb1a795a19..38d23643863 100644--- a/docs/changelog/2025-01-03-user-profile.mdx+++ b/docs/changelog/2025-01-03-user-profile.mdx@@ -1,8 +1,8 @@---title: LobeChat Supports User Data Statistics and Activity Sharingdescription: >-- LobeChat now supports multi-dimensional user data statistics and activity sharing-+ LobeChat now supports multi-dimensional user data statistics and activity+ sharingtags:- LobeChat- User Statisticsdiff --git a/docs/changelog/2025-01-22-new-ai-provider.mdx b/docs/changelog/2025-01-22-new-ai-provider.mdxindex da4d67802fe..8caa6e5f74d 100644--- a/docs/changelog/2025-01-22-new-ai-provider.mdx+++ b/docs/changelog/2025-01-22-new-ai-provider.mdx@@ -1,8 +1,8 @@---title: LobeChat Launches New AI Provider Management Systemdescription: >-- LobeChat has revamped its AI Provider Management System, now supporting custom AI providers and models.-+ LobeChat has revamped its AI Provider Management System, now supporting custom+ AI providers and models.tags:- LobeChat- AI Providerdiff --git a/docs/changelog/2025-02-02-deepseek-r1.mdx b/docs/changelog/2025-02-02-deepseek-r1.mdxindex 970f5faac23..28f1853ca37 100644--- a/docs/changelog/2025-02-02-deepseek-r1.mdx+++ b/docs/changelog/2025-02-02-deepseek-r1.mdx@@ -1,10 +1,10 @@---title: >-- LobeChat Integrates DeepSeek R1, Bringing a Revolutionary Chain of Thought Experience-+ LobeChat Integrates DeepSeek R1, Bringing a Revolutionary Chain of Thought+ Experiencedescription: >-- LobeChat v1.49.12 fully supports the DeepSeek R1 model, providing users with an unprecedented interactive experience in the chain of thought.-+ LobeChat v1.49.12 fully supports the DeepSeek R1 model, providing users with+ an unprecedented interactive experience in the chain of thought.tags:- LobeChat- DeepSeekdiff --git a/docs/development/basic/add-new-authentication-providers.mdx b/docs/development/basic/add-new-authentication-providers.mdxindex 582c4666d54..33a14ac4695 100644--- a/docs/development/basic/add-new-authentication-providers.mdx+++ b/docs/development/basic/add-new-authentication-providers.mdx@@ -1,3 +1,7 @@+---+title: New Authentication Provider Guide+---+# New Authentication Provider GuideLobeChat uses [Auth.js v5](https://authjs.dev/) as the external authentication service. Auth.js is an open-source authentication library that provides a simple way to implement authentication and authorization features. This document will introduce how to use Auth.js to implement a new authentication provider.diff --git a/docs/development/basic/add-new-authentication-providers.zh-CN.mdx b/docs/development/basic/add-new-authentication-providers.zh-CN.mdxindex 66f8e88de68..8b16ffd9fc2 100644--- a/docs/development/basic/add-new-authentication-providers.zh-CN.mdx+++ b/docs/development/basic/add-new-authentication-providers.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 新身份验证方式开发指南+---+# 新身份验证方式开发指南LobeChat 使用 [Auth.js v5](https://authjs.dev/) 作为外部身份验证服务。Auth.js 是一个开源的身份验证库,它提供了一种简单的方式来实现身份验证和授权功能。本文档将介绍如何使用 Auth.js 来实现新的身份验证方式。diff --git a/docs/development/basic/add-new-image-model.mdx b/docs/development/basic/add-new-image-model.mdxindex 37dfc54a4fb..fa74480521c 100644--- a/docs/development/basic/add-new-image-model.mdx+++ b/docs/development/basic/add-new-image-model.mdx@@ -1,3 +1,7 @@+---+title: Adding New Image Models+---+# Adding New Image Models> Learn more about the AI image generation modal design in the [AI Image Generation Modal Design Discussion](https://github.com/lobehub/lobe-chat/discussions/7442)diff --git a/docs/development/basic/add-new-image-model.zh-CN.mdx b/docs/development/basic/add-new-image-model.zh-CN.mdxindex 6eacc207468..f65db8fb86b 100644--- a/docs/development/basic/add-new-image-model.zh-CN.mdx+++ b/docs/development/basic/add-new-image-model.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 添加新的图像模型+---+# 添加新的图像模型> 了解更多关于 AI 绘画模态的设计,请参考 [AI 绘画模态设计讨论](https://github.com/lobehub/lobe-chat/discussions/7442)diff --git a/docs/development/basic/architecture.mdx b/docs/development/basic/architecture.mdxindex f6171137d04..86a1ac08f14 100644--- a/docs/development/basic/architecture.mdx+++ b/docs/development/basic/architecture.mdx@@ -1,3 +1,7 @@+---+title: Architecture Design+---+# Architecture DesignLobeChat is an AI chat application built on the Next.js framework, aiming to provide an AI productivity platform that enables users to interact with AI through natural language. The following is an overview of the architecture design of LobeChat:diff --git a/docs/development/basic/architecture.zh-CN.mdx b/docs/development/basic/architecture.zh-CN.mdxindex c947c5498e2..c1cbb7ad3b0 100644--- a/docs/development/basic/architecture.zh-CN.mdx+++ b/docs/development/basic/architecture.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 架构设计+---+# 架构设计LobeChat 是一个基于 Next.js 框架构建的 AI 聊天应用,旨在提供一个 AI 生产力平台,使用户能够与 AI 进行自然语言交互。以下是 LobeChat 的架构设计介稿:diff --git a/docs/development/basic/chat-api.mdx b/docs/development/basic/chat-api.mdxindex 1f079fa5174..685fad6d4dd 100644--- a/docs/development/basic/chat-api.mdx+++ b/docs/development/basic/chat-api.mdx@@ -1,3 +1,7 @@+---+title: Lobe Chat API Client-Server Interaction Logic+---+# Lobe Chat API Client-Server Interaction LogicThis document explains the implementation logic of Lobe Chat API in client-server interactions, including event sequences and core components involved.diff --git a/docs/development/basic/chat-api.zh-CN.mdx b/docs/development/basic/chat-api.zh-CN.mdxindex b8332d5f541..c3b2de9847f 100644--- a/docs/development/basic/chat-api.zh-CN.mdx+++ b/docs/development/basic/chat-api.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: Lobe Chat API 前后端交互逻辑+---+# Lobe Chat API 前后端交互逻辑本文档说明了 Lobe Chat API 在前后端交互中的实现逻辑,包括事件序列和涉及的核心组件。diff --git a/docs/development/basic/comfyui-development.mdx b/docs/development/basic/comfyui-development.mdxindex 5f3a0b16966..ee9f3fcc084 100644--- a/docs/development/basic/comfyui-development.mdx+++ b/docs/development/basic/comfyui-development.mdx@@ -1,6 +1,8 @@---title: ComfyUI Extension Development Guide-description: Learn how to add new models, workflows, and features to LobeChat's ComfyUI integration+description: >-+ Learn how to add new models, workflows, and features to LobeChat's ComfyUI+ integrationtags:- ComfyUI- Development Guidediff --git a/docs/development/basic/contributing-guidelines.mdx b/docs/development/basic/contributing-guidelines.mdxindex f129d516210..69d7f327eb4 100644--- a/docs/development/basic/contributing-guidelines.mdx+++ b/docs/development/basic/contributing-guidelines.mdx@@ -1,3 +1,7 @@+---+title: Code Style and Contribution Guidelines+---+# Code Style and Contribution GuidelinesWelcome to the Code Style and Contribution Guidelines for LobeChat. This guide will help you understand our code standards and contribution process, ensuring code consistency and smooth project progression.diff --git a/docs/development/basic/contributing-guidelines.zh-CN.mdx b/docs/development/basic/contributing-guidelines.zh-CN.mdxindex 278029107e7..3420b4bdb6f 100644--- a/docs/development/basic/contributing-guidelines.zh-CN.mdx+++ b/docs/development/basic/contributing-guidelines.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 代码风格与贡献指南+---+# 代码风格与贡献指南欢迎来到 LobeChat 的代码风格与贡献指南。本指南将帮助您理解我们的代码规范和贡献流程,确保代码的一致性和项目的顺利进行。diff --git a/docs/development/basic/feature-development-frontend.mdx b/docs/development/basic/feature-development-frontend.mdxindex 6672707bca2..defac17e902 100644--- a/docs/development/basic/feature-development-frontend.mdx+++ b/docs/development/basic/feature-development-frontend.mdx@@ -1,3 +1,7 @@+---+title: How to Develop a New Feature+---+# How to Develop a New FeatureLobeChat is built on the Next.js framework and uses TypeScript as the primary development language. When developing a new feature, we need to follow a certain development process to ensure the quality and stability of the code. The general process can be divided into the following five steps:@@ -76,7 +80,8 @@ const ChatPage = () => {renderItem={(message) => (<List.Item><Typography.Text>{message.content}</Typography.Text>- </List.Item>++</List.Item>)}/>);@@ -86,6 +91,7 @@ export default ChatPage;```> **Note on Feature Organization**: LobeChat uses two patterns for organizing features:+>> - **Global features** (`src/features/`): Shared components like `ChatInput`, `Conversation` used across the app> - **Page-specific features** (`src/app/<page>/features/`): Components used only within a specific page route>@@ -113,11 +119,13 @@ const ChatPage = () => {renderItem={(message) => (<List.Item><Typography.Text>{message.content}</Typography.Text>- </List.Item>++</List.Item>)}/><Button onClick={handleSend}>Send</Button>- </>++</>);};diff --git a/docs/development/basic/feature-development-frontend.zh-CN.mdx b/docs/development/basic/feature-development-frontend.zh-CN.mdxindex a36d3c43774..ec9dc69a343 100644--- a/docs/development/basic/feature-development-frontend.zh-CN.mdx+++ b/docs/development/basic/feature-development-frontend.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 如何开发一个新功能:前端实现+---+# 如何开发一个新功能:前端实现LobeChat 基于 Next.js 框架构建,使用 TypeScript 作为主要开发语言。在开发新功能时,我们需要遵循一定的开发流程,以确保代码的质量和稳定性。大致的流程分为以下五步:@@ -76,7 +80,8 @@ const ChatPage = () => {renderItem={(message) => (<List.Item><Typography.Text>{message.content}</Typography.Text>- </List.Item>++</List.Item>)}/>);@@ -86,6 +91,7 @@ export default ChatPage;```> **关于功能组件组织方式的说明**:LobeChat 使用两种模式来组织功能组件:+>> - **全局功能**(`src/features/`):跨应用共享的组件,如 `ChatInput`、`Conversation` 等> - **页面专属功能**(`src/app/<page>/features/`):仅在特定页面路由中使用的组件>@@ -113,11 +119,13 @@ const ChatPage = () => {renderItem={(message) => (<List.Item><Typography.Text>{message.content}</Typography.Text>- </List.Item>++</List.Item>)}/><Button onClick={handleSend}>Send</Button>- </>++</>);};diff --git a/docs/development/basic/feature-development.mdx b/docs/development/basic/feature-development.mdxindex 338834ba345..dadc2dbe85a 100644--- a/docs/development/basic/feature-development.mdx+++ b/docs/development/basic/feature-development.mdx@@ -1,3 +1,7 @@+---+title: LobeChat Feature Development Complete Guide+---+# LobeChat Feature Development Complete GuideThis document aims to guide developers on how to develop a complete feature in LobeChat.@@ -362,7 +366,8 @@ const OpeningQuestions = memo(() => {{isRepeat && (<p className={styles.repeatError}>{t('settingOpening.openingQuestions.repeat')}</p>)}- </Flexbox>++</Flexbox><div className={styles.questionsList}>{openingQuestions.length > 0 ? (@@ -378,7 +383,8 @@ const OpeningQuestions = memo(() => {onClick={() => removeQuestion(item.content)}type="text"/>- </SortableList.Item>++</SortableList.Item>)}/>) : (@@ -387,8 +393,10 @@ const OpeningQuestions = memo(() => {description={t('settingOpening.openingQuestions.empty')}/>)}- </div>- </Flexbox>++</div>++</Flexbox>);});@@ -440,7 +448,8 @@ const WelcomeMessage = () => {{chatItem}{/* Render guiding questions */}<OpeningQuestions mobile={mobile} questions={openingQuestions} />- </Flexbox>++</Flexbox>) : (chatItem);diff --git a/docs/development/basic/feature-development.zh-CN.mdx b/docs/development/basic/feature-development.zh-CN.mdxindex b8a12a43c0b..c4c80c0bd76 100644--- a/docs/development/basic/feature-development.zh-CN.mdx+++ b/docs/development/basic/feature-development.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: LobeChat 功能开发完全指南+---+# LobeChat 功能开发完全指南本文档旨在指导开发者了解如何在 LobeChat 中开发一块完整的功能需求。@@ -362,7 +366,8 @@ const OpeningQuestions = memo(() => {{isRepeat && (<p className={styles.repeatError}>{t('settingOpening.openingQuestions.repeat')}</p>)}- </Flexbox>++</Flexbox><div className={styles.questionsList}>{openingQuestions.length > 0 ? (@@ -378,7 +383,8 @@ const OpeningQuestions = memo(() => {onClick={() => removeQuestion(item.content)}type="text"/>- </SortableList.Item>++</SortableList.Item>)}/>) : (@@ -387,8 +393,10 @@ const OpeningQuestions = memo(() => {description={t('settingOpening.openingQuestions.empty')}/>)}- </div>- </Flexbox>++</div>++</Flexbox>);});@@ -440,7 +448,8 @@ const WelcomeMessage = () => {{chatItem}{/* 渲染引导性问题 */}<OpeningQuestions mobile={mobile} questions={openingQuestions} />- </Flexbox>++</Flexbox>) : (chatItem);diff --git a/docs/development/basic/folder-structure.mdx b/docs/development/basic/folder-structure.mdxindex 7fcc42922f2..c5e5ead22c9 100644--- a/docs/development/basic/folder-structure.mdx+++ b/docs/development/basic/folder-structure.mdx@@ -1,3 +1,7 @@+---+title: Directory Structure+---+# Directory StructureThe directory structure of LobeChat is as follows:@@ -73,17 +77,20 @@ app### Architecture Explanation**Route Groups:**+- `(backend)` - Contains all server-side API routes, middleware, and backend services- `[variants]` - Dynamic route group handling different platform variants and main application pages- `@modal` - Parallel routes for modal dialogs using Next.js parallel routing**Platform Organization:**+- The architecture supports multiple platforms (web, desktop, mobile) through route organization- Desktop-specific routes are in the `desktop/` directory- Mobile-specific routes are organized under `(main)/(mobile)/`- Shared layouts and components are in `_layout/` directories**API Architecture:**+- REST APIs in `(backend)/api/` and `(backend)/webapi/`- tRPC endpoints organized by runtime environment (edge, lambda, async, desktop)- Authentication and OIDC handling in dedicated route groupsdiff --git a/docs/development/basic/folder-structure.zh-CN.mdx b/docs/development/basic/folder-structure.zh-CN.mdxindex 16f2a8fa7dd..795f9025df9 100644--- a/docs/development/basic/folder-structure.zh-CN.mdx+++ b/docs/development/basic/folder-structure.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 目录架构+---+# 目录架构LobeChat 的文件夹目录架构如下:@@ -73,17 +77,20 @@ app### 架构说明**路由组:**+- `(backend)` - 包含所有服务端 API 路由、中间件和后端服务- `[variants]` - 处理不同平台变体和主应用页面的动态路由组- `@modal` - 使用 Next.js 并行路由的模态框对话框并行路由**平台组织:**+- 架构通过路由组织支持多个平台(Web、桌面端、移动端)- 桌面端专用路由位于 `desktop/` 目录中- 移动端专用路由组织在 `(main)/(mobile)/` 下- 共享布局和组件位于 `_layout/` 目录中**API 架构:**+- `(backend)/api/` 和 `(backend)/webapi/` 中的 REST API- 按运行时环境组织的 tRPC 端点(edge、lambda、async、desktop)- 专用路由组中的身份验证和 OIDC 处理diff --git a/docs/development/basic/resources.mdx b/docs/development/basic/resources.mdxindex 8a91716853a..e0a8bcf7d45 100644--- a/docs/development/basic/resources.mdx+++ b/docs/development/basic/resources.mdx@@ -1,3 +1,7 @@+---+title: Resources and References+---+# Resources and ReferencesThe design and development of LobeChat would not have been possible without the excellent projects in the community and ecosystem. We have used or referred to some outstanding resources and guides in the design and development process. Here are some key reference resources for developers to refer to during the development and learning process:diff --git a/docs/development/basic/resources.zh-CN.mdx b/docs/development/basic/resources.zh-CN.mdxindex 1f8c272a515..6428bf66748 100644--- a/docs/development/basic/resources.zh-CN.mdx+++ b/docs/development/basic/resources.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 资源与参考+---+# 资源与参考LobeChat 的设计和开发离不开社区和生态中的优秀项目。我们在设计和开发过程中使用或参考了一些优秀的资源和指南。以下是一些主要的参考资源,供开发者在开发和学习过程中参考:diff --git a/docs/development/basic/setup-development.mdx b/docs/development/basic/setup-development.mdxindex 281fae42b91..b9fe8e29ae2 100644--- a/docs/development/basic/setup-development.mdx+++ b/docs/development/basic/setup-development.mdx@@ -1,3 +1,7 @@+---+title: Environment Setup Guide+---+# Environment Setup GuideWelcome to the LobeChat development environment setup guide.diff --git a/docs/development/basic/setup-development.zh-CN.mdx b/docs/development/basic/setup-development.zh-CN.mdxindex b552c5a693a..69b629a1709 100644--- a/docs/development/basic/setup-development.zh-CN.mdx+++ b/docs/development/basic/setup-development.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 环境设置指南+---+# 环境设置指南欢迎阅读 LobeChat 的开发环境设置指南。diff --git a/docs/development/basic/test.mdx b/docs/development/basic/test.mdxindex 7dff2ff4d25..cda71c511f3 100644--- a/docs/development/basic/test.mdx+++ b/docs/development/basic/test.mdx@@ -1,3 +1,7 @@+---+title: Testing Guide+---+# Testing GuideLobeChat's testing strategy includes unit testing and end-to-end (E2E) testing. Below are detailed explanations of each type of testing:diff --git a/docs/development/basic/test.zh-CN.mdx b/docs/development/basic/test.zh-CN.mdxindex d72a77cd3de..c00c1acef70 100644--- a/docs/development/basic/test.zh-CN.mdx+++ b/docs/development/basic/test.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 测试指南+---+# 测试指南LobeChat 的测试策略包括单元测试和端到端 (E2E) 测试。下面是每种测试的详细说明:diff --git a/docs/development/basic/work-with-server-side-database.mdx b/docs/development/basic/work-with-server-side-database.mdxindex 0ef38cd8f51..d421acc9cab 100644--- a/docs/development/basic/work-with-server-side-database.mdx+++ b/docs/development/basic/work-with-server-side-database.mdx@@ -1,3 +1,7 @@+---+title: Work with Server-Side Database+---+# Work with Server-Side DatabaseLobeChat provides a battery-included experience with its client-side database.@@ -19,7 +23,6 @@ cp docker-compose/local/.env.example docker-compose/local/.envEdit `docker-compose/local/.env` as needed for your development setup. This file contains all necessary environment variables for the Docker services and configures:-- **Service Mode**: `NEXT_PUBLIC_SERVICE_MODE=server`- **Database**: PostgreSQL with connection string- **Authentication**: NextAuth with Casdoor SSO- **Storage**: MinIO S3-compatible storage@@ -80,7 +83,6 @@ The image generation feature requires:- **PostgreSQL**: Stores metadata about generated images- **MinIO/S3**: Stores the actual image files-- **Server Mode**: Required for file handling (`NEXT_PUBLIC_SERVICE_MODE=server`)### Storage Configuration@@ -138,14 +140,13 @@ await fetch(uploadUrl, {});```-### Service URLsWhen running with Docker Compose development setup:- **PostgreSQL**: `postgres://postgres@localhost:5432/lobechat`- **MinIO API**: `http://localhost:9000`-- **MinIO Console**: `http://localhost:9001` (admin/CHANGE_THIS_PASSWORD_IN_PRODUCTION)+- **MinIO Console**: `http://localhost:9001` (admin/CHANGE\_THIS\_PASSWORD\_IN\_PRODUCTION)- **Application**: `http://localhost:3010`### Reset Services@@ -164,7 +165,6 @@ docker-compose -f docker-compose.development.yml up -dpnpm db:migrate```-### Troubleshooting#### Port Conflictsdiff --git a/docs/development/basic/work-with-server-side-database.zh-CN.mdx b/docs/development/basic/work-with-server-side-database.zh-CN.mdxindex 91c6440d7c2..6b720280595 100644--- a/docs/development/basic/work-with-server-side-database.zh-CN.mdx+++ b/docs/development/basic/work-with-server-side-database.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 使用服务端数据库+---+# 使用服务端数据库LobeChat 提供了内置的客户端数据库体验。@@ -19,7 +23,6 @@ cp docker-compose/local/.env.example docker-compose/local/.env根据需要编辑 `docker-compose/local/.env` 文件以适应你的开发设置。此文件包含 Docker 服务所需的所有环境变量,配置了:-- **服务模式**: `NEXT_PUBLIC_SERVICE_MODE=server`- **数据库**: 带连接字符串的 PostgreSQL- **身份验证**: 带 Casdoor SSO 的 NextAuth- **存储**: MinIO S3 兼容存储@@ -80,7 +83,6 @@ docker-compose -f docker-compose.development.yml ps- **PostgreSQL**:存储生成图像的元数据- **MinIO/S3**:存储实际的图像文件-- **服务器模式**:文件处理所需(`NEXT_PUBLIC_SERVICE_MODE=server`)### 存储配置@@ -138,14 +140,13 @@ await fetch(uploadUrl, {});```-### 服务地址运行 Docker Compose 开发环境时:- **PostgreSQL**:`postgres://postgres@localhost:5432/lobechat`- **MinIO API**:`http://localhost:9000`-- **MinIO 控制台**:`http://localhost:9001` (admin/CHANGE_THIS_PASSWORD_IN_PRODUCTION)+- **MinIO 控制台**:`http://localhost:9001` (admin/CHANGE\_THIS\_PASSWORD\_IN\_PRODUCTION)- **应用程序**:`http://localhost:3010`### 重置服务@@ -164,7 +165,6 @@ docker-compose -f docker-compose.development.yml up -dpnpm db:migrate```-### 故障排除#### 端口冲突diff --git a/docs/development/internationalization/add-new-locale.mdx b/docs/development/internationalization/add-new-locale.mdxindex e240ba4c9c0..0fb889f87cd 100644--- a/docs/development/internationalization/add-new-locale.mdx+++ b/docs/development/internationalization/add-new-locale.mdx@@ -1,3 +1,7 @@+---+title: New Locale Guide+---+# New Locale GuideLobeChat uses [lobe-i18n](https://github.com/lobehub/lobe-cli-toolbox/tree/master/packages/lobe-i18n) as the i18n solution, which allows for quick addition of new language support in the application.diff --git a/docs/development/internationalization/add-new-locale.zh-CN.mdx b/docs/development/internationalization/add-new-locale.zh-CN.mdxindex e00932c818b..33a7fb68e6f 100644--- a/docs/development/internationalization/add-new-locale.zh-CN.mdx+++ b/docs/development/internationalization/add-new-locale.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 新语种添加指南+---+# 新语种添加指南LobeChat 使用 [lobe-i18n](https://github.com/lobehub/lobe-cli-toolbox/tree/master/packages/lobe-i18n) 作为 i18n 解决方案,可以在应用中快速添加新的语言支持。diff --git a/docs/development/internationalization/internationalization-implementation.mdx b/docs/development/internationalization/internationalization-implementation.mdxindex b4ddb2006da..5360962b39b 100644--- a/docs/development/internationalization/internationalization-implementation.mdx+++ b/docs/development/internationalization/internationalization-implementation.mdx@@ -1,3 +1,7 @@+---+title: Internationalization Implementation Guide+---+# Internationalization Implementation GuideWelcome to the LobeChat Internationalization Implementation Guide. This document will guide you through understanding the internationalization mechanism of LobeChat, including file structure and how to add new languages. LobeChat uses `i18next` and `lobe-i18n` as the internationalization solution, aiming to provide users with seamless multilingual support.diff --git a/docs/development/internationalization/internationalization-implementation.zh-CN.mdx b/docs/development/internationalization/internationalization-implementation.zh-CN.mdxindex e8c369247a1..a3cc5b60d41 100644--- a/docs/development/internationalization/internationalization-implementation.zh-CN.mdx+++ b/docs/development/internationalization/internationalization-implementation.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 国际化实现指南+---+# 国际化实现指南欢迎阅读 LobeChat 国际化实现指南。本文档将指导你了解 LobeChat 的国际化机制,包括文件结构、如何添加新语种。LobeChat 采用 `i18next` 和 `lobe-i18n` 作为国际化解决方案,旨在为用户提供流畅的多语言支持。diff --git a/docs/development/others/lighthouse.mdx b/docs/development/others/lighthouse.mdxindex 6ba058cd227..286866cac6b 100644--- a/docs/development/others/lighthouse.mdx+++ b/docs/development/others/lighthouse.mdx@@ -1,3 +1,7 @@+---+title: Lighthouse Reports+---+# Lighthouse Reports## Chat Pagediff --git a/docs/development/others/lighthouse.zh-CN.mdx b/docs/development/others/lighthouse.zh-CN.mdxindex cffab368feb..c3a6a6bc488 100644--- a/docs/development/others/lighthouse.zh-CN.mdx+++ b/docs/development/others/lighthouse.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: Lighthouse 测试报告+---+# Lighthouse 测试报告## Chat 聊天页面diff --git a/docs/development/start.mdx b/docs/development/start.mdxindex 0175579a0b8..e185bfa66b9 100644--- a/docs/development/start.mdx+++ b/docs/development/start.mdx@@ -1,3 +1,7 @@+---+title: Technical Development Getting Started Guide+---+# Technical Development Getting Started GuideWelcome to the LobeChat Technical Development Getting Started Guide. LobeChat is an AI conversation application built on the Next.js framework, incorporating a range of technology stacks to achieve diverse functionalities and features. This guide will detail the main technical components of LobeChat and how to configure and use these technologies in your development environment.diff --git a/docs/development/start.zh-CN.mdx b/docs/development/start.zh-CN.mdxindex a7d731ba1ed..c30ad563968 100644--- a/docs/development/start.zh-CN.mdx+++ b/docs/development/start.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 技术开发上手指南+---+# 技术开发上手指南欢迎来到 LobeChat 技术开发上手指南。LobeChat 是一款基于 Next.js 框架构建的 AI 会话应用,它汇集了一系列的技术栈,以实现多样化的功能和特性。本指南将详细介绍 LobeChat 的主要技术组成,以及如何在你的开发环境中配置和使用这些技术。diff --git a/docs/development/state-management/state-management-intro.mdx b/docs/development/state-management/state-management-intro.mdxindex 82816a526ba..4d932700c5b 100644--- a/docs/development/state-management/state-management-intro.mdx+++ b/docs/development/state-management/state-management-intro.mdx@@ -1,3 +1,7 @@+---+title: Best Practices for State Management+---+# Best Practices for State ManagementLobeChat differs from traditional CRUD web applications in that it involves a large amount of rich interactive capabilities. Therefore, it is crucial to design a data flow architecture that is easy to develop and maintain. This document will introduce the best practices for data flow management in LobeChat.@@ -167,8 +171,6 @@ const createStore: StateCreator<SessionStore, [['zustand/devtools', never]]> = (...createSessionSlice(...parameters),});--// =============== Implement useStore ============ //export const useSessionStore = createWithEqualityFn<SessionStore>()(diff --git a/docs/development/state-management/state-management-intro.zh-CN.mdx b/docs/development/state-management/state-management-intro.zh-CN.mdxindex c7bcb0d1fb1..f1fbe9decea 100644--- a/docs/development/state-management/state-management-intro.zh-CN.mdx+++ b/docs/development/state-management/state-management-intro.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 状态管理最佳实践+---+# 状态管理最佳实践LobeChat 不同于传统 CRUD 的网页,存在大量的富交互能力,如何设计一个易于开发与易于维护的数据流架构非常重要。本篇文档将介绍 LobeChat 中的数据流管理最佳实践。@@ -159,8 +163,6 @@ const createStore: StateCreator<SessionStore, [['zustand/devtools', never]]> = (...createSessionSlice(...parameters),});--// =============== 实装 useStore ============ //export const useSessionStore = createWithEqualityFn<SessionStore>()(diff --git a/docs/development/state-management/state-management-selectors.mdx b/docs/development/state-management/state-management-selectors.mdxindex 23f0d260c9e..db4e9276d9b 100644--- a/docs/development/state-management/state-management-selectors.mdx+++ b/docs/development/state-management/state-management-selectors.mdx@@ -1,3 +1,7 @@+---+title: Data Store Selector+---+# Data Store SelectorSelectors are data retrieval modules under the LobeChat data flow development framework. Their role is to extract data from the store using specific business logic for consumption by components.@@ -51,7 +55,8 @@ import { pluginSelectors } from '@/store/plugin/selectors';const Render = ({ plugins }) => {const list = usePluginStore(pluginSelectors.displayPluginList);- return <> ... </>;+ return <> ...+</>;};```diff --git a/docs/development/state-management/state-management-selectors.zh-CN.mdx b/docs/development/state-management/state-management-selectors.zh-CN.mdxindex 7cf80311945..438db180919 100644--- a/docs/development/state-management/state-management-selectors.zh-CN.mdx+++ b/docs/development/state-management/state-management-selectors.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 数据存储取数模块+---+# 数据存储取数模块selectors 是 LobeChat 数据流研发框架下的取数模块,它的作用是从 store 中以特定特务逻辑取出数据,供组件消费使用。@@ -32,7 +36,8 @@ import { pluginSelectors } from '@/store/tool/selectors';const Render = () => {const list = useToolStore(pluginSelectors.installedPluginMetaList);- return <> ... </>;+ return <> ...+</>;};```diff --git a/docs/development/tests/integration-testing.zh-CN.mdx b/docs/development/tests/integration-testing.zh-CN.mdxindex e12133850d5..1d49be2f516 100644--- a/docs/development/tests/integration-testing.zh-CN.mdx+++ b/docs/development/tests/integration-testing.zh-CN.mdx@@ -1,3 +1,7 @@+---+title: 集成测试指南+---+# 集成测试指南## 概述diff --git a/docs/self-hosting/advanced/analytics.mdx b/docs/self-hosting/advanced/analytics.mdxindex 039ba7d9e90..0ccd0e8d66f 100644--- a/docs/self-hosting/advanced/analytics.mdx+++ b/docs/self-hosting/advanced/analytics.mdx@@ -1,8 +1,8 @@---title: Integrating Data Analytics Services in LobeChat for User Usage Analysisdescription: >-- Learn how to integrate free/open-source data analytics services in LobeChat to collect user usage data efficiently.-+ Learn how to integrate free/open-source data analytics services in LobeChat to+ collect user usage data efficiently.tags:- LobeChat- data analyticsdiff --git a/docs/self-hosting/advanced/auth.mdx b/docs/self-hosting/advanced/auth.mdxindex 33f27bc8545..a8e4a07e7ba 100644--- a/docs/self-hosting/advanced/auth.mdx+++ b/docs/self-hosting/advanced/auth.mdx@@ -1,33 +1,24 @@---title: LobeChat Authentication Service Configurationdescription: >-- Learn how to configure external authentication services using Better Auth, Clerk, or Next Auth for centralized user authorization management. Supported authentication services include Auth0, Azure ID, etc.-+ Learn how to configure Better Auth for centralized user authorization+ management. Supported SSO providers include Google, GitHub, Microsoft, and+ more.tags:- Authentication Service- Better Auth- - Next Auth- SSO- - Clerk---# Authentication Service-LobeChat supports the configuration of external authentication services using Better Auth, Clerk, or Next Auth for internal use within enterprises/organizations to centrally manage user authorization.--## Clerk--Clerk is a comprehensive identity verification solution that has recently gained popularity. It provides a simple yet powerful API and services to handle user authentication and session management. Clerk's design philosophy is to offer a concise and modern authentication solution that enables developers to easily integrate and use it.--LobeChat has deeply integrated with Clerk to provide users with a more secure and convenient login and registration experience. It also relieves developers from the burden of managing authentication logic. Clerk's concise and modern design philosophy aligns perfectly with LobeChat's goals, making user management on the entire platform more efficient and reliable.--By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` in LobeChat's environment, you can enable and use Clerk.+LobeChat uses [Better Auth](https://www.better-auth.com) as its authentication solution, providing comprehensive, secure, and flexible identity verification for self-hosted deployments.-## Better Auth--[Better Auth](https://www.better-auth.com) is a modern, framework-agnostic authentication library designed to provide comprehensive, secure, and flexible authentication solutions. It supports various authentication methods including email/password, magic links, and multiple OAuth/SSO providers.+<Callout type={'info'}>+ Looking for legacy authentication methods? See [Legacy Authentication](/docs/self-hosting/advanced/auth/legacy) for NextAuth and Clerk documentation.+</Callout>-### Key Features+## Key Features- **Email/Password Authentication**: Built-in support for traditional email and password login with secure password hashing- **Email Verification**: Optional email verification flow with customizable email templates@@ -35,160 +26,116 @@ By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CL- **OAuth/SSO Support**: Integration with popular identity providers including Google, GitHub, Microsoft, AWS Cognito, and more- **Generic OIDC/OAuth**: Support for any OpenID Connect or OAuth 2.0 compliant provider-### Getting Started+## Getting StartedTo enable Better Auth in LobeChat, set the following environment variables:-| Environment Variable | Type | Description |-| -------------------------------- | -------- | ----------------------------------------------------------------------------- |-| `NEXT_PUBLIC_ENABLE_BETTER_AUTH` | Required | Set to `1` to enable Better Auth service |-| `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |-| `AUTH_SSO_PROVIDERS` | Optional | Comma-separated list of enabled SSO providers, e.g., `google,github,microsoft`|--<Callout type={'error'}>- **Important**: Better Auth is currently only suitable for **fresh deployments**. If you are already using NextAuth or Clerk and have existing user data in your database, **do not switch to Better Auth yet**, otherwise existing users will not be able to log in.-- We are developing user data migration tools from NextAuth/Clerk to Better Auth. Documentation will be updated once the migration solution is complete. For progress updates, please follow [GitHub Issue #10456](https://github.com/lobehub/lobe-chat/issues/10456).-</Callout>--<Callout type={'warning'}>- If you build/deploy with the official Docker image, the defaults keep **NextAuth enabled** and **Better- Auth disabled** (`NEXT_PUBLIC_ENABLE_NEXT_AUTH=1`, `NEXT_PUBLIC_ENABLE_BETTER_AUTH=0`) to avoid unexpected- login redirects. To switch to Better Auth, set both build args and runtime envs explicitly:- `NEXT_PUBLIC_ENABLE_BETTER_AUTH=1` and `NEXT_PUBLIC_ENABLE_NEXT_AUTH=0`, then rebuild the image.-</Callout>--### Supported SSO Providers--| Provider | Value | Environment Variables |-| --------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------- |-| Google | `google` | `AUTH_GOOGLE_ID`, `AUTH_GOOGLE_SECRET` |-| GitHub | `github` | `AUTH_GITHUB_ID`, `AUTH_GITHUB_SECRET` |-| Microsoft | `microsoft` | `AUTH_MICROSOFT_ID`, `AUTH_MICROSOFT_SECRET` |-| AWS Cognito | `cognito` | `AUTH_COGNITO_ID`, `AUTH_COGNITO_SECRET`, `AUTH_COGNITO_ISSUER` |-| Auth0 | `auth0` | `AUTH_AUTH0_ID`, `AUTH_AUTH0_SECRET`, `AUTH_AUTH0_ISSUER` |-| Authelia | `authelia` | `AUTH_AUTHELIA_ID`, `AUTH_AUTHELIA_SECRET`, `AUTH_AUTHELIA_ISSUER` |-| Authentik | `authentik` | `AUTH_AUTHENTIK_ID`, `AUTH_AUTHENTIK_SECRET`, `AUTH_AUTHENTIK_ISSUER` |-| Casdoor | `casdoor` | `AUTH_CASDOOR_ID`, `AUTH_CASDOOR_SECRET`, `AUTH_CASDOOR_ISSUER` |-| Cloudflare Zero Trust | `cloudflare-zero-trust` | `AUTH_CLOUDFLARE_ZERO_TRUST_ID`, `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET`, `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` |-| Keycloak | `keycloak` | `AUTH_KEYCLOAK_ID`, `AUTH_KEYCLOAK_SECRET`, `AUTH_KEYCLOAK_ISSUER` |-| Logto | `logto` | `AUTH_LOGTO_ID`, `AUTH_LOGTO_SECRET`, `AUTH_LOGTO_ISSUER` |-| Okta | `okta` | `AUTH_OKTA_ID`, `AUTH_OKTA_SECRET`, `AUTH_OKTA_ISSUER` |-| ZITADEL | `zitadel` | `AUTH_ZITADEL_ID`, `AUTH_ZITADEL_SECRET`, `AUTH_ZITADEL_ISSUER` |-| Generic OIDC | `generic-oidc` | `AUTH_GENERIC_OIDC_ID`, `AUTH_GENERIC_OIDC_SECRET`, `AUTH_GENERIC_OIDC_ISSUER` |-| Feishu | `feishu` | `AUTH_FEISHU_APP_ID`, `AUTH_FEISHU_APP_SECRET` |-| WeChat | `wechat` | `AUTH_WECHAT_ID`, `AUTH_WECHAT_SECRET` |--### Callback URL Format--When configuring OAuth providers, use the following callback URL format:--- **Development**: `http://localhost:3210/api/auth/callback/{provider}`-- **Production**: `https://yourdomain.com/api/auth/callback/{provider}`--### Email Service Configuration--Used by email verification, password reset, and magic-link delivery. Choose a provider, then fill the matching variables:+| Environment Variable | Type | Description |+| -------------------- | -------- | ------------------------------------------------------------------------------ |+| `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |+| `AUTH_SSO_PROVIDERS` | Optional | Comma-separated list of enabled SSO providers, e.g., `google,github,microsoft` |++## Supported SSO Providers++| Provider | Value | Environment Variables |+| --------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------ |+| Google | `google` | `AUTH_GOOGLE_ID`, `AUTH_GOOGLE_SECRET` |+| GitHub | `github` | `AUTH_GITHUB_ID`, `AUTH_GITHUB_SECRET` |+| Microsoft | `microsoft` | `AUTH_MICROSOFT_ID`, `AUTH_MICROSOFT_SECRET` |+| Apple | `apple` | `AUTH_APPLE_CLIENT_ID`, `AUTH_APPLE_CLIENT_SECRET` |+| AWS Cognito | `cognito` | `AUTH_COGNITO_ID`, `AUTH_COGNITO_SECRET`, `AUTH_COGNITO_DOMAIN`, `AUTH_COGNITO_REGION`, `AUTH_COGNITO_USERPOOL_ID` |+| Auth0 | `auth0` | `AUTH_AUTH0_ID`, `AUTH_AUTH0_SECRET`, `AUTH_AUTH0_ISSUER` |+| Authelia | `authelia` | `AUTH_AUTHELIA_ID`, `AUTH_AUTHELIA_SECRET`, `AUTH_AUTHELIA_ISSUER` |+| Authentik | `authentik` | `AUTH_AUTHENTIK_ID`, `AUTH_AUTHENTIK_SECRET`, `AUTH_AUTHENTIK_ISSUER` |+| Casdoor | `casdoor` | `AUTH_CASDOOR_ID`, `AUTH_CASDOOR_SECRET`, `AUTH_CASDOOR_ISSUER` |+| Cloudflare Zero Trust | `cloudflare-zero-trust` | `AUTH_CLOUDFLARE_ZERO_TRUST_ID`, `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET`, `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` |+| Keycloak | `keycloak` | `AUTH_KEYCLOAK_ID`, `AUTH_KEYCLOAK_SECRET`, `AUTH_KEYCLOAK_ISSUER` |+| Logto | `logto` | `AUTH_LOGTO_ID`, `AUTH_LOGTO_SECRET`, `AUTH_LOGTO_ISSUER` |+| Okta | `okta` | `AUTH_OKTA_ID`, `AUTH_OKTA_SECRET`, `AUTH_OKTA_ISSUER` |+| ZITADEL | `zitadel` | `AUTH_ZITADEL_ID`, `AUTH_ZITADEL_SECRET`, `AUTH_ZITADEL_ISSUER` |+| Generic OIDC | `generic-oidc` | `AUTH_GENERIC_OIDC_ID`, `AUTH_GENERIC_OIDC_SECRET`, `AUTH_GENERIC_OIDC_ISSUER` |+| Feishu | `feishu` | `AUTH_FEISHU_APP_ID`, `AUTH_FEISHU_APP_SECRET` |+| WeChat | `wechat` | `AUTH_WECHAT_ID`, `AUTH_WECHAT_SECRET` |++Click on a provider below for detailed configuration guides:-| Environment Variable | Type | Description |-| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |-| `NEXT_PUBLIC_AUTH_EMAIL_VERIFICATION` | Optional | Set to `1` to require email verification before users can sign in |-| `EMAIL_SERVICE_PROVIDER` | Optional | Email provider selector: `nodemailer` (default, SMTP) or `resend` |-| `SMTP_HOST` | Required | SMTP server hostname (e.g., `smtp.gmail.com`). Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |-| `SMTP_PORT` | Required | SMTP server port (usually `587` for TLS, `465` for SSL). Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |-| `SMTP_SECURE` | Optional | `true` for SSL (port 465), `false` for TLS (port 587). Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |-| `SMTP_USER` | Required | SMTP auth username. Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |-| `SMTP_PASS` | Required | SMTP auth password. Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |-| `RESEND_API_KEY` | Required | Resend API key. Required when `EMAIL_SERVICE_PROVIDER=resend` |-| `RESEND_FROM` | Recommended | Default sender address (e.g., `[email protected]`). Must be a domain verified in Resend. Used when `EMAIL_SERVICE_PROVIDER=resend` |+<Cards>+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/github'} title={'GitHub'} />-### Magic Link (Passwordless) Login+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/google'} title={'Google'} />-Enable BetterAuth magic-link login (depends on a working email provider above):+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/microsoft'} title={'Microsoft'} />-| Environment Variable | Type | Description |-| ------------------------------- | -------- | -------------------------------------------------- |-| `NEXT_PUBLIC_ENABLE_MAGIC_LINK` | Optional | Set to `1` to enable passwordless magic-link login |+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/apple'} title={'Apple'} />-<Callout type={'tip'}>- For detailed provider configuration, refer to the [Next Auth provider documentation](/docs/self-hosting/advanced/auth/next-auth) as most configurations are compatible, or visit the official [Better Auth documentation](https://www.better-auth.com/docs/introduction).-</Callout>--<Callout type={'tip'}>- Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#better-auth) for detailed information on all Better Auth variables.-</Callout>+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/cognito'} title={'AWS Cognito'} />-## Next Auth+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/auth0'} title={'Auth0'} />-Before using NextAuth, please set the following variables in LobeChat's environment variables:+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/authelia'} title={'Authelia'} />-| Environment Variable | Type | Description |-| -------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |-| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | Required | This is used to enable the NextAuth service. Set it to `1` to enable it; changing this setting requires recompiling the application. Users deploying with the `lobehub/lobe-chat-database` image have this configuration added by default. |-| `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. |-| `AUTH_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`. |-| `NEXT_AUTH_SSO_SESSION_STRATEGY` | Optional | The session strategy for Auth.js. Options are `jwt` or `database`. Default is `jwt`. |+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/authentik'} title={'Authentik'} />-Currently supported identity verification services include:+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/casdoor'} title={'Casdoor'} />-<Cards>- <Card href={'/docs/self-hosting/advanced/auth/next-auth/auth0'} title={'Auth0'} />+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust'} title={'Cloudflare Zero Trust'} />- <Card href={'/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id'} title={'Microsoft Entra ID'} />+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/keycloak'} title={'Keycloak'} />- <Card href={'/docs/self-hosting/advanced/auth/next-auth/authentik'} title={'Authentik'} />+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/logto'} title={'Logto'} />- <Card href={'/docs/self-hosting/advanced/auth/next-auth/github'} title={'Github'} />+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/okta'} title={'Okta'} />- <Card href={'/docs/self-hosting/advanced/auth/next-auth/zitadel'} title={'ZITADEL'} />+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/zitadel'} title={'ZITADEL'} />- <Card href={'/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust'} title={'Cloudflare Zero Trust'} />+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/generic-oidc'} title={'Generic OIDC'} />- <Card href={'/docs/self-hosting/advanced/auth/next-auth/authelia'} title={'Authelia'} />+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/feishu'} title={'Feishu'} />- <Card href={'/docs/self-hosting/advanced/auth/next-auth/logto'} title={'Logto'} />+ <Card href={'/docs/self-hosting/advanced/auth/better-auth/wechat'} title={'WeChat'} />+</Cards>- <Card href={'/docs/self-hosting/advanced/auth/next-auth/keycloak'} title={'Keycloak'} />+## Callback URL Format- <Card href={'/docs/self-hosting/advanced/auth/next-auth/google'} title={'Google'} />+When configuring OAuth providers, use the following callback URL format:- <Card href={'/docs/self-hosting/advanced/auth/next-auth/okta'} title={'Okta'} />-</Cards>+- **Development**: `http://localhost:3210/api/auth/callback/{provider}`+- **Production**: `https://yourdomain.com/api/auth/callback/{provider}`-Click on the links to view the corresponding platform's configuration documentation.+## Email Service Configuration-## Advanced Configuration+Used by email verification, password reset, and magic-link delivery. Choose a provider, then fill the matching variables:-To simultaneously enable multiple identity verification sources, please set the `NEXT_AUTH_SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,microsoft-entra-id,authentik`.+| Environment Variable | Type | Description |+| ------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |+| `AUTH_EMAIL_VERIFICATION` | Optional | Set to `1` to require email verification before sign in (off by default) |+| `EMAIL_SERVICE_PROVIDER` | Optional | Email provider selector: `nodemailer` (default, SMTP) or `resend` |+| `SMTP_HOST` | Required | SMTP server hostname (e.g., `smtp.gmail.com`). Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |+| `SMTP_PORT` | Required | SMTP server port (usually `587` for TLS, `465` for SSL). Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |+| `SMTP_SECURE` | Optional | `true` for SSL (port 465), `false` for TLS (port 587). Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |+| `SMTP_USER` | Required | SMTP auth username. Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |+| `SMTP_PASS` | Required | SMTP auth password. Used when `EMAIL_SERVICE_PROVIDER=nodemailer` |+| `RESEND_API_KEY` | Required | Resend API key. Required when `EMAIL_SERVICE_PROVIDER=resend` |+| `RESEND_FROM` | Recommended | Default sender address (e.g., `[email protected]`). Must be a domain verified in Resend. Used when `EMAIL_SERVICE_PROVIDER=resend` |-The order corresponds to the display order of the SSO providers.+## Magic Link (Passwordless) Login-| SSO Provider | Value | Additional Features |-| --------------------- | ----------------------- | ------------------- |-| Auth0 | `auth0` | |-| Authenlia | `authenlia` | |-| Authentik | `authentik` | |-| Casdoor | `casdoor` | `Webhook` |-| Cloudflare Zero Trust | `cloudflare-zero-trust` | |-| Github | `github` | |-| Logto | `logto` | `Webhook` |-| Microsoft Entra ID | `microsoft-entra-id` | |-| ZITADEL | `zitadel` | |-| Keycloak | `keycloak` | |-| Google | `google` | |-| Okta | `okta` | |+Enable magic-link login (depends on a working email provider above, off by default):-## Additional Features+| Environment Variable | Type | Description |+| -------------------- | -------- | ------------------------------------------------------------------- |+| `ENABLE_MAGIC_LINK` | Optional | Set to `1` to enable passwordless magic-link login (off by default) |-### Webhook Support+<Callout type={'tip'}>+ Go to [Environment Variables](/docs/self-hosting/environment-variables/auth#better-auth) for detailed information on all Better Auth variables.+</Callout>-Allow LobeChat to receive notifications when user information is updated in the identity provider. Supported providers include Casdoor and Logto. Please refer to the specific provider documentation for configuration details.+## FAQ-### Database Session+### What SSO providers does Better Auth support?-Allow the session store in database, see also the [Auth.js Session Documentation](https://authjs.dev/concepts/session-strategies#database-session).+Better Auth supports built-in providers (Google, GitHub, Microsoft, Apple, AWS Cognito) and Generic OIDC providers (Auth0, Authelia, Authentik, Casdoor, Cloudflare Zero Trust, Keycloak, Logto, Okta, ZITADEL, Generic OIDC, Feishu, WeChat).-## Other SSO Providers+### How do I enable multiple SSO providers?-Please refer to the [Auth.js](https://authjs.dev/getting-started/authentication/oauth) documentation and feel free to submit a Pull Request.+Set the `AUTH_SSO_PROVIDERS` environment variable with a comma-separated list, e.g., `google,github,microsoft`. The order determines the display order on the login page.diff --git a/docs/self-hosting/advanced/auth.zh-CN.mdx b/docs/self-hosting/advanced/auth.zh-CN.mdxindex 41fcca74437..5cd1d8205a4 100644--- a/docs/self-hosting/advanced/auth.zh-CN.mdx+++ b/docs/self-hosting/advanced/auth.zh-CN.mdx@@ -1,31 +1,21 @@---title: LobeChat 身份验证服务配置-description: 了解如何使用 Better Auth、Clerk 或 Next Auth 配置外部身份验证服务,以统一管理用户授权。支持的身份验证服务包括 Auth0、 Azure ID 等。+description: 了解如何配置 Better Auth 以统一管理用户授权。支持的 SSO 提供商包括 Google、GitHub、Microsoft 等。tags:- 身份验证服务- Better Auth- - LobeChat- SSO- - Clerk---# 身份验证服务-LobeChat 支持使用 Better Auth、Clerk 或者 Next Auth 配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权。+LobeChat 使用 [Better Auth](https://www.better-auth.com) 作为身份验证解决方案,为自托管部署提供全面、安全、灵活的身份验证服务。-## Clerk--Clerk 是一个近期流行起来的全面的身份验证解决方案,它提供了简单而强大的 API 和服务来处理用户认证和会话管理。Clerk 的设计哲学是提供一套简洁、现代的认证解决方案,使得开发者可以轻松集成和使用。--LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全、便捷的登录和注册体验,同时也为开发者减轻了管理身份验证逻辑的负担。Clerk 的简洁和现代的设计理念与 LobeChat 的目标非常契合,使得整个平台的用户管理更加高效和可靠。--在 LobeChat 的环境变量中设置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY`,即可开启和使用 Clerk。--## Better Auth--[Better Auth](https://www.better-auth.com) 是一个现代化、框架无关的身份验证库,旨在提供全面、安全、灵活的身份验证解决方案。它支持多种认证方式,包括邮箱 / 密码登录、魔法链接登录以及多种 OAuth/SSO 提供商。+<Callout type={'info'}>+ 需要使用旧版身份验证方案?请参阅 [旧版身份验证](/zh/docs/self-hosting/advanced/auth/legacy) 了解 NextAuth 和 Clerk 的文档。+</Callout>-### 主要特性+## 主要特性- **邮箱 / 密码认证**:内置支持传统的邮箱和密码登录,采用安全的密码哈希算法- **邮箱验证**:可选的邮箱验证流程,支持自定义邮件模板@@ -33,157 +23,116 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全- **OAuth/SSO 支持**:集成 Google、GitHub、Microsoft、AWS Cognito 等主流身份提供商- **通用 OIDC/OAuth**:支持任何符合 OpenID Connect 或 OAuth 2.0 标准的提供商-### 快速开始+## 快速开始要在 LobeChat 中启用 Better Auth,请设置以下环境变量:-| 环境变量 | 类型 | 描述 |-| -------------------------------- | -- | ----------------------------------------------------------- |-| `NEXT_PUBLIC_ENABLE_BETTER_AUTH` | 必选 | 设置为 `1` 以启用 Better Auth 服务 |-| `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |-| `AUTH_SSO_PROVIDERS` | 可选 | 启用的 SSO 提供商列表,以逗号分隔,例如 `google,github,microsoft` |--<Callout type={'error'}>- **重要提示**:Better Auth 目前仅适用于**全新部署**的场景。如果你已经使用 NextAuth 或 Clerk 并且数据库中存在用户数据,**请暂时不要切换到 Better Auth**,否则现有用户将无法登录。-- 我们正在开发从 NextAuth/Clerk 到 Better Auth 的用户数据迁移工具,迁移方案完成后会更新文档。相关进度请关注 [GitHub Issue #10456](https://github.com/lobehub/lobe-chat/issues/10456)。-</Callout>--<Callout type={'warning'}>- 若使用官方 Docker 镜像构建 / 部署,默认是 **开启 NextAuth、关闭 Better Auth**- (`NEXT_PUBLIC_ENABLE_NEXT_AUTH=1`、`NEXT_PUBLIC_ENABLE_BETTER_AUTH=0`),以避免意外跳转到新版登录页。- 如果要切换到 Better Auth,请同时显式设置构建参数和运行时环境变量:- `NEXT_PUBLIC_ENABLE_BETTER_AUTH=1`、`NEXT_PUBLIC_ENABLE_NEXT_AUTH=0`,并重新构建镜像。-</Callout>--### 支持的 SSO 提供商--| 提供商 | 值 | 环境变量 |-| --------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------- |-| Google | `google` | `AUTH_GOOGLE_ID`, `AUTH_GOOGLE_SECRET` |-| GitHub | `github` | `AUTH_GITHUB_ID`, `AUTH_GITHUB_SECRET` |-| Microsoft | `microsoft` | `AUTH_MICROSOFT_ID`, `AUTH_MICROSOFT_SECRET` |-| AWS Cognito | `cognito` | `AUTH_COGNITO_ID`, `AUTH_COGNITO_SECRET`, `AUTH_COGNITO_ISSUER` |-| Auth0 | `auth0` | `AUTH_AUTH0_ID`, `AUTH_AUTH0_SECRET`, `AUTH_AUTH0_ISSUER` |-| Authelia | `authelia` | `AUTH_AUTHELIA_ID`, `AUTH_AUTHELIA_SECRET`, `AUTH_AUTHELIA_ISSUER` |-| Authentik | `authentik` | `AUTH_AUTHENTIK_ID`, `AUTH_AUTHENTIK_SECRET`, `AUTH_AUTHENTIK_ISSUER` |-| Casdoor | `casdoor` | `AUTH_CASDOOR_ID`, `AUTH_CASDOOR_SECRET`, `AUTH_CASDOOR_ISSUER` |-| Cloudflare Zero Trust | `cloudflare-zero-trust` | `AUTH_CLOUDFLARE_ZERO_TRUST_ID`, `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET`, `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` |-| Keycloak | `keycloak` | `AUTH_KEYCLOAK_ID`, `AUTH_KEYCLOAK_SECRET`, `AUTH_KEYCLOAK_ISSUER` |-| Logto | `logto` | `AUTH_LOGTO_ID`, `AUTH_LOGTO_SECRET`, `AUTH_LOGTO_ISSUER` |-| Okta | `okta` | `AUTH_OKTA_ID`, `AUTH_OKTA_SECRET`, `AUTH_OKTA_ISSUER` |-| ZITADEL | `zitadel` | `AUTH_ZITADEL_ID`, `AUTH_ZITADEL_SECRET`, `AUTH_ZITADEL_ISSUER` |-| Generic OIDC | `generic-oidc` | `AUTH_GENERIC_OIDC_ID`, `AUTH_GENERIC_OIDC_SECRET`, `AUTH_GENERIC_OIDC_ISSUER` |-| 飞书 | `feishu` | `AUTH_FEISHU_APP_ID`, `AUTH_FEISHU_APP_SECRET` |-| 微信 | `wechat` | `AUTH_WECHAT_ID`, `AUTH_WECHAT_SECRET` |--### 回调 URL 格式--配置 OAuth 提供商时,请使用以下回调 URL 格式:--- **开发环境**:`http://localhost:3210/api/auth/callback/{provider}`-- **生产环境**:`https://yourdomain.com/api/auth/callback/{provider}`--### 邮件服务配置+| 环境变量 | 类型 | 描述 |+| -------------------- | -- | ------------------------------------------------ |+| `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |+| `AUTH_SSO_PROVIDERS` | 可选 | 启用的 SSO 提供商列表,以逗号分隔,例如 `google,github,microsoft` |++## 支持的 SSO 提供商++| 提供商 | 值 | 环境变量 |+| --------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------ |+| Google | `google` | `AUTH_GOOGLE_ID`, `AUTH_GOOGLE_SECRET` |+| GitHub | `github` | `AUTH_GITHUB_ID`, `AUTH_GITHUB_SECRET` |+| Microsoft | `microsoft` | `AUTH_MICROSOFT_ID`, `AUTH_MICROSOFT_SECRET` |+| Apple | `apple` | `AUTH_APPLE_CLIENT_ID`, `AUTH_APPLE_CLIENT_SECRET` |+| AWS Cognito | `cognito` | `AUTH_COGNITO_ID`, `AUTH_COGNITO_SECRET`, `AUTH_COGNITO_DOMAIN`, `AUTH_COGNITO_REGION`, `AUTH_COGNITO_USERPOOL_ID` |+| Auth0 | `auth0` | `AUTH_AUTH0_ID`, `AUTH_AUTH0_SECRET`, `AUTH_AUTH0_ISSUER` |+| Authelia | `authelia` | `AUTH_AUTHELIA_ID`, `AUTH_AUTHELIA_SECRET`, `AUTH_AUTHELIA_ISSUER` |+| Authentik | `authentik` | `AUTH_AUTHENTIK_ID`, `AUTH_AUTHENTIK_SECRET`, `AUTH_AUTHENTIK_ISSUER` |+| Casdoor | `casdoor` | `AUTH_CASDOOR_ID`, `AUTH_CASDOOR_SECRET`, `AUTH_CASDOOR_ISSUER` |+| Cloudflare Zero Trust | `cloudflare-zero-trust` | `AUTH_CLOUDFLARE_ZERO_TRUST_ID`, `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET`, `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` |+| Keycloak | `keycloak` | `AUTH_KEYCLOAK_ID`, `AUTH_KEYCLOAK_SECRET`, `AUTH_KEYCLOAK_ISSUER` |+| Logto | `logto` | `AUTH_LOGTO_ID`, `AUTH_LOGTO_SECRET`, `AUTH_LOGTO_ISSUER` |+| Okta | `okta` | `AUTH_OKTA_ID`, `AUTH_OKTA_SECRET`, `AUTH_OKTA_ISSUER` |+| ZITADEL | `zitadel` | `AUTH_ZITADEL_ID`, `AUTH_ZITADEL_SECRET`, `AUTH_ZITADEL_ISSUER` |+| Generic OIDC | `generic-oidc` | `AUTH_GENERIC_OIDC_ID`, `AUTH_GENERIC_OIDC_SECRET`, `AUTH_GENERIC_OIDC_ISSUER` |+| 飞书 | `feishu` | `AUTH_FEISHU_APP_ID`, `AUTH_FEISHU_APP_SECRET` |+| 微信 | `wechat` | `AUTH_WECHAT_ID`, `AUTH_WECHAT_SECRET` |++点击下方提供商查看详细配置指南:-用于邮箱验证、密码重置和魔法链接发送。先选择邮件服务,再填对应变量:+<Cards>+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/github'} title={'GitHub'} />-| 环境变量 | 类型 | 描述 |-| ------------------------------------- | -- | ----------------------------------------------------------------------------------------- |-| `NEXT_PUBLIC_AUTH_EMAIL_VERIFICATION` | 可选 | 设置为 `1` 以要求用户在登录前验证邮箱 |-| `EMAIL_SERVICE_PROVIDER` | 可选 | 邮件服务选择:`nodemailer`(默认,SMTP)或 `resend` |-| `SMTP_HOST` | 必选 | SMTP 服务器主机名(如 `smtp.gmail.com`),仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |-| `SMTP_PORT` | 必选 | SMTP 服务器端口(TLS 通常为 `587`,SSL 为 `465`),仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |-| `SMTP_SECURE` | 可选 | SSL 设置为 `true`(端口 465),TLS 设置为 `false`(端口 587),仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |-| `SMTP_USER` | 必选 | SMTP 认证用户名,仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |-| `SMTP_PASS` | 必选 | SMTP 认证密码,仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |-| `RESEND_API_KEY` | 必选 | Resend API Key,`EMAIL_SERVICE_PROVIDER=resend` 时必填 |-| `RESEND_FROM` | 推荐 | 默认发件人地址(如 `noreply@已验证域名`),需为 Resend 已验证域名下的邮箱,`EMAIL_SERVICE_PROVIDER=resend` 时使用 |+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/google'} title={'Google'} />-### 魔法链接(免密)登录+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/microsoft'} title={'Microsoft'} />-启用 BetterAuth 魔法链接登录(依赖上方已配置好的邮件服务):+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/apple'} title={'Apple'} />-| 环境变量 | 类型 | 描述 |-| ------------------------------- | -- | ----------------- |-| `NEXT_PUBLIC_ENABLE_MAGIC_LINK` | 可选 | 设置为 `1` 以启用魔法链接登录 |+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/cognito'} title={'AWS Cognito'} />-<Callout type={'tip'}>- 详细的提供商配置可参考 [Next Auth 提供商文档](/zh/docs/self-hosting/advanced/auth/next-auth)(大部分配置兼容),或访问官方 [Better Auth 文档](https://www.better-auth.com/docs/introduction)。-</Callout>+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/auth0'} title={'Auth0'} />-<Callout type={'tip'}>- 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#better-auth) 可查阅所有 Better Auth 相关变量详情。-</Callout>+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/authelia'} title={'Authelia'} />-## Next Auth+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/authentik'} title={'Authentik'} />-在使用 NextAuth 之前,请先在 LobeChat 的环境变量中设置以下变量:+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/casdoor'} title={'Casdoor'} />-| 环境变量 | 类型 | 描述 |-| -------------------------------- | -- | ------------------------------------------------------------------------------------------------------------ |-| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | 必选 | 用于启用 NextAuth 服务,设置为 `1` 以启用,更改此项需要重新编译应用。使用 `lobehub/lobe-chat-database` 镜像部署的用户已经默认添加了该项配置。 |-| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |-| `AUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |-| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 |-| `NEXT_AUTH_SSO_SESSION_STRATEGY` | 可选 | Auth.js 的会话策略。选项为 `jwt` 或 `database`。默认值为 `jwt`。 |+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust'} title={'Cloudflare Zero Trust'} />-目前支持的身份验证服务有:--<Cards>- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/auth0'} title={'Auth0'} />+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/keycloak'} title={'Keycloak'} />- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id'} title={'Microsoft Entra ID'} />+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/logto'} title={'Logto'} />- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/authentik'} title={'Authentik'} />+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/okta'} title={'Okta'} />- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/github'} title={'Github'} />+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/zitadel'} title={'ZITADEL'} />- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/zitadel'} title={'ZITADEL'} />+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/generic-oidc'} title={'Generic OIDC'} />- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust'} title={'Cloudflare Zero Trust'} />+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/feishu'} title={'飞书'} />- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/authelia'} title={'Authelia'} />+ <Card href={'/zh/docs/self-hosting/advanced/auth/better-auth/wechat'} title={'微信'} />+</Cards>- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/logto'} title={'Logto'} />+## 回调 URL 格式- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/keycloak'} title={'Keycloak'} />+配置 OAuth 提供商时,请使用以下回调 URL 格式:- <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/okta'} title={'Okta'} />-</Cards>+- **开发环境**:`http://localhost:3210/api/auth/callback/{provider}`+- **生产环境**:`https://yourdomain.com/api/auth/callback/{provider}`-点击即可查看对应平台的配置文档。+## 邮件服务配置-## 进阶配置+用于邮箱验证、密码重置和魔法链接发送。先选择邮件服务,再填对应变量:-同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。+| 环境变量 | 类型 | 描述 |+| ------------------------- | -- | ----------------------------------------------------------------------------------------- |+| `AUTH_EMAIL_VERIFICATION` | 可选 | 设置为 `1` 以要求用户在登录前验证邮箱(默认关闭) |+| `EMAIL_SERVICE_PROVIDER` | 可选 | 邮件服务选择:`nodemailer`(默认,SMTP)或 `resend` |+| `SMTP_HOST` | 必选 | SMTP 服务器主机名(如 `smtp.gmail.com`),仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |+| `SMTP_PORT` | 必选 | SMTP 服务器端口(TLS 通常为 `587`,SSL 为 `465`),仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |+| `SMTP_SECURE` | 可选 | SSL 设置为 `true`(端口 465),TLS 设置为 `false`(端口 587),仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |+| `SMTP_USER` | 必选 | SMTP 认证用户名,仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |+| `SMTP_PASS` | 必选 | SMTP 认证密码,仅在 `EMAIL_SERVICE_PROVIDER=nodemailer` 时需要 |+| `RESEND_API_KEY` | 必选 | Resend API Key,`EMAIL_SERVICE_PROVIDER=resend` 时必填 |+| `RESEND_FROM` | 推荐 | 默认发件人地址(如 `noreply@已验证域名`),需为 Resend 已验证域名下的邮箱,`EMAIL_SERVICE_PROVIDER=resend` 时使用 |-顺序为 SSO 提供商的显示顺序。+## 魔法链接(免密)登录-| SSO 提供商 | 值 | 额外功能 |-| --------------------- | ----------------------- | --------- |-| Auth0 | `auth0` | |-| Authenlia | `authenlia` | |-| Authentik | `authentik` | |-| Casdoor | `casdoor` | `Webhook` |-| Cloudflare Zero Trust | `cloudflare-zero-trust` | |-| Github | `github` | |-| Logto | `logto` | `Webhook` |-| Microsoft Entra ID | `microsoft-entra-id` | |-| ZITADEL | `zitadel` | |-| Keycloak | `keycloak` | |-| Okta | `okta` | |+启用魔法链接登录(依赖上方已配置好的邮件服务,默认关闭):-## 额外功能+| 环境变量 | 类型 | 描述 |+| ------------------- | -- | ----------------------- |+| `ENABLE_MAGIC_LINK` | 可选 | 设置为 `1` 以启用魔法链接登录(默认关闭) |-### Webhook 支持+<Callout type={'tip'}>+ 前往 [环境变量](/zh/docs/self-hosting/environment-variables/auth#better-auth) 可查阅所有 Better Auth 相关变量详情。+</Callout>-允许 LobeChat 在身份提供商中用户信息更新时接收通知。支持的提供商包括 Casdoor 和 Logto。请参考具体提供商文档进行配置。+## 常见问题-### 数据库会话+### Better Auth 支持哪些 SSO 提供商?-允许会话存储在数据库中,详情请参阅 [Auth.js 会话文档](https://authjs.dev/concepts/session-strategies#database-session)。+Better Auth 支持内置提供商(Google、GitHub、Microsoft、Apple、AWS Cognito)和通用 OIDC 提供商(Auth0、Authelia、Authentik、Casdoor、Cloudflare Zero Trust、Keycloak、Logto、Okta、ZITADEL、Generic OIDC、飞书、微信)。-## 其他 SSO 提供商+### 如何启用多个 SSO 提供商?-请参考 [NextAuth.js](https://next-auth.js.org/providers) 文档,欢迎提交 Pull Request。+设置 `AUTH_SSO_PROVIDERS` 环境变量,使用逗号分隔多个提供商,例如 `google,github,microsoft`。顺序决定登录页面上的显示顺序。diff --git a/docs/self-hosting/advanced/auth/better-auth/apple.mdx b/docs/self-hosting/advanced/auth/better-auth/apple.mdxnew file mode 100644index 00000000000..9c603906a29--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/apple.mdx@@ -0,0 +1,132 @@+---+title: Configuring Apple Authentication for LobeChat+description: >-+ Learn how to configure Apple Sign In for LobeChat, including creating+ credentials in Apple Developer Portal and setting up environment variables.+tags:+ - Apple+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring Apple Authentication++<Callout type={'warning'}>+ Apple Sign In requires a paid Apple Developer account ($99/year) and does not+ support localhost. You must use a domain with HTTPS for both development and+ production.+</Callout>++<Steps>+ ### Create an App ID++ 1. Go to [Apple Developer Portal](https://developer.apple.com/account/resources/identifiers/list)+ 2. Navigate to **Certificates, Identifiers & Profiles** > **Identifiers**+ 3. Click **+** to register a new identifier+ 4. Select **App IDs** > **App** type > **Continue**+ 5. Fill in:+ - **Description**: e.g., `LobeChat`+ - **Bundle ID**: e.g., `com.yourcompany.lobechat`+ 6. Enable **Sign In with Apple** capability+ 7. Click **Continue** > **Register**++ ### Create a Services ID++ 1. Go back to **Identifiers**, click **+**+ 2. Select **Services IDs** > **Continue**+ 3. Fill in:+ - **Description**: e.g., `LobeChat Web`+ - **Identifier**: e.g., `com.yourcompany.lobechat.web` (this is your Client ID)+ 4. Click **Continue** > **Register**++ ### Configure Services ID++ 1. Click on the created Services ID+ 2. Enable **Sign In with Apple**+ 3. Click **Configure**+ 4. Select your Primary App ID+ 5. Add domains and callback URLs:+ - **Domains**: `your-domain.com`+ - **Return URLs**: `https://your-domain.com/api/auth/callback/apple`+ 6. Click **Save** > **Continue** > **Save**++ <Callout type={'info'}>+ Callback URL format:++ - Production: `https://your-domain.com/api/auth/callback/apple`+ - Apple does **not** support localhost or HTTP URLs+ </Callout>++ ### Create a Sign In Key++ 1. Navigate to **Keys**, click **+**+ 2. Fill in key name+ 3. Enable **Sign In with Apple**, click **Configure**+ 4. Select your Primary App ID+ 5. Click **Save** > **Continue** > **Register**+ 6. **Download the key file** (`.p8`) - you can only download it once+ 7. Note down:+ - **Key ID**: shown on the key page+ - **Team ID**: shown in top right corner of developer portal++ ### Generate Client Secret++ Apple requires a JWT as the client secret. Generate it using your `.p8` key file:++ ```js+ // Example using Node.js+ const jwt = require('jsonwebtoken');+ const fs = require('fs');++ const privateKey = fs.readFileSync('AuthKey_XXXXX.p8');+ const token = jwt.sign({}, privateKey, {+ algorithm: 'ES256',+ expiresIn: '180d', // Max 6 months+ issuer: 'YOUR_TEAM_ID',+ audience: 'https://appleid.apple.com',+ subject: 'YOUR_SERVICES_ID', // Client ID+ keyid: 'YOUR_KEY_ID',+ });+ ```++ <Callout type={'warning'}>+ The JWT expires after maximum 180 days. You need to regenerate and update it+ before expiration.+ </Callout>++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | ---------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `apple` |+ | `AUTH_APPLE_CLIENT_ID` | Required | Your Services ID |+ | `AUTH_APPLE_CLIENT_SECRET` | Required | The generated JWT |+ | `AUTH_APPLE_APP_BUNDLE_IDENTIFIER` | Optional | App Bundle ID (for native app integration) |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#apple)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Apple and+ use LobeChat.+</Callout>++## Common Issues++### localhost Not Supported++Apple Sign In does not support localhost or non-HTTPS URLs. For local development, use a tunneling service like ngrok or deploy to a staging environment with HTTPS.++### Secret Expiration++The JWT client secret expires after 180 days maximum. Set a reminder to regenerate it before expiration.++## Related Resources++- [Apple Developer Portal](https://developer.apple.com/account)+- [Sign In with Apple Documentation](https://developer.apple.com/sign-in-with-apple/)diff --git a/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdxnew file mode 100644index 00000000000..ad0d49ab8ea--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdx@@ -0,0 +1,127 @@+---+title: 在 LobeChat 中配置 Apple 身份验证+description: 学习如何在 LobeChat 中配置 Apple 登录,包括在 Apple Developer Portal 创建凭证和设置环境变量。+tags:+ - Apple+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置 Apple 身份验证++<Callout type={'warning'}>+ Apple 登录需要付费的 Apple Developer 账户($99 / 年),且不支持+ localhost。开发和生产环境都必须使用 HTTPS 域名。+</Callout>++<Steps>+ ### 创建 App ID++ 1. 前往 [Apple Developer Portal](https://developer.apple.com/account/resources/identifiers/list)+ 2. 导航到 **Certificates, Identifiers & Profiles** > **Identifiers**+ 3. 点击 **+** 注册新标识符+ 4. 选择 **App IDs** > **App** 类型 > **Continue**+ 5. 填写:+ - **Description**: 如 `LobeChat`+ - **Bundle ID**: 如 `com.yourcompany.lobechat`+ 6. 启用 **Sign In with Apple** 功能+ 7. 点击 **Continue** > **Register**++ ### 创建 Services ID++ 1. 返回 **Identifiers**,点击 **+**+ 2. 选择 **Services IDs** > **Continue**+ 3. 填写:+ - **Description**: 如 `LobeChat Web`+ - **Identifier**: 如 `com.yourcompany.lobechat.web`(这是你的 Client ID)+ 4. 点击 **Continue** > **Register**++ ### 配置 Services ID++ 1. 点击已创建的 Services ID+ 2. 启用 **Sign In with Apple**+ 3. 点击 **Configure**+ 4. 选择 Primary App ID+ 5. 添加域名和回调 URL:+ - **Domains**: `your-domain.com`+ - **Return URLs**: `https://your-domain.com/api/auth/callback/apple`+ 6. 点击 **Save** > **Continue** > **Save**++ <Callout type={'info'}>+ 回调 URL 格式:++ - 生产环境: `https://your-domain.com/api/auth/callback/apple`+ - Apple **不支持** localhost 或 HTTP URL+ </Callout>++ ### 创建登录密钥++ 1. 导航到 **Keys**,点击 **+**+ 2. 填写密钥名称+ 3. 启用 **Sign In with Apple**,点击 **Configure**+ 4. 选择 Primary App ID+ 5. 点击 **Save** > **Continue** > **Register**+ 6. **下载密钥文件**(`.p8`)- 只能下载一次+ 7. 记录:+ - **Key ID**: 密钥页面显示+ - **Team ID**: 开发者门户右上角显示++ ### 生成 Client Secret++ Apple 要求使用 JWT 作为 client secret。使用 `.p8` 密钥文件生成:++ ```js+ // Node.js 示例+ const jwt = require('jsonwebtoken');+ const fs = require('fs');++ const privateKey = fs.readFileSync('AuthKey_XXXXX.p8');+ const token = jwt.sign({}, privateKey, {+ algorithm: 'ES256',+ expiresIn: '180d', // 最长 6 个月+ issuer: 'YOUR_TEAM_ID',+ audience: 'https://appleid.apple.com',+ subject: 'YOUR_SERVICES_ID', // Client ID+ keyid: 'YOUR_KEY_ID',+ });+ ```++ <Callout type={'warning'}>+ JWT 最长有效期为 180 天。需要在过期前重新生成并更新。+ </Callout>++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | ---------------------------------- | -- | -------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `apple` |+ | `AUTH_APPLE_CLIENT_ID` | 必选 | 你的 Services ID |+ | `AUTH_APPLE_CLIENT_SECRET` | 必选 | 生成的 JWT |+ | `AUTH_APPLE_APP_BUNDLE_IDENTIFIER` | 可选 | App Bundle ID(用于原生应用集成) |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#apple)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过 Apple 身份认证并使用 LobeChat。+</Callout>++## 常见问题++### 不支持 localhost++Apple 登录不支持 localhost 或非 HTTPS URL。本地开发请使用 ngrok 等隧道服务或部署到带有 HTTPS 的测试环境。++### 密钥过期++JWT client secret 最长有效期为 180 天。请设置提醒在过期前重新生成。++## 相关资源++- [Apple Developer Portal](https://developer.apple.com/account)+- [Sign In with Apple 文档](https://developer.apple.com/sign-in-with-apple/)diff --git a/docs/self-hosting/advanced/auth/better-auth/auth0.mdx b/docs/self-hosting/advanced/auth/better-auth/auth0.mdxnew file mode 100644index 00000000000..757619cefd0--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/auth0.mdx@@ -0,0 +1,111 @@+---+title: Configuring Auth0 Authentication for LobeChat+description: >-+ Learn how to configure Auth0 SSO for LobeChat, including creating+ applications, adding users, and setting up environment variables.+tags:+ - Auth0+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring Auth0 Authentication++<Steps>+ ### Create Auth0 Application++ 1. Go to [Auth0 Dashboard](https://manage.auth0.com/dashboard)+ 2. Click **Applications** > **Create Application**++ <Image alt="Create Auth0 Application S1" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/f068190f-0027-4d3b-8667-d632e43d5a86" />++ 3. Fill in the application name+ 4. Select **Regular Web Applications** as the application type+ 5. Click **Create**++ <Image alt="Create Auth0 Application S2" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/3e0082df-9b6f-46f3-b67f-bdc79e1eb2cc" />++ ### Configure Application Settings++ After creation, go to the **Settings** tab:++ <Image alt="Create Auth0 Application S3" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/df4cea85-616a-46f5-b2de-42725d9b82a6" />++ Note down:++ - **Domain** (e.g., `your-tenant.auth0.com`)+ - **Client ID**+ - **Client Secret**++ ### Configure Callback URL++ In **Allowed Callback URLs**, add:++ <Callout type={'info'}>+ Callback URL format:++ - Local development: `http://localhost:3210/api/auth/callback/auth0`+ - Production: `https://your-domain.com/api/auth/callback/auth0`+ </Callout>++ <Image alt="Create Auth0 Application S4" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/62fbd09f-a69a-4460-949b-0f6285fa65b9" />++ ### Add Users (Optional)++ Click **User Management** to create users for your organization.++ <Image alt="Add Users" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/0beda150-d0b6-43cf-a9f1-fce928b83a96" />++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `auth0` |+ | `AUTH_AUTH0_ID` | Required | Client ID |+ | `AUTH_AUTH0_SECRET` | Required | Client Secret |+ | `AUTH_AUTH0_ISSUER` | Required | `https://your-tenant.auth0.com` |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#auth0)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Auth0 and+ use LobeChat.+</Callout>++## Advanced Configuration++### Connect Existing SSO Services++If your organization has existing identity infrastructure, connect to SSO services in **Applications** > **SSO Integrations**.++Auth0 supports Azure AD, Slack, Google Workspace, Office 365, Zoom, and more. See [Auth0 SSO Integrations](https://marketplace.auth0.com/features/sso-integrations).++<Image alt="Connecting to Existing SSO Service" src="https://github.com/lobehub/lobe-chat/assets/30863298/9891347e-a338-4aa9-8714-f16c8dbcfcec" />++### Configure Social Login++Configure social login in **Authentication** > **Social**.++<Image alt="Configuring Social Login" src="https://github.com/lobehub/lobe-chat/assets/30863298/880749a6-5ba4-4e20-a968-b583a54de7fa" />++<Callout type={'warning'}>+ Social login by default allows anyone to authenticate. Configure blocking+ policies to restrict access.+</Callout>++<Callout type={'warning'}>+ When creating a GitHub connection, make sure to enable the **Email Address** permission in the **Attributes** section. LobeChat requires user email for authentication.++ <Image alt="GitHub Connection Email Permission" src="https://hub-apac-1.lobeobjects.space/docs/afdf22891dda3e5e44c690db184c548e.png" />+</Callout>++## Related Resources++- [Auth0 Dashboard](https://manage.auth0.com/dashboard)+- [Auth0 Documentation](https://auth0.com/docs)diff --git a/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdxnew file mode 100644index 00000000000..360bb01a5ad--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdx@@ -0,0 +1,107 @@+---+title: 在 LobeChat 中配置 Auth0 身份验证+description: 学习如何在 LobeChat 中配置 Auth0 SSO,包括创建应用、添加用户和设置环境变量。+tags:+ - Auth0+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置 Auth0 身份验证++<Steps>+ ### 创建 Auth0 应用++ 1. 前往 [Auth0 Dashboard](https://manage.auth0.com/dashboard)+ 2. 点击 **Applications** > **Create Application**++ <Image alt="创建 Auth0 应用 S1" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/f068190f-0027-4d3b-8667-d632e43d5a86" />++ 3. 填写应用名称+ 4. 选择 **Regular Web Applications** 作为应用类型+ 5. 点击 **Create**++ <Image alt="创建 Auth0 应用 S2" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/3e0082df-9b6f-46f3-b67f-bdc79e1eb2cc" />++ ### 配置应用设置++ 创建后,进入 **Settings** 标签页:++ <Image alt="创建 Auth0 应用 S3" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/df4cea85-616a-46f5-b2de-42725d9b82a6" />++ 记录:++ - **Domain**(如 `your-tenant.auth0.com`)+ - **Client ID**+ - **Client Secret**++ ### 配置回调 URL++ 在 **Allowed Callback URLs** 中添加:++ <Callout type={'info'}>+ 回调 URL 格式:++ - 本地开发: `http://localhost:3210/api/auth/callback/auth0`+ - 生产环境: `https://your-domain.com/api/auth/callback/auth0`+ </Callout>++ <Image alt="创建 Auth0 应用 S4" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/62fbd09f-a69a-4460-949b-0f6285fa65b9" />++ ### 添加用户(可选)++ 点击 **User Management** 为组织创建用户。++ <Image alt="添加用户" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/0beda150-d0b6-43cf-a9f1-fce928b83a96" />++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | -------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `auth0` |+ | `AUTH_AUTH0_ID` | 必选 | Client ID |+ | `AUTH_AUTH0_SECRET` | 必选 | Client Secret |+ | `AUTH_AUTH0_ISSUER` | 必选 | `https://your-tenant.auth0.com` |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#auth0)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过 Auth0 身份认证并使用 LobeChat。+</Callout>++## 高级配置++### 连接现有 SSO 服务++如果组织已有身份认证基础设施,在 **Applications** > **SSO Integrations** 中连接 SSO 服务。++Auth0 支持 Azure AD、Slack、Google Workspace、Office 365、Zoom 等。详见 [Auth0 SSO Integrations](https://marketplace.auth0.com/features/sso-integrations)。++<Image alt="连接现有 SSO 服务" src="https://github.com/lobehub/lobe-chat/assets/30863298/9891347e-a338-4aa9-8714-f16c8dbcfcec" />++### 配置社交登录++在 **Authentication** > **Social** 中配置社交登录。++<Image alt="配置社交登录" src="https://github.com/lobehub/lobe-chat/assets/30863298/880749a6-5ba4-4e20-a968-b583a54de7fa" />++<Callout type={'warning'}>+ 默认社交登录允许任何人认证。请配置阻止策略以限制访问。+</Callout>++<Callout type={'warning'}>+ 创建 GitHub 连接时,务必在 **Attributes** 部分勾选 **Email Address** 权限。LobeChat 需要用户邮箱进行身份认证。++ <Image alt="GitHub 连接邮箱权限" src="https://hub-apac-1.lobeobjects.space/docs/afdf22891dda3e5e44c690db184c548e.png" />+</Callout>++## 相关资源++- [Auth0 Dashboard](https://manage.auth0.com/dashboard)+- [Auth0 文档](https://auth0.com/docs)diff --git a/docs/self-hosting/advanced/auth/better-auth/authelia.mdx b/docs/self-hosting/advanced/auth/better-auth/authelia.mdxnew file mode 100644index 00000000000..e16bc30ea04--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/authelia.mdx@@ -0,0 +1,66 @@+---+title: Configuring Authelia Authentication for LobeChat+description: >-+ Learn how to configure Authelia SSO for LobeChat, including setting up OIDC+ client and environment variables.+tags:+ - Authelia+ - Authentication+ - LobeChat+ - Single Sign-On+ - OIDC+---++# Configuring Authelia Authentication++[Authelia](https://www.authelia.com/) is an open-source authentication and authorization server providing two-factor authentication and single sign-on.++<Steps>+ ### Configure OIDC Client in Authelia++ Add a new OIDC client in your Authelia configuration file:++ ```yaml+ identity_providers:+ oidc:+ clients:+ - client_id: 'lobechat'+ client_name: 'LobeChat'+ client_secret: 'your-client-secret'+ redirect_uris:+ - 'https://your-domain.com/api/auth/callback/authelia'+ scopes:+ - 'openid'+ - 'profile'+ - 'email'+ ```++ <Callout type={'info'}>+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/authelia`+ </Callout>++ ### Configure Environment Variables++ When deploying LobeChat, you need to configure the following environment variables:++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `authelia` for Authelia |+ | `AUTH_AUTHELIA_ID` | Required | Client ID configured in Authelia |+ | `AUTH_AUTHELIA_SECRET` | Required | Client Secret configured in Authelia |+ | `AUTH_AUTHELIA_ISSUER` | Required | Authelia issuer URL (e.g., `https://auth.your-domain.com`) |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#authelia) for detailed information on these variables.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Authelia and use LobeChat.+</Callout>++## Related Resources++- [Authelia Documentation](https://www.authelia.com/docs/)+- [Authelia OIDC Configuration](https://www.authelia.com/configuration/identity-providers/openid-connect/)diff --git a/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdxnew file mode 100644index 00000000000..abc989c5475--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdx@@ -0,0 +1,62 @@+---+title: 在 LobeChat 中配置 Authelia 身份验证+description: 学习如何在 LobeChat 中配置 Authelia SSO,包括设置 OIDC 客户端和环境变量。+tags:+ - Authelia+ - 身份验证+ - LobeChat+ - 单点登录+ - OIDC+---++# 配置 Authelia 身份验证++[Authelia](https://www.authelia.com/) 是一个开源的身份验证和授权服务器,提供双因素认证和单点登录功能。++<Steps>+ ### 在 Authelia 中配置 OIDC 客户端++ 在 Authelia 配置文件中添加新的 OIDC 客户端:++ ```yaml+ identity_providers:+ oidc:+ clients:+ - client_id: 'lobechat'+ client_name: 'LobeChat'+ client_secret: 'your-client-secret'+ redirect_uris:+ - 'https://your-domain.com/api/auth/callback/authelia'+ scopes:+ - 'openid'+ - 'profile'+ - 'email'+ ```++ <Callout type={'info'}>+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/authelia`+ </Callout>++ ### 配置环境变量++ 在部署 LobeChat 时,你需要配置以下环境变量:++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | ------------------------------------------------------ |+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Authelia 请填写 `authelia` |+ | `AUTH_AUTHELIA_ID` | 必选 | Authelia 中配置的 Client ID |+ | `AUTH_AUTHELIA_SECRET` | 必选 | Authelia 中配置的 Client Secret |+ | `AUTH_AUTHELIA_ISSUER` | 必选 | Authelia Issuer URL(例如 `https://auth.your-domain.com`) |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#authelia) 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>部署成功后,用户将可以通过 Authelia 身份认证并使用 LobeChat。</Callout>++## 相关资源++- [Authelia 文档](https://www.authelia.com/docs/)+- [Authelia OIDC 配置](https://www.authelia.com/configuration/identity-providers/openid-connect/)diff --git a/docs/self-hosting/advanced/auth/better-auth/authentik.mdx b/docs/self-hosting/advanced/auth/better-auth/authentik.mdxnew file mode 100644index 00000000000..579010cbd04--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/authentik.mdx@@ -0,0 +1,67 @@+---+title: Configuring Authentik Authentication for LobeChat+description: >-+ Learn how to configure Authentik SSO for LobeChat, including creating an+ OAuth2 provider and application.+tags:+ - Authentik+ - Authentication+ - LobeChat+ - Single Sign-On+ - OIDC+---++# Configuring Authentik Authentication++[Authentik](https://goauthentik.io/) is an open-source Identity Provider focused on flexibility and versatility.++<Steps>+ ### Create OAuth2 Provider in Authentik++ 1. In Authentik admin interface, go to **Applications** > **Providers**+ 2. Click **Create** and select **OAuth2/OpenID Provider**+ 3. Configure the provider:+ - Name: `LobeChat`+ - Authorization flow: Select your authorization flow+ - Client type: `Confidential`+ - Redirect URIs: Add your callback URL++ <Callout type={'info'}>+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/authentik`+ </Callout>++ ### Create Application++ 1. Go to **Applications** > **Applications**+ 2. Click **Create** and link it to the OAuth2 provider you created+ 3. Note down the **Client ID** and **Client Secret**++ ### Get Issuer URL++ The issuer URL is typically: `https://your-authentik-domain/application/o/your-app-slug/`++ ### Configure Environment Variables++ When deploying LobeChat, you need to configure the following environment variables:++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `authentik` for Authentik |+ | `AUTH_AUTHENTIK_ID` | Required | Client ID from Authentik provider |+ | `AUTH_AUTHENTIK_SECRET` | Required | Client Secret from Authentik provider |+ | `AUTH_AUTHENTIK_ISSUER` | Required | Authentik issuer URL |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#authentik) for detailed information on these variables.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Authentik and use LobeChat.+</Callout>++## Related Resources++- [Authentik Documentation](https://docs.goauthentik.io/)+- [Authentik OAuth2 Provider](https://docs.goauthentik.io/docs/providers/oauth2/)diff --git a/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdxnew file mode 100644index 00000000000..33814b11cda--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdx@@ -0,0 +1,63 @@+---+title: 在 LobeChat 中配置 Authentik 身份验证+description: 学习如何在 LobeChat 中配置 Authentik SSO,包括创建 OAuth2 提供商和应用。+tags:+ - Authentik+ - 身份验证+ - LobeChat+ - 单点登录+ - OIDC+---++# 配置 Authentik 身份验证++[Authentik](https://goauthentik.io/) 是一个开源身份提供商,专注于灵活性和多功能性。++<Steps>+ ### 在 Authentik 中创建 OAuth2 提供商++ 1. 在 Authentik 管理界面,前往 **Applications** > **Providers**+ 2. 点击 **Create**,选择 **OAuth2/OpenID Provider**+ 3. 配置提供商:+ - Name: `LobeChat`+ - Authorization flow: 选择授权流程+ - Client type: `Confidential`+ - Redirect URIs: 添加回调 URL++ <Callout type={'info'}>+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/authentik`+ </Callout>++ ### 创建应用++ 1. 前往 **Applications** > **Applications**+ 2. 点击 **Create**,关联到刚创建的 OAuth2 提供商+ 3. 记下 **Client ID** 和 **Client Secret**++ ### 获取 Issuer URL++ Issuer URL 通常为:`https://your-authentik-domain/application/o/your-app-slug/`++ ### 配置环境变量++ 在部署 LobeChat 时,你需要配置以下环境变量:++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | ---------------------------------------------- |+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Authentik 请填写 `authentik` |+ | `AUTH_AUTHENTIK_ID` | 必选 | Authentik 提供商的 Client ID |+ | `AUTH_AUTHENTIK_SECRET` | 必选 | Authentik 提供商的 Client Secret |+ | `AUTH_AUTHENTIK_ISSUER` | 必选 | Authentik Issuer URL |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#authentik) 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>部署成功后,用户将可以通过 Authentik 身份认证并使用 LobeChat。</Callout>++## 相关资源++- [Authentik 文档](https://docs.goauthentik.io/)+- [Authentik OAuth2 提供商](https://docs.goauthentik.io/docs/providers/oauth2/)diff --git a/docs/self-hosting/advanced/auth/better-auth/casdoor.mdx b/docs/self-hosting/advanced/auth/better-auth/casdoor.mdxnew file mode 100644index 00000000000..0bc2988322e--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/casdoor.mdx@@ -0,0 +1,62 @@+---+title: Configuring Casdoor Authentication for LobeChat+description: >-+ Learn how to configure Casdoor SSO for LobeChat, including creating an+ application and setting up environment variables.+tags:+ - Casdoor+ - Authentication+ - LobeChat+ - Single Sign-On+ - OIDC+---++# Configuring Casdoor Authentication++[Casdoor](https://casdoor.org/) is an open-source Identity Access Management (IAM) platform with web UI for SSO.++<Steps>+ ### Create Application in Casdoor++ 1. Log in to your Casdoor admin console+ 2. Go to **Applications** and click **Add**+ 3. Configure the application:+ - Name: `LobeChat`+ - Organization: Select your organization+ - Redirect URLs: Add your callback URL++ <Callout type={'info'}>+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/casdoor`+ </Callout>++ 4. Save and note down the **Client ID** and **Client Secret**++ ### Get Issuer URL++ The issuer URL is your Casdoor server URL, typically: `https://your-casdoor-domain`++ ### Configure Environment Variables++ When deploying LobeChat, you need to configure the following environment variables:++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `casdoor` for Casdoor |+ | `AUTH_CASDOOR_ID` | Required | Client ID from Casdoor application |+ | `AUTH_CASDOOR_SECRET` | Required | Client Secret from Casdoor application |+ | `AUTH_CASDOOR_ISSUER` | Required | Casdoor server URL (e.g., `https://your-casdoor-domain`) |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#casdoor) for detailed information on these variables.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Casdoor and use LobeChat.+</Callout>++## Related Resources++- [Casdoor Documentation](https://casdoor.org/docs/overview)+- [Casdoor Application Configuration](https://casdoor.org/docs/application/config)diff --git a/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdxnew file mode 100644index 00000000000..db1ac0c5a57--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdx@@ -0,0 +1,58 @@+---+title: 在 LobeChat 中配置 Casdoor 身份验证+description: 学习如何在 LobeChat 中配置 Casdoor SSO,包括创建应用和设置环境变量。+tags:+ - Casdoor+ - 身份验证+ - LobeChat+ - 单点登录+ - OIDC+---++# 配置 Casdoor 身份验证++[Casdoor](https://casdoor.org/) 是一个开源的身份访问管理 (IAM) 平台,提供 Web UI 支持单点登录。++<Steps>+ ### 在 Casdoor 中创建应用++ 1. 登录 Casdoor 管理控制台+ 2. 前往 **Applications**,点击 **Add**+ 3. 配置应用:+ - Name: `LobeChat`+ - Organization: 选择你的组织+ - Redirect URLs: 添加回调 URL++ <Callout type={'info'}>+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/casdoor`+ </Callout>++ 4. 保存并记下 **Client ID** 和 **Client Secret**++ ### 获取 Issuer URL++ Issuer URL 是 Casdoor 服务器 URL,通常为:`https://your-casdoor-domain`++ ### 配置环境变量++ 在部署 LobeChat 时,你需要配置以下环境变量:++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | ------------------------------------------------- |+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Casdoor 请填写 `casdoor` |+ | `AUTH_CASDOOR_ID` | 必选 | Casdoor 应用的 Client ID |+ | `AUTH_CASDOOR_SECRET` | 必选 | Casdoor 应用的 Client Secret |+ | `AUTH_CASDOOR_ISSUER` | 必选 | Casdoor 服务器 URL(例如 `https://your-casdoor-domain`) |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#casdoor) 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>部署成功后,用户将可以通过 Casdoor 身份认证并使用 LobeChat。</Callout>++## 相关资源++- [Casdoor 文档](https://casdoor.org/docs/overview)+- [Casdoor 应用配置](https://casdoor.org/docs/application/config)diff --git a/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdx b/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdxnew file mode 100644index 00000000000..2d19ecf374c--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdx@@ -0,0 +1,59 @@+---+title: Configuring Cloudflare Zero Trust Authentication for LobeChat+description: >-+ Learn how to configure Cloudflare Zero Trust SSO for LobeChat, including+ creating an Access application.+tags:+ - Cloudflare Zero Trust+ - Authentication+ - LobeChat+ - Single Sign-On+ - OIDC+---++# Configuring Cloudflare Zero Trust Authentication++[Cloudflare Zero Trust](https://www.cloudflare.com/zero-trust/) provides secure access to your applications without a VPN.++<Steps>+ ### Create Access Application++ 1. Log in to [Cloudflare Zero Trust Dashboard](https://one.dash.cloudflare.com/)+ 2. Go to **Access** > **Applications**+ 3. Click **Add an application** and select **SaaS**+ 4. Configure the application:+ - Application name: `LobeChat`+ - Select OIDC as the authentication protocol+ - Add the callback URL in redirect URIs++ <Callout type={'info'}>+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/cloudflare-zero-trust`+ </Callout>++ 5. Note down the **Client ID**, **Client Secret**, and **Issuer URL**++ ### Configure Environment Variables++ When deploying LobeChat, you need to configure the following environment variables:++ | Environment Variable | Type | Description |+ | ----------------------------------- | -------- | ----------------------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `cloudflare-zero-trust` |+ | `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | Required | Client ID from Cloudflare Access |+ | `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | Required | Client Secret from Cloudflare Access |+ | `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | Required | Issuer URL (e.g., `https://your-team.cloudflareaccess.com`) |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#cloudflare-zero-trust) for detailed information on these variables.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Cloudflare Zero Trust and use LobeChat.+</Callout>++## Related Resources++- [Cloudflare Zero Trust Documentation](https://developers.cloudflare.com/cloudflare-one/)+- [Configure OIDC Application](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/generic-oidc/)diff --git a/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdxnew file mode 100644index 00000000000..f9609734eba--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdx@@ -0,0 +1,55 @@+---+title: 在 LobeChat 中配置 Cloudflare Zero Trust 身份验证+description: 学习如何在 LobeChat 中配置 Cloudflare Zero Trust SSO,包括创建 Access 应用。+tags:+ - Cloudflare Zero Trust+ - 身份验证+ - LobeChat+ - 单点登录+ - OIDC+---++# 配置 Cloudflare Zero Trust 身份验证++[Cloudflare Zero Trust](https://www.cloudflare.com/zero-trust/) 无需 VPN 即可提供应用程序的安全访问。++<Steps>+ ### 创建 Access 应用++ 1. 登录 [Cloudflare Zero Trust Dashboard](https://one.dash.cloudflare.com/)+ 2. 前往 **Access** > **Applications**+ 3. 点击 **Add an application**,选择 **SaaS**+ 4. 配置应用:+ - Application name: `LobeChat`+ - 选择 OIDC 作为认证协议+ - 在 redirect URIs 中添加回调 URL++ <Callout type={'info'}>+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/cloudflare-zero-trust`+ </Callout>++ 5. 记下 **Client ID**、**Client Secret** 和 **Issuer URL**++ ### 配置环境变量++ 在部署 LobeChat 时,你需要配置以下环境变量:++ | 环境变量 | 类型 | 描述 |+ | ----------------------------------- | -- | ------------------------------------------------------- |+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。填写 `cloudflare-zero-trust` |+ | `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | 必选 | Cloudflare Access 的 Client ID |+ | `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | 必选 | Cloudflare Access 的 Client Secret |+ | `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | 必选 | Issuer URL(例如 `https://your-team.cloudflareaccess.com`) |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#cloudflare-zero-trust) 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>部署成功后,用户将可以通过 Cloudflare Zero Trust 身份认证并使用 LobeChat。</Callout>++## 相关资源++- [Cloudflare Zero Trust 文档](https://developers.cloudflare.com/cloudflare-one/)+- [配置 OIDC 应用](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/generic-oidc/)diff --git a/docs/self-hosting/advanced/auth/better-auth/cognito.mdx b/docs/self-hosting/advanced/auth/better-auth/cognito.mdxnew file mode 100644index 00000000000..f7eb1e7e5b3--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/cognito.mdx@@ -0,0 +1,88 @@+---+title: Configuring AWS Cognito Authentication for LobeChat+description: >-+ Learn how to configure AWS Cognito SSO for LobeChat, including creating a User+ Pool and App Client in AWS Console.+tags:+ - AWS Cognito+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring AWS Cognito Authentication++<Steps>+ ### Create a Cognito User Pool++ 1. Go to [AWS Cognito Console](https://console.aws.amazon.com/cognito/)+ 2. Click **Create user pool**+ 3. Configure sign-in experience:+ - Select **Email** as the sign-in option+ - Configure password policy and MFA settings as needed+ - Configure user account recovery options++ ### Configure App Client++ In the **App integration** section:++ 1. Click **Add an app client**+ 2. Select **Confidential client** as the app type+ 3. Enter a name for the app client+ 4. Under **OAuth 2.0 grant types**, enable **Authorization code grant**+ 5. Under **OpenID Connect scopes**, select `email`, `openid`, and `profile`++ ### Configure Callback URL++ In the app client settings, add the callback URL:++ <Callout type={'info'}>+ Callback URL format:++ - Local development: `http://localhost:3210/api/auth/callback/cognito`+ - Production: `https://your-domain.com/api/auth/callback/cognito`+ </Callout>++ ### Configure Domain++ 1. Go to **App integration** > **Domain**+ 2. Configure a Cognito domain (e.g., `your-app-name`) or custom domain+ 3. Note your full domain (e.g., `your-app-name.auth.us-east-1.amazoncognito.com`)++ ### Get Configuration Values++ Collect the following:++ - **Client ID**: From App client settings+ - **Client Secret**: From App client settings (click "Show client secret")+ - **User Pool ID**: From User pool overview (e.g., `us-east-1_XXXXXXXXX`)+ - **Region**: AWS region (e.g., `us-east-1`)+ - **Domain**: Your Cognito domain++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | ------------------------------------------------------------------ |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `cognito` |+ | `AUTH_COGNITO_ID` | Required | App Client ID |+ | `AUTH_COGNITO_SECRET` | Required | App Client Secret |+ | `AUTH_COGNITO_DOMAIN` | Required | Cognito domain (e.g., `your-app.auth.us-east-1.amazoncognito.com`) |+ | `AUTH_COGNITO_REGION` | Required | AWS Region (e.g., `us-east-1`) |+ | `AUTH_COGNITO_USERPOOL_ID` | Required | User Pool ID (e.g., `us-east-1_XXXXXXXXX`) |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#cognito)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with AWS+ Cognito and use LobeChat.+</Callout>++## Related Resources++- [AWS Cognito Console](https://console.aws.amazon.com/cognito/)+- [Amazon Cognito Documentation](https://docs.aws.amazon.com/cognito/)diff --git a/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdxnew file mode 100644index 00000000000..de161cb9aa2--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdx@@ -0,0 +1,85 @@+---+title: 在 LobeChat 中配置 AWS Cognito 身份验证+description: 学习如何在 LobeChat 中配置 AWS Cognito SSO,包括在 AWS Console 创建用户池和应用客户端。+tags:+ - AWS Cognito+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置 AWS Cognito 身份验证++<Steps>+ ### 创建 Cognito 用户池++ 1. 前往 [AWS Cognito Console](https://console.aws.amazon.com/cognito/)+ 2. 点击 **Create user pool**+ 3. 配置登录体验:+ - 选择 **Email** 作为登录选项+ - 根据需要配置密码策略和 MFA 设置+ - 配置用户账户恢复选项++ ### 配置应用客户端++ 在 **App integration** 部分:++ 1. 点击 **Add an app client**+ 2. 选择 **Confidential client** 作为应用类型+ 3. 输入应用客户端名称+ 4. 在 **OAuth 2.0 grant types** 下,启用 **Authorization code grant**+ 5. 在 **OpenID Connect scopes** 下,选择 `email`、`openid` 和 `profile`++ ### 配置回调 URL++ 在应用客户端设置中,添加回调 URL:++ <Callout type={'info'}>+ 回调 URL 格式:++ - 本地开发: `http://localhost:3210/api/auth/callback/cognito`+ - 生产环境: `https://your-domain.com/api/auth/callback/cognito`+ </Callout>++ ### 配置域名++ 1. 前往 **App integration** > **Domain**+ 2. 配置 Cognito 域名(如 `your-app-name`)或自定义域名+ 3. 记录完整域名(如 `your-app-name.auth.us-east-1.amazoncognito.com`)++ ### 获取配置值++ 收集以下信息:++ - **Client ID**:来自应用客户端设置+ - **Client Secret**:来自应用客户端设置(点击 "Show client secret")+ - **User Pool ID**:来自用户池概览(如 `us-east-1_XXXXXXXXX`)+ - **Region**:AWS 区域(如 `us-east-1`)+ - **Domain**:你的 Cognito 域名++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | --------------------------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `cognito` |+ | `AUTH_COGNITO_ID` | 必选 | 应用客户端 ID |+ | `AUTH_COGNITO_SECRET` | 必选 | 应用客户端 Secret |+ | `AUTH_COGNITO_DOMAIN` | 必选 | Cognito 域名(如 `your-app.auth.us-east-1.amazoncognito.com`) |+ | `AUTH_COGNITO_REGION` | 必选 | AWS 区域(如 `us-east-1`) |+ | `AUTH_COGNITO_USERPOOL_ID` | 必选 | 用户池 ID(如 `us-east-1_XXXXXXXXX`) |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#cognito)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过 AWS Cognito 身份认证并使用 LobeChat。+</Callout>++## 相关资源++- [AWS Cognito Console](https://console.aws.amazon.com/cognito/)+- [Amazon Cognito 文档](https://docs.aws.amazon.com/cognito/)diff --git a/docs/self-hosting/advanced/auth/better-auth/feishu.mdx b/docs/self-hosting/advanced/auth/better-auth/feishu.mdxnew file mode 100644index 00000000000..b4a20900895--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/feishu.mdx@@ -0,0 +1,73 @@+---+title: Configuring Feishu (Lark) Authentication for LobeChat+description: >-+ Learn how to configure Feishu (Lark) SSO for LobeChat, including creating an+ application and setting up environment variables.+tags:+ - Feishu+ - Lark+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring Feishu (Lark) Authentication++[Feishu](https://www.feishu.cn/) (also known as Lark internationally) is an enterprise collaboration platform by ByteDance.++<Steps>+ ### Create Application in Feishu Open Platform++ 1. Go to [Feishu Open Platform](https://open.feishu.cn/)+ 2. Click **Create App** > **Enterprise Self-built App**+ 3. Fill in the app name and description+ 4. After creation, go to **Credentials & Basic Info** to get:+ - **App ID**+ - **App Secret**++ ### Configure OAuth Permissions++ 1. In app settings, go to **Security Settings**+ 2. Add the redirect URI++ <Callout type={'info'}>+ Callback URL format:++ - Local development: `http://localhost:3210/api/auth/callback/feishu`+ - Production: `https://your-domain.com/api/auth/callback/feishu`+ </Callout>++ 3. Go to **Permissions & Scopes** and add:+ - `contact:user.email:readonly` (read user email)+ - `contact:user.base:readonly` (read basic user info)++ ### Publish the Application++ 1. Go to **Version Management & Release**+ 2. Create a new version and submit for review+ 3. Once approved, publish the app++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `feishu` |+ | `AUTH_FEISHU_APP_ID` | Required | App ID from Feishu Open Platform |+ | `AUTH_FEISHU_APP_SECRET` | Required | App Secret from Feishu Open Platform |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#feishu)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Feishu+ and use LobeChat.+</Callout>++## Related Resources++- [Feishu Open Platform](https://open.feishu.cn/)+- [Feishu OAuth 2.0 Guide](https://open.feishu.cn/document/common-capabilities/sso/web-application-sso/web-app-overview)diff --git a/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdxnew file mode 100644index 00000000000..df401b10ab2--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdx@@ -0,0 +1,69 @@+---+title: 在 LobeChat 中配置飞书身份验证+description: 学习如何在 LobeChat 中配置飞书 SSO,包括创建应用和设置环境变量。+tags:+ - 飞书+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置飞书身份验证++[飞书](https://www.feishu.cn/) 是字节跳动推出的企业协作平台。++<Steps>+ ### 在飞书开放平台创建应用++ 1. 前往 [飞书开放平台](https://open.feishu.cn/)+ 2. 点击 **创建应用** > **企业自建应用**+ 3. 填写应用名称和描述+ 4. 创建后,前往 **凭证与基础信息** 获取:+ - **App ID**+ - **App Secret**++ ### 配置 OAuth 权限++ 1. 在应用设置中,前往 **安全设置**+ 2. 添加重定向 URI++ <Callout type={'info'}>+ 回调 URL 格式:++ - 本地开发: `http://localhost:3210/api/auth/callback/feishu`+ - 生产环境: `https://your-domain.com/api/auth/callback/feishu`+ </Callout>++ 3. 前往 **权限管理** 添加:+ - `contact:user.email:readonly`(读取用户邮箱)+ - `contact:user.base:readonly`(读取用户基本信息)++ ### 发布应用++ 1. 前往 **版本管理与发布**+ 2. 创建新版本并提交审核+ 3. 审核通过后,发布应用++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | -------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `feishu` |+ | `AUTH_FEISHU_APP_ID` | 必选 | 飞书开放平台的 App ID |+ | `AUTH_FEISHU_APP_SECRET` | 必选 | 飞书开放平台的 App Secret |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#feishu)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过飞书身份认证并使用 LobeChat。+</Callout>++## 相关资源++- [飞书开放平台](https://open.feishu.cn/)+- [飞书 OAuth 2.0 指南](https://open.feishu.cn/document/common-capabilities/sso/web-application-sso/web-app-overview)diff --git a/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdx b/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdxnew file mode 100644index 00000000000..e1ce429ca85--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdx@@ -0,0 +1,86 @@+---+title: Configuring Generic OIDC Authentication for LobeChat+description: >-+ Learn how to configure any OpenID Connect provider for LobeChat using Generic+ OIDC integration.+tags:+ - Generic OIDC+ - OpenID Connect+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring Generic OIDC Authentication++Use Generic OIDC to integrate LobeChat with any OpenID Connect compliant identity provider not explicitly listed in our supported providers.++<Steps>+ ### Configure Your OIDC Provider++ In your identity provider's admin console:++ 1. Create a new OIDC/OAuth2 application+ 2. Set the application type to **Web Application** or **Confidential Client**+ 3. Enable required scopes: `openid`, `profile`, `email`+ 4. Note down **Client ID** and **Client Secret**++ ### Configure Redirect URI++ Add the callback URL to your OIDC provider:++ <Callout type={'info'}>+ Callback URL format:++ - Local development: `http://localhost:3210/api/auth/callback/generic-oidc`+ - Production: `https://your-domain.com/api/auth/callback/generic-oidc`+ </Callout>++ ### Find Your Issuer URL++ The issuer URL is typically found in your provider's OIDC discovery document:++ ```+ https://your-provider/.well-known/openid-configuration+ ```++ Look for the `issuer` field in the JSON response.++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `generic-oidc` |+ | `AUTH_GENERIC_OIDC_ID` | Required | Client ID |+ | `AUTH_GENERIC_OIDC_SECRET` | Required | Client Secret |+ | `AUTH_GENERIC_OIDC_ISSUER` | Required | OIDC issuer URL (e.g., `https://your-provider.com`) |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#generic-oidc)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with your OIDC+ provider and use LobeChat.+</Callout>++## Troubleshooting++### Common Issues++1. **Invalid redirect URI**: Ensure the callback URL exactly matches what you configured in your provider+2. **Missing scopes**: Make sure `openid`, `profile`, and `email` scopes are enabled+3. **Invalid issuer**: The issuer URL must match exactly what's in the OIDC discovery document++### Testing OIDC Configuration++Verify your OIDC configuration by accessing:++```+https://your-provider/.well-known/openid-configuration+```++This should return a JSON document with all required endpoints.diff --git a/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdxnew file mode 100644index 00000000000..a14c7a3baf9--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdx@@ -0,0 +1,83 @@+---+title: 在 LobeChat 中配置 Generic OIDC 身份验证+description: 学习如何使用 Generic OIDC 集成将 LobeChat 与任何 OpenID Connect 提供商对接。+tags:+ - Generic OIDC+ - OpenID Connect+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置 Generic OIDC 身份验证++使用 Generic OIDC 可以将 LobeChat 与任何符合 OpenID Connect 标准的身份提供商集成,适用于不在我们支持列表中的提供商。++<Steps>+ ### 配置你的 OIDC 提供商++ 在身份提供商的管理控制台中:++ 1. 创建新的 OIDC/OAuth2 应用+ 2. 设置应用类型为 **Web Application** 或 **Confidential Client**+ 3. 启用必需的 scopes:`openid`、`profile`、`email`+ 4. 记下 **Client ID** 和 **Client Secret**++ ### 配置重定向 URI++ 在 OIDC 提供商中添加回调 URL:++ <Callout type={'info'}>+ 回调 URL 格式:++ - 本地开发: `http://localhost:3210/api/auth/callback/generic-oidc`+ - 生产环境: `https://your-domain.com/api/auth/callback/generic-oidc`+ </Callout>++ ### 查找 Issuer URL++ Issuer URL 通常在提供商的 OIDC 发现文档中:++ ```+ https://your-provider/.well-known/openid-configuration+ ```++ 在 JSON 响应中查找 `issuer` 字段。++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | ---------------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `generic-oidc` |+ | `AUTH_GENERIC_OIDC_ID` | 必选 | Client ID |+ | `AUTH_GENERIC_OIDC_SECRET` | 必选 | Client Secret |+ | `AUTH_GENERIC_OIDC_ISSUER` | 必选 | OIDC Issuer URL(如 `https://your-provider.com`) |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#generic-oidc)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过你的 OIDC 提供商身份认证并使用 LobeChat。+</Callout>++## 故障排除++### 常见问题++1. **无效的重定向 URI**:确保回调 URL 与提供商中配置的完全匹配+2. **缺少 scopes**:确保 `openid`、`profile` 和 `email` scopes 已启用+3. **无效的 issuer**:Issuer URL 必须与 OIDC 发现文档中的完全匹配++### 测试 OIDC 配置++通过访问以下地址验证 OIDC 配置:++```+https://your-provider/.well-known/openid-configuration+```++这应该返回包含所有必需端点的 JSON 文档。diff --git a/docs/self-hosting/advanced/auth/better-auth/github.mdx b/docs/self-hosting/advanced/auth/better-auth/github.mdxnew file mode 100644index 00000000000..760a7a891ec--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/github.mdx@@ -0,0 +1,93 @@+---+title: Configuring GitHub Authentication for LobeChat+description: >-+ Learn how to configure GitHub SSO for LobeChat, including creating a GitHub+ App, setting up environment variables, and deployment.+tags:+ - GitHub+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring GitHub Authentication++<Steps>+ ### Create a GitHub App++ 1. Go to [GitHub Developer Settings](https://github.com/settings/apps/new)+ 2. Fill in the **GitHub App name** and **Homepage URL**++ <Image alt="Create a GitHub App" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/2f919f99-2aaa-4fa7-9938-169d3ed09db7" />++ ### Configure Callback URL++ <Callout type={'info'}>+ Callback URL format:++ - Local development: `http://localhost:3210/api/auth/callback/github`+ - Production: `https://your-domain.com/api/auth/callback/github`+ </Callout>++ Set the Webhook URL according to your needs (can be disabled if not used).++ <Image alt="Fill in other fields" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/d7ef5ad1-b1a3-435e-b1bc-4436d2b6fecd" />++ ### Configure Permissions++ Set permission to read user email addresses:++ <Image alt="Set required permissions" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/23131ca1-9e84-4a89-a840-ef79c4bc0251" />++ <Image alt="Set permission to read email addresses" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/358bca8d-3d82-4e76-9a5e-90d16a39efde" />++ Set whether the app is publicly accessible or only accessible to yourself.++ <Image alt="Set accessibility" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/995780cb-9096-4a36-ab17-d422703ab970" />++ Click **Create GitHub App**.++ ### Generate Client Secret++ After creation, click **Generate a new client secret**.++ <Image alt="Create a new client secret" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/6d69bdca-7d18-4cbc-b3e0-220d8815cd29" />++ Save the **Client ID** and **Client Secret**.++ <Image alt="Save credentials" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/c6108133-a918-48b0-ab1a-e3fa607572a4" />++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `github` |+ | `AUTH_GITHUB_ID` | Required | Client ID from the GitHub App |+ | `AUTH_GITHUB_SECRET` | Required | Client Secret from the GitHub App |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#github)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with GitHub+ and use LobeChat.+</Callout>++## Common Issues++### email\_not\_found Error++This usually happens when the GitHub App doesn't have email read permission. Go to your app settings, navigate to **Permissions & events** > **Account permissions** > **Email addresses** and set it to **Read-only**.++### No Refresh Token++GitHub OAuth does not issue refresh tokens. Access tokens remain valid until the user revokes access, the app revokes access, or the token hasn't been used for one year.++## Related Resources++- [GitHub Developer Settings](https://github.com/settings/developers)+- [GitHub Apps Documentation](https://docs.github.com/en/apps)diff --git a/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdxnew file mode 100644index 00000000000..8d93621eaaa--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdx@@ -0,0 +1,90 @@+---+title: 在 LobeChat 中配置 GitHub 身份验证+description: 学习如何在 LobeChat 中配置 GitHub SSO,包括创建 GitHub App、设置环境变量和部署。+tags:+ - GitHub+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置 GitHub 身份验证++<Steps>+ ### 创建 GitHub App++ 1. 前往 [GitHub 开发者设置](https://github.com/settings/apps/new)+ 2. 填写 **GitHub App name** 和 **Homepage URL**++ <Image alt="创建 GitHub App" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/2f919f99-2aaa-4fa7-9938-169d3ed09db7" />++ ### 配置回调 URL++ <Callout type={'info'}>+ 回调 URL 格式:++ - 本地开发: `http://localhost:3210/api/auth/callback/github`+ - 生产环境: `https://your-domain.com/api/auth/callback/github`+ </Callout>++ 按需设置 Webhook URL(不需要可禁用)。++ <Image alt="填写其他字段" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/d7ef5ad1-b1a3-435e-b1bc-4436d2b6fecd" />++ ### 配置权限++ 设置读取用户邮箱地址的权限:++ <Image alt="设置所需权限" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/23131ca1-9e84-4a89-a840-ef79c4bc0251" />++ <Image alt="设置读取邮件地址权限" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/358bca8d-3d82-4e76-9a5e-90d16a39efde" />++ 设置公开访问还是仅自己访问。++ <Image alt="设置访问权限" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/995780cb-9096-4a36-ab17-d422703ab970" />++ 点击 **Create GitHub App**。++ ### 生成客户端密钥++ 创建成功后,点击 **Generate a new client secret**。++ <Image alt="创建客户端密钥" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/6d69bdca-7d18-4cbc-b3e0-220d8815cd29" />++ 保存 **Client ID** 和 **Client Secret**。++ <Image alt="保存凭证" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/c6108133-a918-48b0-ab1a-e3fa607572a4" />++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | -------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `github` |+ | `AUTH_GITHUB_ID` | 必选 | GitHub App 的 Client ID |+ | `AUTH_GITHUB_SECRET` | 必选 | GitHub App 的 Client Secret |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#github)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过 GitHub 身份认证并使用 LobeChat。+</Callout>++## 常见问题++### email\_not\_found 错误++这通常是因为 GitHub App 没有邮箱读取权限。前往应用设置,导航到 **Permissions & events** > **Account permissions** > **Email addresses**,设置为 **Read-only**。++### 没有 Refresh Token++GitHub OAuth 不发放 refresh token。访问令牌在用户撤销、应用撤销或一年未使用前会一直有效。++## 相关资源++- [GitHub 开发者设置](https://github.com/settings/developers)+- [GitHub Apps 文档](https://docs.github.com/en/apps)diff --git a/docs/self-hosting/advanced/auth/better-auth/google.mdx b/docs/self-hosting/advanced/auth/better-auth/google.mdxnew file mode 100644index 00000000000..81e2d3f6b7b--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/google.mdx@@ -0,0 +1,80 @@+---+title: Configuring Google Authentication for LobeChat+description: >-+ Learn how to configure Google SSO for LobeChat, including creating OAuth+ credentials in Google Cloud Console and setting up environment variables.+tags:+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring Google Authentication++<Steps>+ ### Create Google OAuth Credentials++ 1. Go to [Google Cloud Console](https://console.cloud.google.com/apis/credentials)+ 2. Create a new project or select an existing one+ 3. Click **Create Credentials** > **OAuth client ID**+ 4. If this is your first time, configure the OAuth consent screen first (see below)+ 5. Select **Web application** as the application type+ 6. Add authorized redirect URIs (see callback URL configuration below)+ 7. Click Create and save the **Client ID** and **Client Secret**++ ### Configure OAuth Consent Screen++ 1. Go to **APIs & Services** > **OAuth consent screen**+ 2. Choose user type:+ - **External**: For any Google account+ - **Internal**: For Google Workspace organization users only+ 3. Fill in required information: app name, user support email, etc.+ 4. Add scopes: `email` and `profile`+ 5. If in testing mode, add test users++ ### Configure Callback URL++ Add to authorized redirect URIs:++ <Callout type={'info'}>+ Callback URL format:++ - Local development: `http://localhost:3210/api/auth/callback/google`+ - Production: `https://your-domain.com/api/auth/callback/google`+ </Callout>++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `google` |+ | `AUTH_GOOGLE_ID` | Required | Client ID from Google Cloud Console |+ | `AUTH_GOOGLE_SECRET` | Required | Client Secret from Google Cloud Console |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#google)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Google+ and use LobeChat.+</Callout>++## Common Issues++### redirect\_uri\_mismatch Error++Ensure the callback URL configured in Google Cloud Console exactly matches your deployment address, including the protocol (http/https) and port number.++### Testing Mode Limitations++If the OAuth consent screen is in testing mode, only Google accounts added as test users can sign in.++## Related Resources++- [Google Cloud Console](https://console.cloud.google.com/)+- [Google OAuth 2.0 Documentation](https://developers.google.com/identity/protocols/oauth2)diff --git a/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdxnew file mode 100644index 00000000000..6ed571884f9--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdx@@ -0,0 +1,77 @@+---+title: 在 LobeChat 中配置 Google 身份验证+description: 学习如何在 LobeChat 中配置 Google SSO,包括在 Google Cloud Console 创建 OAuth 凭证和设置环境变量。+tags:+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置 Google 身份验证++<Steps>+ ### 创建 Google OAuth 凭证++ 1. 前往 [Google Cloud Console](https://console.cloud.google.com/apis/credentials)+ 2. 创建新项目或选择现有项目+ 3. 点击 **Create Credentials** > **OAuth client ID**+ 4. 如果是首次创建,需先配置 OAuth 同意屏幕(见下方步骤)+ 5. 选择 **Web application** 作为应用类型+ 6. 添加授权重定向 URI(见下方回调 URL 配置)+ 7. 点击创建,保存 **Client ID** 和 **Client Secret**++ ### 配置 OAuth 同意屏幕++ 1. 前往 **APIs & Services** > **OAuth consent screen**+ 2. 选择用户类型:+ - **External**:适用于任何 Google 账户+ - **Internal**:仅限 Google Workspace 组织用户+ 3. 填写应用名称、用户支持邮箱等必填信息+ 4. 添加授权范围:`email` 和 `profile`+ 5. 如果处于测试模式,需添加测试用户++ ### 配置回调 URL++ 在授权重定向 URI 中添加:++ <Callout type={'info'}>+ 回调 URL 格式:++ - 本地开发: `http://localhost:3210/api/auth/callback/google`+ - 生产环境: `https://your-domain.com/api/auth/callback/google`+ </Callout>++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | -------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `google` |+ | `AUTH_GOOGLE_ID` | 必选 | Google Cloud Console 中的 Client ID |+ | `AUTH_GOOGLE_SECRET` | 必选 | Google Cloud Console 中的 Client Secret |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#google)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过 Google 身份认证并使用 LobeChat。+</Callout>++## 常见问题++### redirect\_uri\_mismatch 错误++确保 Google Cloud Console 中配置的回调 URL 与实际部署地址完全匹配,包括协议(http/https)和端口号。++### 测试模式限制++如果 OAuth 同意屏幕处于测试模式,只有添加为测试用户的 Google 账户才能登录。++## 相关资源++- [Google Cloud Console](https://console.cloud.google.com/)+- [Google OAuth 2.0 文档](https://developers.google.com/identity/protocols/oauth2)diff --git a/docs/self-hosting/advanced/auth/better-auth/keycloak.mdx b/docs/self-hosting/advanced/auth/better-auth/keycloak.mdxnew file mode 100644index 00000000000..709b7991786--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/keycloak.mdx@@ -0,0 +1,77 @@+---+title: Configuring Keycloak Authentication for LobeChat+description: >-+ Learn how to configure Keycloak SSO for LobeChat, including creating a client+ and setting up environment variables.+tags:+ - Keycloak+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring Keycloak Authentication++[Keycloak](https://www.keycloak.org/) is an open-source Identity and Access Management solution.++<Steps>+ ### Create Client in Keycloak++ 1. Log in to your Keycloak Admin Console+ 2. Select your realm (or create a new one)+ 3. Go to **Clients** > **Create client**+ 4. Configure the client:+ - **Client type**: `OpenID Connect`+ - **Client ID**: `lobechat` (or any name you prefer)+ 5. Click **Next**+ 6. Enable **Client authentication** (On)+ 7. Click **Next** and then **Save**++ ### Configure Redirect URI++ In the client **Settings** tab:++ 1. Add redirect URI under **Valid redirect URIs**++ <Callout type={'info'}>+ Callback URL format:++ - Local development: `http://localhost:3210/api/auth/callback/keycloak`+ - Production: `https://your-domain.com/api/auth/callback/keycloak`+ </Callout>++ ### Get Client Secret++ Go to the **Credentials** tab and copy the **Client secret**.++ ### Get Issuer URL++ The issuer URL format: `https://your-keycloak-domain/realms/your-realm`++ For example: `https://keycloak.example.com/realms/master`++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `keycloak` |+ | `AUTH_KEYCLOAK_ID` | Required | Client ID |+ | `AUTH_KEYCLOAK_SECRET` | Required | Client Secret |+ | `AUTH_KEYCLOAK_ISSUER` | Required | `https://your-keycloak-domain/realms/your-realm` |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#keycloak)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Keycloak+ and use LobeChat.+</Callout>++## Related Resources++- [Keycloak Documentation](https://www.keycloak.org/documentation)+- [Keycloak OpenID Connect Guide](https://www.keycloak.org/docs/latest/securing_apps/#_oidc)diff --git a/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdxnew file mode 100644index 00000000000..48da6cee8c4--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdx@@ -0,0 +1,74 @@+---+title: 在 LobeChat 中配置 Keycloak 身份验证+description: 学习如何在 LobeChat 中配置 Keycloak SSO,包括创建客户端和设置环境变量。+tags:+ - Keycloak+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置 Keycloak 身份验证++[Keycloak](https://www.keycloak.org/) 是一个开源的身份和访问管理解决方案。++<Steps>+ ### 在 Keycloak 中创建客户端++ 1. 登录 Keycloak 管理控制台+ 2. 选择你的 realm(或创建新的)+ 3. 前往 **Clients** > **Create client**+ 4. 配置客户端:+ - **Client type**: `OpenID Connect`+ - **Client ID**: `lobechat`(或任意名称)+ 5. 点击 **Next**+ 6. 启用 **Client authentication**(On)+ 7. 点击 **Next** 然后 **Save**++ ### 配置重定向 URI++ 在客户端 **Settings** 标签页中:++ 1. 在 **Valid redirect URIs** 下添加重定向 URI++ <Callout type={'info'}>+ 回调 URL 格式:++ - 本地开发: `http://localhost:3210/api/auth/callback/keycloak`+ - 生产环境: `https://your-domain.com/api/auth/callback/keycloak`+ </Callout>++ ### 获取客户端密钥++ 前往 **Credentials** 标签页复制 **Client secret**。++ ### 获取 Issuer URL++ Issuer URL 格式:`https://your-keycloak-domain/realms/your-realm`++ 例如:`https://keycloak.example.com/realms/master`++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | ------------------------------------------------ |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `keycloak` |+ | `AUTH_KEYCLOAK_ID` | 必选 | Client ID |+ | `AUTH_KEYCLOAK_SECRET` | 必选 | Client Secret |+ | `AUTH_KEYCLOAK_ISSUER` | 必选 | `https://your-keycloak-domain/realms/your-realm` |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#keycloak)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过 Keycloak 身份认证并使用 LobeChat。+</Callout>++## 相关资源++- [Keycloak 文档](https://www.keycloak.org/documentation)+- [Keycloak OpenID Connect 指南](https://www.keycloak.org/docs/latest/securing_apps/#_oidc)diff --git a/docs/self-hosting/advanced/auth/better-auth/logto.mdx b/docs/self-hosting/advanced/auth/better-auth/logto.mdxnew file mode 100644index 00000000000..8df44208b94--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/logto.mdx@@ -0,0 +1,64 @@+---+title: Configuring Logto Authentication for LobeChat+description: >-+ Learn how to configure Logto SSO for LobeChat, including creating an+ application and setting up environment variables.+tags:+ - Logto+ - Authentication+ - LobeChat+ - Single Sign-On+ - OIDC+---++# Configuring Logto Authentication++[Logto](https://logto.io/) is an open-source Auth0 alternative designed for modern apps and SaaS products.++<Steps>+ ### Create Application in Logto++ 1. Log in to your Logto Console+ 2. Go to **Applications** and click **Create application**+ 3. Select **Traditional web** as the application type+ 4. Fill in the application name: `LobeChat`+ 5. Configure redirect URIs:++ <Callout type={'info'}>+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/logto`+ </Callout>++ 6. After creation, note down the **App ID** and **App Secret**++ ### Get Issuer URL++ The issuer URL is your Logto endpoint, typically:++ - Cloud: `https://your-tenant.logto.app/oidc`+ - Self-hosted: `https://your-logto-domain/oidc`++ ### Configure Environment Variables++ When deploying LobeChat, you need to configure the following environment variables:++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `logto` for Logto |+ | `AUTH_LOGTO_ID` | Required | App ID from Logto application |+ | `AUTH_LOGTO_SECRET` | Required | App Secret from Logto application |+ | `AUTH_LOGTO_ISSUER` | Required | Logto issuer URL (e.g., `https://your-tenant.logto.app/oidc`) |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#logto) for detailed information on these variables.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Logto and use LobeChat.+</Callout>++## Related Resources++- [Logto Documentation](https://docs.logto.io/)+- [Logto Application Setup](https://docs.logto.io/docs/recipes/integrate-logto/)diff --git a/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdxnew file mode 100644index 00000000000..bf74ea33915--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdx@@ -0,0 +1,60 @@+---+title: 在 LobeChat 中配置 Logto 身份验证+description: 学习如何在 LobeChat 中配置 Logto SSO,包括创建应用和设置环境变量。+tags:+ - Logto+ - 身份验证+ - LobeChat+ - 单点登录+ - OIDC+---++# 配置 Logto 身份验证++[Logto](https://logto.io/) 是一个开源的 Auth0 替代方案,专为现代应用和 SaaS 产品设计。++<Steps>+ ### 在 Logto 中创建应用++ 1. 登录 Logto 控制台+ 2. 前往 **Applications**,点击 **Create application**+ 3. 选择 **Traditional web** 作为应用类型+ 4. 填写应用名称:`LobeChat`+ 5. 配置重定向 URI:++ <Callout type={'info'}>+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/logto`+ </Callout>++ 6. 创建后,记下 **App ID** 和 **App Secret**++ ### 获取 Issuer URL++ Issuer URL 是 Logto 端点,通常为:++ - 云版:`https://your-tenant.logto.app/oidc`+ - 自托管:`https://your-logto-domain/oidc`++ ### 配置环境变量++ 在部署 LobeChat 时,你需要配置以下环境变量:++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | --------------------------------------------------------- |+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Logto 请填写 `logto` |+ | `AUTH_LOGTO_ID` | 必选 | Logto 应用的 App ID |+ | `AUTH_LOGTO_SECRET` | 必选 | Logto 应用的 App Secret |+ | `AUTH_LOGTO_ISSUER` | 必选 | Logto Issuer URL(例如 `https://your-tenant.logto.app/oidc`) |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#logto) 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>部署成功后,用户将可以通过 Logto 身份认证并使用 LobeChat。</Callout>++## 相关资源++- [Logto 文档](https://docs.logto.io/)+- [Logto 应用设置](https://docs.logto.io/docs/recipes/integrate-logto/)diff --git a/docs/self-hosting/advanced/auth/better-auth/microsoft.mdx b/docs/self-hosting/advanced/auth/better-auth/microsoft.mdxnew file mode 100644index 00000000000..76f85589b5d--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/microsoft.mdx@@ -0,0 +1,113 @@+---+title: Configuring Microsoft Authentication for LobeChat+description: >-+ Learn how to configure Microsoft (Entra ID / Azure AD) SSO for LobeChat,+ including creating applications in Azure Portal and setting up environment+ variables.+tags:+ - Microsoft+ - Authentication+ - Azure AD+ - LobeChat+ - Single Sign-On+---++# Configuring Microsoft Authentication++<Steps>+ ### Create a Microsoft Entra ID Application++ 1. Go to [Microsoft Entra Admin Center](https://entra.microsoft.com/)+ 2. Navigate to **Identity** > **Applications** > **App registrations** > **New registration**+ 3. Fill in the application name+ 4. Choose supported account types:+ - **Single tenant**: Only users in your organization+ - **Multitenant**: Users in any Azure AD organization+ - **Multitenant + personal**: Also includes personal Microsoft accounts++ <Image alt="App Register" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/4f9d83bd-b3fc-4abc-bcf4-ccbad65c219d" />++ ### Configure Redirect URI++ In the **Redirect URI** section:++ 1. Select **Web** as the platform+ 2. Enter the callback URL++ <Callout type={'info'}>+ Callback URL format:++ - Local development: `http://localhost:3210/api/auth/callback/microsoft`+ - Production: `https://your-domain.com/api/auth/callback/microsoft`+ </Callout>++ Click **Register**.++ ### Get Application Credentials++ After creation, view the **Overview** tab:++ <Image alt="App Overview" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/48a0b702-05bd-4ce4-a007-a8ad00a36e5a" />++ Note down:++ - **Application (client) ID** - This is your `AUTH_MICROSOFT_ID`+ - **Directory (tenant) ID** - Needed for single-tenant apps++ ### Create Client Secret++ 1. Go to **Certificates & secrets** > **Client secrets**+ 2. Click **New client secret**+ 3. Fill in description and select expiration time+ 4. Click **Add**++ <Image alt="Create App Client Secret" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/c9d66fa0-158c-4bd3-a1fa-969e638259d2" />++ <Callout type={'warning'}>+ Copy the client secret **Value** immediately - you won't be able to see it+ again.+ </Callout>++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `microsoft` |+ | `AUTH_MICROSOFT_ID` | Required | Application (client) ID |+ | `AUTH_MICROSOFT_SECRET` | Required | Client secret value |++ <Callout type={'info'}>+ **Alternative Environment Variables**: For backward compatibility, these+ aliases are also supported:++ - `AUTH_MICROSOFT_ENTRA_ID_ID` / `AUTH_MICROSOFT_ENTRA_ID_SECRET`+ - `AUTH_AZURE_AD_ID` / `AUTH_AZURE_AD_SECRET`+ - `AZURE_AD_CLIENT_ID` / `AZURE_AD_CLIENT_SECRET`+ </Callout>++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#microsoft)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Microsoft+ and use LobeChat.+</Callout>++## Common Issues++### Tenant Configuration++By default, LobeChat uses `common` tenant which allows both organizational and personal Microsoft accounts. If you need single-tenant configuration, you may need to customize the tenant settings.++### Client Secret Expiration++Microsoft client secrets have a maximum validity of 24 months. Remember to rotate secrets before they expire.++## Related Resources++- [Microsoft Entra Admin Center](https://entra.microsoft.com/)+- [Quickstart: Register an application](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app)diff --git a/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdxnew file mode 100644index 00000000000..f97208b273a--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdx@@ -0,0 +1,109 @@+---+title: 在 LobeChat 中配置 Microsoft 身份验证+description: >-+ 学习如何在 LobeChat 中配置 Microsoft (Entra ID / Azure AD) SSO,包括在 Azure Portal+ 创建应用和设置环境变量。+tags:+ - Microsoft+ - 身份验证+ - Azure AD+ - LobeChat+ - 单点登录+---++# 配置 Microsoft 身份验证++<Steps>+ ### 创建 Microsoft Entra ID 应用++ 1. 前往 [Microsoft Entra 管理中心](https://entra.microsoft.com/)+ 2. 导航到 **Identity** > **Applications** > **App registrations** > **New registration**+ 3. 填写应用名称+ 4. 选择支持的帐户类型:+ - **Single tenant**:仅限组织内用户+ - **Multitenant**:任何 Azure AD 组织的用户+ - **Multitenant + personal**:也包括个人 Microsoft 帐户++ <Image alt="应用注册" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/4f9d83bd-b3fc-4abc-bcf4-ccbad65c219d" />++ ### 配置重定向 URI++ 在 **Redirect URI** 部分:++ 1. 选择 **Web** 作为平台+ 2. 输入回调 URL++ <Callout type={'info'}>+ 回调 URL 格式:++ - 本地开发: `http://localhost:3210/api/auth/callback/microsoft`+ - 生产环境: `https://your-domain.com/api/auth/callback/microsoft`+ </Callout>++ 点击 **Register**。++ ### 获取应用凭证++ 创建后,查看 **Overview** 标签页:++ <Image alt="应用概览" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/48a0b702-05bd-4ce4-a007-a8ad00a36e5a" />++ 记录:++ - **Application (client) ID** - 即 `AUTH_MICROSOFT_ID`+ - **Directory (tenant) ID** - 单租户应用需要++ ### 创建客户端密钥++ 1. 前往 **Certificates & secrets** > **Client secrets**+ 2. 点击 **New client secret**+ 3. 填写描述并选择过期时间+ 4. 点击 **Add**++ <Image alt="创建客户端密钥" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/c9d66fa0-158c-4bd3-a1fa-969e638259d2" />++ <Callout type={'warning'}>+ 立即复制客户端密钥的 **Value** - 之后将无法再次查看。+ </Callout>++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | -------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `microsoft` |+ | `AUTH_MICROSOFT_ID` | 必选 | Application (client) ID |+ | `AUTH_MICROSOFT_SECRET` | 必选 | 客户端密钥值 |++ <Callout type={'info'}>+ **兼容的环境变量**:为了向后兼容,以下别名也支持:++ - `AUTH_MICROSOFT_ENTRA_ID_ID` / `AUTH_MICROSOFT_ENTRA_ID_SECRET`+ - `AUTH_AZURE_AD_ID` / `AUTH_AZURE_AD_SECRET`+ - `AZURE_AD_CLIENT_ID` / `AZURE_AD_CLIENT_SECRET`+ </Callout>++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#microsoft)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过 Microsoft 身份认证并使用 LobeChat。+</Callout>++## 常见问题++### 租户配置++默认情况下,LobeChat 使用 `common` 租户,允许组织帐户和个人 Microsoft 帐户登录。如果需要单租户配置,可能需要自定义租户设置。++### 客户端密钥过期++Microsoft 客户端密钥最长有效期为 24 个月。请记得在过期前轮换密钥。++## 相关资源++- [Microsoft Entra 管理中心](https://entra.microsoft.com/)+- [快速入门:注册应用](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app)diff --git a/docs/self-hosting/advanced/auth/better-auth/okta.mdx b/docs/self-hosting/advanced/auth/better-auth/okta.mdxnew file mode 100644index 00000000000..b38802a090a--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/okta.mdx@@ -0,0 +1,67 @@+---+title: Configuring Okta Authentication for LobeChat+description: >-+ Learn how to configure Okta SSO for LobeChat, including creating an+ application and setting up environment variables.+tags:+ - Okta+ - Authentication+ - LobeChat+ - Single Sign-On+ - OIDC+---++# Configuring Okta Authentication++[Okta](https://www.okta.com/) is a leading identity and access management platform.++<Steps>+ ### Create Application in Okta++ 1. Log in to Okta Admin Console+ 2. Go to **Applications** > **Applications**+ 3. Click **Create App Integration**+ 4. Select:+ - Sign-in method: **OIDC - OpenID Connect**+ - Application type: **Web Application**+ 5. Configure the application:+ - App integration name: `LobeChat`+ - Sign-in redirect URIs: Add your callback URL++ <Callout type={'info'}>+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/okta`+ </Callout>++ 6. After creation, note down the **Client ID** and **Client Secret**++ ### Get Issuer URL++ The issuer URL is typically: `https://your-okta-domain.okta.com`++ For custom authorization servers: `https://your-okta-domain.okta.com/oauth2/default`++ ### Configure Environment Variables++ When deploying LobeChat, you need to configure the following environment variables:++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `okta` for Okta |+ | `AUTH_OKTA_ID` | Required | Client ID from Okta application |+ | `AUTH_OKTA_SECRET` | Required | Client Secret from Okta application |+ | `AUTH_OKTA_ISSUER` | Required | Okta issuer URL (e.g., `https://your-okta-domain.okta.com`) |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#okta) for detailed information on these variables.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with Okta and use LobeChat.+</Callout>++## Related Resources++- [Okta Developer Documentation](https://developer.okta.com/docs/)+- [Create OIDC App Integration](https://developer.okta.com/docs/guides/implement-grant-type/authcode/main/)diff --git a/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdxnew file mode 100644index 00000000000..46dd37e6e0f--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdx@@ -0,0 +1,63 @@+---+title: 在 LobeChat 中配置 Okta 身份验证+description: 学习如何在 LobeChat 中配置 Okta SSO,包括创建应用和设置环境变量。+tags:+ - Okta+ - 身份验证+ - LobeChat+ - 单点登录+ - OIDC+---++# 配置 Okta 身份验证++[Okta](https://www.okta.com/) 是领先的身份和访问管理平台。++<Steps>+ ### 在 Okta 中创建应用++ 1. 登录 Okta 管理控制台+ 2. 前往 **Applications** > **Applications**+ 3. 点击 **Create App Integration**+ 4. 选择:+ - Sign-in method: **OIDC - OpenID Connect**+ - Application type: **Web Application**+ 5. 配置应用:+ - App integration name: `LobeChat`+ - Sign-in redirect URIs: 添加回调 URL++ <Callout type={'info'}>+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/okta`+ </Callout>++ 6. 创建后,记下 **Client ID** 和 **Client Secret**++ ### 获取 Issuer URL++ Issuer URL 通常为:`https://your-okta-domain.okta.com`++ 对于自定义授权服务器:`https://your-okta-domain.okta.com/oauth2/default`++ ### 配置环境变量++ 在部署 LobeChat 时,你需要配置以下环境变量:++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | ------------------------------------------------------- |+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Okta 请填写 `okta` |+ | `AUTH_OKTA_ID` | 必选 | Okta 应用的 Client ID |+ | `AUTH_OKTA_SECRET` | 必选 | Okta 应用的 Client Secret |+ | `AUTH_OKTA_ISSUER` | 必选 | Okta Issuer URL(例如 `https://your-okta-domain.okta.com`) |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#okta) 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>部署成功后,用户将可以通过 Okta 身份认证并使用 LobeChat。</Callout>++## 相关资源++- [Okta 开发者文档](https://developer.okta.com/docs/)+- [创建 OIDC 应用集成](https://developer.okta.com/docs/guides/implement-grant-type/authcode/main/)diff --git a/docs/self-hosting/advanced/auth/better-auth/wechat.mdx b/docs/self-hosting/advanced/auth/better-auth/wechat.mdxnew file mode 100644index 00000000000..337d6ef78be--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/wechat.mdx@@ -0,0 +1,77 @@+---+title: Configuring WeChat Authentication for LobeChat+description: >-+ Learn how to configure WeChat SSO for LobeChat, including creating an+ application on WeChat Open Platform.+tags:+ - Authentication+ - LobeChat+ - Single Sign-On+---++# Configuring WeChat Authentication++[WeChat Open Platform](https://open.weixin.qq.com/) enables third-party applications to integrate WeChat login.++<Callout type={'warning'}>+ WeChat Web Login requires a verified WeChat Open Platform account and an+ approved website application. This process requires business verification in+ China.+</Callout>++<Steps>+ ### Create Website Application on WeChat Open Platform++ 1. Go to [WeChat Open Platform](https://open.weixin.qq.com/)+ 2. Register and verify your developer account+ 3. Go to **Management Center** > **Website Application**+ 4. Click **Create Website Application**+ 5. Fill in the application information and submit for review++ ### Configure OAuth Settings++ After your application is approved:++ 1. Go to your application settings+ 2. In **Website Information**, configure the callback domain++ <Callout type={'info'}>+ Callback domain format:++ - **Callback Domain**: `your-domain.com` (without protocol or path)+ - **Full Callback URL**: `https://your-domain.com/api/auth/callback/wechat`+ </Callout>++ 3. Note down the **AppID** and **AppSecret**++ ### Configure Environment Variables++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | --------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | Set to `wechat` |+ | `AUTH_WECHAT_ID` | Required | AppID from WeChat Open Platform |+ | `AUTH_WECHAT_SECRET` | Required | AppSecret from WeChat Open Platform |++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#wechat)+ for detailed information.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with WeChat+ and use LobeChat.+</Callout>++## Notes++- WeChat login uses QR code scanning, users need to use WeChat mobile app+- A verified WeChat Open Platform account is required+- The callback domain must be filed with ICP in China++## Related Resources++- [WeChat Open Platform](https://open.weixin.qq.com/)+- [WeChat Login Documentation](https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html)diff --git a/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdxnew file mode 100644index 00000000000..fc0fae4685a--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdx@@ -0,0 +1,72 @@+---+title: 在 LobeChat 中配置微信身份验证+description: 学习如何在 LobeChat 中配置微信 SSO,包括在微信开放平台创建应用。+tags:+ - 微信+ - 身份验证+ - LobeChat+ - 单点登录+---++# 配置微信身份验证++[微信开放平台](https://open.weixin.qq.com/) 支持第三方应用接入微信登录功能。++<Callout type={'warning'}>+ 微信网页登录需要经过认证的微信开放平台账号,以及通过微信审核的网站应用。此流程需要在中国进行企业认证。+</Callout>++<Steps>+ ### 在微信开放平台创建网站应用++ 1. 前往 [微信开放平台](https://open.weixin.qq.com/)+ 2. 注册并验证开发者账号+ 3. 前往 **管理中心** > **网站应用**+ 4. 点击 **创建网站应用**+ 5. 填写应用信息并提交审核++ ### 配置 OAuth 设置++ 应用审核通过后:++ 1. 进入应用设置+ 2. 在 **网站信息** 中配置回调域名++ <Callout type={'info'}>+ 回调域名格式:++ - **回调域名**: `your-domain.com`(不含协议和路径)+ - **完整回调 URL**: `https://your-domain.com/api/auth/callback/wechat`+ </Callout>++ 3. 记下 **AppID** 和 **AppSecret**++ ### 配置环境变量++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | -------------------------------------- |+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `wechat` |+ | `AUTH_WECHAT_ID` | 必选 | 微信开放平台的 AppID |+ | `AUTH_WECHAT_SECRET` | 必选 | 微信开放平台的 AppSecret |++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#wechat)+ 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>+ 部署成功后,用户将可以通过微信身份认证并使用 LobeChat。+</Callout>++## 注意事项++- 微信登录使用扫码方式,用户需要使用微信手机端扫码+- 需要经过认证的微信开放平台账号+- 回调域名需要在中国进行 ICP 备案++## 相关资源++- [微信开放平台](https://open.weixin.qq.com/)+- [微信登录文档](https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html)diff --git a/docs/self-hosting/advanced/auth/better-auth/zitadel.mdx b/docs/self-hosting/advanced/auth/better-auth/zitadel.mdxnew file mode 100644index 00000000000..edf461a76e4--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/zitadel.mdx@@ -0,0 +1,73 @@+---+title: Configuring ZITADEL Authentication for LobeChat+description: >-+ Learn how to configure ZITADEL SSO for LobeChat, including creating an+ application and setting up environment variables.+tags:+ - ZITADEL+ - Authentication+ - LobeChat+ - Single Sign-On+ - OIDC+---++# Configuring ZITADEL Authentication++[ZITADEL](https://zitadel.com/) is an open-source identity infrastructure with built-in multi-tenancy.++<Steps>+ ### Create Application in ZITADEL++ 1. Log in to ZITADEL Console+ 2. Go to your project (or create a new one)+ 3. Click **New** to create a new application+ 4. Select **Web** as the application type+ 5. Configure:+ - Name: `LobeChat`+ - Authentication Method: `CODE` (for confidential clients)+ 6. Add redirect URI:++ <Callout type={'info'}>+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/zitadel`+ </Callout>++ 7. After creation, note down the **Client ID** and generate a **Client Secret**++ ### Get Issuer URL++ The issuer URL is your ZITADEL instance URL, typically:++ - Cloud: `https://your-instance.zitadel.cloud`+ - Self-hosted: `https://your-zitadel-domain`++ ### Configure Environment Variables++ When deploying LobeChat, you need to configure the following environment variables:++ | Environment Variable | Type | Description |+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `zitadel` for ZITADEL |+ | `AUTH_ZITADEL_ID` | Required | Client ID from ZITADEL application |+ | `AUTH_ZITADEL_SECRET` | Required | Client Secret from ZITADEL application |+ | `AUTH_ZITADEL_ISSUER` | Required | ZITADEL issuer URL (e.g., `https://your-instance.zitadel.cloud`) |++ <Callout type={'info'}>+ **Alternative Environment Variables**: For backward compatibility, the following aliases are also supported:++ - `ZITADEL_CLIENT_ID` / `ZITADEL_CLIENT_SECRET` / `ZITADEL_ISSUER`+ </Callout>++ <Callout type={'tip'}>+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#zitadel) for detailed information on these variables.+ </Callout>+</Steps>++<Callout type={'info'}>+ After successful deployment, users will be able to authenticate with ZITADEL and use LobeChat.+</Callout>++## Related Resources++- [ZITADEL Documentation](https://zitadel.com/docs)+- [ZITADEL Application Setup](https://zitadel.com/docs/guides/integrate/login-users)diff --git a/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdx b/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdxnew file mode 100644index 00000000000..ce65d6dd2c3--- /dev/null+++ b/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdx@@ -0,0 +1,69 @@+---+title: 在 LobeChat 中配置 ZITADEL 身份验证+description: 学习如何在 LobeChat 中配置 ZITADEL SSO,包括创建应用和设置环境变量。+tags:+ - ZITADEL+ - 身份验证+ - LobeChat+ - 单点登录+ - OIDC+---++# 配置 ZITADEL 身份验证++[ZITADEL](https://zitadel.com/) 是一个开源的身份基础设施,内置多租户支持。++<Steps>+ ### 在 ZITADEL 中创建应用++ 1. 登录 ZITADEL 控制台+ 2. 前往你的项目(或创建新项目)+ 3. 点击 **New** 创建新应用+ 4. 选择 **Web** 作为应用类型+ 5. 配置:+ - Name: `LobeChat`+ - Authentication Method: `CODE`(用于机密客户端)+ 6. 添加重定向 URI:++ <Callout type={'info'}>+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/zitadel`+ </Callout>++ 7. 创建后,记下 **Client ID** 并生成 **Client Secret**++ ### 获取 Issuer URL++ Issuer URL 是 ZITADEL 实例 URL,通常为:++ - 云版:`https://your-instance.zitadel.cloud`+ - 自托管:`https://your-zitadel-domain`++ ### 配置环境变量++ 在部署 LobeChat 时,你需要配置以下环境变量:++ | 环境变量 | 类型 | 描述 |+ | -------------------------------- | -- | ------------------------------------------------------------ |+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 ZITADEL 请填写 `zitadel` |+ | `AUTH_ZITADEL_ID` | 必选 | ZITADEL 应用的 Client ID |+ | `AUTH_ZITADEL_SECRET` | 必选 | ZITADEL 应用的 Client Secret |+ | `AUTH_ZITADEL_ISSUER` | 必选 | ZITADEL Issuer URL(例如 `https://your-instance.zitadel.cloud`) |++ <Callout type={'info'}>+ **兼容的环境变量**:为了向后兼容,以下别名也支持:++ - `ZITADEL_CLIENT_ID` / `ZITADEL_CLIENT_SECRET` / `ZITADEL_ISSUER`+ </Callout>++ <Callout type={'tip'}>+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#zitadel) 可查阅相关变量详情。+ </Callout>+</Steps>++<Callout type={'info'}>部署成功后,用户将可以通过 ZITADEL 身份认证并使用 LobeChat。</Callout>++## 相关资源++- [ZITADEL 文档](https://zitadel.com/docs)+- [ZITADEL 应用设置](https://zitadel.com/docs/guides/integrate/login-users)diff --git a/docs/self-hosting/advanced/auth/clerk.mdx b/docs/self-hosting/advanced/auth/clerk.mdxindex 14d8c7f5f2e..3e9b7be3aa3 100644--- a/docs/self-hosting/advanced/auth/clerk.mdx+++ b/docs/self-hosting/advanced/auth/clerk.mdx@@ -1,8 +1,8 @@---title: Configure Clerk Authentication Service - Step-by-Step Guidedescription: >-- Learn how to set up Clerk authentication with environment variables and webhooks.-+ Learn how to set up Clerk authentication with environment variables and+ webhooks.tags:- Clerk Authentication- Environment Variablesdiff --git a/docs/self-hosting/advanced/auth/legacy.mdx b/docs/self-hosting/advanced/auth/legacy.mdxnew file mode 100644index 00000000000..de17e26f2c3--- /dev/null+++ b/docs/self-hosting/advanced/auth/legacy.mdx@@ -0,0 +1,106 @@+---+title: Legacy Authentication (NextAuth & Clerk)+description: >-+ Documentation for legacy authentication methods including NextAuth and Clerk.+ For new deployments, we recommend using Better Auth.+tags:+ - Authentication Service+ - Next Auth+ - Clerk+ - Legacy+---++# Legacy Authentication++<Callout type={'warning'}>+ **Legacy Notice**: NextAuth and Clerk are legacy authentication methods. For new deployments, we strongly recommend using [Better Auth](/docs/self-hosting/advanced/auth) for its simplicity and flexibility.+</Callout>++This page documents the legacy authentication methods (NextAuth and Clerk) for users who are still using these services.++## Clerk++Clerk is a comprehensive identity verification solution that provides a simple yet powerful API and services to handle user authentication and session management.++LobeChat has deeply integrated with Clerk to provide users with a secure and convenient login and registration experience.++By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` in LobeChat's environment, you can enable and use Clerk.++<Callout type={'info'}>+ For detailed Clerk configuration, see [Clerk Configuration Guide](/docs/self-hosting/advanced/auth/clerk).+</Callout>++## Next Auth++Before using NextAuth, please set the following variables in LobeChat's environment variables:++| Environment Variable | Type | Description |+| -------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |+| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | Required | This is used to enable the NextAuth service. Set it to `1` to enable it; changing this setting requires recompiling the application. Users deploying with the `lobehub/lobe-chat-database` image have this configuration added by default. |+| `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. |+| `AUTH_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`. |+| `NEXT_AUTH_SSO_SESSION_STRATEGY` | Optional | The session strategy for Auth.js. Options are `jwt` or `database`. Default is `jwt`. |++Currently supported identity verification services include:++<Cards>+ <Card href={'/docs/self-hosting/advanced/auth/next-auth/auth0'} title={'Auth0'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id'} title={'Microsoft Entra ID'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/authentik'} title={'Authentik'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/github'} title={'Github'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/zitadel'} title={'ZITADEL'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust'} title={'Cloudflare Zero Trust'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/authelia'} title={'Authelia'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/logto'} title={'Logto'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/keycloak'} title={'Keycloak'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/google'} title={'Google'} />++ <Card href={'/docs/self-hosting/advanced/auth/next-auth/okta'} title={'Okta'} />+</Cards>++Click on the links to view the corresponding platform's configuration documentation.++## Advanced Configuration++To simultaneously enable multiple identity verification sources, please set the `NEXT_AUTH_SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,microsoft-entra-id,authentik`.++The order corresponds to the display order of the SSO providers.++| SSO Provider | Value | Additional Features |+| --------------------- | ----------------------- | ------------------- |+| Auth0 | `auth0` | |+| Authenlia | `authenlia` | |+| Authentik | `authentik` | |+| Casdoor | `casdoor` | `Webhook` |+| Cloudflare Zero Trust | `cloudflare-zero-trust` | |+| Github | `github` | |+| Logto | `logto` | `Webhook` |+| Microsoft Entra ID | `microsoft-entra-id` | |+| ZITADEL | `zitadel` | |+| Keycloak | `keycloak` | |+| Google | `google` | |+| Okta | `okta` | |++## Additional Features++### Webhook Support++Allow LobeChat to receive notifications when user information is updated in the identity provider. Supported providers include Casdoor and Logto. Please refer to the specific provider documentation for configuration details.++### Database Session++Allow the session store in database, see also the [Auth.js Session Documentation](https://authjs.dev/concepts/session-strategies#database-session).++## Other SSO Providers++Please refer to the [Auth.js](https://authjs.dev/getting-started/authentication/oauth) documentation and feel free to submit a Pull Request.diff --git a/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx b/docs/self-hosting/advanced/auth/legacy.zh-CN.mdxnew file mode 100644index 00000000000..6d96753980d--- /dev/null+++ b/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx@@ -0,0 +1,101 @@+---+title: 旧版身份验证(NextAuth 和 Clerk)+description: 关于 NextAuth 和 Clerk 等旧版身份验证方法的文档。对于新部署,我们建议使用 Better Auth。+tags:+ - 身份验证服务+ - Next Auth+ - Clerk+ - 旧版+---++# 旧版身份验证++<Callout type={'warning'}>+ **旧版提示**:NextAuth 和 Clerk 是旧版身份验证方案。对于新部署,我们强烈建议使用 [Better Auth](/zh/docs/self-hosting/advanced/auth),它更简洁、更灵活。+</Callout>++本页面为仍在使用这些服务的用户提供旧版身份验证方案(NextAuth 和 Clerk)的文档。++## Clerk++Clerk 是一个全面的身份验证解决方案,它提供了简单而强大的 API 和服务来处理用户认证和会话管理。++LobeChat 与 Clerk 做了深度集成,能够为用户提供安全、便捷的登录和注册体验。++在 LobeChat 的环境变量中设置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY`,即可开启和使用 Clerk。++<Callout type={'info'}>+ 详细的 Clerk 配置请参阅 [Clerk 配置指南](/zh/docs/self-hosting/advanced/auth/clerk)。+</Callout>++## Next Auth++在使用 NextAuth 之前,请先在 LobeChat 的环境变量中设置以下变量:++| 环境变量 | 类型 | 描述 |+| -------------------------------- | -- | ------------------------------------------------------------------------------------------------------------ |+| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | 必选 | 用于启用 NextAuth 服务,设置为 `1` 以启用,更改此项需要重新编译应用。使用 `lobehub/lobe-chat-database` 镜像部署的用户已经默认添加了该项配置。 |+| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |+| `AUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |+| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 |+| `NEXT_AUTH_SSO_SESSION_STRATEGY` | 可选 | Auth.js 的会话策略。选项为 `jwt` 或 `database`。默认值为 `jwt`。 |++目前支持的身份验证服务有:++<Cards>+ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/auth0'} title={'Auth0'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id'} title={'Microsoft Entra ID'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/authentik'} title={'Authentik'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/github'} title={'Github'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/zitadel'} title={'ZITADEL'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust'} title={'Cloudflare Zero Trust'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/authelia'} title={'Authelia'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/logto'} title={'Logto'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/keycloak'} title={'Keycloak'} />++ <Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/okta'} title={'Okta'} />+</Cards>++点击即可查看对应平台的配置文档。++## 进阶配置++同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。++顺序为 SSO 提供商的显示顺序。++| SSO 提供商 | 值 | 额外功能 |+| --------------------- | ----------------------- | --------- |+| Auth0 | `auth0` | |+| Authenlia | `authenlia` | |+| Authentik | `authentik` | |+| Casdoor | `casdoor` | `Webhook` |+| Cloudflare Zero Trust | `cloudflare-zero-trust` | |+| Github | `github` | |+| Logto | `logto` | `Webhook` |+| Microsoft Entra ID | `microsoft-entra-id` | |+| ZITADEL | `zitadel` | |+| Keycloak | `keycloak` | |+| Okta | `okta` | |++## 额外功能++### Webhook 支持++允许 LobeChat 在身份提供商中用户信息更新时接收通知。支持的提供商包括 Casdoor 和 Logto。请参考具体提供商文档进行配置。++### 数据库会话++允许会话存储在数据库中,详情请参阅 [Auth.js 会话文档](https://authjs.dev/concepts/session-strategies#database-session)。++## 其他 SSO 提供商++请参考 [NextAuth.js](https://next-auth.js.org/providers) 文档,欢迎提交 Pull Request。diff --git a/docs/self-hosting/advanced/auth/next-auth/auth0.mdx b/docs/self-hosting/advanced/auth/next-auth/auth0.mdxindex 1ef1b2658c8..fea7d6c04db 100644--- a/docs/self-hosting/advanced/auth/next-auth/auth0.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/auth0.mdx@@ -1,8 +1,9 @@---title: Configure Auth0 Identity Verification Service for LobeChatdescription: >-- Learn how to configure Auth0 Identity Verification Service for LobeChat for your organization, including creating applications, adding users, and configuring environment variables.-+ Learn how to configure Auth0 Identity Verification Service for LobeChat for+ your organization, including creating applications, adding users, and+ configuring environment variables.tags:- Auth0- Identity Verificationdiff --git a/docs/self-hosting/advanced/auth/next-auth/authelia.mdx b/docs/self-hosting/advanced/auth/next-auth/authelia.mdxindex 33bbcff1c82..6b2ec0a5353 100644--- a/docs/self-hosting/advanced/auth/next-auth/authelia.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/authelia.mdx@@ -1,8 +1,9 @@---title: Configuring Authelia Authentication Service for LobeChatdescription: >-- Learn how to configure Authelia authentication service in LobeChat, including creating a provider, configuring environment variables, and deploying LobeChat. Detailed steps and necessary environment variable settings.-+ Learn how to configure Authelia authentication service in LobeChat, including+ creating a provider, configuring environment variables, and deploying+ LobeChat. Detailed steps and necessary environment variable settings.tags:- Authelia Configuration- Single Sign-On (SSO)diff --git a/docs/self-hosting/advanced/auth/next-auth/authentik.mdx b/docs/self-hosting/advanced/auth/next-auth/authentik.mdxindex 74e469c07ac..ad7af1c2534 100644--- a/docs/self-hosting/advanced/auth/next-auth/authentik.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/authentik.mdx@@ -1,8 +1,9 @@---title: Configuring Authentik Authentication Service for LobeChatdescription: >-- Learn how to configure Authentik for Single Sign-On (SSO) for LobeChat, including creating an application provider, setting environment variables, and deployment instructions.-+ Learn how to configure Authentik for Single Sign-On (SSO) for LobeChat,+ including creating an application provider, setting environment variables, and+ deployment instructions.tags:- Authentik Configuration- Single Sign-On (SSO)diff --git a/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx b/docs/self-hosting/advanced/auth/next-auth/casdoor.mdxindex e847adfc1be..3d309b46a97 100644--- a/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx@@ -1,8 +1,9 @@---title: Configuring Casdoor Authentication Service in LobeChatdescription: >-- Learn how to configure the Casdoor authentication service in LobeChat, including deployment, creation, permission settings, and environment variables.-+ Learn how to configure the Casdoor authentication service in LobeChat,+ including deployment, creation, permission settings, and environment+ variables.tags:- Casdoor Authentication- Environment Variable Configuration@@ -87,6 +88,8 @@ If you are deploying using a public network, the following assumptions apply:box-shadow: none;}}++</style>```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.mdxindex b16170277e0..cdeeeed468f 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@@ -85,6 +85,8 @@ tags:box-shadow: none;}}++</style>```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.mdxindex dc8d9a51bff..ee8bb552dbc 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@@ -1,8 +1,9 @@---title: Configuring Cloudflare Zero Trust Authentication Service for LobeChatdescription: >-- Learn how to configure Cloudflare Zero Trust for Single Sign-On (SSO) for LobeChat, including creating an application provider, setting environment variables, and deployment instructions.-+ Learn how to configure Cloudflare Zero Trust for Single Sign-On (SSO) for+ LobeChat, including creating an application provider, setting environment+ variables, and deployment instructions.tags:- Cloudflare Zero Trust- Single Sign-On (SSO)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.mdxindex e490ce4f360..e58d3473853 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@@ -1,8 +1,8 @@---title: 在 LobeChat 中配置 Cloudflare Zero Trust 身份验证服务description: >-- 学习如何在 LobeChat 中配置 Cloudflare Zero Trust 身份验证服务,包括创建提供程序、配置环境变量和部署 LobeChat。详细步骤和必要环境变量设置。-+ 学习如何在 LobeChat 中配置 Cloudflare Zero Trust 身份验证服务,包括创建提供程序、配置环境变量和部署+ LobeChat。详细步骤和必要环境变量设置。tags:- Cloudflare Zero Trust- 身份验证diff --git a/docs/self-hosting/advanced/auth/next-auth/github.mdx b/docs/self-hosting/advanced/auth/next-auth/github.mdxindex 96cd38c18a3..0feb0f42b15 100644--- a/docs/self-hosting/advanced/auth/next-auth/github.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/github.mdx@@ -1,8 +1,9 @@---title: Configuring Github Authentication Service for LobeChatdescription: >-- Learn how to configure Github authentication service for LobeChat, including creating a Github provider, setting up environment variables, and deploying LobeChat.-+ Learn how to configure Github authentication service for LobeChat, including+ creating a Github provider, setting up environment variables, and deploying+ LobeChat.tags:- Github authentication- LobeChatdiff --git a/docs/self-hosting/advanced/auth/next-auth/google.mdx b/docs/self-hosting/advanced/auth/next-auth/google.mdxindex 79cc188eb39..34ae3870b84 100644--- a/docs/self-hosting/advanced/auth/next-auth/google.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/google.mdx@@ -1,19 +1,17 @@----title: Configuration of Google SSO Authentication Service for LobeChatdescription: >--Learn how to configure Google SSO Authentication Service for LobeChat,-create OAuth applications, add users, and set up environment variables for seamless integration.+ Learn how to configure Google SSO Authentication Service for LobeChat, create+ OAuth applications, add users, and set up environment variables for seamless+ integration.tags:--* Google SSO-* Authentication Service-* Google Cloud-* OAuth-* SSO-* Environment Variables-* LobeChat-+ - Google SSO+ - Authentication Service+ - Google Cloud+ - OAuth+ - SSO+ - Environment Variables+ - LobeChat---# Configuration of Google SSO Authentication Servicediff --git a/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx b/docs/self-hosting/advanced/auth/next-auth/keycloak.mdxindex c73f8576cea..d9cbb949738 100644--- a/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx@@ -1,8 +1,9 @@---title: Configuring Keycloak Authentication Service in LobeChatdescription: >-- Learn how to configure the Keycloak authentication service in LobeChat, including deployment, creation, permission settings, and environment variables.-+ Learn how to configure the Keycloak authentication service in LobeChat,+ including deployment, creation, permission settings, and environment+ variables.tags:- Keycloak Authentication- Environment Variable Configurationdiff --git a/docs/self-hosting/advanced/auth/next-auth/logto.mdx b/docs/self-hosting/advanced/auth/next-auth/logto.mdxindex e1a0ece7ca4..0c552fdf6af 100644--- a/docs/self-hosting/advanced/auth/next-auth/logto.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/logto.mdx@@ -1,8 +1,8 @@---title: Configuring Logto Authentication Service in LobeChatdescription: >-- Learn how to configure Logto authentication service in LobeChat, including deployment, creation, setting permissions, and environment variables.-+ Learn how to configure Logto authentication service in LobeChat, including+ deployment, creation, setting permissions, and environment variables.tags:- Logto Authentication- Environment Variable Configurationdiff --git a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdxindex d453b8159b4..0ba3b380e39 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@@ -1,8 +1,9 @@---title: Configuration of Microsoft Entra ID Authentication Service for LobeChatdescription: >-- Learn how to configure Microsoft Entra ID Authentication Service for LobeChat, create applications, add users, and set up environment variables for seamless integration.-+ Learn how to configure Microsoft Entra ID Authentication Service for LobeChat,+ create applications, add users, and set up environment variables for seamless+ integration.tags:- Microsoft Entra ID- Authentication Servicediff --git a/docs/self-hosting/advanced/auth/next-auth/okta.mdx b/docs/self-hosting/advanced/auth/next-auth/okta.mdxindex c7f41636a48..125486c2f7d 100644--- a/docs/self-hosting/advanced/auth/next-auth/okta.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/okta.mdx@@ -1,8 +1,9 @@---title: Configure Okta Identity Verification Service for LobeChatdescription: >-- Learn how to configure Okta Identity Verification Service for LobeChat for your organization, including creating applications, adding users, and configuring environment variables.-+ Learn how to configure Okta Identity Verification Service for LobeChat for+ your organization, including creating applications, adding users, and+ configuring environment variables.tags:- Okta- Identity Verificationdiff --git a/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdxindex d4426bed6b7..d435f168146 100644--- a/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx@@ -1,8 +1,6 @@---title: 在 LobeChat 中配置 Okta 身份验证服务 - 详细步骤和环境变量设置-description: >-- 学习如何在 LobeChat 中为您的组织配置 Okta 身份验证服务,包括创建应用程序、添加用户和配置环境变量等。-+description: 学习如何在 LobeChat 中为您的组织配置 Okta 身份验证服务,包括创建应用程序、添加用户和配置环境变量等。tags:- Okta- 身份验证diff --git a/docs/self-hosting/advanced/auth/next-auth/wechat.mdx b/docs/self-hosting/advanced/auth/next-auth/wechat.mdxindex 33bec156602..34e65f145f3 100644--- a/docs/self-hosting/advanced/auth/next-auth/wechat.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/wechat.mdx@@ -1,8 +1,8 @@---title: Configure Wechat Authentication Service in LobeChatdescription: >-- Learn how to configure Wechat authentication service in LobeChat, including creating a new Wechat App, setting permissions, and environment variables.-+ Learn how to configure Wechat authentication service in LobeChat, including+ creating a new Wechat App, setting permissions, and environment variables.tags:- Wechat Authentication- Wechat Appdiff --git a/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx b/docs/self-hosting/advanced/auth/next-auth/zitadel.mdxindex d0576686597..ecbbb79e93a 100644--- a/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx+++ b/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx@@ -1,8 +1,9 @@---title: Configure ZITADEL Authentication Service for LobeChatdescription: >-- Learn how to configure ZITADEL Authentication Service for LobeChat deployment, including creating ZITADEL applications, setting up environment variables, and enabling single sign-on (SSO).-+ Learn how to configure ZITADEL Authentication Service for LobeChat deployment,+ including creating ZITADEL applications, setting up environment variables, and+ enabling single sign-on (SSO).tags:- ZITADEL Authentication- LobeChat Deploymentdiff --git a/docs/self-hosting/advanced/desktop.mdx b/docs/self-hosting/advanced/desktop.mdxindex f05b8bc23bd..069f2d9cf26 100644--- a/docs/self-hosting/advanced/desktop.mdx+++ b/docs/self-hosting/advanced/desktop.mdx@@ -44,11 +44,17 @@ Before connecting the desktop to your self-hosted instance, ensure that your sel#### OIDC Environment Variable Configuration-You need to add the following two environment variables, `ENABLE_OIDC` and `JWKS_KEY`, to your self-hosted instance. You can click the button below to generate them with one click:+You need to add the following two environment variables, `ENABLE_OIDC` and `JWKS_KEY`, to your self-hosted instance:-<OIDCJWKs />+```bash+ENABLE_OIDC=1+```++Click the button below to generate `JWKS_KEY`:++<GenerateJWKSKey />-Add the generated JWK key to your environment variables.+Add the generated environment variables to your deployment configuration.<Callout>If you have already configured `OIDC_JWKS_KEY`, no changes are needed. The system will automatically fall back to `OIDC_JWKS_KEY` for backward compatibility.</Callout>diff --git a/docs/self-hosting/advanced/desktop.zh-CN.mdx b/docs/self-hosting/advanced/desktop.zh-CN.mdxindex 34aa3c62474..3cc877ff0c2 100644--- a/docs/self-hosting/advanced/desktop.zh-CN.mdx+++ b/docs/self-hosting/advanced/desktop.zh-CN.mdx@@ -42,11 +42,17 @@ LobeChat 桌面端可以与您自托管的 LobeChat 实例连接,以便您可#### OIDC 环境变量配置-您需要在自托管实例中添加以下`ENABLE_OIDC` 和 `JWKS_KEY` 这两个环境变量,你可以点击下方按钮一键生成:+您需要在自托管实例中添加以下`ENABLE_OIDC` 和 `JWKS_KEY` 这两个环境变量:-<OIDCJWKs />+```bash+ENABLE_OIDC=1+```++点击下方按钮一键生成 `JWKS_KEY`:++<GenerateJWKSKey />-将生成的 JWK 密钥添加到您的环境变量中。+将生成的环境变量添加到您的部署配置中。<Callout>如果您之前已配置 `OIDC_JWKS_KEY`,无需修改。系统会自动回退使用 `OIDC_JWKS_KEY`(向后兼容)。</Callout>diff --git a/docs/self-hosting/advanced/feature-flags.mdx b/docs/self-hosting/advanced/feature-flags.mdxindex 727020038bd..b5eeeabba03 100644--- a/docs/self-hosting/advanced/feature-flags.mdx+++ b/docs/self-hosting/advanced/feature-flags.mdx@@ -1,8 +1,9 @@---title: LobeChat Feature Flags Environment Variables Configuration Guidedescription: >-- Learn how to use environment variables to customize LobeChat's feature flags, including controlling whether a feature is enabled or disabled, or enabling or disabling features for specific user groups or environments as needed.-+ Learn how to use environment variables to customize LobeChat's feature flags,+ including controlling whether a feature is enabled or disabled, or enabling or+ disabling features for specific user groups or environments as needed.tags:- LobeChat- Environment Variablesdiff --git a/docs/self-hosting/advanced/knowledge-base.mdx b/docs/self-hosting/advanced/knowledge-base.mdxindex b0e353d596f..2e8509d7e3e 100644--- a/docs/self-hosting/advanced/knowledge-base.mdx+++ b/docs/self-hosting/advanced/knowledge-base.mdx@@ -1,8 +1,8 @@---title: LobeChat Knowledge Base / File Uploaddescription: >-- Explore LobeChat's file upload and knowledge base management features with core components.-+ Explore LobeChat's file upload and knowledge base management features with+ core components.tags:- LobeChat- File Uploaddiff --git a/docs/self-hosting/advanced/model-list.mdx b/docs/self-hosting/advanced/model-list.mdxindex 79e617dcf21..f060567595c 100644--- a/docs/self-hosting/advanced/model-list.mdx+++ b/docs/self-hosting/advanced/model-list.mdx@@ -1,8 +1,8 @@---title: Customizing Provider Model List in LobeChat for Deploymentdescription: >-- Learn how to customize the model list in LobeChat for deployment with the syntax and extension capabilities-+ Learn how to customize the model list in LobeChat for deployment with the+ syntax and extension capabilitiestags:- LobeChat- model customizationdiff --git a/docs/self-hosting/advanced/observability/grafana.mdx b/docs/self-hosting/advanced/observability/grafana.mdxindex 06447e5b507..453ff586404 100644--- a/docs/self-hosting/advanced/observability/grafana.mdx+++ b/docs/self-hosting/advanced/observability/grafana.mdx@@ -1,7 +1,9 @@----title: Observability with Grafana, Prometheus, and Tempo+title: 'Observability with Grafana, Prometheus, and Tempo'description: >-- Monitor and analyze your LobeChat instance using Grafana dashboards, Prometheus metrics, and Tempo traces. This guide covers setup, configuration for self-hosted deployments.+ Monitor and analyze your LobeChat instance using Grafana dashboards,+ Prometheus metrics, and Tempo traces. This guide covers setup, configuration+ for self-hosted deployments.tags:- Observability- Grafanadiff --git a/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx b/docs/self-hosting/advanced/observability/grafana.zh-CN.mdxindex 7ff0d705308..6936eaf7bc2 100644--- a/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx+++ b/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx@@ -1,7 +1,8 @@---title: 使用 Grafana、Prometheus 和 Tempo 进行可观测性监控description: >-- 使用 Grafana、Prometheus 指标和 Tempo 链路追踪,监控和分析你的 LobeChat 实例。本指南涵盖自托管部署的搭建、配置和示例仪表盘。+ 使用 Grafana、Prometheus 指标和 Tempo 链路追踪,监控和分析你的 LobeChat+ 实例。本指南涵盖自托管部署的搭建、配置和示例仪表盘。tags:- 可观测性- Grafanadiff --git a/docs/self-hosting/advanced/observability/langfuse.mdx b/docs/self-hosting/advanced/observability/langfuse.mdxindex 9881d08990b..46110892f11 100644--- a/docs/self-hosting/advanced/observability/langfuse.mdx+++ b/docs/self-hosting/advanced/observability/langfuse.mdx@@ -1,8 +1,9 @@---title: Observability and Tracing for LobeChatdescription: >-- Enhance your LobeChat applications with open-source observability and tracing using Langfuse. Automatically capture detailed traces and metrics for every request to optimize and debug your chats.-+ Enhance your LobeChat applications with open-source observability and tracing+ using Langfuse. Automatically capture detailed traces and metrics for every+ request to optimize and debug your chats.tags:- Observability- Tracingdiff --git a/docs/self-hosting/advanced/online-search.mdx b/docs/self-hosting/advanced/online-search.mdxindex 2200415a964..5388e8120fb 100644--- a/docs/self-hosting/advanced/online-search.mdx+++ b/docs/self-hosting/advanced/online-search.mdx@@ -1,12 +1,10 @@---title: >-- Configuring Online Search Functionality - Enhancing AI's Ability to Access Web Information--+ Configuring Online Search Functionality - Enhancing AI's Ability to Access Web+ Informationdescription: >-- Learn how to configure the SearXNG online search functionality for LobeChat, enabling AI to access the latest web information.--+ Learn how to configure the SearXNG online search functionality for LobeChat,+ enabling AI to access the latest web information.tags:- Online Search- SearXNGdiff --git a/docs/self-hosting/advanced/s3/tencent-cloud.mdx b/docs/self-hosting/advanced/s3/tencent-cloud.mdxindex 4c8d28d906e..eed8a276d44 100644--- a/docs/self-hosting/advanced/s3/tencent-cloud.mdx+++ b/docs/self-hosting/advanced/s3/tencent-cloud.mdx@@ -1,8 +1,8 @@---title: Configuring Tencent Cloud COS Storage Servicedescription: >-- Detailed steps to configure Tencent Cloud COS storage service for smooth file storage.-+ Detailed steps to configure Tencent Cloud COS storage service for smooth file+ storage.tags:- Tencent Cloud COS- S3 Storagediff --git a/docs/self-hosting/advanced/settings-url-share.mdx b/docs/self-hosting/advanced/settings-url-share.mdxindex b5cb79f0533..80e121be3d6 100644--- a/docs/self-hosting/advanced/settings-url-share.mdx+++ b/docs/self-hosting/advanced/settings-url-share.mdx@@ -1,8 +1,9 @@---title: Share Settings via URL - Import and Export Configuration Settingsdescription: >-- Learn how to import and export configuration settings for LobeChat via URL. Understand the supported settings, URL format, and parameter schema for keyVaults and languageModel.-+ Learn how to import and export configuration settings for LobeChat via URL.+ Understand the supported settings, URL format, and parameter schema for+ keyVaults and languageModel.tags:- Share Settings- URL Importdiff --git a/docs/self-hosting/advanced/upstream-sync.mdx b/docs/self-hosting/advanced/upstream-sync.mdxindex 98e45b7106a..0525d8e816c 100644--- a/docs/self-hosting/advanced/upstream-sync.mdx+++ b/docs/self-hosting/advanced/upstream-sync.mdx@@ -1,8 +1,9 @@---title: LobeChat Upstream Sync and Docker Deployment Guidedescription: >-- Learn how to enable automatic updates for LobeChat Vercel deployments and upgrade Docker deployment versions easily. Follow step-by-step instructions for a seamless deployment process.-+ Learn how to enable automatic updates for LobeChat Vercel deployments and+ upgrade Docker deployment versions easily. Follow step-by-step instructions+ for a seamless deployment process.tags:- Upstream Sync- Vercel Deployment@@ -69,7 +70,6 @@ Upgrading the Docker deployment version is very simple, you just need to redeplodocker 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```@@ -93,7 +93,6 @@ If you wish to automate the above steps, you can follow the method below and use```envOPENAI_API_KEY=sk-xxxxOPENAI_PROXY_URL=https://api-proxy.com/v1- ACCESS_CODE=arthals2333OPENAI_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```diff --git a/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx b/docs/self-hosting/advanced/upstream-sync.zh-CN.mdxindex 60340f8e6bc..1ccb01ca24b 100644--- a/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx+++ b/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx@@ -65,7 +65,6 @@ Docker 部署版本的升级非常简单,只需要重新部署 LobeChat 的最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```@@ -89,7 +88,6 @@ Docker 部署版本的升级非常简单,只需要重新部署 LobeChat 的最```envOPENAI_API_KEY=sk-xxxxOPENAI_PROXY_URL=https://api-proxy.com/v1- ACCESS_CODE=arthals2333OPENAI_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```diff --git a/docs/self-hosting/environment-variables.mdx b/docs/self-hosting/environment-variables.mdxindex b8d3b6b224d..758dce29d3f 100644--- a/docs/self-hosting/environment-variables.mdx+++ b/docs/self-hosting/environment-variables.mdx@@ -1,8 +1,8 @@---title: LobeChat Environment Variables - Customizing Guidedescription: >-- Learn how to customize LobeChat configuration using environment variables for additional features and options.-+ Learn how to customize LobeChat configuration using environment variables for+ additional features and options.tags:- LobeChat- Environment Variables@@ -83,7 +83,6 @@ jobs:# List all variables you need to overwritebuild-args: |NEXT_PUBLIC_BASE_PATH=${{ secrets.NEXT_PUBLIC_BASE_PATH }}- 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 overridediff --git a/docs/self-hosting/environment-variables/analytics.mdx b/docs/self-hosting/environment-variables/analytics.mdxindex 945ba21ba76..c5bb104c479 100644--- a/docs/self-hosting/environment-variables/analytics.mdx+++ b/docs/self-hosting/environment-variables/analytics.mdx@@ -1,8 +1,9 @@---title: Integrating Analytics in LobeChatdescription: >-- Learn how to configure environment variables for Vercel Analytics, Google Analytics, PostHog Analytics, and Umami Analytics in LobeChat for data collection and analysis.-+ Learn how to configure environment variables for Vercel Analytics, Google+ Analytics, PostHog Analytics, and Umami Analytics in LobeChat for data+ collection and analysis.tags:- Data Analytics- LobeChatdiff --git a/docs/self-hosting/environment-variables/auth.mdx b/docs/self-hosting/environment-variables/auth.mdxindex 05f75b3907e..65702e320da 100644--- a/docs/self-hosting/environment-variables/auth.mdx+++ b/docs/self-hosting/environment-variables/auth.mdx@@ -1,9 +1,9 @@---title: LobeChat Authentication Service Environment Variablesdescription: >-- Explore the essential environment variables for configuring authentication services in LobeChat, including Better Auth, OAuth SSO, NextAuth settings, and provider-specific details.--+ Explore the essential environment variables for configuring authentication+ services in LobeChat, including Better Auth, OAuth SSO, NextAuth settings, and+ provider-specific details.tags:- Authentication Service- Better Auth@@ -20,13 +20,6 @@ LobeChat provides a complete authentication service capability when deployed. Th### General Settings-#### `NEXT_PUBLIC_ENABLE_BETTER_AUTH`--- Type: Required-- Description: Set to `1` to enable Better Auth service. When enabled, Better Auth will be used for authentication instead of Next Auth or Clerk.-- Default: `-`-- Example: `1`-#### `AUTH_SECRET`- Type: Required@@ -51,10 +44,10 @@ LobeChat provides a complete authentication service capability when deployed. Th#### `JWKS_KEY`- Type: Required-- Description: Generic JWKS (JSON Web Key Set) key for signing and verifying JWTs. Used for internal service authentication and other cryptographic operations. Must be a JWKS JSON string containing an RS256 RSA key pair. Falls back to `OIDC_JWKS_KEY` if not set (for backward compatibility).+- Description: JWKS (JSON Web Key Set) key for signing and verifying JWTs. Used for OIDC JWT token signing and internal service call authentication tokens. Must be a JWKS JSON string containing an RS256 RSA key pair.- Default: `-`-<OIDCJWKs />+<GenerateJWKSKey />#### `INTERNAL_JWT_EXPIRATION`diff --git a/docs/self-hosting/environment-variables/auth.zh-CN.mdx b/docs/self-hosting/environment-variables/auth.zh-CN.mdxindex ba78c287c8e..4dddbd8820f 100644--- a/docs/self-hosting/environment-variables/auth.zh-CN.mdx+++ b/docs/self-hosting/environment-variables/auth.zh-CN.mdx@@ -18,13 +18,6 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相### 通用设置-#### `NEXT_PUBLIC_ENABLE_BETTER_AUTH`--- 类型:必选-- 描述:设置为 `1` 以启用 Better Auth 服务。启用后,将使用 Better Auth 进行身份验证,而非 Next Auth 或 Clerk。-- 默认值:`-`-- 示例:`1`-#### `AUTH_SECRET`- 类型:必选@@ -49,10 +42,10 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相#### `JWKS_KEY`- 类型:必选-- 描述:用于签名和验证 JWT 的通用 JWKS(JSON Web Key Set)密钥。用于内部服务认证和其他加密操作。必须是包含 RS256 RSA 密钥对的 JWKS JSON 字符串。如果未设置,将回退到 `OIDC_JWKS_KEY`(向后兼容)。+- 描述:用于签名和验证 JWT 的 JWKS(JSON Web Key Set)密钥。用于 OIDC JWT token 签名和内部服务调用认证 token。必须是包含 RS256 RSA 密钥对的 JWKS JSON 字符串。- 默认值:`-`-<OIDCJWKs />+<GenerateJWKSKey />#### `INTERNAL_JWT_EXPIRATION`diff --git a/docs/self-hosting/environment-variables/basic.mdx b/docs/self-hosting/environment-variables/basic.mdxindex ef69cdfa125..c8138346432 100644--- a/docs/self-hosting/environment-variables/basic.mdx+++ b/docs/self-hosting/environment-variables/basic.mdx@@ -1,13 +1,13 @@---title: Customize LobeChat Deployment with Environment Variablesdescription: >-- Learn about the common environment variables used to customize LobeChat deployment, including access code, OAuth SSO, base path, and default agent configuration.-+ Learn about the common environment variables used to customize LobeChat+ deployment, including OAuth SSO, base path, and default agent+ configuration.tags:- LobeChat- environment variables- deployment- - access code- OAuth SSO- base path- default agent configuration@@ -19,13 +19,6 @@ LobeChat provides some additional configuration options during deployment, which## Common Variables-### `ACCESS_CODE`--- Type: Optional-- Description: Add a password to access the LobeChat service. You can set a long password to prevent brute force attacks.-- Default: --- Example: `awCTe)re_r74` or `rtrt_ewee3@09!`-### `API_KEY_SELECT_MODE`- Type:Optionaldiff --git a/docs/self-hosting/environment-variables/basic.zh-CN.mdx b/docs/self-hosting/environment-variables/basic.zh-CN.mdxindex c1818111609..1fc05e7afad 100644--- a/docs/self-hosting/environment-variables/basic.zh-CN.mdx+++ b/docs/self-hosting/environment-variables/basic.zh-CN.mdx@@ -16,13 +16,6 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境## 通用变量-### `ACCESS_CODE`--- 类型:可选-- 描述:添加访问 LobeChat 服务的密码,你可以设置一个长密码以防被爆破-- 默认值:--- 示例:`awCTe)re_r74` or `rtrt_ewee3@09!`-### `API_KEY_SELECT_MODE`- 类型:可选diff --git a/docs/self-hosting/environment-variables/model-provider.mdx b/docs/self-hosting/environment-variables/model-provider.mdxindex 29d5cee4f14..b4384465fe9 100644--- a/docs/self-hosting/environment-variables/model-provider.mdx+++ b/docs/self-hosting/environment-variables/model-provider.mdx@@ -1,9 +1,9 @@---title: LobeChat Model Service Providers - Environment Variables and Configurationdescription: >-- Learn about the environment variables and configuration settings for various model service providers like OpenAI, Google AI, AWS Bedrock, Ollama, Perplexity AI, Anthropic AI, Mistral AI, Groq AI, OpenRouter AI, and 01.AI.--+ Learn about the environment variables and configuration settings for various+ model service providers like OpenAI, Google AI, AWS Bedrock, Ollama,+ Perplexity AI, Anthropic AI, Mistral AI, Groq AI, OpenRouter AI, and 01.AI.tags:- Model Service Providers- Environment Variables@@ -144,7 +144,6 @@ If you need to use Azure OpenAI to provide model services, you can refer to the- Default: `global`- Example: `us-central1`-### `VERTEXAI_MODEL_LIST`- Type: Optionaldiff --git a/docs/self-hosting/environment-variables/s3.mdx b/docs/self-hosting/environment-variables/s3.mdxindex 8e8f5e73d49..a068b0dcbb5 100644--- a/docs/self-hosting/environment-variables/s3.mdx+++ b/docs/self-hosting/environment-variables/s3.mdx@@ -1,8 +1,8 @@---title: Configuring S3 Storage Servicedescription: >-- Learn how to configure S3 storage service to support multimodal AI sessions and image uploads.-+ Learn how to configure S3 storage service to support multimodal AI sessions+ and image uploads.tags:- S3 Storage- Multimodal AIdiff --git a/docs/self-hosting/examples/azure-openai.mdx b/docs/self-hosting/examples/azure-openai.mdxindex 6b453bfd47d..1a9275059ca 100644--- a/docs/self-hosting/examples/azure-openai.mdx+++ b/docs/self-hosting/examples/azure-openai.mdx@@ -1,8 +1,8 @@---title: Configuring Azure OpenAI for LobeChatdescription: >-- Learn how to configure Azure OpenAI for LobeChat, including interface configuration, and deployment settings.-+ Learn how to configure Azure OpenAI for LobeChat, including interface+ configuration, and deployment settings.tags:- Azure OpenAI- LobeChat@@ -40,4 +40,3 @@ If you want the deployed version to be pre-configured with Azure OpenAI for end| `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.mdxindex f875ccac765..dfa2456c8ee 100644--- a/docs/self-hosting/examples/azure-openai.zh-CN.mdx+++ b/docs/self-hosting/examples/azure-openai.zh-CN.mdx@@ -42,4 +42,3 @@ LobeChat 支持使用 [Azure OpenAI](https://learn.microsoft.com/zh-cn/azure/ai-| `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.mdxindex 92f7f09efb8..bb5f60121a0 100644--- a/docs/self-hosting/examples/ollama.mdx+++ b/docs/self-hosting/examples/ollama.mdx@@ -1,8 +1,9 @@---title: Integrating LobeChat with Ollama for Enhanced Language Modelsdescription: >-- Learn how to configure and deploy LobeChat to leverage Ollama's powerful language models locally. Follow the guide to run Ollama and LobeChat on your system.-+ Learn how to configure and deploy LobeChat to leverage Ollama's powerful+ language models locally. Follow the guide to run Ollama and LobeChat on your+ system.tags:- Ollama integration- LobeChat configurationdiff --git a/docs/self-hosting/faq/no-v1-suffix.mdx b/docs/self-hosting/faq/no-v1-suffix.mdxindex 214fd6ea9bb..95bb2755af5 100644--- a/docs/self-hosting/faq/no-v1-suffix.mdx+++ b/docs/self-hosting/faq/no-v1-suffix.mdx@@ -1,10 +1,10 @@---title: >-- Troubleshooting `OPENAI_PROXY_URL` in LobeChat Configuration for Empty Response-+ Troubleshooting `OPENAI_PROXY_URL` in LobeChat Configuration for Empty+ Responsedescription: >-- Learn how to troubleshoot and resolve the issue of receiving an empty response after configuring the LobeChat `OPENAI_PROXY_URL` environment variable.-+ Learn how to troubleshoot and resolve the issue of receiving an empty response+ after configuring the LobeChat `OPENAI_PROXY_URL` environment variable.tags:- OPENAI_PROXY_URL- environment variablediff --git a/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx b/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdxindex e8f65ce1786..82530888ab4 100644--- a/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx+++ b/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx@@ -1,8 +1,9 @@---title: Resolving `UNABLE_TO_VERIFY_LEAF_SIGNATURE` Error in LobeChat When Using Proxydescription: >-- Learn how to bypass Node.js certificate validation to resolve certificate verification errors in LobeChat when using a proxy with self-signed or untrusted certificates.-+ Learn how to bypass Node.js certificate validation to resolve certificate+ verification errors in LobeChat when using a proxy with self-signed or+ untrusted certificates.tags:- Node.js- certificate validationdiff --git a/docs/self-hosting/faq/vercel-ai-image-timeout.mdx b/docs/self-hosting/faq/vercel-ai-image-timeout.mdxindex 414577ca2bf..51b4cf06eef 100644--- a/docs/self-hosting/faq/vercel-ai-image-timeout.mdx+++ b/docs/self-hosting/faq/vercel-ai-image-timeout.mdx@@ -1,8 +1,8 @@---title: Resolving AI Image Generation Timeout on Verceldescription: >-- Learn how to resolve timeout issues when using AI image generation models like gpt-image-1 on Vercel by enabling Fluid Compute for extended execution time.-+ Learn how to resolve timeout issues when using AI image generation models like+ gpt-image-1 on Vercel by enabling Fluid Compute for extended execution time.tags:- Vercel- AI Image Generationdiff --git a/docs/self-hosting/migration/v2/breaking-changes.mdx b/docs/self-hosting/migration/v2/breaking-changes.mdxnew file mode 100644index 00000000000..0513f41e9bb--- /dev/null+++ b/docs/self-hosting/migration/v2/breaking-changes.mdx@@ -0,0 +1,73 @@+---+title: LobeHub 2.0 Breaking Changes+description: >-+ A comprehensive guide to breaking changes in LobeHub 2.0 and how to migrate+ from version 1.x.+tags:+ - LobeHub 2.0+ - Migration+ - Breaking Changes+ - Authentication+---++# LobeHub 2.0 Breaking Changes++This document outlines the breaking changes introduced in LobeHub 2.0 and provides migration guidance for users upgrading from version 1.x.++## Removed Environment Variables++The following environment variables have been removed in LobeHub 2.0:++| Environment Variable | Removal Reason |+| ----------------------------------- | ----------------------------------------------------------------- |+| `ACCESS_CODE` | No longer supported, use Better Auth authentication system |+| `NEXT_PUBLIC_SERVICE_MODE` | 2.0 only supports Server DB mode, Client DB (PGlite) removed |+| `NEXT_PUBLIC_ENABLE_BETTER_AUTH` | Automatically detected via `AUTH_SECRET` presence |+| `NEXT_PUBLIC_AUTH_URL` / `AUTH_URL` | Automatically detected from request headers |+| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | NextAuth removed |+| `NEXT_AUTH_SECRET` | NextAuth removed |+| `NEXT_AUTH_SSO_PROVIDERS` | NextAuth removed |+| `NEXTAUTH_URL` | NextAuth removed |+| `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` | Clerk removed |+| `CLERK_SECRET_KEY` | Clerk removed |++## New Required Environment Variables++LobeHub 2.0 only supports Better Auth authentication system. The following environment variables are now required:++- `AUTH_SECRET`: Used to encrypt session tokens+- `JWKS_KEY`: Used to sign and verify JWTs, including OIDC JWT tokens and internal service call authentication tokens++## New Optional Environment Variables++| Environment Variable | Description |+| ---------------------------------- | ---------------------------------------------------------------- |+| `AUTH_SSO_PROVIDERS` | Comma-separated list of enabled SSO providers |+| `INTERNAL_JWT_EXPIRATION` | Internal JWT token expiration time (default: `30s`) |+| `NEXT_PUBLIC_AUTH_EMAIL_VERIFICATION` | Set to `1` to require email verification |+| `SMTP_HOST` | SMTP server hostname for email features |+| `SMTP_PORT` | SMTP server port |+| `SMTP_USER` | SMTP authentication username |+| `SMTP_PASS` | SMTP authentication password |++For detailed configuration, see [Authentication Environment Variables](/docs/self-hosting/environment-variables/auth).++## Authentication System Changes++LobeHub 2.0 only supports Better Auth authentication system. NextAuth and Clerk are no longer supported.++## Migration Guide++### Migrating from NextAuth++Detailed migration guide coming soon.++### Migrating from Clerk++Detailed migration guide coming soon.++## Database Mode Changes++LobeHub 2.0 only supports Server DB mode. Client DB (PGlite) is no longer supported. If you were using `NEXT_PUBLIC_SERVICE_MODE=client`, you need to migrate to Server DB deployment.++For deployment guides, see [Server Database Deployment](/docs/self-hosting/server-database).diff --git a/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx b/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdxnew file mode 100644index 00000000000..2d596a9b03c--- /dev/null+++ b/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx@@ -0,0 +1,71 @@+---+title: LobeHub 2.0 破坏性变更+description: LobeHub 2.0 破坏性变更完整指南,帮助用户从 1.x 版本升级到 2.0 版本。+tags:+ - LobeHub 2.0+ - 迁移指南+ - 破坏性变更+ - 身份验证+---++# LobeHub 2.0 破坏性变更++本文档概述了 LobeHub 2.0 中引入的破坏性变更,并为从 1.x 版本升级的用户提供迁移指南。++## 移除的环境变量++以下环境变量在 LobeHub 2.0 中已被移除:++| 环境变量 | 移除原因 |+| ----------------------------------- | ------------------------------------------------------- |+| `ACCESS_CODE` | 不再支持,请使用 Better Auth 认证系统 |+| `NEXT_PUBLIC_SERVICE_MODE` | 2.0 仅支持 Server DB 模式,不再支持 Client DB (PGlite) |+| `NEXT_PUBLIC_ENABLE_BETTER_AUTH` | 通过 `AUTH_SECRET` 是否存在自动检测 |+| `NEXT_PUBLIC_AUTH_URL` / `AUTH_URL` | 从请求头中自动检测 |+| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | NextAuth 已移除 |+| `NEXT_AUTH_SECRET` | NextAuth 已移除 |+| `NEXT_AUTH_SSO_PROVIDERS` | NextAuth 已移除 |+| `NEXTAUTH_URL` | NextAuth 已移除 |+| `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` | Clerk 已移除 |+| `CLERK_SECRET_KEY` | Clerk 已移除 |++## 新增的必需环境变量++LobeHub 2.0 仅支持 Better Auth 认证系统。以下环境变量现在是必需的:++- `AUTH_SECRET`:用于加密会话令牌+- `JWKS_KEY`:用于签名和验证 JWT,包括 OIDC JWT token 和内部服务调用认证 token++## 新增的可选环境变量++| 环境变量 | 说明 |+| ------------------------------------- | -------------------------------------- |+| `AUTH_SSO_PROVIDERS` | 启用的 SSO 提供商列表,以逗号分隔 |+| `INTERNAL_JWT_EXPIRATION` | 内部 JWT 令牌过期时间(默认:`30s`) |+| `NEXT_PUBLIC_AUTH_EMAIL_VERIFICATION` | 设置为 `1` 以要求邮箱验证 |+| `SMTP_HOST` | 邮件功能的 SMTP 服务器主机名 |+| `SMTP_PORT` | SMTP 服务器端口 |+| `SMTP_USER` | SMTP 认证用户名 |+| `SMTP_PASS` | SMTP 认证密码 |++详细配置请参阅[身份验证环境变量](/docs/self-hosting/environment-variables/auth)。++## 认证系统变更++LobeHub 2.0 仅支持 Better Auth 认证系统,不再支持 NextAuth 和 Clerk。++## 迁移指南++### 从 NextAuth 迁移++详细迁移指南即将推出。++### 从 Clerk 迁移++详细迁移指南即将推出。++## 数据库模式变更++LobeHub 2.0 仅支持 Server DB 模式,不再支持 Client DB (PGlite)。如果您之前使用 `NEXT_PUBLIC_SERVICE_MODE=client`,需要迁移到 Server DB 部署方式。++详细部署指南请参阅[服务端数据库部署](/docs/self-hosting/server-database)。diff --git a/docs/self-hosting/platform/alibaba-cloud.mdx b/docs/self-hosting/platform/alibaba-cloud.mdxindex 9691bfd60d5..73d9a161bb1 100644--- a/docs/self-hosting/platform/alibaba-cloud.mdx+++ b/docs/self-hosting/platform/alibaba-cloud.mdx@@ -1,13 +1,12 @@---title: Deploy LobeChat on Alibaba Clouddescription: >-- Learn how to deploy the LobeChat application on Alibaba Cloud, including preparing the large model API Key, clicking the deploy button, and other operations.-+ Learn how to deploy the LobeChat application on Alibaba Cloud, including+ clicking the deploy button and other operations.tags:- Alibaba Cloud- LobeChat- Alibaba Cloud Compute Nest- - API Key---# Deploy LobeChat with Alibaba Cloud@@ -17,10 +16,6 @@ If you want to deploy LobeChat on Alibaba Cloud, you can follow the steps below:## Alibaba Cloud Deployment Process<Steps>- ### 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.-### One-click to deploy[![][deploy-button-image]][deploy-link]diff --git a/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx b/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdxindex b7395f167cc..9732e944010 100644--- a/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx+++ b/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx@@ -1,11 +1,10 @@---title: 在 阿里云 上部署 LobeChat-description: 学习如何在阿里云上部署LobeChat应用,包括准备大模型 API Key、点击部署按钮等操作。+description: 学习如何在阿里云上部署 LobeChat 应用,包括点击部署按钮等操作。tags:- 阿里云- LobeChat- 部署流程- - 大模型 API Key---# 使用 阿里云计算巢 部署@@ -15,10 +14,6 @@ tags:## 阿里云 部署流程<Steps>- ### 准备好你的 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]diff --git a/docs/self-hosting/platform/btpanel.mdx b/docs/self-hosting/platform/btpanel.mdxindex 7f250bf5ede..90347591abc 100644--- a/docs/self-hosting/platform/btpanel.mdx+++ b/docs/self-hosting/platform/btpanel.mdx@@ -1,8 +1,10 @@---title: Deploy LobeChat using aaPaneldescription: >-- Learn how to deploy the LobeChat service using aaPanel-Docker, including installing the Docker container environment and using the command to start the service with one click. Detailed instructions on how to configure environment variables and use proxy addresses.-+ Learn how to deploy the LobeChat service using aaPanel-Docker, including+ installing the Docker container environment and using the command to start the+ service with one click. Detailed instructions on how to configure environment+ variables and use proxy addresses.tags:- Docker- LobeChatdiff --git a/docs/self-hosting/platform/btpanel.zh-CN.mdx b/docs/self-hosting/platform/btpanel.zh-CN.mdxindex 4dc65dcc198..bfebf84680b 100644--- a/docs/self-hosting/platform/btpanel.zh-CN.mdx+++ b/docs/self-hosting/platform/btpanel.zh-CN.mdx@@ -1,8 +1,8 @@---title: 通过 宝塔面板Docker应用商店 部署 LobeChatdescription: >-- 学习如何使用 宝塔面板Docker应用 部署 LobeChat 服务,包括安装 Docker 容器环境和使用指令一键启动服务。详细说明如何配置环境变量和使用代理地址。-+ 学习如何使用 宝塔面板Docker应用 部署 LobeChat 服务,包括安装 Docker+ 容器环境和使用指令一键启动服务。详细说明如何配置环境变量和使用代理地址。tags:- Docker- LobeChatdiff --git a/docs/self-hosting/platform/docker-compose.mdx b/docs/self-hosting/platform/docker-compose.mdxindex f850e7a4d4c..a0c3b4c01f5 100644--- a/docs/self-hosting/platform/docker-compose.mdx+++ b/docs/self-hosting/platform/docker-compose.mdx@@ -1,8 +1,9 @@---title: Deploy LobeChat with Docker Composedescription: >-- Learn how to deploy the LobeChat service using Docker Compose. Follow step-by-step instructions to install Docker, run the deployment command, and set up automatic updates.-+ Learn how to deploy the LobeChat service using Docker Compose. Follow+ step-by-step instructions to install Docker, run the deployment command, and+ set up automatic updates.tags:- Docker Compose- LobeChat Service@@ -59,7 +60,6 @@ We provide a [Docker image][docker-release-link] for deploying the LobeChat servenvironment:OPENAI_API_KEY: sk-xxxxOPENAI_PROXY_URL: https://api-proxy.com/v1- ACCESS_CODE: lobe66```Run the following command to start the Lobe Chat service:diff --git a/docs/self-hosting/platform/docker-compose.zh-CN.mdx b/docs/self-hosting/platform/docker-compose.zh-CN.mdxindex 04c75cd45a5..b6aa7b9be7b 100644--- a/docs/self-hosting/platform/docker-compose.zh-CN.mdx+++ b/docs/self-hosting/platform/docker-compose.zh-CN.mdx@@ -57,7 +57,6 @@ tags:environment:OPENAI_API_KEY: sk-xxxxOPENAI_PROXY_URL: https://api-proxy.com/v1- ACCESS_CODE: lobe66```运行以下命令启动 Lobe Chat 服务:diff --git a/docs/self-hosting/platform/docker.mdx b/docs/self-hosting/platform/docker.mdxindex 5fdd91416f5..8793dc34530 100644--- a/docs/self-hosting/platform/docker.mdx+++ b/docs/self-hosting/platform/docker.mdx@@ -1,8 +1,8 @@---title: Deploy LobeChat with Dockerdescription: >-- Learn how to deploy the LobeChat service using Docker, including installation steps, command deployment, proxy configuration, and automatic update scripts.-+ Learn how to deploy the LobeChat service using Docker, including installation+ steps, command deployment, proxy configuration, and automatic update scripts.tags:- Docker Deployment- LobeChat Service@@ -49,7 +49,6 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat```fish$ docker run -d -p 3210:3210 \-e OPENAI_API_KEY=sk-xxxx \- -e ACCESS_CODE=lobe66 \--name lobe-chat \lobehub/lobe-chat```@@ -67,12 +66,6 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChatprompt after deployment, you can wait for the image to finish building before deploying again.</Callout>- <Callout type="warning">- 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).- </Callout>-<Callout type="important">Note that when the **deployment architecture is inconsistent with the image**, you need tocross-compile **Sharp**, see [Sharp@@ -87,7 +80,6 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat$ 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```@@ -101,7 +93,6 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat```envOPENAI_API_KEY=sk-xxxxOPENAI_PROXY_URL=https://api-proxy.com/v1- ACCESS_CODE=arthals2333OPENAI_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```diff --git a/docs/self-hosting/platform/docker.zh-CN.mdx b/docs/self-hosting/platform/docker.zh-CN.mdxindex c68f414a77e..d23c1365b12 100644--- a/docs/self-hosting/platform/docker.zh-CN.mdx+++ b/docs/self-hosting/platform/docker.zh-CN.mdx@@ -50,7 +50,6 @@ tags:```fish$ docker run -d -p 3210:3210 \-e OPENAI_API_KEY=sk-xxxx \- -e ACCESS_CODE=lobe66 \--name lobe-chat \lobehub/lobe-chat```@@ -70,11 +69,6 @@ tags:镜像构建大约需要半小时左右,如果在更新部署后会出现「存在更新」的提示,可以等待镜像构建完成后再次部署。</Callout>- <Callout type="warning">- 官方 Docker 镜像中未设定密码,强烈建议添加密码以提升安全性,否则你可能会遇到 [My API Key was- stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123) 这样的情况- </Callout>-<Callout type="important">注意,当**部署架构与镜像的不一致时**,需要对 **Sharp** 进行交叉编译,详见 [Sharp交叉编译](https://sharp.pixelplumbing.com/install#cross-platform)@@ -88,7 +82,6 @@ tags:$ 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```@@ -102,7 +95,6 @@ tags:```envOPENAI_API_KEY=sk-xxxxOPENAI_PROXY_URL=https://api-proxy.com/v1- ACCESS_CODE=arthals2333OPENAI_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```diff --git a/docs/self-hosting/platform/netlify.mdx b/docs/self-hosting/platform/netlify.mdxindex bddf7162a4d..9833d81e49b 100644--- a/docs/self-hosting/platform/netlify.mdx+++ b/docs/self-hosting/platform/netlify.mdx@@ -1,12 +1,12 @@---title: Deploy LobeChat with Netlify - Step-by-Step Guidedescription: >-- Learn how to deploy LobeChat on Netlify with detailed instructions on forking the repository, preparing your OpenAI API Key, importing to Netlify workspace, configuring site name and environment variables, and monitoring deployment progress.-+ Learn how to deploy LobeChat on Netlify with detailed instructions on forking+ the repository, importing to Netlify workspace, configuring site name and+ environment variables, and monitoring deployment progress.tags:- Deploy LobeChat- Netlify Deployment- - OpenAI API Key- Environment Variables- Custom Domain Setup---@@ -22,10 +22,6 @@ If you want to deploy LobeChat on Netlify, you can follow these steps:Click the Fork button to fork the LobeChat repository to your GitHub account.- ### Prepare 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<Callout>@@ -51,24 +47,16 @@ If you want to deploy LobeChat on Netlify, you can follow these steps:<Image alt={'Configure LobeChat site name'} height={712} inStep src={'https://github.com/lobehub/lobe-chat/assets/28616219/f3885537-6d43-422f-b1b8-e70732401025'} />- Click the "Add environment variables" button to add site environment variables:+ Click the "Add environment variables" button to add site environment variables if needed:<Image alt={'Add LobeChat site environment variables'} height={537} inStep src={'https://github.com/lobehub/lobe-chat/assets/28616219/3b607482-4d99-455a-bc10-3090dd4fe3c5'} />- 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` |-<Callout type={'tip'}>For a complete list of environment variables supported by LobeChat, please refer to the [📘Environment Variables](/docs/self-hosting/environment-variables)</Callout>- Afteradding the variables, finally click "Deploy lobe-chat" to enter the deployment phase+ Finally click "Deploy lobe-chat" to enter the deployment phase<Image alt={'Environment variables added'} height={600} inStep src={'https://github.com/lobehub/lobe-chat/assets/28616219/c9f74ec4-ce63-4ce9-b9e2-34bda6fda10b'} />diff --git a/docs/self-hosting/platform/netlify.zh-CN.mdx b/docs/self-hosting/platform/netlify.zh-CN.mdxindex 42f1523976a..b8f6c9985fc 100644--- a/docs/self-hosting/platform/netlify.zh-CN.mdx+++ b/docs/self-hosting/platform/netlify.zh-CN.mdx@@ -1,13 +1,11 @@---title: 在 Netlify 上部署 LobeChatdescription: >-- 学习如何在 Netlify 上部署 LobeChat,包括 Fork 仓库、准备 OpenAI API Key、导入到 Netlify 工作台、配置站点名称与环境变量等步骤。-+ 学习如何在 Netlify 上部署 LobeChat,包括 Fork 仓库、导入到 Netlify 工作台、配置站点名称与环境变量等步骤。tags:- Netlify- LobeChat- 部署教程- - OpenAI API Key- 环境配置---@@ -22,10 +20,6 @@ tags:点击 Fork 按钮,将 LobeChat 仓库 Fork 到你的 GitHub 账号下。- ### 准备好你的 OpenAI API Key-- 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key-### 在 Netlify 工作台导入<Callout>经过测试,暂不支持类似 Vercel/Zeabur 的一键部署按钮,原因未知。因此需要手动导入</Callout>@@ -48,24 +42,16 @@ tags:<Image alt={'配置 LobeChat 站点名称'} height={712} inStep src={'https://github.com/lobehub/lobe-chat/assets/28616219/f3885537-6d43-422f-b1b8-e70732401025'} />- 点击 「Add environment variables」按钮,添加站点环境变量:+ 如需要,点击 「Add environment variables」按钮添加站点环境变量:<Image alt={'添加 LobeChat 站点环境变量'} height={537} inStep src={'https://github.com/lobehub/lobe-chat/assets/28616219/3b607482-4d99-455a-bc10-3090dd4fe3c5'} />- 以配置 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` |-<Callout type={'tip'}>LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables)部分</Callout>- 添加完成后,最后点击「Deploy lobe-chat」 进入部署阶段。+ 最后点击「Deploy lobe-chat」进入部署阶段。<Image alt={'环境变量添加完成'} height={600} inStep src={'https://github.com/lobehub/lobe-chat/assets/28616219/c9f74ec4-ce63-4ce9-b9e2-34bda6fda10b'} />diff --git a/docs/self-hosting/platform/railway.mdx b/docs/self-hosting/platform/railway.mdxindex b311598e9d1..bc022487c07 100644--- a/docs/self-hosting/platform/railway.mdx+++ b/docs/self-hosting/platform/railway.mdx@@ -1,12 +1,12 @@---title: Deploy LobeChat with Railwaydescription: >-- Learn how to deploy LobeChat on Railway and follow the step-by-step process. Get your OpenAI API Key, deploy with a click, and start using it. Optionally, bind a custom domain for your deployment.-+ Learn how to deploy LobeChat on Railway and follow the step-by-step process.+ Deploy with a click and start using it. Optionally, bind a custom domain for+ your deployment.tags:- Deploy LobeChat- Railway Deployment- - OpenAI API Key- Custom Domain Binding---@@ -17,10 +17,6 @@ If you want to deploy LobeChat on Railway, you can follow the steps below:## Railway Deployment Process<Steps>- ### Prepare 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[](https://railway.app/template/FB6HrV?referralCode=9bD9mT)diff --git a/docs/self-hosting/platform/railway.zh-CN.mdx b/docs/self-hosting/platform/railway.zh-CN.mdxindex 4f466ede016..77e54aa046d 100644--- a/docs/self-hosting/platform/railway.zh-CN.mdx+++ b/docs/self-hosting/platform/railway.zh-CN.mdx@@ -1,12 +1,10 @@---title: 在 Railway 上部署 LobeChat-description: 学习如何在 Railway 上部署 LobeChat 应用,包括准备 OpenAI API Key、点击按钮进行部署、绑定自定义域名等步骤。+description: 学习如何在 Railway 上部署 LobeChat 应用,包括点击按钮进行部署、绑定自定义域名等步骤。tags:- Railway- 部署- LobeChat- - OpenAI- - API Key- 自定义域名---@@ -17,10 +15,6 @@ tags:## Railway 部署流程<Steps>- ### 准备好你的 OpenAI API Key-- 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key-### 点击下方按钮进行部署[](https://railway.app/template/FB6HrV?referralCode=9bD9mT)diff --git a/docs/self-hosting/platform/repocloud.mdx b/docs/self-hosting/platform/repocloud.mdxindex a8daa99d50a..e0a7a00fae6 100644--- a/docs/self-hosting/platform/repocloud.mdx+++ b/docs/self-hosting/platform/repocloud.mdx@@ -1,12 +1,12 @@---title: Deploy LobeChat on RepoClouddescription: >-- Learn how to deploy LobeChat on RepoCloud with ease. Follow these steps to prepare your OpenAI API Key, deploy the application, and start using it. Optional: Bind a custom domain for a personalized touch.-+ Learn how to deploy LobeChat on RepoCloud with ease. Follow these steps to+ deploy the application and start using it. Optional: Bind a custom domain for+ a personalized touch.tags:- Deploy LobeChat- RepoCloud Deployment- - OpenAI API Key- Custom Domain Binding---@@ -17,10 +17,6 @@ If you want to deploy LobeChat on RepoCloud, you can follow the steps below:## RepoCloud Deployment Process<Steps>- ### Prepare 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[![][deploy-button-image]][deploy-link]diff --git a/docs/self-hosting/platform/repocloud.zh-CN.mdx b/docs/self-hosting/platform/repocloud.zh-CN.mdxindex 58d0e8097ee..9e3bb81ad39 100644--- a/docs/self-hosting/platform/repocloud.zh-CN.mdx+++ b/docs/self-hosting/platform/repocloud.zh-CN.mdx@@ -1,11 +1,10 @@---title: 在 RepoCloud 上部署 LobeChat-description: 学习如何在RepoCloud上部署LobeChat应用,包括准备OpenAI API Key、点击部署按钮、绑定自定义域名等操作。+description: 学习如何在 RepoCloud 上部署 LobeChat 应用,包括点击部署按钮、绑定自定义域名等操作。tags:- RepoCloud- LobeChat- 部署流程- - OpenAI API Key- 自定义域名---@@ -16,10 +15,6 @@ tags:## RepoCloud 部署流程<Steps>- ### 准备好你的 OpenAI API Key-- 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key-### 点击下方按钮进行部署[![][deploy-button-image]][deploy-link]diff --git a/docs/self-hosting/platform/sealos.mdx b/docs/self-hosting/platform/sealos.mdxindex ca23eca26b5..562b8ada20b 100644--- a/docs/self-hosting/platform/sealos.mdx+++ b/docs/self-hosting/platform/sealos.mdx@@ -1,12 +1,11 @@---title: Deploy LobeChat on Sealosdescription: >-- Learn how to deploy LobeChat on Sealos with ease. Follow the provided steps to set up LobeChat and start using it efficiently.-+ Learn how to deploy LobeChat on Sealos with ease. Follow the provided steps to+ set up LobeChat and start using it efficiently.tags:- Deploy LobeChat- Sealos Deployment- - OpenAI API Key- Custom Domain Binding---@@ -17,10 +16,6 @@ If you want to deploy LobeChat on Sealos, you can follow the steps below:## Sealos Deployment Process<Steps>- ### Prepare 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[![][deploy-button-image]][deploy-link]diff --git a/docs/self-hosting/platform/sealos.zh-CN.mdx b/docs/self-hosting/platform/sealos.zh-CN.mdxindex ee766901cf4..42d4fc15721 100644--- a/docs/self-hosting/platform/sealos.zh-CN.mdx+++ b/docs/self-hosting/platform/sealos.zh-CN.mdx@@ -1,10 +1,9 @@---title: 在 Sealos 上部署 LobeChat-description: 学习如何在 Sealos 上部署 LobeChat,包括准备 OpenAI API Key、点击部署按钮、绑定自定义域名等操作。+description: 学习如何在 Sealos 上部署 LobeChat,包括点击部署按钮、绑定自定义域名等操作。tags:- Sealos- LobeChat- - OpenAI API Key- 部署流程- 自定义域名---@@ -16,10 +15,6 @@ tags:## Sealos 部署流程<Steps>- ### 准备好你的 OpenAI API Key-- 前往 [OpenAI](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key-### 点击下方按钮进行部署[![][deploy-button-image]][deploy-link]diff --git a/docs/self-hosting/platform/tencentcloud-lighthouse.mdx b/docs/self-hosting/platform/tencentcloud-lighthouse.mdxindex 696dd76914d..238b3e2151b 100644--- a/docs/self-hosting/platform/tencentcloud-lighthouse.mdx+++ b/docs/self-hosting/platform/tencentcloud-lighthouse.mdx@@ -1,13 +1,12 @@---title: Deploy LobeChat on TencentCloud Lighthousedescription: >-- Learn how to deploy the LobeChat application on TencentCloud Lighthouse, including preparing the large model API Key, clicking the deploy button, and other operations.-+ Learn how to deploy the LobeChat application on TencentCloud Lighthouse,+ including clicking the deploy button and other operations.tags:- TencentCloud Lighthouse- TencentCloud- LobeChat- - API Key---# Deploy LobeChat with TencentCloud Lighthouse@@ -17,10 +16,6 @@ If you want to deploy LobeChat on TencentCloud Lighthouse, you can follow the st## Tencent Cloud Deployment Process<Steps>- ### Prepare your API Key-- Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key.-### One-click to deploy[![][deploy-button-image]][deploy-link]diff --git a/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx b/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdxindex 395ca10a976..ffb76467f2d 100644--- a/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx+++ b/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx@@ -1,12 +1,11 @@---title: 在 腾讯轻量云 上部署 LobeChat-description: 学习如何快速在腾讯轻量云上部署LobeChat应用,包括准备大模型 API Key、点击部署按钮等操作。+description: 学习如何快速在腾讯轻量云上部署 LobeChat 应用,包括点击部署按钮等操作。tags:- 腾讯云- 腾讯轻量云- LobeChat- 部署流程- - 大模型 API Key---# 使用 腾讯轻量云 部署@@ -16,10 +15,6 @@ tags:## 腾讯轻量云 部署流程<Steps>- ### 准备好你的 API Key-- 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key-### 点击下方按钮进行部署[![][deploy-button-image]][deploy-link]diff --git a/docs/self-hosting/platform/vercel.mdx b/docs/self-hosting/platform/vercel.mdxindex 19863da82f5..c59af768975 100644--- a/docs/self-hosting/platform/vercel.mdx+++ b/docs/self-hosting/platform/vercel.mdx@@ -1,12 +1,11 @@---title: Deploy LobeChat with Verceldescription: >-- Learn how to deploy LobeChat on Vercel with ease. Follow the provided steps to prepare your OpenAI API Key, deploy the project, and start using it efficiently.-+ Learn how to deploy LobeChat on Vercel with ease. Follow the provided steps to+ deploy the project and start using it efficiently.tags:- Deploy LobeChat- Vercel Deployment- - OpenAI API Key- Custom Domain Binding---@@ -17,15 +16,11 @@ If you want to deploy LobeChat on Vercel, you can follow the steps below:## Vercel Deployment Process<Steps>- ### Prepare 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- [](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/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat\&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 to complete the deployment.### After deployment, you can start using itdiff --git a/docs/self-hosting/platform/vercel.zh-CN.mdx b/docs/self-hosting/platform/vercel.zh-CN.mdxindex acf68749bbe..952ac1b7e9c 100644--- a/docs/self-hosting/platform/vercel.zh-CN.mdx+++ b/docs/self-hosting/platform/vercel.zh-CN.mdx@@ -1,11 +1,10 @@---title: 在 Vercel 上部署 LobeChat-description: 学习如何在 Vercel 上一键部署 LobeChat,准备 OpenAI API Key,点击按钮进行部署,绑定自定义域名,自动同步更新等。+description: 学习如何在 Vercel 上一键部署 LobeChat,点击按钮进行部署,绑定自定义域名,自动同步更新等。tags:- Vercel- 部署指引- LobeChat- - OpenAI API Key- 自定义域名- 自动同步更新---@@ -17,15 +16,11 @@ tags:## Vercel 部署流程<Steps>- ### 准备好你的 OpenAI API Key-- 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key-### 点击下方按钮进行部署[![][deploy-button-image]][deploy-link]- 直接使用 GitHub 账号登录即可,记得在环境变量页填入 `OPENAI_API_KEY` (必填) and `ACCESS_CODE`(推荐);+ 直接使用 GitHub 账号登录即可完成部署。### 部署完毕后,即可开始使用@@ -44,4 +39,4 @@ tags:</Callout>[deploy-button-image]: https://vercel.com/button-[deploy-link]: 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+[deploy-link]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat&project-name=lobe-chat&repository-name=lobe-chatdiff --git a/docs/self-hosting/platform/zeabur.mdx b/docs/self-hosting/platform/zeabur.mdxindex 4509eb613eb..f18bfe67ffc 100644--- a/docs/self-hosting/platform/zeabur.mdx+++ b/docs/self-hosting/platform/zeabur.mdx@@ -1,12 +1,11 @@---title: Deploy LobeChat on Zeaburdescription: >-- Learn how to deploy LobeChat on Zeabur with ease. Follow the provided steps to set up your chat application seamlessly.-+ Learn how to deploy LobeChat on Zeabur with ease. Follow the provided steps to+ set up your chat application seamlessly.tags:- Deploy LobeChat- Zeabur Deployment- - OpenAI API Key- Custom Domain Binding---@@ -17,10 +16,6 @@ If you want to deploy LobeChat on Zeabur, you can follow the steps below:## Zeabur Deployment Process<Steps>- ### Prepare 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[![][deploy-button-image]][deploy-link]@@ -54,10 +49,6 @@ Since Zeabur does NOT officially support FREE users deploy containerized service}```- ### Prepare your OpenAI API Key-- Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key.-### Login to your [Zeabur dashboard](https://dash.zeabur.com)If you do not already have an account, you will need to register one.diff --git a/docs/self-hosting/platform/zeabur.zh-CN.mdx b/docs/self-hosting/platform/zeabur.zh-CN.mdxindex 8b6fc7e2100..810a0196748 100644--- a/docs/self-hosting/platform/zeabur.zh-CN.mdx+++ b/docs/self-hosting/platform/zeabur.zh-CN.mdx@@ -1,10 +1,9 @@---title: 在 Zeabur 上部署 LobeChat-description: 按照指南准备 OpenAI API Key 并点击按钮进行部署。在部署完成后,即可开始使用 LobeChat 并选择是否绑定自定义域名。+description: 点击按钮进行部署。在部署完成后,即可开始使用 LobeChat 并选择是否绑定自定义域名。tags:- Zeabur- LobeChat- - OpenAI API Key- 部署流程- 自定义域名---@@ -16,10 +15,6 @@ tags:## Zeabur 部署流程<Steps>- ### 准备好你的 OpenAI API Key-- 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key-### 点击下方按钮进行部署[![][deploy-button-image]][deploy-link]@@ -53,10 +48,6 @@ tags:}```- ### 准备您的 OpenAI API 密钥-- 前往 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。-### 登录到您的 [Zeabur 仪表板](https://dash.zeabur.com)如果您尚未拥有一个账号,您需要注册一个。diff --git a/docs/self-hosting/server-database.mdx b/docs/self-hosting/server-database.mdxindex 2486349dc4f..01cb3800169 100644--- a/docs/self-hosting/server-database.mdx+++ b/docs/self-hosting/server-database.mdx@@ -47,24 +47,6 @@ Before deployment, make sure you have a Postgres database instance ready. You caSince 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.<Steps>- ### `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`.-- For server-side database deployment scenarios, you need to set `NEXT_PUBLIC_SERVICE_MODE` to `server`.-- <Callout type={'info'}>- 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.- </Callout>-- <Callout type={'tip'}>- 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.- </Callout>-### `DATABASE_URL`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`.@@ -95,7 +77,7 @@ Since we support file-based conversations/knowledge base conversations, we need<Callout type={'info'}>You can generate a random 32-character string as the value of `KEY_VAULTS_SECRET` using `openssl- rand -base64 32`.+ rand -base64 32`.</Callout></Steps>diff --git a/docs/self-hosting/server-database.zh-CN.mdx b/docs/self-hosting/server-database.zh-CN.mdxindex cb46d107180..4f40d16ecbc 100644--- a/docs/self-hosting/server-database.zh-CN.mdx+++ b/docs/self-hosting/server-database.zh-CN.mdx@@ -45,23 +45,6 @@ LobeChat 默认使用客户端数据库(IndexedDB),同时也支持使用同时,由于我们支持了文件对话 / 知识库对话的能力,因此我们需要为 Postgres 安装 `pgvector` 插件,该插件提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。<Steps>- ### `NEXT_PUBLIC_SERVICE_MODE`-- LobeChat 同时支持了客户端数据库和服务端数据库,因此我们提供了一个环境变量用于切换模式,这个变量为 `NEXT_PUBLIC_SERVICE_MODE`,该值默认为 `client`。-- 针对服务端数据库部署场景,你需要将 `NEXT_PUBLIC_SERVICE_MODE` 设置为 `server`。-- <Callout type={'info'}>- 在官方的 `lobe-chat-database` Docker 镜像中,已经默认将该环境变量设为 `server`,因此如果你使用- Docker 镜像部署,则无需再配置该环境变量。- </Callout>-- <Callout type={'tip'}>- 由于 `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` 开头的环境变量打进去。- </Callout>-### `DATABASE_URL`配置数据库,核心是添加 `DATABASE_URL` 环境变量,将你准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。diff --git a/docs/self-hosting/server-database/docker-compose.mdx b/docs/self-hosting/server-database/docker-compose.mdxindex 3ab28d30908..0a1249b389f 100644--- a/docs/self-hosting/server-database/docker-compose.mdx+++ b/docs/self-hosting/server-database/docker-compose.mdx@@ -1,8 +1,8 @@---title: Deploying LobeChat with Docker Composedescription: >-- Learn how to deploy the LobeChat service using Docker Compose, including configuration tutorials for various services.-+ Learn how to deploy the LobeChat service using Docker Compose, including+ configuration tutorials for various services.tags:- Docker Compose- LobeChat@@ -20,15 +20,6 @@ tags:[![][docker-pulls-shield]][docker-pulls-link]</div>-<Callout type="warning">- **Note on Docker Deployment Limitations**- The Docker and Docker Compose deployment options do not support injecting the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` through environment variables, which prevents enabling the Clerk authentication service. Recommended alternatives include:-- - Hosting deployment via Vercel-- - Running a local image build process-</Callout>-## Quick Start<Callout type="info">@@ -246,15 +237,15 @@ The script supports the following deployment modes; please choose the appropriat- Choose the access protocol: `http` or `https`- Regenerate secure keys: We highly recommend regenerating the secure keys; if you lack the key generation library required by the script, we suggest referring to the [Custom Deployment](#custom-deployment) section for key modifications.- <Callout type="warning">- The following issues may impede access to your service:+ <Callout type="warning">+ The following issues may impede access to your service:- - The domain configuration here must match the reverse proxy configuration in step `1`.+ - The domain configuration here must match the reverse proxy configuration in step `1`.- - If you are using Cloudflare for domain resolution and have activated `full proxy`, please use the `https` protocol.+ - If you are using Cloudflare for domain resolution and have activated `full proxy`, please use the `https` protocol.- - If you have used the HTTPS protocol, ensure that your domain certificate is correctly configured; one-click deployment does not support self-signed certificates by default.- </Callout>+ - If you have used the HTTPS protocol, ensure that your domain certificate is correctly configured; one-click deployment does not support self-signed certificates by default.+ </Callout>### Check Configuration Generation Report@@ -701,12 +692,14 @@ environment:```**How it works:**+- `APP_URL`: Used for browser/client access, OAuth callbacks, webhooks, etc. (goes through CDN/proxy)- `INTERNAL_APP_URL`: Used for internal server-to-server communication (bypasses CDN/proxy)If `INTERNAL_APP_URL` is not set, it defaults to `APP_URL`.**Configuration options:**+- `http://localhost:3210` - If using Docker with host network mode- `http://lobe:3210` - If using Docker network with service name- `http://127.0.0.1:3210` - Alternative localhost address@@ -726,7 +719,7 @@ For convenience, here is a summary of example configuration files required for t# HTTP_PROXY=http://localhost:7890# HTTPS_PROXY=http://localhost:7890-# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.+# Other environment variables, as needed. You can refer to the environment variables configuration for the client version.# OPENAI_API_KEY=sk-xxxx# OPENAI_PROXY_URL=https://api.openai.com/v1# OPENAI_MODEL_LIST=...@@ -808,7 +801,6 @@ services:command: >server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"-casdoor:image: casbin/casdoorcontainer_name: lobe-casdoordiff --git a/docs/self-hosting/server-database/docker-compose.zh-CN.mdx b/docs/self-hosting/server-database/docker-compose.zh-CN.mdxindex 010d55a3213..6808e0b1af0 100644--- a/docs/self-hosting/server-database/docker-compose.zh-CN.mdx+++ b/docs/self-hosting/server-database/docker-compose.zh-CN.mdx@@ -18,16 +18,6 @@ tags:[![][docker-pulls-shield]][docker-pulls-link]</div>-<Callout type="warning">- **Docker 部署限制说明**- Docker 及 Docker Compose 部署方案不支持通过环境变量注入 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,- 因此无法启用 Clerk 身份验证服务。建议替代方案:-- - 采用 Vercel 托管部署-- - 执行本地镜像构建流程-</Callout>-## 快速启动<Callout type="info">@@ -234,15 +224,15 @@ bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN- 选择访问协议:`http` 或 `https`- 安全密钥重新生成:我们强烈建议你重新生成安全密钥,如果你缺少脚本所需的密钥生成库,我们建议你参考 [自定义部署](#自定义部署) 章节对密钥进行修改。- <Callout type="warning">- 以下问题可能导致你的服务无法正常访问:+ <Callout type="warning">+ 以下问题可能导致你的服务无法正常访问:- - 此处的域名配置需要与步骤`1`中的反向代理配置保持一致。+ - 此处的域名配置需要与步骤`1`中的反向代理配置保持一致。- - 如果你使用 Cloudflare 的域名解析服务并开启了 `全程代理`,请使用 `https` 协议。+ - 如果你使用 Cloudflare 的域名解析服务并开启了 `全程代理`,请使用 `https` 协议。- - 如果你使用了 HTTPS 协议,请确保你的域名证书已经正确配置,一键部署默认不支持自签发证书。- </Callout>+ - 如果你使用了 HTTPS 协议,请确保你的域名证书已经正确配置,一键部署默认不支持自签发证书。+ </Callout>### 查看配置生成报告@@ -665,7 +655,7 @@ docker compose up -d # 重新启动#### 使用 `INTERNAL_APP_URL` 配置内部服务器通信<Callout type="info">- 如果你在 CDN(如 Cloudflare)或反向代理后部署 LobeChat,你可以配置内部服务器到服务器通信以绕过 CDN/代理层,以获得更好的性能。+ 如果你在 CDN(如 Cloudflare)或反向代理后部署 LobeChat,你可以配置内部服务器到服务器通信以绕过 CDN / 代理层,以获得更好的性能。</Callout>你可以配置 `INTERNAL_APP_URL` 环境变量:@@ -677,12 +667,14 @@ environment:```**工作原理:**-- `APP_URL`:用于浏览器/客户端访问、OAuth 回调、webhook 等(通过 CDN/代理)-- `INTERNAL_APP_URL`:用于内部服务器到服务器通信(绕过 CDN/代理)++- `APP_URL`:用于浏览器 / 客户端访问、OAuth 回调、webhook 等(通过 CDN / 代理)+- `INTERNAL_APP_URL`:用于内部服务器到服务器通信(绕过 CDN / 代理)如果未设置 `INTERNAL_APP_URL`,它将默认为 `APP_URL`。**配置选项:**+- `http://localhost:3210` - 如果使用 Docker 主机网络模式- `http://lobe:3210` - 如果使用 Docker 网络与服务名称- `http://127.0.0.1:3210` - 备用本地主机地址@@ -702,7 +694,7 @@ environment:# HTTP_PROXY=http://localhost:7890# HTTPS_PROXY=http://localhost:7890-# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.+# Other environment variables, as needed. You can refer to the environment variables configuration for the client version.# OPENAI_API_KEY=sk-xxxx# OPENAI_PROXY_URL=https://api.openai.com/v1# OPENAI_MODEL_LIST=...@@ -784,7 +776,6 @@ services:command: >server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"-casdoor:image: casbin/casdoorcontainer_name: lobe-casdoordiff --git a/docs/self-hosting/server-database/docker.mdx b/docs/self-hosting/server-database/docker.mdxindex 981e0a5b73f..43e80ca4e78 100644--- a/docs/self-hosting/server-database/docker.mdx+++ b/docs/self-hosting/server-database/docker.mdx@@ -1,8 +1,8 @@---title: Deploying LobeChat Database with Dockerdescription: >-- Learn how to deploy the LobeChat server database version using Docker on Linux and local machines.-+ Learn how to deploy the LobeChat server database version using Docker on Linux+ and local machines.tags:- LobeChat- Docker@@ -28,11 +28,6 @@ tags:Database](/docs/self-hosting/server-database) first.</Callout>-<Callout type="warning">- 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.-</Callout>## Deploying on a Linux Server@@ -74,13 +69,11 @@ Here is the process for deploying the LobeChat server database version on a Linu# Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container nameDATABASE_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+ # Authentication (Better Auth)+ # Session encryption key (generate with: openssl rand -base64 32)+ AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=+ # JWKS key for signing and verifying JWTs (generate at: https://lobehub.com/docs/self-hosting/environment-variables/auth#jwks_key)+ JWKS_KEY='{"keys":[...]}'# S3 relatedS3_ACCESS_KEY_ID=xxxxxxxxxx@@ -89,10 +82,6 @@ Here is the process for deploying the LobeChat server database version on a LinuS3_BUCKET=lobechatS3_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@@ -141,13 +130,9 @@ The script command you need to execute is:$ docker run -it -d --name lobe-chat-database -p 3210:3210 \-e DATABASE_URL=postgres://postgres:[email protected]:5432/postgres \-e KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \- -e NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 \- -e NEXT_AUTH_SSO_PROVIDERS=auth0 \- -e AUTH_AUTH0_ID=xxxxxx \- -e AUTH_AUTH0_SECRET=cSX_xxxxx \- -e AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com \+ -e AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \+ -e JWKS_KEY='{"keys":[...]}' \-e APP_URL=http://localhost:3210 \- -e NEXTAUTH_URL=http://localhost:3210/api/auth \-e S3_ACCESS_KEY_ID=xxxxxxxxxx \-e S3_SECRET_ACCESS_KEY=xxxxxxxxxx \-e S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com \diff --git a/docs/self-hosting/server-database/docker.zh-CN.mdx b/docs/self-hosting/server-database/docker.zh-CN.mdxindex 22fc9e3760d..d59597b4d42 100644--- a/docs/self-hosting/server-database/docker.zh-CN.mdx+++ b/docs/self-hosting/server-database/docker.zh-CN.mdx@@ -26,12 +26,6 @@ tags:存储服务](/zh/docs/self-hosting/advanced/s3/tencent-cloud)。</Callout>-<Callout type="warning">- 由于无法使用 Docker 环境变量暴露 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,使用 Docker / Docker Compose- 部署 LobeChat 时,你不能使用 Clerk 作为登录鉴权服务。-- 如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。-</Callout>## 在 Linux 服务器上部署@@ -72,13 +66,11 @@ tags:# 格式: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+ # 身份验证(Better Auth)+ # 会话加密密钥(使用以下命令生成:openssl rand -base64 32)+ AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=+ # JWKS 密钥,用于签名和验证 JWT(在此生成:https://lobehub.com/zh/docs/self-hosting/environment-variables/auth#jwks_key)+ JWKS_KEY='{"keys":[...]}'# S3 相关S3_ACCESS_KEY_ID=xxxxxxxxxx@@ -90,11 +82,6 @@ tags: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 镜像@@ -143,13 +130,9 @@ LobeChat 的 DB 版也支持直接在本地的 Mac/Windows 本地使用。$ docker run -it -d --name lobe-chat-database -p 3210:3210 \-e DATABASE_URL=postgres://postgres:[email protected]:5432/postgres \-e KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \- -e NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 \- -e NEXT_AUTH_SSO_PROVIDERS=auth0 \- -e AUTH_AUTH0_ID=xxxxxx \- -e AUTH_AUTH0_SECRET=cSX_xxxxx \- -e AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com \+ -e AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \+ -e JWKS_KEY='{"keys":[...]}' \-e APP_URL=http://localhost:3210 \- -e NEXTAUTH_URL=http://localhost:3210/api/auth \-e S3_ACCESS_KEY_ID=xxxxxxxxxx \-e S3_SECRET_ACCESS_KEY=xxxxxxxxxx \-e S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com \diff --git a/docs/self-hosting/server-database/dokploy.mdx b/docs/self-hosting/server-database/dokploy.mdxindex 63516f4b327..15d534713dc 100644--- a/docs/self-hosting/server-database/dokploy.mdx+++ b/docs/self-hosting/server-database/dokploy.mdx@@ -1,13 +1,13 @@---title: Deploy LobeChat with database on Dokploydescription: >-- Learn how to deploy LobeChat with database on Dokploy with ease, including: database, authentication and S3 storage service.-+ Learn how to deploy LobeChat with database on Dokploy with ease, including:+ database, authentication and S3 storage service.tags:- Deploy LobeChat- - Vercel Deployment- - OpenAI API Key- - Custom Domain Binding+ - Dokploy Deployment+ - Better Auth+ - S3 Storage---# Deploying Server Database Version on Dokploy.@@ -43,15 +43,27 @@ S3_PUBLIC_DOMAIN=S3_ENABLE_PATH_STYLE=```-### Configure the Clerk authentication service.+### Configure KEY_VAULTS_SECRET Environment Variable-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.+`KEY_VAULTS_SECRET` is used to encrypt sensitive information such as API keys stored by users. Click the button below to generate:-```shell-NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx-CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx-CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx-```+<GenerateSecret envName="KEY_VAULTS_SECRET" />++### Configure authentication environment variables++Prepare the following authentication environment variables (powered by [Better Auth](https://www.better-auth.com)):++Click the button below to generate `AUTH_SECRET` (session encryption key):++<GenerateSecret envName="AUTH_SECRET" />++You also need to configure the `JWKS_KEY` environment variable for signing and verifying JWTs. Click the button below to generate:++<GenerateJWKSKey />++<Callout type={'info'}>+ For advanced features like SSO providers, magic link login, and email verification, see [Authentication Service](/docs/self-hosting/advanced/auth).+</Callout>## 2. Deploying the database on Dokploy@@ -92,20 +104,14 @@ NIXPACKS_START_CMD="pnpm start"APP_URL=-# Set the service mode to server-NEXT_PUBLIC_SERVICE_MODE=server-# Configuration related to Postgres databaseDATABASE_DRIVER=nodeDATABASE_URL=-# You can use openssl rand -base64 32 to generate a random 32-character string as a key.+# Use the values generated aboveKEY_VAULTS_SECRET=--# Clerk related configuration-NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=-CLERK_SECRET_KEY=-CLERK_WEBHOOK_SECRET=+AUTH_SECRET=+JWKS_KEY=# S3 related configurationS3_ACCESS_KEY_ID=@@ -115,10 +121,6 @@ S3_BUCKET=S3_PUBLIC_DOMAIN=S3_ENABLE_PATH_STYLE=-# OpenAI related configuration-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.diff --git a/docs/self-hosting/server-database/dokploy.zh-CN.mdx b/docs/self-hosting/server-database/dokploy.zh-CN.mdxindex ad3fe886e78..11464ab9672 100644--- a/docs/self-hosting/server-database/dokploy.zh-CN.mdx+++ b/docs/self-hosting/server-database/dokploy.zh-CN.mdx@@ -4,7 +4,7 @@ description: 本文详细介绍如何在 Dokploy 中部署服务端数据库版tags:- 服务端数据库- Postgres- - Clerk+ - Better Auth- Dokploy部署- 数据库配置- 身份验证服务@@ -44,15 +44,27 @@ S3_PUBLIC_DOMAIN=S3_ENABLE_PATH_STYLE=```-### 配置 Clerk 身份验证服务+### 配置 KEY_VAULTS_SECRET 环境变量-获取 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、`CLERK_SECRET_KEY` 、`CLERK_WEBHOOK_SECRET` 这三个环境变量,Clerk 的详细配置流程请参考 使用 Vercel 部署中 [配置身份验证服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#二、-配置身份验证服务)+`KEY_VAULTS_SECRET` 用于加密用户存储的 API Key 等敏感信息。点击下方按钮一键生成:-```shell-NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx-CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx-CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx-```+<GenerateSecret envName="KEY_VAULTS_SECRET" />++### 配置身份验证环境变量++准备以下身份验证环境变量(基于 [Better Auth](https://www.better-auth.com)):++点击下方按钮一键生成 `AUTH_SECRET`(会话加密密钥):++<GenerateSecret envName="AUTH_SECRET" />++同时需要配置 `JWKS_KEY` 环境变量,用于签名和验证 JWT。点击下方按钮一键生成:++<GenerateJWKSKey />++<Callout type={'info'}>+ 如需 SSO 登录、魔法链接登录、邮箱验证等高级功能,请参阅 [身份验证服务](/zh/docs/self-hosting/advanced/auth)。+</Callout>## 二、在 Dokploy 上部署数据库@@ -93,20 +105,14 @@ NIXPACKS_START_CMD="pnpm start"APP_URL=-# 指定服务模式为 server-NEXT_PUBLIC_SERVICE_MODE=server-# Postgres 数据库相关配置DATABASE_DRIVER=nodeDATABASE_URL=-# 你可以使用 openssl rand -base64 32 生成一个随机的 32 位字符串作为密钥。+# 使用上方生成的值KEY_VAULTS_SECRET=--# Clerk 相关配置-NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=-CLERK_SECRET_KEY=-CLERK_WEBHOOK_SECRET=+AUTH_SECRET=+JWKS_KEY=# S3 相关配置S3_ACCESS_KEY_ID=@@ -116,10 +122,6 @@ S3_BUCKET=S3_PUBLIC_DOMAIN=S3_ENABLE_PATH_STYLE=-# OpenAI 相关配置-OPENAI_API_KEY=-OPENAI_MODEL_LIST=-OPENAI_PROXY_URL=```添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息diff --git a/docs/self-hosting/server-database/netlify.mdx b/docs/self-hosting/server-database/netlify.mdxindex 29822f68e10..bcc0e0fd82f 100644--- a/docs/self-hosting/server-database/netlify.mdx+++ b/docs/self-hosting/server-database/netlify.mdx@@ -1,8 +1,8 @@---title: Deploy LobeChat with Database on Netlifydescription: >-- Learn how to deploy LobeChat on Netlify with ease, including: database, authentication and S3 storage service.-+ Learn how to deploy LobeChat on Netlify with ease, including: database,+ authentication and S3 storage service.tags:- Deploy LobeChat- Netlify Deploymentdiff --git a/docs/self-hosting/server-database/netlify.zh-CN.mdx b/docs/self-hosting/server-database/netlify.zh-CN.mdxindex b9465b5e73f..c71f604fa20 100644--- a/docs/self-hosting/server-database/netlify.zh-CN.mdx+++ b/docs/self-hosting/server-database/netlify.zh-CN.mdx@@ -1,8 +1,8 @@---title: 在 Netlify 上部署 LobeChat 服务端数据库版description: >-- 学习如何在 Netlify 上部署 LobeChat,包括 Fork 仓库、准备 OpenAI API Key、导入到 Netlify 工作台、配置站点名称与环境变量等步骤。-+ 学习如何在 Netlify 上部署 LobeChat,包括 Fork 仓库、准备 OpenAI API Key、导入到 Netlify+ 工作台、配置站点名称与环境变量等步骤。tags:- Netlify- LobeChatdiff --git a/docs/self-hosting/server-database/railway.mdx b/docs/self-hosting/server-database/railway.mdxindex 2ff3c55d230..d59f1243dd4 100644--- a/docs/self-hosting/server-database/railway.mdx+++ b/docs/self-hosting/server-database/railway.mdx@@ -1,8 +1,8 @@---title: Deploy LobeChat with Database on Railwaydescription: >-- Learn how to deploy LobeChat on Railway with ease, including: database, authentication and S3 storage service.-+ Learn how to deploy LobeChat on Railway with ease, including: database,+ authentication and S3 storage service.tags:- Deploy LobeChat- Railway Deploymentdiff --git a/docs/self-hosting/server-database/repocloud.mdx b/docs/self-hosting/server-database/repocloud.mdxindex 8fada1079ad..ee95f9601f3 100644--- a/docs/self-hosting/server-database/repocloud.mdx+++ b/docs/self-hosting/server-database/repocloud.mdx@@ -1,8 +1,8 @@---title: Deploy LobeChat with Database on RepoClouddescription: >-- Learn how to deploy LobeChat on RepoCloud with ease, including database, authentication and S3 storage service.-+ Learn how to deploy LobeChat on RepoCloud with ease, including database,+ authentication and S3 storage service.tags:- Deploy LobeChat- RepoCloud Deploymentdiff --git a/docs/self-hosting/server-database/sealos.mdx b/docs/self-hosting/server-database/sealos.mdxindex 6c5d7454be1..3b581623777 100644--- a/docs/self-hosting/server-database/sealos.mdx+++ b/docs/self-hosting/server-database/sealos.mdx@@ -1,8 +1,8 @@---title: Deploy Lobe Chat Database Version on Sealosdescription: >-- Learn how to deploy LobeChat on Sealos with ease. Follow the provided steps to set up LobeChat and start using it efficiently.-+ Learn how to deploy LobeChat on Sealos with ease. Follow the provided steps to+ set up LobeChat and start using it efficiently.tags:- Deploy LobeChat- Sealos Deploymentdiff --git a/docs/self-hosting/server-database/vercel.mdx b/docs/self-hosting/server-database/vercel.mdxindex 5a9dea7950a..971a04832c8 100644--- a/docs/self-hosting/server-database/vercel.mdx+++ b/docs/self-hosting/server-database/vercel.mdx@@ -1,13 +1,13 @@---title: Deploy LobeChat with database on Verceldescription: >-- Learn how to deploy LobeChat with database on Vercel with ease, including: database, authentication and S3 storage service.-+ Learn how to deploy LobeChat with database on Vercel with ease, including:+ database, authentication and S3 storage service.tags:- Deploy LobeChat- Vercel Deployment- - OpenAI API Key- - Custom Domain Binding+ - Better Auth+ - S3 Storage---# Deploying Server Database Version on Vercel@@ -18,7 +18,6 @@ This article will detail how to deploy the server database version of LobeChat oBefore 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!</Callout>@@ -50,9 +49,6 @@ This article will detail how to deploy the server database version of LobeChat o```shell# Serverless Postgres DB UrlDATABASE_URL=-- # 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:@@ -69,9 +65,6 @@ This article will detail how to deploy the server database version of LobeChat o# Specify Postgres database driver as nodeDATABASE_DRIVER=node-- # 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:@@ -88,11 +81,9 @@ This article will detail how to deploy the server database version of LobeChat o### 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. Click the button below to generate:- ```shell- KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=- ```+ <GenerateSecret envName="KEY_VAULTS_SECRET" />Make sure to add this to the Vercel environment variables as well.@@ -106,66 +97,26 @@ This article will detail how to deploy the server database version of LobeChat oThe server-side database needs to be paired with a user authentication service to function properly. Therefore, the corresponding authentication service needs to be configured.<Steps>- ### 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.-- <Callout type={'info'}>- 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.- </Callout>-- ### 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.-- <Image alt={'Find the corresponding public and private key environment variables in Clerk'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'} />-- 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- ```-- Add the above variables to Vercel:+ ### Add Authentication Environment Variables- <Image alt={'Add Clerk public and private key environment variables in Vercel'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'} />+ In Vercel's deployment environment variables, add the following environment variables to enable authentication (powered by [Better Auth](https://www.better-auth.com)):- ### Create and Configure Webhook in Clerk+ Click the button below to generate `AUTH_SECRET` (session encryption key):- 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.+ <GenerateSecret envName="AUTH_SECRET" />- 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.+ You also need to configure the `JWKS_KEY` environment variable for signing and verifying JWTs. Click the button below to generate:- <Image alt={'Add Webhooks endpoint in Clerk'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'} />+ <GenerateJWKSKey />- 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.+ With these variables, users can register and login with email and password.- <Callout type={'warning'}>- The `https://` in the URL is essential to maintain the integrity of the URL.+ <Callout type={'info'}>+ For advanced features like SSO providers, magic link login, and email verification, see [Authentication Service](/docs/self-hosting/advanced/auth).</Callout>-- <Image alt={'Configure URL and user events when adding Clerk Webhooks'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'} />-- ### Add Webhook Secret to Vercel Environment Variables-- After creation, you can find the secret of this Webhook in the bottom right corner:-- <Image alt={'View Clerk Webhooks secret'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'} />-- The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`:-- ```shell- CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx- ```-- Add it to Vercel's environment variables:-- <Image alt={'Add Clerk Webhooks secret in Vercel'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'} /></Steps>-By completing these steps, you have successfully configured the Clerk authentication service. Next, we will configure the S3 storage service.+By completing these steps, you have successfully configured the authentication service. Next, we will configure the S3 storage service.## 3. Configure S3 Storage Service@@ -320,17 +271,13 @@ For easy copying, here is a summary of the environment variables required to con```shellAPP_URL=https://your-project.com-# Specify the service mode as server-NEXT_PUBLIC_SERVICE_MODE=server-# Postgres database URLDATABASE_URL=KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=-# Clerk related configurations-NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx-CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx-CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx+# Authentication+AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=+JWKS_KEY='{"keys":[...]}'# S3 related configurations# S3 keysdiff --git a/docs/self-hosting/server-database/vercel.zh-CN.mdx b/docs/self-hosting/server-database/vercel.zh-CN.mdxindex e56c1cb9280..b5d74a3c664 100644--- a/docs/self-hosting/server-database/vercel.zh-CN.mdx+++ b/docs/self-hosting/server-database/vercel.zh-CN.mdx@@ -4,7 +4,7 @@ description: 本文详细介绍如何在 Vercel 中部署服务端数据库版 Ltags:- 服务端数据库- Postgres- - Clerk+ - Better Auth- S3存储服务- Vercel部署- 数据库配置@@ -20,7 +20,6 @@ tags:进行后续操作前,请务必确认以下事项:- 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入!- - 环境变量中的`ACCESS_CODE`未设置或已清除!- 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题!</Callout>@@ -51,9 +50,6 @@ tags:```shell# Serverless Postgres DB UrlDATABASE_URL=-- # 指定 service mode 为 server,否则不会进入服务端数据库- NEXT_PUBLIC_SERVICE_MODE=server```在 Vercel 中填写的示例如下:@@ -70,9 +66,6 @@ tags:# 指定 Postgres database driver 为 nodeDATABASE_DRIVER=node-- # 指定 service mode 为 server,否则不会进入服务端数据库- NEXT_PUBLIC_SERVICE_MODE=server```在 Vercel 中填写的示例如下:@@ -88,11 +81,9 @@ tags:### 添加 `KEY_VAULTS_SECRET` 环境变量- 在完成数据库 `DATABASE_URL` 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为密钥。+ 在完成数据库 `DATABASE_URL` 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。点击下方按钮一键生成:- ```shell- KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=- ```+ <GenerateSecret envName="KEY_VAULTS_SECRET" />同样需要将其添加到 Vercel 环境变量中。@@ -106,64 +97,26 @@ tags:服务端数据库需要搭配用户身份验证服务才可以正常使用。因此需要配置对应的身份验证服务。<Steps>- ### 准备 Clerk 身份验证服务-- 前往 [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。-- <Callout type={'info'}>- 如果对 Clerk 不太了解,可以查阅 [身份验证服务 -- Clerk](/zh/docs/self-hosting/advanced/authentication#clerk) 了解 Clerk 的使用详情。- </Callout>-- ### 在 Vercel 中添加公、私钥环境变量-- 在 Vercel 的部署环境变量中,添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值填入 Vercel 的环境变量中。-- <Image alt={'在 Clerk 中找到对应的公私钥环境变量'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'} />-- 此步骤所需的环境变量如下:-- ```shell- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx- CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx- ```+ ### 添加身份验证环境变量- 添加上述变量到 Vercel 中:+ 在 Vercel 的部署环境变量中,添加以下环境变量以启用身份验证(基于 [Better Auth](https://www.better-auth.com)):- <Image alt={'在 Vercel 中添加 Clerk 公私钥环境变量'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'} />+ 点击下方按钮一键生成 `AUTH_SECRET`(会话加密密钥):- ### 在 Clerk 中创建并配置 Webhook+ <GenerateSecret envName="AUTH_SECRET" />- 由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。+ 同时需要配置 `JWKS_KEY` 环境变量,用于签名和验证 JWT。点击下方按钮一键生成:- 我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。+ <GenerateJWKSKey />- <Image alt={'Clerk 添加 Webhooks 端点'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'} />+ 配置这些变量后,用户即可使用邮箱和密码注册登录。- 在 endpoint 中填写你的 Vercel 项目的 URL,如 `https://your-project.vercel.app/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。-- <Callout type={'warning'}>URL 的`https://`不可缺失,须保持 URL 的完整性</Callout>-- <Image alt={'添加 Clerk Webhooks 时,配置 URL 和用户事件'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'} />-- ### 将 Webhook 秘钥添加到 Vercel 环境变量-- 创建完毕后,可以在右下角找到该 Webhook 的秘钥:-- <Image alt={'查看 Clerk Webhooks 秘钥'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'} />-- 这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`:-- ```shell- CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx- ```-- 将其添加到 Vercel 的环境变量中:-- <Image alt={'在 Vercel 中 添加 Clerk Webhooks 秘钥'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'} />+ <Callout type={'info'}>+ 如需 SSO 登录、魔法链接登录、邮箱验证等高级功能,请参阅 [身份验证服务](/zh/docs/self-hosting/advanced/auth)。+ </Callout></Steps>-这样,你已经成功配置了 Clerk 身份验证服务。接下来我们将配置 S3 存储服务。+这样,你已经成功配置了身份验证服务。接下来我们将配置 S3 存储服务。## 三、 配置 S3 存储服务@@ -313,17 +266,13 @@ tags:```shellAPP_URL=https://your-project.com-# 指定服务模式为 server-NEXT_PUBLIC_SERVICE_MODE=server-# Postgres 数据库 URLDATABASE_URL=KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=-# Clerk 相关配置-NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx-CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx-CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx+# 身份验证+AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=+JWKS_KEY='{"keys":[...]}'# S3 相关配置# S3 秘钥diff --git a/docs/self-hosting/server-database/zeabur.mdx b/docs/self-hosting/server-database/zeabur.mdxindex b93f15e62a2..5f9dc5503c1 100644--- a/docs/self-hosting/server-database/zeabur.mdx+++ b/docs/self-hosting/server-database/zeabur.mdx@@ -1,8 +1,8 @@---title: Deploying LobeChat Database on Zeaburdescription: >-- Learn how to deploy LobeChat on Zeabur with ease. Follow the provided steps to set up your chat application seamlessly.-+ Learn how to deploy LobeChat on Zeabur with ease. Follow the provided steps to+ set up your chat application seamlessly.tags:- Deploy LobeChat- Zeabur Deploymentdiff --git a/docs/self-hosting/start.mdx b/docs/self-hosting/start.mdxindex 145166c733b..4f5aa21e8a6 100644--- a/docs/self-hosting/start.mdx+++ b/docs/self-hosting/start.mdx@@ -1,8 +1,8 @@---title: Build Your Own LobeChat - Choose Your Deployment Platformdescription: >-- Explore multiple deployment platforms like Vercel, Docker, Docker Compose, and more to deploy LobeChat. Choose the platform that best suits your needs.-+ Explore multiple deployment platforms like Vercel, Docker, Docker Compose, and+ more to deploy LobeChat. Choose the platform that best suits your needs.tags:- Lobe Chat- Deployment Platformdiff --git a/docs/self-hosting/start.zh-CN.mdx b/docs/self-hosting/start.zh-CN.mdxindex 308a3f86c1a..bad58495d94 100644--- a/docs/self-hosting/start.zh-CN.mdx+++ b/docs/self-hosting/start.zh-CN.mdx@@ -1,8 +1,8 @@---title: 构建属于自己的 LobeChat - 自选部署平台description: >-- 选择适合自己的部署平台,构建个性化的 Lobe Chat。支持 Docker、Docker Compose、Netlify、Railway、Repocloud、Sealos、Vercel 和 Zeabur 部署。-+ 选择适合自己的部署平台,构建个性化的 Lobe Chat。支持 Docker、Docker+ Compose、Netlify、Railway、Repocloud、Sealos、Vercel 和 Zeabur 部署。tags:- Lobe Chat- 部署平台diff --git a/packages/types/src/serverConfig.ts b/packages/types/src/serverConfig.tsindex f1068a6ad13..af3fac5a8be 100644--- a/packages/types/src/serverConfig.ts+++ b/packages/types/src/serverConfig.ts@@ -56,7 +56,6 @@ export interface GlobalServerConfig {enableMagicLink?: boolean;enableMarketTrustedClient?: boolean;enableUploadFileToServer?: boolean;- enabledAccessCode?: boolean;/*** @deprecated*/diff --git a/src/envs/app.ts b/src/envs/app.tsindex e01f1877b93..ecc09719928 100644--- a/src/envs/app.ts+++ b/src/envs/app.ts@@ -2,14 +2,6 @@import { createEnv } from '@t3-oss/env-nextjs';import { z } from 'zod';-declare global {- // eslint-disable-next-line @typescript-eslint/no-namespace- namespace NodeJS {- interface ProcessEnv {- ACCESS_CODE?: string;- }- }-}const isInVercel = process.env.VERCEL === '1';// Vercel URL fallback order (by stability):@@ -43,14 +35,11 @@ const ASSISTANT_INDEX_URL = 'https://registry.npmmirror.com/@lobehub/agents-indeconst PLUGINS_INDEX_URL = 'https://registry.npmmirror.com/@lobehub/plugins-index/v1/files/public';export const getAppConfig = () => {- const ACCESS_CODES = process.env.ACCESS_CODE?.split(',').filter(Boolean) || [];-return createEnv({client: {NEXT_PUBLIC_ENABLE_SENTRY: z.boolean(),},server: {- ACCESS_CODES: z.any(z.string()).optional(),AGENTS_INDEX_URL: z.string().url(),DEFAULT_AGENT_CONFIG: z.string(),@@ -100,8 +89,6 @@ export const getAppConfig = () => {// SentryNEXT_PUBLIC_ENABLE_SENTRY: !!process.env.NEXT_PUBLIC_SENTRY_DSN,- ACCESS_CODES: ACCESS_CODES as any,-AGENTS_INDEX_URL: !!process.env.AGENTS_INDEX_URL? process.env.AGENTS_INDEX_URL: ASSISTANT_INDEX_URL,diff --git a/src/server/globalConfig/index.ts b/src/server/globalConfig/index.tsindex c2bf9091503..6286d36650a 100644--- a/src/server/globalConfig/index.ts+++ b/src/server/globalConfig/index.ts@@ -27,7 +27,7 @@ const getBetterAuthSSOProviders = () => {};export const getServerGlobalConfig = async () => {- const { ACCESS_CODES, DEFAULT_AGENT_CONFIG } = getAppConfig();+ const { DEFAULT_AGENT_CONFIG } = getAppConfig();const config: GlobalServerConfig = {aiProvider: await genServerAiProvidersConfig({@@ -83,7 +83,6 @@ export const getServerGlobalConfig = async () => {appEnv.MARKET_TRUSTED_CLIENT_SECRET && appEnv.MARKET_TRUSTED_CLIENT_ID),enableUploadFileToServer: !!fileEnv.S3_SECRET_ACCESS_KEY,- enabledAccessCode: ACCESS_CODES?.length > 0,image: cleanObject({defaultImageNum: imageEnv.AI_IMAGE_DEFAULT_IMAGE_NUM,diff --git a/src/store/serverConfig/selectors.ts b/src/store/serverConfig/selectors.tsindex 4ee67245975..fa41193590e 100644--- a/src/store/serverConfig/selectors.ts+++ b/src/store/serverConfig/selectors.ts@@ -12,7 +12,6 @@ export const serverConfigSelectors = {enableMarketTrustedClient: (s: ServerConfigStore) =>s.serverConfig.enableMarketTrustedClient || false,enableUploadFileToServer: (s: ServerConfigStore) => s.serverConfig.enableUploadFileToServer,- enabledAccessCode: (s: ServerConfigStore) => !!s.serverConfig?.enabledAccessCode,enabledTelemetryChat: (s: ServerConfigStore) => s.serverConfig.telemetry.langfuse || false,isMobile: (s: ServerConfigStore) => s.isMobile || false,oAuthSSOProviders: (s: ServerConfigStore) => s.serverConfig.oAuthSSOProviders,