diff --git a/CLAUDE.md b/CLAUDE.md index e6068cb..5d778ca 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -76,7 +76,7 @@ Xget is a high-performance, secure acceleration engine for developer resources, 1. **Code Repositories**: gh (GitHub), gl (GitLab), gitea, codeberg, sf (SourceForge), aosp 2. **Package Managers**: npm, pypi, conda, maven, gradle, nuget, crates, etc. -3. **Container Registries**: cr-ghcr, cr-gcr, cr-mcr, cr-quay, etc. (prefixed with `cr-`) +3. **Container Registries**: cr-docker (Docker Hub), cr-ghcr, cr-gcr, cr-mcr, cr-quay, etc. (prefixed with `cr-`) 4. **AI Inference Providers**: ip-openai, ip-anthropic, ip-gemini, etc. (prefixed with `ip-`) 5. **Model/Dataset Platforms**: hf (Hugging Face), civitai 6. **Linux Distributions**: debian, ubuntu, fedora, arch, etc. @@ -95,6 +95,7 @@ Xget is a high-performance, secure acceleration engine for developer resources, - Handles Docker authentication flow with token fetching - Supports anonymous access to public repositories - All requests must use `/cr/` prefix (e.g., `/cr/ghcr/owner/repo`) +- **Docker Hub Special Handling** ([src/index.js](src/index.js):600-604): Official images (single-name like `nginx`) are automatically prefixed with `library/` for authentication scope, while user images (namespace/image) are passed through unchanged **AI Inference APIs** ([src/index.js](src/index.js):110-146) diff --git a/README.en.md b/README.en.md index b31aa75..5e083f4 100644 --- a/README.en.md +++ b/README.en.md @@ -694,6 +694,7 @@ Xget supports multiple container registries, using the `cr/[Registry Prefix]` fo | Container Registry | Registry Prefix | Original URL Format | Accelerated URL Format | |-------------------|----------------|---------------------|------------------------| +| Docker Hub | `docker` | `https://registry-1.docker.io/...` | `https://xget.xi-xu.me/cr/docker/...` | | Quay.io | `quay` | `https://quay.io/...` | `https://xget.xi-xu.me/cr/quay/...` | | Google Container Registry | `gcr` | `https://gcr.io/...` | `https://xget.xi-xu.me/cr/gcr/...` | | Microsoft Container Registry | `mcr` | `https://mcr.microsoft.com/...` | `https://xget.xi-xu.me/cr/mcr/...` | @@ -712,6 +713,18 @@ Xget supports multiple container registries, using the `cr/[Registry Prefix]` fo | Gitpod Registry | `gitpod` | `https://registry.gitpod.io/...` | `https://xget.xi-xu.me/cr/gitpod/...` | ```url +# Docker Hub original URL (official images) +https://registry-1.docker.io/v2/library/nginx/manifests/latest + +# Converted (add cr/docker prefix) +https://xget.xi-xu.me/cr/docker/v2/nginx/manifests/latest + +# Docker Hub original URL (user images) +https://registry-1.docker.io/v2/nginxinc/nginx-unprivileged/manifests/latest + +# Converted (add cr/docker prefix) +https://xget.xi-xu.me/cr/docker/v2/nginxinc/nginx-unprivileged/manifests/latest + # GitHub Container Registry original URL https://ghcr.io/v2/nginxinc/nginx-unprivileged/manifests/latest diff --git a/README.md b/README.md index d6f5a6f..664c94e 100644 --- a/README.md +++ b/README.md @@ -703,6 +703,7 @@ Xget 支持多个容器注册表,使用 `cr/[容器注册表前缀]` 格式: | 容器注册表 | 容器注册表前缀 | 原始 URL 格式 | 加速 URL 格式 | |----------|------|--------------|--------------| +| Docker Hub | `docker` | `https://registry-1.docker.io/...` | `https://xget.xi-xu.me/cr/docker/...` | | Quay.io | `quay` | `https://quay.io/...` | `https://xget.xi-xu.me/cr/quay/...` | | 谷歌容器注册表 | `gcr` | `https://gcr.io/...` | `https://xget.xi-xu.me/cr/gcr/...` | | 微软容器注册表 | `mcr` | `https://mcr.microsoft.com/...` | `https://xget.xi-xu.me/cr/mcr/...` | @@ -721,6 +722,18 @@ Xget 支持多个容器注册表,使用 `cr/[容器注册表前缀]` 格式: | Gitpod 注册表 | `gitpod` | `https://registry.gitpod.io/...` | `https://xget.xi-xu.me/cr/gitpod/...` | ```url +# Docker Hub 原始 URL(官方镜像) +https://registry-1.docker.io/v2/library/nginx/manifests/latest + +# 转换后(添加 cr/docker 前缀) +https://xget.xi-xu.me/cr/docker/v2/nginx/manifests/latest + +# Docker Hub 原始 URL(用户镜像) +https://registry-1.docker.io/v2/nginxinc/nginx-unprivileged/manifests/latest + +# 转换后(添加 cr/docker 前缀) +https://xget.xi-xu.me/cr/docker/v2/nginxinc/nginx-unprivileged/manifests/latest + # GitHub 容器注册表原始 URL https://ghcr.io/v2/nginxinc/nginx-unprivileged/manifests/latest