@lobehub/chat 0.147.0 → 0.147.2

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 (120) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +8 -8
  3. package/README.zh-CN.md +8 -8
  4. package/docs/self-hosting/advanced/analytics.mdx +1 -0
  5. package/docs/self-hosting/advanced/analytics.zh-CN.mdx +1 -0
  6. package/docs/self-hosting/advanced/authentication.mdx +7 -6
  7. package/docs/self-hosting/advanced/authentication.zh-CN.mdx +7 -6
  8. package/docs/self-hosting/advanced/sso-providers/auth0.mdx +58 -32
  9. package/docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx +60 -32
  10. package/docs/self-hosting/advanced/sso-providers/authentik.mdx +33 -29
  11. package/docs/self-hosting/advanced/sso-providers/authentik.zh-CN.mdx +30 -27
  12. package/docs/self-hosting/advanced/sso-providers/github.mdx +49 -20
  13. package/docs/self-hosting/advanced/sso-providers/github.zh-CN.mdx +57 -31
  14. package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.mdx +53 -35
  15. package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.zh-CN.mdx +43 -31
  16. package/docs/self-hosting/advanced/sso-providers/zitadel.mdx +64 -34
  17. package/docs/self-hosting/advanced/sso-providers/zitadel.zh-CN.mdx +62 -36
  18. package/docs/self-hosting/advanced/upstream-sync.mdx +32 -23
  19. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +32 -23
  20. package/docs/self-hosting/environment-variables/analytics.mdx +1 -0
  21. package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +1 -0
  22. package/docs/self-hosting/environment-variables/auth.mdx +1 -0
  23. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +1 -0
  24. package/docs/self-hosting/environment-variables/basic.mdx +1 -0
  25. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +1 -0
  26. package/docs/self-hosting/environment-variables/model-provider.mdx +1 -0
  27. package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +1 -0
  28. package/docs/self-hosting/environment-variables.mdx +1 -0
  29. package/docs/self-hosting/environment-variables.zh-CN.mdx +1 -0
  30. package/docs/self-hosting/examples/azure-openai.mdx +12 -8
  31. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +12 -8
  32. package/docs/self-hosting/examples/ollama.mdx +1 -0
  33. package/docs/self-hosting/examples/ollama.zh-CN.mdx +1 -0
  34. package/docs/self-hosting/faq/no-v1-suffix.mdx +1 -0
  35. package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +1 -0
  36. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +1 -0
  37. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.zh-CN.mdx +1 -0
  38. package/docs/self-hosting/platform/docker-compose.mdx +80 -73
  39. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +79 -73
  40. package/docs/self-hosting/platform/docker.mdx +85 -85
  41. package/docs/self-hosting/platform/docker.zh-CN.mdx +84 -85
  42. package/docs/self-hosting/platform/netlify.mdx +91 -42
  43. package/docs/self-hosting/platform/netlify.zh-CN.mdx +88 -38
  44. package/docs/self-hosting/platform/railway.mdx +8 -6
  45. package/docs/self-hosting/platform/railway.zh-CN.mdx +8 -6
  46. package/docs/self-hosting/platform/repocloud.mdx +8 -6
  47. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +8 -6
  48. package/docs/self-hosting/platform/sealos.mdx +8 -6
  49. package/docs/self-hosting/platform/sealos.zh-CN.mdx +8 -6
  50. package/docs/self-hosting/platform/vercel.mdx +9 -7
  51. package/docs/self-hosting/platform/vercel.zh-CN.mdx +9 -7
  52. package/docs/self-hosting/platform/zeabur.mdx +8 -6
  53. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +8 -6
  54. package/docs/self-hosting/start.mdx +11 -1
  55. package/docs/self-hosting/start.zh-CN.mdx +2 -1
  56. package/docs/usage/agents/concepts.mdx +13 -2
  57. package/docs/usage/agents/concepts.zh-CN.mdx +13 -2
  58. package/docs/usage/agents/custom-agent.mdx +9 -2
  59. package/docs/usage/agents/custom-agent.zh-CN.mdx +8 -4
  60. package/docs/usage/agents/model.mdx +3 -3
  61. package/docs/usage/agents/model.zh-CN.mdx +6 -5
  62. package/docs/usage/agents/prompt.mdx +7 -5
  63. package/docs/usage/agents/prompt.zh-CN.mdx +7 -5
  64. package/docs/usage/agents/topics.mdx +9 -1
  65. package/docs/usage/agents/topics.zh-CN.mdx +9 -1
  66. package/docs/usage/features/agent-market.mdx +5 -5
  67. package/docs/usage/features/agent-market.zh-CN.mdx +1 -0
  68. package/docs/usage/features/local-llm.mdx +6 -1
  69. package/docs/usage/features/local-llm.zh-CN.mdx +6 -1
  70. package/docs/usage/features/mobile.mdx +5 -1
  71. package/docs/usage/features/mobile.zh-CN.mdx +6 -1
  72. package/docs/usage/features/more.mdx +1 -0
  73. package/docs/usage/features/more.zh-CN.mdx +1 -0
  74. package/docs/usage/features/multi-ai-providers.mdx +11 -2
  75. package/docs/usage/features/multi-ai-providers.zh-CN.mdx +12 -2
  76. package/docs/usage/features/plugin-system.mdx +8 -7
  77. package/docs/usage/features/plugin-system.zh-CN.mdx +9 -7
  78. package/docs/usage/features/pwa.mdx +10 -4
  79. package/docs/usage/features/pwa.zh-CN.mdx +11 -4
  80. package/docs/usage/features/text-to-image.zh-CN.mdx +1 -0
  81. package/docs/usage/features/theme.mdx +6 -1
  82. package/docs/usage/features/theme.zh-CN.mdx +7 -1
  83. package/docs/usage/features/tts.zh-CN.mdx +1 -0
  84. package/docs/usage/features/vision.zh-CN.mdx +1 -0
  85. package/docs/usage/plugins/basic-usage.mdx +31 -7
  86. package/docs/usage/plugins/basic-usage.zh-CN.mdx +31 -7
  87. package/docs/usage/plugins/custom-plugin.mdx +1 -0
  88. package/docs/usage/plugins/custom-plugin.zh-CN.mdx +1 -0
  89. package/docs/usage/plugins/development.mdx +79 -30
  90. package/docs/usage/plugins/development.zh-CN.mdx +80 -31
  91. package/docs/usage/plugins/store.mdx +11 -2
  92. package/docs/usage/plugins/store.zh-CN.mdx +11 -2
  93. package/docs/usage/providers/groq.mdx +32 -12
  94. package/docs/usage/providers/groq.zh-CN.mdx +30 -12
  95. package/docs/usage/providers/ollama/gemma.mdx +27 -11
  96. package/docs/usage/providers/ollama/gemma.zh-CN.mdx +28 -11
  97. package/docs/usage/providers/ollama/qwen.mdx +30 -16
  98. package/docs/usage/providers/ollama/qwen.zh-CN.mdx +25 -11
  99. package/docs/usage/providers/ollama.mdx +27 -14
  100. package/docs/usage/providers/ollama.zh-CN.mdx +27 -14
  101. package/package.json +1 -1
  102. package/src/app/settings/llm/Azure/index.tsx +1 -1
  103. package/src/app/settings/llm/components/ProviderConfig/index.tsx +1 -1
  104. package/src/app/settings/llm/components/ProviderModelList/CustomModelOption.tsx +1 -1
  105. package/src/app/settings/llm/components/ProviderModelList/ModelConfigModal.tsx +1 -1
  106. package/src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx +3 -3
  107. package/src/app/settings/llm/components/ProviderModelList/index.tsx +2 -2
  108. package/src/features/AgentSetting/AgentConfig/ModelSelect.tsx +1 -1
  109. package/src/features/Conversation/Error/APIKeyForm/ProviderApiKeyForm.tsx +2 -2
  110. package/src/features/ModelSwitchPanel/index.tsx +1 -1
  111. package/src/locales/resources.test.ts +49 -0
  112. package/src/locales/resources.ts +7 -20
  113. package/src/services/_auth.ts +5 -3
  114. package/src/services/_header.ts +3 -4
  115. package/src/services/chat.ts +1 -1
  116. package/src/services/ollama.ts +3 -2
  117. package/src/store/global/slices/settings/actions/llm.test.ts +1 -1
  118. package/src/store/global/slices/settings/actions/llm.ts +2 -2
  119. package/src/store/global/slices/settings/selectors/modelConfig.test.ts +35 -14
  120. package/src/store/global/slices/settings/selectors/modelConfig.ts +55 -118
