⚙️ 概览

MirrorProxy 是一款基于 Rust 编写的高性能自托管镜像代理平台。内嵌 React 管理控制台,支持对 GitHub、Docker/OCI、语言包仓库(npm、PyPI、Go、Cargo 等)以及操作系统软件源(Debian、Ubuntu、Fedora、Arch Linux 等)进行代理转发、缓存、配额管理与流量统计。

  • 版本: MirrorProxy latest (kudang/mirrorproxy:latest)
  • 后端监听端口: 25781
  • 部署目录: /opt/mirrorproxy
  • 默认管理员账号: admin
  • 默认管理员密码: <YOUR_ADMIN_PASSWORD>

🛠️ 部署架构与配置文件

配置文件路径: /opt/mirrorproxy/config.toml
Docker 编排文件: /opt/mirrorproxy/docker-compose.yml

listen_addr = "0.0.0.0:3000"
database_path = "/data/mirrorproxy.sqlite3"
public_base_url = "http://localhost:25781"
forward_client_authorization = false

enabled_proxies = [
  "github", "composer", "oci", "npm", "nvm", "go", "maven",
  "rustup", "crates", "pypi", "homebrew", "os"
]

[upstreams]
github = "https://github.com"
github_raw = "https://raw.githubusercontent.com"
docker_hub = "https://registry-1.docker.io"
ghcr = "https://ghcr.io"
npm = "https://registry.npmjs.org"
go_proxy = "https://proxy.golang.org"
pypi_simple = "https://pypi.org/simple"
pypi_files = "https://files.pythonhosted.org"
debian = "https://deb.debian.org/debian"
ubuntu = "https://archive.ubuntu.com/ubuntu"

🌐 代理服务调用 URL 格式

当服务绑定在 25781 端口后,可以通过以下 URL 代理拉取资源:

  • GitHub Raw 文件代理: http://localhost:25781/gh/owner/repo/main/file.txt
  • Docker / OCI 镜像代理: http://localhost:25781/v2/
  • npm 镜像代理: npm config set registry http://localhost:25781/npm/
  • PyPI 镜像代理: pip install -i http://localhost:25781/pypi/simple/ package_name

🚀 服务管理指令

# 查看容器状态
cd /opt/mirrorproxy && docker compose ps

# 查看日志
cd /opt/mirrorproxy && docker compose logs -f

# 重启 MirrorProxy
cd /opt/mirrorproxy && docker compose restart