@lobehub/chat 1.19.25 → 1.19.26

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 (51) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/docker-compose/local/.env.example +17 -15
  3. package/docker-compose/local/.env.zh-CN.example +19 -16
  4. package/docker-compose/local/docker-compose.yml +17 -16
  5. package/docker-compose/local/init_data.json.tar.gz +0 -0
  6. package/docker-compose/local/s3_data.tar.gz +0 -0
  7. package/docker-compose/local/setup.sh +242 -0
  8. package/docker-compose/local-logto/.env.example +33 -0
  9. package/docker-compose/local-logto/.env.zh-CN.example +33 -0
  10. package/docker-compose/local-logto/docker-compose.yml +102 -0
  11. package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +5 -6
  12. package/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx +4 -5
  13. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +4 -4
  14. package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +4 -4
  15. package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +4 -4
  16. package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +4 -4
  17. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +4 -4
  18. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +1 -1
  19. package/docs/self-hosting/advanced/auth/next-auth/github.mdx +3 -3
  20. package/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +3 -3
  21. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +4 -4
  22. package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +4 -4
  23. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +4 -4
  24. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +4 -4
  25. package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +5 -5
  26. package/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx +5 -5
  27. package/docs/self-hosting/server-database/docker-compose.mdx +2 -2
  28. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +2 -2
  29. package/locales/ar/chat.json +2 -2
  30. package/locales/bg-BG/chat.json +2 -2
  31. package/locales/de-DE/chat.json +2 -2
  32. package/locales/en-US/chat.json +2 -2
  33. package/locales/es-ES/chat.json +2 -2
  34. package/locales/fr-FR/chat.json +2 -2
  35. package/locales/it-IT/chat.json +2 -2
  36. package/locales/ja-JP/chat.json +2 -2
  37. package/locales/ko-KR/chat.json +2 -2
  38. package/locales/nl-NL/chat.json +2 -2
  39. package/locales/pl-PL/chat.json +2 -2
  40. package/locales/pt-BR/chat.json +2 -2
  41. package/locales/ru-RU/chat.json +2 -2
  42. package/locales/tr-TR/chat.json +2 -2
  43. package/locales/vi-VN/chat.json +2 -2
  44. package/locales/zh-CN/chat.json +2 -2
  45. package/locales/zh-TW/chat.json +2 -2
  46. package/package.json +1 -1
  47. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +2 -2
  48. package/src/config/modelProviders/ai360.ts +2 -1
  49. package/src/layout/GlobalProvider/StoreInitialization.tsx +12 -8
  50. package/src/libs/agent-runtime/ai360/index.ts +8 -0
  51. package/src/locales/default/chat.ts +2 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.19.26](https://github.com/lobehub/lobe-chat/compare/v1.19.25...v1.19.26)
6
+
7
+ <sup>Released on **2024-09-24**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix url config import after user state init.
12
+
13
+ #### 💄 Styles
14
+
15
+ - **misc**: Add support function call for 360AI, left sidebar has only assistants.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### What's fixed
23
+
24
+ - **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))
25
+
26
+ #### Styles
27
+
28
+ - **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))
29
+ - **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))
30
+
31
+ </details>
32
+
33
+ <div align="right">
34
+
35
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
36
+
37
+ </div>
38
+
5
39
  ### [Version 1.19.25](https://github.com/lobehub/lobe-chat/compare/v1.19.24...v1.19.25)
6
40
 
7
41
  <sup>Released on **2024-09-24**</sup>
@@ -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
- # ----- Other config -----
12
+ # ===========================
13
+ # ====== Preset config ======
14
+ # ===========================
26
15
  # if no special requirements, no need to change
27
16
  LOBE_PORT=3210
28
- LOGTO_PORT=3001
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
- # ----- 相关配置 start -----
12
+ # ===================
13
+ # ===== 预设配置 =====
14
+ # ===================
26
15
  # 如没有特殊需要不用更改
27
16
  LOBE_PORT=3210
