@lobehub/chat 1.20.2 → 1.20.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 +42 -0
- package/docker-compose/local/zitadel/.env.example +33 -0
- package/docker-compose/local/zitadel/.env.zh-CN.example +32 -0
- package/docker-compose/local/zitadel/docker-compose.yml +86 -0
- package/docker-compose/local/zitadel/zitadel-config.yaml +26 -0
- package/docker-compose/local/zitadel/zitadel-init-steps.yaml +11 -0
- package/docker-compose/production/zitadel/.env.example +53 -0
- package/docker-compose/production/zitadel/.env.zh-CN.example +48 -0
- package/docker-compose/production/zitadel/docker-compose.yml +69 -0
- package/docker-compose/production/zitadel/zitadel-config.yaml +25 -0
- package/docker-compose/production/zitadel/zitadel-init-steps.yaml +11 -0
- package/docs/self-hosting/advanced/feature-flags.mdx +1 -0
- package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/model-provider.mdx +16 -0
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +16 -0
- package/package.json +2 -2
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/index.tsx +7 -1
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/Portal.tsx +0 -2
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/TopicPanel.tsx +0 -2
- package/src/app/(main)/chat/@session/features/SessionListContent/Modals/ConfigGroupModal/index.tsx +1 -2
- package/src/components/DragUpload/index.tsx +0 -1
- package/src/components/FunctionModal/style.tsx +0 -1
- package/src/components/GuideModal/index.tsx +0 -1
- package/src/database/server/models/chunk.ts +10 -1
- package/src/features/Conversation/components/VirtualizedList/index.tsx +2 -7
- package/src/layout/AuthProvider/Clerk/useAppearance.ts +0 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,48 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.20.4](https://github.com/lobehub/lobe-chat/compare/v1.20.3...v1.20.4)
|
6
|
+
|
7
|
+
<sup>Released on **2024-09-28**</sup>
|
8
|
+
|
9
|
+
<br/>
|
10
|
+
|
11
|
+
<details>
|
12
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
13
|
+
|
14
|
+
</details>
|
15
|
+
|
16
|
+
<div align="right">
|
17
|
+
|
18
|
+
[](#readme-top)
|
19
|
+
|
20
|
+
</div>
|
21
|
+
|
22
|
+
### [Version 1.20.3](https://github.com/lobehub/lobe-chat/compare/v1.20.2...v1.20.3)
|
23
|
+
|
24
|
+
<sup>Released on **2024-09-28**</sup>
|
25
|
+
|
26
|
+
#### 🐛 Bug Fixes
|
27
|
+
|
28
|
+
- **misc**: Improve delete orphan chunks when delete files.
|
29
|
+
|
30
|
+
<br/>
|
31
|
+
|
32
|
+
<details>
|
33
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
34
|
+
|
35
|
+
#### What's fixed
|
36
|
+
|
37
|
+
- **misc**: Improve delete orphan chunks when delete files, closes [#4179](https://github.com/lobehub/lobe-chat/issues/4179) ([f3e0ffe](https://github.com/lobehub/lobe-chat/commit/f3e0ffe))
|
38
|
+
|
39
|
+
</details>
|
40
|
+
|
41
|
+
<div align="right">
|
42
|
+
|
43
|
+
[](#readme-top)
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
5
47
|
### [Version 1.20.2](https://github.com/lobehub/lobe-chat/compare/v1.20.1...v1.20.2)
|
6
48
|
|
7
49
|
<sup>Released on **2024-09-27**</sup>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Required: LobeChat domain for tRPC calls
|
2
|
+
# Ensure this domain is whitelisted in your NextAuth providers and S3 service CORS settings
|
3
|
+
APP_URL=http://localhost:3210
|
4
|
+
|
5
|
+
# Postgres related environment variables
|
6
|
+
# Required: Secret key for encrypting sensitive information. Generate with: openssl rand -base64 32
|
7
|
+
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
|
8
|
+
# Required: Postgres database connection string
|
9
|
+
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobechat
|
10
|
+
|
11
|
+
# NEXT_AUTH related environment variables
|
12
|
+
NEXTAUTH_URL=http://localhost:3210/api/auth
|
13
|
+
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
14
|
+
NEXT_AUTH_SSO_PROVIDERS=zitadel
|
15
|
+
# ZiTADEL provider configuration
|
16
|
+
# Please refer to:https://lobehub.com/zh/docs/self-hosting/advanced/auth/next-auth/zitadel
|
17
|
+
AUTH_ZITADEL_ID=285945938244075523
|
18
|
+
AUTH_ZITADEL_SECRET=hkbtzHLaCEIeHeFThym14UcydpmQiEB5JtAX08HSqSoJxhAlVVkyovTuNUZ5TNrT
|
19
|
+
AUTH_ZITADEL_ISSUER=http://localhost:8080
|
20
|
+
|
21
|
+
# MinIO S3 configuration
|
22
|
+
S3_ACCESS_KEY_ID=
|
23
|
+
S3_SECRET_ACCESS_KEY=
|
24
|
+
S3_ENDPOINT=http://localhost:9000
|
25
|
+
S3_BUCKET=lobe
|
26
|
+
S3_PUBLIC_DOMAIN=http://localhost:9000
|
27
|
+
S3_ENABLE_PATH_STYLE=1
|
28
|
+
LLM_VISION_IMAGE_USE_BASE64=1
|
29
|
+
|
30
|
+
# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
|
31
|
+
# OPENAI_API_KEY=sk-xxxx
|
32
|
+
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
33
|
+
# OPENAI_MODEL_LIST=...
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# LobeChat 域名
|
2
|
+
APP_URL=http://localhost:3210
|
3
|
+
|
4
|
+
# Postgres 相关,也即 DB 必须的环境变量
|
5
|
+
# 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成
|
6
|
+
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
|
7
|
+
# Postgres 数据库连接字符串
|
8
|
+
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobechat
|
9
|
+
|
10
|
+
# NEXT_AUTH 相关
|
11
|
+
NEXTAUTH_URL=http://localhost:3210/api/auth
|
12
|
+
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
13
|
+
NEXT_AUTH_SSO_PROVIDERS=zitadel
|
14
|
+
# ZiTADEL 鉴权服务提供商部分
|
15
|
+
# 请参考:https://lobehub.com/zh/docs/self-hosting/advanced/auth/next-auth/zitadel
|
16
|
+
AUTH_ZITADEL_ID=285945938244075523
|
17
|
+
AUTH_ZITADEL_SECRET=hkbtzHLaCEIeHeFThym14UcydpmQiEB5JtAX08HSqSoJxhAlVVkyovTuNUZ5TNrT
|
18
|
+
AUTH_ZITADEL_ISSUER=http://localhost:8080
|
19
|
+
|
20
|
+
# MinIO S3 配置
|
21
|
+
S3_ACCESS_KEY_ID=
|
22
|
+
S3_SECRET_ACCESS_KEY=
|
23
|
+
S3_ENDPOINT=http://localhost:9000
|
24
|
+
S3_BUCKET=lobe
|
25
|
+
S3_PUBLIC_DOMAIN=http://localhost:9000
|
26
|
+
S3_ENABLE_PATH_STYLE=1
|
27
|
+
LLM_VISION_IMAGE_USE_BASE64=1
|
28
|
+
|
29
|
+
# 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE
|
30
|
+
# OPENAI_API_KEY=sk-xxxx
|
31
|
+
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
32
|
+
# OPENAI_MODEL_LIST=...
|
@@ -0,0 +1,86 @@
|
|
1
|
+
services:
|
2
|
+
network-service:
|
3
|
+
image: alpine
|
4
|
+
container_name: lobe-network
|
5
|
+
ports:
|
6
|
+
- '9000:9000' # MinIO API
|
7
|
+
- '9001:9001' # MinIO Console
|
8
|
+
- '8080:8080' # Zitadel Console
|
9
|
+
- '3210:3210' # LobeChat
|
10
|
+
command: tail -f /dev/null
|
11
|
+
networks:
|
12
|
+
- lobe-network
|
13
|
+
|
14
|
+
postgresql:
|
15
|
+
image: pgvector/pgvector:pg16
|
16
|
+
container_name: lobe-postgres
|
17
|
+
ports:
|
18
|
+
- "5432:5432"
|
19
|
+
volumes:
|
20
|
+
- './data:/var/lib/postgresql/data'
|
21
|
+
environment:
|
22
|
+
- 'POSTGRES_DB=lobechat'
|
23
|
+
- 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC'
|
24
|
+
healthcheck:
|
25
|
+
test: ['CMD-SHELL', 'pg_isready -U postgres']
|
26
|
+
interval: 5s
|
27
|
+
timeout: 5s
|
28
|
+
retries: 5
|
29
|
+
restart: always
|
30
|
+
networks:
|
31
|
+
- lobe-network
|
32
|
+
|
33
|
+
minio:
|
34
|
+
image: minio/minio
|
35
|
+
container_name: lobe-minio
|
36
|
+
network_mode: 'service:network-service'
|
37
|
+
volumes:
|
38
|
+
- './s3_data:/etc/minio/data'
|
39
|
+
environment:
|
40
|
+
- 'MINIO_ROOT_USER=YOUR_MINIO_USER'
|
41
|
+
- 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD'
|
42
|
+
- 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:3210'
|
43
|
+
restart: always
|
44
|
+
command: >
|
45
|
+
server /etc/minio/data --address ":9000" --console-address ":9001"
|
46
|
+
|
47
|
+
zitadel:
|
48
|
+
restart: 'always'
|
49
|
+
image: 'ghcr.io/zitadel/zitadel:latest'
|
50
|
+
container_name: lobe-zitadel
|
51
|
+
network_mode: 'service:network-service'
|
52
|
+
command: start-from-init --config /zitadel-config.yaml --steps
|
53
|
+
/zitadel-init-steps.yaml --masterkey "cft3Tekr/rQBOqwoQSCPoncA9BHbn7QJ"
|
54
|
+
--tlsMode disabled #MasterkeyNeedsToHave32Characters
|
55
|
+
volumes:
|
56
|
+
- ./zitadel-config.yaml:/zitadel-config.yaml:ro
|
57
|
+
- ./zitadel-init-steps.yaml:/zitadel-init-steps.yaml:ro
|
58
|
+
depends_on:
|
59
|
+
postgresql:
|
60
|
+
condition: service_healthy
|
61
|
+
|
62
|
+
lobe:
|
63
|
+
image: lobehub/lobe-chat-database
|
64
|
+
container_name: lobe-database
|
65
|
+
network_mode: 'service:network-service'
|
66
|
+
depends_on:
|
67
|
+
postgresql:
|
68
|
+
condition: service_healthy
|
69
|
+
network-service:
|
70
|
+
condition: service_started
|
71
|
+
minio:
|
72
|
+
condition: service_started
|
73
|
+
zitadel:
|
74
|
+
condition: service_started
|
75
|
+
env_file:
|
76
|
+
- .env
|
77
|
+
restart: always
|
78
|
+
|
79
|
+
volumes:
|
80
|
+
data:
|
81
|
+
driver: local
|
82
|
+
s3_data:
|
83
|
+
driver: local
|
84
|
+
networks:
|
85
|
+
lobe-network:
|
86
|
+
driver: bridge
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Log:
|
2
|
+
Level: 'info'
|
3
|
+
|
4
|
+
Port: 8080
|
5
|
+
ExternalPort: 8080
|
6
|
+
ExternalDomain: localhost
|
7
|
+
ExternalSecure: false
|
8
|
+
TLS:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
# If not using the docker compose example, adjust these values for connecting ZITADEL to your PostgreSQL
|
12
|
+
Database:
|
13
|
+
postgres:
|
14
|
+
Host: postgresql
|
15
|
+
Port: 5432
|
16
|
+
Database: zitadel
|
17
|
+
User:
|
18
|
+
Username: 'zitadel'
|
19
|
+
Password: 'zitadel'
|
20
|
+
SSL:
|
21
|
+
Mode: 'disable'
|
22
|
+
Admin:
|
23
|
+
Username: 'postgres'
|
24
|
+
Password: 'uWNZugjBqixf8dxC' #postgres password
|
25
|
+
SSL:
|
26
|
+
Mode: 'disable'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# All possible options and their defaults: https://github.com/zitadel/zitadel/blob/main/cmd/setup/steps.yaml
|
2
|
+
FirstInstance:
|
3
|
+
Org:
|
4
|
+
Human:
|
5
|
+
# use the loginname root@zitadel.localhost
|
6
|
+
Username: 'root'
|
7
|
+
# The password must be 8 characters or more and must contain uppercase letters, lowercase letters, symbols, and numbers. The first login will require a password change.
|
8
|
+
Password: 'Password1!'
|
9
|
+
Email:
|
10
|
+
# Optional, if set, can be used to log in with email.
|
11
|
+
Address: 'example@zitadel.com' # ZITADEL_FIRSTINSTANCE_ORG_HUMAN_EMAIL_ADDRESS
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Required: LobeChat domain for tRPC calls
|
2
|
+
# Ensure this domain is whitelisted in your NextAuth providers and S3 service CORS settings
|
3
|
+
APP_URL=https://lobe.example.com/
|
4
|
+
|
5
|
+
# Postgres related environment variables
|
6
|
+
# Required: Secret key for encrypting sensitive information. Generate with: openssl rand -base64 32
|
7
|
+
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
|
8
|
+
# Required: Postgres database connection string
|
9
|
+
# Format: postgresql://username:password@host:port/dbname
|
10
|
+
# If using Docker, you can use the container name as the host
|
11
|
+
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
|
12
|
+
|
13
|
+
# NEXT_AUTH related environment variables
|
14
|
+
# Required: NextAuth URL for callbacks
|
15
|
+
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
16
|
+
# Required: NextAuth secret key. Generate with: openssl rand -base64 32
|
17
|
+
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
18
|
+
# Required: Specify the authentication provider
|
19
|
+
NEXT_AUTH_SSO_PROVIDERS=zitadel
|
20
|
+
|
21
|
+
# ZiTADEL provider configuration
|
22
|
+
# Please refer to:https://lobehub.com/zh/docs/self-hosting/advanced/auth/next-auth/zitadel
|
23
|
+
AUTH_ZITADEL_ID=285934220675723622
|
24
|
+
AUTH_ZITADEL_SECRET=pe7Nh3lopXkZkfqh5YEDYI2xsbIz08eZKqInOUZxssd3refRia518Apbv3DZ
|
25
|
+
AUTH_ZITADEL_ISSUER=https://zitadel.example.com
|
26
|
+
|
27
|
+
# Proxy settings (if needed, e.g., when using GitHub as an auth provider)
|
28
|
+
# HTTP_PROXY=http://localhost:7890
|
29
|
+
# HTTPS_PROXY=http://localhost:7890
|
30
|
+
|
31
|
+
# S3 related environment variables (example using MinIO)
|
32
|
+
# Required: S3 Access Key ID (for MinIO, invalid until manually created in MinIO UI)
|
33
|
+
S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID
|
34
|
+
# Required: S3 Secret Access Key (for MinIO, invalid until manually created in MinIO UI)
|
35
|
+
S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY
|
36
|
+
# Required: S3 Endpoint for server/client connections to S3 API
|
37
|
+
S3_ENDPOINT=https://lobe-s3-api.example.com
|
38
|
+
# Required: S3 Bucket (invalid until manually created in MinIO UI)
|
39
|
+
S3_BUCKET=lobe
|
40
|
+
# Required: S3 Public Domain for client access to unstructured data
|
41
|
+
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
42
|
+
# Optional: S3 Enable Path Style
|
43
|
+
# Use 0 for mainstream S3 cloud providers; use 1 for self-hosted MinIO
|
44
|
+
# See: https://lobehub.com/docs/self-hosting/advanced/s3#s-3-enable-path-style
|
45
|
+
S3_ENABLE_PATH_STYLE=1
|
46
|
+
|
47
|
+
# Other basic environment variables (as needed)
|
48
|
+
# See: https://lobehub.com/docs/self-hosting/environment-variables/basic
|
49
|
+
# Note: For server versions, the API must support embedding models (OpenAI text-embedding-3-small) for file processing
|
50
|
+
# You don't need to specify this model in OPENAI_MODEL_LIST
|
51
|
+
# OPENAI_API_KEY=sk-xxxx
|
52
|
+
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
53
|
+
# OPENAI_MODEL_LIST=...
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# 必填,LobeChat 域名,用于 tRPC 调用
|
2
|
+
# 请保证此域名在你的 NextAuth 鉴权服务提供商、S3 服务商的 CORS 白名单中
|
3
|
+
APP_URL=https://lobe.example.com/
|
4
|
+
|
5
|
+
# Postgres 相关,也即 DB 必需的环境变量
|
6
|
+
# 必填,用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成
|
7
|
+
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
|
8
|
+
# 必填,Postgres 数据库连接字符串,用于连接到数据库
|
9
|
+
# 格式:postgresql://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器且位于同一 docker-compose 文件中,亦可使用容器名作为 host
|
10
|
+
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
|
11
|
+
|
12
|
+
# NEXT_AUTH 相关,也即鉴权服务必需的环境变量
|
13
|
+
# 必填,NextAuth 的 URL,用于 NextAuth 的回调
|
14
|
+
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
15
|
+
# 必填,用于 NextAuth 的密钥,可以使用 openssl rand -base64 32 生成
|
16
|
+
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
17
|
+
# 必填,指定鉴权服务提供商
|
18
|
+
NEXT_AUTH_SSO_PROVIDERS=zitadel
|
19
|
+
|
20
|
+
# ZiTADEL 鉴权服务提供商部分
|
21
|
+
# 请参考:https://lobehub.com/zh/docs/self-hosting/advanced/auth/next-auth/zitadel
|
22
|
+
AUTH_ZITADEL_ID=285934220675723622
|
23
|
+
AUTH_ZITADEL_SECRET=pe7Nh3lopXkZkfqh5YEDYI2xsbIz08eZKqInOUZxssd3refRia518Apbv3DZ
|
24
|
+
AUTH_ZITADEL_ISSUER=https://zitadel.example.com
|
25
|
+
|
26
|
+
# S3 相关,也即非结构化数据(文件、图片等)存储必需的环境变量
|
27
|
+
# 这里以 MinIO 为例
|
28
|
+
# 必填,S3 的 Access Key ID,对于 MinIO 来说,直到在 MinIO UI 中手动创建之前都是无效的
|
29
|
+
S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID
|
30
|
+
# 必填,S3 的 Secret Access Key,对于 MinIO 来说,直到在 MinIO UI 中手动创建之前都是无效的
|
31
|
+
S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY
|
32
|
+
# 必填,S3 的 Endpoint,用于服务端/客户端连接到 S3 API
|
33
|
+
S3_ENDPOINT=https://lobe-s3-api.example.com
|
34
|
+
# 必填,S3 的 Bucket,直到在 MinIO UI 中手动创建之前都是无效的
|
35
|
+
S3_BUCKET=lobe
|
36
|
+
# 必填,S3 的 Public Domain,用于客户端通过公开连接访问非结构化数据
|
37
|
+
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
38
|
+
# 选填,S3 的 Enable Path Style
|
39
|
+
# 对于主流 S3 Cloud 服务商,一般填 0 即可;对于自部署的 MinIO,请填 1
|
40
|
+
# 请参考:https://lobehub.com/zh/docs/self-hosting/advanced/s3#s-3-enable-path-style
|
41
|
+
S3_ENABLE_PATH_STYLE=1
|
42
|
+
|
43
|
+
# 其他基础环境变量,视需求而定。注意不要有 ACCESS_CODE
|
44
|
+
# 请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/basic
|
45
|
+
# 请注意,对于服务端版本,其 API 必须支持嵌入(即 OpenAI text-embedding-3-small)模型,否则无法对上传文件进行处理,但你无需在 OPENAI_MODEL_LIST 中指定此模型
|
46
|
+
# OPENAI_API_KEY=sk-xxxx
|
47
|
+
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
48
|
+
# OPENAI_MODEL_LIST=...
|
@@ -0,0 +1,69 @@
|
|
1
|
+
services:
|
2
|
+
postgresql:
|
3
|
+
image: pgvector/pgvector:pg16
|
4
|
+
container_name: lobe-postgres
|
5
|
+
ports:
|
6
|
+
- '5432:5432'
|
7
|
+
volumes:
|
8
|
+
- './data:/var/lib/postgresql/data'
|
9
|
+
environment:
|
10
|
+
- 'POSTGRES_DB=lobe'
|
11
|
+
- 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC'
|
12
|
+
healthcheck:
|
13
|
+
test: ['CMD-SHELL', 'pg_isready -U postgres']
|
14
|
+
interval: 5s
|
15
|
+
timeout: 5s
|
16
|
+
retries: 5
|
17
|
+
restart: always
|
18
|
+
|
19
|
+
minio:
|
20
|
+
image: minio/minio
|
21
|
+
container_name: lobe-minio
|
22
|
+
ports:
|
23
|
+
- '9000:9000'
|
24
|
+
- '9001:9001'
|
25
|
+
volumes:
|
26
|
+
- './s3_data:/etc/minio/data'
|
27
|
+
environment:
|
28
|
+
- 'MINIO_ROOT_USER=YOUR_MINIO_USER'
|
29
|
+
- 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD'
|
30
|
+
- 'MINIO_DOMAIN=lobe-s3-api.example.com'
|
31
|
+
- 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' # Your LobeChat's domain name.
|
32
|
+
restart: always
|
33
|
+
command: >
|
34
|
+
server /etc/minio/data --address ":9000" --console-address ":9001"
|
35
|
+
|
36
|
+
zitadel:
|
37
|
+
restart: always
|
38
|
+
image: ghcr.io/zitadel/zitadel:latest
|
39
|
+
container_name: lobe-zitadel
|
40
|
+
command: start-from-init --config /zitadel-config.yaml --steps
|
41
|
+
/zitadel-init-steps.yaml --masterkey "cft3Tekr/rQBOqwoQSCPoncA9BHbn7QJ"
|
42
|
+
--tlsMode external #MasterkeyNeedsToHave32Characters
|
43
|
+
ports:
|
44
|
+
- 8080:8080
|
45
|
+
volumes:
|
46
|
+
- ./zitadel-config.yaml:/zitadel-config.yaml:ro
|
47
|
+
- ./zitadel-init-steps.yaml:/zitadel-init-steps.yaml:ro
|
48
|
+
depends_on:
|
49
|
+
postgresql:
|
50
|
+
condition: service_healthy
|
51
|
+
|
52
|
+
lobe:
|
53
|
+
image: lobehub/lobe-chat-database
|
54
|
+
container_name: lobe-database
|
55
|
+
ports:
|
56
|
+
- '3210:3210'
|
57
|
+
depends_on:
|
58
|
+
- postgresql
|
59
|
+
- minio
|
60
|
+
- zitadel
|
61
|
+
env_file:
|
62
|
+
- .env
|
63
|
+
restart: always
|
64
|
+
|
65
|
+
volumes:
|
66
|
+
data:
|
67
|
+
driver: local
|
68
|
+
s3_data:
|
69
|
+
driver: local
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Log:
|
2
|
+
Level: 'info'
|
3
|
+
|
4
|
+
ExternalPort: 443
|
5
|
+
ExternalDomain: example.com #Your zitadel's domain name
|
6
|
+
ExternalSecure: true
|
7
|
+
TLS:
|
8
|
+
Enabled: false # ZITADEL_TLS_ENABLED
|
9
|
+
|
10
|
+
# If not using the docker compose example, adjust these values for connecting ZITADEL to your PostgreSQL
|
11
|
+
Database:
|
12
|
+
postgres:
|
13
|
+
Host: postgresql
|
14
|
+
Port: 5432
|
15
|
+
Database: zitadel
|
16
|
+
User:
|
17
|
+
Username: 'zitadel'
|
18
|
+
Password: 'zitadel'
|
19
|
+
SSL:
|
20
|
+
Mode: 'disable'
|
21
|
+
Admin:
|
22
|
+
Username: 'postgres'
|
23
|
+
Password: 'uWNZugjBqixf8dxC' #postgres password
|
24
|
+
SSL:
|
25
|
+
Mode: 'disable'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# All possible options and their defaults: https://github.com/zitadel/zitadel/blob/main/cmd/setup/steps.yaml
|
2
|
+
FirstInstance:
|
3
|
+
Org:
|
4
|
+
Human:
|
5
|
+
# use the loginname root@zitadel.localhost, replace localhost with your configured external domain
|
6
|
+
Username: 'root'
|
7
|
+
# The password must be 8 characters or more and must contain uppercase letters, lowercase letters, symbols, and numbers. The first login will require a password change.
|
8
|
+
Password: 'Password1!'
|
9
|
+
Email:
|
10
|
+
# Optional, if set, can be used to log in with email.
|
11
|
+
Address: 'example@zitadel.com' # ZITADEL_FIRSTINSTANCE_ORG_HUMAN_EMAIL_ADDRESS
|
@@ -46,5 +46,6 @@ You can achieve various feature combinations using the above configuration synta
|
|
46
46
|
| `market` | Enables the assistant market functionality. | Enabled |
|
47
47
|
| `speech_to_text` | Enables speech-to-text functionality. | Enabled |
|
48
48
|
| `knowledge_base` | Enables the knowledge base functionality. | Enabled |
|
49
|
+
| `clerk_sign_up` | Enables the Clerk SignUp functionality. | Enabled |
|
49
50
|
|
50
51
|
You can always check the [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) to get the latest list of feature flags.
|
@@ -42,5 +42,6 @@ tags:
|
|
42
42
|
| `market` | 启用助手市场功能。 | 开启 |
|
43
43
|
| `speech_to_text` | 启用语音转文本功能。 | 开启 |
|
44
44
|
| `knowledge_base` | 启用知识库功能。 | 开启 |
|
45
|
+
| `clerk_sign_up` | 启用Clerk注册功能。 | 开启 |
|
45
46
|
|
46
47
|
你可以随时检查 [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) 以获取最新的特性标志列表。
|
@@ -479,4 +479,20 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
|
479
479
|
- Default: -
|
480
480
|
- Example: `xxxxxx...xxxxxx`
|
481
481
|
|
482
|
+
## HUNYUAN
|
483
|
+
|
484
|
+
### `HUNYUAN_API_KEY`
|
485
|
+
|
486
|
+
- Type: Required
|
487
|
+
- Description: This is the API key you applied from HUNYUAN service
|
488
|
+
- Default: -
|
489
|
+
- Example: `xxxxxx...xxxxxx`
|
490
|
+
|
491
|
+
### `HUNYUAN_MODEL_LIST`
|
492
|
+
|
493
|
+
- Type: Optional
|
494
|
+
- Description: Used to control the model list, use `+` to add a model, use `-` to hide a model, use `model_name=display_name` to customize the display name of a model, separated by commas. Definition syntax rules see [model-list][model-list]
|
495
|
+
- Default: `-`
|
496
|
+
- Example: `-all,+hunyuan-lite,+hunyuan-standard`
|
497
|
+
|
482
498
|
[model-list]: /docs/self-hosting/advanced/model-list
|
@@ -477,4 +477,20 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
|
477
477
|
- 默认值:-
|
478
478
|
- 示例:`xxxxxx...xxxxxx`
|
479
479
|
|
480
|
+
## 腾讯混元
|
481
|
+
|
482
|
+
### `HUNYUAN_API_KEY`
|
483
|
+
|
484
|
+
- 类型:必选
|
485
|
+
- 描述:这是你在 腾讯混元 服务中申请的 API 密钥
|
486
|
+
- 默认值:-
|
487
|
+
- 示例:`xxxxxx...xxxxxx`
|
488
|
+
|
489
|
+
### `HUNYUAN_MODEL_LIST`
|
490
|
+
|
491
|
+
- 类型:可选
|
492
|
+
- 描述:用来控制模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名<扩展配置>` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则见 [模型列表][model-list]
|
493
|
+
- 默认值:`-`
|
494
|
+
- 示例:`-all,+hunyuan-lite,+hunyuan-standard`
|
495
|
+
|
480
496
|
[model-list]: /zh/docs/self-hosting/advanced/model-list
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.20.
|
3
|
+
"version": "1.20.4",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -217,7 +217,7 @@
|
|
217
217
|
"systemjs": "^6.15.1",
|
218
218
|
"ts-md5": "^1.3.1",
|
219
219
|
"ua-parser-js": "^1.0.38",
|
220
|
-
"unstructured-client": "^0.
|
220
|
+
"unstructured-client": "^0.18.0",
|
221
221
|
"url-join": "^5.0.0",
|
222
222
|
"use-merge-value": "^1.2.0",
|
223
223
|
"utility-types": "^3.11.0",
|
@@ -3,6 +3,12 @@ import { ChatHeader } from '@lobehub/ui';
|
|
3
3
|
import HeaderAction from './HeaderAction';
|
4
4
|
import Main from './Main';
|
5
5
|
|
6
|
-
const Header = () =>
|
6
|
+
const Header = () => (
|
7
|
+
<ChatHeader
|
8
|
+
left={<Main />}
|
9
|
+
right={<HeaderAction />}
|
10
|
+
style={{ minHeight: 64, position: 'initial', zIndex: 11 }}
|
11
|
+
/>
|
12
|
+
);
|
7
13
|
|
8
14
|
export default Header;
|
@@ -6,7 +6,6 @@ import { rgba } from 'polished';
|
|
6
6
|
import { PropsWithChildren, memo } from 'react';
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
8
8
|
|
9
|
-
import SafeSpacing from '@/components/SafeSpacing';
|
10
9
|
import { CHAT_DOCK_TOOL_UI_WIDTH, CHAT_DOCK_WIDTH, MAX_WIDTH } from '@/const/layoutTokens';
|
11
10
|
import { useChatStore } from '@/store/chat';
|
12
11
|
import { chatPortalSelectors } from '@/store/chat/slices/portal/selectors';
|
@@ -69,7 +68,6 @@ const PortalPanel = memo(({ children }: PropsWithChildren) => {
|
|
69
68
|
minWidth: CHAT_DOCK_WIDTH,
|
70
69
|
}}
|
71
70
|
>
|
72
|
-
<SafeSpacing />
|
73
71
|
<Flexbox className={styles.panel}>{children}</Flexbox>
|
74
72
|
</DraggablePanelContainer>
|
75
73
|
</DraggablePanel>
|
@@ -5,7 +5,6 @@ import { createStyles, useResponsive } from 'antd-style';
|
|
5
5
|
import isEqual from 'fast-deep-equal';
|
6
6
|
import { PropsWithChildren, memo, useEffect, useState } from 'react';
|
7
7
|
|
8
|
-
import SafeSpacing from '@/components/SafeSpacing';
|
9
8
|
import { CHAT_SIDEBAR_WIDTH } from '@/const/layoutTokens';
|
10
9
|
import { useChatStore } from '@/store/chat';
|
11
10
|
import { chatPortalSelectors } from '@/store/chat/slices/portal/selectors';
|
@@ -71,7 +70,6 @@ const TopicPanel = memo(({ children }: PropsWithChildren) => {
|
|
71
70
|
minWidth: CHAT_SIDEBAR_WIDTH,
|
72
71
|
}}
|
73
72
|
>
|
74
|
-
<SafeSpacing />
|
75
73
|
{children}
|
76
74
|
</DraggablePanelContainer>
|
77
75
|
</DraggablePanel>
|
package/src/app/(main)/chat/@session/features/SessionListContent/Modals/ConfigGroupModal/index.tsx
CHANGED
@@ -13,7 +13,7 @@ import { SessionGroupItem } from '@/types/session';
|
|
13
13
|
|
14
14
|
import GroupItem from './GroupItem';
|
15
15
|
|
16
|
-
const useStyles = createStyles(({ css, token
|
16
|
+
const useStyles = createStyles(({ css, token }) => ({
|
17
17
|
container: css`
|
18
18
|
height: 36px;
|
19
19
|
padding-inline: 8px;
|
@@ -21,7 +21,6 @@ const useStyles = createStyles(({ css, token, stylish }) => ({
|
|
21
21
|
transition: background 0.2s ease-in-out;
|
22
22
|
|
23
23
|
&:hover {
|
24
|
-
${stylish.blur};
|
25
24
|
background: ${token.colorFillTertiary};
|
26
25
|
}
|
27
26
|
`,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { asc, cosineDistance, count, eq, inArray, sql } from 'drizzle-orm';
|
2
2
|
import { and, desc, isNull } from 'drizzle-orm/expressions';
|
3
|
+
import { chunk } from 'lodash-es';
|
3
4
|
|
4
5
|
import { serverDB } from '@/database/server';
|
5
6
|
import { ChunkMetadata, FileChunk, SemanticSearchChunk } from '@/types/chunk';
|
@@ -53,7 +54,15 @@ export class ChunkModel {
|
|
53
54
|
const ids = orphanedChunks.map((chunk) => chunk.chunkId);
|
54
55
|
if (ids.length === 0) return;
|
55
56
|
|
56
|
-
|
57
|
+
const list = chunk(ids, 500);
|
58
|
+
|
59
|
+
await serverDB.transaction(async (trx) => {
|
60
|
+
await Promise.all(
|
61
|
+
list.map(async (chunkIds) => {
|
62
|
+
await trx.delete(chunks).where(inArray(chunks.id, chunkIds));
|
63
|
+
}),
|
64
|
+
);
|
65
|
+
});
|
57
66
|
};
|
58
67
|
|
59
68
|
findById = async (id: string) => {
|
@@ -43,10 +43,9 @@ const VirtualizedList = memo<VirtualizedListProps>(({ mobile }) => {
|
|
43
43
|
|
44
44
|
const data = useChatStore((s) => {
|
45
45
|
const showInboxWelcome = chatSelectors.showInboxWelcome(s);
|
46
|
-
|
46
|
+
return showInboxWelcome
|
47
47
|
? [WELCOME_GUIDE_CHAT_ID]
|
48
48
|
: chatSelectors.currentChatIDsWithGuideMessage(s);
|
49
|
-
return ['empty', ...ids];
|
50
49
|
}, isEqual);
|
51
50
|
|
52
51
|
useEffect(() => {
|
@@ -71,11 +70,7 @@ const VirtualizedList = memo<VirtualizedListProps>(({ mobile }) => {
|
|
71
70
|
(index: number, id: string) => {
|
72
71
|
if (id === WELCOME_GUIDE_CHAT_ID) return <InboxWelcome />;
|
73
72
|
|
74
|
-
return
|
75
|
-
<div style={{ height: 24 + (mobile ? 0 : 64) }} />
|
76
|
-
) : (
|
77
|
-
<Item id={id} index={index - 1} />
|
78
|
-
);
|
73
|
+
return <Item id={id} index={index} />;
|
79
74
|
},
|
80
75
|
[mobile],
|
81
76
|
);
|