Files
xxxig-proxy/README.md
T
wangdefaandClaude Opus 4.8 3114521a35
Build and Release / release (push) Successful in 7s
Build and Release / build-and-test (amd64) (push) Successful in 12s
Build and Release / build-and-test (arm64) (push) Successful in 1m38s
改用 musl 全静态修复 DNS 解析,并规范 Dockerfile 与产物命名
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 09:40:10 +08:00

91 lines
3.5 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.
# XXXig Proxy
XXXig Proxy 是 [XMRig-Proxy](https://github.com/xmrig/xmrig-proxy) 的定制构建——**无捐献改造版**的 Monero (RandomX) 矿机代理。
代理的作用:把大量矿机聚合成到上游矿池的少数几条连接,降低矿池侧连接数与网络开销,并统一管理矿机接入。
**本仓库只包含构建与打包基础设施**,不含代理源码:二进制在 CI 中从上游源码仓库 `github.com/wangdefaa/xxxig-proxy` 编译,再打包分发到 [gitea.bcde.io](https://gitea.bcde.io) 的 Generic / Debian 包仓库。
## 产物
每次构建产出单个可执行文件(网络服务,**全静态链接**,含 OpenSSL/libuv,无外部动态库依赖,任意 Linux 发行版可跑):
| 二进制 | 作用 |
|---|---|
| `xxxig-proxy` | 矿机代理服务:监听矿机接入,聚合转发到上游矿池 |
支持架构 `amd64` / `arm64`musl 全静态,任意 Linux 发行版(Debian/Ubuntu/Alpine/CentOS 等)开箱即跑。
> 与矿工项目 `xxxig``xxxig` / `xxxigDaemon` / `xxxigServer` 三件套 + Web 控制台)不同,proxy 是**单二进制、无 C&C、无 GPU**。
## 安装
### APTDebian / Ubuntu
```bash
sudo curl https://gitea.bcde.io/api/packages/wangdefa/debian/repository.key -o /etc/apt/keyrings/gitea-wangdefa.asc
echo "deb [signed-by=/etc/apt/keyrings/gitea-wangdefa.asc] https://gitea.bcde.io/api/packages/wangdefa/debian stable main" | sudo tee /etc/apt/sources.list.d/wangdefa.list
sudo apt-get update && sudo apt-get install xxxig-proxy
```
安装布局:
| | 路径 |
|---|---|
| 二进制 | `/opt/xxxig-proxy/xxxig-proxy` |
| 默认配置 | `/opt/xxxig-proxy/config.json`postinst 复制到 `/etc/xxxig-proxy/config.json` |
| 日志 | `/var/log/xxxig-proxy/` |
| 服务 | `xxxig-proxy.service` |
> 安装后服务**不会自动启动**(默认上游为 `localhost`,无实际意义)。先编辑 `/etc/xxxig-proxy/config.json` 配好上游矿池,再启用:
>
> ```bash
> sudo systemctl enable --now xxxig-proxy
> ```
### tar.gz(通用:Alpine / Ubuntu / Debian
从 Generic Package Registry 下载对应架构/发行版的 tar.gz 解压即用:
```bash
curl -fSL -o xxxig-proxy.tar.gz \
https://gitea.bcde.io/api/packages/wangdefa/generic/xxxig-proxy/6.26.0/xxxig-proxy-amd64-linux-static-6.26.0.tar.gz
tar -xzf xxxig-proxy.tar.gz
./xxxig-proxy -c config.json
```
## 构建与发布
CI 定义于 [.gitea/workflows/ci.yaml](.gitea/workflows/ci.yaml)
- **push 到 `main`/`develop`**:矩阵 `arch=[amd64,arm64]`,在原生 runner 上用 Dockermusl 全静态)编译为 tar.gz 并打 `.deb`
- **打 tag**:产物上传到 Generic / Debian 包仓库并创建 Release。
本地构建:
```bash
# 编译某架构/发行版二进制(输出到 ./output/linux_<arch>/
docker buildx build --platform linux/amd64 \
--build-arg XXXIG_PROXY_VERSION=v6.26.0 \
--output type=local,dest=./output \
-f docker/Dockerfile .
# 用产物 tar.gz 打 .deb
./debian/build-deb.sh amd64 6.26.0 xxxig-proxy-amd64-linux-static-6.26.0.tar.gz
```
## 版本号约定
- **上游源码 git tag** 带 `v`(如 `v6.26.0`),CI 用 `XXXIG_PROXY_VERSION=v${PACKAGE_VERSION}` 检出。
- **包版本**tar.gz / deb / registry 路径)一律用数字(如 `6.26.0`),符合 Debian 版本规范。
发版只需改 ci.yaml 的 `PACKAGE_VERSION`
## 目录结构
```
.gitea/workflows/ CI 流水线
docker/ Dockerfilemusl 全静态,从上游源码编译)
debian/ .deb 打包:control 模板、维护脚本、systemd 服务
```