@lobehub/chat 1.14.4 → 1.14.6
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/docker-compose/local/.env.example +35 -0
- package/docker-compose/local/.env.zh-CN.example +35 -0
- package/docker-compose/local/docker-compose.yml +64 -0
- package/docker-compose/{.env.example → production/.env.example} +4 -4
- package/docker-compose/{.env.zh-CN.example → production/.env.zh-CN.example} +5 -5
- package/docs/self-hosting/server-database/docker-compose.mdx +136 -10
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +135 -10
- package/package.json +1 -1
- package/src/config/modelProviders/google.ts +29 -1
- package/src/libs/next-auth/sso-providers/cloudflare-zero-trust.ts +1 -1
- /package/docker-compose/{docker-compose.yml → production/docker-compose.yml} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.14.6](https://github.com/lobehub/lobe-chat/compare/v1.14.5...v1.14.6)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-08-28**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Update Gemini models.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Update Gemini models, closes [#3653](https://github.com/lobehub/lobe-chat/issues/3653) ([b61ca4c](https://github.com/lobehub/lobe-chat/commit/b61ca4c))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 1.14.5](https://github.com/lobehub/lobe-chat/compare/v1.14.4...v1.14.5)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-08-28**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: No user name if Cloudflare Zero Trust with onetimepin.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: No user name if Cloudflare Zero Trust with onetimepin, closes [#3649](https://github.com/lobehub/lobe-chat/issues/3649) ([5bfee5a](https://github.com/lobehub/lobe-chat/commit/5bfee5a))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 1.14.4](https://github.com/lobehub/lobe-chat/compare/v1.14.3...v1.14.4)
|
|
6
56
|
|
|
7
57
|
<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=
|
|
17
|
-
LOGTO_CLIENT_SECRET=
|
|
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=
|
|
17
|
-
LOGTO_CLIENT_SECRET=
|
|
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
|
-
###
|
|
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=
|
|
369
|
-
LOGTO_CLIENT_SECRET=
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
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=
|
|
364
|
-
LOGTO_CLIENT_SECRET=
|
|
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
|
-
|
|
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' #
|
|
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
|
-
|
|
584
|
+
#### `minio-bucket-config.json`
|
|
460
585
|
|
|
461
586
|
```json
|
|
462
587
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.6",
|
|
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",
|
|
@@ -23,6 +23,25 @@ const Google: ModelProviderCard = {
|
|
|
23
23
|
tokens: 1_048_576 + 8192,
|
|
24
24
|
vision: true,
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
description: 'Fast and versatile multimodal model for scaling across diverse tasks',
|
|
28
|
+
displayName: 'Gemini 1.5 Flash Experimental 0827',
|
|
29
|
+
enabled: true,
|
|
30
|
+
functionCall: true,
|
|
31
|
+
id: 'gemini-1.5-flash-exp-0827',
|
|
32
|
+
maxOutput: 8192,
|
|
33
|
+
tokens: 1_048_576 + 8192,
|
|
34
|
+
vision: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
description: 'Fast and versatile multimodal model for scaling across diverse tasks',
|
|
38
|
+
displayName: 'Gemini 1.5 Flash 8B Experimental 0827',
|
|
39
|
+
functionCall: true,
|
|
40
|
+
id: 'gemini-1.5-flash-8b-exp-0827',
|
|
41
|
+
maxOutput: 8192,
|
|
42
|
+
tokens: 1_048_576 + 8192,
|
|
43
|
+
vision: true,
|
|
44
|
+
},
|
|
26
45
|
{
|
|
27
46
|
description: 'Mid-size multimodal model that supports up to 2 million tokens',
|
|
28
47
|
displayName: 'Gemini 1.5 Pro',
|
|
@@ -45,13 +64,22 @@ const Google: ModelProviderCard = {
|
|
|
45
64
|
{
|
|
46
65
|
description: 'Mid-size multimodal model that supports up to 2 million tokens',
|
|
47
66
|
displayName: 'Gemini 1.5 Pro Experimental 0801',
|
|
48
|
-
enabled: true,
|
|
49
67
|
functionCall: true,
|
|
50
68
|
id: 'gemini-1.5-pro-exp-0801',
|
|
51
69
|
maxOutput: 8192,
|
|
52
70
|
tokens: 2_097_152 + 8192,
|
|
53
71
|
vision: true,
|
|
54
72
|
},
|
|
73
|
+
{
|
|
74
|
+
description: 'Mid-size multimodal model that supports up to 2 million tokens',
|
|
75
|
+
displayName: 'Gemini 1.5 Pro Experimental 0827',
|
|
76
|
+
enabled: true,
|
|
77
|
+
functionCall: true,
|
|
78
|
+
id: 'gemini-1.5-pro-exp-0827',
|
|
79
|
+
maxOutput: 8192,
|
|
80
|
+
tokens: 2_097_152 + 8192,
|
|
81
|
+
vision: true,
|
|
82
|
+
},
|
|
55
83
|
{
|
|
56
84
|
description:
|
|
57
85
|
'The best model for scaling across a wide range of tasks. This is the latest model.',
|
|
File without changes
|