@@ -9,6 +9,7 @@ tags:
9
9
  - 配置
10
10
  - 部署
11
11
  ---
12
+
12
13
  # 与 Ollama 集成
13
14
 
14
15
  Ollama 是一款强大的本地运行大型语言模型(LLM)的框架,支持多种语言模型,包括 Llama 2, Mistral 等。现在,LobeChat 已经支持与 Ollama 的集成,这意味着你可以在 LobeChat 中轻松使用 Ollama 提供的语言模型来增强你的应用。
@@ -10,6 +10,7 @@ tags:
10
10
  - environment variable
11
11
  - configuration troubleshooting
12
12
  ---
13
+
13
14
  # Configuring `OPENAI_PROXY_URL` Environment Variable but Getting Empty Response
14
15
 
15
16
  ### Problem Description
@@ -7,6 +7,7 @@ tags:
7
7
  - 返回值为空
8
8
  - 问题解决
9
9
  ---
10
+
10
11
  # 配置 `OPENAI_PROXY_URL` 环境变量但返回值为空
11
12
 
12
13
  ### 问题描述
@@ -12,6 +12,7 @@ tags:
12
12
  - Docker
13
13
  - certificate issue
14
14
  ---
15
+
15
16
  # Encounter `UNABLE_TO_VERIFY_LEAF_SIGNATURE` Error When Using Proxy
