Allow CPA_AUTO_IMPORT_REMOTE from .env
Enable remote CPA import via env flag with priority over config.json, and load project .env when resolving remote settings.
This commit is contained in:
1 parent
0d8265de03
commit
06044551c7
4 files changed
+66
-9
No files matched your search
@@ -130,7 +130,8 @@ cp config.example.json config.json
|
||||
| `GROK2API_APP_KEY` | 远端 grok2api Admin |
|
||||
| `API_REVERSE_TOOLS` | 可选:外部 `cpa_xai` 父目录 |
|
||||
| `CPA_EXPORT` | `auto_register` 是否导出 CPA(`0/false` 关) |
|
||||
| `CPA_REMOTE_BASE` | 远程 CPA 根地址(配合 `cpa_auto_import_remote`) |
|
||||
| `CPA_AUTO_IMPORT_REMOTE` | 是否自动导入远程 CPA(`1/true` 开,`0/false` 关;优先于 config) |
|
||||
| `CPA_REMOTE_BASE` | 远程 CPA 根地址 |
|
||||
| `CPA_REMOTE_PASSWORD` | 远程 CPA 管理密码 |
|
||||
| `https_proxy` / `http_proxy` | 代理回退 |
|
||||
|
||||
@@ -243,15 +244,17 @@ cpa_proxy > proxy > 环境变量 https_proxy/http_proxy
|
||||
}
|
||||
```
|
||||
|
||||
或写在 `.env`:
|
||||
或全部写在 `.env`(开关也可用环境变量):
|
||||
|
||||
```bash
|
||||
CPA_AUTO_IMPORT_REMOTE=1
|
||||
CPA_REMOTE_BASE=http://127.0.0.1:8317
|
||||
CPA_REMOTE_PASSWORD=你的管理密码
|
||||
```
|
||||
|
||||
说明:
|
||||
|
||||
- `CPA_AUTO_IMPORT_REMOTE=1/true/yes` 开启,`0/false/no` 关闭;**env 优先于** `config.json`
|
||||
- **只填根地址**(到端口即可);程序会请求
|
||||
`POST {base}/v0/management/auth-files?name=xai-email.json`
|
||||
- 认证头:`Authorization: Bearer <管理密码>`(同时附带 `X-Management-Key`)
|
||||
|
||||
Reference in new issue
Block a user