logo
icon

HubProxy

Self-hosted acceleration proxy for Docker registries, GitHub files, and Hugging Face downloads.

template cover
Implementado1 veces
Editor8521125
Creado2026-05-02
Etiquetas
ToolNetworking

HubProxy

HubProxy is a lightweight self-hosted acceleration proxy for Docker registries, GitHub release/raw files, and Hugging Face downloads.

What this template deploys

  • One HubProxy service from ghcr.io/sky22333/hubproxy:latest.
  • HTTP port 5000, bound to the domain selected during deployment.
  • A persistent volume mounted at /data for config.toml.
  • The container starts with cd /data && /root/hubproxy, so HubProxy reads /data/config.toml without masking the binary in /root.

Usage

Open the deployed domain to use the built-in web interface.

Docker pull acceleration:

docker pull ${ZEABUR_WEB_DOMAIN}/nginx
docker pull ${ZEABUR_WEB_DOMAIN}/ghcr.io/sky22333/hubproxy

Docker daemon registry mirror:

{
  "registry-mirrors": ["${ZEABUR_WEB_URL}"]
}

GitHub file acceleration:

curl -L ${ZEABUR_WEB_URL}/https://raw.githubusercontent.com/<owner>/<repo>/main/path/to/file -o file

Operations notes

HubProxy is intended for learning, lawful acceleration, and private/self-hosted usage. A public proxy can attract abuse, so keep rate limits enabled and adjust the access whitelist or blacklist in /data/config.toml when exposing it broadly.

The upstream Docker Compose example uses the default latest tag. If upstream publishes stable versioned container tags later, pin this template to a specific tag for more reproducible deployments.

持久化与配置迁移 (Persistence)

本模板已在服务中挂载持久化卷:

  • config -> /data:保存 /data/config.toml

HubProxy Docker 镜像的二进制文件位于 /root/hubproxy,不能把硬盘直接挂载到 /root,否则会覆盖二进制并导致 exec: "./hubproxy": stat ./hubproxy: no such file or directory。因此模板使用自定义启动命令 cd /data && /root/hubproxy,让程序从持久化目录读取 config.toml

挂载卷的操作(Dashboard):

  1. 打开项目 -> 点击该服务 -> 进入 Volumes 选项卡,点击 Mount Volumes
  2. 挂载配置卷:Volume ID 填写 config,Mount Directory 填写 /data
  3. 注意:首次挂载会清空目标挂载目录的现有文件。如果服务已经有生效配置,请先备份,再在挂载后把备份内容写回 /data/config.toml

迁移现有配置示例:

  • 备份旧配置: npx zeabur@latest service exec --name HubProxy -- cat /root/config.toml
  • 挂载卷后写入新配置: npx zeabur@latest service exec --name HubProxy -- sh -c 'cat > /data/config.toml' 然后把备份内容粘贴进去并结束输入;也可以直接在 Zeabur Dashboard 的 Config Editor 中编辑 /data/config.toml

存储建议:

  • 仅保存配置文件:100MB 即足够。
  • 如果后续 HubProxy 增加磁盘缓存能力,再按上游配置要求额外挂载缓存目录。
  • 挂载卷后服务将不支持零停机滚动更新(会先停止再启动)。