Skip to content

Commit

Permalink
📝 docs: improve docs (lobehub#1597)
Browse files Browse the repository at this point in the history
* 📝 docs: Update docs to fit the new docs theme

* 📝 docs: Update docs

* 🔧 chore: fix build

* Update tts.zh-CN.mdx

* Update tts.mdx

---------

Co-authored-by: arvinxx <[email protected]>
  • Loading branch information
canisminor1990 and arvinxx authored Mar 17, 2024
1 parent d9353d1 commit 04d8e53
Show file tree
Hide file tree
Showing 75 changed files with 352 additions and 410 deletions.
2 changes: 0 additions & 2 deletions docs/self-hosting/advanced/analytics.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Callout } from 'nextra/components';

# Data Analysis

To better help analyze the usage of LobeChat users, we have integrated several free/open-source data analytics services in LobeChat for collecting user usage data, which you can enable as needed.
Expand Down
2 changes: 0 additions & 2 deletions docs/self-hosting/advanced/analytics.zh-CN.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Callout } from 'nextra/components';

# 数据分析

为更好地帮助分析 LobeChat 的用户使用情况,我们在 LobeChat 中集成了若干免费 / 开源的数据统计服务,用于收集用户的使用情况,你可以按需开启。
Expand Down
8 changes: 4 additions & 4 deletions docs/self-hosting/advanced/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ To simultaneously enable multiple identity verification sources, please set the

The order corresponds to the display order of the SSO providers.

| SSO Provider | Value |
| ------------------ | -------- |
| Auth0 | auth0 |
| Microsoft Entra ID | azure-ad |
| SSO Provider | Value |
| ------------------ | ---------- |
| Auth0 | `auth0` |
| Microsoft Entra ID | `azure-ad` |

## Other SSO Providers

Expand Down
8 changes: 4 additions & 4 deletions docs/self-hosting/advanced/authentication.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ LobeChat 支持配置外部身份验证服务,供企业 / 组织内部使用

顺序为 SSO 提供商的显示顺序。

| SSO 提供商 ||
| ------------------ | -------- |
| Auth0 | auth0 |
| Microsoft Entra ID | azure-ad |
| SSO 提供商 | |
| ------------------ | ---------- |
| Auth0 | `auth0` |
| Microsoft Entra ID | `azure-ad` |

## 其他 SSO 提供商

Expand Down
22 changes: 11 additions & 11 deletions docs/self-hosting/advanced/sso-providers/auth0.mdx
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
import { Callout, Steps } from 'nextra/components';

# Configure Auth0 Identity Verification Service

<Steps>
### Create Auth0 Application

Register and log in to [Auth0][auth0-client-page], click on the "Applications" in the left navigation bar to switch to the application management interface, and click "Create Application" in the upper right corner to create an application.

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/1b405347-f4c3-4c55-82f6-47116f2210d0)
<Image alt="Create Auth0 Application S1" inStep src="hhttps://github.com/CloudPassenger/lobe-chat/assets/30863298/1b405347-f4c3-4c55-82f6-47116f2210d0" />

Fill in the application name you want to display to the organization users, choose any application type, and click "Create".

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/75c92f85-3ad3-4473-a9c6-e667e28d428d)
<Image alt="Create Auth0 Application S2" inStep src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/75c92f85-3ad3-4473-a9c6-e667e28d428d" />

After successful creation, click on the corresponding application to enter the application details page, switch to the "Settings" tab, and you can see the corresponding configuration information.

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/a1ed996b-95ef-4b7d-a50d-b4666eccfecb)
<Image alt="Create Auth0 Application S3" inStep src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/a1ed996b-95ef-4b7d-a50d-b4666eccfecb" />

In the application configuration page, you also need to configure Allowed Callback URLs, where you should fill in:

```bash
http(s)://your-domain/api/auth/callback/auth0
```

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/575f46aa-f485-49bd-8b90-dbb1ce1a5c1b)
<Image alt="Create Auth0 Application S4" inStep src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/575f46aa-f485-49bd-8b90-dbb1ce1a5c1b" />

