@lobehub/lobehub 2.1.0 → 2.1.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.
Files changed (174) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +1 -1
  3. package/README.zh-CN.md +1 -1
  4. package/apps/desktop/src/main/controllers/McpInstallCtr.ts +10 -10
  5. package/apps/desktop/src/main/controllers/NetworkProxyCtr.ts +6 -6
  6. package/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts +2 -2
  7. package/changelog/v2.json +18 -0
  8. package/docker-compose/deploy/.env.example +35 -0
  9. package/docker-compose/deploy/.env.zh-CN.example +31 -0
  10. package/docker-compose/deploy/bucket.config.json +18 -0
  11. package/docker-compose/deploy/docker-compose.yml +148 -0
  12. package/docker-compose/deploy/searxng-settings.yml +2582 -0
  13. package/docker-compose/setup.sh +37 -88
  14. package/docs/changelog/2025-03-02-new-models.mdx +1 -1
  15. package/docs/changelog/2025-03-02-new-models.zh-CN.mdx +1 -1
  16. package/docs/changelog/2025-04-06-exports.mdx +1 -1
  17. package/docs/changelog/2025-04-06-exports.zh-CN.mdx +1 -1
  18. package/docs/changelog/2025-05-08-desktop-app.mdx +2 -2
  19. package/docs/changelog/2025-05-08-desktop-app.zh-CN.mdx +2 -2
  20. package/docs/changelog/2025-06-08-claude-4.mdx +1 -1
  21. package/docs/changelog/2025-06-08-claude-4.zh-CN.mdx +1 -1
  22. package/docs/changelog/2025-07-08-mcp-market.mdx +1 -1
  23. package/docs/changelog/2025-07-08-mcp-market.zh-CN.mdx +1 -1
  24. package/docs/changelog/2025-08-08-image-generation.mdx +1 -1
  25. package/docs/changelog/2025-08-08-image-generation.zh-CN.mdx +1 -1
  26. package/docs/changelog/2025-09-08-gemini.mdx +1 -1
  27. package/docs/changelog/2025-09-08-gemini.zh-CN.mdx +1 -1
  28. package/docs/changelog/2025-10-08-python.mdx +1 -1
  29. package/docs/changelog/2025-10-08-python.zh-CN.mdx +1 -1
  30. package/docs/changelog/2025-11-08-comfy-ui.mdx +1 -1
  31. package/docs/changelog/2025-11-08-comfy-ui.zh-CN.mdx +1 -1
  32. package/docs/changelog/2025-12-20-mcp.mdx +1 -1
  33. package/docs/changelog/2025-12-20-mcp.zh-CN.mdx +1 -1
  34. package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +1 -1
  35. package/docs/development/basic/add-new-image-model.mdx +3 -3
  36. package/docs/development/basic/add-new-image-model.zh-CN.mdx +3 -3
  37. package/docs/development/basic/chat-api.mdx +10 -10
  38. package/docs/development/basic/chat-api.zh-CN.mdx +10 -10
  39. package/docs/development/basic/feature-development.mdx +4 -4
  40. package/docs/development/basic/feature-development.zh-CN.mdx +4 -4
  41. package/docs/development/basic/setup-development.mdx +4 -4
  42. package/docs/development/basic/setup-development.zh-CN.mdx +4 -4
  43. package/docs/development/internationalization/add-new-locale.mdx +1 -1
  44. package/docs/development/internationalization/add-new-locale.zh-CN.mdx +1 -1
  45. package/docs/development/internationalization/internationalization-implementation.mdx +5 -5
  46. package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +5 -5
  47. package/docs/development/others/lighthouse.mdx +8 -8
  48. package/docs/development/others/lighthouse.zh-CN.mdx +8 -8
  49. package/docs/development/start.mdx +3 -3
  50. package/docs/development/start.zh-CN.mdx +3 -3
  51. package/docs/self-hosting/advanced/feature-flags.mdx +1 -1
  52. package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -1
  53. package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
  54. package/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +2 -2
  55. package/docs/self-hosting/advanced/online-search.mdx +1 -1
  56. package/docs/self-hosting/advanced/online-search.zh-CN.mdx +1 -1
  57. package/docs/self-hosting/advanced/redis/upstash.mdx +3 -3
  58. package/docs/self-hosting/advanced/redis/upstash.zh-CN.mdx +3 -3
  59. package/docs/self-hosting/advanced/redis.mdx +6 -6
  60. package/docs/self-hosting/advanced/redis.zh-CN.mdx +6 -6
  61. package/docs/self-hosting/advanced/s3/rustfs.mdx +116 -116
  62. package/docs/self-hosting/advanced/s3/rustfs.zh-CN.mdx +116 -117
  63. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +5 -5
  64. package/docs/self-hosting/auth/email.mdx +70 -0
  65. package/docs/self-hosting/auth/email.zh-CN.mdx +70 -0
  66. package/docs/self-hosting/{advanced/auth → auth}/legacy.mdx +10 -10
  67. package/docs/self-hosting/{advanced/auth → auth}/legacy.zh-CN.mdx +5 -5
  68. package/docs/self-hosting/{advanced/auth → auth}/next-auth/casdoor.zh-CN.mdx +3 -3
  69. package/docs/self-hosting/{advanced/auth → auth}/next-auth/keycloak.zh-CN.mdx +2 -2
  70. package/docs/self-hosting/{advanced/auth → auth}/next-auth/logto.zh-CN.mdx +2 -2
  71. package/docs/self-hosting/{advanced/auth → auth}/providers/apple.mdx +6 -6
  72. package/docs/self-hosting/{advanced/auth → auth}/providers/apple.zh-CN.mdx +6 -6
  73. package/docs/self-hosting/{advanced/auth → auth}/providers/auth0.mdx +12 -12
  74. package/docs/self-hosting/{advanced/auth → auth}/providers/auth0.zh-CN.mdx +12 -12
  75. package/docs/self-hosting/{advanced/auth → auth}/providers/authelia.mdx +13 -13
  76. package/docs/self-hosting/{advanced/auth → auth}/providers/authelia.zh-CN.mdx +13 -13
  77. package/docs/self-hosting/{advanced/auth → auth}/providers/authentik.mdx +13 -13
  78. package/docs/self-hosting/{advanced/auth → auth}/providers/authentik.zh-CN.mdx +13 -13
  79. package/docs/self-hosting/auth/providers/casdoor.mdx +197 -0
  80. package/docs/self-hosting/auth/providers/casdoor.zh-CN.mdx +248 -0
  81. package/docs/self-hosting/{advanced/auth → auth}/providers/cloudflare-zero-trust.mdx +7 -7
  82. package/docs/self-hosting/{advanced/auth → auth}/providers/cloudflare-zero-trust.zh-CN.mdx +6 -6
  83. package/docs/self-hosting/{advanced/auth → auth}/providers/cognito.mdx +13 -13
  84. package/docs/self-hosting/{advanced/auth → auth}/providers/cognito.zh-CN.mdx +13 -13
  85. package/docs/self-hosting/{advanced/auth → auth}/providers/feishu.mdx +10 -10
  86. package/docs/self-hosting/{advanced/auth → auth}/providers/feishu.zh-CN.mdx +10 -10
  87. package/docs/self-hosting/{advanced/auth → auth}/providers/generic-oidc.mdx +12 -12
  88. package/docs/self-hosting/{advanced/auth → auth}/providers/generic-oidc.zh-CN.mdx +12 -12
  89. package/docs/self-hosting/{advanced/auth → auth}/providers/github.mdx +10 -10
  90. package/docs/self-hosting/{advanced/auth → auth}/providers/github.zh-CN.mdx +10 -10
  91. package/docs/self-hosting/{advanced/auth → auth}/providers/google.mdx +10 -10
  92. package/docs/self-hosting/{advanced/auth → auth}/providers/google.zh-CN.mdx +10 -10
  93. package/docs/self-hosting/{advanced/auth → auth}/providers/keycloak.mdx +11 -11
  94. package/docs/self-hosting/{advanced/auth → auth}/providers/keycloak.zh-CN.mdx +11 -11
  95. package/docs/self-hosting/{advanced/auth → auth}/providers/logto.mdx +8 -8
  96. package/docs/self-hosting/{advanced/auth → auth}/providers/logto.zh-CN.mdx +7 -7
  97. package/docs/self-hosting/{advanced/auth → auth}/providers/microsoft.mdx +11 -11
  98. package/docs/self-hosting/{advanced/auth → auth}/providers/microsoft.zh-CN.mdx +11 -11
  99. package/docs/self-hosting/{advanced/auth → auth}/providers/okta.mdx +13 -13
  100. package/docs/self-hosting/{advanced/auth → auth}/providers/okta.zh-CN.mdx +13 -13
  101. package/docs/self-hosting/{advanced/auth → auth}/providers/wechat.mdx +10 -10
  102. package/docs/self-hosting/{advanced/auth → auth}/providers/wechat.zh-CN.mdx +10 -10
  103. package/docs/self-hosting/{advanced/auth → auth}/providers/zitadel.mdx +13 -13
  104. package/docs/self-hosting/{advanced/auth → auth}/providers/zitadel.zh-CN.mdx +13 -13
  105. package/docs/self-hosting/{advanced/auth.mdx → auth.mdx} +12 -81
  106. package/docs/self-hosting/{advanced/auth.zh-CN.mdx → auth.zh-CN.mdx} +11 -80
  107. package/docs/self-hosting/environment-variables/redis.mdx +1 -1
  108. package/docs/self-hosting/environment-variables/redis.zh-CN.mdx +1 -1
  109. package/docs/self-hosting/environment-variables.mdx +1 -1
  110. package/docs/self-hosting/faq/no-v1-suffix.mdx +3 -3
  111. package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +3 -3
  112. package/docs/self-hosting/{advanced → migration/v2}/auth/clerk-to-betterauth.mdx +7 -7
  113. package/docs/self-hosting/{advanced → migration/v2}/auth/clerk-to-betterauth.zh-CN.mdx +7 -7
  114. package/docs/self-hosting/{advanced → migration/v2}/auth/migration-internals.mdx +2 -2
  115. package/docs/self-hosting/{advanced → migration/v2}/auth/migration-internals.zh-CN.mdx +2 -2
  116. package/docs/self-hosting/{advanced → migration/v2}/auth/nextauth-to-betterauth.mdx +11 -11
  117. package/docs/self-hosting/{advanced → migration/v2}/auth/nextauth-to-betterauth.zh-CN.mdx +11 -11
  118. package/docs/self-hosting/migration/v2/breaking-changes.mdx +1 -1
  119. package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +1 -1
  120. package/docs/self-hosting/platform/docker-compose.mdx +43 -561
  121. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +43 -540
  122. package/docs/self-hosting/platform/docker.mdx +5 -5
  123. package/docs/self-hosting/platform/docker.zh-CN.mdx +10 -10
  124. package/docs/self-hosting/platform/dokploy.mdx +1 -1
  125. package/docs/self-hosting/platform/dokploy.zh-CN.mdx +5 -5
  126. package/docs/self-hosting/platform/sealos.mdx +12 -12
  127. package/docs/self-hosting/platform/sealos.zh-CN.mdx +17 -17
  128. package/docs/self-hosting/platform/vercel.zh-CN.mdx +4 -4
  129. package/docs/self-hosting/start.mdx +3 -3
  130. package/docs/self-hosting/start.zh-CN.mdx +4 -4
  131. package/locales/en-US/auth.json +1 -1
  132. package/locales/en-US/authError.json +1 -0
  133. package/locales/en-US/metadata.json +1 -1
  134. package/locales/zh-CN/authError.json +1 -0
  135. package/package.json +1 -1
  136. package/packages/const/src/url.ts +1 -1
  137. package/src/app/[variants]/(auth)/auth-error/page.tsx +4 -2
  138. package/src/app/[variants]/(auth)/signin/SignInEmailStep.tsx +1 -1
  139. package/src/app/[variants]/(auth)/signin/SignInPasswordStep.tsx +1 -1
  140. package/src/features/Conversation/Messages/AssistantGroup/components/MessageContent.tsx +6 -1
  141. package/src/libs/better-auth/sso/providers/feishu.ts +15 -14
  142. package/src/libs/better-auth/sso/providers/wechat.ts +6 -3
  143. package/src/libs/next/proxy/define-config.ts +1 -0
  144. package/src/locales/default/auth.ts +1 -1
  145. package/src/locales/default/authError.ts +2 -0
  146. package/src/locales/default/metadata.ts +1 -1
  147. package/src/server/ld.ts +1 -1
  148. package/docs/self-hosting/advanced/auth/providers/casdoor.mdx +0 -87
  149. package/docs/self-hosting/advanced/auth/providers/casdoor.zh-CN.mdx +0 -83
  150. /package/docs/self-hosting/{advanced/auth → auth}/clerk.mdx +0 -0
  151. /package/docs/self-hosting/{advanced/auth → auth}/clerk.zh-CN.mdx +0 -0
  152. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/auth0.mdx +0 -0
  153. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/auth0.zh-CN.mdx +0 -0
  154. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authelia.mdx +0 -0
  155. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authelia.zh-CN.mdx +0 -0
  156. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authentik.mdx +0 -0
  157. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authentik.zh-CN.mdx +0 -0
  158. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/casdoor.mdx +0 -0
  159. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/cloudflare-zero-trust.mdx +0 -0
  160. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/cloudflare-zero-trust.zh-CN.mdx +0 -0
  161. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/github.mdx +0 -0
  162. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/github.zh-CN.mdx +0 -0
  163. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/google.mdx +0 -0
  164. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/google.zh-CN.mdx +0 -0
  165. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/keycloak.mdx +0 -0
  166. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/logto.mdx +0 -0
  167. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/microsoft-entra-id.mdx +0 -0
  168. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/microsoft-entra-id.zh-CN.mdx +0 -0
  169. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/okta.mdx +0 -0
  170. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/okta.zh-CN.mdx +0 -0
  171. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/wechat.mdx +0 -0
  172. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/wechat.zh-CN.mdx +0 -0
  173. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/zitadel.mdx +0 -0
  174. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/zitadel.zh-CN.mdx +0 -0
