@lobehub/chat 1.14.5 → 1.14.7

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 (78) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/docker-compose/local/.env.example +35 -0
  3. package/docker-compose/local/.env.zh-CN.example +35 -0
  4. package/docker-compose/local/docker-compose.yml +64 -0
  5. package/docker-compose/{.env.example → production/.env.example} +4 -4
  6. package/docker-compose/{.env.zh-CN.example → production/.env.zh-CN.example} +5 -5
  7. package/docs/self-hosting/server-database/docker-compose.mdx +136 -10
  8. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +135 -10
  9. package/locales/ar/portal.json +7 -0
  10. package/locales/bg-BG/portal.json +7 -0
  11. package/locales/de-DE/portal.json +7 -0
  12. package/locales/en-US/components.json +10 -10
  13. package/locales/en-US/file.json +5 -5
  14. package/locales/en-US/portal.json +7 -0
  15. package/locales/en-US/tool.json +1 -1
  16. package/locales/es-ES/portal.json +7 -0
  17. package/locales/fr-FR/portal.json +7 -0
  18. package/locales/it-IT/portal.json +7 -0
  19. package/locales/ja-JP/portal.json +7 -0
  20. package/locales/ko-KR/portal.json +7 -0
  21. package/locales/nl-NL/portal.json +7 -0
  22. package/locales/pl-PL/portal.json +7 -0
  23. package/locales/pt-BR/portal.json +7 -0
  24. package/locales/ru-RU/portal.json +7 -0
  25. package/locales/tr-TR/portal.json +7 -0
  26. package/locales/vi-VN/portal.json +7 -0
  27. package/locales/zh-CN/portal.json +7 -0
  28. package/locales/zh-TW/portal.json +7 -0
  29. package/package.json +1 -1
  30. package/src/app/(main)/chat/(workspace)/@portal/Artifacts/{index.tsx → Body/index.tsx} +1 -1
  31. package/src/app/(main)/chat/(workspace)/@portal/Artifacts/Header.tsx +35 -0
  32. package/src/app/(main)/chat/(workspace)/@portal/Artifacts/index.ts +9 -0
  33. package/src/app/(main)/chat/(workspace)/@portal/Artifacts/useEnable.ts +6 -0
  34. package/src/app/(main)/chat/(workspace)/@portal/FilePreview/Body/index.tsx +57 -0
  35. package/src/app/(main)/chat/(workspace)/@portal/FilePreview/Header.tsx +36 -0
  36. package/src/app/(main)/chat/(workspace)/@portal/FilePreview/index.ts +9 -0
  37. package/src/app/(main)/chat/(workspace)/@portal/FilePreview/useEnable.ts +6 -0
  38. package/src/app/(main)/chat/(workspace)/@portal/Home/{Files → Body/Files}/FileList/Item.tsx +7 -7
  39. package/src/app/(main)/chat/(workspace)/@portal/Home/{Files → Body/Files}/FileList/index.tsx +2 -2
  40. package/src/app/(main)/chat/(workspace)/@portal/Home/Header.tsx +17 -0
  41. package/src/app/(main)/chat/(workspace)/@portal/Home/index.ts +2 -0
  42. package/src/app/(main)/chat/(workspace)/@portal/_layout/Desktop.tsx +1 -1
  43. package/src/app/(main)/chat/(workspace)/@portal/default.tsx +2 -2
  44. package/src/app/(main)/chat/(workspace)/@portal/features/Header.tsx +6 -35
  45. package/src/app/(main)/chat/(workspace)/@portal/router.tsx +36 -12
  46. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/KnowledgeTag.tsx +5 -3
  47. package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +3 -1
  48. package/src/components/FileParsingStatus/EmbeddingStatus.tsx +117 -0
  49. package/src/components/FileParsingStatus/index.tsx +54 -112
  50. package/src/config/modelProviders/google.ts +29 -1
  51. package/src/config/modelProviders/openai.ts +0 -1
  52. package/src/database/server/models/message.ts +8 -2
  53. package/src/features/Conversation/Messages/Assistant/FileChunks/Item/index.tsx +10 -7
  54. package/src/features/Conversation/Messages/Assistant/FileChunks/Item/style.ts +13 -0
  55. package/src/features/Conversation/Messages/User/FileListViewer/Item.tsx +1 -1
  56. package/src/features/FileManager/FileList/FileListItem/ChunkTag.tsx +14 -7
  57. package/src/layout/GlobalProvider/Locale.tsx +19 -17
  58. package/src/locales/default/portal.ts +7 -0
  59. package/src/server/routers/lambda/agent.ts +3 -1
  60. package/src/server/routers/lambda/file.ts +19 -0
  61. package/src/services/file/server.ts +4 -0
  62. package/src/services/rag.ts +1 -0
  63. package/src/store/chat/slices/portal/action.ts +9 -4
  64. package/src/store/chat/slices/portal/initialState.ts +7 -3
  65. package/src/store/chat/slices/portal/selectors.ts +2 -0
  66. package/src/store/file/slices/fileManager/action.ts +18 -0
  67. package/src/styles/index.ts +2 -0
  68. package/src/styles/text.ts +10 -0
  69. package/src/types/message/index.ts +2 -0
  70. package/src/app/(main)/chat/(workspace)/@portal/FilePreview/index.tsx +0 -26
  71. /package/docker-compose/{docker-compose.yml → production/docker-compose.yml} +0 -0
  72. /package/src/app/(main)/chat/(workspace)/@portal/Artifacts/{ToolRender.tsx → Body/ToolRender.tsx} +0 -0
  73. /package/src/app/(main)/chat/(workspace)/@portal/Home/{Artifacts → Body/Artifacts}/ArtifactList/Item/index.tsx +0 -0
  74. /package/src/app/(main)/chat/(workspace)/@portal/Home/{Artifacts → Body/Artifacts}/ArtifactList/Item/style.ts +0 -0
  75. /package/src/app/(main)/chat/(workspace)/@portal/Home/{Artifacts → Body/Artifacts}/ArtifactList/index.tsx +0 -0
  76. /package/src/app/(main)/chat/(workspace)/@portal/Home/{Artifacts → Body/Artifacts}/index.tsx +0 -0
  77. /package/src/app/(main)/chat/(workspace)/@portal/Home/{Files → Body/Files}/index.tsx +0 -0
  78. /package/src/app/(main)/chat/(workspace)/@portal/Home/{index.tsx → Body/index.tsx} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,64 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.14.7](https://github.com/lobehub/lobe-chat/compare/v1.14.6...v1.14.7)
6
+
7
+ <sup>Released on **2024-08-28**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Disable ChatGPT-4o Tools Calling.
12
+
13
+ #### 💄 Styles
14
+
15
+ - **misc**: Improve chunk and file preview.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### What's fixed
23
+
24
+ - **misc**: Disable ChatGPT-4o Tools Calling, closes [#3659](https://github.com/lobehub/lobe-chat/issues/3659) ([c94077d](https://github.com/lobehub/lobe-chat/commit/c94077d))
25
+
26
+ #### Styles
27
+
28
+ - **misc**: Improve chunk and file preview, closes [#3658](https://github.com/lobehub/lobe-chat/issues/3658) ([4c9155c](https://github.com/lobehub/lobe-chat/commit/4c9155c))
29
+
30
+ </details>
31
+
32
+ <div align="right">
33
+
34
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
35
+
36
+ </div>
37
+
38
+ ### [Version 1.14.6](https://github.com/lobehub/lobe-chat/compare/v1.14.5...v1.14.6)
39
+
40
+ <sup>Released on **2024-08-28**</sup>
41
+
42
+ #### 💄 Styles
43
+
44
+ - **misc**: Update Gemini models.
45
+
46
+ <br/>
47
+
48
+ <details>
49
+ <summary><kbd>Improvements and Fixes</kbd></summary>
50
+
51
+ #### Styles
52
+
53
+ - **misc**: Update Gemini models, closes [#3653](https://github.com/lobehub/lobe-chat/issues/3653) ([b61ca4c](https://github.com/lobehub/lobe-chat/commit/b61ca4c))
54
+
55
+ </details>
56
+
57
+ <div align="right">
58
+
59
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
60
+
61
+ </div>
62
+
5
63
  ### [Version 1.14.5](https://github.com/lobehub/lobe-chat/compare/v1.14.4...v1.14.5)
6
64
 
7
65
  <sup>Released on **2024-08-28**</sup>
@@ -0,0 +1,35 @@
1
+ # LobeChat domain
2
+ APP_URL=https://localhost:3210
3
+
4
+ # Postgres related, which are the necessary environment variables for DB
5
+ # Key used to encrypt sensitive information; can be generated using openssl rand -base64 32
6
+ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
7
+ # Postgres database connection string
8
+ # Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container name
9
+ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
10
+
11
+ # NEXT_AUTH related; can use auth0, Azure AD, GitHub, Authentik, Zitadel, Logto, etc. If you have other integration requests, feel free to submit a PR.
12
+ # Here we take Logto as an example
13
+ NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
14
+ NEXT_AUTH_SSO_PROVIDERS=logto
15
+ NEXTAUTH_URL=http://localhost:3210/api/auth
16
+ LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
17
+ LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
18
+ LOGTO_ISSUER=http://localhost:3001/oidc
19
+ # Note: If you have ACCESS_CODE, be sure to clear it. We use NEXT_AUTH as the only authentication source.
20
+ # Proxy, if you need it (e.g., if you use GitHub as an authentication service provider)
21
+ # HTTP_PROXY=http://localhost:7890
22
+ # HTTPS_PROXY=http://localhost:7890
23
+
24
+ # MinIO S3 configuration
25
+ S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # Invalid until manually created in MinIO UI
26
+ S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY # Invalid until manually created in MinIO UI
27
+ S3_ENDPOINT=http://localhost:9000
28
+ S3_BUCKET=lobe # Invalid until manually created in MinIO UI
29
+ S3_ENDPOINT=http://localhost:9000
30
+ S3_ENABLE_PATH_STYLE=1
31
+
32
+ # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
33
+ # OPEANAI_API_KEY=sk-xxxx
34
+ # OPENAI_PROXY_URL=https://api.openai.com/v1
35
+ # OPENAI_MODEL_LIST=...
@@ -0,0 +1,35 @@
1
+ # LobeChat 域名
2
+ APP_URL=https://localhost:3210
3
+
4
+ # Postgres 相关,也即 DB 必须的环境变量
5
+ # 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成
6
+ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
7
+ # Postgres 数据库连接字符串
8
+ # 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例与 LobeChat 服务在同一 Docker 网络中,可以使用容器名作为 host
9
+ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@localhost:5432/postgres
10
+
11
+ # NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、Zitadel、Logto 等,如有其他接入诉求欢迎提 PR
12
+ # 这里以 Logto 为例
13
+ NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
14
+ NEXT_AUTH_SSO_PROVIDERS=logto
15
+ NEXTAUTH_URL=http://localhost:3210/api/auth
16
+ LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
17
+ LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
18
+ LOGTO_ISSUER=http://localhost:3001/oidc
19
+ # 注:如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源
20
+ # Proxy,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
21
+ # HTTP_PROXY=http://localhost:7890
22
+ # HTTPS_PROXY=http://localhost:7890
23
+
24
+ # MinIO S3 配置
25
+ S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # 直到在 MinIO UI 中手动创建之前都是无效的
26
+ S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY # 直到在 MinIO UI 中手动创建之前都是无效的
27
+ S3_ENDPOINT=http://localhost:9000
28
+ S3_BUCKET=lobe # 直到在 MinIO UI 中手动创建之前都是无效的
29
+ S3_PUBLIC_DOMAIN=http://localhost:9000
30
+ S3_ENABLE_PATH_STYLE=1
31
+
32
+ # 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE
33
+ # OPEANAI_API_KEY=sk-xxxx
34
+ # OPENAI_PROXY_URL=https://api.openai.com/v1
35
+ # OPENAI_MODEL_LIST=...
@@ -0,0 +1,64 @@
1
+ services:
2
+ postgresql:
3
+ image: pgvector/pgvector:pg16
4
+ container_name: lobe-postgres
5
+ network_mode: 'host'
6
+ volumes:
7
+ - './data:/var/lib/postgresql/data'
8
+ environment:
9
+ - 'POSTGRES_DB=lobe'
10
+ - 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC'
11
+ healthcheck:
12
+ test: ['CMD-SHELL', 'pg_isready -U postgres']
13
+ interval: 5s
14
+ timeout: 5s
15
+ retries: 5
16
+ restart: always
17
+
18
+ minio:
19
+ image: minio/minio
20
+ container_name: lobe-minio
21
+ network_mode: 'host'
22
+ volumes:
23
+ - './s3_data:/etc/minio/data'
24
+ environment:
25
+ - 'MINIO_ROOT_USER=YOUR_MINIO_USER'
26
+ - 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD'
27
+ - 'MINIO_DOMAIN=localhost:9000'
28
+ - 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:3210'
29
+ restart: always
30
+ command: >
31
+ server /etc/minio/data --address ":9000" --console-address ":9001"
32
+
33
+
34
+ logto:
35
+ image: svhd/logto
36
+ container_name: lobe-logto
37
+ network_mode: 'host'
38
+ depends_on:
39
+ postgresql:
40
+ condition: service_healthy
41
+ environment:
42
+ - 'TRUST_PROXY_HEADER=1'
43
+ - 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@localhost:5432/logto'
44
+ - 'ENDPOINT=http://localhost:3001'
45
+ - 'ADMIN_ENDPOINT=http://localhost:3002'
46
+ entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
47
+
48
+ lobe:
49
+ image: lobehub/lobe-chat-database
50
+ container_name: lobe-database
51
+ network_mode: 'host'
52
+ depends_on:
53
+ - postgresql
54
+ - minio
55
+ - logto
56
+ env_file:
57
+ - .env
58
+ restart: always
59
+
60
+ volumes:
61
+ data:
62
+ driver: local
63
+ s3_data:
64
+ driver: local
@@ -13,13 +13,13 @@ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
13
13
  NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
14
14
  NEXT_AUTH_SSO_PROVIDERS=logto
15
15
  NEXTAUTH_URL=https://lobe.example.com/api/auth
16
- LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
17
- LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
16
+ LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
17
+ LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
18
18
  LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
19
19
  # Note: If you have ACCESS_CODE, be sure to clear it. We use NEXT_AUTH as the only authentication source.
20
20
  # Proxy, if you need it (e.g., if you use GitHub as an authentication service provider)
21
- HTTP_PROXY=http://localhost:7890
22
- HTTPS_PROXY=http://localhost:7890
21
+ # HTTP_PROXY=http://localhost:7890
22
+ # HTTPS_PROXY=http://localhost:7890
23
23
 
24
24
  # MinIO S3 configuration
25
25
  S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # Invalid until manually created in MinIO UI
@@ -13,13 +13,13 @@ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
13
13
  NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
14
14
  NEXT_AUTH_SSO_PROVIDERS=logto
15
15
  NEXTAUTH_URL=https://lobe.example.com/api/auth
16
- LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
17
- LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
16
+ LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
17
+ LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
18
18
  LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
19
19
  # 注:如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源
20
20
  # Proxy,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
21
- HTTP_PROXY=http://localhost:7890
22
- HTTPS_PROXY=http://localhost:7890
21
+ # HTTP_PROXY=http://localhost:7890
22
+ # HTTPS_PROXY=http://localhost:7890
23
23
 
24
24
  # MinIO S3 配置
25
25
  S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # 直到在 MinIO UI 中手动创建之前都是无效的
@@ -32,4 +32,4 @@ S3_ENABLE_PATH_STYLE=1
32
32
  # 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE
33
33
  # OPEANAI_API_KEY=sk-xxxx
34
34
  # OPENAI_PROXY_URL=https://api.openai.com/v1
35
- # OPENAI_MODEL_LIST=...
35
+ # OPENAI_MODEL_LIST=...
@@ -49,14 +49,20 @@ The following assumes that you choose to build all four required services for Lo
49
49
  ### Create Configuration Files
50
50
 
51
51
  ```sh
52
- curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/docker-compose.yml
53
- curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/.env.example > .env
52
+ curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml
53
+ curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/.env.example > .env
54
54
  ```
55
55
 
56
56
  You can also copy these two example configuration files from the appendix below.
57
57
 
58
58
  Please modify your `.env` and `docker-compose.yml` files according to the comments.
59
59
 
60
+ <Callout type="warning">
61
+
62
+ Due to network reasons, when starting locally, we intentionally let all services use `network_mode: host` simultaneously. This can solve some network issues, but it may cause port conflicts, please resolve them yourself.
63
+
64
+ </Callout>
65
+
60
66
  ### Start Services
61
67
 
62
68
  ```sh
@@ -196,6 +202,11 @@ If you need to configure SSL certificates, please configure them uniformly in th
196
202
 
197
203
  ### Configuration Files
198
204
 
205
+ ```sh
206
+ curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/docker-compose.yml
207
+ curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/.env.example > .env
208
+ ```
209
+
199
210
  The configuration files include `.env` and `docker-compose.yml`, where the `.env` file is used to configure LobeChat's environment variables, and the `docker-compose.yml` file is used to configure the Postgres, MinIO, and Logto services.
200
211
 
201
212
  In general, you should only modify sensitive information such as domain names and account passwords, while other configuration items should be set according to the default values.
@@ -347,7 +358,121 @@ You have successfully deployed the LobeChat database version, and you can access
347
358
 
348
359
  To facilitate one-click copying, here are the example configuration files needed to configure the server database:
349
360
 
350
- ### `.env`
361
+ ### Local Deployment
362
+
363
+ #### `.env`
364
+
365
+ ```sh
366
+ # LobeChat domain
367
+ APP_URL=https://localhost:3210
368
+
369
+ # Postgres related, which are the necessary environment variables for DB
370
+ # Key used to encrypt sensitive information; can be generated using openssl rand -base64 32
371
+ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
372
+ # Postgres database connection string
373
+ # Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container name
374
+ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
375
+
376
+ # NEXT_AUTH related; can use auth0, Azure AD, GitHub, Authentik, Zitadel, Logto, etc. If you have other integration requests, feel free to submit a PR.
377
+ # Here we take Logto as an example
378
+ NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
379
+ NEXT_AUTH_SSO_PROVIDERS=logto
380
+ NEXTAUTH_URL=http://localhost:3210/api/auth
381
+ LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
382
+ LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
383
+ LOGTO_ISSUER=http://localhost:3001/oidc
384
+ # Note: If you have ACCESS_CODE, be sure to clear it. We use NEXT_AUTH as the only authentication source.
385
+ # Proxy, if you need it (e.g., if you use GitHub as an authentication service provider)
386
+ # HTTP_PROXY=http://localhost:7890
387
+ # HTTPS_PROXY=http://localhost:7890
388
+
389
+ # MinIO S3 configuration
390
+ S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # Invalid until manually created in MinIO UI
391
+ S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY # Invalid until manually created in MinIO UI
392
+ S3_ENDPOINT=http://localhost:9000
393
+ S3_BUCKET=lobe # Invalid until manually created in MinIO UI
394
+ S3_ENDPOINT=http://localhost:9000
395
+ S3_ENABLE_PATH_STYLE=1
396
+
397
+ # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
398
+ # OPEANAI_API_KEY=sk-xxxx
399
+ # OPENAI_PROXY_URL=https://api.openai.com/v1
400
+ # OPENAI_MODEL_LIST=...
401
+
402
+ ```
403
+
404
+ #### `docker-compose.yml`
405
+
406
+ ```yaml
407
+ services:
408
+ postgresql:
409
+ image: pgvector/pgvector:pg16
410
+ container_name: lobe-postgres
411
+ network_mode: 'host'
412
+ volumes:
413
+ - './data:/var/lib/postgresql/data'
414
+ environment:
415
+ - 'POSTGRES_DB=lobe'
416
+ - 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC'
417
+ healthcheck:
418
+ test: ['CMD-SHELL', 'pg_isready -U postgres']
419
+ interval: 5s
420
+ timeout: 5s
421
+ retries: 5
422
+ restart: always
423
+
424
+ minio:
425
+ image: minio/minio
426
+ container_name: lobe-minio
427
+ network_mode: 'host'
428
+ volumes:
429
+ - './s3_data:/etc/minio/data'
430
+ environment:
431
+ - 'MINIO_ROOT_USER=YOUR_MINIO_USER'
432
+ - 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD'
433
+ - 'MINIO_DOMAIN=localhost:9000'
434
+ - 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:3210'
435
+ restart: always
436
+ command: >
437
+ server /etc/minio/data --address ":9000" --console-address ":9001"
438
+
439
+ logto:
440
+ image: svhd/logto
441
+ container_name: lobe-logto
442
+ network_mode: 'host'
443
+ depends_on:
444
+ postgresql:
445
+ condition: service_healthy
446
+ environment:
447
+ - 'TRUST_PROXY_HEADER=1'
448
+ - 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@localhost:5432/logto'
449
+ - 'ENDPOINT=http://localhost:3001'
450
+ - 'ADMIN_ENDPOINT=http://localhost:3002'
451
+ entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
452
+
453
+ lobe:
454
+ image: lobehub/lobe-chat-database
455
+ container_name: lobe-database
456
+ network_mode: 'host'
457
+ depends_on:
458
+ - postgresql
459
+ - minio
460
+ - logto
461
+ env_file:
462
+ - .env
463
+ restart: always
464
+
465
+ volumes:
466
+ data:
467
+ driver: local
468
+ s3_data:
469
+ driver: local
470
+
471
+ ```
472
+
473
+ ### Deploying to Production
474
+
475
+ #### `.env`
351
476
 
352
477
  ```sh
353
478
  # LobeChat domain
@@ -365,13 +490,13 @@ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
365
490
  NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
366
491
  NEXT_AUTH_SSO_PROVIDERS=logto
367
492
  NEXTAUTH_URL=https://lobe.example.com/api/auth
368
- LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
369
- LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
493
+ LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
494
+ LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
370
495
  LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
371
496
  # Note: If you have ACCESS_CODE, be sure to clear it. We use NEXT_AUTH as the only authentication source.
372
497
  # Proxy, if you need it (e.g., if you use GitHub as an authentication service provider)
373
- HTTP_PROXY=http://localhost:7890
374
- HTTPS_PROXY=http://localhost:7890
498
+ # HTTP_PROXY=http://localhost:7890
499
+ # HTTPS_PROXY=http://localhost:7890
375
500
 
376
501
  # MinIO S3 configuration
377
502
  S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # Invalid until manually created in MinIO UI
@@ -387,7 +512,7 @@ S3_ENABLE_PATH_STYLE=1
387
512
  # OPENAI_MODEL_LIST=...
388
513
  ```
389
514
 
390
- ### `docker-compose.yml`
515
+ #### `docker-compose.yml`
391
516
 
392
517
  ```yaml
393
518
  services:
@@ -420,7 +545,7 @@ services:
420
545
  - 'MINIO_ROOT_USER=YOUR_MINIO_USER'
421
546
  - 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD'
422
547
  - 'MINIO_DOMAIN=lobe-s3-api.example.com'
423
- - 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' # Your LobeChat domain
548
+ - 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' # Your LobeChat's domain name.
424
549
  restart: always
425
550
  command: >
426
551
  server /etc/minio/data --address ":9000" --console-address ":9001"
@@ -459,9 +584,10 @@ volumes:
459
584
  driver: local
460
585
  s3_data:
461
586
  driver: local
587
+
462
588
  ```
463
589
 
464
- ### `minio-bucket-config.json`
590
+ #### `minio-bucket-config.json`
465
591
 
466
592
  ```json
467
593
  {
@@ -46,14 +46,18 @@ tags:
46
46
  ### 创建配置文件
47
47
 
48
48
  ```sh
49
- curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/docker-compose.yml
50
- curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/.env.zh-CN.example > .env
49
+ curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml
50
+ curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/.env.zh-CN.example > .env
51
51
  ```
52
52
 
53
53
  你也可以从下文的附录中复制得到这两份示例配置文件。
54
54
 
55
55
  请按照注释,修改你的 `.env` 和 `docker-compose.yml` 文件。
56
56
 
57
+ <Callout type="warning">
58
+ 出于网络原因,本地启动时,我们特意让所有服务都同时使用了 `network_mode: host`。这可以解决一些网络问题,但是有可能会导致端口冲突,请自行解决。
59
+ </Callout>
60
+
57
61
  ### 启动服务
58
62
 
59
63
  ```sh
@@ -194,6 +198,11 @@ docker logs -f lobe-database
194
198
 
195
199
  ### 配置文件
196
200
 
201
+ ```sh
202
+ curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/docker-compose.yml
203
+ curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/.env.zh-CN.example > .env
204
+ ```
205
+
197
206
  配置文件包括 `.env` 和 `docker-compose.yml` 两个文件,其中 `.env` 文件用于配置 LobeChat 的环境变量,`docker-compose.yml` 文件用于配置 Postgres、MinIO 和 Logto 服务。
198
207
 
199
208
  一般情况下,你只应修改其中的域名和账号密码等敏感信息,其他配置项请按照默认值进行配置。
@@ -342,7 +351,121 @@ docker compose up -d # 重新启动
342
351
 
343
352
  为方便一键复制,在此汇总配置服务端数据库所需要的示例配置文件:
344
353
 
345
- ### `.env`
354
+ ### 本地部署
355
+
356
+ #### `.env`
357
+
358
+ ```sh
359
+ # LobeChat 域名
360
+ APP_URL=https://localhost:3210
361
+
362
+ # Postgres 相关,也即 DB 必须的环境变量
363
+ # 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成
364
+ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
365
+ # Postgres 数据库连接字符串
366
+ # 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例与 LobeChat 服务在同一 Docker 网络中,可以使用容器名作为 host
367
+ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@localhost:5432/postgres
368
+
369
+ # NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、Zitadel、Logto 等,如有其他接入诉求欢迎提 PR
370
+ # 这里以 Logto 为例
371
+ NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
372
+ NEXT_AUTH_SSO_PROVIDERS=logto
373
+ NEXTAUTH_URL=http://localhost:3210/api/auth
374
+ LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
375
+ LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
376
+ LOGTO_ISSUER=http://localhost:3001/oidc
377
+ # 注:如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源
378
+ # Proxy,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
379
+ # HTTP_PROXY=http://localhost:7890
380
+ # HTTPS_PROXY=http://localhost:7890
381
+
382
+ # MinIO S3 配置
383
+ S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # 直到在 MinIO UI 中手动创建之前都是无效的
384
+ S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY # 直到在 MinIO UI 中手动创建之前都是无效的
385
+ S3_ENDPOINT=http://localhost:9000
386
+ S3_BUCKET=lobe # 直到在 MinIO UI 中手动创建之前都是无效的
387
+ S3_PUBLIC_DOMAIN=http://localhost:9000
388
+ S3_ENABLE_PATH_STYLE=1
389
+
390
+ # 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE
391
+ # OPEANAI_API_KEY=sk-xxxx
392
+ # OPENAI_PROXY_URL=https://api.openai.com/v1
393
+ # OPENAI_MODEL_LIST=...
394
+
395
+ ```
396
+
397
+ #### `docker-compose.yml`
398
+
399
+ ```yaml
400
+ services:
401
+ postgresql:
402
+ image: pgvector/pgvector:pg16
403
+ container_name: lobe-postgres
404
+ network_mode: 'host'
405
+ volumes:
406
+ - './data:/var/lib/postgresql/data'
407
+ environment:
408
+ - 'POSTGRES_DB=lobe'
409
+ - 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC'
410
+ healthcheck:
411
+ test: ['CMD-SHELL', 'pg_isready -U postgres']
412
+ interval: 5s
413
+ timeout: 5s
414
+ retries: 5
415
+ restart: always
416
+
417
+ minio:
418
+ image: minio/minio
419
+ container_name: lobe-minio
420
+ network_mode: 'host'
421
+ volumes:
422
+ - './s3_data:/etc/minio/data'
423
+ environment:
424
+ - 'MINIO_ROOT_USER=YOUR_MINIO_USER'
425
+ - 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD'
426
+ - 'MINIO_DOMAIN=localhost:9000'
427
+ - 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:3210'
428
+ restart: always
429
+ command: >
430
+ server /etc/minio/data --address ":9000" --console-address ":9001"
431
+
432
+ logto:
433
+ image: svhd/logto
434
+ container_name: lobe-logto
435
+ network_mode: 'host'
436
+ depends_on:
437
+ postgresql:
438
+ condition: service_healthy
439
+ environment:
440
+ - 'TRUST_PROXY_HEADER=1'
441
+ - 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@localhost:5432/logto'
442
+ - 'ENDPOINT=http://localhost:3001'
443
+ - 'ADMIN_ENDPOINT=http://localhost:3002'
444
+ entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
445
+
446
+ lobe:
447
+ image: lobehub/lobe-chat-database
448
+ container_name: lobe-database
449
+ network_mode: 'host'
450
+ depends_on:
451
+ - postgresql
452
+ - minio
453
+ - logto
454
+ env_file:
455
+ - .env
456
+ restart: always
457
+
458
+ volumes:
459
+ data:
460
+ driver: local
461
+ s3_data:
462
+ driver: local
463
+
464
+ ```
465
+
466
+ ### 发布到生产
467
+
468
+ #### `.env`
346
469
 
347
470
  ```sh
348
471
  # LobeChat 域名
@@ -360,13 +483,13 @@ DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
360
483
  NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
361
484
  NEXT_AUTH_SSO_PROVIDERS=logto
362
485
  NEXTAUTH_URL=https://lobe.example.com/api/auth
363
- LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
364
- LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
486
+ LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
487
+ LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
365
488
  LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
366
489
  # 注:如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源
367
490
  # Proxy,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
368
- HTTP_PROXY=http://localhost:7890
369
- HTTPS_PROXY=http://localhost:7890
491
+ # HTTP_PROXY=http://localhost:7890
492
+ # HTTPS_PROXY=http://localhost:7890
370
493
 
371
494
  # MinIO S3 配置
372
495
  S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID # 直到在 MinIO UI 中手动创建之前都是无效的
@@ -380,9 +503,10 @@ S3_ENABLE_PATH_STYLE=1
380
503
  # OPEANAI_API_KEY=sk-xxxx
381
504
  # OPENAI_PROXY_URL=https://api.openai.com/v1
382
505
  # OPENAI_MODEL_LIST=...
506
+
383
507
  ```
384
508
 
385
- ### `docker-compose.yml`
509
+ #### `docker-compose.yml`
386
510
 
387
511
  ```yaml
388
512
  services:
@@ -415,7 +539,7 @@ services:
415
539
  - 'MINIO_ROOT_USER=YOUR_MINIO_USER'
416
540
  - 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD'
417
541
  - 'MINIO_DOMAIN=lobe-s3-api.example.com'
418
- - 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' # 请注意这里的域名是你的 LobeChat 服务端域名
542
+ - 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' # Your LobeChat's domain name.
419
543
  restart: always
420
544
  command: >
421
545
  server /etc/minio/data --address ":9000" --console-address ":9001"
@@ -454,9 +578,10 @@ volumes:
454
578
  driver: local
455
579
  s3_data:
456
580
  driver: local
581
+
457
582
  ```
458
583
 
459
- ### `minio-bucket-config.json`
584
+ #### `minio-bucket-config.json`
460
585
 
461
586
  ```json
462
587
  {
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "Artifacts": "القطع الأثرية",
3
+ "FilePreview": {
4
+ "tabs": {
5
+ "chunk": "جزء",
6
+ "file": "ملف"
7
+ }
8
+ },
3
9
  "actions": {
4
10
  "genAiMessage": "إنشاء رسالة مساعد ذكاء اصطناعي",
5
11
  "summary": "ملخص",
6
12
  "summaryTooltip": "ملخص للمحتوى الحالي"
7
13
  },
8
14
  "emptyArtifactList": "قائمة القطع الأثرية الحالية فارغة، يرجى استخدام الإضافات في الجلسة ومن ثم التحقق مرة أخرى",
15
+ "emptyKnowledgeList": "قائمة المعرفة الحالية فارغة، يرجى فتح قاعدة المعرفة حسب الحاجة في المحادثة قبل العرض",
9
16
  "files": "ملفات",
10
17
  "title": "نافذة موسعة"
11
18
  }