@lobehub/chat 1.48.2 → 1.48.4
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/changelog/v1.json +18 -0
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +197 -194
- package/locales/ar/chat.json +0 -4
- package/locales/ar/components.json +5 -0
- package/locales/bg-BG/chat.json +0 -4
- package/locales/bg-BG/components.json +5 -0
- package/locales/de-DE/chat.json +0 -4
- package/locales/de-DE/components.json +5 -0
- package/locales/en-US/chat.json +0 -4
- package/locales/en-US/components.json +5 -0
- package/locales/es-ES/chat.json +0 -4
- package/locales/es-ES/components.json +5 -0
- package/locales/fa-IR/chat.json +0 -4
- package/locales/fa-IR/components.json +5 -0
- package/locales/fr-FR/chat.json +0 -4
- package/locales/fr-FR/components.json +5 -0
- package/locales/it-IT/chat.json +0 -4
- package/locales/it-IT/components.json +5 -0
- package/locales/ja-JP/chat.json +0 -4
- package/locales/ja-JP/components.json +5 -0
- package/locales/ko-KR/chat.json +0 -4
- package/locales/ko-KR/components.json +5 -0
- package/locales/nl-NL/chat.json +0 -4
- package/locales/nl-NL/components.json +5 -0
- package/locales/pl-PL/chat.json +0 -4
- package/locales/pl-PL/components.json +5 -0
- package/locales/pt-BR/chat.json +0 -4
- package/locales/pt-BR/components.json +5 -0
- package/locales/ru-RU/chat.json +0 -4
- package/locales/ru-RU/components.json +5 -0
- package/locales/tr-TR/chat.json +0 -4
- package/locales/tr-TR/components.json +5 -0
- package/locales/vi-VN/chat.json +0 -4
- package/locales/vi-VN/components.json +5 -0
- package/locales/zh-CN/chat.json +0 -4
- package/locales/zh-CN/components.json +5 -0
- package/locales/zh-TW/chat.json +0 -4
- package/locales/zh-TW/components.json +5 -0
- package/package.json +1 -1
- package/src/app/(main)/settings/provider/features/ModelList/ModelItem.tsx +31 -36
- package/src/components/Thinking/index.tsx +137 -0
- package/src/const/currency.ts +2 -0
- package/src/const/discover.ts +0 -2
- package/src/features/Conversation/Messages/Assistant/Reasoning/index.tsx +6 -110
- package/src/locales/default/chat.ts +0 -4
- package/src/locales/default/components.ts +5 -0
- package/src/utils/format.test.ts +2 -9
- package/src/utils/format.ts +2 -2
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.48.4](https://github.com/lobehub/lobe-chat/compare/v1.48.3...v1.48.4)
|
6
|
+
|
7
|
+
<sup>Released on **2025-01-27**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Improve thinking style.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Improve thinking style, closes [#5602](https://github.com/lobehub/lobe-chat/issues/5602) ([d4dc3f2](https://github.com/lobehub/lobe-chat/commit/d4dc3f2))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.48.3](https://github.com/lobehub/lobe-chat/compare/v1.48.2...v1.48.3)
|
31
|
+
|
32
|
+
<sup>Released on **2025-01-26**</sup>
|
33
|
+
|
34
|
+
#### 💄 Styles
|
35
|
+
|
36
|
+
- **misc**: Improve model pricing with CNY.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### Styles
|
44
|
+
|
45
|
+
- **misc**: Improve model pricing with CNY, closes [#5599](https://github.com/lobehub/lobe-chat/issues/5599) ([6d91457](https://github.com/lobehub/lobe-chat/commit/6d91457))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.48.2](https://github.com/lobehub/lobe-chat/compare/v1.48.1...v1.48.2)
|
6
56
|
|
7
57
|
<sup>Released on **2025-01-25**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Improve thinking style."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-01-27",
|
9
|
+
"version": "1.48.4"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"improvements": [
|
14
|
+
"Improve model pricing with CNY."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-01-26",
|
18
|
+
"version": "1.48.3"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"improvements": [
|
@@ -189,48 +189,83 @@ docker compose up -d
|
|
189
189
|
|
190
190
|
## 发布到生产(域名模式)
|
191
191
|
|
192
|
+
### 基于 `Casdoor` 鉴权方法的生产部署
|
193
|
+
|
192
194
|
<Callout type="info">
|
193
|
-
|
194
|
-
|
195
|
+
由于使用[Logto](https://logto.io/)
|
196
|
+
作为登录鉴权服务存在比较大的不稳定性。
|
197
|
+
因此,下文基于发布到IP模式的教程,实现了使用 Casdoor 作为鉴权服务提供商的域名发布方案。
|
198
|
+
本文剩余部分也将以其为例进行说明。如果你使用其他诸如 Logto
|
195
199
|
等其他登录鉴权服务,流程应当相近,但请注意不同的登录鉴权服务的端口配置可能有所差异。
|
196
200
|
</Callout>
|
197
201
|
|
198
|
-
在下文中,我们假设在上述服务之外,你还运行了一层 Nginx 来进行反向代理、配置 SSL。
|
202
|
+
在下文中,我们假设在上述服务之外,你还运行了一层 **Nginx** 来进行反向代理、配置 SSL。
|
199
203
|
|
200
204
|
域名和配套服务端口说明如下:
|
201
205
|
|
202
206
|
- `lobe.example.com`:为你的 LobeChat 服务端域名,需要反向代理到 LobeChat 服务端口,默认为 `3210`
|
203
|
-
- `
|
204
|
-
- `
|
205
|
-
- `
|
206
|
-
- `lobe-s3-ui.example.com`:可选,为你的 MinIO UI 域名,需要反向代理到 MinIO WebUI 服务端口,默认为 `9001`
|
207
|
-
|
208
|
-
以及不进行反向代理的服务端口:
|
209
|
-
|
210
|
-
- `postgresql`:你的 PostgreSQL 数据库服务端口,默认为 `5432`
|
211
|
-
|
212
|
-
<Callout type="warning">
|
213
|
-
请务必注意,CORS 跨域是在 MinIO / Logto 服务端内部配置的,请勿在你的反向代理中额外配置 CORS,这会导致错误。
|
207
|
+
- `auth-ui.example.com`:为你的 Logto UI 域名,需要反向代理到 Logto WebUI 服务端口,默认为 `8000`
|
208
|
+
- `s3-api.example.com`:为你的 MinIO API 域名,需要反向代理到 MinIO API 服务端口,默认为 `9000`
|
209
|
+
- `s3-ui.example.com`:可选,为你的 MinIO UI 域名,需要反向代理到 MinIO WebUI 服务端口,默认为 `9001`
|
214
210
|
|
215
|
-
|
216
|
-
|
217
|
-
|
211
|
+
#### 配置文件
|
212
|
+
```sh
|
213
|
+
bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -l zh_CN
|
214
|
+
docker compose up -d
|
215
|
+
```
|
216
|
+
注意保存此时生成的新密码!
|
217
|
+
|
218
|
+
运行后会获得三个文件
|
219
|
+
- init_data.json
|
220
|
+
- docker-compose.yml
|
221
|
+
- .env
|
222
|
+
|
223
|
+
接下来,修改配置文件以实现域名发布
|
224
|
+
1. 修改 `docker-compose.yml` 文件
|
225
|
+
1. 修改 `minio`的`MINIO_API_CORS_ALLOW_ORIGIN`字段。
|
226
|
+
```yaml
|
227
|
+
'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com'
|
228
|
+
```
|
229
|
+
2. 修改`casdoor`的`origin`字段。
|
230
|
+
```yaml
|
231
|
+
origin: 'https://auth-ui.example.com'
|
232
|
+
```
|
233
|
+
3. 修改`lobe`的`environment`字段。
|
234
|
+
```yaml
|
235
|
+
# - 'APP_URL=http://localhost:3210'
|
236
|
+
- 'APP_URL=https://lobe.example.com'
|
237
|
+
|
238
|
+
- 'NEXT_AUTH_SSO_PROVIDERS=casdoor'
|
239
|
+
- 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
|
240
|
+
- 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
|
241
|
+
# - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth'
|
242
|
+
- 'AUTH_URL=https://lobe.example.com/api/auth'
|
243
|
+
|
244
|
+
# - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}'
|
245
|
+
- 'AUTH_CASDOOR_ISSUER=https://auth-ui.example.com'
|
246
|
+
|
247
|
+
- 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}'
|
248
|
+
# - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}'
|
249
|
+
- 'S3_ENDPOINT=https://s3-api.example.com'
|
250
|
+
|
251
|
+
- 'S3_BUCKET=${MINIO_LOBE_BUCKET}'
|
252
|
+
# - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}'
|
253
|
+
- 'S3_PUBLIC_DOMAIN=https://s3-api.example.com'
|
254
|
+
|
255
|
+
- 'S3_ENABLE_PATH_STYLE=1'
|
256
|
+
- 'LLM_VISION_IMAGE_USE_BASE64=1'
|
257
|
+
```
|
258
|
+
2. 修改 `.env` 文件
|
259
|
+
<Callout type="info">
|
260
|
+
为了安全起见,修改 `.env` 文件中的ROOT USER的字段
|
218
261
|
</Callout>
|
219
|
-
|
220
|
-
### 配置文件
|
221
|
-
|
222
262
|
```sh
|
223
|
-
|
224
|
-
|
263
|
+
# MinIO S3 configuration
|
264
|
+
MINIO_ROOT_USER=XXXX
|
265
|
+
MINIO_ROOT_PASSWORD=XXXX
|
225
266
|
```
|
226
267
|
|
227
|
-
|
228
|
-
|
229
|
-
一般情况下,你只应修改其中的域名和账号密码等敏感信息,其他配置项请按照默认值进行配置。
|
230
|
-
|
231
|
-
它们的示例配置请参见本文附录。
|
232
|
-
|
233
|
-
### Postgres 数据库配置
|
268
|
+
#### Postgres 数据库配置
|
234
269
|
|
235
270
|
你可以使用下述指令检查日志:
|
236
271
|
|
@@ -253,52 +288,36 @@ sudo rm -rf ./data # 移除挂载的数据库数据
|
|
253
288
|
docker compose up -d # 重新启动
|
254
289
|
```
|
255
290
|
|
256
|
-
### 登录鉴权服务配置
|
257
291
|
|
258
|
-
|
259
|
-
|
260
|
-
<Callout type="warning">
|
261
|
-
请记得注意配置对应登录鉴权服务提供商的 CORS 跨域配置,以确保 LobeChat 能够正常访问登录鉴权服务。
|
262
|
-
|
263
|
-
在本文中,你需要允许 `https://lobe.example.com` 的跨域请求。
|
264
|
-
</Callout>
|
292
|
+
#### 登录鉴权服务配置
|
265
293
|
|
266
294
|
你需要首先访问 WebUI 来进行配置:
|
267
295
|
|
268
|
-
- 如果你按照前文配置了反向代理,打开 `https://
|
269
|
-
- 否则,请在进行端口映射后,打开 `http://localhost:
|
270
|
-
|
271
|
-
1. 注册一个新账户,首个注册的账户将自动成为管理员
|
272
|
-
|
273
|
-
2. 在 `Applications` 里创建一个 `Next.js (App Router)` 应用,名称随意
|
274
|
-
|
275
|
-
3. 配置 `Redirect URI` 为 `https://lobe.example.com/api/auth/callback/logto`,`Post sign-out redirect URI` 为 `https://lobe.example.com/`
|
276
|
-
|
277
|
-
4. 配置 `CORS allowed origins` 为 `https://lobe.example.com`
|
278
|
-
|
279
|
-
<Image alt="配置 Logto" src="https://github.com/user-attachments/assets/5b816379-c07b-40ea-bde4-df16e2e4e523" />
|
280
|
-
|
281
|
-
5. 获取 `App ID` 和 `App secrets`,填入你的 `.env` 文件中的 `AUTH_LOGTO_ID` 和 `AUTH_LOGTO_SECRET` 中
|
282
|
-
|
283
|
-
6. 配置你的 `.env` 文件中 `AUTH_LOGTO_ISSUER` 为 `https://lobe-auth-api.example.com/oidc`
|
296
|
+
- 如果你按照前文配置了反向代理,打开 `https://auth-ui.example.com`
|
297
|
+
- 否则,请在进行端口映射后,打开 `http://localhost:8000`
|
284
298
|
|
285
|
-
|
299
|
+
登录管理员账户
|
286
300
|
|
287
|
-
|
301
|
+
- 默认用户名为 admin
|
302
|
+
- 默认密码为 下载配置文件时生成的随机密码。如忘记可到 `init_data.json` 文件中找回
|
288
303
|
|
289
|
-
|
304
|
+
登入后执行如下操作
|
305
|
+
1. 在 `用户管理 -> 组织` 中,添加一个新的组织。名称与显示名称为 `Lobe Users`。其余保持默认即可。
|
306
|
+
2. 在 `身份认证 -> 应用` 中,添加一个新的应用。
|
307
|
+
- 名称与显示名称为 `LobeChat`。
|
308
|
+
- 组织为 `Lobe Users`。
|
309
|
+
- 重定向 URLS中添加一行 为 `https://lobe.example.com/api/auth/callback/casdoor`。
|
310
|
+
- 关闭除密码外的登录方式 。
|
311
|
+
- 将客户端ID和客户端密钥分别填入 `.env`中的 `AUTH_CASDOOR_ID` 和 `AUTH_CASDOOR_SECRET` 中。
|
312
|
+
- (可选) 仿照`built-in`应用的配置,来设计登录和注册的页面外观。
|
313
|
+
- 保存并退出。
|
290
314
|
|
291
|
-
|
292
|
-
|
293
|
-
```sh
|
294
|
-
docker compose up -d
|
295
|
-
```
|
296
|
-
|
297
|
-
<Callout type="warning">
|
298
|
-
请注意,管理员账户不等同于注册用户,不要用你的管理员账户登录 LobeChat,那样只会报错。
|
315
|
+
<Callout type="info">
|
316
|
+
通过上述步骤,可以避免默认情况下所有用户均为管理员导致的不安全的情况。
|
299
317
|
</Callout>
|
300
318
|
|
301
|
-
|
319
|
+
#### S3 对象存储服务配置
|
320
|
+
|
302
321
|
|
303
322
|
本文以 MinIO 为例,解释配置过程,如果你使用的是其他 S3 服务商,请参照其文档进行配置。
|
304
323
|
|
@@ -312,26 +331,16 @@ docker compose up -d # 重新启动
|
|
312
331
|
|
313
332
|
你需要首先访问 WebUI 来进行配置:
|
314
333
|
|
315
|
-
- 如果你按照前文配置了反向代理,打开 `https://
|
334
|
+
- 如果你按照前文配置了反向代理,打开 `https://s3-ui.example.com`
|
316
335
|
- 否则,请在进行端口映射后,打开 `http://localhost:9001`
|
317
336
|
|
318
337
|
1. 在登录界面输入你设置的 `MINIO_ROOT_USER` 和 `MINIO_ROOT_PASSWORD`,然后点击登录
|
319
338
|
|
320
|
-
2. 在左侧面板
|
321
|
-
|
322
|
-
<Image alt="创建 MinIO 桶" src="https://github.com/user-attachments/assets/79f44a13-00d3-4302-a6bc-5f4c6cdbffab" />
|
323
|
-
|
324
|
-
3. 选中你的桶,点击 Summary - Access Policy,编辑,选择 `Custom`,输入 `minio-bucket-config.json` 中的内容(见附录)并保存(同样默认你的桶名为 `lobe`):
|
325
|
-
|
326
|
-
<Image alt="选中 MinIO 桶策略" src="https://github.com/user-attachments/assets/57032a82-7604-45d3-ba12-884af6fbcb7c" />
|
327
|
-
|
328
|
-
<Image alt="配置 MinIO 桶策略" src="https://github.com/user-attachments/assets/d8109f4e-71fc-4ba8-8402-ede92669d5e0" />
|
329
|
-
|
330
|
-
4. 在左侧面板 User / Access Keys 处,点击 `Create New Access Key`,无需额外修改,将生成的 `Access Key` 和 `Secret Key` 填入你的 `.env` 文件中的 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 中
|
339
|
+
2. 在左侧面板 User / Access Keys 处,点击 `Create New Access Key`,无需额外修改,将生成的 `Access Key` 和 `Secret Key` 填入你的 `.env` 文件中的 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 中
|
331
340
|
|
332
341
|
<Image alt="创建 MinIO 访问密钥" src="https://github.com/user-attachments/assets/72f02ce5-9991-425b-9864-9113ee1ed6bf" />
|
333
342
|
|
334
|
-
|
343
|
+
3. 重启 LobeChat 服务:
|
335
344
|
|
336
345
|
```sh
|
337
346
|
docker compose up -d
|
@@ -339,68 +348,51 @@ docker compose up -d # 重新启动
|
|
339
348
|
|
340
349
|
至此,你已经成功部署了 LobeChat 数据库版本,你可以通过 `https://lobe.example.com` 访问你的 LobeChat 服务。
|
341
350
|
|
351
|
+
|
352
|
+
|
342
353
|
## 附录
|
343
354
|
|
344
|
-
|
355
|
+
为方便一键复制,在此汇总基于casdoor鉴权方案的域名方式下生产部署配置服务端数据库所需要的示例配置文件。
|
345
356
|
|
346
|
-
### `.env`
|
357
|
+
### `.env`
|
347
358
|
|
348
359
|
```sh
|
349
|
-
#
|
350
|
-
# 请保证此域名在你的 NextAuth 鉴权服务提供商、S3 服务商的 CORS 白名单中
|
351
|
-
APP_URL=https://lobe.example.com/
|
352
|
-
|
353
|
-
# Postgres 相关,也即 DB 必需的环境变量
|
354
|
-
# 必填,用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成
|
355
|
-
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
|
356
|
-
# 必填,Postgres 数据库连接字符串,用于连接到数据库
|
357
|
-
# 格式:postgresql://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器且位于同一 docker-compose 文件中,亦可使用容器名作为 host
|
358
|
-
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
|
359
|
-
|
360
|
-
# NEXT_AUTH 相关,也即鉴权服务必需的环境变量
|
361
|
-
# 可以使用 auth0、Azure AD、GitHub、Authentik、Zitadel、Logto 等,如有其他接入诉求欢迎提 PR
|
362
|
-
# 目前支持的鉴权服务提供商请参考:https://lobehub.com/zh/docs/self-hosting/advanced/auth#next-auth
|
363
|
-
# 如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源
|
364
|
-
# 必填,用于 NextAuth 的密钥,可以使用 openssl rand -base64 32 生成
|
365
|
-
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
366
|
-
# 必填,指定鉴权服务提供商,这里以 Logto 为例
|
367
|
-
NEXT_AUTH_SSO_PROVIDERS=logto
|
368
|
-
# 必填,NextAuth 的 URL,用于 NextAuth 的回调
|
369
|
-
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
370
|
-
|
371
|
-
# NextAuth 鉴权服务提供商部分,以 Logto 为例
|
372
|
-
# 其他鉴权服务提供商所需的环境变量,请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/auth
|
373
|
-
AUTH_LOGTO_ID=YOUR_LOGTO_ID
|
374
|
-
AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET
|
375
|
-
AUTH_LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
376
|
-
|
377
|
-
# 代理相关,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
|
360
|
+
# Proxy, if you need it
|
378
361
|
# HTTP_PROXY=http://localhost:7890
|
379
362
|
# HTTPS_PROXY=http://localhost:7890
|
380
363
|
|
381
|
-
|
382
|
-
#
|
383
|
-
# 必填,S3 的 Access Key ID,对于 MinIO 来说,直到在 MinIO UI 中手动创建之前都是无效的
|
384
|
-
S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID
|
385
|
-
# 必填,S3 的 Secret Access Key,对于 MinIO 来说,直到在 MinIO UI 中手动创建之前都是无效的
|
386
|
-
S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY
|
387
|
-
# 必填,S3 的 Endpoint,用于服务端/客户端连接到 S3 API
|
388
|
-
S3_ENDPOINT=https://lobe-s3-api.example.com
|
389
|
-
# 必填,S3 的 Bucket,直到在 MinIO UI 中手动创建之前都是无效的
|
390
|
-
S3_BUCKET=lobe
|
391
|
-
# 必填,S3 的 Public Domain,用于客户端通过公开连接访问非结构化数据
|
392
|
-
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
393
|
-
# 选填,S3 的 Enable Path Style
|
394
|
-
# 对于主流 S3 Cloud 服务商,一般填 0 即可;对于自部署的 MinIO,请填 1
|
395
|
-
# 请参考:https://lobehub.com/zh/docs/self-hosting/advanced/s3#s-3-enable-path-style
|
396
|
-
S3_ENABLE_PATH_STYLE=1
|
397
|
-
|
398
|
-
# 其他基础环境变量,视需求而定。注意不要有 ACCESS_CODE
|
399
|
-
# 请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/basic
|
400
|
-
# 请注意,对于服务端版本,其 API 必须支持嵌入(OpenAI text-embedding-3-small)模型,否则无法对上传文件进行处理,但你无需在 OPENAI_MODEL_LIST 中指定此模型
|
364
|
+
|
365
|
+
# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
|
401
366
|
# OPENAI_API_KEY=sk-xxxx
|
402
367
|
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
403
368
|
# OPENAI_MODEL_LIST=...
|
369
|
+
|
370
|
+
|
371
|
+
# ===========================
|
372
|
+
# ====== Preset config ======
|
373
|
+
# ===========================
|
374
|
+
# if no special requirements, no need to change
|
375
|
+
LOBE_PORT=3210
|
376
|
+
CASDOOR_PORT=8000
|
377
|
+
MINIO_PORT=9000
|
378
|
+
|
379
|
+
# Postgres related, which are the necessary environment variables for DB
|
380
|
+
LOBE_DB_NAME=lobechat
|
381
|
+
POSTGRES_PASSWORD=uWNZugjBqixf8dxC
|
382
|
+
|
383
|
+
# Casdoor secret
|
384
|
+
AUTH_CASDOOR_ID=943e627d79d5dd8a22a1
|
385
|
+
AUTH_CASDOOR_SECRET=6ec24ac304e92e160ef0d0656ecd86de8cb563f1
|
386
|
+
|
387
|
+
# MinIO S3 configuration
|
388
|
+
MINIO_ROOT_USER=Joe
|
389
|
+
MINIO_ROOT_PASSWORD=Crj1570768
|
390
|
+
|
391
|
+
# Configure the bucket information of MinIO
|
392
|
+
MINIO_LOBE_BUCKET=lobe
|
393
|
+
S3_ACCESS_KEY_ID=dB6Uq9CYZPdWSZouPyEd
|
394
|
+
S3_SECRET_ACCESS_KEY=aPBW8CVULkh8bw1GatlT0GjLihcXHLNwRml4pieS
|
395
|
+
|
404
396
|
```
|
405
397
|
|
406
398
|
### `docker-compose.yml`
|
@@ -408,6 +400,18 @@ S3_ENABLE_PATH_STYLE=1
|
|
408
400
|
```yaml
|
409
401
|
name: lobe-chat-database
|
410
402
|
services:
|
403
|
+
network-service:
|
404
|
+
image: alpine
|
405
|
+
container_name: lobe-network
|
406
|
+
ports:
|
407
|
+
- '${MINIO_PORT}:${MINIO_PORT}' # MinIO API
|
408
|
+
- '9001:9001' # MinIO Console
|
409
|
+
- '${CASDOOR_PORT}:${CASDOOR_PORT}' # Casdoor
|
410
|
+
- '${LOBE_PORT}:3210' # LobeChat
|
411
|
+
command: tail -f /dev/null
|
412
|
+
networks:
|
413
|
+
- lobe-network
|
414
|
+
|
411
415
|
postgresql:
|
412
416
|
image: pgvector/pgvector:pg16
|
413
417
|
container_name: lobe-postgres
|
@@ -416,57 +420,88 @@ services:
|
|
416
420
|
volumes:
|
417
421
|
- './data:/var/lib/postgresql/data'
|
418
422
|
environment:
|
419
|
-
- 'POSTGRES_DB
|
420
|
-
- 'POSTGRES_PASSWORD
|
423
|
+
- 'POSTGRES_DB=${LOBE_DB_NAME}'
|
424
|
+
- 'POSTGRES_PASSWORD=${POSTGRES_PASSWORD}'
|
421
425
|
healthcheck:
|
422
426
|
test: ['CMD-SHELL', 'pg_isready -U postgres']
|
423
427
|
interval: 5s
|
424
428
|
timeout: 5s
|
425
429
|
retries: 5
|
426
430
|
restart: always
|
431
|
+
networks:
|
432
|
+
- lobe-network
|
427
433
|
|
428
434
|
minio:
|
429
435
|
image: minio/minio
|
430
436
|
container_name: lobe-minio
|
431
|
-
|
432
|
-
- '9000:9000'
|
433
|
-
- '9001:9001'
|
437
|
+
network_mode: 'service:network-service'
|
434
438
|
volumes:
|
435
439
|
- './s3_data:/etc/minio/data'
|
436
440
|
environment:
|
437
|
-
- 'MINIO_ROOT_USER
|
438
|
-
- 'MINIO_ROOT_PASSWORD
|
439
|
-
- '
|
440
|
-
- 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com'
|
441
|
+
- 'MINIO_ROOT_USER=${MINIO_ROOT_USER}'
|
442
|
+
- 'MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}'
|
443
|
+
# - 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:${LOBE_PORT}'
|
444
|
+
- 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com'
|
441
445
|
restart: always
|
442
446
|
command: >
|
443
|
-
server /etc/minio/data --address "
|
447
|
+
server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
|
444
448
|
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
449
|
+
|
450
|
+
casdoor:
|
451
|
+
image: casbin/casdoor
|
452
|
+
container_name: lobe-casdoor
|
453
|
+
entrypoint: /bin/sh -c './server --createDatabase=true'
|
454
|
+
network_mode: 'service:network-service'
|
451
455
|
depends_on:
|
452
456
|
postgresql:
|
453
457
|
condition: service_healthy
|
454
458
|
environment:
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
459
|
+
RUNNING_IN_DOCKER: 'true'
|
460
|
+
driverName: 'postgres'
|
461
|
+
dataSourceName: 'user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor'
|
462
|
+
# origin: 'http://localhost:${CASDOOR_PORT}'
|
463
|
+
origin: 'https://auth-ui.example.com'
|
464
|
+
runmode: 'dev'
|
465
|
+
volumes:
|
466
|
+
- ./init_data.json:/init_data.json
|
460
467
|
|
461
468
|
lobe:
|
462
469
|
image: lobehub/lobe-chat-database
|
463
|
-
container_name: lobe-chat
|
464
|
-
|
465
|
-
- '3210:3210'
|
470
|
+
container_name: lobe-chat-database
|
471
|
+
network_mode: 'service:network-service'
|
466
472
|
depends_on:
|
467
|
-
|
468
|
-
|
469
|
-
-
|
473
|
+
postgresql:
|
474
|
+
condition: service_healthy
|
475
|
+
network-service:
|
476
|
+
condition: service_started
|
477
|
+
minio:
|
478
|
+
condition: service_started
|
479
|
+
casdoor:
|
480
|
+
condition: service_started
|
481
|
+
|
482
|
+
environment:
|
483
|
+
# - 'APP_URL=http://localhost:3210'
|
484
|
+
- 'APP_URL=https://lobe.example.com'
|
485
|
+
|
486
|
+
- 'NEXT_AUTH_SSO_PROVIDERS=casdoor'
|
487
|
+
- 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
|
488
|
+
- 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
|
489
|
+
# - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth'
|
490
|
+
- 'AUTH_URL=https://lobe.example.com/api/auth'
|
491
|
+
|
492
|
+
# - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}'
|
493
|
+
- 'AUTH_CASDOOR_ISSUER=https://auth-ui.example.com'
|
494
|
+
|
495
|
+
- 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}'
|
496
|
+
# - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}'
|
497
|
+
- 'S3_ENDPOINT=https://s3-api.example.com'
|
498
|
+
|
499
|
+
- 'S3_BUCKET=${MINIO_LOBE_BUCKET}'
|
500
|
+
# - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}'
|
501
|
+
- 'S3_PUBLIC_DOMAIN=https://s3-api.example.com'
|
502
|
+
|
503
|
+
- 'S3_ENABLE_PATH_STYLE=1'
|
504
|
+
- 'LLM_VISION_IMAGE_USE_BASE64=1'
|
470
505
|
env_file:
|
471
506
|
- .env
|
472
507
|
restart: always
|
@@ -476,47 +511,15 @@ volumes:
|
|
476
511
|
driver: local
|
477
512
|
s3_data:
|
478
513
|
driver: local
|
479
|
-
```
|
480
514
|
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
{
|
487
|
-
"Effect": "Allow",
|
488
|
-
"Principal": {
|
489
|
-
"AWS": ["*"]
|
490
|
-
},
|
491
|
-
"Action": ["s3:GetBucketLocation"],
|
492
|
-
"Resource": ["arn:aws:s3:::lobe"]
|
493
|
-
},
|
494
|
-
{
|
495
|
-
"Effect": "Allow",
|
496
|
-
"Principal": {
|
497
|
-
"AWS": ["*"]
|
498
|
-
},
|
499
|
-
"Action": ["s3:ListBucket"],
|
500
|
-
"Resource": ["arn:aws:s3:::lobe"],
|
501
|
-
"Condition": {
|
502
|
-
"StringEquals": {
|
503
|
-
"s3:prefix": ["files/*"]
|
504
|
-
}
|
505
|
-
}
|
506
|
-
},
|
507
|
-
{
|
508
|
-
"Effect": "Allow",
|
509
|
-
"Principal": {
|
510
|
-
"AWS": ["*"]
|
511
|
-
},
|
512
|
-
"Action": ["s3:PutObject", "s3:DeleteObject", "s3:GetObject"],
|
513
|
-
"Resource": ["arn:aws:s3:::lobe/files/**"]
|
514
|
-
}
|
515
|
-
],
|
516
|
-
"Version": "2012-10-17"
|
517
|
-
}
|
515
|
+
networks:
|
516
|
+
lobe-network:
|
517
|
+
driver: bridge
|
518
|
+
|
519
|
+
|
518
520
|
```
|
519
521
|
|
522
|
+
|
520
523
|
[docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
|
521
524
|
[docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobe-chat-database?color=45cc11&labelColor=black&style=flat-square
|
522
525
|
[docker-release-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
|
package/locales/ar/chat.json
CHANGED
@@ -85,5 +85,10 @@
|
|
85
85
|
"ModelSwitchPanel": {
|
86
86
|
"emptyModel": "لا توجد نماذج ممكن تمكينها، يرجى الانتقال إلى الإعدادات لتمكينها",
|
87
87
|
"provider": "مزود"
|
88
|
+
},
|
89
|
+
"Thinking": {
|
90
|
+
"thinking": "في حالة تفكير عميق...",
|
91
|
+
"thought": "تم التفكير بعمق",
|
92
|
+
"thoughtWithDuration": "تم التفكير بعمق (استغرق {{duration}} ثانية)"
|
88
93
|
}
|
89
94
|
}
|
package/locales/bg-BG/chat.json
CHANGED
@@ -82,10 +82,6 @@
|
|
82
82
|
}
|
83
83
|
}
|
84
84
|
},
|
85
|
-
"reasoning": {
|
86
|
-
"thinking": "В дълбочинно размисъл",
|
87
|
-
"thought": "Дълбоко помислих (отне ми {{duration}} секунди)"
|
88
|
-
},
|
89
85
|
"regenerate": "Прегенерирай",
|
90
86
|
"roleAndArchive": "Роля и архив",
|
91
87
|
"searchAgentPlaceholder": "Търсач на помощ...",
|
@@ -85,5 +85,10 @@
|
|
85
85
|
"ModelSwitchPanel": {
|
86
86
|
"emptyModel": "Няма активирани модели, моля, посетете настройките и ги активирайте",
|
87
87
|
"provider": "Доставчик"
|
88
|
+
},
|
89
|
+
"Thinking": {
|
90
|
+
"thinking": "В процес на дълбочинно размисъл...",
|
91
|
+
"thought": "Дълбочинно размислено",
|
92
|
+
"thoughtWithDuration": "Дълбочинно размислено (време: {{duration}} секунди)"
|
88
93
|
}
|
89
94
|
}
|
package/locales/de-DE/chat.json
CHANGED
@@ -82,10 +82,6 @@
|
|
82
82
|
}
|
83
83
|
}
|
84
84
|
},
|
85
|
-
"reasoning": {
|
86
|
-
"thinking": "Tiefes Nachdenken",
|
87
|
-
"thought": "Tiefgründig nachgedacht (Dauer: {{duration}} Sekunden)"
|
88
|
-
},
|
89
85
|
"regenerate": "Neu generieren",
|
90
86
|
"roleAndArchive": "Rolle und Archiv",
|
91
87
|
"searchAgentPlaceholder": "Suchassistent...",
|
@@ -85,5 +85,10 @@
|
|
85
85
|
"ModelSwitchPanel": {
|
86
86
|
"emptyModel": "Kein aktiviertes Modell. Bitte gehen Sie zu den Einstellungen, um es zu aktivieren.",
|
87
87
|
"provider": "Anbieter"
|
88
|
+
},
|
89
|
+
"Thinking": {
|
90
|
+
"thinking": "Tiefes Nachdenken...",
|
91
|
+
"thought": "Tief nachgedacht",
|
92
|
+
"thoughtWithDuration": "Tief nachgedacht (Dauer: {{duration}} Sekunden)"
|
88
93
|
}
|
89
94
|
}
|
package/locales/en-US/chat.json
CHANGED
@@ -82,10 +82,6 @@
|
|
82
82
|
}
|
83
83
|
}
|
84
84
|
},
|
85
|
-
"reasoning": {
|
86
|
-
"thinking": "Deep in thought",
|
87
|
-
"thought": "Deeply thought (took {{duration}} seconds)"
|
88
|
-
},
|
89
85
|
"regenerate": "Regenerate",
|
90
86
|
"roleAndArchive": "Role and Archive",
|
91
87
|
"searchAgentPlaceholder": "Search assistants...",
|