diff --git a/docs/cn/usage/installation.md b/docs/cn/usage/installation.md index 1d47bb24..9f2a578b 100644 --- a/docs/cn/usage/installation.md +++ b/docs/cn/usage/installation.md @@ -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` 访问(需要身份验证),或在其前面配置反向代理。 如果希望服务常驻后台,可以使用: diff --git a/docs/en/usage/installation.md b/docs/en/usage/installation.md index 02d007de..ea8d9498 100644 --- a/docs/en/usage/installation.md +++ b/docs/en/usage/installation.md @@ -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 ` (default `3110`), `--host
`, and `--token `. On macOS and Linux, use `--socket ` 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 ` (default `3110`), `--host
`, and `--token `. On macOS and Linux, use `--socket ` 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: diff --git a/docs/tw/usage/installation.md b/docs/tw/usage/installation.md index 13d73eb5..f7233cd8 100644 --- a/docs/tw/usage/installation.md +++ b/docs/tw/usage/installation.md @@ -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` 存取(需要驗證身分),或在其前方設定反向代理。 若要讓服務常駐後台,可以使用: diff --git a/src/components/common/Settings/ApiSettingsTab.vue b/src/components/common/Settings/ApiSettingsTab.vue index 2b609c3a..29d93d11 100644 --- a/src/components/common/Settings/ApiSettingsTab.vue +++ b/src/components/common/Settings/ApiSettingsTab.vue @@ -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 {
-
+
+ {{ t('settings.api.service.socket') }} + {{ config.socket }} +
+
{{ t('settings.api.port.label') }} {{ config.port || '-' }}
diff --git a/src/i18n/locales/en-US/settings.json b/src/i18n/locales/en-US/settings.json index 6f005726..2030aec9 100644 --- a/src/i18n/locales/en-US/settings.json +++ b/src/i18n/locales/en-US/settings.json @@ -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": { diff --git a/src/i18n/locales/ja-JP/settings.json b/src/i18n/locales/ja-JP/settings.json index bba3ea51..309cd0e1 100644 --- a/src/i18n/locales/ja-JP/settings.json +++ b/src/i18n/locales/ja-JP/settings.json @@ -519,6 +519,7 @@ "title": "API サービス", "enable": "API サービスを有効化", "enableDesc": "有効にすると、外部ツールが HTTP API 経由でチャットデータの照会・エクスポート・インポートができます。ローカルホストのみ (127.0.0.1)", + "socket": "Unix ソケット", "portInUseHint": "ポートが使用中です。下のポートを変更するか、このポートを使用しているプログラムを終了してから再試行してください" }, "status": { diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json index d6604228..493f98d0 100644 --- a/src/i18n/locales/zh-CN/settings.json +++ b/src/i18n/locales/zh-CN/settings.json @@ -519,6 +519,7 @@ "title": "API 服务", "enable": "启用 API 服务", "enableDesc": "开启后,外部工具可通过 HTTP API 查询、导出和导入聊天数据。仅本机可访问 (127.0.0.1)", + "socket": "Unix 套接字", "portInUseHint": "端口被占用,请在下方修改端口或关闭占用该端口的程序后重试" }, "status": { diff --git a/src/i18n/locales/zh-TW/settings.json b/src/i18n/locales/zh-TW/settings.json index 4aaab320..c33a59d0 100644 --- a/src/i18n/locales/zh-TW/settings.json +++ b/src/i18n/locales/zh-TW/settings.json @@ -519,6 +519,7 @@ "title": "API 服務", "enable": "啟用 API 服務", "enableDesc": "開啟後,外部工具可透過 HTTP API 查詢、匯出和匯入聊天數據。僅本機可存取 (127.0.0.1)", + "socket": "Unix 通訊端", "portInUseHint": "連接埠被佔用,請在下方修改連接埠或關閉佔用該連接埠的程式後重試" }, "status": {