@lobehub/chat 0.147.0 → 0.147.2
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/CHANGELOG.md +50 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docs/self-hosting/advanced/analytics.mdx +1 -0
- package/docs/self-hosting/advanced/analytics.zh-CN.mdx +1 -0
- package/docs/self-hosting/advanced/authentication.mdx +7 -6
- package/docs/self-hosting/advanced/authentication.zh-CN.mdx +7 -6
- package/docs/self-hosting/advanced/sso-providers/auth0.mdx +58 -32
- package/docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx +60 -32
- package/docs/self-hosting/advanced/sso-providers/authentik.mdx +33 -29
- package/docs/self-hosting/advanced/sso-providers/authentik.zh-CN.mdx +30 -27
- package/docs/self-hosting/advanced/sso-providers/github.mdx +49 -20
- package/docs/self-hosting/advanced/sso-providers/github.zh-CN.mdx +57 -31
- package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.mdx +53 -35
- package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.zh-CN.mdx +43 -31
- package/docs/self-hosting/advanced/sso-providers/zitadel.mdx +64 -34
- package/docs/self-hosting/advanced/sso-providers/zitadel.zh-CN.mdx +62 -36
- package/docs/self-hosting/advanced/upstream-sync.mdx +32 -23
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +32 -23
- package/docs/self-hosting/environment-variables/analytics.mdx +1 -0
- package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/auth.mdx +1 -0
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/basic.mdx +1 -0
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/model-provider.mdx +1 -0
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables.mdx +1 -0
- package/docs/self-hosting/environment-variables.zh-CN.mdx +1 -0
- package/docs/self-hosting/examples/azure-openai.mdx +12 -8
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +12 -8
- package/docs/self-hosting/examples/ollama.mdx +1 -0
- package/docs/self-hosting/examples/ollama.zh-CN.mdx +1 -0
- package/docs/self-hosting/faq/no-v1-suffix.mdx +1 -0
- package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +1 -0
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +1 -0
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.zh-CN.mdx +1 -0
- package/docs/self-hosting/platform/docker-compose.mdx +80 -73
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +79 -73
- package/docs/self-hosting/platform/docker.mdx +85 -85
- package/docs/self-hosting/platform/docker.zh-CN.mdx +84 -85
- package/docs/self-hosting/platform/netlify.mdx +91 -42
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +88 -38
- package/docs/self-hosting/platform/railway.mdx +8 -6
- package/docs/self-hosting/platform/railway.zh-CN.mdx +8 -6
- package/docs/self-hosting/platform/repocloud.mdx +8 -6
- package/docs/self-hosting/platform/repocloud.zh-CN.mdx +8 -6
- package/docs/self-hosting/platform/sealos.mdx +8 -6
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +8 -6
- package/docs/self-hosting/platform/vercel.mdx +9 -7
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +9 -7
- package/docs/self-hosting/platform/zeabur.mdx +8 -6
- package/docs/self-hosting/platform/zeabur.zh-CN.mdx +8 -6
- package/docs/self-hosting/start.mdx +11 -1
- package/docs/self-hosting/start.zh-CN.mdx +2 -1
- package/docs/usage/agents/concepts.mdx +13 -2
- package/docs/usage/agents/concepts.zh-CN.mdx +13 -2
- package/docs/usage/agents/custom-agent.mdx +9 -2
- package/docs/usage/agents/custom-agent.zh-CN.mdx +8 -4
- package/docs/usage/agents/model.mdx +3 -3
- package/docs/usage/agents/model.zh-CN.mdx +6 -5
- package/docs/usage/agents/prompt.mdx +7 -5
- package/docs/usage/agents/prompt.zh-CN.mdx +7 -5
- package/docs/usage/agents/topics.mdx +9 -1
- package/docs/usage/agents/topics.zh-CN.mdx +9 -1
- package/docs/usage/features/agent-market.mdx +5 -5
- package/docs/usage/features/agent-market.zh-CN.mdx +1 -0
- package/docs/usage/features/local-llm.mdx +6 -1
- package/docs/usage/features/local-llm.zh-CN.mdx +6 -1
- package/docs/usage/features/mobile.mdx +5 -1
- package/docs/usage/features/mobile.zh-CN.mdx +6 -1
- package/docs/usage/features/more.mdx +1 -0
- package/docs/usage/features/more.zh-CN.mdx +1 -0
- package/docs/usage/features/multi-ai-providers.mdx +11 -2
- package/docs/usage/features/multi-ai-providers.zh-CN.mdx +12 -2
- package/docs/usage/features/plugin-system.mdx +8 -7
- package/docs/usage/features/plugin-system.zh-CN.mdx +9 -7
- package/docs/usage/features/pwa.mdx +10 -4
- package/docs/usage/features/pwa.zh-CN.mdx +11 -4
- package/docs/usage/features/text-to-image.zh-CN.mdx +1 -0
- package/docs/usage/features/theme.mdx +6 -1
- package/docs/usage/features/theme.zh-CN.mdx +7 -1
- package/docs/usage/features/tts.zh-CN.mdx +1 -0
- package/docs/usage/features/vision.zh-CN.mdx +1 -0
- package/docs/usage/plugins/basic-usage.mdx +31 -7
- package/docs/usage/plugins/basic-usage.zh-CN.mdx +31 -7
- package/docs/usage/plugins/custom-plugin.mdx +1 -0
- package/docs/usage/plugins/custom-plugin.zh-CN.mdx +1 -0
- package/docs/usage/plugins/development.mdx +79 -30
- package/docs/usage/plugins/development.zh-CN.mdx +80 -31
- package/docs/usage/plugins/store.mdx +11 -2
- package/docs/usage/plugins/store.zh-CN.mdx +11 -2
- package/docs/usage/providers/groq.mdx +32 -12
- package/docs/usage/providers/groq.zh-CN.mdx +30 -12
- package/docs/usage/providers/ollama/gemma.mdx +27 -11
- package/docs/usage/providers/ollama/gemma.zh-CN.mdx +28 -11
- package/docs/usage/providers/ollama/qwen.mdx +30 -16
- package/docs/usage/providers/ollama/qwen.zh-CN.mdx +25 -11
- package/docs/usage/providers/ollama.mdx +27 -14
- package/docs/usage/providers/ollama.zh-CN.mdx +27 -14
- package/package.json +1 -1
- package/src/app/settings/llm/Azure/index.tsx +1 -1
- package/src/app/settings/llm/components/ProviderConfig/index.tsx +1 -1
- package/src/app/settings/llm/components/ProviderModelList/CustomModelOption.tsx +1 -1
- package/src/app/settings/llm/components/ProviderModelList/ModelConfigModal.tsx +1 -1
- package/src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx +3 -3
- package/src/app/settings/llm/components/ProviderModelList/index.tsx +2 -2
- package/src/features/AgentSetting/AgentConfig/ModelSelect.tsx +1 -1
- package/src/features/Conversation/Error/APIKeyForm/ProviderApiKeyForm.tsx +2 -2
- package/src/features/ModelSwitchPanel/index.tsx +1 -1
- package/src/locales/resources.test.ts +49 -0
- package/src/locales/resources.ts +7 -20
- package/src/services/_auth.ts +5 -3
- package/src/services/_header.ts +3 -4
- package/src/services/chat.ts +1 -1
- package/src/services/ollama.ts +3 -2
- package/src/store/global/slices/settings/actions/llm.test.ts +1 -1
- package/src/store/global/slices/settings/actions/llm.ts +2 -2
- package/src/store/global/slices/settings/selectors/modelConfig.test.ts +35 -14
- package/src/store/global/slices/settings/selectors/modelConfig.ts +55 -118
|
@@ -8,6 +8,7 @@ tags:
|
|
|
8
8
|
- 环境变量
|
|
9
9
|
- LobeChat
|
|
10
10
|
---
|
|
11
|
+
|
|
11
12
|
# 配置 Authentik 身份验证服务
|
|
12
13
|
|
|
13
14
|
## Authentik 配置流程
|
|
@@ -15,45 +16,47 @@ tags:
|
|
|
15
16
|
<Steps>
|
|
16
17
|
### 创建 Authentik 提供应用
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
在你的 Authentik 实例中使用管理员账号进入 管理员界面 -> 应用程序 -> 提供程序 创建一个新的提供程序。
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
选择 OAuth2/OpenID Provider 作为提供程序类型。填写提供程序的名称,选择身份流程和授权流程。
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
在 `重定向 URL/Origin(正则)` 处填写:
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
```bash
|
|
26
|
+
https://your-domain/api/auth/callback/authentik
|
|
27
|
+
```
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
<Callout type={'info'}>
|
|
30
|
+
- 可以之后再填写或修改 `重定向 URL/Origin(正则)`,但是务必保证填写的 URL 与部署的 URL 一致。 -
|
|
31
|
+
your-domain 请替换为自己的域名
|
|
32
32
|
</Callout>
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
<Image
|
|
35
|
+
alt="创建 Authentik 提供程序"
|
|
36
|
+
inStep
|
|
37
|
+
src="https://github.com/lobehub/lobe-chat/assets/67304509/4244634e-5f68-48d5-aac0-e5f4b06d1c4b"
|
|
38
|
+
/>
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
点击「完成」
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
创建成功后,点击左侧的「应用程序」-> 创建,填写名称和 Slug ,提供程序选择上一步创建的提供程序,点击「创建」。
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
复制 `OpenID 配置颁发者` 的 URL,保存下来。
|
|
44
|
+
提供程序创建成功后,点击相应的提供程序,进入详情页,点击「编辑」,将 `客户端 ID` 和 `客户端 Secret` 保存下来。复制 `OpenID 配置颁发者` 的 URL,保存下来。
|
|
42
45
|
|
|
43
|
-
|
|
46
|
+
### 配置环境变量
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
在部署 LobeChat 时,你需要配置以下环境变量:
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
| 环境变量 | 类型 | 描述 |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
|
53
|
+
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
|
54
|
+
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 |
|
|
55
|
+
| `AUTHENTIK_CLIENT_ID` | 必选 | Authentik 提供程序详情页的 客户端 ID |
|
|
56
|
+
| `AUTHENTIK_CLIENT_SECRET` | 必选 | Authentik 提供程序详情页的 客户端 Secret |
|
|
57
|
+
| `AUTHENTIK_ISSUER` | 必选 | Authentik 提供程序详情页的 OpenID 配置颁发者 |
|
|
58
|
+
| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
|
|
59
|
+
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
|
57
60
|
|
|
58
61
|
<Callout type={'tip'}>
|
|
59
62
|
前往 [📘 环境变量](/zh/self-hosting/environment-variable#Authentik) 可查阅相关变量详情。
|
|
@@ -11,6 +11,7 @@ tags:
|
|
|
11
11
|
- Single Sign-On
|
|
12
12
|
- OAuth authentication
|
|
13
13
|
---
|
|
14
|
+
|
|
14
15
|
# Configuring Github Authentication Service
|
|
15
16
|
|
|
16
17
|
## Github Configuration Process
|
|
@@ -22,53 +23,81 @@ Click [here][github-create-app] to create a new Github App.
|
|
|
22
23
|
|
|
23
24
|
Fill in the Github App name, Homepage URL, and Callback URL.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
<Image
|
|
27
|
+
alt="Create a Github Provider"
|
|
28
|
+
inStep
|
|
29
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/2f919f99-2aaa-4fa7-9938-169d3ed09db7"
|
|
30
|
+
/>
|
|
26
31
|
|
|
27
32
|
Set the webhook callback URL according to your needs.
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
<Image
|
|
35
|
+
alt="Fill in other fields"
|
|
36
|
+
inStep
|
|
37
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/d7ef5ad1-b1a3-435e-b1bc-4436d2b6fecd"
|
|
38
|
+
/>
|
|
30
39
|
|
|
31
40
|
Set the permission to read email addresses.
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
<Image
|
|
43
|
+
alt="Set required permissions"
|
|
44
|
+
inStep
|
|
45
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/23131ca1-9e84-4a89-a840-ef79c4bc0251"
|
|
46
|
+
/>
|
|
47
|
+
<Image
|
|
48
|
+
alt="Set permission to read email addresses"
|
|
49
|
+
inStep
|
|
50
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/358bca8d-3d82-4e76-9a5e-90d16a39efde"
|
|
51
|
+
/>
|
|
35
52
|
|
|
36
53
|
Set whether it is accessible publicly or only accessible to yourself.
|
|
37
54
|
|
|
38
|
-
|
|
55
|
+
<Image
|
|
56
|
+
alt="Set whether it is accessible publicly or only accessible to yourself"
|
|
57
|
+
inStep
|
|
58
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/995780cb-9096-4a36-ab17-d422703ab970"
|
|
59
|
+
/>
|
|
39
60
|
|
|
40
61
|
Click "Create Github App".
|
|
41
62
|
|
|
42
63
|
After successful creation, click "Generate a new client secret" to create a client secret.
|
|
43
64
|
|
|
44
|
-
|
|
65
|
+
<Image
|
|
66
|
+
alt="Create a new client secret"
|
|
67
|
+
inStep
|
|
68
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/6d69bdca-7d18-4cbc-b3e0-220d8815cd29"
|
|
69
|
+
/>
|
|
45
70
|
|
|
46
71
|
After successful creation, save the `Client ID` and `Client Secret`.
|
|
47
72
|
|
|
48
|
-
|
|
73
|
+
<Image
|
|
74
|
+
alt="Create a new client secret"
|
|
75
|
+
inStep
|
|
76
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/c6108133-a918-48b0-ab1a-e3fa607572a4"
|
|
77
|
+
/>
|
|
49
78
|
|
|
50
79
|
### Configure Environment Variables
|
|
51
80
|
|
|
52
81
|
When deploying LobeChat, you need to configure the following environment variables:
|
|
53
82
|
|
|
54
|
-
| Environment Variable
|
|
55
|
-
|
|
|
56
|
-
| `ENABLE_OAUTH_SSO`
|
|
57
|
-
| `NEXTAUTH_SECRET`
|
|
58
|
-
| `SSO_PROVIDERS`
|
|
59
|
-
| `GITHUB_CLIENT_ID`
|
|
60
|
-
| `GITHUB_CLIENT_SECRET` | Required | Client Secret in the Github App details page.
|
|
61
|
-
| `ACCESS_CODE`
|
|
62
|
-
| `NEXTAUTH_URL`
|
|
83
|
+
| Environment Variable | Type | Description |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| `ENABLE_OAUTH_SSO` | Required | Enable Single Sign-On (SSO) for LobeChat. Set to `1` to enable SSO. |
|
|
86
|
+
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` |
|
|
87
|
+
| `SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. |
|
|
88
|
+
| `GITHUB_CLIENT_ID` | Required | Client ID in the Github App details page. |
|
|
89
|
+
| `GITHUB_CLIENT_SECRET` | Required | Client Secret in the Github App details page. |
|
|
90
|
+
| `ACCESS_CODE` | Required | Add a password for accessing this service. You can set a long random password to "disable" access code authorization. |
|
|
91
|
+
| `NEXTAUTH_URL` | Optional | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` |
|
|
63
92
|
|
|
64
93
|
<Callout type={'tip'}>
|
|
65
|
-
Go to [📘 Environment Variables](/en/self-hosting/environment-variable#Github) for detailed
|
|
66
|
-
|
|
67
|
-
|
|
94
|
+
Go to [📘 Environment Variables](/en/self-hosting/environment-variable#Github) for detailed
|
|
95
|
+
information on these variables.
|
|
96
|
+
</Callout>
|
|
68
97
|
</Steps>
|
|
69
98
|
|
|
70
99
|
<Callout type={'info'}>
|
|
71
|
-
After successful deployment, users will be able to authenticate with Github and use LobeChat.
|
|
100
|
+
After successful deployment, users will be able to authenticate with Github and use LobeChat.
|
|
72
101
|
</Callout>
|
|
73
102
|
|
|
74
103
|
[github-create-app]: https://github.com/settings/apps/new
|
|
@@ -8,6 +8,7 @@ tags:
|
|
|
8
8
|
- 单点登录
|
|
9
9
|
- LobeChat
|
|
10
10
|
---
|
|
11
|
+
|
|
11
12
|
# 配置 Github 身份验证服务
|
|
12
13
|
|
|
13
14
|
## Github 配置流程
|
|
@@ -15,48 +16,75 @@ tags:
|
|
|
15
16
|
<Steps>
|
|
16
17
|
### 创建 Github 提供应用
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
点击[这里][github-create-app]创建一个新的Gituhb App。
|
|
20
|
+
|
|
21
|
+
填写Github App name、Homepage URL、Callbak URL
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
<Image
|
|
24
|
+
alt="创建 Github 提供程序"
|
|
25
|
+
inStep
|
|
26
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/2f919f99-2aaa-4fa7-9938-169d3ed09db7"
|
|
27
|
+
/>
|
|
28
|
+
按照自己所需设置Webhook回调地址
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
<Image
|
|
31
|
+
alt="填写其他字段"
|
|
32
|
+
inStep
|
|
33
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/d7ef5ad1-b1a3-435e-b1bc-4436d2b6fecd"
|
|
34
|
+
/>
|
|
25
35
|
|
|
26
|
-
|
|
36
|
+
设置读取邮件地址权限
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
<Image
|
|
39
|
+
alt="设置所需权限"
|
|
40
|
+
inStep
|
|
41
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/23131ca1-9e84-4a89-a840-ef79c4bc0251"
|
|
42
|
+
/>
|
|
43
|
+
<Image
|
|
44
|
+
alt="设置读取邮件地址权限"
|
|
45
|
+
inStep
|
|
46
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/358bca8d-3d82-4e76-9a5e-90d16a39efde"
|
|
47
|
+
/>
|
|
29
48
|
|
|
30
|
-
|
|
31
|
-
<Image alt="设置读取邮件地址权限" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/358bca8d-3d82-4e76-9a5e-90d16a39efde" />
|
|
49
|
+
设置公开访问还是仅自己访问
|
|
32
50
|
|
|
33
|
-
|
|
51
|
+
<Image
|
|
52
|
+
alt="设置公开访问还是仅自己访问"
|
|
53
|
+
inStep
|
|
54
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/995780cb-9096-4a36-ab17-d422703ab970"
|
|
55
|
+
/>
|
|
34
56
|
|
|
35
|
-
|
|
57
|
+
点击「Create Github App」
|
|
36
58
|
|
|
37
|
-
|
|
59
|
+
创建成功后,点击「Generate a new client secret」创建客户端Secret
|
|
38
60
|
|
|
39
|
-
|
|
61
|
+
<Image
|
|
62
|
+
alt="创建新的客户端密钥"
|
|
63
|
+
inStep
|
|
64
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/6d69bdca-7d18-4cbc-b3e0-220d8815cd29"
|
|
65
|
+
/>
|
|
40
66
|
|
|
41
|
-
|
|
67
|
+
创建成功后, 将 `客户端 ID` 和 `客户端 Secret` 保存下来。
|
|
42
68
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
69
|
+
<Image
|
|
70
|
+
alt="创建新的客户端密钥"
|
|
71
|
+
inStep
|
|
72
|
+
src="https://github.com/lobehub/lobe-chat/assets/64475363/c6108133-a918-48b0-ab1a-e3fa607572a4"
|
|
73
|
+
/>
|
|
46
74
|
|
|
47
|
-
|
|
75
|
+
### 配置环境变量
|
|
48
76
|
|
|
49
|
-
|
|
77
|
+
在部署 LobeChat 时,你需要配置以下环境变量:
|
|
50
78
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
79
|
+
| 环境变量 | 类型 | 描述 |
|
|
80
|
+
| --- | --- | --- |
|
|
81
|
+
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
|
82
|
+
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
|
83
|
+
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 |
|
|
84
|
+
| `GITHUB_CLIENT_ID` | 必选 | Github App详情页的 客户端 ID |
|
|
85
|
+
| `GITHUB_CLIENT_SECRET` | 必选 | Github App详情页的 客户端 Secret |
|
|
86
|
+
| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
|
|
87
|
+
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
|
60
88
|
|
|
61
89
|
<Callout type={'tip'}>
|
|
62
90
|
前往 [📘 环境变量](/zh/self-hosting/environment-variable#Github) 可查阅相关变量详情。
|
|
@@ -64,8 +92,6 @@ tags:
|
|
|
64
92
|
</Callout>
|
|
65
93
|
</Steps>
|
|
66
94
|
|
|
67
|
-
<Callout type={'info'}>
|
|
68
|
-
部署成功后,用户将可以通过Github身份认证并使用 LobeChat。
|
|
69
|
-
</Callout>
|
|
95
|
+
<Callout type={'info'}>部署成功后,用户将可以通过Github身份认证并使用 LobeChat。</Callout>
|
|
70
96
|
|
|
71
97
|
[github-create-app]: https://github.com/settings/apps/new
|
|
@@ -12,68 +12,86 @@ tags:
|
|
|
12
12
|
- Environment Variables
|
|
13
13
|
- LobeChat
|
|
14
14
|
---
|
|
15
|
+
|
|
15
16
|
# Configuration of Microsoft Entra ID Authentication Service
|
|
16
17
|
|
|
17
18
|
<Steps>
|
|
18
19
|
### Create a Microsoft Entra ID Application
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
In your [Microsoft Azure Portal][microsoft-azure-portal], go to Microsoft Entra ID -> App registrations -> New registration to create a new application.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
Fill in the desired application name to be displayed to organizational users, choose the account types you wish to support, and if only internal users are supported, select `Accounts in this organizational directory only (Default Directory only - Single tenant)`.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter:
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
```bash
|
|
28
|
+
https://your-domain/api/auth/callback/azure-ad
|
|
29
|
+
```
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
<Callout type={'info'}>
|
|
32
|
+
- You can fill in or modify the Redirect URIs after registering, but make sure the URL you enter
|
|
33
|
+
matches the deployed URL. - Please replace "your-domain" with your own domain.
|
|
34
34
|
</Callout>
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
<Image
|
|
37
|
+
alt="App Register"
|
|
38
|
+
inStep
|
|
39
|
+
src="https://github.com/lobehub/lobe-chat/assets/13883964/4f9d83bd-b3fc-4abc-bcf4-ccbad65c219d"
|
|
40
|
+
/>
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
Click on "Register".
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
After successfully creating the application, click on the corresponding application to enter the application details page, and switch to the "Overview" tab to view the corresponding configuration information.
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
<Image
|
|
47
|
+
alt="App Overview"
|
|
48
|
+
inStep
|
|
49
|
+
src="https://github.com/lobehub/lobe-chat/assets/13883964/48a0b702-05bd-4ce4-a007-a8ad00a36e5a"
|
|
50
|
+
/>
|
|
43
51
|
|
|
44
|
-
|
|
52
|
+
Go to "Certificates & secrets", select the "Client secrets" tab, click on "New client secret", fill in the description, select the expiration time, and click on "Add" to create a new client secret.
|
|
45
53
|
|
|
46
|
-
|
|
54
|
+
<Image
|
|
55
|
+
alt="Create App Client Secret"
|
|
56
|
+
inStep
|
|
57
|
+
src="https://github.com/lobehub/lobe-chat/assets/13883964/c9d66fa0-158c-4bd3-a1fa-969e638259d2"
|
|
58
|
+
/>
|
|
47
59
|
|
|
48
|
-
|
|
60
|
+
<Callout type={'important'}>
|
|
61
|
+
Please make sure to save your client secret as this is your only chance to view it.
|
|
62
|
+
</Callout>
|
|
49
63
|
|
|
50
|
-
|
|
64
|
+
### Add Users
|
|
51
65
|
|
|
52
|
-
|
|
66
|
+
Go back to the "Microsoft Entra ID" interface, enter "Users", click on "New user", fill in the user information, and click on "Create" to create a user for using LobeChat.
|
|
53
67
|
|
|
54
|
-
|
|
68
|
+
### Configure Environment Variables
|
|
55
69
|
|
|
56
|
-
|
|
70
|
+
When deploying LobeChat, you need to configure the following environment variables:
|
|
57
71
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
| Environment Variable | Type | Description |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `ENABLE_OAUTH_SSO` | Required | Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on. |
|
|
75
|
+
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` |
|
|
76
|
+
| `SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `azure-ad` for Microsoft Entra ID. |
|
|
77
|
+
| `AZURE_AD_CLIENT_ID` | Required | Client ID of the Microsoft Entra ID application. |
|
|
78
|
+
| `AZURE_AD_CLIENT_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
|
|
79
|
+
| `AZURE_AD_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
|
|
80
|
+
| `ACCESS_CODE` | Required | Add a password for accessing this service, you can set a sufficiently long random password to "disable" access code authorization. |
|
|
81
|
+
| `NEXTAUTH_URL` | Optional | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` |
|
|
68
82
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
<Callout type={'tip'}>
|
|
84
|
+
You can refer to [📘 environment
|
|
85
|
+
variables](/en/self-hosting/environment-variable#microsoft-entra-id) for details on related
|
|
86
|
+
variables.
|
|
72
87
|
</Callout>
|
|
73
88
|
|
|
74
89
|
</Steps>
|
|
75
90
|
|
|
76
|
-
<Callout>
|
|
91
|
+
<Callout>
|
|
92
|
+
After successful deployment, users will be able to authenticate and use LobeChat using the users
|
|
93
|
+
configured in Microsoft Entra ID.
|
|
94
|
+
</Callout>
|
|
77
95
|
|
|
78
96
|
## Advanced Configuration
|
|
79
97
|
|
|
@@ -9,6 +9,7 @@ tags:
|
|
|
9
9
|
- 环境变量
|
|
10
10
|
- 用户管理
|
|
11
11
|
---
|
|
12
|
+
|
|
12
13
|
# 配置 Microsoft Entra ID 身份验证服务
|
|
13
14
|
|
|
14
15
|
## Microsoft Entra ID 配置流程
|
|
@@ -16,54 +17,65 @@ tags:
|
|
|
16
17
|
<Steps>
|
|
17
18
|
### 创建 Microsoft Entra ID 应用
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
在你的 [Microsoft Azure Portal][microsoft-azure-portal] 进入 Microsoft Entra ID -> App registrations -> New registration 创建一个新的应用。
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
填写你想向组织用户显示的应用名称,选择你期望支持的账户类型,如果只支持内部用户请选择 `Accounts in this organizational directory only (Default Directory only - Single tenant)`。
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
在 `Redirect URI (optional)` 中,应用类型选择 `Web`,Callback URL, 处填写:
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
```bash
|
|
27
|
+
https://your-domain/api/auth/callback/azure-ad
|
|
28
|
+
```
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
<Callout type={'info'}>
|
|
31
|
+
- 可以在 Register 后再填写或修改 Redirect URIs,但是务必保证填写的 URL 与部署的 URL 一致。 -
|
|
32
|
+
your-domain 请填写自己的域名
|
|
33
33
|
</Callout>
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<Image
|
|
36
|
+
alt="App Register"
|
|
37
|
+
inStep
|
|
38
|
+
src="https://github.com/lobehub/lobe-chat/assets/13883964/4f9d83bd-b3fc-4abc-bcf4-ccbad65c219d"
|
|
39
|
+
/>
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
点击「Register」
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
创建成功后,点击相应的应用,进入应用详情页,切换到「Overview」标签页,就可以看到相应的配置信息。
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
<Image
|
|
46
|
+
alt="App Overview"
|
|
47
|
+
inStep
|
|
48
|
+
src="https://github.com/lobehub/lobe-chat/assets/13883964/48a0b702-05bd-4ce4-a007-a8ad00a36e5a"
|
|
49
|
+
/>
|
|
42
50
|
|
|
43
|
-
|
|
51
|
+
进入「Certificates & secrets」,选择「Client secrets」标签,点击「New client secret」,填写描述,选择过期时间,点击「Add」,创建一个新的客户端密钥。
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
<Image
|
|
54
|
+
alt="Create App Client Secret"
|
|
55
|
+
inStep
|
|
56
|
+
src="https://github.com/lobehub/lobe-chat/assets/13883964/c9d66fa0-158c-4bd3-a1fa-969e638259d2"
|
|
57
|
+
/>
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
<Callout type={'important'}>请务必保存好你的客户端密钥,因为这是你唯一的机会查看它。</Callout>
|
|
48
60
|
|
|
49
|
-
|
|
61
|
+
### 新增用户
|
|
50
62
|
|
|
51
|
-
|
|
63
|
+
回到「Microsoft Entra ID」界面,进入「Users」,点击「New user」,填写用户信息,点击「Create」,创建用户以使用 LobeChat。
|
|
52
64
|
|
|
53
|
-
|
|
65
|
+
### 配置环境变量
|
|
54
66
|
|
|
55
|
-
|
|
67
|
+
在部署 LobeChat 时,你需要配置以下环境变量:
|
|
56
68
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
| 环境变量 | 类型 | 描述 |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
|
72
|
+
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
|
73
|
+
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `azure-ad`。 |
|
|
74
|
+
| `AZURE_AD_CLIENT_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID |
|
|
75
|
+
| `AZURE_AD_CLIENT_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret |
|
|
76
|
+
| `AZURE_AD_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID |
|
|
77
|
+
| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
|
|
78
|
+
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
|
67
79
|
|
|
68
80
|
<Callout type={'tip'}>
|
|
69
81
|
前往 [📘 环境变量](/zh/self-hosting/environment-variable#microsoft-entra-id) 可查阅相关变量详情。
|