@lobehub/chat 1.14.2 → 1.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/docker-compose/.env.example +35 -0
- package/docker-compose/.env.zh-CN.example +35 -0
- package/docker-compose/docker-compose.yml +70 -0
- package/docker-compose/minio-bucket.config.json +34 -0
- package/docs/self-hosting/server-database/docker-compose.mdx +465 -7
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +456 -4
- package/docs/self-hosting/server-database/docker.mdx +20 -0
- package/docs/self-hosting/server-database/docker.zh-CN.mdx +27 -4
- package/docs/usage/features/pwa.zh-CN.mdx +1 -1
- package/package.json +1 -1
- package/src/database/server/models/asyncTask.ts +4 -4
- package/src/server/routers/async/caller.ts +2 -0
- package/src/server/routers/async/file.ts +72 -46
- package/src/server/services/chunk/index.ts +32 -3
- package/src/types/asyncTask.ts +23 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.14.3](https://github.com/lobehub/lobe-chat/compare/v1.14.2...v1.14.3)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-08-27**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Improve aysnc error type.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Improve aysnc error type, closes [#3638](https://github.com/lobehub/lobe-chat/issues/3638) ([dbae456](https://github.com/lobehub/lobe-chat/commit/dbae456))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 1.14.2](https://github.com/lobehub/lobe-chat/compare/v1.14.1...v1.14.2)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-08-27**</sup>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# LobeChat domain
|
|
2
|
+
APP_URL=https://lobe.example.com/
|
|
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=https://lobe-auth-api.example.com/api/auth
|
|
16
|
+
LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
|
|
17
|
+
LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
|
|
18
|
+
LOGTO_ISSUER=https://lobe-auth-api.example.com/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=https://lobe-s3-api.example.com
|
|
28
|
+
S3_BUCKET=lobe # Invalid until manually created in MinIO UI
|
|
29
|
+
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
|
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://lobe.example.com/
|
|
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 实例为 Docker 容器,请使用容器名
|
|
9
|
+
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql: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=https://lobe-auth-api.example.com/api/auth
|
|
16
|
+
LOGTO_CLIENT_ID=buc2lpttyo6evdtrfqsur
|
|
17
|
+
LOGTO_CLIENT_SECRET=d97eztx8Ej6aUafeToMAL4jugAKGTAH4
|
|
18
|
+
LOGTO_ISSUER=https://lobe-auth-api.example.com/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=https://lobe-s3-api.example.com
|
|
28
|
+
S3_BUCKET=lobe # 直到在 MinIO UI 中手动创建之前都是无效的
|
|
29
|
+
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
|
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,70 @@
|
|
|
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
|
+
|
|
37
|
+
logto:
|
|
38
|
+
image: svhd/logto
|
|
39
|
+
container_name: lobe-logto
|
|
40
|
+
ports:
|
|
41
|
+
- '3001:3001'
|
|
42
|
+
- '3002:3002'
|
|
43
|
+
depends_on:
|
|
44
|
+
postgresql:
|
|
45
|
+
condition: service_healthy
|
|
46
|
+
environment:
|
|
47
|
+
- 'TRUST_PROXY_HEADER=1'
|
|
48
|
+
- 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/logto'
|
|
49
|
+
- 'ENDPOINT=https://lobe-auth-api.example.com'
|
|
50
|
+
- 'ADMIN_ENDPOINT=https://lobe-auth-ui.example.com'
|
|
51
|
+
entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
|
|
52
|
+
|
|
53
|
+
lobe:
|
|
54
|
+
image: lobehub/lobe-chat-database
|
|
55
|
+
container_name: lobe-database
|
|
56
|
+
ports:
|
|
57
|
+
- '3210:3210'
|
|
58
|
+
depends_on:
|
|
59
|
+
- postgresql
|
|
60
|
+
- minio
|
|
61
|
+
- logto
|
|
62
|
+
env_file:
|
|
63
|
+
- .env
|
|
64
|
+
restart: always
|
|
65
|
+
|
|
66
|
+
volumes:
|
|
67
|
+
data:
|
|
68
|
+
driver: local
|
|
69
|
+
s3_data:
|
|
70
|
+
driver: local
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Statement": [
|
|
3
|
+
{
|
|
4
|
+
"Effect": "Allow",
|
|
5
|
+
"Principal": {
|
|
6
|
+
"AWS": ["*"]
|
|
7
|
+
},
|
|
8
|
+
"Action": ["s3:GetBucketLocation"],
|
|
9
|
+
"Resource": ["arn:aws:s3:::lobe"]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"Effect": "Allow",
|
|
13
|
+
"Principal": {
|
|
14
|
+
"AWS": ["*"]
|
|
15
|
+
},
|
|
16
|
+
"Action": ["s3:ListBucket"],
|
|
17
|
+
"Resource": ["arn:aws:s3:::lobe"],
|
|
18
|
+
"Condition": {
|
|
19
|
+
"StringEquals": {
|
|
20
|
+
"s3:prefix": ["files/*"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"Effect": "Allow",
|
|
26
|
+
"Principal": {
|
|
27
|
+
"AWS": ["*"]
|
|
28
|
+
},
|
|
29
|
+
"Action": ["s3:PutObject", "s3:DeleteObject", "s3:GetObject"],
|
|
30
|
+
"Resource": ["arn:aws:s3:::lobe/files/**"]
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"Version": "2012-10-17"
|
|
34
|
+
}
|