@lobehub/lobehub 2.0.0-next.331 → 2.0.0-next.333

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/apps/desktop/src/main/const/dir.ts +3 -0
  3. package/apps/desktop/src/main/controllers/SystemCtr.ts +19 -0
  4. package/apps/desktop/src/main/controllers/__tests__/SystemCtr.test.ts +1 -0
  5. package/apps/desktop/src/main/menus/impls/macOS.test.ts +1 -0
  6. package/changelog/v1.json +21 -0
  7. package/docs/changelog/2023-09-09-plugin-system.mdx +3 -2
  8. package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -4
  9. package/docs/changelog/2023-11-19-tts-stt.mdx +3 -2
  10. package/docs/changelog/2023-12-22-dalle-3.mdx +5 -2
  11. package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +2 -2
  12. package/docs/changelog/2024-02-08-sso-oauth.mdx +2 -2
  13. package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +3 -2
  14. package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +2 -2
  15. package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +3 -2
  16. package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +2 -2
  17. package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +3 -2
  18. package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +5 -4
  19. package/docs/changelog/2024-09-13-openai-o1-models.mdx +2 -2
  20. package/docs/changelog/2024-09-20-artifacts.mdx +3 -2
  21. package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +2 -2
  22. package/docs/changelog/2024-10-27-pin-assistant.mdx +3 -2
  23. package/docs/changelog/2024-11-06-share-text-json.mdx +4 -2
  24. package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +2 -2
  25. package/docs/changelog/2024-11-25-november-providers.mdx +2 -2
  26. package/docs/changelog/2024-11-27-forkable-chat.mdx +2 -2
  27. package/docs/changelog/2025-01-03-user-profile.mdx +2 -2
  28. package/docs/changelog/2025-01-22-new-ai-provider.mdx +2 -2
  29. package/docs/changelog/2025-02-02-deepseek-r1.mdx +4 -4
  30. package/docs/development/basic/add-new-authentication-providers.mdx +4 -0
  31. package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +4 -0
  32. package/docs/development/basic/add-new-image-model.mdx +4 -0
  33. package/docs/development/basic/add-new-image-model.zh-CN.mdx +4 -0
  34. package/docs/development/basic/architecture.mdx +4 -0
  35. package/docs/development/basic/architecture.zh-CN.mdx +4 -0
  36. package/docs/development/basic/chat-api.mdx +4 -0
  37. package/docs/development/basic/chat-api.zh-CN.mdx +4 -0
  38. package/docs/development/basic/comfyui-development.mdx +3 -1
  39. package/docs/development/basic/contributing-guidelines.mdx +4 -0
  40. package/docs/development/basic/contributing-guidelines.zh-CN.mdx +4 -0
  41. package/docs/development/basic/feature-development-frontend.mdx +11 -3
  42. package/docs/development/basic/feature-development-frontend.zh-CN.mdx +11 -3
  43. package/docs/development/basic/feature-development.mdx +14 -5
  44. package/docs/development/basic/feature-development.zh-CN.mdx +14 -5
  45. package/docs/development/basic/folder-structure.mdx +7 -0
  46. package/docs/development/basic/folder-structure.zh-CN.mdx +7 -0
  47. package/docs/development/basic/resources.mdx +4 -0
  48. package/docs/development/basic/resources.zh-CN.mdx +4 -0
  49. package/docs/development/basic/setup-development.mdx +4 -0
  50. package/docs/development/basic/setup-development.zh-CN.mdx +4 -0
  51. package/docs/development/basic/test.mdx +4 -0
  52. package/docs/development/basic/test.zh-CN.mdx +4 -0
  53. package/docs/development/basic/work-with-server-side-database.mdx +5 -5
  54. package/docs/development/basic/work-with-server-side-database.zh-CN.mdx +5 -5
  55. package/docs/development/internationalization/add-new-locale.mdx +4 -0
  56. package/docs/development/internationalization/add-new-locale.zh-CN.mdx +4 -0
  57. package/docs/development/internationalization/internationalization-implementation.mdx +4 -0
  58. package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +4 -0
  59. package/docs/development/others/lighthouse.mdx +4 -0
  60. package/docs/development/others/lighthouse.zh-CN.mdx +4 -0
  61. package/docs/development/start.mdx +4 -0
  62. package/docs/development/start.zh-CN.mdx +4 -0
  63. package/docs/development/state-management/state-management-intro.mdx +4 -2
  64. package/docs/development/state-management/state-management-intro.zh-CN.mdx +4 -2
  65. package/docs/development/state-management/state-management-selectors.mdx +6 -1
  66. package/docs/development/state-management/state-management-selectors.zh-CN.mdx +6 -1
  67. package/docs/development/tests/integration-testing.zh-CN.mdx +4 -0
  68. package/docs/self-hosting/advanced/analytics.mdx +2 -2
  69. package/docs/self-hosting/advanced/auth/better-auth/apple.mdx +132 -0
  70. package/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdx +127 -0
  71. package/docs/self-hosting/advanced/auth/better-auth/auth0.mdx +111 -0
  72. package/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdx +107 -0
  73. package/docs/self-hosting/advanced/auth/better-auth/authelia.mdx +66 -0
  74. package/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdx +62 -0
  75. package/docs/self-hosting/advanced/auth/better-auth/authentik.mdx +67 -0
  76. package/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdx +63 -0
  77. package/docs/self-hosting/advanced/auth/better-auth/casdoor.mdx +62 -0
  78. package/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdx +58 -0
  79. package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdx +59 -0
  80. package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdx +55 -0
  81. package/docs/self-hosting/advanced/auth/better-auth/cognito.mdx +88 -0
  82. package/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdx +85 -0
  83. package/docs/self-hosting/advanced/auth/better-auth/feishu.mdx +73 -0
  84. package/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdx +69 -0
  85. package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdx +86 -0
  86. package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdx +83 -0
  87. package/docs/self-hosting/advanced/auth/better-auth/github.mdx +93 -0
  88. package/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdx +90 -0
  89. package/docs/self-hosting/advanced/auth/better-auth/google.mdx +80 -0
  90. package/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdx +77 -0
  91. package/docs/self-hosting/advanced/auth/better-auth/keycloak.mdx +77 -0
  92. package/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdx +74 -0
  93. package/docs/self-hosting/advanced/auth/better-auth/logto.mdx +64 -0
  94. package/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdx +60 -0
  95. package/docs/self-hosting/advanced/auth/better-auth/microsoft.mdx +113 -0
  96. package/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdx +109 -0
  97. package/docs/self-hosting/advanced/auth/better-auth/okta.mdx +67 -0
  98. package/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdx +63 -0
  99. package/docs/self-hosting/advanced/auth/better-auth/wechat.mdx +77 -0
  100. package/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdx +72 -0
  101. package/docs/self-hosting/advanced/auth/better-auth/zitadel.mdx +73 -0
  102. package/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdx +69 -0
  103. package/docs/self-hosting/advanced/auth/clerk.mdx +2 -2
  104. package/docs/self-hosting/advanced/auth/legacy.mdx +106 -0
  105. package/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx +101 -0
  106. package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +3 -2
  107. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +3 -2
  108. package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +3 -2
  109. package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +5 -2
  110. package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +2 -0
  111. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +3 -2
  112. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +2 -2
  113. package/docs/self-hosting/advanced/auth/next-auth/github.mdx +3 -2
  114. package/docs/self-hosting/advanced/auth/next-auth/google.mdx +10 -12
  115. package/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx +3 -2
  116. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +2 -2
  117. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +3 -2
  118. package/docs/self-hosting/advanced/auth/next-auth/okta.mdx +3 -2
  119. package/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx +1 -3
  120. package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +2 -2
  121. package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +3 -2
  122. package/docs/self-hosting/advanced/auth.mdx +86 -139
  123. package/docs/self-hosting/advanced/auth.zh-CN.mdx +84 -135
  124. package/docs/self-hosting/advanced/desktop.mdx +9 -3
  125. package/docs/self-hosting/advanced/desktop.zh-CN.mdx +9 -3
  126. package/docs/self-hosting/advanced/feature-flags.mdx +3 -2
  127. package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
  128. package/docs/self-hosting/advanced/model-list.mdx +2 -2
  129. package/docs/self-hosting/advanced/observability/grafana.mdx +4 -2
  130. package/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx +2 -1
  131. package/docs/self-hosting/advanced/observability/langfuse.mdx +3 -2
  132. package/docs/self-hosting/advanced/online-search.mdx +4 -6
  133. package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +2 -2
  134. package/docs/self-hosting/advanced/settings-url-share.mdx +3 -2
  135. package/docs/self-hosting/advanced/upstream-sync.mdx +3 -4
  136. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +0 -2
  137. package/docs/self-hosting/environment-variables/analytics.mdx +3 -2
  138. package/docs/self-hosting/environment-variables/auth.mdx +5 -12
  139. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +2 -9
  140. package/docs/self-hosting/environment-variables/basic.mdx +3 -10
  141. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
  142. package/docs/self-hosting/environment-variables/model-provider.mdx +3 -4
  143. package/docs/self-hosting/environment-variables/s3.mdx +2 -2
  144. package/docs/self-hosting/environment-variables.mdx +2 -3
  145. package/docs/self-hosting/examples/azure-openai.mdx +2 -3
  146. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
  147. package/docs/self-hosting/examples/ollama.mdx +3 -2
  148. package/docs/self-hosting/faq/no-v1-suffix.mdx +4 -4
  149. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +3 -2
  150. package/docs/self-hosting/faq/vercel-ai-image-timeout.mdx +2 -2
  151. package/docs/self-hosting/migration/v2/breaking-changes.mdx +73 -0
  152. package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +71 -0
  153. package/docs/self-hosting/platform/alibaba-cloud.mdx +2 -7
  154. package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -6
  155. package/docs/self-hosting/platform/btpanel.mdx +4 -2
  156. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +2 -2
  157. package/docs/self-hosting/platform/docker-compose.mdx +3 -3
  158. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +0 -1
  159. package/docs/self-hosting/platform/docker.mdx +2 -11
  160. package/docs/self-hosting/platform/docker.zh-CN.mdx +0 -8
  161. package/docs/self-hosting/platform/netlify.mdx +5 -17
  162. package/docs/self-hosting/platform/netlify.zh-CN.mdx +3 -17
  163. package/docs/self-hosting/platform/railway.mdx +3 -7
  164. package/docs/self-hosting/platform/railway.zh-CN.mdx +1 -7
  165. package/docs/self-hosting/platform/repocloud.mdx +3 -7
  166. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +1 -6
  167. package/docs/self-hosting/platform/sealos.mdx +2 -7
  168. package/docs/self-hosting/platform/sealos.zh-CN.mdx +1 -6
  169. package/docs/self-hosting/platform/tencentcloud-lighthouse.mdx +2 -7
  170. package/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx +1 -6
  171. package/docs/self-hosting/platform/vercel.mdx +4 -9
  172. package/docs/self-hosting/platform/vercel.zh-CN.mdx +3 -8
  173. package/docs/self-hosting/platform/zeabur.mdx +2 -11
  174. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +1 -10
  175. package/docs/self-hosting/server-database/docker-compose.mdx +11 -19
  176. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +12 -21
  177. package/docs/self-hosting/server-database/docker.mdx +9 -24
  178. package/docs/self-hosting/server-database/docker.zh-CN.mdx +7 -24
  179. package/docs/self-hosting/server-database/dokploy.mdx +27 -25
  180. package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +23 -21
  181. package/docs/self-hosting/server-database/netlify.mdx +2 -2
  182. package/docs/self-hosting/server-database/netlify.zh-CN.mdx +2 -2
  183. package/docs/self-hosting/server-database/railway.mdx +2 -2
  184. package/docs/self-hosting/server-database/repocloud.mdx +2 -2
  185. package/docs/self-hosting/server-database/sealos.mdx +2 -2
  186. package/docs/self-hosting/server-database/vercel.mdx +19 -72
  187. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +17 -68
  188. package/docs/self-hosting/server-database/zeabur.mdx +2 -2
  189. package/docs/self-hosting/server-database.mdx +1 -19
  190. package/docs/self-hosting/server-database.zh-CN.mdx +0 -17
  191. package/docs/self-hosting/start.mdx +2 -2
  192. package/docs/self-hosting/start.zh-CN.mdx +2 -2
  193. package/e2e/src/support/webServer.ts +95 -43
  194. package/locales/ar/chat.json +5 -0
  195. package/locales/ar/desktop-onboarding.json +5 -0
  196. package/locales/ar/discover.json +15 -0
  197. package/locales/ar/models.json +35 -0
  198. package/locales/bg-BG/chat.json +5 -0
  199. package/locales/bg-BG/desktop-onboarding.json +5 -0
  200. package/locales/bg-BG/discover.json +15 -0
  201. package/locales/bg-BG/models.json +30 -0
  202. package/locales/de-DE/chat.json +5 -0
  203. package/locales/de-DE/desktop-onboarding.json +5 -0
  204. package/locales/de-DE/discover.json +15 -0
  205. package/locales/de-DE/models.json +38 -0
  206. package/locales/en-US/desktop-onboarding.json +6 -0
  207. package/locales/en-US/discover.json +14 -0
  208. package/locales/es-ES/chat.json +5 -0
  209. package/locales/es-ES/desktop-onboarding.json +5 -0
  210. package/locales/es-ES/discover.json +15 -0
  211. package/locales/es-ES/models.json +38 -0
  212. package/locales/fa-IR/chat.json +5 -0
  213. package/locales/fa-IR/desktop-onboarding.json +5 -0
  214. package/locales/fa-IR/discover.json +15 -0
  215. package/locales/fa-IR/models.json +11 -0
  216. package/locales/fr-FR/chat.json +5 -0
  217. package/locales/fr-FR/desktop-onboarding.json +5 -0
  218. package/locales/fr-FR/discover.json +15 -0
  219. package/locales/fr-FR/models.json +36 -0
  220. package/locales/it-IT/chat.json +5 -0
  221. package/locales/it-IT/desktop-onboarding.json +5 -0
  222. package/locales/it-IT/discover.json +15 -0
  223. package/locales/it-IT/models.json +32 -0
  224. package/locales/ja-JP/chat.json +5 -0
  225. package/locales/ja-JP/desktop-onboarding.json +5 -0
  226. package/locales/ja-JP/discover.json +15 -0
  227. package/locales/ja-JP/models.json +42 -0
  228. package/locales/ko-KR/chat.json +5 -0
  229. package/locales/ko-KR/desktop-onboarding.json +5 -0
  230. package/locales/ko-KR/discover.json +15 -0
  231. package/locales/ko-KR/models.json +55 -0
  232. package/locales/nl-NL/chat.json +5 -0
  233. package/locales/nl-NL/desktop-onboarding.json +5 -0
  234. package/locales/nl-NL/discover.json +15 -0
  235. package/locales/nl-NL/models.json +34 -0
  236. package/locales/pl-PL/chat.json +5 -0
  237. package/locales/pl-PL/desktop-onboarding.json +5 -0
  238. package/locales/pl-PL/discover.json +15 -0
  239. package/locales/pl-PL/models.json +31 -0
  240. package/locales/pt-BR/chat.json +5 -0
  241. package/locales/pt-BR/desktop-onboarding.json +5 -0
  242. package/locales/pt-BR/discover.json +15 -0
  243. package/locales/pt-BR/models.json +42 -0
  244. package/locales/ru-RU/chat.json +5 -0
  245. package/locales/ru-RU/desktop-onboarding.json +5 -0
  246. package/locales/ru-RU/discover.json +15 -0
  247. package/locales/ru-RU/models.json +32 -0
  248. package/locales/tr-TR/chat.json +5 -0
  249. package/locales/tr-TR/desktop-onboarding.json +5 -0
  250. package/locales/tr-TR/discover.json +15 -0
  251. package/locales/tr-TR/models.json +48 -0
  252. package/locales/vi-VN/chat.json +5 -0
  253. package/locales/vi-VN/desktop-onboarding.json +5 -0
  254. package/locales/vi-VN/discover.json +15 -0
  255. package/locales/vi-VN/models.json +36 -0
  256. package/locales/zh-CN/desktop-onboarding.json +4 -3
  257. package/locales/zh-CN/discover.json +14 -0
  258. package/locales/zh-CN/models.json +1 -0
  259. package/locales/zh-TW/chat.json +5 -0
  260. package/locales/zh-TW/desktop-onboarding.json +5 -0
  261. package/locales/zh-TW/discover.json +15 -0
  262. package/locales/zh-TW/models.json +42 -0
  263. package/package.json +2 -2
  264. package/packages/builtin-tool-cloud-sandbox/src/systemRole.ts +62 -2
  265. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/index.ts +2 -0
  266. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/multi-tasks-with-summary.json +234 -0
  267. package/packages/conversation-flow/src/__tests__/parse.test.ts +25 -0
  268. package/packages/conversation-flow/src/transformation/ContextTreeBuilder.ts +15 -0
  269. package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +20 -0
  270. package/packages/types/src/serverConfig.ts +0 -1
  271. package/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx +39 -1
  272. package/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx +34 -14
  273. package/src/envs/app.ts +0 -13
  274. package/src/locales/default/desktop-onboarding.ts +1 -0
  275. package/src/server/globalConfig/index.ts +1 -2
  276. package/src/services/electron/system.ts +4 -0
  277. package/src/store/serverConfig/selectors.ts +0 -1