16
17
 
17
18
  ## Problem Description
@@ -9,6 +9,7 @@ tags:
9
9
  - Docker
10
10
  - 安全性
11
11
  ---
12
+
12
13
  # 使用代理时遇到 `UNABLE_TO_VERIFY_LEAF_SIGNATURE` 错误
13
14
 
14
15
  ## 问题描述
@@ -11,120 +11,127 @@ tags:
11
11
  - Automatic Updates
12
12
  - Crontab Script
13
13
  ---
14
+
14
15
  # Docker Compose Deployment Guide
15
16
 
16
17
  <div style={{display:"flex", gap: 4}}>
17
18
  [![][docker-release-shield]][docker-release-link]
18
19
 
19
- [![][docker-size-shield]][docker-size-link]
20
+ [![][docker-size-shield]][docker-size-link]
21
+
22
+ [![][docker-pulls-shield]][docker-pulls-link]
20
23
 
21
- [![][docker-pulls-shield]][docker-pulls-link]
22
24
  </div>
23
25
 
24
26
  We provide a [Docker image][docker-release-link] for deploying the LobeChat service on your private device.
25
27
 
26
28
  <Steps>
27
- ### Install Docker Container Environment
29
+
30
+ ### Install Docker Container Environment
28
31
 
29
- (Skip this step if already installed)
32
+ (Skip this step if already installed)
30
33
 
31
- <Tabs items={['Ubuntu', 'CentOS']}>
32
- <Tab>
33
- ```fish
34
- $ apt install docker.io
35
- ```
34
+ <Tabs items={['Ubuntu', 'CentOS']}>
36
35
 
36
+ <Tab>
37
+
38
+ ```fish
39
+ $ apt install docker.io
40
+ ```
41
+
37
42
  </Tab>
38
43
 
