@lobehub/chat 0.147.0 → 0.147.1

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 (103) hide show
  1. package/CHANGELOG.md +25 -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/locales/resources.test.ts +49 -0
  103. package/src/locales/resources.ts +7 -20
@@ -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
@@ -10,14 +10,16 @@ tags:
10
10
  - Proxy Configuration
11
11
  - Automatic Update Script
12
12
  ---
13
+
13
14
  # Docker Deployment Guide
14
15
 
15
16
  <div style={{display:"flex", gap: 4}}>
16
17
  [![][docker-release-shield]][docker-release-link]
17
18
 
18
- [![][docker-size-shield]][docker-size-link]
19
+ [![][docker-size-shield]][docker-size-link]
20
+
21
+ [![][docker-pulls-shield]][docker-pulls-link]
19
22
 
20
- [![][docker-pulls-shield]][docker-pulls-link]
21
23
  </div>
22
24
 
23
25
  We provide a [Docker image][docker-release-link] for you to deploy the LobeChat service on your private device.
@@ -25,7 +27,7 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat
25
27
  <Steps>
26
28
  ### Install Docker Container Environment
27
29
 
28
- (If already installed, skip this step)
30
+ (If already installed, skip this step)
29
31
 
30
32
  <Tabs items={['Ubuntu', 'CentOS']}>
31
33
  <Tab>
@@ -39,126 +41,124 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat
39
41
  ```fish
40
42
  $ yum install docker
41
43
  ```
42
-
44
+
43
45
  </Tab>
44
46
 
45
47
  </Tabs>
46
48
 
47
- ### Docker Command Deployment
49
+ ### Docker Command Deployment
48
50
 
49
- Use the following command to start the LobeChat service with one click:
51
+ Use the following command to start the LobeChat service with one click:
50
52
 
51
- ```fish
52
- $ docker run -d -p 3210:3210 \
53
- -e OPENAI_API_KEY=sk-xxxx \
54
- -e ACCESS_CODE=lobe66 \
55
- --name lobe-chat \
56
- lobehub/lobe-chat
57
- ```
53
+ ```fish
54
+ $ docker run -d -p 3210:3210 \
55
+ -e OPENAI_API_KEY=sk-xxxx \
56
+ -e ACCESS_CODE=lobe66 \
57
+ --name lobe-chat \
58
+ lobehub/lobe-chat
59
+ ```
58
60
 
59
- Command explanation:
61
+ Command explanation:
60
62
 
61
- - The default port mapping is `3210`, please ensure it is not occupied or manually change the port mapping.
63
+ - The default port mapping is `3210`, please ensure it is not occupied or manually change the port mapping.
62
64
 
63
- - Replace `sk-xxxx` in the above command with your OpenAI API Key.
65
+ - Replace `sk-xxxx` in the above command with your OpenAI API Key.
64
66
 
65
- - For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/zh/self-hosting/environment-ariable) section.
67
+ - For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/zh/self-hosting/environment-ariable) section.
66
68
 
67
- <Callout type="tip">
68
- Since the official Docker image build takes about half an hour, if you see the "update available"
69
- prompt after deployment, you can wait for the image to finish building before deploying again.
70
-
69
+ <Callout type="tip">
70
+ Since the official Docker image build takes about half an hour, if you see the "update available"
71
+ prompt after deployment, you can wait for the image to finish building before deploying again.
71
72
  </Callout>
72
73
 
73
- <Callout type="warning">
74
- The official Docker image does not have a password set. It is strongly recommended to add a
75
- password to enhance security, otherwise you may encounter situations like [My API Key was
76
- stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123).
77
-
74
+ <Callout type="warning">
75
+ The official Docker image does not have a password set. It is strongly recommended to add a
76
+ password to enhance security, otherwise you may encounter situations like [My API Key was
77
+ stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123).
78
78
  </Callout>
79
79
 
