@lobehub/lobehub 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +4 -3
- package/.github/workflows/release-desktop-stable.yml +1 -1
- package/CHANGELOG.md +50 -0
- package/Dockerfile +6 -4
- package/README.md +3 -4
- package/README.zh-CN.md +3 -4
- package/apps/desktop/src/main/controllers/McpInstallCtr.ts +10 -10
- package/apps/desktop/src/main/controllers/NetworkProxyCtr.ts +6 -6
- package/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts +2 -2
- package/changelog/v2.json +14 -0
- package/docs/changelog/2025-03-02-new-models.mdx +1 -1
- package/docs/changelog/2025-03-02-new-models.zh-CN.mdx +1 -1
- package/docs/changelog/2025-04-06-exports.mdx +1 -1
- package/docs/changelog/2025-04-06-exports.zh-CN.mdx +1 -1
- package/docs/changelog/2025-05-08-desktop-app.mdx +2 -2
- package/docs/changelog/2025-05-08-desktop-app.zh-CN.mdx +2 -2
- package/docs/changelog/2025-06-08-claude-4.mdx +1 -1
- package/docs/changelog/2025-06-08-claude-4.zh-CN.mdx +1 -1
- package/docs/changelog/2025-07-08-mcp-market.mdx +1 -1
- package/docs/changelog/2025-07-08-mcp-market.zh-CN.mdx +1 -1
- package/docs/changelog/2025-08-08-image-generation.mdx +1 -1
- package/docs/changelog/2025-08-08-image-generation.zh-CN.mdx +1 -1
- package/docs/changelog/2025-09-08-gemini.mdx +1 -1
- package/docs/changelog/2025-09-08-gemini.zh-CN.mdx +1 -1
- package/docs/changelog/2025-10-08-python.mdx +1 -1
- package/docs/changelog/2025-10-08-python.zh-CN.mdx +1 -1
- package/docs/changelog/2025-11-08-comfy-ui.mdx +1 -1
- package/docs/changelog/2025-11-08-comfy-ui.zh-CN.mdx +1 -1
- package/docs/changelog/2025-12-20-mcp.mdx +1 -1
- package/docs/changelog/2025-12-20-mcp.zh-CN.mdx +1 -1
- package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +1 -1
- package/docs/development/basic/add-new-image-model.mdx +3 -3
- package/docs/development/basic/add-new-image-model.zh-CN.mdx +3 -3
- package/docs/development/basic/chat-api.mdx +10 -10
- package/docs/development/basic/chat-api.zh-CN.mdx +10 -10
- package/docs/development/basic/feature-development.mdx +4 -4
- package/docs/development/basic/feature-development.zh-CN.mdx +4 -4
- package/docs/development/basic/setup-development.mdx +4 -4
- package/docs/development/basic/setup-development.zh-CN.mdx +4 -4
- package/docs/development/internationalization/add-new-locale.mdx +1 -1
- package/docs/development/internationalization/add-new-locale.zh-CN.mdx +1 -1
- package/docs/development/internationalization/internationalization-implementation.mdx +5 -5
- package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +5 -5
- package/docs/development/others/lighthouse.mdx +8 -8
- package/docs/development/others/lighthouse.zh-CN.mdx +8 -8
- package/docs/development/start.mdx +3 -3
- package/docs/development/start.zh-CN.mdx +3 -3
- package/docs/self-hosting/advanced/feature-flags.mdx +1 -1
- package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
- package/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +2 -2
- package/docs/self-hosting/advanced/online-search.mdx +1 -1
- package/docs/self-hosting/advanced/online-search.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/redis/upstash.mdx +3 -3
- package/docs/self-hosting/advanced/redis/upstash.zh-CN.mdx +3 -3
- package/docs/self-hosting/advanced/redis.mdx +6 -6
- package/docs/self-hosting/advanced/redis.zh-CN.mdx +6 -6
- package/docs/self-hosting/advanced/s3/rustfs.mdx +116 -116
- package/docs/self-hosting/advanced/s3/rustfs.zh-CN.mdx +116 -117
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +5 -5
- package/docs/self-hosting/auth/email.mdx +70 -0
- package/docs/self-hosting/auth/email.zh-CN.mdx +70 -0
- package/docs/self-hosting/{advanced/auth → auth}/legacy.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/legacy.zh-CN.mdx +5 -5
- package/docs/self-hosting/{advanced/auth → auth}/next-auth/casdoor.zh-CN.mdx +3 -3
- package/docs/self-hosting/{advanced/auth → auth}/next-auth/keycloak.zh-CN.mdx +2 -2
- package/docs/self-hosting/{advanced/auth → auth}/next-auth/logto.zh-CN.mdx +2 -2
- package/docs/self-hosting/{advanced/auth → auth}/providers/apple.mdx +6 -6
- package/docs/self-hosting/{advanced/auth → auth}/providers/apple.zh-CN.mdx +6 -6
- package/docs/self-hosting/{advanced/auth → auth}/providers/auth0.mdx +12 -12
- package/docs/self-hosting/{advanced/auth → auth}/providers/auth0.zh-CN.mdx +12 -12
- package/docs/self-hosting/{advanced/auth → auth}/providers/authelia.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/authelia.zh-CN.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/authentik.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/authentik.zh-CN.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/casdoor.mdx +8 -8
- package/docs/self-hosting/{advanced/auth → auth}/providers/casdoor.zh-CN.mdx +7 -7
- package/docs/self-hosting/{advanced/auth → auth}/providers/cloudflare-zero-trust.mdx +7 -7
- package/docs/self-hosting/{advanced/auth → auth}/providers/cloudflare-zero-trust.zh-CN.mdx +6 -6
- package/docs/self-hosting/{advanced/auth → auth}/providers/cognito.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/cognito.zh-CN.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/feishu.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/feishu.zh-CN.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/generic-oidc.mdx +12 -12
- package/docs/self-hosting/{advanced/auth → auth}/providers/generic-oidc.zh-CN.mdx +12 -12
- package/docs/self-hosting/{advanced/auth → auth}/providers/github.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/github.zh-CN.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/google.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/google.zh-CN.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/keycloak.mdx +11 -11
- package/docs/self-hosting/{advanced/auth → auth}/providers/keycloak.zh-CN.mdx +11 -11
- package/docs/self-hosting/{advanced/auth → auth}/providers/logto.mdx +8 -8
- package/docs/self-hosting/{advanced/auth → auth}/providers/logto.zh-CN.mdx +7 -7
- package/docs/self-hosting/{advanced/auth → auth}/providers/microsoft.mdx +11 -11
- package/docs/self-hosting/{advanced/auth → auth}/providers/microsoft.zh-CN.mdx +11 -11
- package/docs/self-hosting/{advanced/auth → auth}/providers/okta.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/okta.zh-CN.mdx +13 -13
- package/docs/self-hosting/auth/providers/password.mdx +112 -0
- package/docs/self-hosting/auth/providers/password.zh-CN.mdx +103 -0
- package/docs/self-hosting/{advanced/auth → auth}/providers/wechat.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/wechat.zh-CN.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/zitadel.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/zitadel.zh-CN.mdx +13 -13
- package/docs/self-hosting/{advanced/auth.mdx → auth.mdx} +24 -81
- package/docs/self-hosting/{advanced/auth.zh-CN.mdx → auth.zh-CN.mdx} +23 -80
- package/docs/self-hosting/environment-variables/auth.mdx +7 -0
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +7 -0
- package/docs/self-hosting/environment-variables/basic.mdx +0 -7
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
- package/docs/self-hosting/environment-variables/redis.mdx +1 -1
- package/docs/self-hosting/environment-variables/redis.zh-CN.mdx +1 -1
- package/docs/self-hosting/environment-variables.mdx +1 -1
- package/docs/self-hosting/examples/azure-openai.mdx +0 -1
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
- package/docs/self-hosting/faq/no-v1-suffix.mdx +3 -3
- package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +3 -3
- package/docs/self-hosting/{advanced → migration/v2}/auth/clerk-to-betterauth.mdx +7 -7
- package/docs/self-hosting/{advanced → migration/v2}/auth/clerk-to-betterauth.zh-CN.mdx +7 -7
- package/docs/self-hosting/{advanced → migration/v2}/auth/migration-internals.mdx +2 -2
- package/docs/self-hosting/{advanced → migration/v2}/auth/migration-internals.zh-CN.mdx +2 -2
- package/docs/self-hosting/{advanced → migration/v2}/auth/nextauth-to-betterauth.mdx +11 -11
- package/docs/self-hosting/{advanced → migration/v2}/auth/nextauth-to-betterauth.zh-CN.mdx +11 -11
- package/docs/self-hosting/migration/v2/breaking-changes.mdx +1 -1
- package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +1 -1
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +4 -4
- package/docs/self-hosting/platform/docker.mdx +5 -5
- package/docs/self-hosting/platform/docker.zh-CN.mdx +10 -10
- package/docs/self-hosting/platform/dokploy.mdx +1 -1
- package/docs/self-hosting/platform/dokploy.zh-CN.mdx +5 -5
- package/docs/self-hosting/platform/sealos.mdx +12 -12
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +17 -17
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +4 -4
- package/docs/self-hosting/start.mdx +3 -3
- package/docs/self-hosting/start.zh-CN.mdx +4 -4
- package/locales/en-US/auth.json +2 -1
- package/locales/en-US/authError.json +1 -0
- package/locales/en-US/metadata.json +1 -1
- package/locales/zh-CN/auth.json +1 -0
- package/locales/zh-CN/authError.json +1 -0
- package/netlify.toml +0 -1
- package/package.json +1 -1
- package/packages/types/src/serverConfig.ts +1 -0
- package/src/app/[variants]/(auth)/auth-error/page.tsx +4 -2
- package/src/app/[variants]/(auth)/signin/SignInEmailStep.tsx +57 -50
- package/src/app/[variants]/(auth)/signin/SignInPasswordStep.tsx +1 -1
- package/src/app/[variants]/(auth)/signin/page.tsx +2 -0
- package/src/app/[variants]/(auth)/signin/useSignIn.ts +2 -0
- package/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx +7 -0
- package/src/envs/app.ts +0 -2
- package/src/envs/auth.ts +3 -0
- package/src/libs/better-auth/define-config.ts +1 -1
- package/src/libs/better-auth/sso/providers/feishu.ts +15 -14
- package/src/libs/better-auth/sso/providers/wechat.ts +6 -3
- package/src/libs/next/proxy/define-config.ts +1 -1
- package/src/locales/default/auth.ts +3 -1
- package/src/locales/default/authError.ts +2 -0
- package/src/locales/default/metadata.ts +1 -1
- package/src/server/globalConfig/index.ts +1 -0
- package/src/server/ld.ts +1 -1
- package/src/store/chat/slices/topic/action.ts +1 -1
- package/src/store/electron/actions/settings.ts +7 -7
- package/src/store/electron/actions/sync.ts +11 -11
- package/src/store/global/actions/general.ts +12 -12
- package/src/store/global/initialState.ts +11 -11
- package/src/store/global/selectors/clientDB.ts +1 -1
- package/src/store/global/selectors/systemStatus.ts +1 -1
- package/src/store/image/slices/generationConfig/action.ts +12 -12
- package/src/store/image/utils/size.ts +11 -11
- package/src/store/library/slices/ragEval/actions/dataset.ts +1 -1
- package/src/store/serverConfig/selectors.ts +1 -0
- package/src/store/session/slices/session/initialState.ts +6 -6
- package/src/store/session/slices/session/reducers.ts +1 -1
- package/src/store/session/slices/sessionGroup/initialState.ts +2 -2
- package/src/store/tool/slices/customPlugin/action.ts +2 -2
- package/src/store/tool/slices/oldStore/action.ts +5 -5
- package/src/store/userMemory/slices/preference/action.ts +6 -6
- /package/docs/self-hosting/{advanced/auth → auth}/clerk.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/clerk.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/auth0.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/auth0.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authelia.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authelia.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authentik.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authentik.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/casdoor.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/cloudflare-zero-trust.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/cloudflare-zero-trust.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/github.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/github.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/google.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/google.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/keycloak.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/logto.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/microsoft-entra-id.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/microsoft-entra-id.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/okta.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/okta.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/wechat.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/wechat.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/zitadel.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/zitadel.zh-CN.mdx +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 邮件服务配置
|
|
3
|
+
description: 配置 LobeHub 的邮件服务,用于邮箱验证、密码重置和魔法链接登录。
|
|
4
|
+
tags:
|
|
5
|
+
- 邮件服务
|
|
6
|
+
- SMTP
|
|
7
|
+
- Resend
|
|
8
|
+
- 邮箱验证
|
|
9
|
+
- 魔法链接
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 邮件服务配置
|
|
13
|
+
|
|
14
|
+
邮件服务用于邮箱验证、密码重置和魔法链接发送。LobeHub 支持两种邮件服务提供商。
|
|
15
|
+
|
|
16
|
+
## Nodemailer(SMTP)
|
|
17
|
+
|
|
18
|
+
使用 SMTP 协议发送邮件,适合已有邮箱服务的用户。参考 [Nodemailer SMTP 文档](https://nodemailer.com/smtp/)。
|
|
19
|
+
|
|
20
|
+
| 环境变量 | 类型 | 描述 | 示例 |
|
|
21
|
+
| ------------------------ | -- | ---------------------------------------------- | --------------------- |
|
|
22
|
+
| `EMAIL_SERVICE_PROVIDER` | 可选 | 设置为 `nodemailer`(默认值) | `nodemailer` |
|
|
23
|
+
| `SMTP_HOST` | 必选 | SMTP 服务器主机名 | `smtp.gmail.com` |
|
|
24
|
+
| `SMTP_PORT` | 必选 | SMTP 服务器端口(TLS 通常为 `587`,SSL 为 `465`) | `587` |
|
|
25
|
+
| `SMTP_SECURE` | 可选 | SSL 设置为 `true`(端口 465),TLS 设置为 `false`(端口 587) | `false` |
|
|
26
|
+
| `SMTP_USER` | 必选 | SMTP 认证用户名 | `user@gmail.com` |
|
|
27
|
+
| `SMTP_PASS` | 必选 | SMTP 认证密码 | `your-app-password` |
|
|
28
|
+
| `SMTP_FROM` | 可选 | 发件人地址(AWS SES 必填),默认为 `SMTP_USER` | `noreply@example.com` |
|
|
29
|
+
|
|
30
|
+
<Callout type={'warning'}>
|
|
31
|
+
使用 Gmail 时,需使用应用专用密码而非账户密码。前往 [Google 应用专用密码](https://myaccount.google.com/apppasswords) 生成。
|
|
32
|
+
</Callout>
|
|
33
|
+
|
|
34
|
+
## Resend
|
|
35
|
+
|
|
36
|
+
[Resend](https://resend.com/) 是一个现代邮件 API 服务,配置简单,推荐新用户使用。
|
|
37
|
+
|
|
38
|
+
| 环境变量 | 类型 | 描述 | 示例 |
|
|
39
|
+
| ------------------------ | -- | ------------------------- | --------------------------- |
|
|
40
|
+
| `EMAIL_SERVICE_PROVIDER` | 必选 | 设置为 `resend` | `resend` |
|
|
41
|
+
| `RESEND_API_KEY` | 必选 | Resend API Key | `re_xxxxxxxxxxxxxxxxxxxxxx` |
|
|
42
|
+
| `RESEND_FROM` | 推荐 | 发件人地址,需为 Resend 已验证域名下的邮箱 | `noreply@your-domain.com` |
|
|
43
|
+
|
|
44
|
+
<Callout type={'info'}>
|
|
45
|
+
使用 Resend 前需先 [验证发件域名](https://resend.com/docs/dashboard/domains/introduction),否则只能发送到自己的邮箱。
|
|
46
|
+
</Callout>
|
|
47
|
+
|
|
48
|
+
## 邮箱验证
|
|
49
|
+
|
|
50
|
+
启用邮箱验证以确保用户拥有其注册的邮箱地址(默认关闭):
|
|
51
|
+
|
|
52
|
+
| 环境变量 | 类型 | 描述 |
|
|
53
|
+
| ------------------------- | -- | -------------------- |
|
|
54
|
+
| `AUTH_EMAIL_VERIFICATION` | 可选 | 设置为 `1` 以要求注册后进行邮箱验证 |
|
|
55
|
+
|
|
56
|
+
<Callout type={'info'}>
|
|
57
|
+
邮箱验证需要上方已配置好的邮件服务(SMTP 或 Resend)。启用后,用户必须验证其邮箱地址才能登录。
|
|
58
|
+
</Callout>
|
|
59
|
+
|
|
60
|
+
## 魔法链接(免密)登录
|
|
61
|
+
|
|
62
|
+
启用魔法链接登录(依赖上方已配置好的邮件服务,默认关闭):
|
|
63
|
+
|
|
64
|
+
| 环境变量 | 类型 | 描述 |
|
|
65
|
+
| ------------------------ | -- | ----------------------- |
|
|
66
|
+
| `AUTH_ENABLE_MAGIC_LINK` | 可选 | 设置为 `1` 以启用魔法链接登录(默认关闭) |
|
|
67
|
+
|
|
68
|
+
<Callout type={'tip'}>
|
|
69
|
+
前往 [环境变量](/zh/docs/self-hosting/environment-variables/auth#better-auth) 可查阅所有 Better Auth 相关变量详情。
|
|
70
|
+
</Callout>
|
|
@@ -22,9 +22,9 @@ This page documents the legacy authentication methods (NextAuth and Clerk) for u
|
|
|
22
22
|
|
|
23
23
|
Clerk is a comprehensive identity verification solution that provides a simple yet powerful API and services to handle user authentication and session management.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
LobeHub has deeply integrated with Clerk to provide users with a secure and convenient login and registration experience.
|
|
26
26
|
|
|
27
|
-
By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` in
|
|
27
|
+
By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` in LobeHub's environment, you can enable and use Clerk.
|
|
28
28
|
|
|
29
29
|
<Callout type={'info'}>
|
|
30
30
|
For detailed Clerk configuration, see [Clerk Configuration Guide](/docs/self-hosting/advanced/auth/clerk).
|
|
@@ -40,15 +40,15 @@ By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CL
|
|
|
40
40
|
To migrate from NextAuth to Better Auth, see the [NextAuth Migration Guide](/docs/self-hosting/advanced/auth/nextauth-to-betterauth).
|
|
41
41
|
</Callout>
|
|
42
42
|
|
|
43
|
-
Before using NextAuth, please set the following variables in
|
|
43
|
+
Before using NextAuth, please set the following variables in LobeHub's environment variables:
|
|
44
44
|
|
|
45
|
-
| Environment Variable | Type | Description
|
|
46
|
-
| -------------------------------- | -------- |
|
|
45
|
+
| Environment Variable | Type | Description |
|
|
46
|
+
| -------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
47
47
|
| `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/lobehub` image have this configuration added by default. |
|
|
48
|
-
| `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.
|
|
49
|
-
| `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`
|
|
50
|
-
| `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`.
|
|
51
|
-
| `NEXT_AUTH_SSO_SESSION_STRATEGY` | Optional | The session strategy for Auth.js. Options are `jwt` or `database`. Default is `jwt`.
|
|
48
|
+
| `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. |
|
|
49
|
+
| `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` |
|
|
50
|
+
| `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`. |
|
|
51
|
+
| `NEXT_AUTH_SSO_SESSION_STRATEGY` | Optional | The session strategy for Auth.js. Options are `jwt` or `database`. Default is `jwt`. |
|
|
52
52
|
|
|
53
53
|
Currently supported identity verification services include:
|
|
54
54
|
|
|
@@ -103,7 +103,7 @@ The order corresponds to the display order of the SSO providers.
|
|
|
103
103
|
|
|
104
104
|
### Webhook Support
|
|
105
105
|
|
|
106
|
-
Allow
|
|
106
|
+
Allow LobeHub 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.
|
|
107
107
|
|
|
108
108
|
### Database Session
|
|
109
109
|
|
|
@@ -20,9 +20,9 @@ tags:
|
|
|
20
20
|
|
|
21
21
|
Clerk 是一个全面的身份验证解决方案,它提供了简单而强大的 API 和服务来处理用户认证和会话管理。
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
LobeHub 与 Clerk 做了深度集成,能够为用户提供安全、便捷的登录和注册体验。
|
|
24
24
|
|
|
25
|
-
在
|
|
25
|
+
在 LobeHub 的环境变量中设置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY`,即可开启和使用 Clerk。
|
|
26
26
|
|
|
27
27
|
<Callout type={'info'}>
|
|
28
28
|
详细的 Clerk 配置请参阅 [Clerk 配置指南](/zh/docs/self-hosting/advanced/auth/clerk)。
|
|
@@ -38,11 +38,11 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供安全、便捷的
|
|
|
38
38
|
如需从 NextAuth 迁移到 Better Auth,请参阅 [NextAuth 迁移指南](/zh/docs/self-hosting/advanced/auth/nextauth-to-betterauth)。
|
|
39
39
|
</Callout>
|
|
40
40
|
|
|
41
|
-
在使用 NextAuth 之前,请先在
|
|
41
|
+
在使用 NextAuth 之前,请先在 LobeHub 的环境变量中设置以下变量:
|
|
42
42
|
|
|
43
43
|
| 环境变量 | 类型 | 描述 |
|
|
44
44
|
| -------------------------------- | -- | ------------------------------------------------------------------------------------------------------------ |
|
|
45
|
-
| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | 必选 | 用于启用 NextAuth 服务,设置为 `1` 以启用,更改此项需要重新编译应用。使用 `lobehub/lobehub` 镜像部署的用户已经默认添加了该项配置。
|
|
45
|
+
| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | 必选 | 用于启用 NextAuth 服务,设置为 `1` 以启用,更改此项需要重新编译应用。使用 `lobehub/lobehub` 镜像部署的用户已经默认添加了该项配置。 |
|
|
46
46
|
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |
|
|
47
47
|
| `AUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
|
48
48
|
| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 |
|
|
@@ -98,7 +98,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供安全、便捷的
|
|
|
98
98
|
|
|
99
99
|
### Webhook 支持
|
|
100
100
|
|
|
101
|
-
允许
|
|
101
|
+
允许 LobeHub 在身份提供商中用户信息更新时接收通知。支持的提供商包括 Casdoor 和 Logto。请参考具体提供商文档进行配置。
|
|
102
102
|
|
|
103
103
|
### 数据库会话
|
|
104
104
|
|
|
@@ -13,7 +13,7 @@ tags:
|
|
|
13
13
|
[Casdoor](https://github.com/casdoor/casdoor) 是一个开源的身份验证服务,功能配置丰富且易于上手。
|
|
14
14
|
|
|
15
15
|
<Callout type={'tip'}>
|
|
16
|
-
若你想要私有部署 Casdoor,我们建议你将之与 LobeHub
|
|
16
|
+
若你想要私有部署 Casdoor,我们建议你将之与 LobeHub 一同使用 Docker Compose 部署,此时
|
|
17
17
|
LobeHub 可以与之共用同一个 Postgres 实例。
|
|
18
18
|
</Callout>
|
|
19
19
|
|
|
@@ -21,12 +21,12 @@ tags:
|
|
|
21
21
|
|
|
22
22
|
若你使用局域网 IP 部署,下文假设:
|
|
23
23
|
|
|
24
|
-
- 你的 LobeHub
|
|
24
|
+
- 你的 LobeHub IP / 端口为 `http://LobeHub_IP:3210`。
|
|
25
25
|
- 你私有部署 Casdoor,其域名为 `http://CASDOOR_IP:8000`。
|
|
26
26
|
|
|
27
27
|
若你使用公网部署,下文假设:
|
|
28
28
|
|
|
29
|
-
- 你的 LobeHub
|
|
29
|
+
- 你的 LobeHub 域名为 `https://lobe.example.com`。
|
|
30
30
|
- 你私有部署 Casdoor,其域名为 `https://lobe-auth-api.example.com`。
|
|
31
31
|
|
|
32
32
|
<Steps>
|
|
@@ -21,12 +21,12 @@ tags:
|
|
|
21
21
|
|
|
22
22
|
若你使用局域网 IP 部署,下文假设:
|
|
23
23
|
|
|
24
|
-
- 你的 LobeHub
|
|
24
|
+
- 你的 LobeHub IP / 端口为 `http://LobeHub_IP:3210`。
|
|
25
25
|
- 你私有部署 Keycloak,其域名为 `http://KEYCLOAK_IP:8080`。
|
|
26
26
|
|
|
27
27
|
若你使用公网部署,下文假设:
|
|
28
28
|
|
|
29
|
-
- 你的 LobeHub
|
|
29
|
+
- 你的 LobeHub 域名为 `https://lobe.example.com`。
|
|
30
30
|
- 你私有部署 Keycloak,其域名为 `https://lobe-auth-api.example.com`。
|
|
31
31
|
|
|
32
32
|
<Steps>
|
|
@@ -13,13 +13,13 @@ tags:
|
|
|
13
13
|
[Logto](https://github.com/logto-io/logto) 是一个开源的身份验证服务,界面简洁美观、功能配置丰富且易于上手,你即可以选择使用其官方提供的 Logto Cloud,也可以选择私有部署 Logto。
|
|
14
14
|
|
|
15
15
|
<Callout type={'tip'}>
|
|
16
|
-
若你想要私有部署 Logto,我们建议你将之与 LobeHub
|
|
16
|
+
若你想要私有部署 Logto,我们建议你将之与 LobeHub 一同使用 Docker Compose 部署,此时
|
|
17
17
|
LobeHub 可以与之共用同一个 Postgres 实例。
|
|
18
18
|
</Callout>
|
|
19
19
|
|
|
20
20
|
## Logto 配置流程
|
|
21
21
|
|
|
22
|
-
下文假设你的 LobeHub
|
|
22
|
+
下文假设你的 LobeHub 域名为 `https://lobe.example.com`。
|
|
23
23
|
|
|
24
24
|
若你是私有部署的 Logto,假设其 endpoint 域名为 `https://lobe-auth-api.example.com`。
|
|
25
25
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Configuring Apple Authentication for
|
|
2
|
+
title: Configuring Apple Authentication for LobeHub
|
|
3
3
|
description: >-
|
|
4
|
-
Learn how to configure Apple Sign In for
|
|
4
|
+
Learn how to configure Apple Sign In for LobeHub, including creating
|
|
5
5
|
credentials in Apple Developer Portal and setting up environment variables.
|
|
6
6
|
tags:
|
|
7
7
|
- Apple
|
|
8
8
|
- Authentication
|
|
9
|
-
-
|
|
9
|
+
- LobeHub
|
|
10
10
|
- Single Sign-On
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ tags:
|
|
|
26
26
|
3. Click **+** to register a new identifier
|
|
27
27
|
4. Select **App IDs** > **App** type > **Continue**
|
|
28
28
|
5. Fill in:
|
|
29
|
-
- **Description**: e.g., `
|
|
29
|
+
- **Description**: e.g., `LobeHub`
|
|
30
30
|
- **Bundle ID**: e.g., `com.yourcompany.lobechat`
|
|
31
31
|
6. Enable **Sign In with Apple** capability
|
|
32
32
|
7. Click **Continue** > **Register**
|
|
@@ -36,7 +36,7 @@ tags:
|
|
|
36
36
|
1. Go back to **Identifiers**, click **+**
|
|
37
37
|
2. Select **Services IDs** > **Continue**
|
|
38
38
|
3. Fill in:
|
|
39
|
-
- **Description**: e.g., `
|
|
39
|
+
- **Description**: e.g., `LobeHub Web`
|
|
40
40
|
- **Identifier**: e.g., `com.yourcompany.lobechat.web` (this is your Client ID)
|
|
41
41
|
4. Click **Continue** > **Register**
|
|
42
42
|
|
|
@@ -113,7 +113,7 @@ tags:
|
|
|
113
113
|
|
|
114
114
|
<Callout type={'info'}>
|
|
115
115
|
After successful deployment, users will be able to authenticate with Apple and
|
|
116
|
-
use
|
|
116
|
+
use LobeHub.
|
|
117
117
|
</Callout>
|
|
118
118
|
|
|
119
119
|
## Common Issues
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: 在
|
|
3
|
-
description: 学习如何在
|
|
2
|
+
title: 在 LobeHub 中配置 Apple 身份验证
|
|
3
|
+
description: 学习如何在 LobeHub 中配置 Apple 登录,包括在 Apple Developer Portal 创建凭证和设置环境变量。
|
|
4
4
|
tags:
|
|
5
5
|
- Apple
|
|
6
6
|
- 身份验证
|
|
7
|
-
-
|
|
7
|
+
- LobeHub
|
|
8
8
|
- 单点登录
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -23,7 +23,7 @@ tags:
|
|
|
23
23
|
3. 点击 **+** 注册新标识符
|
|
24
24
|
4. 选择 **App IDs** > **App** 类型 > **Continue**
|
|
25
25
|
5. 填写:
|
|
26
|
-
- **Description**: 如 `
|
|
26
|
+
- **Description**: 如 `LobeHub`
|
|
27
27
|
- **Bundle ID**: 如 `com.yourcompany.lobechat`
|
|
28
28
|
6. 启用 **Sign In with Apple** 功能
|
|
29
29
|
7. 点击 **Continue** > **Register**
|
|
@@ -33,7 +33,7 @@ tags:
|
|
|
33
33
|
1. 返回 **Identifiers**,点击 **+**
|
|
34
34
|
2. 选择 **Services IDs** > **Continue**
|
|
35
35
|
3. 填写:
|
|
36
|
-
- **Description**: 如 `
|
|
36
|
+
- **Description**: 如 `LobeHub Web`
|
|
37
37
|
- **Identifier**: 如 `com.yourcompany.lobechat.web`(这是你的 Client ID)
|
|
38
38
|
4. 点击 **Continue** > **Register**
|
|
39
39
|
|
|
@@ -108,7 +108,7 @@ tags:
|
|
|
108
108
|
</Steps>
|
|
109
109
|
|
|
110
110
|
<Callout type={'info'}>
|
|
111
|
-
部署成功后,用户将可以通过 Apple 身份认证并使用
|
|
111
|
+
部署成功后,用户将可以通过 Apple 身份认证并使用 LobeHub。
|
|
112
112
|
</Callout>
|
|
113
113
|
|
|
114
114
|
## 常见问题
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Configuring Auth0 Authentication for
|
|
2
|
+
title: Configuring Auth0 Authentication for LobeHub
|
|
3
3
|
description: >-
|
|
4
|
-
Learn how to configure Auth0 SSO for
|
|
4
|
+
Learn how to configure Auth0 SSO for LobeHub, including creating
|
|
5
5
|
applications, adding users, and setting up environment variables.
|
|
6
6
|
tags:
|
|
7
7
|
- Auth0
|
|
8
8
|
- Authentication
|
|
9
|
-
-
|
|
9
|
+
- LobeHub
|
|
10
10
|
- Single Sign-On
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -59,13 +59,13 @@ tags:
|
|
|
59
59
|
|
|
60
60
|
### Configure Environment Variables
|
|
61
61
|
|
|
62
|
-
| Environment Variable
|
|
63
|
-
|
|
|
64
|
-
| `AUTH_SECRET`
|
|
65
|
-
| `AUTH_SSO_PROVIDERS`
|
|
66
|
-
| `AUTH_AUTH0_ID`
|
|
67
|
-
| `AUTH_AUTH0_SECRET`
|
|
68
|
-
| `AUTH_AUTH0_ISSUER`
|
|
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
69
|
|
|
70
70
|
<Callout type={'tip'}>
|
|
71
71
|
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#auth0)
|
|
@@ -75,7 +75,7 @@ tags:
|
|
|
75
75
|
|
|
76
76
|
<Callout type={'info'}>
|
|
77
77
|
After successful deployment, users will be able to authenticate with Auth0 and
|
|
78
|
-
use
|
|
78
|
+
use LobeHub.
|
|
79
79
|
</Callout>
|
|
80
80
|
|
|
81
81
|
## Advanced Configuration
|
|
@@ -100,7 +100,7 @@ Configure social login in **Authentication** > **Social**.
|
|
|
100
100
|
</Callout>
|
|
101
101
|
|
|
102
102
|
<Callout type={'warning'}>
|
|
103
|
-
When creating a GitHub connection, make sure to enable the **Email Address** permission in the **Attributes** section.
|
|
103
|
+
When creating a GitHub connection, make sure to enable the **Email Address** permission in the **Attributes** section. LobeHub requires user email for authentication.
|
|
104
104
|
|
|
105
105
|
<Image alt="GitHub Connection Email Permission" src="https://hub-apac-1.lobeobjects.space/docs/afdf22891dda3e5e44c690db184c548e.png" />
|
|
106
106
|
</Callout>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: 在
|
|
3
|
-
description: 学习如何在
|
|
2
|
+
title: 在 LobeHub 中配置 Auth0 身份验证
|
|
3
|
+
description: 学习如何在 LobeHub 中配置 Auth0 SSO,包括创建应用、添加用户和设置环境变量。
|
|
4
4
|
tags:
|
|
5
5
|
- Auth0
|
|
6
6
|
- 身份验证
|
|
7
|
-
-
|
|
7
|
+
- LobeHub
|
|
8
8
|
- 单点登录
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -57,13 +57,13 @@ tags:
|
|
|
57
57
|
|
|
58
58
|
### 配置环境变量
|
|
59
59
|
|
|
60
|
-
| 环境变量
|
|
61
|
-
|
|
|
62
|
-
| `AUTH_SECRET`
|
|
63
|
-
| `AUTH_SSO_PROVIDERS`
|
|
64
|
-
| `AUTH_AUTH0_ID`
|
|
65
|
-
| `AUTH_AUTH0_SECRET`
|
|
66
|
-
| `AUTH_AUTH0_ISSUER`
|
|
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
67
|
|
|
68
68
|
<Callout type={'tip'}>
|
|
69
69
|
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#auth0)
|
|
@@ -72,7 +72,7 @@ tags:
|
|
|
72
72
|
</Steps>
|
|
73
73
|
|
|
74
74
|
<Callout type={'info'}>
|
|
75
|
-
部署成功后,用户将可以通过 Auth0 身份认证并使用
|
|
75
|
+
部署成功后,用户将可以通过 Auth0 身份认证并使用 LobeHub。
|
|
76
76
|
</Callout>
|
|
77
77
|
|
|
78
78
|
## 高级配置
|
|
@@ -96,7 +96,7 @@ Auth0 支持 Azure AD、Slack、Google Workspace、Office 365、Zoom 等。详
|
|
|
96
96
|
</Callout>
|
|
97
97
|
|
|
98
98
|
<Callout type={'warning'}>
|
|
99
|
-
创建 GitHub 连接时,务必在 **Attributes** 部分勾选 **Email Address** 权限。
|
|
99
|
+
创建 GitHub 连接时,务必在 **Attributes** 部分勾选 **Email Address** 权限。LobeHub 需要用户邮箱进行身份认证。
|
|
100
100
|
|
|
101
101
|
<Image alt="GitHub 连接邮箱权限" src="https://hub-apac-1.lobeobjects.space/docs/afdf22891dda3e5e44c690db184c548e.png" />
|
|
102
102
|
</Callout>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Configuring Authelia Authentication for
|
|
2
|
+
title: Configuring Authelia Authentication for LobeHub
|
|
3
3
|
description: >-
|
|
4
|
-
Learn how to configure Authelia SSO for
|
|
4
|
+
Learn how to configure Authelia SSO for LobeHub, including setting up OIDC
|
|
5
5
|
client and environment variables.
|
|
6
6
|
tags:
|
|
7
7
|
- Authelia
|
|
8
8
|
- Authentication
|
|
9
|
-
-
|
|
9
|
+
- LobeHub
|
|
10
10
|
- Single Sign-On
|
|
11
11
|
- OIDC
|
|
12
12
|
---
|
|
@@ -25,7 +25,7 @@ tags:
|
|
|
25
25
|
oidc:
|
|
26
26
|
clients:
|
|
27
27
|
- client_id: 'lobechat'
|
|
28
|
-
client_name: '
|
|
28
|
+
client_name: 'LobeHub'
|
|
29
29
|
client_secret: 'your-client-secret'
|
|
30
30
|
redirect_uris:
|
|
31
31
|
- 'https://your-domain.com/api/auth/callback/authelia'
|
|
@@ -41,15 +41,15 @@ tags:
|
|
|
41
41
|
|
|
42
42
|
### Configure Environment Variables
|
|
43
43
|
|
|
44
|
-
When deploying
|
|
44
|
+
When deploying LobeHub, you need to configure the following environment variables:
|
|
45
45
|
|
|
46
|
-
| Environment Variable
|
|
47
|
-
|
|
|
48
|
-
| `AUTH_SECRET`
|
|
49
|
-
| `AUTH_SSO_PROVIDERS`
|
|
50
|
-
| `AUTH_AUTHELIA_ID`
|
|
51
|
-
| `AUTH_AUTHELIA_SECRET`
|
|
52
|
-
| `AUTH_AUTHELIA_ISSUER`
|
|
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 LobeHub. 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
53
|
|
|
54
54
|
<Callout type={'tip'}>
|
|
55
55
|
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#authelia) for detailed information on these variables.
|
|
@@ -57,7 +57,7 @@ tags:
|
|
|
57
57
|
</Steps>
|
|
58
58
|
|
|
59
59
|
<Callout type={'info'}>
|
|
60
|
-
After successful deployment, users will be able to authenticate with Authelia and use
|
|
60
|
+
After successful deployment, users will be able to authenticate with Authelia and use LobeHub.
|
|
61
61
|
</Callout>
|
|
62
62
|
|
|
63
63
|
## Related Resources
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: 在
|
|
3
|
-
description: 学习如何在
|
|
2
|
+
title: 在 LobeHub 中配置 Authelia 身份验证
|
|
3
|
+
description: 学习如何在 LobeHub 中配置 Authelia SSO,包括设置 OIDC 客户端和环境变量。
|
|
4
4
|
tags:
|
|
5
5
|
- Authelia
|
|
6
6
|
- 身份验证
|
|
7
|
-
-
|
|
7
|
+
- LobeHub
|
|
8
8
|
- 单点登录
|
|
9
9
|
- OIDC
|
|
10
10
|
---
|
|
@@ -23,7 +23,7 @@ tags:
|
|
|
23
23
|
oidc:
|
|
24
24
|
clients:
|
|
25
25
|
- client_id: 'lobechat'
|
|
26
|
-
client_name: '
|
|
26
|
+
client_name: 'LobeHub'
|
|
27
27
|
client_secret: 'your-client-secret'
|
|
28
28
|
redirect_uris:
|
|
29
29
|
- 'https://your-domain.com/api/auth/callback/authelia'
|
|
@@ -39,22 +39,22 @@ tags:
|
|
|
39
39
|
|
|
40
40
|
### 配置环境变量
|
|
41
41
|
|
|
42
|
-
在部署
|
|
42
|
+
在部署 LobeHub 时,你需要配置以下环境变量:
|
|
43
43
|
|
|
44
|
-
| 环境变量
|
|
45
|
-
|
|
|
46
|
-
| `AUTH_SECRET`
|
|
47
|
-
| `AUTH_SSO_PROVIDERS`
|
|
48
|
-
| `AUTH_AUTHELIA_ID`
|
|
49
|
-
| `AUTH_AUTHELIA_SECRET`
|
|
50
|
-
| `AUTH_AUTHELIA_ISSUER`
|
|
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
51
|
|
|
52
52
|
<Callout type={'tip'}>
|
|
53
53
|
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#authelia) 可查阅相关变量详情。
|
|
54
54
|
</Callout>
|
|
55
55
|
</Steps>
|
|
56
56
|
|
|
57
|
-
<Callout type={'info'}>部署成功后,用户将可以通过 Authelia 身份认证并使用
|
|
57
|
+
<Callout type={'info'}>部署成功后,用户将可以通过 Authelia 身份认证并使用 LobeHub。</Callout>
|
|
58
58
|
|
|
59
59
|
## 相关资源
|
|
60
60
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Configuring Authentik Authentication for
|
|
2
|
+
title: Configuring Authentik Authentication for LobeHub
|
|
3
3
|
description: >-
|
|
4
|
-
Learn how to configure Authentik SSO for
|
|
4
|
+
Learn how to configure Authentik SSO for LobeHub, including creating an
|
|
5
5
|
OAuth2 provider and application.
|
|
6
6
|
tags:
|
|
7
7
|
- Authentik
|
|
8
8
|
- Authentication
|
|
9
|
-
-
|
|
9
|
+
- LobeHub
|
|
10
10
|
- Single Sign-On
|
|
11
11
|
- OIDC
|
|
12
12
|
---
|
|
@@ -21,7 +21,7 @@ tags:
|
|
|
21
21
|
1. In Authentik admin interface, go to **Applications** > **Providers**
|
|
22
22
|
2. Click **Create** and select **OAuth2/OpenID Provider**
|
|
23
23
|
3. Configure the provider:
|
|
24
|
-
- Name: `
|
|
24
|
+
- Name: `LobeHub`
|
|
25
25
|
- Authorization flow: Select your authorization flow
|
|
26
26
|
- Client type: `Confidential`
|
|
27
27
|
- Redirect URIs: Add your callback URL
|
|
@@ -42,15 +42,15 @@ tags:
|
|
|
42
42
|
|
|
43
43
|
### Configure Environment Variables
|
|
44
44
|
|
|
45
|
-
When deploying
|
|
45
|
+
When deploying LobeHub, you need to configure the following environment variables:
|
|
46
46
|
|
|
47
|
-
| Environment Variable
|
|
48
|
-
|
|
|
49
|
-
| `AUTH_SECRET`
|
|
50
|
-
| `AUTH_SSO_PROVIDERS`
|
|
51
|
-
| `AUTH_AUTHENTIK_ID`
|
|
52
|
-
| `AUTH_AUTHENTIK_SECRET`
|
|
53
|
-
| `AUTH_AUTHENTIK_ISSUER`
|
|
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 LobeHub. 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
54
|
|
|
55
55
|
<Callout type={'tip'}>
|
|
56
56
|
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#authentik) for detailed information on these variables.
|
|
@@ -58,7 +58,7 @@ tags:
|
|
|
58
58
|
</Steps>
|
|
59
59
|
|
|
60
60
|
<Callout type={'info'}>
|
|
61
|
-
After successful deployment, users will be able to authenticate with Authentik and use
|
|
61
|
+
After successful deployment, users will be able to authenticate with Authentik and use LobeHub.
|
|
62
62
|
</Callout>
|
|
63
63
|
|
|
64
64
|
## Related Resources
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: 在
|
|
3
|
-
description: 学习如何在
|
|
2
|
+
title: 在 LobeHub 中配置 Authentik 身份验证
|
|
3
|
+
description: 学习如何在 LobeHub 中配置 Authentik SSO,包括创建 OAuth2 提供商和应用。
|
|
4
4
|
tags:
|
|
5
5
|
- Authentik
|
|
6
6
|
- 身份验证
|
|
7
|
-
-
|
|
7
|
+
- LobeHub
|
|
8
8
|
- 单点登录
|
|
9
9
|
- OIDC
|
|
10
10
|
---
|
|
@@ -19,7 +19,7 @@ tags:
|
|
|
19
19
|
1. 在 Authentik 管理界面,前往 **Applications** > **Providers**
|
|
20
20
|
2. 点击 **Create**,选择 **OAuth2/OpenID Provider**
|
|
21
21
|
3. 配置提供商:
|
|
22
|
-
- Name: `
|
|
22
|
+
- Name: `LobeHub`
|
|
23
23
|
- Authorization flow: 选择授权流程
|
|
24
24
|
- Client type: `Confidential`
|
|
25
25
|
- Redirect URIs: 添加回调 URL
|
|
@@ -40,22 +40,22 @@ tags:
|
|
|
40
40
|
|
|
41
41
|
### 配置环境变量
|
|
42
42
|
|
|
43
|
-
在部署
|
|
43
|
+
在部署 LobeHub 时,你需要配置以下环境变量:
|
|
44
44
|
|
|
45
|
-
| 环境变量
|
|
46
|
-
|
|
|
47
|
-
| `AUTH_SECRET`
|
|
48
|
-
| `AUTH_SSO_PROVIDERS`
|
|
49
|
-
| `AUTH_AUTHENTIK_ID`
|
|
50
|
-
| `AUTH_AUTHENTIK_SECRET`
|
|
51
|
-
| `AUTH_AUTHENTIK_ISSUER`
|
|
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
52
|
|
|
53
53
|
<Callout type={'tip'}>
|
|
54
54
|
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#authentik) 可查阅相关变量详情。
|
|
55
55
|
</Callout>
|
|
56
56
|
</Steps>
|
|
57
57
|
|
|
58
|
-
<Callout type={'info'}>部署成功后,用户将可以通过 Authentik 身份认证并使用
|
|
58
|
+
<Callout type={'info'}>部署成功后,用户将可以通过 Authentik 身份认证并使用 LobeHub。</Callout>
|
|
59
59
|
|
|
60
60
|
## 相关资源
|
|
61
61
|
|