39
- <Tab>
40
- ```fish
41
- $ yum install docker
42
- ```
43
-
44
+ <Tab>
45
+
46
+ ```fish
47
+ $ yum install docker
48
+ ```
49
+
44
50
  </Tab>
45
-
51
+
46
52
  </Tabs>
47
53
 
48
- ### Run Docker Compose Deployment Command
54
+ ### Run Docker Compose Deployment Command
49
55
 
50
- When using `docker-compose`, the configuration file is as follows:
56
+ When using `docker-compose`, the configuration file is as follows:
51
57
 
52
- ```yml
53
- version: '3.8'
58
+ ```yml
59
+ version: '3.8'
54
60
 
55
- services:
56
- lobe-chat:
57
- image: lobehub/lobe-chat
58
- container_name: lobe-chat
59
- restart: always
60
- ports:
61
- - '3210:3210'
62
- environment:
63
- OPENAI_API_KEY: sk-xxxx
64
- OPENAI_PROXY_URL: https://api-proxy.com/v1
65
- ACCESS_CODE: lobe66
66
- ```
61
+ services:
62
+ lobe-chat:
63
+ image: lobehub/lobe-chat
64
+ container_name: lobe-chat
65
+ restart: always
66
+ ports:
67
+ - '3210:3210'
68
+ environment:
69
+ OPENAI_API_KEY: sk-xxxx
70
+ OPENAI_PROXY_URL: https://api-proxy.com/v1
71
+ ACCESS_CODE: lobe66
72
+ ```
67
73
 
68
- Run the following command to start the Lobe Chat service:
74
+ Run the following command to start the Lobe Chat service:
69
75
 
70
- ```bash
71
- $ docker-compose up -d
72
- ```
76
+ ```bash
77
+ $ docker-compose up -d
78
+ ```
73
79
 
74
- ### Crontab Automatic Update Script (Optional)
80
+ ### Crontab Automatic Update Script (Optional)
75
81
 
76
- Similarly, you can use the following script to automatically update Lobe Chat. When using `Docker Compose`, no additional configuration of environment variables is required.
82
+ Similarly, you can use the following script to automatically update Lobe Chat. When using `Docker Compose`, no additional configuration of environment variables is required.
77
83
 
78
- ```bash
79
- #!/bin/bash
80
- # auto-update-lobe-chat.sh
84
+ ```bash
85
+ #!/bin/bash
86
+ # auto-update-lobe-chat.sh
81
87
 
82
- # Set proxy (optional)
83
- export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
88
+ # Set proxy (optional)
89
+ export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
84
90
 
85
- # Pull the latest image and store the output in a variable
86
- output=$(docker pull lobehub/lobe-chat:latest 2>&1)
91
+ # Pull the latest image and store the output in a variable
92
+ output=$(docker pull lobehub/lobe-chat:latest 2>&1)
87
93
 
88
- # Check if the pull command was executed successfully
89
- if [ $? -ne 0 ]; then
90
- exit 1
91
- fi
94
+ # Check if the pull command was executed successfully
95
+ if [ $? -ne 0 ]; then
96
+ exit 1
97
+ fi
92
98
 
93
- # Check if the output contains a specific string
94
- echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
99
+ # Check if the output contains a specific string
100
+ echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
95
101
 
96
- # If the image is already up to date, do nothing
97
- if [ $? -eq 0 ]; then
98
- exit 0
99
- fi
102
+ # If the image is already up to date, do nothing
103
+ if [ $? -eq 0 ]; then
104
+ exit 0
105
+ fi
100
106
 
101
- echo "Detected Lobe-Chat update"
107
+ echo "Detected Lobe-Chat update"
102
108
 
103
- # Remove the old container
104
- echo "Removed: $(docker rm -f Lobe-Chat)"
109
+ # Remove the old container
110
+ echo "Removed: $(docker rm -f Lobe-Chat)"
105
111
 
106
- # You may need to navigate to the directory where `docker-compose.yml` is located first
107
- # cd /path/to/docker-compose-folder
112
+ # You may need to navigate to the directory where `docker-compose.yml` is located first
113
+ # cd /path/to/docker-compose-folder
108
114
 
