mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
fix(cli): clarify Unix socket server details
This commit is contained in:
1 parent
e3c2e8ec58
commit
16808e7403
8 files changed
+12
-5
No files matched your search
@@ -28,7 +28,7 @@ clb web --no-open # 启动 API + Web UI,但不自动打开浏览器
|
||||
clb web --headless # 仅启动 API,不提供 Web UI(供脚本 / AI Agent 调用)
|
||||
```
|
||||
|
||||
常用选项:`--port <端口>`(默认 `3110`)、`--host <地址>`、`--token <令牌>`。在 macOS 和 Linux 上,可以使用 `--socket <路径>` 监听 Unix 域套接字而不占用 TCP 端口,例如 `clb web --socket /tmp/chatlab.sock --no-open`。可通过 `curl --unix-socket /tmp/chatlab.sock http://localhost/api/v1/status` 访问,或在其前面配置反向代理。
|
||||
常用选项:`--port <端口>`(默认 `3110`)、`--host <地址>`、`--token <令牌>`。在 macOS 和 Linux 上,可以使用 `--socket <路径>` 监听 Unix 域套接字而不占用 TCP 端口,例如 `clb web --socket /tmp/chatlab.sock --no-open`。可通过 `curl --unix-socket /tmp/chatlab.sock http://localhost/api/v1/status` 访问(需要身份验证),或在其前面配置反向代理。
|
||||
|
||||
如果希望服务常驻后台,可以使用:
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ clb web --no-open # Start API + Web UI without opening a browser
|
||||
clb web --headless # Start the API without serving the Web UI (for scripts / AI Agents)
|
||||
```
|
||||
|
||||
Common options: `--port <port>` (default `3110`), `--host <address>`, and `--token <token>`. On macOS and Linux, use `--socket <path>` to listen on a Unix domain socket instead of a TCP port, for example `clb web --socket /tmp/chatlab.sock --no-open`. Access it with `curl --unix-socket /tmp/chatlab.sock http://localhost/api/v1/status` or place a reverse proxy in front of it.
|
||||
Common options: `--port <port>` (default `3110`), `--host <address>`, and `--token <token>`. On macOS and Linux, use `--socket <path>` to listen on a Unix domain socket instead of a TCP port, for example `clb web --socket /tmp/chatlab.sock --no-open`. Access it with `curl --unix-socket /tmp/chatlab.sock http://localhost/api/v1/status` (with authentication) or place a reverse proxy in front of it.
|
||||
|
||||
To keep ChatLab running as a background service:
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ clb web --no-open # 啟動 API + Web UI,但不自動開啟瀏覽器
|
||||
clb web --headless # 僅啟動 API,不提供 Web UI(供腳本 / AI Agent 呼叫)
|
||||
```
|
||||
|
||||
常用選項:`--port <連接埠>`(預設 `3110`)、`--host <位址>`、`--token <令牌>`。在 macOS 和 Linux 上,可以使用 `--socket <路徑>` 監聽 Unix 網域通訊端而不占用 TCP 連接埠,例如 `clb web --socket /tmp/chatlab.sock --no-open`。可透過 `curl --unix-socket /tmp/chatlab.sock http://localhost/api/v1/status` 存取,或在其前方設定反向代理。
|
||||
常用選項:`--port <連接埠>`(預設 `3110`)、`--host <位址>`、`--token <令牌>`。在 macOS 和 Linux 上,可以使用 `--socket <路徑>` 監聽 Unix 網域通訊端而不占用 TCP 連接埠,例如 `clb web --socket /tmp/chatlab.sock --no-open`。可透過 `curl --unix-socket /tmp/chatlab.sock http://localhost/api/v1/status` 存取(需要驗證身分),或在其前方設定反向代理。
|
||||
|
||||
若要讓服務常駐後台,可以使用:
|
||||
|
||||
|
||||
@@ -94,7 +94,6 @@ const statusColor = computed(() => {
|
||||
})
|
||||
|
||||
const apiBaseUrl = computed(() => {
|
||||
if (config.value.socket) return `unix://${config.value.socket}`
|
||||
const port = status.value.port || config.value.port
|
||||
return `http://127.0.0.1:${port}/api/v1`
|
||||
})
|
||||
@@ -418,7 +417,11 @@ function subscribedRemoteIds(ds: DataSource): Set<string> {
|
||||
<div
|
||||
class="mt-3 space-y-2 border-t border-gray-200 pt-3 text-xs text-gray-600 dark:border-gray-700 dark:text-gray-400"
|
||||
>
|
||||
<div class="flex items-center justify-between">
|
||||
<div v-if="config.socket" class="flex items-center justify-between gap-4">
|
||||
<span>{{ t('settings.api.service.socket') }}</span>
|
||||
<span class="break-all font-mono text-gray-700 dark:text-gray-300">{{ config.socket }}</span>
|
||||
</div>
|
||||
<div v-else class="flex items-center justify-between">
|
||||
<span>{{ t('settings.api.port.label') }}</span>
|
||||
<span class="font-mono text-gray-700 dark:text-gray-300">{{ config.port || '-' }}</span>
|
||||
</div>
|
||||
|
||||
@@ -519,6 +519,7 @@
|
||||
"title": "API Service",
|
||||
"enable": "Enable API Service",
|
||||
"enableDesc": "When enabled, external tools can query, export, and import chat data via HTTP API. Localhost only (127.0.0.1)",
|
||||
"socket": "Unix Socket",
|
||||
"portInUseHint": "Port is in use. Please change the port below or close the program using this port"
|
||||
},
|
||||
"status": {
|
||||
|
||||
@@ -519,6 +519,7 @@
|
||||
"title": "API サービス",
|
||||
"enable": "API サービスを有効化",
|
||||
"enableDesc": "有効にすると、外部ツールが HTTP API 経由でチャットデータの照会・エクスポート・インポートができます。ローカルホストのみ (127.0.0.1)",
|
||||
"socket": "Unix ソケット",
|
||||
"portInUseHint": "ポートが使用中です。下のポートを変更するか、このポートを使用しているプログラムを終了してから再試行してください"
|
||||
},
|
||||
"status": {
|
||||
|
||||
@@ -519,6 +519,7 @@
|
||||
"title": "API 服务",
|
||||
"enable": "启用 API 服务",
|
||||
"enableDesc": "开启后,外部工具可通过 HTTP API 查询、导出和导入聊天数据。仅本机可访问 (127.0.0.1)",
|
||||
"socket": "Unix 套接字",
|
||||
"portInUseHint": "端口被占用,请在下方修改端口或关闭占用该端口的程序后重试"
|
||||
},
|
||||
"status": {
|
||||
|
||||
@@ -519,6 +519,7 @@
|
||||
"title": "API 服務",
|
||||
"enable": "啟用 API 服務",
|
||||
"enableDesc": "開啟後,外部工具可透過 HTTP API 查詢、匯出和匯入聊天數據。僅本機可存取 (127.0.0.1)",
|
||||
"socket": "Unix 通訊端",
|
||||
"portInUseHint": "連接埠被佔用,請在下方修改連接埠或關閉佔用該連接埠的程式後重試"
|
||||
},
|
||||
"status": {
|
||||
|
||||
Reference in new issue
Block a user