@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 配置 Redis 缓存服务
|
|
3
|
-
description: 了解如何配置 Redis 缓存服务以优化
|
|
3
|
+
description: 了解如何配置 Redis 缓存服务以优化 LobeHub 的性能和会话管理。
|
|
4
4
|
tags:
|
|
5
5
|
- Redis
|
|
6
6
|
- 缓存
|
|
@@ -10,17 +10,17 @@ tags:
|
|
|
10
10
|
|
|
11
11
|
# 配置 Redis 缓存服务
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
LobeHub 使用 Redis 作为高性能缓存和会话存储服务,用于优化系统性能和管理用户认证状态。
|
|
14
14
|
|
|
15
15
|
<Callout type={'info'}>
|
|
16
|
-
|
|
16
|
+
LobeHub 使用标准 Redis 协议(通过 ioredis 库),支持任何兼容 Redis 协议的服务,包括 Redis
|
|
17
17
|
官方服务、自部署 Redis、以及云服务商提供的 Redis 服务(如 AWS ElastiCache、阿里云 Redis
|
|
18
18
|
等)。
|
|
19
19
|
</Callout>
|
|
20
20
|
|
|
21
21
|
## 使用场景
|
|
22
22
|
|
|
23
|
-
Redis 在
|
|
23
|
+
Redis 在 LobeHub 中主要用于以下场景:
|
|
24
24
|
|
|
25
25
|
### 认证会话存储
|
|
26
26
|
|
|
@@ -57,7 +57,7 @@ Redis 在 LobeChat 中主要用于以下场景:
|
|
|
57
57
|
|
|
58
58
|
### `REDIS_PREFIX`
|
|
59
59
|
|
|
60
|
-
Redis 键的前缀,用于在共享 Redis 实例中隔离
|
|
60
|
+
Redis 键的前缀,用于在共享 Redis 实例中隔离 LobeHub 的数据。
|
|
61
61
|
|
|
62
62
|
- 默认值:`lobechat`
|
|
63
63
|
- 示例:`REDIS_PREFIX=my-lobechat`
|
|
@@ -118,7 +118,7 @@ REDIS_PREFIX=lobechat
|
|
|
118
118
|
## 注意事项
|
|
119
119
|
|
|
120
120
|
<Callout type={'warning'}>
|
|
121
|
-
Redis 是可选服务。如果不配置 `REDIS_URL`,
|
|
121
|
+
Redis 是可选服务。如果不配置 `REDIS_URL`,LobeHub 仍然可以正常运行,但会失去上述缓存和会话管理的优化功能。
|
|
122
122
|
</Callout>
|
|
123
123
|
|
|
124
124
|
- **内存管理**:Redis 是内存数据库,请确保服务器有足够的内存
|
|
@@ -12,131 +12,131 @@ tags:
|
|
|
12
12
|
We need to configure an S3-compatible storage service in the server-side database to store files.
|
|
13
13
|
|
|
14
14
|
<Callout type={'info'}>
|
|
15
|
-
Due to recent changes in MinIO's commercial strategy, we no longer recommend MinIO as the S3 storage backend. Please migrate to open-source solutions such as [RustFS](https://rustfs.com/) or [ceph](https://ceph.io/), or to cloud providers like Tencent Cloud Object Storage or Cloudflare R2.
|
|
15
|
+
Due to recent changes in MinIO's commercial strategy, we no longer recommend MinIO as the S3 storage backend. Please migrate to open-source solutions such as [RustFS](https://rustfs.com/) or [ceph](https://ceph.io/), or to cloud providers like Tencent Cloud Object Storage or Cloudflare R2.
|
|
16
16
|
</Callout>
|
|
17
17
|
|
|
18
18
|
## Configuration Steps
|
|
19
19
|
|
|
20
20
|
<Steps>
|
|
21
|
-
### Deploy RustFS
|
|
22
|
-
|
|
23
|
-
First, pull the RustFS Docker image:
|
|
24
|
-
|
|
25
|
-
```shell
|
|
26
|
-
docker pull rustfs/rustfs:latest
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
You can inspect its version with the following command. We recommend version v1.0.0 or above:
|
|
30
|
-
|
|
31
|
-
```shell
|
|
32
|
-
docker inspect --format='{{index .Config.Labels "version"}}' rustfs/rustfs:latest
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
We recommend using Docker Compose to deploy RustFS:
|
|
36
|
-
|
|
37
|
-
```yml
|
|
38
|
-
services:
|
|
39
|
-
rustfs:
|
|
40
|
-
image: rustfs/rustfs:latest
|
|
41
|
-
container_name: lobe-rustfs
|
|
42
|
-
ports:
|
|
43
|
-
- '9000:9000'
|
|
44
|
-
- '9001:9001'
|
|
45
|
-
environment:
|
|
46
|
-
- RUSTFS_CONSOLE_ENABLE=true
|
|
47
|
-
- RUSTFS_ACCESS_KEY=<YOUR_ACCESS_KEY>
|
|
48
|
-
- RUSTFS_SECRET_KEY=<YOUR_SECRET_KEY>
|
|
49
|
-
volumes:
|
|
50
|
-
- rustfs-data:/data
|
|
51
|
-
|
|
52
|
-
volumes:
|
|
53
|
-
rustfs-data:
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Then start RustFS:
|
|
57
|
-
|
|
58
|
-
```shell
|
|
59
|
-
docker compose up -d
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Create a Bucket
|
|
63
|
-
|
|
64
|
-
Open the RustFS WebUI (`http://localhost:9001/`) and you will be redirected to the login screen. Enter the username (`RUSTFS_ACCESS_KEY` in the `docker-compose.yml`) and password (`RUSTFS_SECRET_KEY` in the same file) to sign in.
|
|
65
|
-
|
|
66
|
-
Click `Object Storage` in the left sidebar, then the `Create Bucket` button in the top-right corner to create a new bucket. This example uses the name `lobe`. Leave Versioning and Object Lock disabled (default settings).
|
|
67
|
-
|
|
68
|
-
<Image alt={"Create Bucket"} src={'https://github.com/user-attachments/assets/27c37617-a813-4de5-b0bf-c7167999c856'} />
|
|
69
|
-
|
|
70
|
-
Go to the bucket and click `Settings`, choose `Custom` for the policy, and paste the following JSON to make the bucket public-read/private-write:
|
|
71
|
-
|
|
72
|
-
```json
|
|
73
|
-
{
|
|
74
|
-
"ID": "",
|
|
75
|
-
"Version": "2012-10-17",
|
|
76
|
-
"Statement": [
|
|
77
|
-
{
|
|
78
|
-
"Sid": "",
|
|
79
|
-
"Effect": "Allow",
|
|
80
|
-
"Principal": {
|
|
81
|
-
"AWS": [
|
|
82
|
-
"*"
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"Action": [
|
|
86
|
-
"s3:GetObject"
|
|
87
|
-
],
|
|
88
|
-
"NotAction": [],
|
|
89
|
-
"Resource": [
|
|
90
|
-
"arn:aws:s3:::lobe/*"
|
|
91
|
-
],
|
|
92
|
-
"NotResource": [],
|
|
93
|
-
"Condition": {}
|
|
94
|
-
}
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Save the settings to apply the policy.
|
|
100
|
-
|
|
101
|
-
### Configure Access Keys
|
|
102
|
-
|
|
103
|
-
<Callout type={'warning'}>
|
|
104
|
-
You can reuse the `RUSTFS_ACCESS_KEY` and `RUSTFS_SECRET_KEY` defined in the `docker-compose.yml`, but for better security we recommend creating a dedicated access key.
|
|
105
|
-
</Callout>
|
|
106
|
-
|
|
107
|
-
Click `Access Key` in the left sidebar, then `Add Access Key` to create a new key. The name is arbitrary, and you can keep the default main-account policy.
|
|
108
|
-
|
|
109
|
-
Copy the generated Access Key and Secret Key (the `Export` button lets you save the JSON locally). The English labels in the UI are confusing, but remember the shorter string is the Access Key and the longer string is the Secret Key (the exported JSON is correct).
|
|
110
|
-
|
|
111
|
-
<Image alt={"Add Key"} src={'https://github.com/user-attachments/assets/81f18b20-3918-4f77-8571-07d0c4a79aec'} />
|
|
112
|
-
|
|
113
|
-
<Image alt={"Export Key"} src={'https://github.com/user-attachments/assets/4dde41ec-985b-4781-8c77-aac65555a32f'} />
|
|
114
|
-
|
|
115
|
-
### Configure Reverse Proxy
|
|
21
|
+
### Deploy RustFS
|
|
116
22
|
|
|
117
|
-
|
|
23
|
+
First, pull the RustFS Docker image:
|
|
118
24
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
| `lobe-s3-ui.example.com` | `9001` | |
|
|
25
|
+
```shell
|
|
26
|
+
docker pull rustfs/rustfs:latest
|
|
27
|
+
```
|
|
123
28
|
|
|
124
|
-
|
|
29
|
+
You can inspect its version with the following command. We recommend version v1.0.0 or above:
|
|
125
30
|
|
|
126
|
-
|
|
31
|
+
```shell
|
|
32
|
+
docker inspect --format='{{index .Config.Labels "version"}}' rustfs/rustfs:latest
|
|
33
|
+
```
|
|
127
34
|
|
|
128
|
-
|
|
35
|
+
We recommend using Docker Compose to deploy RustFS:
|
|
129
36
|
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
37
|
+
```yml
|
|
38
|
+
services:
|
|
39
|
+
rustfs:
|
|
40
|
+
image: rustfs/rustfs:latest
|
|
41
|
+
container_name: lobe-rustfs
|
|
42
|
+
ports:
|
|
43
|
+
- '9000:9000'
|
|
44
|
+
- '9001:9001'
|
|
45
|
+
environment:
|
|
46
|
+
- RUSTFS_CONSOLE_ENABLE=true
|
|
47
|
+
- RUSTFS_ACCESS_KEY=<YOUR_ACCESS_KEY>
|
|
48
|
+
- RUSTFS_SECRET_KEY=<YOUR_SECRET_KEY>
|
|
49
|
+
volumes:
|
|
50
|
+
- rustfs-data:/data
|
|
51
|
+
|
|
52
|
+
volumes:
|
|
53
|
+
rustfs-data:
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then start RustFS:
|
|
57
|
+
|
|
58
|
+
```shell
|
|
59
|
+
docker compose up -d
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Create a Bucket
|
|
63
|
+
|
|
64
|
+
Open the RustFS WebUI (`http://localhost:9001/`) and you will be redirected to the login screen. Enter the username (`RUSTFS_ACCESS_KEY` in the `docker-compose.yml`) and password (`RUSTFS_SECRET_KEY` in the same file) to sign in.
|
|
65
|
+
|
|
66
|
+
Click `Object Storage` in the left sidebar, then the `Create Bucket` button in the top-right corner to create a new bucket. This example uses the name `lobe`. Leave Versioning and Object Lock disabled (default settings).
|
|
67
|
+
|
|
68
|
+
<Image alt={"Create Bucket"} src={'https://github.com/user-attachments/assets/27c37617-a813-4de5-b0bf-c7167999c856'} />
|
|
69
|
+
|
|
70
|
+
Go to the bucket and click `Settings`, choose `Custom` for the policy, and paste the following JSON to make the bucket public-read/private-write:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"ID": "",
|
|
75
|
+
"Version": "2012-10-17",
|
|
76
|
+
"Statement": [
|
|
77
|
+
{
|
|
78
|
+
"Sid": "",
|
|
79
|
+
"Effect": "Allow",
|
|
80
|
+
"Principal": {
|
|
81
|
+
"AWS": [
|
|
82
|
+
"*"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"Action": [
|
|
86
|
+
"s3:GetObject"
|
|
87
|
+
],
|
|
88
|
+
"NotAction": [],
|
|
89
|
+
"Resource": [
|
|
90
|
+
"arn:aws:s3:::lobe/*"
|
|
91
|
+
],
|
|
92
|
+
"NotResource": [],
|
|
93
|
+
"Condition": {}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Save the settings to apply the policy.
|
|
100
|
+
|
|
101
|
+
### Configure Access Keys
|
|
102
|
+
|
|
103
|
+
<Callout type={'warning'}>
|
|
104
|
+
You can reuse the `RUSTFS_ACCESS_KEY` and `RUSTFS_SECRET_KEY` defined in the `docker-compose.yml`, but for better security we recommend creating a dedicated access key.
|
|
105
|
+
</Callout>
|
|
106
|
+
|
|
107
|
+
Click `Access Key` in the left sidebar, then `Add Access Key` to create a new key. The name is arbitrary, and you can keep the default main-account policy.
|
|
108
|
+
|
|
109
|
+
Copy the generated Access Key and Secret Key (the `Export` button lets you save the JSON locally). The English labels in the UI are confusing, but remember the shorter string is the Access Key and the longer string is the Secret Key (the exported JSON is correct).
|
|
110
|
+
|
|
111
|
+
<Image alt={"Add Key"} src={'https://github.com/user-attachments/assets/81f18b20-3918-4f77-8571-07d0c4a79aec'} />
|
|
112
|
+
|
|
113
|
+
<Image alt={"Export Key"} src={'https://github.com/user-attachments/assets/4dde41ec-985b-4781-8c77-aac65555a32f'} />
|
|
114
|
+
|
|
115
|
+
### Configure Reverse Proxy
|
|
116
|
+
|
|
117
|
+
You also need reverse-proxy rules so that RustFS is accessible from the LAN/public internet. Map the following ports to domains:
|
|
118
|
+
|
|
119
|
+
| Domain | Port | Required |
|
|
120
|
+
| ------------------------- | ------ | -------- |
|
|
121
|
+
| `lobe-s3-api.example.com` | `9000` | Yes |
|
|
122
|
+
| `lobe-s3-ui.example.com` | `9001` | |
|
|
123
|
+
|
|
124
|
+
After completing the reverse proxy, remember to configure the corresponding SSL certificate and enable HTTPS access.
|
|
125
|
+
|
|
126
|
+
### Set Environment Variables
|
|
127
|
+
|
|
128
|
+
Update the LobeHub `.env` file with the following environment variables to use RustFS as the S3 backend:
|
|
129
|
+
|
|
130
|
+
```shell
|
|
131
|
+
# RustFS Access Key / Secret Key
|
|
132
|
+
S3_ACCESS_KEY_ID=<YOUR_ACCESS_KEY>
|
|
133
|
+
S3_SECRET_ACCESS_KEY=<YOUR_SECRET_KEY>
|
|
134
|
+
# RustFS API endpoint
|
|
135
|
+
S3_ENDPOINT=https://lobe-s3-api.example.com
|
|
136
|
+
# Bucket name
|
|
137
|
+
S3_BUCKET=lobe
|
|
138
|
+
# Public domain for accessing the bucket
|
|
139
|
+
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
|
140
|
+
S3_ENABLE_PATH_STYLE=1
|
|
141
|
+
```
|
|
142
142
|
</Steps>
|
|
@@ -11,133 +11,132 @@ tags:
|
|
|
11
11
|
|
|
12
12
|
在服务端数据库中我们需要配置 S3 存储服务来存储文件。
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
<Callout type={'info'}>
|
|
16
|
-
由于近期 MinIO 的商业化策略调整,我们不再推荐使用 MinIO 作为 S3 存储服务,建议所有仍在使用 MinIO 的用户迁移至 [RustFS](https://rustfs.com/) 或者 [ceph](https://ceph.io/) 等开源的 S3 存储服务或者腾讯云对象存储、Cloudflare R2 等云服务商的 S3 存储服务。
|
|
15
|
+
由于近期 MinIO 的商业化策略调整,我们不再推荐使用 MinIO 作为 S3 存储服务,建议所有仍在使用 MinIO 的用户迁移至 [RustFS](https://rustfs.com/) 或者 [ceph](https://ceph.io/) 等开源的 S3 存储服务或者腾讯云对象存储、Cloudflare R2 等云服务商的 S3 存储服务。
|
|
17
16
|
</Callout>
|
|
18
17
|
|
|
19
18
|
## 配置步骤
|
|
20
19
|
|
|
21
20
|
<Steps>
|
|
22
|
-
### 部署 RustFS
|
|
23
|
-
|
|
24
|
-
首先,拉取 RustFS 的 Docker 镜像:
|
|
25
|
-
|
|
26
|
-
```shell
|
|
27
|
-
docker pull rustfs/rustfs:latest
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
你可以使用如下命令来查看其版本,建议使用 v1.0.0 及以上版本:
|
|
31
|
-
|
|
32
|
-
```shell
|
|
33
|
-
docker inspect --format='{{index .Config.Labels "version"}}' rustfs/rustfs:latest
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
我们推荐使用 Docker Compose 来部署 RustFS:
|
|
37
|
-
|
|
38
|
-
```yml
|
|
39
|
-
services:
|
|
40
|
-
rustfs:
|
|
41
|
-
image: rustfs/rustfs:latest
|
|
42
|
-
container_name: lobe-rustfs
|
|
43
|
-
ports:
|
|
44
|
-
- '9000:9000'
|
|
45
|
-
- '9001:9001'
|
|
46
|
-
environment:
|
|
47
|
-
- RUSTFS_CONSOLE_ENABLE=true
|
|
48
|
-
- RUSTFS_ACCESS_KEY=<YOUR_ACCESS_KEY>
|
|
49
|
-
- RUSTFS_SECRET_KEY=<YOUR_SECRET_KEY>
|
|
50
|
-
volumes:
|
|
51
|
-
- rustfs-data:/data
|
|
52
|
-
|
|
53
|
-
volumes:
|
|
54
|
-
rustfs-data:
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
然后,启动 RustFS:
|
|
58
|
-
|
|
59
|
-
```shell
|
|
60
|
-
docker compose up -d
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### 创建存储桶
|
|
64
|
-
|
|
65
|
-
访问 RustFS 的 WebUI(`http://localhost:9001/`),即可自动跳转到登录页。输入账号(上述 `docker-compose.yml` 文件中的 `RUSTFS_ACCESS_KEY`)、密码(上述 `docker-compose.yml` 文件中的 `RUSTFS_SECRET_KEY`),即可登录。
|
|
66
|
-
|
|
67
|
-
点击左侧边栏的 `对象存储` 菜单,右上角 `创建存储桶` 按钮,创建一个新的存储桶(Bucket)。创建存储桶时将指定其名称,下文以 `lobe` 为例。版本、对象锁依照默认配置不开启。
|
|
68
|
-
|
|
69
|
-
<Image alt={"Create Bucket"} src={'https://github.com/user-attachments/assets/27c37617-a813-4de5-b0bf-c7167999c856'} />
|
|
70
|
-
|
|
71
|
-
点击存储桶 - `配置` 按钮,选择策略为 `自定义`,然后填入如下 JSON,设置存储桶的权限为 `公有读私有写`:
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
{
|
|
75
|
-
"ID": "",
|
|
76
|
-
"Version": "2012-10-17",
|
|
77
|
-
"Statement": [
|
|
78
|
-
{
|
|
79
|
-
"Sid": "",
|
|
80
|
-
"Effect": "Allow",
|
|
81
|
-
"Principal": {
|
|
82
|
-
"AWS": [
|
|
83
|
-
"*"
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"Action": [
|
|
87
|
-
"s3:GetObject"
|
|
88
|
-
],
|
|
89
|
-
"NotAction": [],
|
|
90
|
-
"Resource": [
|
|
91
|
-
"arn:aws:s3:::lobe/*"
|
|
92
|
-
],
|
|
93
|
-
"NotResource": [],
|
|
94
|
-
"Condition": {}
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
点击保存即可。
|
|
101
|
-
|
|
102
|
-
### 设置访问密钥
|
|
103
|
-
|
|
104
|
-
<Callout type={'warning'}>
|
|
105
|
-
有关这部分,你可以直接使用在 `docker-compose.yml` 文件中配置的 `RUSTFS_ACCESS_KEY` 和 `RUSTFS_SECRET_KEY`,但出于安全考虑,我们推荐你手动创建一个访问密钥。
|
|
106
|
-
</Callout>
|
|
107
|
-
|
|
108
|
-
点击左侧边栏的 `访问密钥` 菜单,右上角 `添加访问密钥` 按钮,创建一个新的访问密钥(Access Key)。名称随意,按照默认配置使用主账号策略即可。
|
|
109
|
-
|
|
110
|
-
记录好得到的访问密钥和密钥(你可以点击 `导出` 按钮以在本地保存)。这里 RustFS 的翻译有点迷惑,但你只需要记住上面那个短的是 `Access Key`,长的是 `Secret Key` 即可(导出的 JSON 中是对的)。
|
|
111
|
-
|
|
112
|
-
<Image alt={"Add Key"} src={'https://github.com/user-attachments/assets/81f18b20-3918-4f77-8571-07d0c4a79aec'} />
|
|
113
|
-
|
|
114
|
-
<Image alt={"Export Key"} src={'https://github.com/user-attachments/assets/4dde41ec-985b-4781-8c77-aac65555a32f'} />
|
|
115
|
-
|
|
116
|
-
### 配置反向代理
|
|
21
|
+
### 部署 RustFS
|
|
117
22
|
|
|
118
|
-
|
|
23
|
+
首先,拉取 RustFS 的 Docker 镜像:
|
|
119
24
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
| `lobe-s3-ui.example.com` | `9001` | |
|
|
25
|
+
```shell
|
|
26
|
+
docker pull rustfs/rustfs:latest
|
|
27
|
+
```
|
|
124
28
|
|
|
125
|
-
|
|
29
|
+
你可以使用如下命令来查看其版本,建议使用 v1.0.0 及以上版本:
|
|
126
30
|
|
|
127
|
-
|
|
31
|
+
```shell
|
|
32
|
+
docker inspect --format='{{index .Config.Labels "version"}}' rustfs/rustfs:latest
|
|
33
|
+
```
|
|
128
34
|
|
|
129
|
-
|
|
35
|
+
我们推荐使用 Docker Compose 来部署 RustFS:
|
|
130
36
|
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
37
|
+
```yml
|
|
38
|
+
services:
|
|
39
|
+
rustfs:
|
|
40
|
+
image: rustfs/rustfs:latest
|
|
41
|
+
container_name: lobe-rustfs
|
|
42
|
+
ports:
|
|
43
|
+
- '9000:9000'
|
|
44
|
+
- '9001:9001'
|
|
45
|
+
environment:
|
|
46
|
+
- RUSTFS_CONSOLE_ENABLE=true
|
|
47
|
+
- RUSTFS_ACCESS_KEY=<YOUR_ACCESS_KEY>
|
|
48
|
+
- RUSTFS_SECRET_KEY=<YOUR_SECRET_KEY>
|
|
49
|
+
volumes:
|
|
50
|
+
- rustfs-data:/data
|
|
51
|
+
|
|
52
|
+
volumes:
|
|
53
|
+
rustfs-data:
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
然后,启动 RustFS:
|
|
57
|
+
|
|
58
|
+
```shell
|
|
59
|
+
docker compose up -d
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 创建存储桶
|
|
63
|
+
|
|
64
|
+
访问 RustFS 的 WebUI(`http://localhost:9001/`),即可自动跳转到登录页。输入账号(上述 `docker-compose.yml` 文件中的 `RUSTFS_ACCESS_KEY`)、密码(上述 `docker-compose.yml` 文件中的 `RUSTFS_SECRET_KEY`),即可登录。
|
|
65
|
+
|
|
66
|
+
点击左侧边栏的 `对象存储` 菜单,右上角 `创建存储桶` 按钮,创建一个新的存储桶(Bucket)。创建存储桶时将指定其名称,下文以 `lobe` 为例。版本、对象锁依照默认配置不开启。
|
|
67
|
+
|
|
68
|
+
<Image alt={"Create Bucket"} src={'https://github.com/user-attachments/assets/27c37617-a813-4de5-b0bf-c7167999c856'} />
|
|
69
|
+
|
|
70
|
+
点击存储桶 - `配置` 按钮,选择策略为 `自定义`,然后填入如下 JSON,设置存储桶的权限为 `公有读私有写`:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"ID": "",
|
|
75
|
+
"Version": "2012-10-17",
|
|
76
|
+
"Statement": [
|
|
77
|
+
{
|
|
78
|
+
"Sid": "",
|
|
79
|
+
"Effect": "Allow",
|
|
80
|
+
"Principal": {
|
|
81
|
+
"AWS": [
|
|
82
|
+
"*"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"Action": [
|
|
86
|
+
"s3:GetObject"
|
|
87
|
+
],
|
|
88
|
+
"NotAction": [],
|
|
89
|
+
"Resource": [
|
|
90
|
+
"arn:aws:s3:::lobe/*"
|
|
91
|
+
],
|
|
92
|
+
"NotResource": [],
|
|
93
|
+
"Condition": {}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
点击保存即可。
|
|
100
|
+
|
|
101
|
+
### 设置访问密钥
|
|
102
|
+
|
|
103
|
+
<Callout type={'warning'}>
|
|
104
|
+
有关这部分,你可以直接使用在 `docker-compose.yml` 文件中配置的 `RUSTFS_ACCESS_KEY` 和 `RUSTFS_SECRET_KEY`,但出于安全考虑,我们推荐你手动创建一个访问密钥。
|
|
105
|
+
</Callout>
|
|
106
|
+
|
|
107
|
+
点击左侧边栏的 `访问密钥` 菜单,右上角 `添加访问密钥` 按钮,创建一个新的访问密钥(Access Key)。名称随意,按照默认配置使用主账号策略即可。
|
|
108
|
+
|
|
109
|
+
记录好得到的访问密钥和密钥(你可以点击 `导出` 按钮以在本地保存)。这里 RustFS 的翻译有点迷惑,但你只需要记住上面那个短的是 `Access Key`,长的是 `Secret Key` 即可(导出的 JSON 中是对的)。
|
|
110
|
+
|
|
111
|
+
<Image alt={"Add Key"} src={'https://github.com/user-attachments/assets/81f18b20-3918-4f77-8571-07d0c4a79aec'} />
|
|
112
|
+
|
|
113
|
+
<Image alt={"Export Key"} src={'https://github.com/user-attachments/assets/4dde41ec-985b-4781-8c77-aac65555a32f'} />
|
|
114
|
+
|
|
115
|
+
### 配置反向代理
|
|
116
|
+
|
|
117
|
+
你还需要完成反向代理配置,并确保局域网 / 公网能访问到 RustFS 的服务。请使用反向代理将以下服务端口映射到域名:
|
|
118
|
+
|
|
119
|
+
| 域名 | 反代端口 | 是否必选 |
|
|
120
|
+
| ------------------------- | ------ | ---- |
|
|
121
|
+
| `lobe-s3-api.example.com` | `9000` | 必选 |
|
|
122
|
+
| `lobe-s3-ui.example.com` | `9001` | |
|
|
123
|
+
|
|
124
|
+
完成反向代理后,记得配置对应的 SSL 证书,启用 HTTPS 访问。
|
|
125
|
+
|
|
126
|
+
### 设置环境变量
|
|
127
|
+
|
|
128
|
+
修改 LobeHub 的 `.env` 文件,添加如下环境变量,即可完成配置,使用 RustFS 作为 S3 存储服务:
|
|
129
|
+
|
|
130
|
+
```shell
|
|
131
|
+
# RustFS 的鉴权 Access Key / Secret Key
|
|
132
|
+
S3_ACCESS_KEY_ID=<YOUR_ACCESS_KEY>
|
|
133
|
+
S3_SECRET_ACCESS_KEY=<YOUR_SECRET_KEY>
|
|
134
|
+
# RustFS API 的请求端点
|
|
135
|
+
S3_ENDPOINT=https://lobe-s3-api.example.com
|
|
136
|
+
# 存储桶的名称
|
|
137
|
+
S3_BUCKET=lobe
|
|
138
|
+
# 存储桶对外的访问域名
|
|
139
|
+
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
|
140
|
+
S3_ENABLE_PATH_STYLE=1
|
|
141
|
+
```
|
|
143
142
|
</Steps>
|
|
@@ -42,11 +42,11 @@ Docker 部署版本的升级非常简单,只需要重新部署 LobeHub 的最
|
|
|
42
42
|
<Steps>
|
|
43
43
|
### 停止并删除当前运行的 LobeHub 容器
|
|
44
44
|
|
|
45
|
-
假设 LobeHub 容器的名称是 `
|
|
45
|
+
假设 LobeHub 容器的名称是 `lobehub`,使用以下指令停止并删除当前运行的 LobeHub 容器:
|
|
46
46
|
|
|
47
47
|
```fish
|
|
48
|
-
docker stop
|
|
49
|
-
docker rm
|
|
48
|
+
docker stop lobehub
|
|
49
|
+
docker rm lobehub
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
### 拉取最新的 LobeHub 镜像
|
|
@@ -54,7 +54,7 @@ Docker 部署版本的升级非常简单,只需要重新部署 LobeHub 的最
|
|
|
54
54
|
使用以下命令拉取 LobeHub 的最新 Docker 镜像:
|
|
55
55
|
|
|
56
56
|
```fish
|
|
57
|
-
docker pull lobehub/
|
|
57
|
+
docker pull lobehub/lobehub
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
### 重新启动 Docker 容器
|
|
@@ -65,7 +65,7 @@ Docker 部署版本的升级非常简单,只需要重新部署 LobeHub 的最
|
|
|
65
65
|
docker run -d -p 3210:3210 \
|
|
66
66
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
67
67
|
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
68
|
-
--name
|
|
68
|
+
--name lobehub \
|
|
69
69
|
lobehub/lobe-chat
|
|
70
70
|
```
|
|
71
71
|
</Steps>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Email Service Configuration
|
|
3
|
+
description: Configure LobeHub email service for email verification, password reset, and magic link login.
|
|
4
|
+
tags:
|
|
5
|
+
- Email Service
|
|
6
|
+
- SMTP
|
|
7
|
+
- Resend
|
|
8
|
+
- Email Verification
|
|
9
|
+
- Magic Link
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Email Service Configuration
|
|
13
|
+
|
|
14
|
+
Email service is used for email verification, password reset, and magic link delivery. LobeHub supports two email service providers.
|
|
15
|
+
|
|
16
|
+
## Nodemailer (SMTP)
|
|
17
|
+
|
|
18
|
+
Send emails via SMTP protocol, suitable for users with existing email services. See [Nodemailer SMTP docs](https://nodemailer.com/smtp/).
|
|
19
|
+
|
|
20
|
+
| Environment Variable | Type | Description | Example |
|
|
21
|
+
| ------------------------ | -------- | -------------------------------------------------------------- | --------------------- |
|
|
22
|
+
| `EMAIL_SERVICE_PROVIDER` | Optional | Set to `nodemailer` (default) | `nodemailer` |
|
|
23
|
+
| `SMTP_HOST` | Required | SMTP server hostname | `smtp.gmail.com` |
|
|
24
|
+
| `SMTP_PORT` | Required | SMTP server port (`587` for TLS, `465` for SSL) | `587` |
|
|
25
|
+
| `SMTP_SECURE` | Optional | `true` for SSL (port 465), `false` for TLS (port 587) | `false` |
|
|
26
|
+
| `SMTP_USER` | Required | SMTP auth username | `user@gmail.com` |
|
|
27
|
+
| `SMTP_PASS` | Required | SMTP auth password | `your-app-password` |
|
|
28
|
+
| `SMTP_FROM` | Optional | Sender address (required for AWS SES), defaults to `SMTP_USER` | `noreply@example.com` |
|
|
29
|
+
|
|
30
|
+
<Callout type={'warning'}>
|
|
31
|
+
When using Gmail, you must use an App Password instead of your account password. Generate one at [Google App Passwords](https://myaccount.google.com/apppasswords).
|
|
32
|
+
</Callout>
|
|
33
|
+
|
|
34
|
+
## Resend
|
|
35
|
+
|
|
36
|
+
[Resend](https://resend.com/) is a modern email API service with simple setup, recommended for new users.
|
|
37
|
+
|
|
38
|
+
| Environment Variable | Type | Description | Example |
|
|
39
|
+
| ------------------------ | ----------- | ----------------------------------------- | --------------------------- |
|
|
40
|
+
| `EMAIL_SERVICE_PROVIDER` | Required | Set to `resend` | `resend` |
|
|
41
|
+
| `RESEND_API_KEY` | Required | Resend API Key | `re_xxxxxxxxxxxxxxxxxxxxxx` |
|
|
42
|
+
| `RESEND_FROM` | Recommended | Sender address, must be a verified domain | `noreply@your-domain.com` |
|
|
43
|
+
|
|
44
|
+
<Callout type={'info'}>
|
|
45
|
+
Before using Resend, you need to [verify your sending domain](https://resend.com/docs/dashboard/domains/introduction), otherwise emails can only be sent to your own address.
|
|
46
|
+
</Callout>
|
|
47
|
+
|
|
48
|
+
## Email Verification
|
|
49
|
+
|
|
50
|
+
Enable email verification to ensure users own the email addresses they register with (off by default):
|
|
51
|
+
|
|
52
|
+
| Environment Variable | Type | Description |
|
|
53
|
+
| ------------------------- | -------- | ----------------------------------------------------------- |
|
|
54
|
+
| `AUTH_EMAIL_VERIFICATION` | Optional | Set to `1` to require email verification after registration |
|
|
55
|
+
|
|
56
|
+
<Callout type={'info'}>
|
|
57
|
+
Email verification requires a working email service (SMTP or Resend) configured above. When enabled, users must verify their email address before they can sign in.
|
|
58
|
+
</Callout>
|
|
59
|
+
|
|
60
|
+
## Magic Link (Passwordless) Login
|
|
61
|
+
|
|
62
|
+
Enable magic-link login (depends on a working email provider above, off by default):
|
|
63
|
+
|
|
64
|
+
| Environment Variable | Type | Description |
|
|
65
|
+
| ------------------------ | -------- | ------------------------------------------------------------------- |
|
|
66
|
+
| `AUTH_ENABLE_MAGIC_LINK` | Optional | Set to `1` to enable passwordless magic-link login (off by default) |
|
|
67
|
+
|
|
68
|
+
<Callout type={'tip'}>
|
|
69
|
+
Go to [Environment Variables](/docs/self-hosting/environment-variables/auth#better-auth) for detailed information on all Better Auth variables.
|
|
70
|
+
</Callout>
|