<Callout type={'info'}>
<Callout type={'important'}>
You can fill in or modify Allowed Callback URLs after deployment, but make sure the filled URL is
consistent with the deployed URL.
</Callout>
Expand All @@ -34,7 +32,7 @@ import { Callout, Steps } from 'nextra/components';

Click on the "Users Management" in the left navigation bar to enter the user management interface, where you can create users for your organization to log in to LobeChat.

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/3b8127ab-dc4f-4ff9-a4cb-dec3ef0295cc)
<Image alt="Add Users" inStep src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/3b8127ab-dc4f-4ff9-a4cb-dec3ef0295cc" />

### Configure Environment Variables

Expand All @@ -51,7 +49,9 @@ import { Callout, Steps } from 'nextra/components';
| `ACCESS_CODE` | Required | Add a password to access this service. You can set a sufficiently long random password to "disable" access code authorization. |
| `NEXTAUTH_URL` | Optional | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |

<Callout type={'info'}>You can refer to the related variable details at [📘Environment Variables](/en/self-hosting/environment-variable#auth0).</Callout>
<Callout type={'tip'}>
You can refer to the related variable details at [📘Environment Variables](/en/self-hosting/environment-variable#auth0).
</Callout>
</Steps>

<Callout>
Expand All @@ -67,13 +67,13 @@ If your enterprise or organization already has a unified identity authentication

Auth0 supports single sign-on services such as Azure Active Directory, Slack, Google Workspace, Office 365, Zoom, and more. For a detailed list of supported services, please refer to [this link][auth0-sso-integrations].

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/32650f4f-d0b0-4843-b26d-d35bad11d8a3)
<Image alt="Connecting to an Existing Single Sign-On Service" src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/32650f4f-d0b0-4843-b26d-d35bad11d8a3" />

### Configuring Social Login

If your enterprise or organization needs to support external user logins, you can configure social login services in Authentication -> Social.

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/7b6f6a6c-2686-49d8-9dbd-0516053f1efa)
<Image alt="Configuring Social Login" src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/7b6f6a6c-2686-49d8-9dbd-0516053f1efa" />

<Callout type={'warning'}>
Configuring social login services by default allows anyone to authenticate, which may lead to
Expand Down
22 changes: 11 additions & 11 deletions docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
import { Callout, Steps } from 'nextra/components';

# 配置 Auth0 身份验证服务

<Steps>
### 创建 Auth0 应用

注册并登录 [Auth0][auth0-client-page],点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/1b405347-f4c3-4c55-82f6-47116f2210d0)
<Image alt="创建 Auth0 应用 S1" inStep src="hhttps://github.com/CloudPassenger/lobe-chat/assets/30863298/1b405347-f4c3-4c55-82f6-47116f2210d0" />

填写你想向组织用户显示的应用名称,可选择任意应用类型,点击「Create」。

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/75c92f85-3ad3-4473-a9c6-e667e28d428d)
<Image alt="创建 Auth0 应用 S2" inStep src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/75c92f85-3ad3-4473-a9c6-e667e28d428d" />

创建成功后,点击相应的应用,进入应用详情页,切换到「Settings」标签页,就可以看到相应的配置信息

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/a1ed996b-95ef-4b7d-a50d-b4666eccfecb)
<Image alt="创建 Auth0 应用 S3" inStep src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/a1ed996b-95ef-4b7d-a50d-b4666eccfecb" />

在应用配置页面中,还需要配置 Allowed Callback URLs,在此处填写:

```bash
http(s)://your-domain/api/auth/callback/auth0
```

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/575f46aa-f485-49bd-8b90-dbb1ce1a5c1b)
<Image alt="创建 Auth0 应用 S4" inStep src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/575f46aa-f485-49bd-8b90-dbb1ce1a5c1b" />

<Callout type={'info'}>
<Callout type={'important'}>
可以在部署后再填写或修改 Allowed Callback URLs,但是务必保证填写的 URL 与部署的 URL 一致
</Callout>

### 新增用户

点击左侧导航栏的「Users Management」,进入用户管理界面,可以为你的组织新建用户,用以登录 LobeChat

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/3b8127ab-dc4f-4ff9-a4cb-dec3ef0295cc)
<Image alt="新增用户" inStep src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/3b8127ab-dc4f-4ff9-a4cb-dec3ef0295cc" />