@@ -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
- You also need reverse-proxy rules so that RustFS is accessible from the LAN/public internet. Map the following ports to domains:
23
+ First, pull the RustFS Docker image:
118
24
 
119
- | Domain | Port | Required |
120
- | ---------------------------- | ------ | -------- |
121
- | `lobe-s3-api.example.com` | `9000` | Yes |
122
- | `lobe-s3-ui.example.com` | `9001` | |
25
+ ```shell
26
+ docker pull rustfs/rustfs:latest
27
+ ```
123
28
 
124
- After completing the reverse proxy, remember to configure the corresponding SSL certificate and enable HTTPS access.
29
+ You can inspect its version with the following command. We recommend version v1.0.0 or above:
125
30
 
126
- ### Set Environment Variables
31
+ ```shell
32
+ docker inspect --format='{{index .Config.Labels "version"}}' rustfs/rustfs:latest
33
+ ```
127
34
 
128
- Update the LobeChat `.env` file with the following environment variables to use RustFS as the S3 backend:
35
+ We recommend using Docker Compose to deploy RustFS:
129
36
 
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
- ```
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
- 你还需要完成反向代理配置,并确保局域网 / 公网能访问到 RustFS 的服务。请使用反向代理将以下服务端口映射到域名:
23
+ 首先,拉取 RustFS Docker 镜像:
119
24
 
120
- | 域名 | 反代端口 | 是否必选 |
121
- | ---------------------- | ------ | ---- |
122
- | `lobe-s3-api.example.com` | `9000` | 必选 |
123
- | `lobe-s3-ui.example.com` | `9001` | |
25
+ ```shell
26
+ docker pull rustfs/rustfs:latest
27
+ ```
124
28
 
125
- 完成反向代理后,记得配置对应的 SSL 证书,启用 HTTPS 访问。
29
+ 你可以使用如下命令来查看其版本,建议使用 v1.0.0 及以上版本:
126
30
 
127
- ### 设置环境变量
31
+ ```shell
32
+ docker inspect --format='{{index .Config.Labels "version"}}' rustfs/rustfs:latest
33
+ ```
128
34
 
129
- 修改 LobeChat `.env` 文件,添加如下环境变量,即可完成配置,使用 RustFS 作为 S3 存储服务:
35
+ 我们推荐使用 Docker Compose 来部署 RustFS
130
36
 
131
- ```shell
132
- # RustFS 的鉴权 Access Key / Secret Key
133
- S3_ACCESS_KEY_ID=<YOUR_ACCESS_KEY>
134
- S3_SECRET_ACCESS_KEY=<YOUR_SECRET_KEY>
135
- # RustFS API 的请求端点
136
- S3_ENDPOINT=https://lobe-s3-api.example.com
137
- # 存储桶的名称
138
- S3_BUCKET=lobe
139
- # 存储桶对外的访问域名
140
- S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
141
- S3_ENABLE_PATH_STYLE=1
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 容器的名称是 `lobe-chat`,使用以下指令停止并删除当前运行的 LobeHub 容器:
45
+ 假设 LobeHub 容器的名称是 `lobehub`,使用以下指令停止并删除当前运行的 LobeHub 容器:
46
46
 
47
47
  ```fish
48
- docker stop lobe-chat
49
- docker rm lobe-chat
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/lobe-chat
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 lobe-chat \
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>
@@ -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>