28
- LOGTO_PORT=3001
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
- - '${LOGTO_PORT}:${LOGTO_PORT}' # Logto
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
- logto:
49
- image: svhd/logto
50
- container_name: lobe-logto
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
- - 'TRUST_PROXY_HEADER=1'
57
- - 'PORT=${LOGTO_PORT}'
58
- - 'DB_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/logto'
59
- - 'ENDPOINT=http://localhost:${LOGTO_PORT}'
60
- - 'ADMIN_ENDPOINT=http://localhost:3002'
61
- entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
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
- logto:
75
+ casdoor:
76
76
  condition: service_started
77
77
 
78
78
  environment:
79
79
  - 'APP_URL=http://localhost:3210'
80
- - 'NEXT_AUTH_SSO_PROVIDERS=logto'
80
+ - 'NEXT_AUTH_SSO_PROVIDERS=casdoor'
81
81
  - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
82
82
  - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
83
- - 'NEXTAUTH_URL=http://localhost:${LOBE_PORT}/api/auth'
84
- - 'LOGTO_ISSUER=http://localhost:${LOGTO_PORT}/oidc'
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
@@ -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
@@ -0,0 +1,102 @@
1
+ services:
2
+ network-service:
3
+ image: alpine
4
+ container_name: lobe-network
5
+ ports:
6
+ - '${MINIO_PORT}:${MINIO_PORT}' # MinIO API
7
+ - '9001:9001' # MinIO Console
8
+ - '${LOGTO_PORT}:${LOGTO_PORT}' # Logto
9
+ - '3002:3002' # Logto Admin
10
+ - '${LOBE_PORT}:3210' # LobeChat
11
+ command: tail -f /dev/null
12
+ networks:
13
+ - lobe-network
14
+
15
+ postgresql:
16
+ image: pgvector/pgvector:pg16
17
+ container_name: lobe-postgres
18
+ ports:
19
+ - "5432:5432"
20
+ volumes:
21
+ - './data:/var/lib/postgresql/data'
22
+ environment:
23
+ - 'POSTGRES_DB=${LOBE_DB_NAME}'
24
+ - 'POSTGRES_PASSWORD=${POSTGRES_PASSWORD}'
25
+ healthcheck:
26
+ test: ['CMD-SHELL', 'pg_isready -U postgres']
27
+ interval: 5s
28
+ timeout: 5s
29
+ retries: 5
30
+ restart: always
31
+ networks:
32
+ - lobe-network
33
+
34
+ minio:
35
+ image: minio/minio
36
+ container_name: lobe-minio
37
+ network_mode: 'service:network-service'
38
+ volumes:
39
+ - './s3_data:/etc/minio/data'
40
+ environment:
41
+ - 'MINIO_ROOT_USER=${MINIO_ROOT_USER}'
42
+ - 'MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}'
43
+ - 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:${LOBE_PORT}'
44
+ restart: always
45
+ command: >
46
+ server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
47
+
48
+ logto:
49
+ image: svhd/logto
50
+ container_name: lobe-logto
51
+ network_mode: 'service:network-service'
52
+ depends_on:
53
+ postgresql:
54
+ condition: service_healthy
55
+ environment:
56
+ - 'TRUST_PROXY_HEADER=1'
57
+ - 'PORT=${LOGTO_PORT}'
58
+ - 'DB_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/logto'
59
+ - 'ENDPOINT=http://localhost:${LOGTO_PORT}'
60
+ - 'ADMIN_ENDPOINT=http://localhost:3002'
61
+ entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
62
+
63
+
64
+ lobe:
65
+ image: lobehub/lobe-chat-database
66
+ container_name: lobe-database
67
+ network_mode: 'service:network-service'
68
+ depends_on:
69
+ postgresql:
70
+ condition: service_healthy
71
+ network-service:
72
+ condition: service_started
73
+ minio:
74
+ condition: service_started
75
+ logto:
76
+ condition: service_started
77
+
78
+ environment:
79
+ - 'APP_URL=http://localhost:3210'
80
+ - 'NEXT_AUTH_SSO_PROVIDERS=logto'
81
+ - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
82
+ - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
83
+ - 'NEXTAUTH_URL=http://localhost:${LOBE_PORT}/api/auth'
84
+ - 'LOGTO_ISSUER=http://localhost:${LOGTO_PORT}/oidc'
85
+ - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}'
86
+ - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}'
87
+ - 'S3_BUCKET=${MINIO_LOBE_BUCKET}'
88
+ - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}'
89
+ - 'S3_ENABLE_PATH_STYLE=1'
90
+ env_file:
91
+ - .env
92
+ restart: always
93
+
94
+ volumes:
95
+ data:
96
+ driver: local
97
+ s3_data:
98
+ driver: local
99
+
100
+ networks:
101
+ lobe-network:
102
+ driver: bridge
@@ -77,12 +77,11 @@ When deploying LobeChat, you need to configure the following environment variabl
77
77
  | Environment Variable | Type | Description |