### 配置环境变量

Expand All @@ -50,7 +48,9 @@ import { Callout, Steps } from 'nextra/components';
| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |

<Callout type={'info'}> 前往 [📘 环境变量](/zh/self-hosting/environment-variable#auth0) 可查阅相关变量详情。</Callout>
<Callout type={'tip'}>
前往 [📘 环境变量](/zh/self-hosting/environment-variable#auth0) 可查阅相关变量详情。
</Callout>
</Steps>

<Callout type={'info'}>部署成功后,用户将可以使用 Auth0 中配置的用户通过身份认证并使用 LobeChat。</Callout>
Expand All @@ -63,13 +63,13 @@ import { Callout, Steps } from 'nextra/components';

Auth0 支持 Azure Active Directory / Slack / Google Workspace / Office 365 / Zoom 等单点登录服务,详细支持列表可参考 [这里][auth0-sso-integrations]

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/32650f4f-d0b0-4843-b26d-d35bad11d8a3)
<Image alt="Connecting to an Existing Single Sign-On Service" src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/32650f4f-d0b0-4843-b26d-d35bad11d8a3" />

### 配置社交登录

如果你的企业或组织需要支持外部人员登录,可以在 Authentication -> Social 中,配置社交登录服务。

![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/7b6f6a6c-2686-49d8-9dbd-0516053f1efa)
<Image alt="Configuring Social Login" src="https://github.com/CloudPassenger/lobe-chat/assets/30863298/7b6f6a6c-2686-49d8-9dbd-0516053f1efa" />

<Callout type={'warning'}>
配置社交登录服务默认会允许所有人通过认证,这可能会导致 LobeChat 被外部人员滥用。
Expand Down
15 changes: 9 additions & 6 deletions docs/self-hosting/advanced/sso-providers/microsoft-entra-id.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter:

```bash
https://<your-domain>/api/auth/callback/azure-ad
https://your-domain/api/auth/callback/azure-ad
```

<Callout type={'info'}>
- You can fill in or modify the Redirect URIs after registering, but make sure the URL you enter matches the deployed URL.
- Please replace "your-domain" with your own domain.
</Callout>

![App Register](https://github.com/lobehub/lobe-chat/assets/13883964/4f9d83bd-b3fc-4abc-bcf4-ccbad65c219d)
<Image alt="App Register" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/4f9d83bd-b3fc-4abc-bcf4-ccbad65c219d" />

Click on "Register".

After successfully creating the application, click on the corresponding application to enter the application details page, and switch to the "Overview" tab to view the corresponding configuration information.

![App Overview](https://github.com/lobehub/lobe-chat/assets/13883964/48a0b702-05bd-4ce4-a007-a8ad00a36e5a)
<Image alt="App Overview" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/48a0b702-05bd-4ce4-a007-a8ad00a36e5a" />

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.

![Create App Client Secret](https://github.com/lobehub/lobe-chat/assets/13883964/c9d66fa0-158c-4bd3-a1fa-969e638259d2)
<Image alt="Create App Client Secret" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/c9d66fa0-158c-4bd3-a1fa-969e638259d2" />

<Callout type={'info'}>Please make sure to save your client secret as this is your only chance to view it.</Callout>
<Callout type={'important'}>Please make sure to save your client secret as this is your only chance to view it.</Callout>

### Add Users

Expand All @@ -51,7 +51,10 @@
| `ACCESS_CODE` | Required | Add a password for accessing this service, you can set a sufficiently long random password to "disable" access code authorization. |
| `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` |

<Callout type={'info'}>You can refer to [📘 environment variables](/en/self-hosting/environment-variable#microsoft-entra-id) for details on related variables.</Callout>
<Callout type={'tip'}>
You can refer to [📘 environment variables](/en/self-hosting/environment-variable#microsoft-entra-id) for details on related variables.
</Callout>

</Steps>

<Callout>After successful deployment, users will be able to authenticate and use LobeChat using the users configured in Microsoft Entra ID.</Callout>
Expand Down
Loading

0 comments on commit 04d8e53

Please sign in to comment.