80
- <Callout type="important">
81
- Note that when the **deployment architecture is inconsistent with the image**, you need to
82
- cross-compile **Sharp**, see [Sharp
83
- Cross-Compilation](https://sharp.pixelplumbing.com/install#cross-platform) for details.
84
-
80
+ <Callout type="important">
81
+ Note that when the **deployment architecture is inconsistent with the image**, you need to
82
+ cross-compile **Sharp**, see [Sharp
83
+ Cross-Compilation](https://sharp.pixelplumbing.com/install#cross-platform) for details.
85
84
  </Callout>
86
85
 
87
- #### Using a Proxy Address
86
+ #### Using a Proxy Address
87
+
88
+ If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable:
88
89
 
89
- If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable:
90
+ ```fish
91
+ $ docker run -d -p 3210:3210 \
92
+ -e OPENAI_API_KEY=sk-xxxx \
93
+ -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
94
+ -e ACCESS_CODE=lobe66 \
95
+ --name lobe-chat \
96
+ lobehub/lobe-chat
97
+ ```
90
98
 
91
- ```fish
92
- $ docker run -d -p 3210:3210 \
93
- -e OPENAI_API_KEY=sk-xxxx \
94
- -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
95
- -e ACCESS_CODE=lobe66 \
96
- --name lobe-chat \
97
- lobehub/lobe-chat
98
- ```
99
+ ### Crontab Automatic Update Script (Optional)
99
100
 
100
- ### Crontab Automatic Update Script (Optional)
101
+ If you want to automatically obtain the latest image, you can follow these steps.
101
102
 
102
- If you want to automatically obtain the latest image, you can follow these steps.
103
+ First, create a `lobe.env` configuration file with various environment variables, for example:
103
104
 
104
- First, create a `lobe.env` configuration file with various environment variables, for example:
105
+ ```env
106
+ OPENAI_API_KEY=sk-xxxx
107
+ OPENAI_PROXY_URL=https://api-proxy.com/v1
108
+ ACCESS_CODE=arthals2333
109
+ CUSTOM_MODELS=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision
110
+ ```
105
111
 
106
- ```env
107
- OPENAI_API_KEY=sk-xxxx
108
- OPENAI_PROXY_URL=https://api-proxy.com/v1
109
- ACCESS_CODE=arthals2333
110
- CUSTOM_MODELS=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision
111
- ```
112
+ Then, you can use the following script to automate the update:
112
113
 
113
- Then, you can use the following script to automate the update:
114
+ ```bash
115
+ #!/bin/bash
116
+ # auto-update-lobe-chat.sh
114
117
 
115
- ```bash
116
- #!/bin/bash
117
- # auto-update-lobe-chat.sh
118
+ # Set up proxy (optional)
119
+ 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
118
120
 
119
- # Set up proxy (optional)
120
- 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
121
+ # Pull the latest image and store the output in a variable
122
+ output=$(docker pull lobehub/lobe-chat:latest 2>&1)
121
123
 
122
- # Pull the latest image and store the output in a variable
123
- output=$(docker pull lobehub/lobe-chat:latest 2>&1)
124
+ # Check if the pull command was executed successfully
125
+ if [ $? -ne 0 ]; then
126
+ exit 1
127
+ fi
124
128
 
125
- # Check if the pull command was executed successfully
126
- if [ $? -ne 0 ]; then
127
- exit 1
128
- fi
129
+ # Check if the output contains a specific string
130
+ echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
129
131
 
130
- # Check if the output contains a specific string
131
- echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
132
+ # If the image is already up to date, do nothing
133
+ if [ $? -eq 0 ]; then
134
+ exit 0
135
+ fi
132
136
 
133
- # If the image is already up to date, do nothing
134
- if [ $? -eq 0 ]; then
135
- exit 0
136
- fi
137
+ echo "Detected Lobe-Chat update"
137
138
 
138
- echo "Detected Lobe-Chat update"
139
+ # Remove the old container
140
+ echo "Removed: $(docker rm -f Lobe-Chat)"
139
141
 
140
- # Remove the old container
141
- echo "Removed: $(docker rm -f Lobe-Chat)"
142
+ # Run the new container
143
+ echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)"
142
144
 
143
- # Run the new container
144
- echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)"
145
+ # Print the update time and version
146
+ echo "Update time: $(date)"
147
+ echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
145
148
 
146
- # Print the update time and version
147
- echo "Update time: $(date)"
148
- echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
149
+ # Clean up unused images
150
+ docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
151
+ echo "Removed old images."
152
+ ```
149
153
 
150
- # Clean up unused images
151
- docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
152
- echo "Removed old images."
153
- ```
154
+ This script can be used in Crontab, but please ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths.
154
155
 
155
- This script can be used in Crontab, but please ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths.
156
+ Configure Crontab to execute the script every 5 minutes:
156
157
 
157
- Configure Crontab to execute the script every 5 minutes:
158
+ ```bash
159
+ */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
160
+ ```
158
161
 
159
- ```bash
160
- */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
161
- ```
162
162
  </Steps>
163
163
 
164
164
  [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat