@lobehub/chat 1.19.25 → 1.19.27
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 +59 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docker-compose/local/.env.example +17 -15
- package/docker-compose/local/.env.zh-CN.example +19 -16
- package/docker-compose/local/docker-compose.yml +17 -16
- package/docker-compose/local/init_data.json.tar.gz +0 -0
- package/docker-compose/local/s3_data.tar.gz +0 -0
- package/docker-compose/local/setup.sh +242 -0
- package/docker-compose/local-logto/.env.example +33 -0
- package/docker-compose/local-logto/.env.zh-CN.example +33 -0
- package/docker-compose/local-logto/docker-compose.yml +102 -0
- package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +5 -6
- package/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx +4 -5
- package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/github.mdx +3 -3
- package/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +3 -3
- package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +4 -4
- package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +5 -5
- package/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx +5 -5
- package/docs/self-hosting/server-database/docker-compose.mdx +2 -2
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +2 -2
- package/locales/ar/chat.json +2 -2
- package/locales/bg-BG/chat.json +2 -2
- package/locales/de-DE/chat.json +2 -2
- package/locales/en-US/chat.json +2 -2
- package/locales/es-ES/chat.json +2 -2
- package/locales/fr-FR/chat.json +2 -2
- package/locales/it-IT/chat.json +2 -2
- package/locales/ja-JP/chat.json +2 -2
- package/locales/ko-KR/chat.json +2 -2
- package/locales/nl-NL/chat.json +2 -2
- package/locales/pl-PL/chat.json +2 -2
- package/locales/pt-BR/chat.json +2 -2
- package/locales/ru-RU/chat.json +2 -2
- package/locales/tr-TR/chat.json +2 -2
- package/locales/vi-VN/chat.json +2 -2
- package/locales/zh-CN/chat.json +2 -2
- package/locales/zh-TW/chat.json +2 -2
- package/package.json +1 -1
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +2 -2
- package/src/components/GalleyGrid/index.tsx +11 -8
- package/src/config/modelProviders/ai360.ts +2 -1
- package/src/layout/GlobalProvider/StoreInitialization.tsx +12 -8
- package/src/libs/agent-runtime/ai360/index.ts +8 -0
- package/src/locales/default/chat.ts +2 -2
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,65 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.19.27](https://github.com/lobehub/lobe-chat/compare/v1.19.26...v1.19.27)
|
6
|
+
|
7
|
+
<sup>Released on **2024-09-24**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Improve images display in chat messages.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Improve images display in chat messages, closes [#3475](https://github.com/lobehub/lobe-chat/issues/3475) ([c54c7ed](https://github.com/lobehub/lobe-chat/commit/c54c7ed))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.19.26](https://github.com/lobehub/lobe-chat/compare/v1.19.25...v1.19.26)
|
31
|
+
|
32
|
+
<sup>Released on **2024-09-24**</sup>
|
33
|
+
|
34
|
+
#### 🐛 Bug Fixes
|
35
|
+
|
36
|
+
- **misc**: Fix url config import after user state init.
|
37
|
+
|
38
|
+
#### 💄 Styles
|
39
|
+
|
40
|
+
- **misc**: Add support function call for 360AI, left sidebar has only assistants.
|
41
|
+
|
42
|
+
<br/>
|
43
|
+
|
44
|
+
<details>
|
45
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
46
|
+
|
47
|
+
#### What's fixed
|
48
|
+
|
49
|
+
- **misc**: Fix url config import after user state init, closes [#4072](https://github.com/lobehub/lobe-chat/issues/4072) ([18a240c](https://github.com/lobehub/lobe-chat/commit/18a240c))
|
50
|
+
|
51
|
+
#### Styles
|
52
|
+
|
53
|
+
- **misc**: Add support function call for 360AI, closes [#4099](https://github.com/lobehub/lobe-chat/issues/4099) ([536696b](https://github.com/lobehub/lobe-chat/commit/536696b))
|
54
|
+
- **misc**: Left sidebar has only assistants, closes [#4108](https://github.com/lobehub/lobe-chat/issues/4108) ([db1f81c](https://github.com/lobehub/lobe-chat/commit/db1f81c))
|
55
|
+
|
56
|
+
</details>
|
57
|
+
|
58
|
+
<div align="right">
|
59
|
+
|
60
|
+
[](#readme-top)
|
61
|
+
|
62
|
+
</div>
|
63
|
+
|
5
64
|
### [Version 1.19.25](https://github.com/lobehub/lobe-chat/compare/v1.19.24...v1.19.25)
|
6
65
|
|
7
66
|
<sup>Released on **2024-09-24**</sup>
|
package/README.md
CHANGED
@@ -285,14 +285,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
285
285
|
|
286
286
|
<!-- AGENT LIST -->
|
287
287
|
|
288
|
-
| Recent Submits | Description
|
289
|
-
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
290
|
-
| [
|
291
|
-
| [
|
292
|
-
| [
|
293
|
-
| [
|
294
|
-
|
295
|
-
> 📊 Total agents: [<kbd>**
|
288
|
+
| Recent Submits | Description |
|
289
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
290
|
+
| [Contract Clause Refiner v1.0](https://chat-preview.lobehub.com/market?agent=business-contract)<br/><sup>By **[houhoufm](https://github.com/houhoufm)** on **2024-09-24**</sup> | Output: {Optimize contract clauses for professional and concise expression}<br/>`contract-optimization` `legal-consultation` `copywriting` `terminology` `project-management` |
|
291
|
+
| [Meeting Assistant v1.0](https://chat-preview.lobehub.com/market?agent=meeting)<br/><sup>By **[houhoufm](https://github.com/houhoufm)** on **2024-09-24**</sup> | Professional meeting report assistant, distilling meeting key points into report sentences<br/>`meeting-reports` `writing` `communication` `workflow` `professional-skills` |
|
292
|
+
| [Stable Album Cover Prompter](https://chat-preview.lobehub.com/market?agent=title-bpm-stimmung)<br/><sup>By **[MellowTrixX](https://github.com/MellowTrixX)** on **2024-09-24**</sup> | Professional graphic designer for front cover design specializing in creating visual concepts and designs for melodic techno music albums.<br/>`album-cover` `prompt` `stable-diffusion` `cover-design` `cover-prompts` |
|
293
|
+
| [Advertising Copywriting Master](https://chat-preview.lobehub.com/market?agent=advertising-copywriting-master)<br/><sup>By **[leter](https://github.com/leter)** on **2024-09-23**</sup> | Specializing in product function analysis and advertising copywriting that resonates with user values<br/>`advertising-copy` `user-values` `marketing-strategy` |
|
294
|
+
|
295
|
+
> 📊 Total agents: [<kbd>**392**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
296
296
|
|
297
297
|
<!-- AGENT LIST -->
|
298
298
|
|
package/README.zh-CN.md
CHANGED
@@ -273,14 +273,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
273
273
|
|
274
274
|
<!-- AGENT LIST -->
|
275
275
|
|
276
|
-
| 最近新增
|
277
|
-
|
|
278
|
-
| [
|
279
|
-
| [
|
280
|
-
| [
|
281
|
-
| [
|
282
|
-
|
283
|
-
> 📊 Total agents: [<kbd>**
|
276
|
+
| 最近新增 | 助手说明 |
|
277
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
278
|
+
| [合同条款精炼师 v1.0](https://chat-preview.lobehub.com/market?agent=business-contract)<br/><sup>By **[houhoufm](https://github.com/houhoufm)** on **2024-09-24**</sup> | 输出: {优化合同条款,专业简洁表达}<br/>`合同优化` `法律咨询` `文案撰写` `专业术语` `项目管理` |
|
279
|
+
| [会议助手 v1.0](https://chat-preview.lobehub.com/market?agent=meeting)<br/><sup>By **[houhoufm](https://github.com/houhoufm)** on **2024-09-24**</sup> | 专业会议汇报助手,提炼会议要点成汇报句子<br/>`会议汇报` `撰写` `沟通` `工作流程` `专业技能` |
|
280
|
+
| [稳定专辑封面提示生成器](https://chat-preview.lobehub.com/market?agent=title-bpm-stimmung)<br/><sup>By **[MellowTrixX](https://github.com/MellowTrixX)** on **2024-09-24**</sup> | 专业的平面设计师,专注于为旋律科技音乐专辑创建视觉概念和设计。<br/>`专辑封面` `提示` `稳定扩散` `封面设计` `封面提示` |
|
281
|
+
| [广告文案创作大师](https://chat-preview.lobehub.com/market?agent=advertising-copywriting-master)<br/><sup>By **[leter](https://github.com/leter)** on **2024-09-23**</sup> | 擅长产品功能分析与用户价值观广告文案创作<br/>`广告文案` `用户价值观` `营销策略` |
|
282
|
+
|
283
|
+
> 📊 Total agents: [<kbd>**392**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
284
284
|
|
285
285
|
<!-- AGENT LIST -->
|
286
286
|
|
@@ -1,16 +1,3 @@
|
|
1
|
-
# Logto secret
|
2
|
-
LOGTO_CLIENT_ID=
|
3
|
-
LOGTO_CLIENT_SECRET=
|
4
|
-
|
5
|
-
# MinIO S3 configuration
|
6
|
-
MINIO_ROOT_USER=YOUR_MINIO_USER
|
7
|
-
MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD
|
8
|
-
|
9
|
-
# Configure the bucket information of MinIO
|
10
|
-
MINIO_LOBE_BUCKET=lobe
|
11
|
-
S3_ACCESS_KEY_ID=
|
12
|
-
S3_SECRET_ACCESS_KEY=
|
13
|
-
|
14
1
|
# Proxy, if you need it
|
15
2
|
# HTTP_PROXY=http://localhost:7890
|
16
3
|
# HTTPS_PROXY=http://localhost:7890
|
@@ -22,12 +9,27 @@ S3_SECRET_ACCESS_KEY=
|
|
22
9
|
# OPENAI_MODEL_LIST=...
|
23
10
|
|
24
11
|
|
25
|
-
#
|
12
|
+
# ===========================
|
13
|
+
# ====== Preset config ======
|
14
|
+
# ===========================
|
26
15
|
# if no special requirements, no need to change
|
27
16
|
LOBE_PORT=3210
|
28
|
-
|
17
|
+
CASDOOR_PORT=8000
|
29
18
|
MINIO_PORT=9000
|
30
19
|
|
31
20
|
# Postgres related, which are the necessary environment variables for DB
|
32
21
|
LOBE_DB_NAME=lobechat
|
33
22
|
POSTGRES_PASSWORD=uWNZugjBqixf8dxC
|
23
|
+
|
24
|
+
# Casdoor secret
|
25
|
+
AUTH_CASDOOR_ID=a387a4892ee19b1a2249
|
26
|
+
AUTH_CASDOOR_SECRET=dbf205949d704de81b0b5b3603174e23fbecc354
|
27
|
+
|
28
|
+
# MinIO S3 configuration
|
29
|
+
MINIO_ROOT_USER=YOUR_MINIO_USER
|
30
|
+
MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD
|
31
|
+
|
32
|
+
# Configure the bucket information of MinIO
|
33
|
+
MINIO_LOBE_BUCKET=lobe
|
34
|
+
S3_ACCESS_KEY_ID=soaucnP8Bip0TDdUjxng
|
35
|
+
S3_SECRET_ACCESS_KEY=ZPUzvY34umfcfxvWKSv0P00vczVMB6YmgJS5J9eO
|
@@ -1,33 +1,36 @@
|
|
1
|
-
# Logto secret
|
2
|
-
LOGTO_CLIENT_ID=
|
3
|
-
LOGTO_CLIENT_SECRET=
|
4
|
-
|
5
|
-
# MinIO S3 配置
|
6
|
-
MINIO_ROOT_USER=YOUR_MINIO_USER
|
7
|
-
MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD
|
8
|
-
|
9
|
-
# 在下方配置 minio 中添加的桶
|
10
|
-
MINIO_LOBE_BUCKET=lobe
|
11
|
-
S3_ACCESS_KEY_ID=
|
12
|
-
S3_SECRET_ACCESS_KEY=
|
13
|
-
|
14
|
-
|
15
1
|
# Proxy,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
|
16
2
|
# HTTP_PROXY=http://localhost:7890
|
17
3
|
# HTTPS_PROXY=http://localhost:7890
|
18
4
|
|
5
|
+
|
19
6
|
# 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE
|
20
7
|
# OPENAI_API_KEY=sk-xxxx
|
21
8
|
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
22
9
|
# OPENAI_MODEL_LIST=...
|
23
10
|
|
24
11
|
|
25
|
-
#
|
12
|
+
# ===================
|
13
|
+
# ===== 预设配置 =====
|
14
|
+
# ===================
|
26
15
|
# 如没有特殊需要不用更改
|
27
16
|
LOBE_PORT=3210
|
28
|
-
|
17
|
+
CASDOOR_PORT=8000
|
29
18
|
MINIO_PORT=9000
|
30
19
|
|
31
20
|
# Postgres 相关,也即 DB 必须的环境变量
|
32
21
|
LOBE_DB_NAME=lobechat
|
33
22
|
POSTGRES_PASSWORD=uWNZugjBqixf8dxC
|
23
|
+
|
24
|
+
# Casdoor secret
|
25
|
+
AUTH_CASDOOR_ID=a387a4892ee19b1a2249
|
26
|
+
AUTH_CASDOOR_SECRET=dbf205949d704de81b0b5b3603174e23fbecc354
|
27
|
+
|
28
|
+
# MinIO S3 配置
|
29
|
+
MINIO_ROOT_USER=YOUR_MINIO_USER
|
30
|
+
MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD
|
31
|
+
|
32
|
+
# 在下方配置 minio 中添加的桶
|
33
|
+
MINIO_LOBE_BUCKET=lobe
|
34
|
+
S3_ACCESS_KEY_ID=soaucnP8Bip0TDdUjxng
|
35
|
+
S3_SECRET_ACCESS_KEY=ZPUzvY34umfcfxvWKSv0P00vczVMB6YmgJS5J9eO
|
36
|
+
|
@@ -5,8 +5,7 @@ services:
|
|
5
5
|
ports:
|
6
6
|
- '${MINIO_PORT}:${MINIO_PORT}' # MinIO API
|
7
7
|
- '9001:9001' # MinIO Console
|
8
|
-
- '${
|
9
|
-
- '3002:3002' # Logto Admin
|
8
|
+
- '${CASDOOR_PORT}:${CASDOOR_PORT}' # Casdoor
|
10
9
|
- '${LOBE_PORT}:3210' # LobeChat
|
11
10
|
command: tail -f /dev/null
|
12
11
|
networks:
|
@@ -45,21 +44,22 @@ services:
|
|
45
44
|
command: >
|
46
45
|
server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
|
47
46
|
|
48
|
-
|
49
|
-
image:
|
50
|
-
container_name: lobe-
|
47
|
+
casdoor:
|
48
|
+
image: casbin/casdoor
|
49
|
+
container_name: lobe-casdoor
|
50
|
+
entrypoint: /bin/sh -c './server --createDatabase=true'
|
51
51
|
network_mode: 'service:network-service'
|
52
52
|
depends_on:
|
53
53
|
postgresql:
|
54
54
|
condition: service_healthy
|
55
55
|
environment:
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
56
|
+
RUNNING_IN_DOCKER: "true"
|
57
|
+
driverName: "postgres"
|
58
|
+
dataSourceName: "user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor"
|
59
|
+
origin: "http://localhost:${CASDOOR_PORT}"
|
60
|
+
runmode: "dev"
|
61
|
+
volumes:
|
62
|
+
- ./init_data.json:/init_data.json
|
63
63
|
|
64
64
|
lobe:
|
65
65
|
image: lobehub/lobe-chat-database
|
@@ -72,21 +72,22 @@ services:
|
|
72
72
|
condition: service_started
|
73
73
|
minio:
|
74
74
|
condition: service_started
|
75
|
-
|
75
|
+
casdoor:
|
76
76
|
condition: service_started
|
77
77
|
|
78
78
|
environment:
|
79
79
|
- 'APP_URL=http://localhost:3210'
|
80
|
-
- 'NEXT_AUTH_SSO_PROVIDERS=
|
80
|
+
- 'NEXT_AUTH_SSO_PROVIDERS=casdoor'
|
81
81
|
- 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
|
82
82
|
- 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
|
83
|
-
- '
|
84
|
-
- '
|
83
|
+
- 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth'
|
84
|
+
- 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}'
|
85
85
|
- 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}'
|
86
86
|
- 'S3_ENDPOINT=http://localhost:${MINIO_PORT}'
|
87
87
|
- 'S3_BUCKET=${MINIO_LOBE_BUCKET}'
|
88
88
|
- 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}'
|
89
89
|
- 'S3_ENABLE_PATH_STYLE=1'
|
90
|
+
- 'LLM_VISION_IMAGE_USE_BASE64=1'
|
90
91
|
env_file:
|
91
92
|
- .env
|
92
93
|
restart: always
|
Binary file
|
Binary file
|
@@ -0,0 +1,242 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# ==================
|
4
|
+
# == Env settings ==
|
5
|
+
# ==================
|
6
|
+
|
7
|
+
# ======================
|
8
|
+
# == Process the args ==
|
9
|
+
# ======================
|
10
|
+
|
11
|
+
# 1. Default values of arguments
|
12
|
+
# Arg: -f
|
13
|
+
# Determine force download asserts, default is not
|
14
|
+
FORCE_DOWNLOAD=false
|
15
|
+
|
16
|
+
# Arg: -l or --lang
|
17
|
+
# Determine the language to show, default is en
|
18
|
+
LANGUAGE="en_US"
|
19
|
+
|
20
|
+
# Arg: --url
|
21
|
+
# Determine the source URL to download files
|
22
|
+
SOURCE_URL="https://raw.githubusercontent.com/lobehub/lobe-chat/main"
|
23
|
+
|
24
|
+
# 2. Parse script arguments
|
25
|
+
while getopts "fl:-:" opt; do
|
26
|
+
case $opt in
|
27
|
+
f)
|
28
|
+
FORCE_DOWNLOAD=true
|
29
|
+
;;
|
30
|
+
l)
|
31
|
+
LANGUAGE=$OPTARG
|
32
|
+
;;
|
33
|
+
-)
|
34
|
+
case "${OPTARG}" in
|
35
|
+
lang)
|
36
|
+
LANGUAGE="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 ))
|
37
|
+
;;
|
38
|
+
url)
|
39
|
+
SOURCE_URL="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 ))
|
40
|
+
;;
|
41
|
+
*)
|
42
|
+
echo "Usage: $0 [-f] [-l language|--lang language] [--url source]" >&2
|
43
|
+
exit 1
|
44
|
+
;;
|
45
|
+
esac
|
46
|
+
;;
|
47
|
+
*)
|
48
|
+
echo "Usage: $0 [-f] [-l language|--lang language] [--url source]" >&2
|
49
|
+
exit 1
|
50
|
+
;;
|
51
|
+
esac
|
52
|
+
done
|
53
|
+
|
54
|
+
|
55
|
+
# ===============
|
56
|
+
# == Variables ==
|
57
|
+
# ===============
|
58
|
+
# File list
|
59
|
+
SUB_DIR="docker-compose/local"
|
60
|
+
FILES=(
|
61
|
+
"$SUB_DIR/docker-compose.yml"
|
62
|
+
"$SUB_DIR/.env.example"
|
63
|
+
"$SUB_DIR/init_data.json.tar.gz"
|
64
|
+
"$SUB_DIR/s3_data.tar.gz"
|
65
|
+
)
|
66
|
+
|
67
|
+
# Supported languages and messages
|
68
|
+
# Arg: -l --lang
|
69
|
+
# If the language is not supported, default to English
|
70
|
+
# Function to show messages
|
71
|
+
show_message() {
|
72
|
+
local key="$1"
|
73
|
+
case $key in
|
74
|
+
downloading)
|
75
|
+
case $LANGUAGE in
|
76
|
+
zh_CN)
|
77
|
+
echo "正在下载文件..."
|
78
|
+
;;
|
79
|
+
*)
|
80
|
+
echo "Downloading files..."
|
81
|
+
;;
|
82
|
+
esac
|
83
|
+
;;
|
84
|
+
downloaded)
|
85
|
+
case $LANGUAGE in
|
86
|
+
zh_CN)
|
87
|
+
echo " 已经存在,跳过下载。"
|
88
|
+
;;
|
89
|
+
*)
|
90
|
+
echo " already exists, skipping download."
|
91
|
+
;;
|
92
|
+
esac
|
93
|
+
;;
|
94
|
+
extracted_success)
|
95
|
+
case $LANGUAGE in
|
96
|
+
zh_CN)
|
97
|
+
echo " 解压成功到目录:"
|
98
|
+
;;
|
99
|
+
*)
|
100
|
+
echo " extracted successfully to directory: "
|
101
|
+
;;
|
102
|
+
esac
|
103
|
+
;;
|
104
|
+
extracted_failed)
|
105
|
+
case $LANGUAGE in
|
106
|
+
zh_CN)
|
107
|
+
echo " 解压失败。"
|
108
|
+
;;
|
109
|
+
*)
|
110
|
+
echo " extraction failed."
|
111
|
+
;;
|
112
|
+
esac
|
113
|
+
;;
|
114
|
+
file_not_exists)
|
115
|
+
case $LANGUAGE in
|
116
|
+
zh_CN)
|
117
|
+
echo " 不存在。"
|
118
|
+
;;
|
119
|
+
*)
|
120
|
+
echo " does not exist."
|
121
|
+
;;
|
122
|
+
esac
|
123
|
+
;;
|
124
|
+
tips_run_command)
|
125
|
+
case $LANGUAGE in
|
126
|
+
zh_CN)
|
127
|
+
echo "您已经完成了所有配置文件的下载。请运行以下命令启动LobeChat:"
|
128
|
+
;;
|
129
|
+
*)
|
130
|
+
echo "You have completed downloading all configuration files. Please run this command to start LobeChat:"
|
131
|
+
;;
|
132
|
+
esac
|
133
|
+
;;
|
134
|
+
tips_show_documentation)
|
135
|
+
case $LANGUAGE in
|
136
|
+
zh_CN)
|
137
|
+
echo "完整的环境变量在'.env'中可以在文档中找到:"
|
138
|
+
;;
|
139
|
+
*)
|
140
|
+
echo "Full environment variables in the '.env' can be found at the documentation on "
|
141
|
+
;;
|
142
|
+
esac
|
143
|
+
;;
|
144
|
+
tips_show_documentation_url)
|
145
|
+
case $LANGUAGE in
|
146
|
+
zh_CN)
|
147
|
+
echo "https://lobehub.com/zh/docs/self-hosting/environment-variables"
|
148
|
+
;;
|
149
|
+
*)
|
150
|
+
echo "https://lobehub.com/docs/self-hosting/environment-variables"
|
151
|
+
;;
|
152
|
+
esac
|
153
|
+
;;
|
154
|
+
tips_warning)
|
155
|
+
case $LANGUAGE in
|
156
|
+
zh_CN)
|
157
|
+
echo "警告:不要在生产环境中使用此演示应用程序!!!"
|
158
|
+
;;
|
159
|
+
*)
|
160
|
+
echo "Warning: do not use this demo application in production!!!"
|
161
|
+
;;
|
162
|
+
esac
|
163
|
+
;;
|
164
|
+
esac
|
165
|
+
}
|
166
|
+
|
167
|
+
# Function to download files
|
168
|
+
download_file() {
|
169
|
+
local file_url="$1"
|
170
|
+
local local_file="$2"
|
171
|
+
|
172
|
+
if [ "$FORCE_DOWNLOAD" = false ] && [ -e "$local_file" ]; then
|
173
|
+
echo "$local_file" $(show_message "downloaded")
|
174
|
+
return 0
|
175
|
+
fi
|
176
|
+
|
177
|
+
wget -q --show-progress "$file_url" -O "$local_file"
|
178
|
+
}
|
179
|
+
|
180
|
+
extract_file() {
|
181
|
+
local file_name=$1
|
182
|
+
local target_dir=$2
|
183
|
+
|
184
|
+
if [ -e "$file_name" ]; then
|
185
|
+
tar -zxvf "$file_name" -C "$target_dir" > /dev/null 2>&1
|
186
|
+
if [ $? -eq 0 ]; then
|
187
|
+
echo "$file_name" $(show_message "extracted_success") "$target_dir"
|
188
|
+
else
|
189
|
+
echo "$file_name" $(show_message "extracted_failed")
|
190
|
+
exit 1
|
191
|
+
fi
|
192
|
+
else
|
193
|
+
echo "$file_name" $(show_message "file_not_exists")
|
194
|
+
exit 1
|
195
|
+
fi
|
196
|
+
}
|
197
|
+
|
198
|
+
# Define colors
|
199
|
+
declare -A colors
|
200
|
+
colors=(
|
201
|
+
[black]="\e[30m"
|
202
|
+
[red]="\e[31m"
|
203
|
+
[green]="\e[32m"
|
204
|
+
[yellow]="\e[33m"
|
205
|
+
[blue]="\e[34m"
|
206
|
+
[magenta]="\e[35m"
|
207
|
+
[cyan]="\e[36m"
|
208
|
+
[white]="\e[37m"
|
209
|
+
[reset]="\e[0m"
|
210
|
+
)
|
211
|
+
|
212
|
+
print_centered() {
|
213
|
+
local text="$1" # Get input texts
|
214
|
+
local color="${2:-reset}" # Get color, default to reset
|
215
|
+
local term_width=$(tput cols) # Get terminal width
|
216
|
+
local text_length=${#text} # Get text length
|
217
|
+
local padding=$(( (term_width - text_length) / 2 )) # Get padding
|
218
|
+
# Check if the color is valid
|
219
|
+
if [[ -z "${colors[$color]}" ]]; then
|
220
|
+
echo "Invalid color specified. Available colors: ${!colors[@]}"
|
221
|
+
return 1
|
222
|
+
fi
|
223
|
+
# Print the text with padding
|
224
|
+
printf "%*s${colors[$color]}%s${colors[reset]}\n" $padding "" "$text"
|
225
|
+
}
|
226
|
+
|
227
|
+
# Download files asynchronously
|
228
|
+
download_file "$SOURCE_URL/${FILES[0]}" "docker-compose.yml"
|
229
|
+
download_file "$SOURCE_URL/${FILES[1]}" ".env"
|
230
|
+
download_file "$SOURCE_URL/${FILES[2]}" "init_data.json.tar.gz"
|
231
|
+
download_file "$SOURCE_URL/${FILES[3]}" "s3_data.tar.gz"
|
232
|
+
|
233
|
+
# Extract .tar.gz file without output
|
234
|
+
extract_file "s3_data.tar.gz" "."
|
235
|
+
extract_file "init_data.json.tar.gz" "."
|
236
|
+
|
237
|
+
# Display final message
|
238
|
+
printf "\n%s\n\n" "$(show_message "tips_run_command")"
|
239
|
+
print_centered "docker compose up -d" "green"
|
240
|
+
printf "\n%s" "$(show_message "tips_show_documentation")"
|
241
|
+
printf "%s\n" $(show_message "tips_show_documentation_url")
|
242
|
+
printf "\n\e[33m%s\e[0m\n" "$(show_message "tips_warning")"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Logto secret
|
2
|
+
LOGTO_CLIENT_ID=
|
3
|
+
LOGTO_CLIENT_SECRET=
|
4
|
+
|
5
|
+
# MinIO S3 configuration
|
6
|
+
MINIO_ROOT_USER=YOUR_MINIO_USER
|
7
|
+
MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD
|
8
|
+
|
9
|
+
# Configure the bucket information of MinIO
|
10
|
+
MINIO_LOBE_BUCKET=lobe
|
11
|
+
S3_ACCESS_KEY_ID=
|
12
|
+
S3_SECRET_ACCESS_KEY=
|
13
|
+
|
14
|
+
# Proxy, if you need it
|
15
|
+
# HTTP_PROXY=http://localhost:7890
|
16
|
+
# HTTPS_PROXY=http://localhost:7890
|
17
|
+
|
18
|
+
|
19
|
+
# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
|
20
|
+
# OPENAI_API_KEY=sk-xxxx
|
21
|
+
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
22
|
+
# OPENAI_MODEL_LIST=...
|
23
|
+
|
24
|
+
|
25
|
+
# ----- Other config -----
|
26
|
+
# if no special requirements, no need to change
|
27
|
+
LOBE_PORT=3210
|
28
|
+
LOGTO_PORT=3001
|
29
|
+
MINIO_PORT=9000
|
30
|
+
|
31
|
+
# Postgres related, which are the necessary environment variables for DB
|
32
|
+
LOBE_DB_NAME=lobechat
|
33
|
+
POSTGRES_PASSWORD=uWNZugjBqixf8dxC
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Logto secret
|
2
|
+
LOGTO_CLIENT_ID=
|
3
|
+
LOGTO_CLIENT_SECRET=
|
4
|
+
|
5
|
+
# MinIO S3 配置
|
6
|
+
MINIO_ROOT_USER=YOUR_MINIO_USER
|
7
|
+
MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD
|
8
|
+
|
9
|
+
# 在下方配置 minio 中添加的桶
|
10
|
+
MINIO_LOBE_BUCKET=lobe
|
11
|
+
S3_ACCESS_KEY_ID=
|
12
|
+
S3_SECRET_ACCESS_KEY=
|
13
|
+
|
14
|
+
|
15
|
+
# Proxy,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
|
16
|
+
# HTTP_PROXY=http://localhost:7890
|
17
|
+
# HTTPS_PROXY=http://localhost:7890
|
18
|
+
|
19
|
+
# 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE
|
20
|
+
# OPENAI_API_KEY=sk-xxxx
|
21
|
+
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
22
|
+
# OPENAI_MODEL_LIST=...
|
23
|
+
|
24
|
+
|
25
|
+
# ----- 相关配置 start -----
|
26
|
+
# 如没有特殊需要不用更改
|
27
|
+
LOBE_PORT=3210
|
28
|
+
LOGTO_PORT=3001
|
29
|
+
MINIO_PORT=9000
|
30
|
+
|
31
|
+
# Postgres 相关,也即 DB 必须的环境变量
|
32
|
+
LOBE_DB_NAME=lobechat
|
33
|
+
POSTGRES_PASSWORD=uWNZugjBqixf8dxC
|