Files
cellular-proxy/README.md
T
Hermes 91939c7cc2 feat: UI/CLI 配置代理账密;armv7 仅保留整包
- 面板可设置 7890 账号密码(管理 API :9091)
- cpxy auth --user/--pass/--clear/--show
- Release armv7 整包已验证,已删除分片资产
2026-07-21 12:29:57 +00:00

122 lines
3.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# cellular-proxy
轻量 **「走代理 = 走数据流量」**(无 frp,512MB 友好)。
## 语义
| 流量 | 出口 |
|------|------|
| **不走** 本代理 | 系统默认(通常 WiFi) |
| **走** 本代理 | **一律数据网卡**(自动探测并 bind |
## 全自动一键安装
无参数即可:
1. 下载源码
2. **自动探测数据网卡**(名称 / 驱动 / 次要默认路由 / 非默认物理口)
3. **写入配置并 bind 出口**
4. 安装 sing-box + systemd
5. 启动并尝试验证出口 IP
```bash
curl -fsSL 'https://gitea.chickliu.fun/Hermes/cellular-proxy/raw/branch/main/install.sh' | sudo bash
```
可选覆盖:
```bash
curl -fsSL 'https://gitea.chickliu.fun/Hermes/cellular-proxy/raw/branch/main/install.sh' | sudo bash -s -- \
--iface wwan0 \
--secret '面板密钥' \
--user proxy \
--pass '代理密码'
```
| 选项 | 说明 |
|------|------|
| (无参数) | 全自动探测 + 绑定 + 安装 + 启动 |
| `--iface` | 强制指定数据网卡 |
| `--secret` | 面板密钥(默认随机) |
| `--user` / `--pass` | 代理鉴权 |
| `--port` / `--panel-port` | 默认 7890 / 9090 |
| `--memory` | MemoryMax MB,默认 96 |
| `--skip-start` / `--skip-verify` | 跳过启动或验证 |
装完:
```bash
cpxy verify # 直连 IP ≠ 代理 IP
cpxy rebind # 重插卡后重新自动探测并绑定
cpxy detect # 查看评分/驱动
cpxy status | logs
cpxy auth --user u --pass p # 设置 7890 代理账号密码
cpxy auth --show # 查看鉴权状态
cpxy auth --clear # 清除鉴权
```
- 代理:`LAN-IP:7890`HTTP + SOCKS5
- 面板:`http://LAN-IP:9090/ui/`(密钥在安装结束输出 / `settings.conf`
- **UI 可直接配置代理账号密码**(管理 API 默认 `9091`,与面板 secret 相同)
## 自动探测逻辑(摘要)
按分数选择,优先:
1. 驱动像蜂窝/USB 拨号:`qmi_wwan``cdc_mbim``cdc_ether``rndis_host`
2. 名称含:`wwan` / `wwp` / `usb` / `enx` / `ppp` / `rmnet` / `ccmni`
3. **不是** 系统默认路由网卡(默认通常是 WiFi)
4. 多默认路由时取次要默认口
5. 回退:任意非默认且有 IPv4 的物理网卡
探测失败会直接报错并提示用 `--iface`
## 手动安装
```bash
git clone https://gitea.chickliu.fun/Hermes/cellular-proxy.git
cd cellular-proxy
sudo ./scripts/install.sh # 同样会自动探测并绑定
```
## 资源
- 单进程 sing-box
- 中文静态面板 ~20KB
- 默认 `MemoryMax=96MB`
## 二进制从哪里下?
**优先 Gitea Release 预置包**(一键安装默认走 Gitea,无需访问 GitHub):
```text
https://gitea.chickliu.fun/Hermes/cellular-proxy/releases/download/bin-v1.11.7/sing-box-1.11.7-linux-amd64.tar.gz
https://gitea.chickliu.fun/Hermes/cellular-proxy/releases/download/bin-v1.11.7/sing-box-1.11.7-linux-arm64.tar.gz
https://gitea.chickliu.fun/Hermes/cellular-proxy/releases/download/bin-v1.11.7/sing-box-1.11.7-linux-armv7.tar.gz
```
下载顺序:`Gitea 整包``Gitea 分片合并(兜底)``GitHub 代理(https://git.86482425.xyz)``直连 GitHub`
## 代理账号密码(更优雅的方式)
| 方式 | 说明 |
|------|------|
| **面板 UI** | 打开 `http://LAN-IP:9090/ui/`,填 secret → 「代理账号密码」保存 |
| **CLI** | `sudo cpxy auth --user u --pass p` |
| **安装时** | `--user` / `--pass` |
| **改文件** | `settings.conf``PROXY_USER` / `PROXY_PASS``cpxy generate` |
管理 API`POST http://LAN-IP:9091/proxy-auth`Header `Authorization: Bearer <PANEL_SECRET>`
维护者更新预置包(从 GitHub 经代理拉再上传 Gitea):
```bash
set -a; source ~/.hermes/env/gitea.env; set +a
ARCHS='amd64 arm64 armv7' ./scripts/publish-binaries-to-gitea.sh
```
## 安全
局域网监听建议设置 `--user/--pass`;面板 secret 已默认随机生成。
`REQUIRE_CELLULAR_IFACE=true`:数据口不在则不装/不生成假出口。