diff --git a/README.md b/README.md index cf582685..32448f0b 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ A cross-platform desktop GUI client for CLIProxyAPI. A web-based management center for CLIProxyAPI. +Set `remote-management.disable-control-panel` to `true` if you prefer to host the management UI elsewhere; the server will skip downloading `management.html` and `/management.html` will return 404. + ### Authentication You can authenticate for Gemini, OpenAI, and/or Claude. All can coexist in the same `auth-dir` and will be load balanced. @@ -277,6 +279,7 @@ The server uses a YAML configuration file (`config.yaml`) located in the project | `request-retry` | integer | 0 | Number of times to retry a request. Retries will occur if the HTTP response code is 403, 408, 500, 502, 503, or 504. | | `remote-management.allow-remote` | boolean | false | Whether to allow remote (non-localhost) access to the management API. If false, only localhost can access. A management key is still required for localhost. | | `remote-management.secret-key` | string | "" | Management key. If a plaintext value is provided, it will be hashed on startup using bcrypt and persisted back to the config file. If empty, the entire management API is disabled (404). | +| `remote-management.disable-control-panel` | boolean | false | When true, skip downloading `management.html` and return 404 for `/management.html`, effectively disabling the bundled management UI. | | `quota-exceeded` | object | {} | Configuration for handling quota exceeded. | | `quota-exceeded.switch-project` | boolean | true | Whether to automatically switch to another project when a quota is exceeded. | | `quota-exceeded.switch-preview-model` | boolean | true | Whether to automatically switch to a preview model when a quota is exceeded. | @@ -326,6 +329,9 @@ remote-management: # Leave empty to disable the Management API entirely (404 for all /v0/management routes). secret-key: "" + # Disable the bundled management control panel asset download and HTTP route when true. + disable-control-panel: false + # Authentication directory (supports ~ for home directory). If you use Windows, please set the directory like this: `C:/cli-proxy-api/` auth-dir: "~/.cli-proxy-api" diff --git a/README_CN.md b/README_CN.md index 399fea2f..d440f831 100644 --- a/README_CN.md +++ b/README_CN.md @@ -85,6 +85,8 @@ CLIProxyAPI 的跨平台桌面图形客户端。 CLIProxyAPI 的基于 Web 的管理中心。 +如果希望自行托管管理页面,可在配置中将 `remote-management.disable-control-panel` 设为 `true`,服务器将停止下载 `management.html`,并让 `/management.html` 返回 404。 + ### 身份验证 您可以分别为 Gemini、OpenAI 和 Claude 进行身份验证,三者可同时存在于同一个 `auth-dir` 中并参与负载均衡。 @@ -289,6 +291,7 @@ console.log(await claudeResponse.json()); | `request-retry` | integer | 0 | 请求重试次数。如果HTTP响应码为403、408、500、502、503或504,将会触发重试。 | | `remote-management.allow-remote` | boolean | false | 是否允许远程(非localhost)访问管理接口。为false时仅允许本地访问;本地访问同样需要管理密钥。 | | `remote-management.secret-key` | string | "" | 管理密钥。若配置为明文,启动时会自动进行bcrypt加密并写回配置文件。若为空,管理接口整体不可用(404)。 | +| `remote-management.disable-control-panel` | boolean | false | 当为 true 时,不再下载 `management.html`,且 `/management.html` 会返回 404,从而禁用内置管理界面。 | | `quota-exceeded` | object | {} | 用于处理配额超限的配置。 | | `quota-exceeded.switch-project` | boolean | true | 当配额超限时,是否自动切换到另一个项目。 | | `quota-exceeded.switch-preview-model` | boolean | true | 当配额超限时,是否自动切换到预览模型。 | @@ -337,6 +340,9 @@ remote-management: # 若为空,/v0/management 整体处于 404(禁用)。 secret-key: "" + # 当设为 true 时,不下载管理面板文件,/management.html 将直接返回 404。 + disable-control-panel: false + # 身份验证目录(支持 ~ 表示主目录)。如果你使用Windows,建议设置成`C:/cli-proxy-api/`。 auth-dir: "~/.cli-proxy-api"