@@ -0,0 +1,127 @@
1
+ ---
2
+ title: 在 LobeChat 中配置 Apple 身份验证
3
+ description: 学习如何在 LobeChat 中配置 Apple 登录,包括在 Apple Developer Portal 创建凭证和设置环境变量。
4
+ tags:
5
+ - Apple
6
+ - 身份验证
7
+ - LobeChat
8
+ - 单点登录
9
+ ---
10
+
11
+ # 配置 Apple 身份验证
12
+
13
+ <Callout type={'warning'}>
14
+ Apple 登录需要付费的 Apple Developer 账户($99 / 年),且不支持
15
+ localhost。开发和生产环境都必须使用 HTTPS 域名。
16
+ </Callout>
17
+
18
+ <Steps>
19
+ ### 创建 App ID
20
+
21
+ 1. 前往 [Apple Developer Portal](https://developer.apple.com/account/resources/identifiers/list)
22
+ 2. 导航到 **Certificates, Identifiers & Profiles** > **Identifiers**
23
+ 3. 点击 **+** 注册新标识符
24
+ 4. 选择 **App IDs** > **App** 类型 > **Continue**
25
+ 5. 填写:
26
+ - **Description**: 如 `LobeChat`
27
+ - **Bundle ID**: 如 `com.yourcompany.lobechat`
28
+ 6. 启用 **Sign In with Apple** 功能
29
+ 7. 点击 **Continue** > **Register**
30
+
31
+ ### 创建 Services ID
32
+
33
+ 1. 返回 **Identifiers**,点击 **+**
34
+ 2. 选择 **Services IDs** > **Continue**
35
+ 3. 填写:
36
+ - **Description**: 如 `LobeChat Web`
37
+ - **Identifier**: 如 `com.yourcompany.lobechat.web`(这是你的 Client ID)
38
+ 4. 点击 **Continue** > **Register**
39
+
40
+ ### 配置 Services ID
41
+
42
+ 1. 点击已创建的 Services ID
43
+ 2. 启用 **Sign In with Apple**
44
+ 3. 点击 **Configure**
45
+ 4. 选择 Primary App ID
46
+ 5. 添加域名和回调 URL:
47
+ - **Domains**: `your-domain.com`
48
+ - **Return URLs**: `https://your-domain.com/api/auth/callback/apple`
49
+ 6. 点击 **Save** > **Continue** > **Save**
50
+
51
+ <Callout type={'info'}>
52
+ 回调 URL 格式:
53
+
54
+ - 生产环境: `https://your-domain.com/api/auth/callback/apple`
55
+ - Apple **不支持** localhost 或 HTTP URL
56
+ </Callout>
57
+
58
+ ### 创建登录密钥
59
+
60
+ 1. 导航到 **Keys**,点击 **+**
61
+ 2. 填写密钥名称
62
+ 3. 启用 **Sign In with Apple**,点击 **Configure**
63
+ 4. 选择 Primary App ID
64
+ 5. 点击 **Save** > **Continue** > **Register**
65
+ 6. **下载密钥文件**(`.p8`)- 只能下载一次
66
+ 7. 记录:
67
+ - **Key ID**: 密钥页面显示
68
+ - **Team ID**: 开发者门户右上角显示
69
+
70
+ ### 生成 Client Secret
71
+
72
+ Apple 要求使用 JWT 作为 client secret。使用 `.p8` 密钥文件生成:
73
+
74
+ ```js
75
+ // Node.js 示例
76
+ const jwt = require('jsonwebtoken');
77
+ const fs = require('fs');
78
+
79
+ const privateKey = fs.readFileSync('AuthKey_XXXXX.p8');
80
+ const token = jwt.sign({}, privateKey, {
81
+ algorithm: 'ES256',
82
+ expiresIn: '180d', // 最长 6 个月
83
+ issuer: 'YOUR_TEAM_ID',
84
+ audience: 'https://appleid.apple.com',
85
+ subject: 'YOUR_SERVICES_ID', // Client ID
86
+ keyid: 'YOUR_KEY_ID',
87
+ });
88
+ ```
89
+
90
+ <Callout type={'warning'}>
91
+ JWT 最长有效期为 180 天。需要在过期前重新生成并更新。
92
+ </Callout>
93
+
94
+ ### 配置环境变量
95
+
96
+ | 环境变量 | 类型 | 描述 |
97
+ | ---------------------------------- | -- | -------------------------------------- |
98
+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
99
+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `apple` |
100
+ | `AUTH_APPLE_CLIENT_ID` | 必选 | 你的 Services ID |
101
+ | `AUTH_APPLE_CLIENT_SECRET` | 必选 | 生成的 JWT |
102
+ | `AUTH_APPLE_APP_BUNDLE_IDENTIFIER` | 可选 | App Bundle ID(用于原生应用集成) |
103
+
104
+ <Callout type={'tip'}>
105
+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#apple)
106
+ 可查阅相关变量详情。
107
+ </Callout>
108
+ </Steps>
109
+
110
+ <Callout type={'info'}>
111
+ 部署成功后,用户将可以通过 Apple 身份认证并使用 LobeChat。
112
+ </Callout>
113
+
114
+ ## 常见问题
115
+
116
+ ### 不支持 localhost
117
+
118
+ Apple 登录不支持 localhost 或非 HTTPS URL。本地开发请使用 ngrok 等隧道服务或部署到带有 HTTPS 的测试环境。
119
+
120
+ ### 密钥过期
121
+
122
+ JWT client secret 最长有效期为 180 天。请设置提醒在过期前重新生成。
123
+
124
+ ## 相关资源
125
+
126
+ - [Apple Developer Portal](https://developer.apple.com/account)
127
+ - [Sign In with Apple 文档](https://developer.apple.com/sign-in-with-apple/)
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: Configuring Auth0 Authentication for LobeChat
3
+ description: >-
4
+ Learn how to configure Auth0 SSO for LobeChat, including creating
5
+ applications, adding users, and setting up environment variables.
6
+ tags:
7
+ - Auth0
8
+ - Authentication
9
+ - LobeChat
10
+ - Single Sign-On
11
+ ---
12
+
13
+ # Configuring Auth0 Authentication
14
+
15
+ <Steps>
16
+ ### Create Auth0 Application
17
+
18
+ 1. Go to [Auth0 Dashboard](https://manage.auth0.com/dashboard)
19
+ 2. Click **Applications** > **Create Application**
20
+
21
+ <Image alt="Create Auth0 Application S1" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/f068190f-0027-4d3b-8667-d632e43d5a86" />
22
+
23
+ 3. Fill in the application name
24
+ 4. Select **Regular Web Applications** as the application type
25
+ 5. Click **Create**
26
+
27
+ <Image alt="Create Auth0 Application S2" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/3e0082df-9b6f-46f3-b67f-bdc79e1eb2cc" />
28
+
29
+ ### Configure Application Settings
30
+
31
+ After creation, go to the **Settings** tab:
32
+
33
+ <Image alt="Create Auth0 Application S3" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/df4cea85-616a-46f5-b2de-42725d9b82a6" />
34
+
35
+ Note down:
36
+
37
+ - **Domain** (e.g., `your-tenant.auth0.com`)
38
+ - **Client ID**
39
+ - **Client Secret**
40
+
41
+ ### Configure Callback URL
42
+
43
+ In **Allowed Callback URLs**, add:
44
+
45
+ <Callout type={'info'}>
46
+ Callback URL format:
47
+
48
+ - Local development: `http://localhost:3210/api/auth/callback/auth0`
49
+ - Production: `https://your-domain.com/api/auth/callback/auth0`
50
+ </Callout>
51
+
52
+ <Image alt="Create Auth0 Application S4" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/62fbd09f-a69a-4460-949b-0f6285fa65b9" />
53
+
54
+ ### Add Users (Optional)
55
+
56
+ Click **User Management** to create users for your organization.
57
+
58
+ <Image alt="Add Users" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/0beda150-d0b6-43cf-a9f1-fce928b83a96" />
59
+
60
+ ### Configure Environment Variables
61
+
62
+ | Environment Variable | Type | Description |
63
+ | -------------------------------- | -------- | --------------------------------------------------------------- |
64
+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |
65
+ | `AUTH_SSO_PROVIDERS` | Required | Set to `auth0` |
66
+ | `AUTH_AUTH0_ID` | Required | Client ID |
67
+ | `AUTH_AUTH0_SECRET` | Required | Client Secret |
68
+ | `AUTH_AUTH0_ISSUER` | Required | `https://your-tenant.auth0.com` |
69
+
70
+ <Callout type={'tip'}>
71
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#auth0)
72
+ for detailed information.
73
+ </Callout>
74
+ </Steps>
75
+
76
+ <Callout type={'info'}>
77
+ After successful deployment, users will be able to authenticate with Auth0 and
78
+ use LobeChat.
79
+ </Callout>
80
+
81
+ ## Advanced Configuration
82
+
83
+ ### Connect Existing SSO Services
84
+
85
+ If your organization has existing identity infrastructure, connect to SSO services in **Applications** > **SSO Integrations**.
86
+
87
+ Auth0 supports Azure AD, Slack, Google Workspace, Office 365, Zoom, and more. See [Auth0 SSO Integrations](https://marketplace.auth0.com/features/sso-integrations).
88
+
89
+ <Image alt="Connecting to Existing SSO Service" src="https://github.com/lobehub/lobe-chat/assets/30863298/9891347e-a338-4aa9-8714-f16c8dbcfcec" />
90
+
91
+ ### Configure Social Login
92
+
93
+ Configure social login in **Authentication** > **Social**.
94
+
95
+ <Image alt="Configuring Social Login" src="https://github.com/lobehub/lobe-chat/assets/30863298/880749a6-5ba4-4e20-a968-b583a54de7fa" />
96
+
97
+ <Callout type={'warning'}>
98
+ Social login by default allows anyone to authenticate. Configure blocking
99
+ policies to restrict access.
100
+ </Callout>
101
+
102
+ <Callout type={'warning'}>
103
+ When creating a GitHub connection, make sure to enable the **Email Address** permission in the **Attributes** section. LobeChat requires user email for authentication.
104
+
105
+ <Image alt="GitHub Connection Email Permission" src="https://hub-apac-1.lobeobjects.space/docs/afdf22891dda3e5e44c690db184c548e.png" />
106
+ </Callout>
107
+
108
+ ## Related Resources
109
+
110
+ - [Auth0 Dashboard](https://manage.auth0.com/dashboard)
111
+ - [Auth0 Documentation](https://auth0.com/docs)
@@ -0,0 +1,107 @@
1
+ ---
2
+ title: 在 LobeChat 中配置 Auth0 身份验证
3
+ description: 学习如何在 LobeChat 中配置 Auth0 SSO,包括创建应用、添加用户和设置环境变量。
4
+ tags:
5
+ - Auth0
6
+ - 身份验证
7
+ - LobeChat
8
+ - 单点登录
9
+ ---
10
+
11
+ # 配置 Auth0 身份验证
12
+
13
+ <Steps>
14
+ ### 创建 Auth0 应用
15
+
16
+ 1. 前往 [Auth0 Dashboard](https://manage.auth0.com/dashboard)
17
+ 2. 点击 **Applications** > **Create Application**
18
+
19
+ <Image alt="创建 Auth0 应用 S1" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/f068190f-0027-4d3b-8667-d632e43d5a86" />
20
+
21
+ 3. 填写应用名称
22
+ 4. 选择 **Regular Web Applications** 作为应用类型
23
+ 5. 点击 **Create**
24
+
25
+ <Image alt="创建 Auth0 应用 S2" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/3e0082df-9b6f-46f3-b67f-bdc79e1eb2cc" />
26
+
27
+ ### 配置应用设置
28
+
29
+ 创建后,进入 **Settings** 标签页:
30
+
31
+ <Image alt="创建 Auth0 应用 S3" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/df4cea85-616a-46f5-b2de-42725d9b82a6" />
32
+
33
+ 记录:
34
+
35
+ - **Domain**(如 `your-tenant.auth0.com`)
36
+ - **Client ID**
37
+ - **Client Secret**
38
+
39
+ ### 配置回调 URL
40
+
41
+ 在 **Allowed Callback URLs** 中添加:
42
+
43
+ <Callout type={'info'}>
44
+ 回调 URL 格式:
45
+
46
+ - 本地开发: `http://localhost:3210/api/auth/callback/auth0`
47
+ - 生产环境: `https://your-domain.com/api/auth/callback/auth0`
48
+ </Callout>
49
+
50
+ <Image alt="创建 Auth0 应用 S4" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/62fbd09f-a69a-4460-949b-0f6285fa65b9" />
51
+
52
+ ### 添加用户(可选)
53
+
54
+ 点击 **User Management** 为组织创建用户。
55
+
56
+ <Image alt="添加用户" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/0beda150-d0b6-43cf-a9f1-fce928b83a96" />
57
+
58
+ ### 配置环境变量
59
+
60
+ | 环境变量 | 类型 | 描述 |
61
+ | -------------------------------- | -- | -------------------------------------- |
62
+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
63
+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `auth0` |
64
+ | `AUTH_AUTH0_ID` | 必选 | Client ID |
65
+ | `AUTH_AUTH0_SECRET` | 必选 | Client Secret |
66
+ | `AUTH_AUTH0_ISSUER` | 必选 | `https://your-tenant.auth0.com` |
67
+
68
+ <Callout type={'tip'}>
69
+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#auth0)
70
+ 可查阅相关变量详情。
71
+ </Callout>
72
+ </Steps>
73
+
74
+ <Callout type={'info'}>
75
+ 部署成功后,用户将可以通过 Auth0 身份认证并使用 LobeChat。
76
+ </Callout>
77
+
78
+ ## 高级配置
79
+
80
+ ### 连接现有 SSO 服务
81
+
82
+ 如果组织已有身份认证基础设施,在 **Applications** > **SSO Integrations** 中连接 SSO 服务。
83
+
84
+ Auth0 支持 Azure AD、Slack、Google Workspace、Office 365、Zoom 等。详见 [Auth0 SSO Integrations](https://marketplace.auth0.com/features/sso-integrations)。
85
+
86
+ <Image alt="连接现有 SSO 服务" src="https://github.com/lobehub/lobe-chat/assets/30863298/9891347e-a338-4aa9-8714-f16c8dbcfcec" />
87
+
88
+ ### 配置社交登录
89
+
90
+ 在 **Authentication** > **Social** 中配置社交登录。
91
+
92
+ <Image alt="配置社交登录" src="https://github.com/lobehub/lobe-chat/assets/30863298/880749a6-5ba4-4e20-a968-b583a54de7fa" />
93
+
94
+ <Callout type={'warning'}>
95
+ 默认社交登录允许任何人认证。请配置阻止策略以限制访问。
96
+ </Callout>
97
+
98
+ <Callout type={'warning'}>
99
+ 创建 GitHub 连接时,务必在 **Attributes** 部分勾选 **Email Address** 权限。LobeChat 需要用户邮箱进行身份认证。
100
+
101
+ <Image alt="GitHub 连接邮箱权限" src="https://hub-apac-1.lobeobjects.space/docs/afdf22891dda3e5e44c690db184c548e.png" />
102
+ </Callout>
103
+
104
+ ## 相关资源
105
+
106
+ - [Auth0 Dashboard](https://manage.auth0.com/dashboard)
107
+ - [Auth0 文档](https://auth0.com/docs)
@@ -0,0 +1,66 @@
1
+ ---
2
+ title: Configuring Authelia Authentication for LobeChat
3
+ description: >-
4
+ Learn how to configure Authelia SSO for LobeChat, including setting up OIDC
5
+ client and environment variables.
6
+ tags:
7
+ - Authelia
8
+ - Authentication
9
+ - LobeChat
10
+ - Single Sign-On
11
+ - OIDC
12
+ ---
13
+
14
+ # Configuring Authelia Authentication
15
+
16
+ [Authelia](https://www.authelia.com/) is an open-source authentication and authorization server providing two-factor authentication and single sign-on.
17
+
18
+ <Steps>
19
+ ### Configure OIDC Client in Authelia
20
+
21
+ Add a new OIDC client in your Authelia configuration file:
22
+
23
+ ```yaml
24
+ identity_providers:
25
+ oidc:
26
+ clients:
27
+ - client_id: 'lobechat'
28
+ client_name: 'LobeChat'
29
+ client_secret: 'your-client-secret'
30
+ redirect_uris:
31
+ - 'https://your-domain.com/api/auth/callback/authelia'
32
+ scopes:
33
+ - 'openid'
34
+ - 'profile'
35
+ - 'email'
36
+ ```
37
+
38
+ <Callout type={'info'}>
39
+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/authelia`
40
+ </Callout>
41
+
42
+ ### Configure Environment Variables
43
+
44
+ When deploying LobeChat, you need to configure the following environment variables:
45
+
46
+ | Environment Variable | Type | Description |
47
+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |
48
+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
49
+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `authelia` for Authelia |
50
+ | `AUTH_AUTHELIA_ID` | Required | Client ID configured in Authelia |
51
+ | `AUTH_AUTHELIA_SECRET` | Required | Client Secret configured in Authelia |
52
+ | `AUTH_AUTHELIA_ISSUER` | Required | Authelia issuer URL (e.g., `https://auth.your-domain.com`) |
53
+
54
+ <Callout type={'tip'}>
55
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#authelia) for detailed information on these variables.
56
+ </Callout>
57
+ </Steps>
58
+
59
+ <Callout type={'info'}>
60
+ After successful deployment, users will be able to authenticate with Authelia and use LobeChat.
61
+ </Callout>
62
+
63
+ ## Related Resources
64
+
65
+ - [Authelia Documentation](https://www.authelia.com/docs/)
66
+ - [Authelia OIDC Configuration](https://www.authelia.com/configuration/identity-providers/openid-connect/)
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: 在 LobeChat 中配置 Authelia 身份验证
3
+ description: 学习如何在 LobeChat 中配置 Authelia SSO,包括设置 OIDC 客户端和环境变量。
4
+ tags:
5
+ - Authelia
6
+ - 身份验证
7
+ - LobeChat
8
+ - 单点登录
9
+ - OIDC
10
+ ---
11
+
12
+ # 配置 Authelia 身份验证
13
+
14
+ [Authelia](https://www.authelia.com/) 是一个开源的身份验证和授权服务器,提供双因素认证和单点登录功能。
15
+
16
+ <Steps>
17
+ ### 在 Authelia 中配置 OIDC 客户端
18
+
19
+ 在 Authelia 配置文件中添加新的 OIDC 客户端:
20
+
21
+ ```yaml
22
+ identity_providers:
23
+ oidc:
24
+ clients:
25
+ - client_id: 'lobechat'
26
+ client_name: 'LobeChat'
27
+ client_secret: 'your-client-secret'
28
+ redirect_uris:
29
+ - 'https://your-domain.com/api/auth/callback/authelia'
30
+ scopes:
31
+ - 'openid'
32
+ - 'profile'
33
+ - 'email'
34
+ ```
35
+
36
+ <Callout type={'info'}>
37
+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/authelia`
38
+ </Callout>
39
+
40
+ ### 配置环境变量
41
+
42
+ 在部署 LobeChat 时,你需要配置以下环境变量:
43
+
44
+ | 环境变量 | 类型 | 描述 |
45
+ | -------------------------------- | -- | ------------------------------------------------------ |
46
+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
47
+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Authelia 请填写 `authelia` |
48
+ | `AUTH_AUTHELIA_ID` | 必选 | Authelia 中配置的 Client ID |
49
+ | `AUTH_AUTHELIA_SECRET` | 必选 | Authelia 中配置的 Client Secret |
50
+ | `AUTH_AUTHELIA_ISSUER` | 必选 | Authelia Issuer URL(例如 `https://auth.your-domain.com`) |
51
+
52
+ <Callout type={'tip'}>
53
+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#authelia) 可查阅相关变量详情。
54
+ </Callout>
55
+ </Steps>
56
+
57
+ <Callout type={'info'}>部署成功后,用户将可以通过 Authelia 身份认证并使用 LobeChat。</Callout>
58
+
59
+ ## 相关资源
60
+
61
+ - [Authelia 文档](https://www.authelia.com/docs/)
62
+ - [Authelia OIDC 配置](https://www.authelia.com/configuration/identity-providers/openid-connect/)
@@ -0,0 +1,67 @@
1
+ ---
2
+ title: Configuring Authentik Authentication for LobeChat
3
+ description: >-
4
+ Learn how to configure Authentik SSO for LobeChat, including creating an
5
+ OAuth2 provider and application.
6
+ tags:
7
+ - Authentik
8
+ - Authentication
9
+ - LobeChat
10
+ - Single Sign-On
11
+ - OIDC
12
+ ---
13
+
14
+ # Configuring Authentik Authentication
15
+
16
+ [Authentik](https://goauthentik.io/) is an open-source Identity Provider focused on flexibility and versatility.
17
+
18
+ <Steps>
19
+ ### Create OAuth2 Provider in Authentik
20
+
21
+ 1. In Authentik admin interface, go to **Applications** > **Providers**
22
+ 2. Click **Create** and select **OAuth2/OpenID Provider**
23
+ 3. Configure the provider:
24
+ - Name: `LobeChat`
25
+ - Authorization flow: Select your authorization flow
26
+ - Client type: `Confidential`
27
+ - Redirect URIs: Add your callback URL
28
+
29
+ <Callout type={'info'}>
30
+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/authentik`
31
+ </Callout>
32
+
33
+ ### Create Application
34
+
35
+ 1. Go to **Applications** > **Applications**
36
+ 2. Click **Create** and link it to the OAuth2 provider you created
37
+ 3. Note down the **Client ID** and **Client Secret**
38
+
39
+ ### Get Issuer URL
40
+
41
+ The issuer URL is typically: `https://your-authentik-domain/application/o/your-app-slug/`
42
+
43
+ ### Configure Environment Variables
44
+
45
+ When deploying LobeChat, you need to configure the following environment variables:
46
+
47
+ | Environment Variable | Type | Description |
48
+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |
49
+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
50
+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `authentik` for Authentik |
51
+ | `AUTH_AUTHENTIK_ID` | Required | Client ID from Authentik provider |
52
+ | `AUTH_AUTHENTIK_SECRET` | Required | Client Secret from Authentik provider |
53
+ | `AUTH_AUTHENTIK_ISSUER` | Required | Authentik issuer URL |
54
+
55
+ <Callout type={'tip'}>
56
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#authentik) for detailed information on these variables.
57
+ </Callout>
58
+ </Steps>
59
+
60
+ <Callout type={'info'}>
61
+ After successful deployment, users will be able to authenticate with Authentik and use LobeChat.
62
+ </Callout>
63
+
64
+ ## Related Resources
65
+
66
+ - [Authentik Documentation](https://docs.goauthentik.io/)
67
+ - [Authentik OAuth2 Provider](https://docs.goauthentik.io/docs/providers/oauth2/)
@@ -0,0 +1,63 @@
1
+ ---
2
+ title: 在 LobeChat 中配置 Authentik 身份验证
3
+ description: 学习如何在 LobeChat 中配置 Authentik SSO,包括创建 OAuth2 提供商和应用。
4
+ tags:
5
+ - Authentik
6
+ - 身份验证
7
+ - LobeChat
8
+ - 单点登录
9
+ - OIDC
10
+ ---
11
+
12
+ # 配置 Authentik 身份验证
13
+
14
+ [Authentik](https://goauthentik.io/) 是一个开源身份提供商,专注于灵活性和多功能性。
15
+
16
+ <Steps>
17
+ ### 在 Authentik 中创建 OAuth2 提供商
18
+
19
+ 1. 在 Authentik 管理界面,前往 **Applications** > **Providers**
20
+ 2. 点击 **Create**,选择 **OAuth2/OpenID Provider**
21
+ 3. 配置提供商:
22
+ - Name: `LobeChat`
23
+ - Authorization flow: 选择授权流程
24
+ - Client type: `Confidential`
25
+ - Redirect URIs: 添加回调 URL
26
+
27
+ <Callout type={'info'}>
28
+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/authentik`
29
+ </Callout>
30
+
31
+ ### 创建应用
32
+
33
+ 1. 前往 **Applications** > **Applications**
34
+ 2. 点击 **Create**,关联到刚创建的 OAuth2 提供商
35
+ 3. 记下 **Client ID** 和 **Client Secret**
36
+
37
+ ### 获取 Issuer URL
38
+
39
+ Issuer URL 通常为:`https://your-authentik-domain/application/o/your-app-slug/`
40
+
41
+ ### 配置环境变量
42
+
43
+ 在部署 LobeChat 时,你需要配置以下环境变量:
44
+
45
+ | 环境变量 | 类型 | 描述 |
46
+ | -------------------------------- | -- | ---------------------------------------------- |
47
+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
48
+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Authentik 请填写 `authentik` |
49
+ | `AUTH_AUTHENTIK_ID` | 必选 | Authentik 提供商的 Client ID |
50
+ | `AUTH_AUTHENTIK_SECRET` | 必选 | Authentik 提供商的 Client Secret |
51
+ | `AUTH_AUTHENTIK_ISSUER` | 必选 | Authentik Issuer URL |
52
+
53
+ <Callout type={'tip'}>
54
+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#authentik) 可查阅相关变量详情。
55
+ </Callout>
56
+ </Steps>
57
+
58
+ <Callout type={'info'}>部署成功后,用户将可以通过 Authentik 身份认证并使用 LobeChat。</Callout>
59
+
60
+ ## 相关资源
61
+
62
+ - [Authentik 文档](https://docs.goauthentik.io/)
63
+ - [Authentik OAuth2 提供商](https://docs.goauthentik.io/docs/providers/oauth2/)
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: Configuring Casdoor Authentication for LobeChat
3
+ description: >-
4
+ Learn how to configure Casdoor SSO for LobeChat, including creating an
5
+ application and setting up environment variables.
6
+ tags:
7
+ - Casdoor
8
+ - Authentication
9
+ - LobeChat
10
+ - Single Sign-On
11
+ - OIDC
12
+ ---
13
+
14
+ # Configuring Casdoor Authentication
15
+
16
+ [Casdoor](https://casdoor.org/) is an open-source Identity Access Management (IAM) platform with web UI for SSO.
17
+
18
+ <Steps>
19
+ ### Create Application in Casdoor
20
+
21
+ 1. Log in to your Casdoor admin console
22
+ 2. Go to **Applications** and click **Add**
23
+ 3. Configure the application:
24
+ - Name: `LobeChat`
25
+ - Organization: Select your organization
26
+ - Redirect URLs: Add your callback URL
27
+
28
+ <Callout type={'info'}>
29
+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/casdoor`
30
+ </Callout>
31
+
32
+ 4. Save and note down the **Client ID** and **Client Secret**
33
+
34
+ ### Get Issuer URL
35
+
36
+ The issuer URL is your Casdoor server URL, typically: `https://your-casdoor-domain`
37
+
38
+ ### Configure Environment Variables
39
+
40
+ When deploying LobeChat, you need to configure the following environment variables:
41
+
42
+ | Environment Variable | Type | Description |
43
+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |
44
+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
45
+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `casdoor` for Casdoor |
46
+ | `AUTH_CASDOOR_ID` | Required | Client ID from Casdoor application |
47
+ | `AUTH_CASDOOR_SECRET` | Required | Client Secret from Casdoor application |
48
+ | `AUTH_CASDOOR_ISSUER` | Required | Casdoor server URL (e.g., `https://your-casdoor-domain`) |
49
+
50
+ <Callout type={'tip'}>
51
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#casdoor) for detailed information on these variables.
52
+ </Callout>
53
+ </Steps>
54
+
55
+ <Callout type={'info'}>
56
+ After successful deployment, users will be able to authenticate with Casdoor and use LobeChat.
57
+ </Callout>
58
+
59
+ ## Related Resources
60
+
61
+ - [Casdoor Documentation](https://casdoor.org/docs/overview)
62
+ - [Casdoor Application Configuration](https://casdoor.org/docs/application/config)