78
78
  | --- | --- | --- |
79
79
  | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` |
80
- | `NEXT_AUTH_SSO_PROVIDERS` | Optional | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. |
81
- | `AUTH0_CLIENT_ID` | Required | Client ID of the Auth0 application |
82
- | `AUTH0_CLIENT_SECRET` | Required | Client Secret of the Auth0 application |
83
- | `AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` |
84
- | `ACCESS_CODE` | Required | Add a password to access this service. You can set a sufficiently long random password to "disable" access code authorization. |
85
- | `NEXTAUTH_URL` | Optional | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
80
+ | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. |
81
+ | `AUTH_AUTH0_ID` | Required | Client ID of the Auth0 application |
82
+ | `AUTH_AUTH0_SECRET` | Required | Client Secret of the Auth0 application |
83
+ | `AUTH_AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` |
84
+ | `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
86
85
 
87
86
  <Callout type={'tip'}>
88
87
  You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variable#auth0).
@@ -73,11 +73,10 @@ http(s)://your-domain/api/auth/callback/auth0
73
73
  | --- | --- | --- |
74
74
  | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
75
75
  | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 |
76
- | `AUTH0_CLIENT_ID` | 必选 | Auth0 应用程序的 Client ID |
77
- | `AUTH0_CLIENT_SECRET` | 必选 | Auth0 应用程序的 Client Secret |
78
- | `AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain,`https://example.auth0.com` |
79
- | `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
80
- | `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
76
+ | `AUTH_AUTH0_ID` | 必选 | Auth0 应用程序的 Client ID |
77
+ | `AUTH_AUTH0_SECRET` | 必选 | Auth0 应用程序的 Client Secret |
78
+ | `AUTH_AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain,`https://example.auth0.com` |
79
+ | `NEXTAUTH_URL` | 必选 | URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
81
80
 
82
81
  <Callout type={'tip'}>
83
82
  前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#auth-0) 可查阅相关变量详情。
@@ -59,10 +59,10 @@ When deploying LobeChat, you need to configure the following environment variabl
59
59
  | --- | --- | --- |
60
60
  | `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` |
61
61
  | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. |
62
- | `AUTHELIA_CLIENT_ID` | Required | The id just configured in Authelia, example value is lobe-chat |
63
- | `AUTHELIA_CLIENT_SECRET` | The plaintext corresponding to the secret just configured in Authelia, example value is insecure_secret |
64
- | `AUTHELIA_ISSUER` | Required | Your Authelia URL, for example https://sso.example.com |
65
- | `NEXTAUTH_URL` | Optional | This URL is used to specify the callback address for Auth.js when performing OAuth verification. It only needs to be set when the default generated redirect address is incorrect. https://chat.example.com/api/auth |
62
+ | `AUTH_AUTHELIA_ID` | Required | The id just configured in Authelia, example value is lobe-chat |
63
+ | `AUTH_AUTHELIA_SECRET` | Required | The plaintext corresponding to the secret just configured in Authelia, example value is insecure_secret |
64
+ | `AUTH_AUTHELIA_ISSUER` | Required | Your Authelia URL, for example https://sso.example.com |
65
+ | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth verification. It only needs to be set when the default generated redirect address is incorrect. https://chat.example.com/api/auth |
66
66
 
67
67
  <Callout type={'tip'}>
68
68
  Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authelia) for details about the variables.