CliProxyApi自部署记录
1.克隆仓库并进入目录
git clone https://github.com/router-for-me/CLIProxyAPI.git
cd CLIProxyAPI
2.复制并修改示例文件。
cp config.example.yaml config.yaml
nano config.yaml
通过nano自行调整config中的配置
host: "0.0.0.0"
port: 8317
remote-management:
allow-remote: true
secret-key: "123456"
disable-control-panel: false
api-keys:
- "sk-xxxxx"
- "sk-xxxxx"
- "sk-xxxxx"
logging-to-file: true
logs-max-total-size-mb: 200
Host改为0.0.0.0
Port保持8317
allow-remote设置为true,打开管理GUI面板
secret-key设置为管理员明文密码
disable-control-panel保持false不用管
api-keys底下配置你想要的apikey
logging-to-file设置为true
logs-max-total-size-mb设置为200
nano docker-compose.yml
通过nano调整docker-compose.yml
ports:
- "127.0.0.1:8317:8317"
...
Ports下面的8317改为127.0.0.1:8317 仅本机部署,后续用CF Tunnel代理出去
3.启动服务,并测试
启动服务:
docker compose up -d
curl http://127.0.0.1:8317
如果能正常显示,代表本机部署完成。
4.常用操作
启动服务:
docker compose up -d
查看服务器日志:
docker compose logs -f
停止服务:
docker compose down