@lobehub/chat 1.50.1 → 1.50.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.
@@ -0,0 +1,660 @@
1
+ #!/bin/bash
2
+
3
+ # ==================
4
+ # == Env settings ==
5
+ # ==================
6
+
7
+ # check operating system
8
+ # ref: https://github.com/lobehub/lobe-chat/pull/5247
9
+ if [[ "$OSTYPE" == "darwin"* ]]; then
10
+ # macOS
11
+ SED_COMMAND="sed -i ''"
12
+ else
13
+ # not macOS
14
+ SED_COMMAND="sed -i"
15
+ fi
16
+
17
+ # ======================
18
+ # == Process the args ==
19
+ # ======================
20
+
21
+ # 1. Default values of arguments
22
+
23
+ # Arg: -l or --lang
24
+ # Determine the language to show, default is en
25
+
26
+ # Arg: --url
27
+ # Determine the source URL to download files
28
+ SOURCE_URL="https://raw.githubusercontent.com/lobehub/lobe-chat/main"
29
+
30
+ # Arg: --host
31
+ # Determine the server host
32
+ HOST=""
33
+
34
+ # 2. Parse script arguments
35
+ while getopts "l:-:" opt; do
36
+ case $opt in
37
+ l)
38
+ LANGUAGE=$OPTARG
39
+ ;;
40
+ -)
41
+ case "${OPTARG}" in
42
+ lang)
43
+ LANGUAGE="${!OPTIND}"
44
+ OPTIND=$(($OPTIND + 1))
45
+ ;;
46
+ url)
47
+ SOURCE_URL="${!OPTIND}"
48
+ OPTIND=$(($OPTIND + 1))
49
+ ;;
50
+ host)
51
+ HOST="${!OPTIND}"
52
+ OPTIND=$(($OPTIND + 1))
53
+ ;;
54
+ *)
55
+ echo "Usage: $0 [-l language|--lang language] [--url source] [--host serverhost]" >&2
56
+ exit 1
57
+ ;;
58
+ esac
59
+ ;;
60
+ *)
61
+ echo "Usage: $0 [-l language|--lang language] [--url source]" >&2
62
+ exit 1
63
+ ;;
64
+ esac
65
+ done
66
+
67
+ #######################
68
+ ## Helper Functions ##
69
+ #######################
70
+
71
+ # Supported languages and messages
72
+ # Arg: -l --lang
73
+ # If the language is not supported, default to English
74
+ # Function to show messages
75
+ show_message() {
76
+ local key="$1"
77
+ case $key in
78
+ choose_language)
79
+ echo "Please choose a language / 请选择语言:"
80
+ echo "(0) English"
81
+ echo "(1) 简体中文"
82
+ ;;
83
+ downloading)
84
+ case $LANGUAGE in
85
+ zh_CN)
86
+ echo "正在下载文件..."
87
+ ;;
88
+ *)
89
+ echo "Downloading files..."
90
+ ;;
91
+ esac
92
+ ;;
93
+ extracted_success)
94
+ case $LANGUAGE in
95
+ zh_CN)
96
+ echo " 解压成功到目录:"
97
+ ;;
98
+ *)
99
+ echo " extracted successfully to directory: "
100
+ ;;
101
+ esac
102
+ ;;
103
+ extracted_failed)
104
+ case $LANGUAGE in
105
+ zh_CN)
106
+ echo " 解压失败。"
107
+ ;;
108
+ *)
109
+ echo " extraction failed."
110
+ ;;
111
+ esac
112
+ ;;
113
+ file_not_exists)
114
+ case $LANGUAGE in
115
+ zh_CN)
116
+ echo " 不存在。"
117
+ ;;
118
+ *)
119
+ echo " does not exist."
120
+ ;;
121
+ esac
122
+ ;;
123
+ security_secrect_regenerate)
124
+ case $LANGUAGE in
125
+ zh_CN)
126
+ echo "重新生成安全密钥..."
127
+ ;;
128
+ *)
129
+ echo "Regenerate security secrets..."
130
+ ;;
131
+ esac
132
+ ;;
133
+ security_secrect_regenerate_failed)
134
+ case $LANGUAGE in
135
+ zh_CN)
136
+ echo "无法重新生成安全密钥:"
137
+ ;;
138
+ *)
139
+ echo "Failed to regenerate security secrets: "
140
+ ;;
141
+ esac
142
+ ;;
143
+ host_regenerate)
144
+ case $LANGUAGE in
145
+ zh_CN)
146
+ echo "✔️ 已更新部署模式配置"
147
+ ;;
148
+ *)
149
+ echo "✔️ Updated deployment mode configuration"
150
+ ;;
151
+ esac
152
+ ;;
153
+ host_regenerate_failed)
154
+ case $LANGUAGE in
155
+ zh_CN)
156
+ echo "无法重新生成服务器域名:"
157
+ ;;
158
+ *)
159
+ echo "Failed to regenerate server host: "
160
+ ;;
161
+ esac
162
+ ;;
163
+ security_secrect_regenerate_report)
164
+ case $LANGUAGE in
165
+ zh_CN)
166
+ echo "安全密钥生成结果如下:"
167
+ ;;
168
+ *)
169
+ echo "Security secret generation results are as follows:"
170
+ ;;
171
+ esac
172
+ ;;
173
+ tips_already_installed)
174
+ case $LANGUAGE in
175
+ zh_CN)
176
+ echo "检测到您已经运行过 LobeChat Database,本安装程序只能完成初始化配置,并不能重复安装。如果你需要重新安装,请删除 data 和 s3_data 文件夹。"
177
+ ;;
178
+ *)
179
+ echo "It is detected that you have run LobeChat Database. This installation program can only complete the initialization configuration and cannot be reinstalled. If you need to reinstall, please delete the data and s3_data folders."
180
+ ;;
181
+ esac
182
+ ;;
183
+ tips_run_command)
184
+ case $LANGUAGE in
185
+ zh_CN)
186
+ echo "您已经完成了所有配置。请运行以下命令启动LobeChat:"
187
+ ;;
188
+ *)
189
+ echo "You have completed all configurations. Please run this command to start LobeChat:"
190
+ ;;
191
+ esac
192
+ ;;
193
+ tips_show_documentation)
194
+ case $LANGUAGE in
195
+ zh_CN)
196
+ echo "完整的环境变量在'.env'中可以在文档中找到:"
197
+ ;;
198
+ *)
199
+ echo "Full environment variables in the '.env' can be found at the documentation on "
200
+ ;;
201
+ esac
202
+ ;;
203
+ tips_show_documentation_url)
204
+ case $LANGUAGE in
205
+ zh_CN)
206
+ echo "https://lobehub.com/zh/docs/self-hosting/environment-variables"
207
+ ;;
208
+ *)
209
+ echo "https://lobehub.com/docs/self-hosting/environment-variables"
210
+ ;;
211
+ esac
212
+ ;;
213
+ tips_no_executable)
214
+ case $LANGUAGE in
215
+ zh_CN)
216
+ echo "没有找到,请先安装。"
217
+ ;;
218
+ *)
219
+ echo "not found, please install it first."
220
+ ;;
221
+ esac
222
+ ;;
223
+ tips_allow_ports)
224
+ case $LANGUAGE in
225
+ zh_CN)
226
+ echo "请确保服务器以下端口未被占用且能被访问:3210, 9000, 9001, 8000"
227
+ ;;
228
+ *)
229
+ echo "Please make sure the following ports on the server are not occupied and can be accessed: 3210, 9000, 9001, 8000"
230
+ ;;
231
+ esac
232
+ ;;
233
+ tips_auto_detected)
234
+ case $LANGUAGE in
235
+ zh_CN)
236
+ echo "已自动识别"
237
+ ;;
238
+ *)
239
+ echo "Auto-detected"
240
+ ;;
241
+ esac
242
+ ;;
243
+ tips_private_ip_detected)
244
+ case $LANGUAGE in
245
+ zh_CN)
246
+ echo "注意,当前识别到内网 IP,如果需要外部访问,请替换为公网 IP 地址"
247
+ ;;
248
+ *)
249
+ echo "Note that the current internal IP is detected. If you need external access, please replace it with the public IP address."
250
+ ;;
251
+ esac
252
+ ;;
253
+ tips_add_reverse_proxy)
254
+ case $LANGUAGE in
255
+ zh_CN)
256
+ echo "请在你的反向代理中完成域名到端口的映射:"
257
+ ;;
258
+ *)
259
+ echo "Please complete the mapping of domain to port in your reverse proxy:"
260
+ ;;
261
+ esac
262
+ ;;
263
+ ask_regenerate_secrets)
264
+ case $LANGUAGE in
265
+ zh_CN)
266
+ echo "是否要重新生成安全密钥?"
267
+ ;;
268
+ *)
269
+ echo "Do you want to regenerate security secrets?"
270
+ ;;
271
+ esac
272
+ ;;
273
+ ask_deploy_mode)
274
+ case $LANGUAGE in
275
+ zh_CN)
276
+ echo "请选择部署模式:"
277
+ echo "(0) 域名模式(访问时无需指明端口),需要使用反向代理服务 LobeChat, MinIO, Casdoor ,并分别分配一个域名;"
278
+ echo "(1) 端口模式(访问时需要指明端口,如使用IP访问,或域名+端口访问),需要放开指定端口;"
279
+ echo "(2) 本地模式(仅供本地测试使用)"
280
+ echo "如果你对这些内容疑惑,可以先选择使用本地模式进行部署,稍后根据文档指引再进行修改。"
281
+ echo "https://lobehub.com/docs/self-hosting/server-database/docker-compose"
282
+ ;;
283
+ *)
284
+ echo "Please select the deployment mode:"
285
+ echo "(0) Domain mode (no need to specify the port when accessing), you need to use the reverse proxy service LobeChat, MinIO, Casdoor, and assign a domain name respectively;"
286
+ echo "(1) Port mode (need to specify the port when accessing, such as using IP access, or domain name + port access), you need to open the specified port;"
287
+ echo "(2) Local mode (for local testing only)"
288
+ echo "If you are confused about these contents, you can choose to deploy in local mode first, and then modify according to the document guide later."
289
+ echo "https://lobehub.com/docs/self-hosting/server-database/docker-compose"
290
+ ;;
291
+ esac
292
+ ;;
293
+ ask_host)
294
+ case $LANGUAGE in
295
+ zh_CN)
296
+ echo " 部署IP/域名"
297
+ ;;
298
+ *)
299
+ echo " Deploy IP/Domain"
300
+ ;;
301
+ esac
302
+ ;;
303
+ ask_domain)
304
+ case $LANGUAGE in
305
+ zh_CN)
306
+ echo "服务的域名(例如 $2 ,不要包含协议前缀):"
307
+ ;;
308
+ *)
309
+ echo "The domain of the service (e.g. $2, do not include the protocol prefix):"
310
+ ;;
311
+ esac
312
+ ;;
313
+ ask_protocol)
314
+ case $LANGUAGE in
315
+ zh_CN)
316
+ echo "域名是否使用 https 协议? (所有服务需要使用同一协议)"
317
+ ;;
318
+ *)
319
+ echo "Does the domain use the https protocol? (All services need to use the same protocol)"
320
+ ;;
321
+ esac
322
+ ;;
323
+ esac
324
+ }
325
+
326
+ # Function to download files
327
+ download_file() {
328
+ wget -q --show-progress "$1" -O "$2"
329
+ }
330
+
331
+ print_centered() {
332
+ # Define colors
333
+ declare -A colors
334
+ colors=(
335
+ [black]="\e[30m"
336
+ [red]="\e[31m"
337
+ [green]="\e[32m"
338
+ [yellow]="\e[33m"
339
+ [blue]="\e[34m"
340
+ [magenta]="\e[35m"
341
+ [cyan]="\e[36m"
342
+ [white]="\e[37m"
343
+ [reset]="\e[0m"
344
+ )
345
+ local text="$1" # Get input texts
346
+ local color="${2:-reset}" # Get color, default to reset
347
+ local term_width=$(tput cols) # Get terminal width
348
+ local text_length=${#text} # Get text length
349
+ local padding=$(((term_width - text_length) / 2)) # Get padding
350
+ # Check if the color is valid
351
+ if [[ -z "${colors[$color]}" ]]; then
352
+ echo "Invalid color specified. Available colors: ${!colors[@]}"
353
+ return 1
354
+ fi
355
+ # Print the text with padding
356
+ printf "%*s${colors[$color]}%s${colors[reset]}\n" $padding "" "$text"
357
+ }
358
+
359
+ # Usage:
360
+ # ```sh
361
+ # ask "prompt" "default" "description"
362
+ # echo $ask_result
363
+ # ```
364
+ # "prompt" ["description" "default"]:
365
+ ask() {
366
+ local prompt="$1"
367
+ local default="$2"
368
+ local description="$3"
369
+ # Add a space after the description if it is not empty
370
+ if [ -n "$description" ]; then
371
+ description="$description "
372
+ fi
373
+ local result
374
+
375
+ if [ -n "$default" ]; then
376
+ read -p "$prompt [${description}${default}]: " result
377
+ result=${result:-$default}
378
+ else
379
+ read -p "$prompt: " result
380
+ fi
381
+ # trim and assign to global variable
382
+ ask_result=$(echo "$result" | xargs)
383
+ }
384
+
385
+ ####################
386
+ ## Main Process ##
387
+ ####################
388
+
389
+ # ===============
390
+ # == Variables ==
391
+ # ===============
392
+ # File list
393
+ SUB_DIR="docker-compose/local"
394
+ FILES=(
395
+ "$SUB_DIR/docker-compose.yml"
396
+ "$SUB_DIR/init_data.json"
397
+ )
398
+ ENV_EXAMPLES=(
399
+ "$SUB_DIR/.env.zh-CN.example"
400
+ "$SUB_DIR/.env.example"
401
+ )
402
+ # Default values
403
+ CASDOOR_PASSWORD="123"
404
+ CASDOOR_SECRET="CASDOOR_SECRET"
405
+ MINIO_ROOT_PASSWORD="YOUR_MINIO_PASSWORD"
406
+ CASDOOR_HOST="localhost:8000"
407
+ MINIO_HOST="localhost:9000"
408
+ PROTOCOL="http"
409
+
410
+ # If no language is specified, ask the user to choose
411
+ if [ -z "$LANGUAGE" ]; then
412
+ show_message "choose_language"
413
+ ask "(0,1)" "0"
414
+ case $ask_result in
415
+ 0)
416
+ LANGUAGE="en_US"
417
+ ;;
418
+ 1)
419
+ LANGUAGE="zh_CN"
420
+ ;;
421
+ *)
422
+ echo "Invalid language: $ask_result"
423
+ exit 1
424
+ ;;
425
+ esac
426
+ fi
427
+
428
+ section_download_files(){
429
+ # Download files asynchronously
430
+ if ! command -v wget &> /dev/null ; then
431
+ echo "wget" $(show_message "tips_no_executable")
432
+ exit 1
433
+ fi
434
+
435
+ download_file "$SOURCE_URL/${FILES[0]}" "docker-compose.yml"
436
+ download_file "$SOURCE_URL/${FILES[1]}" "init_data.json"
437
+
438
+ # Download .env.example with the specified language
439
+ if [ "$LANGUAGE" = "zh_CN" ]; then
440
+ download_file "$SOURCE_URL/${ENV_EXAMPLES[0]}" ".env"
441
+ else
442
+ download_file "$SOURCE_URL/${ENV_EXAMPLES[1]}" ".env"
443
+ fi
444
+ }
445
+ # If the folder `data` or `s3_data` exists, warn the user
446
+ if [ -d "data" ] || [ -d "s3_data" ]; then
447
+ show_message "tips_already_installed"
448
+ exit 0
449
+ else
450
+ section_download_files
451
+ fi
452
+
453
+ section_configurate_host() {
454
+ DEPLOY_MODE=$ask_result
455
+ show_message "host_regenerate"
456
+ # If run in local mode, skip this step
457
+ if [[ "$DEPLOY_MODE" == "2" ]]; then
458
+ HOST="localhost:3210"
459
+ LOBE_HOST="$HOST"
460
+ return 0
461
+ fi
462
+
463
+ # Configurate protocol for domain
464
+ if [[ "$DEPLOY_MODE" == "0" ]]; then
465
+ # Ask if enable https
466
+ echo $(show_message "ask_protocol")
467
+ ask "(y/n)" "y"
468
+ if [[ "$ask_result" == "y" ]]; then
469
+ PROTOCOL="https"
470
+ # Replace all http with https
471
+ $SED_COMMAND "s#http://#https://#" .env
472
+ fi
473
+ fi
474
+
475
+ # Check if sed is installed
476
+ if ! command -v $SED_COMMAND &> /dev/null ; then
477
+ echo "sed" $(show_message "tips_no_executable")
478
+ exit 1
479
+ fi
480
+
481
+ # If user not specify host, try to get the server ip
482
+ if [ -z "$HOST" ]; then
483
+ HOST=$(hostname -I | awk '{print $1}')
484
+ # If the host is a private ip and the deploy mode is port mode
485
+ if [[ "$DEPLOY_MODE" == "1" ]] && ([[ "$HOST" == "192.168."* ]] || [[ "$HOST" == "172."* ]] || [[ "$HOST" == "10."* ]]); then
486
+ echo $(show_message "tips_private_ip_detected")
487
+ fi
488
+ fi
489
+
490
+
491
+ case $DEPLOY_MODE in
492
+ 0)
493
+ DEPLOY_MODE="domain"
494
+ echo "LobeChat" $(show_message "ask_domain" "example.com")
495
+ ask "(example.com)"
496
+ LOBE_HOST="$ask_result"
497
+ # If user use domain mode, ask for the domain of Minio and Casdoor
498
+ echo "Minio S3 API" $(show_message "ask_domain" "minio.example.com")
499
+ ask "(minio.example.com)"
500
+ MINIO_HOST="$ask_result"
501
+ echo "Casdoor API" $(show_message "ask_domain" "auth.example.com")
502
+ ask "(auth.example.com)"
503
+ CASDOOR_HOST="$ask_result"
504
+ # Setup callback url for Casdoor
505
+ $SED_COMMAND "s/"example.com"/${LOBE_HOST}/" init_data.json
506
+ ;;
507
+ 1)
508
+ DEPLOY_MODE="ip"
509
+ ask $(printf "%s%s" "LobeChat" $(show_message "ask_host")) "$HOST" $(printf "%s" $(show_message "tips_auto_detected"))
510
+ LOBE_HOST="$ask_result"
511
+ # If user use ip mode, use ask_result as the host
512
+ HOST="$ask_result"
513
+ # If user use ip mode, append the port to the host
514
+ LOBE_HOST="${HOST}:3210"
515
+ MINIO_HOST="${HOST}:9000"
516
+ CASDOOR_HOST="${HOST}:8000"
517
+ # Setup callback url for Casdoor
518
+ $SED_COMMAND "s/"localhost:3210"/${LOBE_HOST}/" init_data.json
519
+ ;;
520
+ *)
521
+ echo "Invalid deploy mode: $ask_result"
522
+ exit 1
523
+ ;;
524
+ esac
525
+
526
+ # lobe host
527
+ $SED_COMMAND "s#^APP_URL=.*#APP_URL=$PROTOCOL://$LOBE_HOST#" .env
528
+ # auth related
529
+ $SED_COMMAND "s#^AUTH_URL=.*#AUTH_URL=$PROTOCOL://$LOBE_HOST/api/auth#" .env
530
+ $SED_COMMAND "s#^AUTH_CASDOOR_ISSUER=.*#AUTH_CASDOOR_ISSUER=$PROTOCOL://$CASDOOR_HOST#" .env
531
+ $SED_COMMAND "s#^origin=.*#origin=$PROTOCOL://$CASDOOR_HOST#" .env
532
+ # s3 related
533
+ $SED_COMMAND "s#^S3_PUBLIC_DOMAIN=.*#S3_PUBLIC_DOMAIN=$PROTOCOL://$MINIO_HOST#" .env
534
+ $SED_COMMAND "s#^S3_ENDPOINT=.*#S3_ENDPOINT=$PROTOCOL://$MINIO_HOST#" .env
535
+
536
+
537
+ # Check if env modified success
538
+ if [ $? -ne 0 ]; then
539
+ echo $(show_message "host_regenerate_failed") "$HOST in \`.env\`"
540
+ fi
541
+ }
542
+ show_message "ask_deploy_mode"
543
+ ask "(0,1,2)" "2"
544
+ if [[ "$ask_result" == "0" ]] || [[ "$ask_result" == "1" ]] || [[ "$ask_result" == "2" ]]; then
545
+ section_configurate_host
546
+ else
547
+ echo "Invalid deploy mode: $ask_result, please select 0, 1 or 2."
548
+ exit 1
549
+ fi
550
+
551
+ # ==========================
552
+ # === Regenerate Secrets ===
553
+ # ==========================
554
+ section_regenerate_secrets() {
555
+ # Check if openssl is installed
556
+ if ! command -v openssl &> /dev/null ; then
557
+ echo "openssl" $(show_message "tips_no_executable")
558
+ exit 1
559
+ fi
560
+ if ! command -v tr &> /dev/null ; then
561
+ echo "tr" $(show_message "tips_no_executable")
562
+ exit 1
563
+ fi
564
+ if ! command -v fold &> /dev/null ; then
565
+ echo "fold" $(show_message "tips_no_executable")
566
+ exit 1
567
+ fi
568
+ if ! command -v head &> /dev/null ; then
569
+ echo "head" $(show_message "tips_no_executable")
570
+ exit 1
571
+ fi
572
+
573
+ generate_key() {
574
+ if [[ -z "$1" ]]; then
575
+ echo "Usage: generate_key <length>"
576
+ return 1
577
+ fi
578
+ echo $(openssl rand -hex $1 | tr -d '\n' | fold -w $1 | head -n 1)
579
+ }
580
+
581
+ if ! command -v sed &> /dev/null ; then
582
+ echo "sed" $(show_message "tips_no_executable")
583
+ exit 1
584
+ fi
585
+ echo $(show_message "security_secrect_regenerate")
586
+
587
+ # Generate CASDOOR_SECRET
588
+ CASDOOR_SECRET=$(generate_key 32)
589
+ if [ $? -ne 0 ]; then
590
+ echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_SECRET"
591
+ else
592
+ # Search and replace the value of CASDOOR_SECRET in .env
593
+ $SED_COMMAND "s#^AUTH_CASDOOR_SECRET=.*#AUTH_CASDOOR_SECRET=${CASDOOR_SECRET}#" .env
594
+ if [ $? -ne 0 ]; then
595
+ echo $(show_message "security_secrect_regenerate_failed") "AUTH_CASDOOR_SECRET in \`.env\`"
596
+ fi
597
+ # replace `clientSecrect` in init_data.json
598
+ $SED_COMMAND "s#dbf205949d704de81b0b5b3603174e23fbecc354#${CASDOOR_SECRET}#" init_data.json
599
+ if [ $? -ne 0 ]; then
600
+ echo $(show_message "security_secrect_regenerate_failed") "AUTH_CASDOOR_SECRET in \`init_data.json\`"
601
+ fi
602
+ fi
603
+
604
+ # Generate Casdoor User
605
+ CASDOOR_USER="admin"
606
+ CASDOOR_PASSWORD=$(generate_key 10)
607
+ if [ $? -ne 0 ]; then
608
+ echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_PASSWORD"
609
+ CASDOOR_PASSWORD="123"
610
+ else
611
+ # replace `password` in init_data.json
612
+ $SED_COMMAND "s/"123"/${CASDOOR_PASSWORD}/" init_data.json
613
+ if [ $? -ne 0 ]; then
614
+ echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_PASSWORD in \`init_data.json\`"
615
+ fi
616
+ fi
617
+ # Generate Minio S3 User Password
618
+ MINIO_ROOT_PASSWORD=$(generate_key 8)
619
+ if [ $? -ne 0 ]; then
620
+ echo $(show_message "security_secrect_regenerate_failed") "MINIO_ROOT_PASSWORD"
621
+ MINIO_ROOT_PASSWORD="YOUR_MINIO_PASSWORD"
622
+ else
623
+ # Search and replace the value of S3_SECRET_ACCESS_KEY in .env
624
+ $SED_COMMAND "s#^MINIO_ROOT_PASSWORD=.*#MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}#" .env
625
+ if [ $? -ne 0 ]; then
626
+ echo $(show_message "security_secrect_regenerate_failed") "MINIO_ROOT_PASSWORD in \`.env\`"
627
+ fi
628
+ fi
629
+ }
630
+ show_message "ask_regenerate_secrets"
631
+ ask "(y/n)" "y"
632
+ if [[ "$ask_result" == "y" ]]; then
633
+ section_regenerate_secrets
634
+ fi
635
+
636
+ section_display_configurated_report() {
637
+ # Display configuration reports
638
+ echo $(show_message "security_secrect_regenerate_report")
639
+
640
+ echo -e "LobeChat: \n - URL: $PROTOCOL://$LOBE_HOST \n - Username: user \n - Password: ${CASDOOR_PASSWORD} "
641
+ echo -e "Casdoor: \n - URL: $PROTOCOL://$CASDOOR_HOST \n - Username: admin \n - Password: ${CASDOOR_PASSWORD}\n"
642
+ echo -e "Minio: \n - URL: $PROTOCOL://$MINIO_HOST \n - Username: admin\n - Password: ${MINIO_ROOT_PASSWORD}\n"
643
+
644
+ # if user run in domain mode, diplay reverse proxy configuration
645
+ if [[ "$DEPLOY_MODE" == "domain" ]]; then
646
+ echo $(show_message "tips_add_reverse_proxy")
647
+ printf "\n%s\t->\t%s\n" "$LOBE_HOST" "127.0.0.1:3210"
648
+ printf "%s\t->\t%s\n" "$CASDOOR_HOST" "127.0.0.1:8000"
649
+ printf "%s\t->\t%s\n" "$MINIO_HOST" "127.0.0.1:9000"
650
+ fi
651
+
652
+ # Display final message
653
+
654
+ printf "\n%s\n\n" "$(show_message "tips_run_command")"
655
+ print_centered "docker compose up -d" "green"
656
+ printf "\n%s\n" "$(show_message "tips_allow_ports")"
657
+ printf "\n%s" "$(show_message "tips_show_documentation")"
658
+ printf "%s\n" $(show_message "tips_show_documentation_url")
659
+ }
660
+ section_display_configurated_report