109
- # Run the new container
110
- echo "Started: $(docker-compose up)"
115
+ # Run the new container
116
+ echo "Started: $(docker-compose up)"
111
117
 
112
- # Print the update time and version
113
- echo "Update time: $(date)"
114
- echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
118
+ # Print the update time and version
119
+ echo "Update time: $(date)"
120
+ echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
115
121
 
116
- # Clean up unused images
117
- docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
118
- echo "Removed old images."
119
- ```
122
+ # Clean up unused images
123
+ docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
124
+ echo "Removed old images."
125
+ ```
120
126
 
121
- This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths.
127
+ This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths.
122
128
 
123
- Configure Crontab to execute the script every 5 minutes:
129
+ Configure Crontab to execute the script every 5 minutes:
130
+
131
+ ```bash
132
+ */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
133
+ ```
124
134
 
125
- ```bash
126
- */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
127
- ```
128
135
  </Steps>
129
136
 
130
137
  [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat
@@ -8,14 +8,16 @@ tags:
8
8
  - 自动更新脚本
9
9
  - 部署指引
10
10
  ---
11
+
11
12
  # Docker Compose 部署指引
12
13
 
13
14
  <div style={{display:"flex", gap: 4}}>
14
15
  [![][docker-release-shield]][docker-release-link]
15
16
 
16
- [![][docker-size-shield]][docker-size-link]
17
+ [![][docker-size-shield]][docker-size-link]
18
+
19
+ [![][docker-pulls-shield]][docker-pulls-link]
17
20
 
18
- [![][docker-pulls-shield]][docker-pulls-link]
19
21
  </div>
20
22
 
21
23
  我们提供了 [Docker 镜像][docker-release-link],供你在自己的私有设备上部署 LobeChat 服务。
@@ -23,105 +25,109 @@ tags:
23
25
  <Steps>
24
26
  ### 安装 Docker 容器环境
25
27
 
26
- (如果已安装,请跳过此步)
28
+ (如果已安装,请跳过此步)
29
+
30
+ <Tabs items={['Ubuntu', 'CentOS']}>
31
+
32
+ <Tab>
33
+
34
+ ```fish
35
+ $ apt install docker.io
36
+ ```
27
37
 
28
- <Tabs items={['Ubuntu', 'CentOS']}>
29
- <Tab>
30
- ```fish
31
- $ apt install docker.io
32
- ```
33
-
34
38
  </Tab>
35
39
 
36
- <Tab>
37
- ```fish
38
- $ yum install docker
39
- ```
40
-
40
+ <Tab>
41
+
42
+ ```fish
43
+ $ yum install docker
44
+ ```
45
+
41
46
  </Tab>
42
-
47
+
43
48
  </Tabs>
44
49
 
45
- ### 运行 Docker Compose 部署指令
50
+ ### 运行 Docker Compose 部署指令
51
+
52
+ 使用 `docker-compose` 时配置文件如下:
46
53
 
47
- 使用 `docker-compose` 时配置文件如下:
54
+ ```yml
55
+ version: '3.8'
48
56
 
49
- ```yml
50
- version: '3.8'
57
+ services:
58
+ lobe-chat:
59
+ image: lobehub/lobe-chat
60
+ container_name: lobe-chat
61
+ restart: always
62
+ ports:
63
+ - '3210:3210'
64
+ environment:
65
+ OPENAI_API_KEY: sk-xxxx
66
+ OPENAI_PROXY_URL: https://api-proxy.com/v1
67
+ ACCESS_CODE: lobe66
68
+ ```
51
69
 
52
- services:
53
- lobe-chat:
54
- image: lobehub/lobe-chat
55
- container_name: lobe-chat
56
- restart: always
57
- ports:
58
- - '3210:3210'
59
- environment:
60
- OPENAI_API_KEY: sk-xxxx
61
- OPENAI_PROXY_URL: https://api-proxy.com/v1
62
- ACCESS_CODE: lobe66
63
- ```
70
+ 运行以下命令启动 Lobe Chat 服务:
64
71
 
65
- 运行以下命令启动 Lobe Chat 服务:
72
+ ```bash
73
+ $ docker-compose up -d
74
+ ```
66
75
 
67
- ```bash
68
- $ docker-compose up -d
69
- ```
76
+ ### Crontab 自动更新脚本(可选)
70
77
 
71
- ### Crontab 自动更新脚本(可选)
78
+ 类似地,你可以使用以下脚本来自动更新 Lobe Chat,使用 `Docker Compose` 时,环境变量无需额外配置。
72
79
 
73
- 类似地,你可以使用以下脚本来自动更新 Lobe Chat,使用 `Docker Compose` 时,环境变量无需额外配置。
80
+ ```bash
81
+ #!/bin/bash
82
+ # auto-update-lobe-chat.sh
74
83
 
75
- ```bash
76
- #!/bin/bash
77
- # auto-update-lobe-chat.sh
84
+ # 设置代理(可选)
85
+ export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
78
86
 
79
- # 设置代理(可选)
80
- export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
87
+ # 拉取最新的镜像并将输出存储在变量中
88
+ output=$(docker pull lobehub/lobe-chat:latest 2>&1)
81
89
 
82
- # 拉取最新的镜像并将输出存储在变量中
83
- output=$(docker pull lobehub/lobe-chat:latest 2>&1)
90
+ # 检查拉取命令是否成功执行
91
+ if [ $? -ne 0 ]; then
92
+ exit 1
93
+ fi
84
94
 
85
- # 检查拉取命令是否成功执行
86
- if [ $? -ne 0 ]; then
87
- exit 1
88
- fi
95
+ # 检查输出中是否包含特定的字符串
96
+ echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
89
97
 
90
- # 检查输出中是否包含特定的字符串
91
- echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
98
+ # 如果镜像已经是最新的,则不执行任何操作
99
+ if [ $? -eq 0 ]; then
100
+ exit 0
101
+ fi
92
102
 
93
- # 如果镜像已经是最新的,则不执行任何操作
94
- if [ $? -eq 0 ]; then
95
- exit 0
96
- fi
103
+ echo "Detected Lobe-Chat update"
97
104
 
98
- echo "Detected Lobe-Chat update"
105
+ # 删除旧的容器
106
+ echo "Removed: $(docker rm -f Lobe-Chat)"
99
107
 
100
- # 删除旧的容器
101
- echo "Removed: $(docker rm -f Lobe-Chat)"
108
+ # 也许需要先进入 `docker-compose.yml` 所在的目录
109
+ # cd /path/to/docker-compose-folder
102
110
 
103
- # 也许需要先进入 `docker-compose.yml` 所在的目录
104
- # cd /path/to/docker-compose-folder
111
+ # 运行新的容器
112
+ echo "Started: $(docker-compose up)"
105
113
 
106
- # 运行新的容器
107
- echo "Started: $(docker-compose up)"
114
+ # 打印更新的时间和版本
115
+ echo "Update time: $(date)"
116
+ echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
108
117
 
109
- # 打印更新的时间和版本
110
- echo "Update time: $(date)"
111
- echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
118
+ # 清理不再使用的镜像
119
+ docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
120
+ echo "Removed old images."
121
+ ```
112
122
 
113
- # 清理不再使用的镜像
114
- docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
115
- echo "Removed old images."
116
- ```
123
+ 此脚本亦可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。
117
124
 
118
- 此脚本亦可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。
125
+ 配置 Crontab,每 5 分钟执行一次脚本:
119
126
 
120
- 配置 Crontab,每 5 分钟执行一次脚本:
127
+ ```bash
128
+ */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
129
+ ```
121
130
 
122
- ```bash
123
- */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
124
- ```
125
131
  </Steps>
126
132
 
127
133
  [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat