From 165c57b8e7a8ab440cf10a4ededc90d1d13cf26d Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Sat, 13 Dec 2025 19:07:40 +0800 Subject: [PATCH] Translate README.md to English and update links The README.md has been fully translated from Chinese to English, including section titles, descriptions, and platform-specific instructions. All internal anchor links and badge references have been updated to use English section names, and example URLs and explanations are now in English. The language switch link now points to the Simplified Chinese README, and terminology throughout the document has been standardized for an international audience. --- README.md | 1696 ++++++++++++++--------------- README.en.md => README.zh-Hans.md | 1696 +++++++++++++++-------------- 2 files changed, 1696 insertions(+), 1696 deletions(-) rename README.en.md => README.zh-Hans.md (52%) diff --git a/README.md b/README.md index 4ffefb4..9548d4f 100644 --- a/README.md +++ b/README.md @@ -2,162 +2,153 @@ # Xget 🚀 -> 🗳️ **Xget 正在参加 [Gitee 2025 年度开源软件评选](https://gitee.com/activity/2025opensource?ident=IB55NH),请为我们投上宝贵的一票!感谢您的支持!** 🙏 +> 🗳️ **Xget is participating in the [Gitee 2025 Open Source Software Awards](https://gitee.com/activity/2025opensource?ident=IB55NH). Please vote for us! Thank you for your support!** 🙏 xixu-me%2FXget | Trendshift Xget | Product Hunt [![Ask Zread](https://img.shields.io/badge/Ask_Zread-_.svg?style=flat&color=00b0aa&labelColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuOTYxNTYgMS42MDAxSDIuMjQxNTZDMS44ODgxIDEuNjAwMSAxLjYwMTU2IDEuODg2NjQgMS42MDE1NiAyLjI0MDFWNC45NjAxQzEuNjAxNTYgNS4zMTM1NiAxLjg4ODEgNS42MDAxIDIuMjQxNTYgNS42MDAxSDQuOTYxNTZDNS4zMTUwMiA1LjYwMDEgNS42MDE1NiA1LjMxMzU2IDUuNjAxNTYgNC45NjAxVjIuMjQwMUM1LjYwMTU2IDEuODg2NjQgNS4zMTUwMiAxLjYwMDEgNC45NjE1NiAxLjYwMDFaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00Ljk2MTU2IDEwLjM5OTlIMi4yNDE1NkMxLjg4ODEgMTAuMzk5OSAxLjYwMTU2IDEwLjY4NjQgMS42MDE1NiAxMS4wMzk5VjEzLjc1OTlDMS42MDE1NiAxNC4xMTM0IDEuODg4MSAxNC4zOTk5IDIuMjQxNTYgMTQuMzk5OUg0Ljk2MTU2QzUuMzE1MDIgMTQuMzk5OSA1LjYwMTU2IDE0LjExMzQgNS42MDE1NiAxMy43NTk5VjExLjAzOTlDNS42MDE1NiAxMC42ODY0IDUuMzE1MDIgMTAuMzk5OSA0Ljk2MTU2IDEwLjM5OTlaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik0xMy43NTg0IDEuNjAwMUgxMS4wMzg0QzEwLjY4NSAxLjYwMDEgMTAuMzk4NCAxLjg4NjY0IDEwLjM5ODQgMi4yNDAxVjQuOTYwMUMxMC4zOTg0IDUuMzEzNTYgMTAuNjg1IDUuNjAwMSAxMS4wMzg0IDUuNjAwMUgxMy43NTg0QzE0LjExMTkgNS42MDAxIDE0LjM5ODQgNS4zMTM1NiAxNC4zOTg0IDQuOTYwMVYyLjI0MDFDMTQuMzk4NCAxLjg4NjY0IDE0LjExMTkgMS42MDAxIDEzLjc1ODQgMS42MDAxWiIgZmlsbD0iI2ZmZiIvPgo8cGF0aCBkPSJNNCAxMkwxMiA0TDQgMTJaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00IDEyTDEyIDQiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L3N2Zz4K&logoColor=ffffff)](https://zread.ai/xixu-me/Xget) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/xixu-me/Xget) -[![Chromium](https://img.shields.io/badge/Chromium-4285F4?logo=googlechrome&logoColor=white)](#-生态系统集成) -[![Firefox](https://img.shields.io/badge/Firefox-FF7139?logo=Firefox&logoColor=white)](#-生态系统集成) +[![Chromium](https://img.shields.io/badge/Chromium-4285F4?logo=googlechrome&logoColor=white)](#-ecosystem-integration) +[![Firefox](https://img.shields.io/badge/Firefox-FF7139?logo=Firefox&logoColor=white)](#-ecosystem-integration) -[![Cloudflare](https://img.shields.io/badge/Cloudflare-F38020?&logo=cloudflare&logoColor=white)](#部署到-cloudflare-workers) -[![EdgeOne](https://img.shields.io/badge/EdgeOne-006EFF?&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAACNklEQVR4nJ1W7XHbMAx96ul/lQnCDapOUG3gdIIkG6QjdINOUGeDNhNYmUDuBHIWiNQF/PqDYAxDoMUGdzx+AXgAAQGqSKKAOgAbma8BXMn5DGAv4wlAv6qJ5KVxR3LkOR3NWu9HkcnqzF0EkoMDcsysLd8oOooAb0lOF7wqpYnkzRrgZkVJ8mp0jLFzotscYOC6ZyNjjLbOnTZI7weSjQc4ZoQmkjuSneIdMoADyR9iVKuB0qglWYOT0n9Uys/qPAD4ZHgfAXwzfO/6LLyxcTxbJEdufFi1aEk32l6Z+1Lhep1lQa1aVwI2O3wBsTIFxOoUADzVspgzQp6S1pztATRyvpG5lTNLTUVykssJwF91OQP4bATuAGzVngBexJD0vJW51/u5VpZc4VSUgViMLX1xlIUCoERNLoYE8Ns579S6chTngGYZh1oWjRGoEGOjKSAGP/HovqblDoiJtAfwLPv5xHnqCrbNeK3K8qX9juQDMx3CVpoesXLop7DeATF+2rsKsbo8oizD3zzsjLWk30RHw7N7R5V68/AgMUpeWg9bLLOxL/AniOw1Yp58t/FZi5+mzuFrJJY/Sb6qFzmmV9PMgzBsHUW/eN5gJwdk54Rm4YTXgHPx00p24qEGydFElb3e09nUbpXVuZ+oS/88Z62rJLMelHAJSDqf6LxWSXvS35/+Vr0SlqrPHsBXxOw/o5IGHDLKE4AucS8A7hG7zAIMACryv371WxkfxYhZFD8jFvt+TdE/deK28xBAUlEAAAAASUVORK5CYII=)](#部署到-edgeone-pages) -[![Vercel](https://img.shields.io/badge/Vercel-000000?&logo=vercel&logoColor=white)](#部署到-vercel) -[![Netlify](https://img.shields.io/badge/Netlify-00C7B7?&logo=netlify&logoColor=white)](#部署到-netlify) -[![Deno](https://img.shields.io/badge/Deno-70FFAF?&logo=deno&logoColor=black)](#部署到-deno-deploy) -[![Docker](https://img.shields.io/badge/Docker-2496ED?&logo=docker&logoColor=white)](#自托管部署) -[![Podman](https://img.shields.io/badge/Podman-892CA0?&logo=podman&logoColor=white)](#自托管部署) +[![Cloudflare](https://img.shields.io/badge/Cloudflare-F38020?&logo=cloudflare&logoColor=white)](#deploy-to-cloudflare-workers) +[![EdgeOne](https://img.shields.io/badge/EdgeOne-006EFF?&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAACNklEQVR4nJ1W7XHbMAx96ul/lQnCDapOUG3gdIIkG6QjdINOUGeDNhNYmUDuBHIWiNQF/PqDYAxDoMUGdzx+AXgAAQGqSKKAOgAbma8BXMn5DGAv4wlAv6qJ5KVxR3LkOR3NWu9HkcnqzF0EkoMDcsysLd8oOooAb0lOF7wqpYnkzRrgZkVJ8mp0jLFzotscYOC6ZyNjjLbOnTZI7weSjQc4ZoQmkjuSneIdMoADyR9iVKuB0qglWYOT0n9Uys/qPAD4ZHgfAXwzfO/6LLyxcTxbJEdufFi1aEk32l6Z+1Lhep1lQa1aVwI2O3wBsTIFxOoUADzVspgzQp6S1pztATRyvpG5lTNLTUVykssJwF91OQP4bATuAGzVngBexJD0vJW51/u5VpZc4VSUgViMLX1xlIUCoERNLoYE8Ns579S6chTngGYZh1oWjRGoEGOjKSAGP/HovqblDoiJtAfwLPv5xHnqCrbNeK3K8qX9juQDMx3CVpoesXLop7DeATF+2rsKsbo8oizD3zzsjLWk30RHw7N7R5V68/AgMUpeWg9bLLOxL/AniOw1Yp58t/FZi5+mzuFrJJY/Sb6qFzmmV9PMgzBsHUW/eN5gJwdk54Rm4YTXgHPx00p24qEGydFElb3e09nUbpXVuZ+oS/88Z62rJLMelHAJSDqf6LxWSXvS35/+Vr0SlqrPHsBXxOw/o5IGHDLKE4AucS8A7hG7zAIMACryv371WxkfxYhZFD8jFvt+TdE/deK28xBAUlEAAAAASUVORK5CYII=)](#deploy-to-edgeone-pages) +[![Vercel](https://img.shields.io/badge/Vercel-000000?&logo=vercel&logoColor=white)](#deploy-to-vercel) +[![Netlify](https://img.shields.io/badge/Netlify-00C7B7?&logo=netlify&logoColor=white)](#deploy-to-netlify) +[![Deno](https://img.shields.io/badge/Deno-70FFAF?&logo=deno&logoColor=black)](#deploy-to-deno-deploy) +[![Docker](https://img.shields.io/badge/Docker-2496ED?&logo=docker&logoColor=white)](#self-hosted-deployment) +[![Podman](https://img.shields.io/badge/Podman-892CA0?&logo=podman&logoColor=white)](#self-hosted-deployment) -***[English](README.en.md)*** +***[汉语(简体)](README.zh-Hans.md)*** [![GitHub](https://img.shields.io/badge/GitHub-181717?&logo=github&logoColor=white)](#github) [![GitLab](https://img.shields.io/badge/GitLab-FC6D26?&logo=gitlab&logoColor=white)](#gitlab) [![Gitea](https://img.shields.io/badge/Gitea-609926?&logo=gitea&logoColor=white)](#gitea) [![Codeberg](https://img.shields.io/badge/Codeberg-2185D0?&logo=codeberg&logoColor=white)](#codeberg) [![SourceForge](https://img.shields.io/badge/SourceForge-FF6600?&logo=sourceforge&logoColor=white)](#sourceforge) -[![AOSP](https://img.shields.io/badge/AOSP-3DDC84?&logo=android&logoColor=white)](#aosp-android-%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE) -[![Hugging Face](https://img.shields.io/badge/Hugging%20Face-FFD21E?&logo=huggingface&logoColor=black)](#hugging-face-镜像) -[![Civitai](https://img.shields.io/badge/Civitai-1971C2)](#civitai-ai-模型平台) -[![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](#npm-包管理加速) -[![PyPI](https://img.shields.io/badge/PyPI-3775A9?logo=pypi&logoColor=white)](#python-包管理加速) -[![conda](https://img.shields.io/badge/conda-44A833?logo=anaconda&logoColor=white)](#conda-包管理加速) -[![Maven](https://img.shields.io/badge/Maven-C71A36?logo=apachemaven&logoColor=white)](#maven-包管理加速) -[![Apache](https://img.shields.io/badge/Apache-D22128?logo=apache&logoColor=white)](#apache-软件下载加速) -[![Gradle](https://img.shields.io/badge/Gradle-02303A?logo=gradle&logoColor=white)](#gradle-包管理加速) -[![Homebrew](https://img.shields.io/badge/Homebrew-FBB040?logo=homebrew&logoColor=black)](#homebrew-包管理加速) -[![RubyGems](https://img.shields.io/badge/RubyGems-E9573F?logo=rubygems&logoColor=white)](#ruby-包管理加速) -[![CRAN](https://img.shields.io/badge/CRAN-276DC3?logo=r&logoColor=white)](#r-包管理加速) -[![CPAN](https://img.shields.io/badge/CPAN-0073A1?logo=perl&logoColor=white)](#perl-包管理加速) -[![CTAN](https://img.shields.io/badge/CTAN-008080?logo=latex&logoColor=white)](#texlatex-包管理加速) -[![Go](https://img.shields.io/badge/Go-00ADD8?logo=go&logoColor=white)](#go-模块加速) -[![NuGet](https://img.shields.io/badge/NuGet-004880?logo=nuget&logoColor=white)](#nuget-包管理加速) -[![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white)](#rust-包管理加速) -[![Packagist](https://img.shields.io/badge/Packagist-F28D1A?logo=packagist&logoColor=white)](#php-包管理加速) -[![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=white)](#debianubuntu-apt-配置) -[![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?logo=ubuntu&logoColor=white)](#debianubuntu-apt-配置) -[![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=white)](#fedora-dnf-配置) -[![Rocky Linux](https://img.shields.io/badge/Rocky%20Linux-10B981?logo=rockylinux&logoColor=white)](#rocky-linux-dnf-配置) -[![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?logo=opensuse&logoColor=white)](#opensuse-zypper-配置) -[![Arch Linux](https://img.shields.io/badge/Arch%20Linux-1793D1?logo=archlinux&logoColor=white)](#arch-linux-pacman-配置) -[![arXiv](https://img.shields.io/badge/arXiv-B31B1B?logo=arxiv&logoColor=white)](#arxiv-论文下载) -[![F-Droid](https://img.shields.io/badge/F--Droid-1976D2?logo=f-droid&logoColor=white)](#f-droid-存储库镜像) -[![Jenkins](https://img.shields.io/badge/Jenkins-D24939?logo=jenkins&logoColor=white)](#jenkins-插件下载) -[![容器注册表](https://img.shields.io/badge/容器注册表-262261?logo=opencontainersinitiative&logoColor=white)](#容器注册表) -[![AI 推理提供商](https://img.shields.io/badge/AI%20推理提供商-94A3B8?logo=openrouter&logoColor=white)](#ai-推理提供商) +[![AOSP](https://img.shields.io/badge/AOSP-3DDC84?&logo=android&logoColor=white)](#aosp-android-open-source-project) +[![Hugging Face](https://img.shields.io/badge/Hugging%20Face-FFD21E?&logo=huggingface&logoColor=black)](#hugging-face-mirror) +[![Civitai](https://img.shields.io/badge/Civitai-1971C2)](#civitai-ai-model-platform) +[![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](#npm-package-acceleration) +[![PyPI](https://img.shields.io/badge/PyPI-3775A9?logo=pypi&logoColor=white)](#python-package-acceleration) +[![conda](https://img.shields.io/badge/conda-44A833?logo=anaconda&logoColor=white)](#conda-package-acceleration) +[![Maven](https://img.shields.io/badge/Maven-C71A36?logo=apachemaven&logoColor=white)](#maven-package-acceleration) +[![Apache](https://img.shields.io/badge/Apache-D22128?logo=apache&logoColor=white)](#apache-software-download-acceleration) +[![Gradle](https://img.shields.io/badge/Gradle-02303A?logo=gradle&logoColor=white)](#gradle-package-acceleration) +[![Homebrew](https://img.shields.io/badge/Homebrew-FBB040?logo=homebrew&logoColor=black)](#homebrew-package-acceleration) +[![RubyGems](https://img.shields.io/badge/RubyGems-E9573F?logo=rubygems&logoColor=white)](#ruby-package-acceleration) +[![CRAN](https://img.shields.io/badge/CRAN-276DC3?logo=r&logoColor=white)](#r-package-acceleration) +[![CPAN](https://img.shields.io/badge/CPAN-0073A1?logo=perl&logoColor=white)](#perl-package-acceleration) +[![CTAN](https://img.shields.io/badge/CTAN-008080?logo=latex&logoColor=white)](#texlatex-package-acceleration) +[![Go](https://img.shields.io/badge/Go-00ADD8?logo=go&logoColor=white)](#go-module-acceleration) +[![NuGet](https://img.shields.io/badge/NuGet-004880?logo=nuget&logoColor=white)](#nuget-package-acceleration) +[![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white)](#rust-package-acceleration) +[![Packagist](https://img.shields.io/badge/Packagist-F28D1A?logo=packagist&logoColor=white)](#php-package-acceleration) +[![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=white)](#debianubuntu-apt-configuration) +[![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?logo=ubuntu&logoColor=white)](#debianubuntu-apt-configuration) +[![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=white)](#fedora-dnf-configuration) +[![Rocky Linux](https://img.shields.io/badge/Rocky%20Linux-10B981?logo=rockylinux&logoColor=white)](#rocky-linux-dnf-configuration) +[![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?logo=opensuse&logoColor=white)](#opensuse-zypper-configuration) +[![Arch Linux](https://img.shields.io/badge/Arch%20Linux-1793D1?logo=archlinux&logoColor=white)](#arch-linux-pacman-configuration) +[![arXiv](https://img.shields.io/badge/arXiv-B31B1B?logo=arxiv&logoColor=white)](#arxiv-paper-download) +[![F-Droid](https://img.shields.io/badge/F--Droid-1976D2?logo=f-droid&logoColor=white)](#f-droid-repository-mirror) +[![Jenkins](https://img.shields.io/badge/Jenkins-D24939?logo=jenkins&logoColor=white)](#jenkins-plugin-download) +[![Container Registries](https://img.shields.io/badge/Container%20Registries-262261?logo=opencontainersinitiative&logoColor=white)](#container-registries) +[![AI Inference Providers](https://img.shields.io/badge/AI%20Inference%20Providers-94A3B8?logo=openrouter&logoColor=white)](#ai-inference-providers) -面向开发者资源的超高性能、安全、一体化加速引擎,其性能显著优于传统解决方案,为代码存储库、模型和数据集中心、软件包注册表、容器注册表、AI 推理提供商等提供统一、高效的加速。 +Ultra-high-performance, secure, all-in-one acceleration engine for developer resources that significantly outperforms traditional solutions, delivering unified, efficient acceleration across code repositories, model and dataset hubs, package registries, container registries, AI inference providers, and more. -技术深度解析文章已发布:**[《深入剖析 Xget:一个高性能、多协议、高安全性的开发者资源加速引擎》](https://blog.xi-xu.me/2025/10/07/deep-dive-into-xget-technology.html)**。 +In-depth technical analysis article published: ***[Deep Dive into Xget: A High-Performance, Multi-Protocol, and Secure Acceleration Engine for Developer Resources](https://blog.xi-xu.me/2025/10/07/deep-dive-into-xget-technology-en.html)***. -## 💡 存储库初衷 +## 🎯 Quick Start -本存储库的初衷是为了加速在中国大陆境内访问不违反相关法律法规的平台上的开发者资源,从而为广大开发者提供一个稳定、合法的加速体验。我们致力于: +**Pre-deployed Instance (no reliability guarantee): `xget.xi-xu.me`** -- **🌍 消除地理限制**:帮助中国大陆开发者快速访问海外开发者资源 -- **⚖️ 合规合法**:严格遵守相关法律法规,仅加速合法资源 -- **🚀 提升效率**:显著提高开发者的工作效率和开发体验 -- **🆓 普惠开源**:为开源社区贡献力量,促进技术交流与发展 +**URL Converter:** [**`xuc.xi-xu.me`**](https://xuc.xi-xu.me) - Convert any supported platform URL to Xget's acceleration format with one click! -## 🎯 快速使用 +## 🌟 Core Advantages - Why Choose Xget? -**预部署实例(不保证可靠性):`xget.xi-xu.me`** +### ⚡ Extreme Performance - Breaking Through Traditional Accelerator Bottlenecks -**URL 转换器:**[**`xuc.xi-xu.me`**](https://xuc.xi-xu.me) - 一键转换任意支持平台的 URL 为 Xget 的加速格式! +- **⚡ Millisecond Response**: Cloudflare's global 330+ edge nodes, average response time < 50ms +- **🌐 HTTP/3 Ultra-Fast Protocol**: Latest HTTP/3 protocol enabled, 40% reduction in connection latency, 30% increase in transmission speed +- **📦 Intelligent Multi-Compression**: Triple compression algorithms (gzip, deflate, brotli), 60% improvement in transmission efficiency +- **🔗 Zero-Latency Pre-Connection**: Connection warm-up and keep-alive, eliminating handshake overhead for second-level responses +- **⚡ Parallel Chunked Download**: Full support for HTTP Range requests, multiplied multi-threaded download speeds +- **🎯 Smart Routing Optimization**: Automatically selects optimal transmission paths, avoiding network congestion nodes -## 🌟 核心优势 - 为什么选择 Xget? +### 🌐 Deep Multi-Platform Integration -### ⚡ 极速性能 - 突破传统加速器瓶颈 +- **All-in-One Multi-Platform Support**: Unified support for mainstream platforms in various development scenarios +- **Intelligent Recognition and Conversion**: Automatically recognizes platform prefixes and converts to correct URL structures for target platforms +- **Consistent Acceleration Experience**: Enjoy unified and stable ultra-fast download experience regardless of file type or source -- **⚡ 毫秒级响应**:Cloudflare 全球 330+ 边缘节点,平均响应时间 < 50ms -- **🌐 HTTP/3 极速协议**:启用最新 HTTP/3 协议,连接延迟降低 40%,传输速度提升 30% -- **📦 智能多重压缩**:gzip、deflate、brotli 三重压缩算法,传输效率提升 60% -- **🔗 零延迟预连接**:连接预热和保持活跃,消除握手开销,实现秒级响应 -- **⚡ 并行分片下载**:完整支持 HTTP Range 请求,多线程下载速度倍增 -- **🎯 智能路由优化**:自动选择最优传输路径,避开网络拥堵节点 +### 🔒 Enterprise-Grade Security -### 🌐 多平台深度集成 +- **Multi-Layer Security Headers**: + - `Strict-Transport-Security`: Enforces HTTPS transmission, prevents man-in-the-middle attacks + - `X-Frame-Options: DENY`: Prevents clickjacking attacks + - `X-XSS-Protection`: Built-in XSS protection mechanism + - `Content-Security-Policy`: Strict content security policy + - `Referrer-Policy`: Controls referrer information leakage +- **Request Validation Mechanism**: + - HTTP method whitelist: Regular requests limited to GET/HEAD, Git operations dynamically allow POST + - Path length limit: Prevents excessively long URL attacks (max 2048 characters) + - Input sanitization: Prevents path traversal and injection attacks +- **Timeout Protection**: 30-second request timeout, prevents resource exhaustion and malicious requests -- **一站式多平台支持**:统一支持各种开发场景中的主流平台 -- **智能识别与转换**:自动识别平台前缀并转换为目标平台的正确 URL 结构 -- **一致的加速体验**:无论文件类型或来源,均可享受统一且稳定的极速下载体验 +### 🚀 Modern Architecture and Reliability -### 🔒 企业级安全保障 +- **Intelligent Retry Mechanism**: + - Maximum 3 retries with linear delay strategy (1000ms × retry count) + - Automatic error recovery, improved download success rate + - Timeout detection and interruption handling +- **Efficient Caching Strategy**: + - 1800 seconds (30 minutes) default cache duration, significantly reduces origin server pressure + - Git operations skip caching to ensure real-time data + - Edge caching based on Cloudflare Cache API +- **Performance Monitoring System**: + - Built-in `PerformanceMonitor` class for real-time tracking of request stage durations + - Detailed performance data provided via `X-Performance-Metrics` response header + - Cache hit rate statistics and optimization recommendations -- **多层安全标头**: - - `Strict-Transport-Security`:强制 HTTPS 传输,预防中间人攻击 - - `X-Frame-Options: DENY`:防止点击劫持攻击 - - `X-XSS-Protection`:内置 XSS 防护机制 - - `Content-Security-Policy`:严格的内容安全策略 - - `Referrer-Policy`:控制引用信息泄露 -- **请求验证机制**: - - HTTP 方法白名单:常规请求限制为 GET/HEAD,Git 操作动态允许 POST - - 路径长度限制:防止超长 URL 攻击(最大 2048 字符) - - 输入清理:防止路径遍历和注入攻击 -- **超时保护**:30 秒请求超时,防止资源耗尽和恶意请求 +### 🎯 Full Git Protocol Compatibility -### 🚀 现代架构与可靠性 +- **Smart Protocol Detection**: + - Automatically recognizes Git-specific endpoints (`/info/refs`, `/git-upload-pack`, `/git-receive-pack`) + - Detects Git client User-Agent patterns + - Supports query parameters like `service=git-upload-pack` +- **Complete Operation Support**: + - `git clone`: Full repository cloning, supports shallow clones and branch specification + - `git push`: Code push and branch management + - `git pull/fetch`: Incremental updates and remote synchronization + - `git submodule`: Recursive submodule cloning +- **Protocol Optimization**: + - Preserves Git-specific request headers and authentication information + - Smart User-Agent handling (default `git/2.34.1`) + - Supports Git LFS large file transfer -- **智能重试机制**: - - 最大 3 次重试,线性延迟策略(1000ms × 重试次数) - - 自动错误恢复,提高下载成功率 - - 超时检测和中断处理 -- **高效缓存策略**: - - 1800 秒(30 分钟)默认缓存时长,显著减少源站压力 - - Git 操作跳过缓存,确保实时性 - - 基于 Cloudflare Cache API 的边缘缓存 -- **性能监控系统**: - - 内置 `PerformanceMonitor` 类,实时追踪请求各阶段耗时 - - 通过 `X-Performance-Metrics` 响应头提供详细性能数据 - - 支持缓存命中率统计和优化建议 +### 📱 Ecosystem Integration -### 🎯 Git 协议完全兼容 +- **Dedicated Browser Extension**: [Xget Now](https://github.com/xixu-me/Xget-Now) provides seamless experience + - Automatic URL redirection, no manual URL modification needed + - Support for custom Xget instance domains + - Multi-platform preference settings and blacklist/whitelist management + - Local processing ensures privacy and security +- **Download Tool Compatibility**: Perfect support for wget, cURL, aria2, IDM, and other mainstream download tools +- **CI/CD Integration**: Can be used directly in GitHub Actions, GitLab CI, and other environments -- **智能协议检测**: - - 自动识别 Git 特定端点(`/info/refs`、`/git-upload-pack`、`/git-receive-pack`) - - 检测 Git 客户端 User-Agent 模式 - - 支持 `service=git-upload-pack` 等查询参数 -- **完整操作支持**: - - `git clone`:完整存储库克隆,支持浅克隆和分支指定 - - `git push`:代码推送和分支管理 - - `git pull/fetch`:增量更新和远程同步 - - `git submodule`:子模块递归克隆 -- **协议优化**: - - 保持 Git 专用请求头和认证信息 - - 智能 User-Agent 处理(默认 `git/2.34.1`) - - 支持 Git LFS 大文件传输 +## 📖 URL Conversion Rules -### 📱 生态系统集成 +Using the pre-deployed instance **`xget.xi-xu.me`** or your own deployed instance, simply replace the domain and add the platform prefix: -- **专用浏览器扩展**:[Xget Now](https://github.com/xixu-me/Xget-Now) 提供无缝体验 - - 自动 URL 重定向,无需手动修改 URL - - 支持自定义 Xget 实例域名 - - 多平台偏好设置和黑白名单管理 - - 本地处理,确保隐私安全 -- **下载工具兼容**:完美支持 wget、cURL、aria2、IDM 等主流下载工具 -- **CI/CD 集成**:可直接在 GitHub Actions、GitLab CI 等环境中使用 +### Conversion Format -## 📖 URL 转换规则 - -使用预部署实例 **`xget.xi-xu.me`** 或你自己部署的实例,只需简单替换域名并添加平台前缀: - -### 转换格式 - -| 平台 | 平台前缀 | 原始 URL 格式 | 加速 URL 格式 | -|------|----------|--------------|--------------| +| Platform | Platform Prefix | Original URL Format | Accelerated URL Format | +|----------|----------------|---------------------|------------------------| | GitHub | `gh` | `https://github.com/...` | `https://xget.xi-xu.me/gh/...` | | GitHub Gist | `gist` | `https://gist.github.com/...` | `https://xget.xi-xu.me/gist/...` | | GitLab | `gl` | `https://gitlab.com/...` | `https://xget.xi-xu.me/gl/...` | @@ -169,7 +160,7 @@ | Civitai | `civitai` | `https://civitai.com/...` | `https://xget.xi-xu.me/civitai/...` | | npm | `npm` | `https://registry.npmjs.org/...` | `https://xget.xi-xu.me/npm/...` | | PyPI | `pypi` | `https://pypi.org/...` | `https://xget.xi-xu.me/pypi/...` | -| conda | `conda` | `https://repo.anaconda.com/...` 和 `https://conda.anaconda.org/...` | `https://xget.xi-xu.me/conda/...` 和 `https://xget.xi-xu.me/conda/community/...` | +| conda | `conda` | `https://repo.anaconda.com/...` and `https://conda.anaconda.org/...` | `https://xget.xi-xu.me/conda/...` and `https://xget.xi-xu.me/conda/community/...` | | Maven | `maven` | `https://repo1.maven.org/...` | `https://xget.xi-xu.me/maven/...` | | Apache | `apache` | `https://downloads.apache.org/...` | `https://xget.xi-xu.me/apache/...` | | Gradle | `gradle` | `https://plugins.gradle.org/...` | `https://xget.xi-xu.me/gradle/...` | @@ -178,7 +169,7 @@ | CRAN | `cran` | `https://cran.r-project.org/...` | `https://xget.xi-xu.me/cran/...` | | CPAN | `cpan` | `https://www.cpan.org/...` | `https://xget.xi-xu.me/cpan/...` | | CTAN | `ctan` | `https://tug.ctan.org/...` | `https://xget.xi-xu.me/ctan/...` | -| Go 模块 | `golang` | `https://proxy.golang.org/...` | `https://xget.xi-xu.me/golang/...` | +| Go Modules | `golang` | `https://proxy.golang.org/...` | `https://xget.xi-xu.me/golang/...` | | NuGet | `nuget` | `https://api.nuget.org/...` | `https://xget.xi-xu.me/nuget/...` | | Rust Crates | `crates` | `https://crates.io/...` | `https://xget.xi-xu.me/crates/...` | | Packagist | `packagist` | `https://repo.packagist.org/...` | `https://xget.xi-xu.me/packagist/...` | @@ -190,530 +181,530 @@ | Arch Linux | `arch` | `https://geo.mirror.pkgbuild.com/...` | `https://xget.xi-xu.me/arch/...` | | arXiv | `arxiv` | `https://arxiv.org/...` | `https://xget.xi-xu.me/arxiv/...` | | F-Droid | `fdroid` | `https://f-droid.org/...` | `https://xget.xi-xu.me/fdroid/...` | -| Jenkins 插件 | `jenkins` | `https://updates.jenkins.io/...` | `https://xget.xi-xu.me/jenkins/...` | -| 容器注册表 | `cr` | 见[容器注册表](#容器注册表) | 见[容器注册表](#容器注册表) | -| AI 推理提供商 | `ip` | 见 [AI 推理提供商](#ai-推理提供商) | 见 [AI 推理提供商](#ai-推理提供商) | +| Jenkins Plugins | `jenkins` | `https://updates.jenkins.io/...` | `https://xget.xi-xu.me/jenkins/...` | +| Container Registries | `cr` | See [Container Registries](#container-registries) | See [Container Registries](#container-registries) | +| AI Inference Providers | `ip` | See [AI Inference Providers](#ai-inference-providers) | See [AI Inference Providers](#ai-inference-providers) | -### 各平台转换示例 +### Platform Conversion Examples #### GitHub ```url -# 原始 URL +# Original URL https://github.com/microsoft/vscode/archive/refs/heads/main.zip -# 转换后(添加 gh 前缀) +# Converted (add gh prefix) https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip ``` #### GitHub Gist ```url -# 原始 URL +# Original URL https://gist.github.com/xixu-me/e2ea9db6b1f143892495f796fef18631/raw/3b8807172ee492d0da3a7e370b0fb88fc97b53e6/Free-ChatGPT-Paid-Plan.md -# 转换后(添加 gist 前缀) +# Converted (add gist prefix) https://xget.xi-xu.me/gist/xixu-me/e2ea9db6b1f143892495f796fef18631/raw/3b8807172ee492d0da3a7e370b0fb88fc97b53e6/Free-ChatGPT-Paid-Plan.md ``` #### GitLab ```url -# 原始 URL +# Original URL https://gitlab.com/gitlab-org/gitlab/-/archive/master/gitlab-master.zip -# 转换后(添加 gl 前缀) +# Converted (add gl prefix) https://xget.xi-xu.me/gl/gitlab-org/gitlab/-/archive/master/gitlab-master.zip ``` #### Gitea ```url -# 原始 URL +# Original URL https://gitea.com/gitea/gitea/archive/master.zip -# 转换后(添加 gitea 前缀) +# Converted (add gitea prefix) https://xget.xi-xu.me/gitea/gitea/gitea/archive/master.zip ``` #### Codeberg ```url -# 原始 URL +# Original URL https://codeberg.org/forgejo/forgejo/archive/forgejo.zip -# 转换后(添加 codeberg 前缀) +# Converted (add codeberg prefix) https://xget.xi-xu.me/codeberg/forgejo/forgejo/archive/forgejo.zip ``` #### SourceForge ```url -# 原始 URL +# Original URL https://sourceforge.net/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download -# 转换后(添加 sf 前缀) +# Converted (add sf prefix) https://xget.xi-xu.me/sf/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download ``` -#### AOSP (Android 开源项目) +#### AOSP (Android Open Source Project) ```url -# AOSP 项目原始 URL +# AOSP project original URL https://android.googlesource.com/platform/frameworks/base -# 转换后(添加 aosp 前缀) +# Converted (add aosp prefix) https://xget.xi-xu.me/aosp/platform/frameworks/base -# AOSP 设备树原始 URL +# AOSP device tree original URL https://android.googlesource.com/device/google/pixel -# 转换后(添加 aosp 前缀) +# Converted (add aosp prefix) https://xget.xi-xu.me/aosp/device/google/pixel ``` #### Hugging Face ```url -# 模型文件原始 URL +# Model file original URL https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin -# 转换后(添加 hf 前缀) +# Converted (add hf prefix) https://xget.xi-xu.me/hf/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin -# 数据集文件原始 URL +# Dataset file original URL https://huggingface.co/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet -# 转换后(添加 hf 前缀) +# Converted (add hf prefix) https://xget.xi-xu.me/hf/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet ``` #### Civitai ```url -# AI 模型下载原始 URL +# AI model download original URL https://civitai.com/api/download/models/128713 -# 转换后(添加 civitai 前缀) +# Converted (add civitai prefix) https://xget.xi-xu.me/civitai/api/download/models/128713 -# 模型 API 原始 URL +# Model API original URL https://civitai.com/api/v1/models/7240 -# 转换后(添加 civitai 前缀) +# Converted (add civitai prefix) https://xget.xi-xu.me/civitai/api/v1/models/7240 -# 模型版本 API 原始 URL +# Model version API original URL https://civitai.com/api/v1/model-versions/128713 -# 转换后(添加 civitai 前缀) +# Converted (add civitai prefix) https://xget.xi-xu.me/civitai/api/v1/model-versions/128713 ``` #### npm ```url -# 包文件原始 URL +# Package file original URL https://registry.npmjs.org/react/-/react-18.2.0.tgz -# 转换后(添加 npm 前缀) +# Converted (add npm prefix) https://xget.xi-xu.me/npm/react/-/react-18.2.0.tgz -# 包元数据原始 URL +# Package metadata original URL https://registry.npmjs.org/lodash -# 转换后(添加 npm 前缀) +# Converted (add npm prefix) https://xget.xi-xu.me/npm/lodash ``` #### PyPI ```url -# Python 包文件原始 URL +# Python package file original URL https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz -# 转换后(添加 pypi 前缀) +# Converted (add pypi prefix) https://xget.xi-xu.me/pypi/packages/source/r/requests/requests-2.31.0.tar.gz -# Wheel 文件原始 URL +# Wheel file original URL https://pypi.org/packages/py3/r/requests/requests-2.31.0-py3-none-any.whl -# 转换后(添加 pypi 前缀) +# Converted (add pypi prefix) https://xget.xi-xu.me/pypi/packages/py3/r/requests/requests-2.31.0-py3-none-any.whl ``` #### conda ```url -# 默认频道包文件原始 URL +# Default channel package file original URL https://repo.anaconda.com/pkgs/main/linux-64/numpy-1.24.3-py311h08b1b3b_1.conda -# 转换后(添加 conda 前缀) +# Converted (add conda prefix) https://xget.xi-xu.me/conda/pkgs/main/linux-64/numpy-1.24.3-py311h08b1b3b_1.conda -# 社区频道元数据原始 URL +# Community channel metadata original URL https://conda.anaconda.org/conda-forge/linux-64/repodata.json -# 转换后(添加 conda/community 前缀) +# Converted (add conda/community prefix) https://xget.xi-xu.me/conda/community/conda-forge/linux-64/repodata.json ``` #### Maven ```url -# Maven 中央存储库 JAR 文件原始 URL +# Maven Central Repository JAR file original URL https://repo1.maven.org/maven2/org/springframework/spring-core/5.3.21/spring-core-5.3.21.jar -# 转换后(添加 maven 前缀) +# Converted (add maven prefix) https://xget.xi-xu.me/maven/maven2/org/springframework/spring-core/5.3.21/spring-core-5.3.21.jar -# Maven 元数据原始 URL +# Maven metadata original URL https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/maven-metadata.xml -# 转换后(添加 maven 前缀) +# Converted (add maven prefix) https://xget.xi-xu.me/maven/maven2/org/apache/commons/commons-lang3/maven-metadata.xml ``` -#### Apache 软件下载 +#### Apache Software Download ```url -# Apache 软件下载原始 URL +# Apache software download original URL https://downloads.apache.org/kafka/3.6.1/kafka_2.13-3.6.1.tgz -# 转换后(添加 apache 前缀) +# Converted (add apache prefix) https://xget.xi-xu.me/apache/kafka/3.6.1/kafka_2.13-3.6.1.tgz -# Apache Maven 下载原始 URL +# Apache Maven download original URL https://downloads.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz -# 转换后(添加 apache 前缀) +# Converted (add apache prefix) https://xget.xi-xu.me/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz -# Apache Spark 下载原始 URL +# Apache Spark download original URL https://downloads.apache.org/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz -# 转换后(添加 apache 前缀) +# Converted (add apache prefix) https://xget.xi-xu.me/apache/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz ``` #### Gradle ```url -# Gradle 插件门户 JAR 文件原始 URL +# Gradle plugin portal JAR file original URL https://plugins.gradle.org/m2/org/gradle/gradle-hello-world-plugin/0.2/gradle-hello-world-plugin-0.2.jar -# 转换后(添加 gradle 前缀) +# Converted (add gradle prefix) https://xget.xi-xu.me/gradle/m2/org/gradle/gradle-hello-world-plugin/0.2/gradle-hello-world-plugin-0.2.jar -# Gradle 插件元数据原始 URL +# Gradle plugin metadata original URL https://plugins.gradle.org/m2/com/github/ben-manes/gradle-versions-plugin/0.51.0/gradle-versions-plugin-0.51.0.module -# 转换后(添加 gradle 前缀) +# Converted (add gradle prefix) https://xget.xi-xu.me/gradle/m2/com/github/ben-manes/gradle-versions-plugin/0.51.0/gradle-versions-plugin-0.51.0.module ``` #### Homebrew ```url -# Homebrew 公式存储库原始 URL +# Homebrew formula repository original URL https://github.com/Homebrew/homebrew-core/raw/HEAD/Formula/g/git.rb -# 转换后(添加 homebrew 前缀) +# Converted (add homebrew prefix) https://xget.xi-xu.me/homebrew/homebrew-core/raw/HEAD/Formula/g/git.rb -# Homebrew API 原始 URL +# Homebrew API original URL https://formulae.brew.sh/api/formula/git.json -# 转换后(添加 homebrew/api 前缀) +# Converted (add homebrew/api prefix) https://xget.xi-xu.me/homebrew/api/formula/git.json -# Homebrew Bottles 原始 URL +# Homebrew Bottles original URL https://ghcr.io/v2/homebrew/core/git/manifests/2.39.0 -# 转换后(添加 homebrew/bottles 前缀) +# Converted (add homebrew/bottles prefix) https://xget.xi-xu.me/homebrew/bottles/v2/homebrew/core/git/manifests/2.39.0 ``` #### RubyGems ```url -# RubyGems 包文件原始 URL +# RubyGems package file original URL https://rubygems.org/gems/rails-7.0.4.gem -# 转换后(添加 rubygems 前缀) +# Converted (add rubygems prefix) https://xget.xi-xu.me/rubygems/gems/rails-7.0.4.gem -# RubyGems API 原始 URL +# RubyGems API original URL https://rubygems.org/api/v1/gems/nokogiri.json -# 转换后(添加 rubygems 前缀) +# Converted (add rubygems prefix) https://xget.xi-xu.me/rubygems/api/v1/gems/nokogiri.json ``` #### CRAN ```url -# CRAN 包文件原始 URL +# CRAN package file original URL https://cran.r-project.org/src/contrib/ggplot2_3.5.2.tar.gz -# 转换后(添加 cran 前缀) +# Converted (add cran prefix) https://xget.xi-xu.me/cran/src/contrib/ggplot2_3.5.2.tar.gz -# CRAN 包元数据原始 URL +# CRAN package metadata original URL https://cran.r-project.org/web/packages/dplyr/DESCRIPTION -# 转换后(添加 cran 前缀) +# Converted (add cran prefix) https://xget.xi-xu.me/cran/web/packages/dplyr/DESCRIPTION ``` -#### CPAN (Perl 包管理) +#### CPAN (Perl Package Management) ```url -# CPAN 模块原始 URL +# CPAN module original URL https://www.cpan.org/modules/by-module/DBI/DBI-1.643.tar.gz -# 转换后(添加 cpan 前缀) +# Converted (add cpan prefix) https://xget.xi-xu.me/cpan/modules/by-module/DBI/DBI-1.643.tar.gz -# CPAN 作者包原始 URL +# CPAN author package original URL https://www.cpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz -# 转换后(添加 cpan 前缀) +# Converted (add cpan prefix) https://xget.xi-xu.me/cpan/authors/id/T/TI/TIMB/DBI-1.643.tar.gz ``` -#### CTAN (TeX/LaTeX 包管理) +#### CTAN (TeX/LaTeX Package Management) ```url -# CTAN 包文件原始 URL +# CTAN package file original URL https://tug.ctan.org/tex-archive/macros/latex/contrib/beamer.zip -# 转换后(添加 ctan 前缀) +# Converted (add ctan prefix) https://xget.xi-xu.me/ctan/tex-archive/macros/latex/contrib/beamer.zip -# CTAN 字体文件原始 URL +# CTAN font file original URL https://tug.ctan.org/tex-archive/fonts/cm/pk/ljfour/public/cm/dpi600/cmr10.pk -# 转换后(添加 ctan 前缀) +# Converted (add ctan prefix) https://xget.xi-xu.me/ctan/tex-archive/fonts/cm/pk/ljfour/public/cm/dpi600/cmr10.pk ``` -#### Go 模块 +#### Go Modules ```url -# Go 模块代理原始 URL +# Go module proxy original URL https://proxy.golang.org/github.com/gin-gonic/gin/@v/v1.9.1.zip -# 转换后(添加 golang 前缀) +# Converted (add golang prefix) https://xget.xi-xu.me/golang/github.com/gin-gonic/gin/@v/v1.9.1.zip -# Go 模块信息原始 URL +# Go module info original URL https://proxy.golang.org/github.com/gorilla/mux/@v/list -# 转换后(添加 golang 前缀) +# Converted (add golang prefix) https://xget.xi-xu.me/golang/github.com/gorilla/mux/@v/list ``` #### NuGet ```url -# NuGet 包下载原始 URL +# NuGet package download original URL https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg -# 转换后(添加 nuget 前缀) +# Converted (add nuget prefix) https://xget.xi-xu.me/nuget/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg -# NuGet 包元数据原始 URL +# NuGet package metadata original URL https://api.nuget.org/v3/registration5-semver1/microsoft.aspnetcore.app/index.json -# 转换后(添加 nuget 前缀) +# Converted (add nuget prefix) https://xget.xi-xu.me/nuget/v3/registration5-semver1/microsoft.aspnetcore.app/index.json ``` #### Rust Crates ```url -# Crate 下载原始 URL +# Crate download original URL https://crates.io/api/v1/crates/serde/1.0.0/download -# 转换后(添加 crates 前缀) +# Converted (add crates prefix) https://xget.xi-xu.me/crates/serde/1.0.0/download -# Crate 元数据原始 URL +# Crate metadata original URL https://crates.io/api/v1/crates/serde -# 转换后(添加 crates 前缀) +# Converted (add crates prefix) https://xget.xi-xu.me/crates/serde -# Crate 搜索原始 URL +# Crate search original URL https://crates.io/api/v1/crates?q=serde -# 转换后(添加 crates 前缀) +# Converted (add crates prefix) https://xget.xi-xu.me/crates/?q=serde ``` #### Packagist ```url -# Packagist 包元数据原始 URL +# Packagist package metadata original URL https://repo.packagist.org/p2/symfony/console.json -# 转换后(添加 packagist 前缀) +# Converted (add packagist prefix) https://xget.xi-xu.me/packagist/p2/symfony/console.json -# Packagist 包列表原始 URL +# Packagist package list original URL https://repo.packagist.org/packages/list.json -# 转换后(添加 packagist 前缀) +# Converted (add packagist prefix) https://xget.xi-xu.me/packagist/packages/list.json ``` -#### Linux 发行版 +#### Linux Distributions ```url -# Debian 包原始 URL +# Debian package original URL https://deb.debian.org/debian/pool/main/c/curl/curl_7.88.1-10+deb12u4_amd64.deb -# 转换后(添加 debian 前缀) +# Converted (add debian prefix) https://xget.xi-xu.me/debian/debian/pool/main/c/curl/curl_7.88.1-10+deb12u4_amd64.deb -# Ubuntu 包原始 URL +# Ubuntu package original URL https://archive.ubuntu.com/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1.9_amd64.deb -# 转换后(添加 ubuntu 前缀) +# Converted (add ubuntu prefix) https://xget.xi-xu.me/ubuntu/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1.9_amd64.deb -# Fedora 包原始 URL +# Fedora package original URL https://dl.fedoraproject.org/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/n/nginx-1.24.0-1.fc39.x86_64.rpm -# 转换后(添加 fedora 前缀) +# Converted (add fedora prefix) https://xget.xi-xu.me/fedora/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/n/nginx-1.24.0-1.fc39.x86_64.rpm -# Rocky Linux 包原始 URL +# Rocky Linux package original URL https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/b/bash-5.1.8-6.el9.x86_64.rpm -# 转换后(添加 rocky 前缀) +# Converted (add rocky prefix) https://xget.xi-xu.me/rocky/pub/rocky/9/BaseOS/x86_64/os/Packages/b/bash-5.1.8-6.el9.x86_64.rpm -# openSUSE 包原始 URL +# openSUSE package original URL https://download.opensuse.org/distribution/leap/15.5/repo/oss/x86_64/vim-9.0.1572-150500.20.8.1.x86_64.rpm -# 转换后(添加 opensuse 前缀) +# Converted (add opensuse prefix) https://xget.xi-xu.me/opensuse/distribution/leap/15.5/repo/oss/x86_64/vim-9.0.1572-150500.20.8.1.x86_64.rpm -# Arch Linux 包原始 URL +# Arch Linux package original URL https://geo.mirror.pkgbuild.com/core/os/x86_64/linux-6.6.10.arch1-1-x86_64.pkg.tar.zst -# 转换后(添加 arch 前缀) +# Converted (add arch prefix) https://xget.xi-xu.me/arch/core/os/x86_64/linux-6.6.10.arch1-1-x86_64.pkg.tar.zst ``` #### arXiv ```url -# arXiv 论文 PDF 原始 URL +# arXiv paper PDF original URL https://arxiv.org/pdf/2301.07041.pdf -# 转换后(添加 arxiv 前缀) +# Converted (add arxiv prefix) https://xget.xi-xu.me/arxiv/pdf/2301.07041.pdf -# arXiv 论文源码原始 URL +# arXiv paper source original URL https://arxiv.org/e-print/2301.07041 -# 转换后(添加 arxiv 前缀) +# Converted (add arxiv prefix) https://xget.xi-xu.me/arxiv/e-print/2301.07041 ``` #### F-Droid ```url -# F-Droid 应用 APK 原始 URL +# F-Droid app APK original URL https://f-droid.org/repo/org.fdroid.fdroid_1016050.apk -# 转换后(添加 fdroid 前缀) +# Converted (add fdroid prefix) https://xget.xi-xu.me/fdroid/repo/org.fdroid.fdroid_1016050.apk -# F-Droid 应用元数据原始 URL +# F-Droid app metadata original URL https://f-droid.org/api/v1/packages/org.fdroid.fdroid -# 转换后(添加 fdroid 前缀) +# Converted (add fdroid prefix) https://xget.xi-xu.me/fdroid/api/v1/packages/org.fdroid.fdroid ``` -#### Jenkins 插件 +#### Jenkins Plugins ```url -# Jenkins 更新中心原始 URL +# Jenkins update center original URL https://updates.jenkins.io/update-center.json -# 转换后(添加 jenkins 前缀) +# Converted (add jenkins prefix) https://xget.xi-xu.me/jenkins/update-center.json -# Jenkins 插件下载原始 URL +# Jenkins plugin download original URL https://updates.jenkins.io/download/plugins/maven-plugin/3.27/maven-plugin.hpi -# 转换后(添加 jenkins 前缀) +# Converted (add jenkins prefix) https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi ``` -#### 容器注册表 +#### Container Registries -Xget 支持多个容器注册表,使用 `cr/[容器注册表前缀]` 格式: +Xget supports multiple container registries, using the `cr/[Registry Prefix]` format: -| 容器注册表 | 容器注册表前缀 | 原始 URL 格式 | 加速 URL 格式 | -|----------|------|--------------|--------------| +| 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/...` | -| 谷歌容器注册表 | `gcr` | `https://gcr.io/...` | `https://xget.xi-xu.me/cr/gcr/...` | -| 微软容器注册表 | `mcr` | `https://mcr.microsoft.com/...` | `https://xget.xi-xu.me/cr/mcr/...` | -| 亚马逊公共弹性容器注册表 | `ecr` | `https://public.ecr.aws/...` | `https://xget.xi-xu.me/cr/ecr/...` | -| GitHub 容器注册表 | `ghcr` | `https://ghcr.io/...` | `https://xget.xi-xu.me/cr/ghcr/...` | -| GitLab 容器注册表 | `gitlab` | `https://registry.gitlab.com/...` | `https://xget.xi-xu.me/cr/gitlab/...` | -| 红帽注册表 | `redhat` | `https://registry.redhat.io/...` | `https://xget.xi-xu.me/cr/redhat/...` | -| 甲骨文容器注册表 | `oracle` | `https://container-registry.oracle.com/...` | `https://xget.xi-xu.me/cr/oracle/...` | +| 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/...` | +| Amazon Public ECR | `ecr` | `https://public.ecr.aws/...` | `https://xget.xi-xu.me/cr/ecr/...` | +| GitHub Container Registry | `ghcr` | `https://ghcr.io/...` | `https://xget.xi-xu.me/cr/ghcr/...` | +| GitLab Container Registry | `gitlab` | `https://registry.gitlab.com/...` | `https://xget.xi-xu.me/cr/gitlab/...` | +| Red Hat Registry | `redhat` | `https://registry.redhat.io/...` | `https://xget.xi-xu.me/cr/redhat/...` | +| Oracle Container Registry | `oracle` | `https://container-registry.oracle.com/...` | `https://xget.xi-xu.me/cr/oracle/...` | | Cloudsmith | `cloudsmith` | `https://docker.cloudsmith.io/...` | `https://xget.xi-xu.me/cr/cloudsmith/...` | -| DigitalOcean 注册表 | `digitalocean` | `https://registry.digitalocean.com/...` | `https://xget.xi-xu.me/cr/digitalocean/...` | -| VMware 注册表 | `vmware` | `https://projects.registry.vmware.com/...` | `https://xget.xi-xu.me/cr/vmware/...` | -| Kubernetes 注册表 | `k8s` | `https://registry.k8s.io/...` | `https://xget.xi-xu.me/cr/k8s/...` | -| Heroku 注册表 | `heroku` | `https://registry.heroku.com/...` | `https://xget.xi-xu.me/cr/heroku/...` | -| SUSE 注册表 | `suse` | `https://registry.suse.com/...` | `https://xget.xi-xu.me/cr/suse/...` | -| openSUSE 注册表 | `opensuse` | `https://registry.opensuse.org/...` | `https://xget.xi-xu.me/cr/opensuse/...` | -| Gitpod 注册表 | `gitpod` | `https://registry.gitpod.io/...` | `https://xget.xi-xu.me/cr/gitpod/...` | +| DigitalOcean Registry | `digitalocean` | `https://registry.digitalocean.com/...` | `https://xget.xi-xu.me/cr/digitalocean/...` | +| VMware Registry | `vmware` | `https://projects.registry.vmware.com/...` | `https://xget.xi-xu.me/cr/vmware/...` | +| Kubernetes Registry | `k8s` | `https://registry.k8s.io/...` | `https://xget.xi-xu.me/cr/k8s/...` | +| Heroku Registry | `heroku` | `https://registry.heroku.com/...` | `https://xget.xi-xu.me/cr/heroku/...` | +| SUSE Registry | `suse` | `https://registry.suse.com/...` | `https://xget.xi-xu.me/cr/suse/...` | +| openSUSE Registry | `opensuse` | `https://registry.opensuse.org/...` | `https://xget.xi-xu.me/cr/opensuse/...` | +| Gitpod Registry | `gitpod` | `https://registry.gitpod.io/...` | `https://xget.xi-xu.me/cr/gitpod/...` | ```url -# Docker Hub 原始 URL(官方镜像) +# Docker Hub original URL (official images) https://registry-1.docker.io/v2/library/nginx/manifests/latest -# 转换后(添加 cr/docker 前缀) +# Converted (add cr/docker prefix) https://xget.xi-xu.me/cr/docker/v2/nginx/manifests/latest -# Docker Hub 原始 URL(用户镜像) +# Docker Hub original URL (user images) https://registry-1.docker.io/v2/nginxinc/nginx-unprivileged/manifests/latest -# 转换后(添加 cr/docker 前缀) +# Converted (add cr/docker prefix) https://xget.xi-xu.me/cr/docker/v2/nginxinc/nginx-unprivileged/manifests/latest -# GitHub 容器注册表原始 URL +# GitHub Container Registry original URL https://ghcr.io/v2/nginxinc/nginx-unprivileged/manifests/latest -# 转换后(添加 cr/ghcr 前缀) +# Converted (add cr/ghcr prefix) https://xget.xi-xu.me/cr/ghcr/v2/nginxinc/nginx-unprivileged/manifests/latest -# 谷歌容器注册表原始 URL +# Google Container Registry original URL https://gcr.io/v2/distroless/base/manifests/latest -# 转换后(添加 cr/gcr 前缀) +# Converted (add cr/gcr prefix) https://xget.xi-xu.me/cr/gcr/v2/distroless/base/manifests/latest ``` -应用场景见[容器镜像加速](#容器镜像加速)。 +For use cases, see [Container Image Acceleration](#container-image-acceleration). -#### AI 推理提供商 +#### AI Inference Providers -Xget 支持众多主流 AI 推理提供商的 API 加速,使用 `ip/[AI 推理提供商前缀]` 格式: +Xget supports API acceleration for many mainstream AI inference providers, using the `ip/[AI Provider Prefix]` format: -| AI 推理提供商 | AI 推理提供商前缀 | 原始 URL 格式 | 加速 URL 格式 | -|-------------|----------|-------------|-------------| +| AI Inference Provider | Provider Prefix | Original URL Format | Accelerated URL Format | +|----------------------|-----------------|---------------------|------------------------| | OpenAI | `openai` | `https://api.openai.com/...` | `https://xget.xi-xu.me/ip/openai/...` | | Anthropic | `anthropic` | `https://api.anthropic.com/...` | `https://xget.xi-xu.me/ip/anthropic/...` | | Gemini | `gemini` | `https://generativelanguage.googleapis.com/...` | `https://xget.xi-xu.me/ip/gemini/...` | @@ -721,7 +712,7 @@ Xget 支持众多主流 AI 推理提供商的 API 加速,使用 `ip/[AI 推理 | Cohere | `cohere` | `https://api.cohere.ai/...` | `https://xget.xi-xu.me/ip/cohere/...` | | Mistral AI | `mistralai` | `https://api.mistral.ai/...` | `https://xget.xi-xu.me/ip/mistralai/...` | | xAI | `xai` | `https://api.x.ai/...` | `https://xget.xi-xu.me/ip/xai/...` | -| GitHub 模型 | `githubmodels` | `https://models.github.ai/...` | `https://xget.xi-xu.me/ip/githubmodels/...` | +| GitHub Models | `githubmodels` | `https://models.github.ai/...` | `https://xget.xi-xu.me/ip/githubmodels/...` | | NVIDIA API | `nvidiaapi` | `https://integrate.api.nvidia.com/...` | `https://xget.xi-xu.me/ip/nvidiaapi/...` | | Perplexity | `perplexity` | `https://api.perplexity.ai/...` | `https://xget.xi-xu.me/ip/perplexity/...` | | Groq | `groq` | `https://api.groq.com/...` | `https://xget.xi-xu.me/ip/groq/...` | @@ -744,78 +735,78 @@ Xget 支持众多主流 AI 推理提供商的 API 加速,使用 `ip/[AI 推理 | Hyperbolic | `hyperbolic` | `https://api.hyperbolic.xyz/...` | `https://xget.xi-xu.me/ip/hyperbolic/...` | ```url -# OpenAI API 原始 URL +# OpenAI API original URL https://api.openai.com/v1/chat/completions -# 转换后(添加 ip/openai 前缀) +# Converted (add ip/openai prefix) https://xget.xi-xu.me/ip/openai/v1/chat/completions -# Claude API 原始 URL +# Claude API original URL https://api.anthropic.com/v1/messages -# 转换后(添加 ip/anthropic 前缀) +# Converted (add ip/anthropic prefix) https://xget.xi-xu.me/ip/anthropic/v1/messages -# Gemini API 原始 URL +# Gemini API original URL https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent -# 转换后(添加 ip/gemini 前缀) +# Converted (add ip/gemini prefix) https://xget.xi-xu.me/ip/gemini/v1beta/models/gemini-2.5-flash:generateContent -# HF Inference API 原始 URL +# HF Inference API original URL https://router.huggingface.co/hf-inference/models/openai/whisper-large-v3 -# 转换后(添加 ip/huggingface 前缀) +# Converted (add ip/huggingface prefix) https://xget.xi-xu.me/ip/huggingface/hf-inference/models/openai/whisper-large-v3 ``` -应用场景见 [AI 推理 API 加速](#ai-推理-api-加速)。 +For use cases, see [AI Inference API Acceleration](#ai-inference-api-acceleration). -## 🎯 应用场景 +## 🎯 Use Cases -### Git 操作与配置 +### Git Operations and Configuration -#### Git 操作 +#### Git Operations ```bash -# 克隆存储库 +# Clone repository git clone https://xget.xi-xu.me/gh/microsoft/vscode.git -# 克隆指定分支 +# Clone specific branch git clone -b main https://xget.xi-xu.me/gh/facebook/react.git -# 浅克隆(仅最新提交) +# Shallow clone (latest commit only) git clone --depth 1 https://xget.xi-xu.me/gh/torvalds/linux.git -# 克隆 GitLab 存储库 +# Clone GitLab repository git clone https://xget.xi-xu.me/gl/gitlab-org/gitlab.git -# 克隆 Gitea 存储库 +# Clone Gitea repository git clone https://xget.xi-xu.me/gitea/gitea/gitea.git -# 克隆 Codeberg 存储库 +# Clone Codeberg repository git clone https://xget.xi-xu.me/codeberg/forgejo/forgejo.git -# 克隆 SourceForge 存储库 +# Clone SourceForge repository git clone https://xget.xi-xu.me/sf/projects/mingw-w64/code.git -# 克隆 AOSP 存储库 +# Clone AOSP repository git clone https://xget.xi-xu.me/aosp/platform/frameworks/base.git -# 添加远程存储库 -git remote add upstream https://xget.xi-xu.me/gh/[所有者]/[存储库].git +# Add remote repository +git remote add upstream https://xget.xi-xu.me/gh/[owner]/[repository].git -# 拉取更新 +# Pull updates git pull https://xget.xi-xu.me/gh/microsoft/vscode.git main -# 子模块递归克隆 -git clone --recursive https://xget.xi-xu.me/gh/[用户名]/[带子模块的存储库].git +# Recursive submodule clone +git clone --recursive https://xget.xi-xu.me/gh/[username]/[repository-with-submodules].git ``` -#### Git 全局加速配置 +#### Git Global Acceleration Configuration ```bash -# 为特定域名配置 Git 使用 Xget +# Configure Git to use Xget for specific domains git config --global url."https://xget.xi-xu.me/gh/".insteadOf "https://github.com/" git config --global url."https://xget.xi-xu.me/gl/".insteadOf "https://gitlab.com/" git config --global url."https://xget.xi-xu.me/gitea/".insteadOf "https://gitea.com/" @@ -823,106 +814,106 @@ git config --global url."https://xget.xi-xu.me/codeberg/".insteadOf "https://cod git config --global url."https://xget.xi-xu.me/sf/".insteadOf "https://sourceforge.net/" git config --global url."https://xget.xi-xu.me/aosp/".insteadOf "https://android.googlesource.com/" -# 验证配置 +# Verify configuration git config --global --get-regexp url -# 现在所有相关平台的 git clone 都会自动使用 Xget -git clone https://github.com/microsoft/vscode.git # 自动转换为 Xget URL -git clone https://gitlab.com/gitlab-org/gitlab.git # 自动转换为 Xget URL -git clone https://codeberg.org/forgejo/forgejo.git # 自动转换为 Xget URL -git clone https://android.googlesource.com/platform/frameworks/base.git # 自动转换为 Xget URL +# Now all git clone operations for relevant platforms will automatically use Xget +git clone https://github.com/microsoft/vscode.git # Automatically converted to Xget URL +git clone https://gitlab.com/gitlab-org/gitlab.git # Automatically converted to Xget URL +git clone https://codeberg.org/forgejo/forgejo.git # Automatically converted to Xget URL +git clone https://android.googlesource.com/platform/frameworks/base.git # Automatically converted to Xget URL ``` -### 主流下载工具集成 +### Mainstream Download Tool Integration -#### wget 下载 +#### wget Download ```bash -# 下载单个文件 +# Download single file wget https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip -# 断点续传 +# Resume download wget -c https://xget.xi-xu.me/hf/microsoft/DialoGPT-large/resolve/main/pytorch_model.bin -# 批量下载 -wget -i urls.txt # urls.txt 包含多个 Xget URL +# Batch download +wget -i urls.txt # urls.txt contains multiple Xget URLs ``` -#### cURL 下载 +#### cURL Download ```bash -# 基本下载 +# Basic download curl -L -O https://xget.xi-xu.me/gh/golang/go/archive/refs/tags/go1.22.0.tar.gz -# 显示进度条 +# Show progress bar curl -L --progress-bar -o model.bin https://xget.xi-xu.me/hf/openai/whisper-large-v3/resolve/main/pytorch_model.bin -# 设置用户代理 +# Set user agent curl -L -H "User-Agent: MyApp/1.0" https://xget.xi-xu.me/gl/gitlab-org/gitlab-runner/-/archive/main/gitlab-runner-main.zip ``` -#### aria2 多线程下载 +#### aria2 Multi-threaded Download ```bash -# 多线程下载大文件 +# Multi-threaded download of large files aria2c -x 16 -s 16 https://xget.xi-xu.me/hf/microsoft/DialoGPT-large/resolve/main/pytorch_model.bin -# 断点续传 +# Resume download aria2c -c https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip -# 批量下载配置文件 -aria2c -i download-list.txt # 包含多个 Xget URL 的文件 +# Batch download configuration file +aria2c -i download-list.txt # File containing multiple Xget URLs ``` -### Hugging Face 镜像 +### Hugging Face Mirror ```python import os from transformers import AutoTokenizer, AutoModelForCausalLM -# 设置环境变量,让 transformers 库自动使用 Xget 镜像 +# Set environment variable to make transformers library automatically use Xget mirror os.environ['HF_ENDPOINT'] = 'https://xget.xi-xu.me/hf' -# 定义模型名称 +# Define model name model_name = 'microsoft/DialoGPT-medium' -print(f"正在从镜像下载模型: {model_name}") +print(f"Downloading model from mirror: {model_name}") -# 使用 AutoModelForCausalLM 来加载对话生成模型 -# 由于上面设置了环境变量,这里无需添加任何额外参数 +# Use AutoModelForCausalLM to load dialogue generation model +# Since we set the environment variable above, no additional parameters are needed here tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name) -print("模型和分词器加载成功!") +print("Model and tokenizer loaded successfully!") -# 你现在可以使用 tokenizer 和 model 了 -# 例如: +# You can now use the tokenizer and model +# For example: # new_user_input_ids = tokenizer.encode("Hello, how are you?", return_tensors='pt') # chat_history_ids = model.generate(new_user_input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id) # print(tokenizer.decode(chat_history_ids[:, new_user_input_ids.shape[-1]:][0], skip_special_tokens=True)) ``` -### Civitai AI 模型平台 +### Civitai AI Model Platform ```python import requests -# 设置 API 基础 URL 使用 Xget +# Set API base URL to use Xget base_url = "https://xget.xi-xu.me/civitai" -# 获取模型信息 +# Get model information def get_model_info(model_id): - """获取 Civitai 模型信息""" + """Get Civitai model information""" url = f"{base_url}/api/v1/models/{model_id}" response = requests.get(url) return response.json() -# 下载模型 +# Download model def download_model(model_version_id, output_path): - """下载 Civitai 模型文件""" + """Download Civitai model file""" download_url = f"{base_url}/api/download/models/{model_version_id}" - print(f"正在下载模型版本 {model_version_id}...") + print(f"Downloading model version {model_version_id}...") response = requests.get(download_url, stream=True) response.raise_for_status() @@ -931,68 +922,68 @@ def download_model(model_version_id, output_path): for chunk in response.iter_content(chunk_size=8192): f.write(chunk) - print(f"模型已下载到: {output_path}") + print(f"Model downloaded to: {output_path}") -# 使用示例 -model_id = 7240 # 示例模型 ID +# Usage example +model_id = 7240 # Example model ID model_info = get_model_info(model_id) -print(f"模型名称: {model_info['name']}") +print(f"Model name: {model_info['name']}") -# 下载第一个模型版本 +# Download first model version if model_info['modelVersions']: version_id = model_info['modelVersions'][0]['id'] download_model(version_id, f"model_{version_id}.safetensors") ``` -### npm 包管理加速 +### npm Package Acceleration -#### 配置 npm 使用 Xget 镜像 +#### Configure npm to Use Xget Mirror ```bash -# 临时使用 Xget 镜像 +# Temporarily use Xget mirror npm install --registry https://xget.xi-xu.me/npm/ -# 全局配置 npm 镜像 +# Globally configure npm mirror npm config set registry https://xget.xi-xu.me/npm/ -# 验证配置 +# Verify configuration npm config get registry ``` -#### 在项目中使用 +#### Use in Project ```bash -# 在 .npmrc 文件中配置项目级镜像 +# Configure project-level mirror in .npmrc file echo "registry=https://xget.xi-xu.me/npm/" > .npmrc -# 安装依赖 +# Install dependencies npm install -# 或者使用 yarn +# Or use yarn yarn config set registry https://xget.xi-xu.me/npm/ yarn install ``` -### Python 包管理加速 +### Python Package Acceleration -#### 配置 pip 使用 Xget 镜像 +#### Configure pip to Use Xget Mirror ```bash -# 临时使用 Xget 镜像 +# Temporarily use Xget mirror pip install requests -i https://xget.xi-xu.me/pypi/simple/ -# 全局配置 pip 镜像 +# Globally configure pip mirror pip config set global.index-url https://xget.xi-xu.me/pypi/simple/ pip config set global.trusted-host xget.xi-xu.me -# 验证配置 +# Verify configuration pip config list ``` -#### 在项目中使用 +#### Use in Project ```bash -# 创建 pip.conf 文件(Linux/macOS) +# Create pip.conf file (Linux/macOS) mkdir -p ~/.pip cat > ~/.pip/pip.conf << EOF [global] @@ -1000,18 +991,18 @@ index-url = https://xget.xi-xu.me/pypi/simple/ trusted-host = xget.xi-xu.me EOF -# 或在项目根目录创建 pip.conf +# Or create pip.conf in project root directory cat > pip.conf << EOF [global] index-url = https://xget.xi-xu.me/pypi/simple/ trusted-host = xget.xi-xu.me EOF -# 使用配置文件安装 +# Install using configuration file pip install -r requirements.txt --config-file pip.conf ``` -#### 在 requirements.txt 中指定镜像 +#### Specify Mirror in requirements.txt ```txt # requirements.txt @@ -1024,33 +1015,33 @@ pandas>=1.3.0 matplotlib>=3.4.0 ``` -### conda 包管理加速 +### conda Package Acceleration -#### 配置 conda 使用 Xget 镜像 +#### Configure conda to Use Xget Mirror ```bash -# 配置默认频道镜像 +# Configure default channel mirrors conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/msys2 conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/r conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/main -# 配置所有社区频道镜像(推荐) +# Configure all community channel mirrors (recommended) conda config --set channel_alias https://xget.xi-xu.me/conda/community -# 或配置特定社区频道 +# Or configure specific community channels conda config --add channels https://xget.xi-xu.me/conda/community/conda-forge conda config --add channels https://xget.xi-xu.me/conda/community/bioconda -# 设置频道优先级 +# Set channel priority conda config --set channel_priority strict -# 验证配置 +# Verify configuration conda config --show ``` -#### 在 .condarc 中配置 +#### Configure in .condarc -.condarc 文件可以放在用户主目录(`~/.condarc`)或项目根目录下: +The .condarc file can be placed in the user home directory (`~/.condarc`) or project root directory: ```yaml default_channels: @@ -1062,9 +1053,9 @@ channel_priority: strict show_channel_urls: true ``` -#### 使用环境文件 +#### Use Environment File -环境文件中可以直接指定完整的镜像 URL: +The environment file can directly specify complete mirror URLs: ```yaml # environment.yml @@ -1086,19 +1077,19 @@ dependencies: ``` ```bash -# 使用环境文件创建环境 +# Create environment using environment file conda env create -f environment.yml -# 更新环境 +# Update environment conda env update -f environment.yml ``` -### Maven 包管理加速 +### Maven Package Acceleration -#### 配置 Maven 使用 Xget 镜像 +#### Configure Maven to Use Xget Mirror ```xml - + @@ -1111,10 +1102,10 @@ conda env update -f environment.yml ``` -#### 在项目中使用 +#### Use in Project ```xml - + @@ -1135,58 +1126,58 @@ conda env update -f environment.yml ``` ```bash -# 使用命令行指定镜像 +# Specify mirror using command line mvn clean install -Dmaven.repo.remote=https://xget.xi-xu.me/maven/maven2 -# 下载特定依赖 +# Download specific dependency mvn dependency:get -Dartifact=org.springframework:spring-core:5.3.21 \ -DremoteRepositories=https://xget.xi-xu.me/maven/maven2 ``` -### Apache 软件下载加速 +### Apache Software Download Acceleration -#### 使用 Xget 下载 Apache 软件 +#### Download Apache Software Using Xget ```bash -# 下载 Apache Kafka +# Download Apache Kafka wget https://xget.xi-xu.me/apache/kafka/3.6.1/kafka_2.13-3.6.1.tgz -# 下载 Apache Maven +# Download Apache Maven curl -L -O https://xget.xi-xu.me/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz -# 下载 Apache Spark +# Download Apache Spark aria2c https://xget.xi-xu.me/apache/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz -# 下载 Apache Hadoop +# Download Apache Hadoop wget https://xget.xi-xu.me/apache/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz -# 下载 Apache Flink +# Download Apache Flink curl -L -O https://xget.xi-xu.me/apache/flink/flink-1.18.1/flink-1.18.1-bin-scala_2.12.tgz ``` -#### 常用 Apache 软件下载 +#### Common Apache Software Downloads ```bash -# 大数据相关 +# Big data related wget https://xget.xi-xu.me/apache/hive/hive-3.1.3/apache-hive-3.1.3-bin.tar.gz wget https://xget.xi-xu.me/apache/hbase/2.5.7/hbase-2.5.7-bin.tar.gz wget https://xget.xi-xu.me/apache/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz -# Web 服务器 +# Web servers wget https://xget.xi-xu.me/apache/httpd/httpd-2.4.59.tar.gz wget https://xget.xi-xu.me/apache/tomcat/tomcat-10/v10.1.19/bin/apache-tomcat-10.1.19.tar.gz -# 开发工具 +# Development tools wget https://xget.xi-xu.me/apache/ant/1.10.14/apache-ant-1.10.14-bin.tar.gz wget https://xget.xi-xu.me/apache/netbeans/netbeans/20/netbeans-20-bin.zip ``` -### Gradle 包管理加速 +### Gradle Package Acceleration -#### 配置 Gradle 使用 Xget 镜像 +#### Configure Gradle to Use Xget Mirror ```gradle -// 在 build.gradle 中配置 Gradle 镜像 +// Configure Gradle mirror in build.gradle repositories { maven { url 'https://xget.xi-xu.me/maven/maven2' @@ -1196,7 +1187,7 @@ repositories { } } -// 配置插件存储库 +// Configure plugin repositories pluginManagement { repositories { maven { @@ -1207,10 +1198,10 @@ pluginManagement { } ``` -#### 全局配置 +#### Global Configuration ```gradle -// 在 ~/.gradle/init.gradle 中配置全局镜像 +// Configure global mirror in ~/.gradle/init.gradle allprojects { repositories { maven { @@ -1232,91 +1223,91 @@ settingsEvaluated { settings -> ``` ```bash -# 使用命令行指定镜像 +# Specify mirror using command line gradle build -Dmaven.repo.remote=https://xget.xi-xu.me/maven/maven2 -# 刷新依赖 +# Refresh dependencies gradle build --refresh-dependencies ``` -### Homebrew 包管理加速 +### Homebrew Package Acceleration -#### 配置 Homebrew 使用 Xget 镜像 +#### Configure Homebrew to Use Xget Mirror ```bash -# 设置 Homebrew 环境变量使用 Xget 镜像 +# Set Homebrew environment variables to use Xget mirror export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git" export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git" export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api" export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles" -# 更新 Homebrew +# Update Homebrew brew update ``` -#### 长期配置 +#### Long-term Configuration ```bash -# 为 bash 用户添加到 ~/.bash_profile +# For bash users, add to ~/.bash_profile echo 'export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git"' >> ~/.bash_profile echo 'export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git"' >> ~/.bash_profile echo 'export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api"' >> ~/.bash_profile echo 'export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles"' >> ~/.bash_profile -# 为 zsh 用户添加到 ~/.zprofile +# For zsh users, add to ~/.zprofile echo 'export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git"' >> ~/.zprofile echo 'export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git"' >> ~/.zprofile echo 'export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api"' >> ~/.zprofile echo 'export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles"' >> ~/.zprofile ``` -#### 在项目中使用 +#### Use in Project ```bash -# 安装软件包 +# Install packages brew install git -# 搜索软件包 +# Search packages brew search python -# 更新软件包 +# Update packages brew upgrade -# 查看已安装软件包 +# View installed packages brew list ``` -#### 验证镜像配置 +#### Verify Mirror Configuration ```bash -# 检查 Homebrew 配置 +# Check Homebrew configuration brew config -# 查看环境变量 +# View environment variables echo $HOMEBREW_API_DOMAIN echo $HOMEBREW_BOTTLE_DOMAIN ``` -### Ruby 包管理加速 +### Ruby Package Acceleration -#### 配置 RubyGems 使用 Xget 镜像 +#### Configure RubyGems to Use Xget Mirror ```bash -# 临时使用 Xget 镜像 +# Temporarily use Xget mirror gem install rails --source https://xget.xi-xu.me/rubygems/ -# 全局配置 RubyGems 镜像 +# Globally configure RubyGems mirror gem sources --add https://xget.xi-xu.me/rubygems/ gem sources --remove https://rubygems.org/ -# 验证配置 +# Verify configuration gem sources -l ``` -#### 在项目中使用 +#### Use in Project ```ruby -# 在 Gemfile 中配置项目级镜像 +# Configure project-level mirror in Gemfile source 'https://xget.xi-xu.me/rubygems/' gem 'rails', '~> 7.0.0' @@ -1325,30 +1316,30 @@ gem 'puma', '~> 5.0' ``` ```bash -# 使用 bundle 安装 +# Install using bundle bundle config mirror.https://rubygems.org https://xget.xi-xu.me/rubygems/ bundle install ``` -### R 包管理加速 +### R Package Acceleration -#### 配置 R 使用 Xget CRAN 镜像 +#### Configure R to Use Xget CRAN Mirror ```r -# 在 R 中临时使用 Xget CRAN 镜像 +# Temporarily use Xget CRAN mirror in R install.packages("ggplot2", repos = "https://xget.xi-xu.me/cran/") -# 全局配置 CRAN 镜像 +# Globally configure CRAN mirror options(repos = c(CRAN = "https://xget.xi-xu.me/cran/")) -# 验证配置 +# Verify configuration getOption("repos") ``` -#### 在 .Rprofile 中配置 +#### Configure in .Rprofile ```r -# 在用户主目录的 .Rprofile 文件中配置全局镜像 +# Configure global mirror in .Rprofile file in user home directory options(repos = c( CRAN = "https://xget.xi-xu.me/cran/", BioCsoft = "https://bioconductor.org/packages/release/bioc", @@ -1356,29 +1347,29 @@ options(repos = c( BioCexp = "https://bioconductor.org/packages/release/data/experiment" )) -# 设置下载方法 +# Set download method options(download.file.method = "libcurl") ``` -#### 在项目中使用 +#### Use in Project ```r -# 在项目的 renv.lock 或脚本中指定镜像 +# Specify mirror in project's renv.lock or script renv::init() renv::settings$repos.override(c(CRAN = "https://xget.xi-xu.me/cran/")) -# 安装包 +# Install packages install.packages(c("dplyr", "ggplot2", "tidyr")) -# 或使用 pak 包管理器 +# Or use pak package manager pak::pkg_install("tidyverse", repos = "https://xget.xi-xu.me/cran/") ``` ```bash -# 在命令行中使用 R 脚本安装包 +# Install packages using R script in command line Rscript -e "options(repos = c(CRAN = 'https://xget.xi-xu.me/cran/')); install.packages('ggplot2')" -# 批量安装包 +# Batch install packages Rscript -e " options(repos = c(CRAN = 'https://xget.xi-xu.me/cran/')) packages <- c('dplyr', 'ggplot2', 'tidyr', 'readr') @@ -1386,134 +1377,134 @@ install.packages(packages) " ``` -### Perl 包管理加速 +### Perl Package Acceleration -#### 配置 CPAN 使用 Xget 镜像 +#### Configure CPAN to Use Xget Mirror ```bash -# 配置 CPAN 使用 Xget 镜像 +# Configure CPAN to use Xget mirror cpan o conf urllist push https://xget.xi-xu.me/cpan/ cpan o conf commit -# 或者直接编辑配置文件 ~/.cpan/CPAN/MyConfig.pm -# 添加: +# Or directly edit configuration file ~/.cpan/CPAN/MyConfig.pm +# Add: # 'urllist' => [q[https://xget.xi-xu.me/cpan/]], ``` -#### 使用 cpanm 安装模块 +#### Use cpanm to Install Modules ```bash -# 安装 cpanm(如果没有) +# Install cpanm (if not available) curl -L https://cpanmin.us | perl - --sudo App::cpanminus -# 使用 Xget 镜像安装模块 +# Install modules using Xget mirror cpanm --mirror https://xget.xi-xu.me/cpan/ DBI cpanm --mirror https://xget.xi-xu.me/cpan/ Mojolicious -# 从 Makefile.PL 安装依赖 +# Install dependencies from Makefile.PL cpanm --mirror https://xget.xi-xu.me/cpan/ --installdeps . ``` -#### 在项目中使用 +#### Use in Project ```perl -# 在 cpanfile 中列出依赖 +# List dependencies in cpanfile requires 'DBI'; requires 'Mojolicious'; requires 'JSON'; -# 然后使用 Xget 镜像安装 +# Then install using Xget mirror cpanm --mirror https://xget.xi-xu.me/cpan/ --installdeps . ``` -### TeX/LaTeX 包管理加速 +### TeX/LaTeX Package Acceleration -#### 配置 TeX Live 使用 Xget CTAN 镜像 +#### Configure TeX Live to Use Xget CTAN Mirror ```bash -# 配置 tlmgr 使用 Xget CTAN 镜像 +# Configure tlmgr to use Xget CTAN mirror tlmgr option repository https://xget.xi-xu.me/ctan/systems/texlive/tlnet -# 更新包数据库 +# Update package database tlmgr update --self --all -# 安装包 +# Install packages tlmgr install beamer tlmgr install tikz ``` -#### 配置 MiKTeX 使用 Xget 镜像 +#### Configure MiKTeX to Use Xget Mirror ```bash -# Windows MiKTeX 配置 +# Windows MiKTeX configuration mpm --set-repository=https://xget.xi-xu.me/ctan/systems/win32/miktex -# 更新包数据库 +# Update package database mpm --update-db -# 安装包 +# Install packages mpm --install=beamer mpm --install=pgf ``` -#### 在项目中使用 +#### Use in Project ```bash -# LaTeX 文档编译时自动安装缺失包 +# Automatically install missing packages during LaTeX document compilation pdflatex --shell-escape document.tex -# 或手动安装特定包 +# Or manually install specific packages tlmgr install caption tlmgr install subcaption tlmgr install algorithm2e ``` -### Go 模块加速 +### Go Module Acceleration -#### 配置 Go 使用 Xget 代理 +#### Configure Go to Use Xget Proxy ```bash -# 配置 Go 模块代理 +# Configure Go module proxy export GOPROXY=https://xget.xi-xu.me/golang,direct export GOSUMDB=off -# 或者永久配置 +# Or permanently configure go env -w GOPROXY=https://xget.xi-xu.me/golang,direct go env -w GOSUMDB=off -# 验证配置 +# Verify configuration go env GOPROXY ``` -#### 在项目中使用 +#### Use in Project ```bash -# 下载依赖 +# Download dependencies go mod download -# 更新依赖 +# Update dependencies go get -u ./... -# 清理模块缓存 +# Clean module cache go clean -modcache ``` -### NuGet 包管理加速 +### NuGet Package Acceleration -#### 配置 NuGet 使用 Xget 镜像 +#### Configure NuGet to Use Xget Mirror ```bash -# 添加 Xget 包源 +# Add Xget package source dotnet nuget add source https://xget.xi-xu.me/nuget/v3/index.json -n xget -# 列出包源 +# List package sources dotnet nuget list source -# 在项目中使用 +# Use in project dotnet restore --source https://xget.xi-xu.me/nuget/v3/index.json ``` -#### 在 NuGet.Config 中配置 +#### Configure in NuGet.Config ```xml @@ -1525,12 +1516,12 @@ dotnet restore --source https://xget.xi-xu.me/nuget/v3/index.json ``` -### Rust 包管理加速 +### Rust Package Acceleration -#### 配置 Cargo 使用 Xget 镜像 +#### Configure Cargo to Use Xget Mirror ```bash -# 配置 Cargo 使用 Xget 镜像(在 ~/.cargo/config.toml 中) +# Configure Cargo to use Xget mirror (in ~/.cargo/config.toml) mkdir -p ~/.cargo cat >> ~/.cargo/config.toml << EOF [source.crates-io] @@ -1540,14 +1531,14 @@ replace-with = "xget" registry = "https://xget.xi-xu.me/crates/" EOF -# 验证配置 +# Verify configuration cargo search serde ``` -#### 在项目中使用 +#### Use in Project ```toml -# 在 Cargo.toml 中可以正常使用依赖 +# Can use dependencies normally in Cargo.toml [dependencies] serde = "1.0" tokio = "1.0" @@ -1555,32 +1546,32 @@ reqwest = "0.11" ``` ```bash -# 构建项目时会自动使用 Xget +# Xget will be automatically used when building the project cargo build -# 更新依赖 +# Update dependencies cargo update -# 添加新依赖 +# Add new dependency cargo add clap ``` -### PHP 包管理加速 +### PHP Package Acceleration -#### 配置 Composer 使用 Xget 镜像 +#### Configure Composer to Use Xget Mirror ```bash -# 全局配置 Composer 镜像 +# Globally configure Composer mirror composer config -g repo.packagist composer https://xget.xi-xu.me/packagist/ -# 项目级配置 +# Project-level configuration composer config repo.packagist composer https://xget.xi-xu.me/packagist/ -# 验证配置 +# Verify configuration composer config -l ``` -#### 在 composer.json 中配置 +#### Configure in composer.json ```json { @@ -1597,100 +1588,100 @@ composer config -l } ``` -### Linux 发行版加速 +### Linux Distribution Acceleration -#### Debian/Ubuntu APT 配置 +#### Debian/Ubuntu APT Configuration ```bash -# 备份原始源列表 +# Backup original source list sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup -# 配置 Debian 镜像 +# Configure Debian mirror echo "deb https://xget.xi-xu.me/debian/debian bookworm main" | sudo tee /etc/apt/sources.list echo "deb https://xget.xi-xu.me/debian/debian-security bookworm-security main" | sudo tee -a /etc/apt/sources.list -# 配置 Ubuntu 镜像 +# Configure Ubuntu mirror echo "deb https://xget.xi-xu.me/ubuntu/ubuntu jammy main restricted universe multiverse" | sudo tee /etc/apt/sources.list echo "deb https://xget.xi-xu.me/ubuntu/ubuntu jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list -# 更新包列表 +# Update package list sudo apt update ``` -#### Fedora DNF 配置 +#### Fedora DNF Configuration ```bash -# 配置 Fedora 镜像 +# Configure Fedora mirror sudo sed -i 's|^metalink=|#metalink=|g' /etc/yum.repos.d/fedora*.repo sudo sed -i 's|^#baseurl=http://download.example/pub/fedora/linux|baseurl=https://xget.xi-xu.me/fedora/pub/fedora/linux|g' /etc/yum.repos.d/fedora*.repo -# 更新包缓存 +# Update package cache sudo dnf makecache ``` -#### Rocky Linux DNF 配置 +#### Rocky Linux DNF Configuration ```bash -# 配置 Rocky Linux 镜像 +# Configure Rocky Linux mirror sudo sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/rocky*.repo sudo sed -i 's|^#baseurl=http://dl.rockylinux.org|baseurl=https://xget.xi-xu.me/rocky|g' /etc/yum.repos.d/rocky*.repo -# 更新包缓存 +# Update package cache sudo dnf makecache ``` -#### openSUSE Zypper 配置 +#### openSUSE Zypper Configuration ```bash -# 配置 openSUSE Leap 镜像 +# Configure openSUSE Leap mirror sudo zypper mr -d repo-oss sudo zypper ar -f https://xget.xi-xu.me/opensuse/distribution/leap/15.5/repo/oss/ repo-oss-xget -# 配置 openSUSE Tumbleweed 镜像 +# Configure openSUSE Tumbleweed mirror sudo zypper mr -d repo-oss sudo zypper ar -f https://xget.xi-xu.me/opensuse/tumbleweed/repo/oss/ repo-oss-xget -# 刷新软件源 +# Refresh software sources sudo zypper refresh -# 验证配置 +# Verify configuration sudo zypper lr -u ``` -#### Arch Linux Pacman 配置 +#### Arch Linux Pacman Configuration ```bash -# 备份原始镜像列表 +# Backup original mirror list sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup -# 配置 Arch Linux 镜像 +# Configure Arch Linux mirror echo 'Server = https://xget.xi-xu.me/arch/$repo/os/$arch' | sudo tee /etc/pacman.d/mirrorlist -# 更新包数据库 +# Update package database sudo pacman -Sy ``` -### 学术资源加速 +### Academic Resource Acceleration -#### arXiv 论文下载 +#### arXiv Paper Download ```bash -# 下载 arXiv 论文 PDF +# Download arXiv paper PDF wget https://xget.xi-xu.me/arxiv/pdf/2301.07041.pdf -# 下载论文源码 +# Download paper source curl -L -O https://xget.xi-xu.me/arxiv/e-print/2301.07041 -# 批量下载多篇论文 +# Batch download multiple papers for id in 2301.07041 2302.13971 2303.08774; do wget https://xget.xi-xu.me/arxiv/pdf/${id}.pdf done ``` -#### 在学术工具中使用 +#### Use in Academic Tools ```python -# 在 Python 中使用 arXiv 加速下载 +# Use arXiv accelerated download in Python import requests def download_arxiv_paper(arxiv_id, output_path): @@ -1704,55 +1695,55 @@ def download_arxiv_paper(arxiv_id, output_path): else: print(f"Failed to download {arxiv_id}") -# 下载论文 +# Download paper download_arxiv_paper("2301.07041", "attention_is_all_you_need.pdf") ``` -### F-Droid 存储库镜像 +### F-Droid Repository Mirror -#### 配置 F-Droid 客户端使用 Xget 镜像 +#### Configure F-Droid Client to Use Xget Mirror -1. 在 F-Droid 应用中进入**设置** → **存储库** -2. 点击 **+** 后输入存储库 URL:`https://xget.xi-xu.me/fdroid/repo` -3. 点击**添加**后再点击**添加镜像** +1. In F-Droid app, go to **Settings** → **Repositories** +2. Click **+** and enter repository URL: `https://xget.xi-xu.me/fdroid/repo` +3. Click **Add** then click **Add Mirror** -#### 支持的 F-Droid 服务 +#### Supported F-Droid Services ```url -# F-Droid 应用 APK 下载 -https://xget.xi-xu.me/fdroid/repo/[包名]_[版本号].apk +# F-Droid app APK download +https://xget.xi-xu.me/fdroid/repo/[package-name]_[version-code].apk -# F-Droid 存储库索引 +# F-Droid repository index https://xget.xi-xu.me/fdroid/repo/index-v1.jar -# F-Droid 应用图标 -https://xget.xi-xu.me/fdroid/repo/icons-640/[包名].[版本号].png +# F-Droid app icons +https://xget.xi-xu.me/fdroid/repo/icons-640/[package-name].[version-code].png -# F-Droid API 接口 -https://xget.xi-xu.me/fdroid/api/v1/packages/[包名] +# F-Droid API endpoints +https://xget.xi-xu.me/fdroid/api/v1/packages/[package-name] ``` -#### 使用示例 +#### Usage Examples ```bash -# 直接下载 F-Droid 客户端 APK +# Directly download F-Droid client APK wget https://xget.xi-xu.me/fdroid/repo/org.fdroid.fdroid_1016050.apk -# 下载其他开源应用 +# Download other open source apps curl -L -O https://xget.xi-xu.me/fdroid/repo/org.mozilla.fennec_fdroid_1014000.apk -# 获取应用信息 +# Get app information curl https://xget.xi-xu.me/fdroid/api/v1/packages/org.fdroid.fdroid ``` -#### 批量应用管理 +#### Batch App Management ```bash -# 创建应用下载脚本 +# Create app download script cat > download_fdroid_apps.sh << 'EOF' #!/bin/bash -# 定义要下载的应用列表 +# Define list of apps to download apps=( "org.fdroid.fdroid_1016050.apk" "org.mozilla.fennec_fdroid_1014000.apk" @@ -1760,28 +1751,28 @@ apps=( "org.videolan.vlc_13050399.apk" ) -# 创建下载目录 +# Create download directory mkdir -p fdroid_apps -# 批量下载应用 +# Batch download apps for app in "${apps[@]}"; do - echo "正在下载: $app" + echo "Downloading: $app" wget -P fdroid_apps "https://xget.xi-xu.me/fdroid/repo/$app" done -echo "所有应用下载完成!" +echo "All apps downloaded!" EOF chmod +x download_fdroid_apps.sh ./download_fdroid_apps.sh ``` -#### 开发者集成 +#### Developer Integration -对于 Android 开发者,可以在构建脚本中集成 F-Droid 镜像: +For Android developers, F-Droid mirror can be integrated into build scripts: ```gradle -// 在 build.gradle 中配置 F-Droid 依赖检查 +// Configure F-Droid dependency check in build.gradle task checkFDroidAvailability { doLast { def fdroidUrl = "https://xget.xi-xu.me/fdroid/api/v1/packages/${project.name}" @@ -1790,78 +1781,77 @@ task checkFDroidAvailability { connection.requestMethod = 'GET' def responseCode = connection.responseCode if (responseCode == 200) { - println "应用在 F-Droid 上可用: $fdroidUrl" + println "App available on F-Droid: $fdroidUrl" } } catch (Exception e) { - println "检查 F-Droid 可用性时出错: ${e.message}" + println "Error checking F-Droid availability: ${e.message}" } } } ``` -### Jenkins 插件下载 +### Jenkins Plugin Download -#### 使用 Xget 加速 Jenkins 插件下载和更新 +#### Use Xget to Accelerate Jenkins Plugin Download and Update -支持 Jenkins 更新中心和插件下载,兼容清华镜像等国内镜像源的配置方式。 +Supports Jenkins update center and plugin downloads, compatible with configuration methods of domestic mirrors like Tsinghua mirror. -#### Jenkins 更新中心配置 +#### Jenkins Update Center Configuration -##### 方法一:在 Jenkins Web 界面配置 +##### Method 1: Configure in Jenkins Web Interface -1. 登录 Jenkins 管理界面 -2. 进入 **Manage Jenkins** → **Plugins** → **Advanced** -3. 在 **Update Site** 部分,将 URL 更改为 `https://xget.xi-xu.me/jenkins/update-center.json` +1. Log in to Jenkins management interface +2. Go to **Manage Jenkins** → **Plugins** → **Advanced** +3. In the **Update Site** section, change the URL to `https://xget.xi-xu.me/jenkins/update-center.json` +4. Click **Submit** to save configuration -4. 点击 **Submit** 保存配置 - -##### 方法二:修改配置文件 +##### Method 2: Modify Configuration File ```bash -# 在 Jenkins 服务器上修改更新中心配置文件 -# 默认位置:$JENKINS_HOME/hudson.model.UpdateCenter.xml +# Modify update center configuration file on Jenkins server +# Default location: $JENKINS_HOME/hudson.model.UpdateCenter.xml sudo nano /var/lib/jenkins/hudson.model.UpdateCenter.xml -# 将 URL 改为: +# Change URL to: # https://xget.xi-xu.me/jenkins/update-center.json -# 重启 Jenkins 服务 +# Restart Jenkins service sudo systemctl restart jenkins ``` -#### 支持的 Jenkins 服务 +#### Supported Jenkins Services ```url -# Jenkins 更新中心 JSON +# Jenkins update center JSON https://xget.xi-xu.me/jenkins/update-center.json -# Jenkins 更新中心(实际 JSON 格式) +# Jenkins update center (actual JSON format) https://xget.xi-xu.me/jenkins/update-center.actual.json -# Jenkins 插件下载 -https://xget.xi-xu.me/jenkins/download/plugins/[插件名]/[版本]/[插件名].hpi +# Jenkins plugin download +https://xget.xi-xu.me/jenkins/download/plugins/[plugin-name]/[version]/[plugin-name].hpi -# 实验性插件更新中心 +# Experimental plugin update center https://xget.xi-xu.me/jenkins/experimental/update-center.json ``` -#### 使用示例 +#### Usage Examples ```bash -# 下载 Maven 插件 +# Download Maven plugin wget https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi -# 下载 Git 插件 +# Download Git plugin curl -L -O https://xget.xi-xu.me/jenkins/download/plugins/git/5.2.1/git.hpi -# 获取更新中心信息 +# Get update center information curl https://xget.xi-xu.me/jenkins/update-center.json -# 批量下载常用插件 +# Batch download common plugins cat > download_jenkins_plugins.sh << 'EOF' #!/bin/bash -# 定义要下载的插件列表 +# Define list of plugins to download plugins=( "git:5.2.1" "maven-plugin:3.27" @@ -1870,44 +1860,44 @@ plugins=( "docker-workflow:563.vd5d2e5c4007f" ) -# 创建插件下载目录 +# Create plugin download directory mkdir -p jenkins_plugins -# 批量下载插件 +# Batch download plugins for plugin in "${plugins[@]}"; do name=$(echo $plugin | cut -d: -f1) version=$(echo $plugin | cut -d: -f2) - echo "正在下载插件: $name v$version" + echo "Downloading plugin: $name v$version" wget -P jenkins_plugins "https://xget.xi-xu.me/jenkins/download/plugins/$name/$version/$name.hpi" done -echo "所有插件下载完成!" +echo "All plugins downloaded!" EOF chmod +x download_jenkins_plugins.sh ./download_jenkins_plugins.sh ``` -#### 离线 Jenkins 部署 +#### Offline Jenkins Deployment -对于无网络环境的 Jenkins 部署: +For Jenkins deployment in offline environments: ```bash -# 1. 下载 Jenkins 核心文件 +# 1. Download Jenkins core file wget https://xget.xi-xu.me/jenkins/war/jenkins.war -# 2. 创建插件打包脚本 +# 2. Create plugin packaging script cat > prepare_jenkins_offline.sh << 'EOF' #!/bin/bash -# 创建离线部署目录结构 +# Create offline deployment directory structure mkdir -p jenkins_offline/{plugins,update_center} -# 下载更新中心配置 +# Download update center configuration curl -o jenkins_offline/update_center/update-center.json \ https://xget.xi-xu.me/jenkins/update-center.json -# 必备插件列表 +# Essential plugins list essential_plugins=( "ant:475.vf34069fef73c" "build-timeout:1.31" @@ -1927,35 +1917,35 @@ essential_plugins=( "ws-cleanup:0.45" ) -# 下载所有必备插件 +# Download all essential plugins for plugin in "${essential_plugins[@]}"; do name=$(echo $plugin | cut -d: -f1) version=$(echo $plugin | cut -d: -f2) - echo "下载 $name:$version" + echo "Downloading $name:$version" wget -P jenkins_offline/plugins \ "https://xget.xi-xu.me/jenkins/download/plugins/$name/$version/$name.hpi" done -# 创建部署说明 +# Create deployment instructions cat > jenkins_offline/deploy_instructions.md << 'DEPLOY' -# Jenkins 离线部署说明 +# Jenkins Offline Deployment Instructions -1. 将 jenkins.war 复制到目标服务器 -2. 启动 Jenkins:java -jar jenkins.war -3. 将 plugins/ 目录中的 .hpi 文件复制到 $JENKINS_HOME/plugins/ -4. 重启 Jenkins +1. Copy jenkins.war to target server +2. Start Jenkins: java -jar jenkins.war +3. Copy .hpi files from plugins/ directory to $JENKINS_HOME/plugins/ +4. Restart Jenkins DEPLOY -echo "离线部署包准备完成!" +echo "Offline deployment package prepared!" EOF chmod +x prepare_jenkins_offline.sh ./prepare_jenkins_offline.sh ``` -#### 在项目中使用 +#### Use in Project -##### Jenkinsfile 中的插件检查 +##### Plugin Check in Jenkinsfile ```groovy pipeline { @@ -1965,16 +1955,16 @@ pipeline { stage('Check Plugin Availability') { steps { script { - // 检查 Maven 插件可用性 + // Check Maven plugin availability def pluginUrl = "https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi" try { def response = httpRequest url: pluginUrl, httpMode: 'HEAD' if (response.status == 200) { - echo "Maven 插件可用: ${pluginUrl}" + echo "Maven plugin available: ${pluginUrl}" } } catch (Exception e) { - error "Maven 插件不可用: ${e.message}" + error "Maven plugin not available: ${e.message}" } } } @@ -1982,33 +1972,33 @@ pipeline { stage('Build') { steps { - // 你的构建步骤 - echo "使用加速后的插件进行构建..." + // Your build steps + echo "Building with accelerated plugins..." } } } } ``` -### 容器镜像加速 +### Container Image Acceleration -#### 直接拉取镜像 +#### Pull Images Directly ```bash -# 拉取 GitHub 容器注册表镜像 +# Pull GitHub Container Registry images docker pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest -# 拉取谷歌容器注册表镜像 +# Pull Google Container Registry images docker pull xget.xi-xu.me/cr/gcr/distroless/base:latest -# 拉取微软容器注册表镜像 +# Pull Microsoft Container Registry images docker pull xget.xi-xu.me/cr/mcr/dotnet/runtime:8.0 ``` -#### Kubernetes 部署配置 +#### Kubernetes Deployment Configuration ```yaml -# deployment.yaml - 使用 Xget 的镜像 +# deployment.yaml - Use Xget's images apiVersion: apps/v1 kind: Deployment metadata: @@ -2034,10 +2024,10 @@ spec: - containerPort: 6379 ``` -#### Docker Compose 配置 +#### Docker Compose Configuration ```yaml -# docker-compose.yml - 使用 Xget 加速镜像 +# docker-compose.yml - Use Xget accelerated images version: '3.8' services: web: @@ -2064,10 +2054,10 @@ volumes: mssql_data: ``` -#### Dockerfile 优化 +#### Dockerfile Optimization ```dockerfile -# 在 Dockerfile 中使用 Xget 加速基础镜像 +# Use Xget accelerated base images in Dockerfile FROM xget.xi-xu.me/cr/ghcr/nodejs/node:18-alpine AS builder WORKDIR /app @@ -2077,21 +2067,21 @@ RUN npm install COPY . . RUN npm run build -# 生产阶段 +# Production stage FROM xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest COPY --from=builder /app/dist /usr/share/nginx/html -# 使用微软容器注册表的 .NET 镜像 +# Use Microsoft Container Registry's .NET image FROM xget.xi-xu.me/cr/mcr/dotnet/aspnet:8.0 AS runtime WORKDIR /app COPY --from=builder /app/publish . ENTRYPOINT ["dotnet", "MyApp.dll"] ``` -#### CI/CD 集成 +#### CI/CD Integration ```yaml -# GitHub Actions - 使用 Xget 加速容器构建 +# GitHub Actions - Use Xget to accelerate container builds name: Build and Deploy on: [push] @@ -2103,37 +2093,37 @@ jobs: - name: Build with accelerated base images run: | - # 构建时使用 Xget 的基础镜像 + # Build using Xget's base images docker build -t myapp:latest \ --build-arg BASE_IMAGE=xget.xi-xu.me/cr/ghcr/nodejs/node:18-alpine . - name: Test with accelerated images run: | - # 使用加速镜像进行测试 + # Test using accelerated images docker run --rm \ xget.xi-xu.me/cr/mcr/dotnet/runtime:8.0 \ dotnet --version ``` -#### Podman 配置 +#### Podman Configuration ```bash -# 配置 Podman 使用 Xget 镜像加速 -# 编辑 /etc/containers/registries.conf +# Configure Podman to use Xget image acceleration +# Edit /etc/containers/registries.conf [[registry]] prefix = "ghcr.io" location = "xget.xi-xu.me/cr/ghcr" -# 或者直接拉取 +# Or pull directly podman pull xget.xi-xu.me/cr/ghcr/alpine/alpine:latest podman pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest ``` -#### containerd 配置 +#### containerd Configuration ```toml -# 配置 containerd 使用 Xget -# 编辑 /etc/containerd/config.toml +# Configure containerd to use Xget +# Edit /etc/containerd/config.toml [plugins."io.containerd.grpc.v1.cri".registry.mirrors] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."ghcr.io"] endpoint = ["https://xget.xi-xu.me/cr/ghcr"] @@ -2142,11 +2132,11 @@ podman pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest ``` ```bash -# 重启 containerd +# Restart containerd sudo systemctl restart containerd ``` -### AI 推理 API 加速 +### AI Inference API Acceleration #### OpenAI API @@ -2155,7 +2145,7 @@ from openai import OpenAI client = OpenAI( api_key="your-api-key", - base_url="https://xget.xi-xu.me/ip/openai/v1", # 使用 Xget + base_url="https://xget.xi-xu.me/ip/openai/v1", # Use Xget ) response = client.responses.create( @@ -2173,7 +2163,7 @@ from anthropic import Anthropic client = Anthropic( api_key="your-api-key", - base_url="https://xget.xi-xu.me/ip/anthropic", # 使用 Xget + base_url="https://xget.xi-xu.me/ip/anthropic", # Use Xget ) message = client.messages.create( @@ -2198,7 +2188,7 @@ from google.genai import types client = genai.Client( api_key="your-api-key", - http_options=types.HttpOptions(base_url="https://xget.xi-xu.me/ip/gemini"), # 使用 Xget + http_options=types.HttpOptions(base_url="https://xget.xi-xu.me/ip/gemini"), # Use Xget ) response = client.models.generate_content( @@ -2209,7 +2199,7 @@ response = client.models.generate_content( print(response.text) ``` -#### 多提供商统一接口 +#### Multi-Provider Unified Interface ```python from openai import OpenAI @@ -2221,7 +2211,7 @@ providers = [ ] for name, key, path, model in providers: - client = OpenAI(api_key=key, base_url="https://xget.xi-xu.me/ip" + path) # 使用 Xget + client = OpenAI(api_key=key, base_url="https://xget.xi-xu.me/ip" + path) # Use Xget response = client.chat.completions.create( model=model, messages=[{"role": "user", "content": f"Hello, who are you?"}], @@ -2229,15 +2219,15 @@ for name, key, path, model in providers: print(name, "=>", response.choices[0].message.content) ``` -#### JavaScript/Node.js 中使用 +#### Use in JavaScript/Node.js ```javascript -// OpenAI API 加速 +// OpenAI API acceleration import OpenAI from "openai"; const openaiClient = new OpenAI({ apiKey: "your-openai-api-key", - baseURL: "https://xget.xi-xu.me/ip/openai/v1", // 使用 Xget + baseURL: "https://xget.xi-xu.me/ip/openai/v1", // Use Xget }); async function chatWithGPT() { @@ -2249,12 +2239,12 @@ async function chatWithGPT() { console.log(response.output_text); } -// Claude API 加速 +// Claude API acceleration import Anthropic from "@anthropic-ai/sdk"; const anthropicClient = new Anthropic({ apiKey: "your-claude-api-key", - baseURL: "https://xget.xi-xu.me/ip/anthropic", // 使用 Xget + baseURL: "https://xget.xi-xu.me/ip/anthropic", // Use Xget }); async function chatWithClaude() { @@ -2272,7 +2262,7 @@ async function chatWithClaude() { console.log(message.content[0].text); } -// Gemini API 加速 +// Gemini API acceleration import { GoogleGenAI } from "@google/genai"; const geminiClient = new GoogleGenAI({ @@ -2285,7 +2275,7 @@ async function chatWithGemini() { contents: "Hello, Gemini!", config: { httpOptions: { - baseUrl: "https://xget.xi-xu.me/ip/gemini", // 使用 Xget + baseUrl: "https://xget.xi-xu.me/ip/gemini", // Use Xget }, }, }); @@ -2294,10 +2284,10 @@ async function chatWithGemini() { } ``` -#### 环境变量配置 +#### Environment Variable Configuration ```bash -# 在 .env 文件中配置 +# Configure in .env file OPENAI_BASE_URL=https://xget.xi-xu.me/ip/openai ANTHROPIC_BASE_URL=https://xget.xi-xu.me/ip/anthropic GEMINI_BASE_URL=https://xget.xi-xu.me/ip/gemini @@ -2306,229 +2296,229 @@ MISTRAL_AI_BASE_URL=https://xget.xi-xu.me/ip/mistralai GROQ_BASE_URL=https://xget.xi-xu.me/ip/groq ``` -然后在代码中使用: +Then use in code: ```python import os from openai import OpenAI -# 从环境变量读取配置 +# Read configuration from environment variables client = OpenAI( api_key=os.getenv("OPENAI_API_KEY"), - base_url=os.getenv("OPENAI_BASE_URL") # 自动使用 Xget + base_url=os.getenv("OPENAI_BASE_URL") # Automatically uses Xget ) ``` -## 🚀 部署 +## 🚀 Deployment -### 部署到 Cloudflare Workers +### Deploy to Cloudflare Workers -1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **获取 Cloudflare 凭证**: - - 访问[账户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板 - - 访问 [Workers 和 Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) 记录 Account ID +2. **Get Cloudflare credentials**: + - Visit [Account API tokens](https://dash.cloudflare.com/?to=/:account/api-tokens) to create and note an API token, using the "Edit Cloudflare Workers" template. + - Visit [Workers and Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) to note the Account ID. -3. **配置 GitHub Secrets**: - - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions - - 添加以下 secrets: - - `CLOUDFLARE_API_TOKEN`:你的 API 令牌 - - `CLOUDFLARE_ACCOUNT_ID`:你的 Account ID +3. **Configure GitHub Secrets**: + - Go to your GitHub repository → Settings → Secrets and variables → Actions + - Add the following secrets: + - `CLOUDFLARE_API_TOKEN`: Your API token + - `CLOUDFLARE_ACCOUNT_ID`: Your Account ID -4. **触发部署**: - - 推送代码到 `main` 分支会自动触发部署 - - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 - - 也可以在 GitHub Actions 页面手动触发部署 +4. **Trigger deployment**: + - Pushing code to the `main` branch will automatically trigger deployment + - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment + - You can also manually trigger deployment in the GitHub Actions page -5. **绑定自定义域名**(可选):在 Cloudflare Workers 控制台中绑定你的自定义域名 +5. **Bind custom domain** (optional): Bind your custom domain in the Cloudflare Workers console -### 部署到 Cloudflare Pages +### Deploy to Cloudflare Pages -1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **获取 Cloudflare 凭证**: - - 访问[账户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板 - - 访问 [Workers 和 Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) 记录 Account ID +2. **Get Cloudflare credentials**: + - Visit [Account API tokens](https://dash.cloudflare.com/?to=/:account/api-tokens) to create and note an API token, using the "Edit Cloudflare Workers" template. + - Visit [Workers and Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) to note the Account ID. -3. **配置 GitHub Secrets**: - - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions - - 添加以下 secrets: - - `CLOUDFLARE_API_TOKEN`:你的 API 令牌 - - `CLOUDFLARE_ACCOUNT_ID`:你的 Account ID +3. **Configure GitHub Secrets**: + - Go to your GitHub repository → Settings → Secrets and variables → Actions + - Add the following secrets: + - `CLOUDFLARE_API_TOKEN`: Your API token + - `CLOUDFLARE_ACCOUNT_ID`: Your Account ID -4. **触发部署**: - - 存储库会自动将 Workers 代码转换为 Pages 兼容格式并同步到 `pages` 分支 - - 推送代码到 `main` 分支会自动触发同步和部署工作流 - - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 - - 也可以在 GitHub Actions 页面手动触发部署 +4. **Trigger deployment**: + - The repository will automatically convert Workers code to Pages-compatible format and sync to the `pages` branch + - Pushing code to the `main` branch will automatically trigger sync and deployment workflows + - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment + - You can also manually trigger deployment in the GitHub Actions page -5. **绑定自定义域名**(可选):在 Cloudflare Pages 控制台中绑定你的自定义域名 +5. **Bind custom domain** (optional): Bind your custom domain in the Cloudflare Pages console -**注意**:`pages` 分支是从 `main` 分支自动生成的。请勿手动编辑 `pages` 分支,因为它会被同步工作流覆盖。 +**Note**: The `pages` branch is automatically generated from the `main` branch. Do not manually edit the `pages` branch as it will be overwritten by the sync workflow. -### 部署到 EdgeOne Pages +### Deploy to EdgeOne Pages -1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **获取 EdgeOne Pages API Token**: - - 访问[中国站 EdgeOne 控制台](https://console.cloud.tencent.com/edgeone/pages?tab=api)或[国际站 EdgeOne 控制台](https://console.tencentcloud.com/edgeone/pages?tab=api)创建并记录 API Token +2. **Get EdgeOne Pages API Token**: + - Visit [China EdgeOne Console](https://console.cloud.tencent.com/edgeone/pages?tab=api) or [International EdgeOne Console](https://console.tencentcloud.com/edgeone/pages?tab=api) to create and note an API Token -3. **配置 GitHub Secrets**: - - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions - - 添加以下 secret: - - `EDGEONE_API_TOKEN`:你的 API Token +3. **Configure GitHub Secrets**: + - Go to your GitHub repository → Settings → Secrets and variables → Actions + - Add the following secret: + - `EDGEONE_PAGES_API_TOKEN`: Your API Token -4. **触发部署**: - - 存储库会自动将 Workers 代码转换为 Pages 兼容格式并同步到 `pages` 分支 - - 推送代码到 `main` 分支会自动触发同步和部署工作流 - - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 - - 也可以在 GitHub Actions 页面手动触发部署 +4. **Trigger deployment**: + - The repository will automatically convert Workers code to Pages-compatible format and sync to the `pages` branch + - Pushing code to the `main` branch will automatically trigger sync and deployment workflows + - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment + - You can also manually trigger deployment in the GitHub Actions page -5. **绑定自定义域名**(可选):在 EdgeOne Pages 控制台中绑定你的自定义域名 +5. **Bind custom domain** (optional): Bind your custom domain in the EdgeOne Pages console -**注意**:`pages` 分支是从 `main` 分支自动生成的。请勿手动编辑 `pages` 分支,因为它会被同步工作流覆盖。 +**Note**: The `pages` branch is automatically generated from the `main` branch. Do not manually edit the `pages` branch as it will be overwritten by the sync workflow. -### 部署到 Vercel +### Deploy to Vercel -1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **获取 Vercel 凭证**: - - 访问 [Vercel Account Settings](https://vercel.com/account/settings/tokens) 创建并记录 Access Token - - 访问 Team Settings 记录 Team ID - - 新建项目后访问项目的 Settings 记录 Project ID +2. **Get Vercel credentials**: + - Visit [Vercel Account Settings](https://vercel.com/account/settings/tokens) to create and note an Access Token + - Visit Team Settings to note the Team ID + - Visit project's Settings after creating a new project to note the Project ID -3. **配置 GitHub Secrets**: - - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions - - 添加以下 secrets: - - `VERCEL_TOKEN`:你的 Access Token - - `VERCEL_ORG_ID`:你的 Team ID - - `VERCEL_PROJECT_ID`:你的 Project ID +3. **Configure GitHub Secrets**: + - Go to your GitHub repository → Settings → Secrets and variables → Actions + - Add the following secrets: + - `VERCEL_TOKEN`: Your Access Token + - `VERCEL_ORG_ID`: Your Team ID + - `VERCEL_PROJECT_ID`: Your Project ID -4. **触发部署**: - - 存储库会自动将 Workers 代码转换为 Functions 兼容格式并同步到 `functions` 分支 - - 推送代码到 `main` 分支会自动触发同步和部署工作流 - - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 - - 也可以在 GitHub Actions 页面手动触发部署 +4. **Trigger deployment**: + - The repository will automatically convert Workers code to Functions-compatible format and sync to the `functions` branch + - Pushing code to the `main` branch will automatically trigger sync and deployment workflows + - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment + - You can also manually trigger deployment in the GitHub Actions page -5. **绑定自定义域名**(可选):在 Vercel 控制台中绑定你的自定义域名 +5. **Bind custom domain** (optional): Bind your custom domain in the Vercel console -**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。 +**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow. -### 部署到 Netlify +### Deploy to Netlify -1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **获取 Netlify 凭证**: - - 访问 [Netlify User Settings](https://app.netlify.com/user/applications) 创建并记录 personal access token - - 新建项目后访问 Project configuration 记录 Project ID +2. **Get Netlify credentials**: + - Visit [Netlify User Settings](https://app.netlify.com/user/applications) to create and note a personal access token + - Visit Project configuration after creating a new project to note the Project ID -3. **配置 GitHub Secrets**: - - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions - - 添加以下 secrets: - - `NETLIFY_AUTH_TOKEN`:你的 personal access token - - `NETLIFY_SITE_ID`:你的 Project ID +3. **Configure GitHub Secrets**: + - Go to your GitHub repository → Settings → Secrets and variables → Actions + - Add the following secrets: + - `NETLIFY_AUTH_TOKEN`: Your personal access token + - `NETLIFY_SITE_ID`: Your Project ID -4. **触发部署**: - - 存储库会自动将 Workers 代码转换为 Functions 兼容格式并同步到 `functions` 分支 - - 推送代码到 `main` 分支会自动触发同步和部署工作流 - - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 - - 也可以在 GitHub Actions 页面手动触发部署 +4. **Trigger deployment**: + - The repository will automatically convert Workers code to Functions-compatible format and sync to the `functions` branch + - Pushing code to the `main` branch will automatically trigger sync and deployment workflows + - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment + - You can also manually trigger deployment in the GitHub Actions page -5. **绑定自定义域名**(可选):在 Netlify 控制台中绑定你的自定义域名 +5. **Bind custom domain** (optional): Bind your custom domain in the Netlify console -**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。 +**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow. -### 部署到 Deno Deploy +### Deploy to Deno Deploy -1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **切换默认分支**: - - 进入你的 GitHub 存储库 → Settings → General → Default branch - - 将默认分支从 `main` 切换到 `functions` +2. **Switch default branch**: + - Go to your GitHub repository → Settings → General → Default branch + - Switch the default branch from `main` to `functions` -3. **部署到 Deno Deploy**: - - 参考 [Deno Deploy 官方文档](https://docs.deno.com/deploy/getting_started/)执行部署 - - 在 Deno Deploy 控制台创建新项目并连接你的 GitHub 存储库 +3. **Deploy to Deno Deploy**: + - Follow the [Deno Deploy official documentation](https://docs.deno.com/deploy/getting_started/) for deployment + - Create a new project in the Deno Deploy console and connect your GitHub repository -4. **绑定自定义域名**(可选):在 Deno Deploy 控制台中绑定你的自定义域名 +4. **Bind custom domain** (optional): Bind your custom domain in the Deno Deploy console -**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。 +**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow. -### 自托管部署 +### Self-Hosted Deployment -如果你希望在自己的服务器上运行 Xget,可以使用 Docker 或 Podman 部署: +If you prefer to run Xget on your own server, you can use Docker or Podman deployment: -#### 使用预构建镜像 +#### Using Pre-built Image -从 GitHub Container Registry 拉取并运行预构建的镜像: +Pull and run the pre-built image from GitHub Container Registry: -**使用 Docker:** +**Using Docker:** ```bash -# 拉取最新镜像 +# Pull the latest image docker pull ghcr.io/xixu-me/xget:latest -# 运行容器 +# Run the container docker run -d \ --name xget \ -p 8080:8080 \ ghcr.io/xixu-me/xget:latest ``` -**使用 Podman:** +**Using Podman:** ```bash -# 拉取最新镜像 +# Pull the latest image podman pull ghcr.io/xixu-me/xget:latest -# 运行容器 +# Run the container podman run -d \ --name xget \ -p 8080:8080 \ ghcr.io/xixu-me/xget:latest ``` -#### 本地构建 +#### Building Locally -从源码构建容器镜像: +Build the container image from source: -**使用 Docker:** +**Using Docker:** ```bash -# 克隆存储库 +# Clone the repository git clone https://github.com/xixu-me/Xget.git cd Xget -# 构建镜像 +# Build the image docker build -t xget:local . -# 运行容器 +# Run the container docker run -d \ --name xget \ -p 8080:8080 \ xget:local ``` -**使用 Podman:** +**Using Podman:** ```bash -# 克隆存储库 +# Clone the repository git clone https://github.com/xixu-me/Xget.git cd Xget -# 构建镜像 +# Build the image podman build -t xget:local . -# 运行容器 +# Run the container podman run -d \ --name xget \ -p 8080:8080 \ xget:local ``` -#### 使用 Docker Compose / Podman Compose +#### Using Docker Compose / Podman Compose -创建 `docker-compose.yml` 文件: +Create a `docker-compose.yml` file: ```yaml version: '3.8' @@ -2542,23 +2532,23 @@ services: restart: unless-stopped ``` -**使用 Docker Compose:** +**Using Docker Compose:** ```bash docker-compose up -d ``` -**使用 Podman Compose:** +**Using Podman Compose:** ```bash podman-compose up -d -# 或者使用 podman compose (Podman 4.0+) +# Or use podman compose (Podman 4.0+) podman compose up -d ``` -部署完成后,Xget 将在 8080 端口运行。 +After deployment, Xget will run on port 8080. -如果你希望在 DigitalOcean 上部署和运行 Xget,可以参考文档[《Deploying and Optimizing Xget on DigitalOcean》](docs/deploy-on-digitalocean.md)。通过下方推荐链接注册账户,可获得 200 美元代金券积分,可用于创建 Droplet、Kubernetes、App Platform 等资源: +If you want to deploy and run Xget on DigitalOcean, please refer to *[Deploying and Optimizing Xget on DigitalOcean](docs/deploy-on-digitalocean.md)*. By signing up via the referral link below, you can receive USD 200 in credits to try Droplets, Kubernetes, App Platform, and more:

@@ -2566,43 +2556,43 @@ podman compose up -d

-**注意**:自托管部署不包括全球边缘网络加速,性能取决于你的服务器配置和网络环境。 +**Note**: Self-hosted deployment does not include global edge network acceleration. Performance depends on your server configuration and network environment. -## 🔧 配置 +## 🔧 Configuration -### 配置参数 +### Configuration Parameters -你可以通过修改 `src/config/index.js` 来自定义配置: +You can customize configuration by modifying `src/config/index.js`: ```javascript export const CONFIG = { - TIMEOUT_SECONDS: 30, // 请求超时时间(秒) - MAX_RETRIES: 3, // 最大重试次数 - RETRY_DELAY_MS: 1000, // 重试延迟时间(毫秒) - CACHE_DURATION: 1800, // 缓存持续时间(1800秒 = 30分钟) + TIMEOUT_SECONDS: 30, // Request timeout (seconds) + MAX_RETRIES: 3, // Maximum retry count + RETRY_DELAY_MS: 1000, // Retry delay (milliseconds) + CACHE_DURATION: 1800, // Cache duration (1800 seconds = 30 minutes) SECURITY: { - ALLOWED_METHODS: ["GET", "HEAD"], // 允许的 HTTP 方法(Git 操作会动态允许 POST) - ALLOWED_ORIGINS: ["*"], // 允许的 CORS 源 - MAX_PATH_LENGTH: 2048, // 最大路径长度(字符) + ALLOWED_METHODS: ["GET", "HEAD"], // Allowed HTTP methods (Git operations dynamically allow POST) + ALLOWED_ORIGINS: ["*"], // Allowed CORS origins + MAX_PATH_LENGTH: 2048, // Maximum path length (characters) }, }; ``` -### 性能调优建议 +### Performance Tuning Recommendations -- **缓存优化**:根据使用模式调整 `CACHE_DURATION`,频繁更新的存储库可适当降低 -- **超时设置**:网络条件较差时可适当增加 `TIMEOUT_SECONDS` -- **重试策略**:高延迟环境下可增加 `MAX_RETRIES` 和 `RETRY_DELAY_MS` +- **Cache Optimization**: Adjust `CACHE_DURATION` based on usage patterns, reduce appropriately for frequently updated repositories +- **Timeout Settings**: Increase `TIMEOUT_SECONDS` appropriately for poor network conditions +- **Retry Strategy**: Increase `MAX_RETRIES` and `RETRY_DELAY_MS` in high-latency environments -### 添加新平台 +### Adding New Platforms -要添加对新平台的支持,编辑 `src/config/platforms.js`: +To add support for new platforms, edit `src/config/platforms.js`: ```javascript export const PLATFORMS = { - // 现有平台... + // Existing platforms... - // 新平台示例 + // New platform example custom: { base: "https://example.com", transform: (path) => path.replace(/^\/custom\//, "/"), @@ -2610,109 +2600,109 @@ export const PLATFORMS = { }; ``` -## 🚧 开发 +## 🚧 Development -1. **存储库设置** +1. **Repository Setup** ```bash git clone https://github.com/xixu-me/Xget.git cd Xget npm install - npx wrangler login # 首次使用 + npx wrangler login # First time use ``` -2. **本地开发** +2. **Local Development** ```bash - npm run dev # 启动开发服务器 (http://localhost:8787) - npm run test:run # 运行完整测试套件 - npm run test:coverage # 生成测试覆盖率报告 - npm run lint # 代码检查 - npm run format # 代码格式化 - npm run deploy # 部署到生产 + npm run dev # Start development server (http://localhost:8787) + npm run test:run # Run complete test suite + npm run test:coverage # Generate test coverage report + npm run lint # Code linting + npm run format # Code formatting + npm run deploy # Deploy to production ``` -## 🧪 测试 +## 🧪 Testing -存储库包含完整的测试套件,确保代码质量和功能正确性。 +The repository includes a complete test suite to ensure code quality and functional correctness. -### 完整测试 +### Complete Testing ```bash -# 安装测试依赖 +# Install test dependencies npm install -# 运行所有测试 +# Run all tests npm run test:run -# 生成覆盖率报告 +# Generate coverage report npm run test:coverage -# 监视模式 +# Watch mode npm run test:watch ``` -### 测试覆盖 +### Test Coverage -- **单元测试**: 核心功能、平台配置、性能监控 -- **集成测试**: 端到端流程、平台集成、Git 协议 -- **安全测试**: 输入验证、安全头、权限控制 -- **性能测试**: 响应时间、内存使用、并发处理 +- **Unit Tests**: Core functionality, platform configuration, performance monitoring +- **Integration Tests**: End-to-end processes, platform integration, Git protocol +- **Security Tests**: Input validation, security headers, permission control +- **Performance Tests**: Response time, memory usage, concurrent processing -## 🔍 故障排除 +## 🔍 Troubleshooting -### 常见问题 +### Common Issues -**Q: 下载速度没有明显提升?** -A: 检查源文件是否已经在 CDN 边缘节点缓存,首次访问可能较慢,后续访问会显著提升。 +**Q: No significant speed improvement?** +A: Check if source files are already cached at CDN edge nodes. Initial access may be slower, subsequent accesses will be significantly faster. -**Q: Git 操作失败?** -A: 确认使用了正确的 URL 格式,且 Git 客户端版本支持 HTTPS 代理。 +**Q: Git operations failing?** +A: Confirm correct URL format is used and Git client version supports HTTPS proxy. -**Q: 部署后无法访问?** -A: 检查 Cloudflare Workers 域名是否正确绑定,确认 `wrangler.toml` 配置正确。 +**Q: Cannot access after deployment?** +A: Check if Cloudflare Workers domain is correctly bound, confirm `wrangler.toml` configuration is correct. -**Q: 出现 400 错误?** -A: 检查 URL 路径格式,确认平台前缀正确使用。 +**Q: Getting 400 error?** +A: Check URL path format, confirm platform prefix is correctly used. -### 性能监控 +### Performance Monitoring -在响应头中返回性能指标: +Performance metrics are returned in response headers: -- `X-Performance-Metrics`: 包含请求各阶段的耗时统计 -- `X-Cache-Status`: 显示缓存命中状态 +- `X-Performance-Metrics`: Contains timing statistics for request stages +- `X-Cache-Status`: Shows cache hit status -### 日志调试 +### Log Debugging -在开发环境中,你可以通过 Cloudflare Workers 控制台查看详细日志: +In development environment, you can view detailed logs through Cloudflare Workers console: ```bash npx wrangler dev --log-level debug ``` -## ⚠️ 免责声明 +## ⚠️ Disclaimer -- **合法合规使用**:本存储库旨在为代码存储库、软件包注册表、AI 推理 API、容器镜像、模型、数据集及更多合法开发者资源提供统一加速服务。使用者应严格遵守所在司法辖区法律法规及相关平台服务条款,任何非法用途的法律责任由使用者自行承担 -- **非关联性与独立责任**:本存储库与各第三方平台不存在任何隶属、代理或合作关系。任何基于本存储库的 fork、二次开发、再分发或衍生版本均由其维护者独立承担全部责任;作者、维护者及贡献者不对衍生存储库的任何行为或后果承担法律或连带责任 -- **无担保与免责条款**:在适用法律允许的最大范围内,本存储库按“现状(AS IS)”提供,不提供任何明示或暗示担保(包括但不限于适销性、特定用途适用性、非侵权等)。对因使用本存储库而造成的任何直接或间接损失(包括但不限于数据丢失、业务中断、利润损失等),作者、维护者及贡献者不承担任何责任 -- **风险自担原则**:使用者应自行评估使用风险,确保其使用行为合法合规,不侵犯第三方权益,不得将本存储库用于任何违法、侵权、恶意或不当用途 -- **第三方平台合规**:使用者应遵守相关平台的服务条款、API 使用政策、速率限制及版权要求,避免对源平台造成过载或干扰。各平台对其内容、服务及政策拥有最终解释权 -- **知识产权保护**:通过本存储库获取的内容受相应版权法保护。使用者应遵守相关许可协议、版权声明及使用条款,不得从事任何侵犯知识产权的行为 -- **安全防护建议**:虽然本存储库采用无日志架构,不存储用户请求数据,但基于互联网传输的固有风险,建议使用者对下载内容进行安全扫描,尤其对可执行文件、脚本等保持谨慎 -- **开源性质声明**:本存储库为开源项目,作者与贡献者不承担提供技术支持、错误修复或持续维护的义务。外部贡献的合并不代表对特定用途或效果的承诺与背书 -- **名称使用规范**:严禁任何可能暗示作者或贡献者提供商业合作、技术支持、担保或背书的表述。涉及存储库名称或作者标识的使用应遵循相关法律法规及通用规范 -- **免责声明更新**:本免责声明可能随存储库发展或法律环境变化进行更新修订。使用者继续使用、复制、分发或修改本存储库即视为接受最新版本的免责声明 +- **Legal and Compliant Use**: This repository aims to provide unified acceleration services for code repositories, package registries, AI inference APIs, container images, models, datasets, and other legitimate developer resources. Users must strictly comply with the laws and regulations of their jurisdiction and the terms of service of relevant platforms. Any illegal use is the sole responsibility of the user +- **Non-Affiliation and Independent Responsibility**: This repository has no affiliation, agency, or partnership relationship with any third-party platforms. Any fork, secondary development, redistribution, or derivative version based on this repository is solely the responsibility of its maintainer; authors, maintainers, and contributors bear no legal or joint liability for the actions or consequences of derivative repositories +- **No Warranty and Limitation of Liability**: To the maximum extent permitted by applicable law, this repository is provided "AS IS" without any express or implied warranties (including but not limited to merchantability, fitness for a particular purpose, non-infringement, etc.). Authors, maintainers, and contributors assume no responsibility for any direct or indirect losses (including but not limited to data loss, business interruption, profit loss, etc.) resulting from the use of this repository +- **Risk Assumption Principle**: Users should independently assess usage risks, ensure their use is legal and compliant, respect third-party rights, and must not use this repository for any illegal, infringing, malicious, or improper purposes +- **Third-Party Platform Compliance**: Users must comply with the terms of service, API usage policies, rate limits, and copyright requirements of relevant platforms, and avoid causing overload or interference to source platforms. Each platform has the final interpretation right over its content, services, and policies +- **Intellectual Property Protection**: Content obtained through this repository is protected by respective copyright laws. Users must comply with relevant licensing agreements, copyright notices, and terms of use, and must not engage in any activities that infringe intellectual property rights +- **Security Recommendations**: Although this repository adopts a no-log architecture and does not store user request data, due to inherent risks of internet transmission, users are advised to perform security scans on downloaded content, especially for executable files and scripts +- **Open Source Nature**: This repository is open source. Authors and contributors are not obligated to provide technical support, bug fixes, or continuous maintenance. The inclusion of external contributions does not constitute endorsement or commitment to specific uses or effects +- **Name Usage Guidelines**: Any representations that may imply authors or contributors provide commercial cooperation, technical support, guarantees, or endorsements are strictly prohibited. The use of repository names or author identifiers must comply with relevant laws and regulations as well as general norms +- **Disclaimer Updates**: This disclaimer may be updated and revised as the repository develops or legal environments change. Continued use, copying, distribution, or modification of this repository constitutes acceptance of the latest version of this disclaimer -## 🤝 贡献 +## 🤝 Contributing -我们欢迎各种形式的贡献!请查看[贡献指南](CONTRIBUTING.md)了解如何参与存储库开发。 +We welcome all forms of contribution! Please check the [Contributing Guide](CONTRIBUTING.md) to learn how to participate in repository development. -1. **报告问题**: 使用 [issue 模板](https://github.com/xixu-me/Xget/issues/new/choose)报告 bug 或提出功能请求 -2. **提交代码**: fork 存储库,创建功能分支,提交 pull request -3. **改进文档**: 修正错误、添加示例、完善说明 -4. **测试反馈**: 在不同环境下测试并提供反馈 +1. **Report Issues**: Use [issue templates](https://github.com/xixu-me/Xget/issues/new/choose) to report bugs or propose feature requests +2. **Submit Code**: Fork the repository, create a feature branch, submit a pull request +3. **Improve Documentation**: Fix errors, add examples, improve descriptions +4. **Testing Feedback**: Test in different environments and provide feedback -## 🌟 Star 历史 +## 🌟 Star History @@ -2722,20 +2712,18 @@ npx wrangler dev --log-level debug -## 📝 许可证 +## 📝 License -版权所有 © Xi Xu。 +Copyright © Xi Xu. -本存储库采用 GPL-3.0 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。 +This repository is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details. ---
-**如果这个存储库对您有帮助,请考虑给它一个 ⭐ star!** +**If this repository helps you, please consider giving it a ⭐ star!** Made with ❤️ by [Xi Xu](https://xi-xu.me)
- -[![Powered by DartNode](https://dartnode.com/branding/DN-Open-Source-sm.png)](https://dartnode.com "Powered by DartNode - Free VPS for Open Source") diff --git a/README.en.md b/README.zh-Hans.md similarity index 52% rename from README.en.md rename to README.zh-Hans.md index 3c89cc2..643308e 100644 --- a/README.en.md +++ b/README.zh-Hans.md @@ -2,153 +2,162 @@ # Xget 🚀 -> 🗳️ **Xget is participating in the [Gitee 2025 Open Source Software Awards](https://gitee.com/activity/2025opensource?ident=IB55NH). Please vote for us! Thank you for your support!** 🙏 +> 🗳️ **Xget 正在参加 [Gitee 2025 年度开源软件评选](https://gitee.com/activity/2025opensource?ident=IB55NH),请为我们投上宝贵的一票!感谢您的支持!** 🙏 xixu-me%2FXget | Trendshift Xget | Product Hunt [![Ask Zread](https://img.shields.io/badge/Ask_Zread-_.svg?style=flat&color=00b0aa&labelColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuOTYxNTYgMS42MDAxSDIuMjQxNTZDMS44ODgxIDEuNjAwMSAxLjYwMTU2IDEuODg2NjQgMS42MDE1NiAyLjI0MDFWNC45NjAxQzEuNjAxNTYgNS4zMTM1NiAxLjg4ODEgNS42MDAxIDIuMjQxNTYgNS42MDAxSDQuOTYxNTZDNS4zMTUwMiA1LjYwMDEgNS42MDE1NiA1LjMxMzU2IDUuNjAxNTYgNC45NjAxVjIuMjQwMUM1LjYwMTU2IDEuODg2NjQgNS4zMTUwMiAxLjYwMDEgNC45NjE1NiAxLjYwMDFaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00Ljk2MTU2IDEwLjM5OTlIMi4yNDE1NkMxLjg4ODEgMTAuMzk5OSAxLjYwMTU2IDEwLjY4NjQgMS42MDE1NiAxMS4wMzk5VjEzLjc1OTlDMS42MDE1NiAxNC4xMTM0IDEuODg4MSAxNC4zOTk5IDIuMjQxNTYgMTQuMzk5OUg0Ljk2MTU2QzUuMzE1MDIgMTQuMzk5OSA1LjYwMTU2IDE0LjExMzQgNS42MDE1NiAxMy43NTk5VjExLjAzOTlDNS42MDE1NiAxMC42ODY0IDUuMzE1MDIgMTAuMzk5OSA0Ljk2MTU2IDEwLjM5OTlaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik0xMy43NTg0IDEuNjAwMUgxMS4wMzg0QzEwLjY4NSAxLjYwMDEgMTAuMzk4NCAxLjg4NjY0IDEwLjM5ODQgMi4yNDAxVjQuOTYwMUMxMC4zOTg0IDUuMzEzNTYgMTAuNjg1IDUuNjAwMSAxMS4wMzg0IDUuNjAwMUgxMy43NTg0QzE0LjExMTkgNS42MDAxIDE0LjM5ODQgNS4zMTM1NiAxNC4zOTg0IDQuOTYwMVYyLjI0MDFDMTQuMzk4NCAxLjg4NjY0IDE0LjExMTkgMS42MDAxIDEzLjc1ODQgMS42MDAxWiIgZmlsbD0iI2ZmZiIvPgo8cGF0aCBkPSJNNCAxMkwxMiA0TDQgMTJaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00IDEyTDEyIDQiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L3N2Zz4K&logoColor=ffffff)](https://zread.ai/xixu-me/Xget) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/xixu-me/Xget) -[![Chromium](https://img.shields.io/badge/Chromium-4285F4?logo=googlechrome&logoColor=white)](#-ecosystem-integration) -[![Firefox](https://img.shields.io/badge/Firefox-FF7139?logo=Firefox&logoColor=white)](#-ecosystem-integration) +[![Chromium](https://img.shields.io/badge/Chromium-4285F4?logo=googlechrome&logoColor=white)](#-生态系统集成) +[![Firefox](https://img.shields.io/badge/Firefox-FF7139?logo=Firefox&logoColor=white)](#-生态系统集成) -[![Cloudflare](https://img.shields.io/badge/Cloudflare-F38020?&logo=cloudflare&logoColor=white)](#deploy-to-cloudflare-workers) -[![EdgeOne](https://img.shields.io/badge/EdgeOne-006EFF?&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAACNklEQVR4nJ1W7XHbMAx96ul/lQnCDapOUG3gdIIkG6QjdINOUGeDNhNYmUDuBHIWiNQF/PqDYAxDoMUGdzx+AXgAAQGqSKKAOgAbma8BXMn5DGAv4wlAv6qJ5KVxR3LkOR3NWu9HkcnqzF0EkoMDcsysLd8oOooAb0lOF7wqpYnkzRrgZkVJ8mp0jLFzotscYOC6ZyNjjLbOnTZI7weSjQc4ZoQmkjuSneIdMoADyR9iVKuB0qglWYOT0n9Uys/qPAD4ZHgfAXwzfO/6LLyxcTxbJEdufFi1aEk32l6Z+1Lhep1lQa1aVwI2O3wBsTIFxOoUADzVspgzQp6S1pztATRyvpG5lTNLTUVykssJwF91OQP4bATuAGzVngBexJD0vJW51/u5VpZc4VSUgViMLX1xlIUCoERNLoYE8Ns579S6chTngGYZh1oWjRGoEGOjKSAGP/HovqblDoiJtAfwLPv5xHnqCrbNeK3K8qX9juQDMx3CVpoesXLop7DeATF+2rsKsbo8oizD3zzsjLWk30RHw7N7R5V68/AgMUpeWg9bLLOxL/AniOw1Yp58t/FZi5+mzuFrJJY/Sb6qFzmmV9PMgzBsHUW/eN5gJwdk54Rm4YTXgHPx00p24qEGydFElb3e09nUbpXVuZ+oS/88Z62rJLMelHAJSDqf6LxWSXvS35/+Vr0SlqrPHsBXxOw/o5IGHDLKE4AucS8A7hG7zAIMACryv371WxkfxYhZFD8jFvt+TdE/deK28xBAUlEAAAAASUVORK5CYII=)](#deploy-to-edgeone-pages) -[![Vercel](https://img.shields.io/badge/Vercel-000000?&logo=vercel&logoColor=white)](#deploy-to-vercel) -[![Netlify](https://img.shields.io/badge/Netlify-00C7B7?&logo=netlify&logoColor=white)](#deploy-to-netlify) -[![Deno](https://img.shields.io/badge/Deno-70FFAF?&logo=deno&logoColor=black)](#deploy-to-deno-deploy) -[![Docker](https://img.shields.io/badge/Docker-2496ED?&logo=docker&logoColor=white)](#self-hosted-deployment) -[![Podman](https://img.shields.io/badge/Podman-892CA0?&logo=podman&logoColor=white)](#self-hosted-deployment) +[![Cloudflare](https://img.shields.io/badge/Cloudflare-F38020?&logo=cloudflare&logoColor=white)](#部署到-cloudflare-workers) +[![EdgeOne](https://img.shields.io/badge/EdgeOne-006EFF?&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAACNklEQVR4nJ1W7XHbMAx96ul/lQnCDapOUG3gdIIkG6QjdINOUGeDNhNYmUDuBHIWiNQF/PqDYAxDoMUGdzx+AXgAAQGqSKKAOgAbma8BXMn5DGAv4wlAv6qJ5KVxR3LkOR3NWu9HkcnqzF0EkoMDcsysLd8oOooAb0lOF7wqpYnkzRrgZkVJ8mp0jLFzotscYOC6ZyNjjLbOnTZI7weSjQc4ZoQmkjuSneIdMoADyR9iVKuB0qglWYOT0n9Uys/qPAD4ZHgfAXwzfO/6LLyxcTxbJEdufFi1aEk32l6Z+1Lhep1lQa1aVwI2O3wBsTIFxOoUADzVspgzQp6S1pztATRyvpG5lTNLTUVykssJwF91OQP4bATuAGzVngBexJD0vJW51/u5VpZc4VSUgViMLX1xlIUCoERNLoYE8Ns579S6chTngGYZh1oWjRGoEGOjKSAGP/HovqblDoiJtAfwLPv5xHnqCrbNeK3K8qX9juQDMx3CVpoesXLop7DeATF+2rsKsbo8oizD3zzsjLWk30RHw7N7R5V68/AgMUpeWg9bLLOxL/AniOw1Yp58t/FZi5+mzuFrJJY/Sb6qFzmmV9PMgzBsHUW/eN5gJwdk54Rm4YTXgHPx00p24qEGydFElb3e09nUbpXVuZ+oS/88Z62rJLMelHAJSDqf6LxWSXvS35/+Vr0SlqrPHsBXxOw/o5IGHDLKE4AucS8A7hG7zAIMACryv371WxkfxYhZFD8jFvt+TdE/deK28xBAUlEAAAAASUVORK5CYII=)](#部署到-edgeone-pages) +[![Vercel](https://img.shields.io/badge/Vercel-000000?&logo=vercel&logoColor=white)](#部署到-vercel) +[![Netlify](https://img.shields.io/badge/Netlify-00C7B7?&logo=netlify&logoColor=white)](#部署到-netlify) +[![Deno](https://img.shields.io/badge/Deno-70FFAF?&logo=deno&logoColor=black)](#部署到-deno-deploy) +[![Docker](https://img.shields.io/badge/Docker-2496ED?&logo=docker&logoColor=white)](#自托管部署) +[![Podman](https://img.shields.io/badge/Podman-892CA0?&logo=podman&logoColor=white)](#自托管部署) -***[汉语](README.md)*** +***[English](README.md)*** [![GitHub](https://img.shields.io/badge/GitHub-181717?&logo=github&logoColor=white)](#github) [![GitLab](https://img.shields.io/badge/GitLab-FC6D26?&logo=gitlab&logoColor=white)](#gitlab) [![Gitea](https://img.shields.io/badge/Gitea-609926?&logo=gitea&logoColor=white)](#gitea) [![Codeberg](https://img.shields.io/badge/Codeberg-2185D0?&logo=codeberg&logoColor=white)](#codeberg) [![SourceForge](https://img.shields.io/badge/SourceForge-FF6600?&logo=sourceforge&logoColor=white)](#sourceforge) -[![AOSP](https://img.shields.io/badge/AOSP-3DDC84?&logo=android&logoColor=white)](#aosp-android-open-source-project) -[![Hugging Face](https://img.shields.io/badge/Hugging%20Face-FFD21E?&logo=huggingface&logoColor=black)](#hugging-face-mirror) -[![Civitai](https://img.shields.io/badge/Civitai-1971C2)](#civitai-ai-model-platform) -[![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](#npm-package-acceleration) -[![PyPI](https://img.shields.io/badge/PyPI-3775A9?logo=pypi&logoColor=white)](#python-package-acceleration) -[![conda](https://img.shields.io/badge/conda-44A833?logo=anaconda&logoColor=white)](#conda-package-acceleration) -[![Maven](https://img.shields.io/badge/Maven-C71A36?logo=apachemaven&logoColor=white)](#maven-package-acceleration) -[![Apache](https://img.shields.io/badge/Apache-D22128?logo=apache&logoColor=white)](#apache-software-download-acceleration) -[![Gradle](https://img.shields.io/badge/Gradle-02303A?logo=gradle&logoColor=white)](#gradle-package-acceleration) -[![Homebrew](https://img.shields.io/badge/Homebrew-FBB040?logo=homebrew&logoColor=black)](#homebrew-package-acceleration) -[![RubyGems](https://img.shields.io/badge/RubyGems-E9573F?logo=rubygems&logoColor=white)](#ruby-package-acceleration) -[![CRAN](https://img.shields.io/badge/CRAN-276DC3?logo=r&logoColor=white)](#r-package-acceleration) -[![CPAN](https://img.shields.io/badge/CPAN-0073A1?logo=perl&logoColor=white)](#perl-package-acceleration) -[![CTAN](https://img.shields.io/badge/CTAN-008080?logo=latex&logoColor=white)](#texlatex-package-acceleration) -[![Go](https://img.shields.io/badge/Go-00ADD8?logo=go&logoColor=white)](#go-module-acceleration) -[![NuGet](https://img.shields.io/badge/NuGet-004880?logo=nuget&logoColor=white)](#nuget-package-acceleration) -[![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white)](#rust-package-acceleration) -[![Packagist](https://img.shields.io/badge/Packagist-F28D1A?logo=packagist&logoColor=white)](#php-package-acceleration) -[![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=white)](#debianubuntu-apt-configuration) -[![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?logo=ubuntu&logoColor=white)](#debianubuntu-apt-configuration) -[![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=white)](#fedora-dnf-configuration) -[![Rocky Linux](https://img.shields.io/badge/Rocky%20Linux-10B981?logo=rockylinux&logoColor=white)](#rocky-linux-dnf-configuration) -[![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?logo=opensuse&logoColor=white)](#opensuse-zypper-configuration) -[![Arch Linux](https://img.shields.io/badge/Arch%20Linux-1793D1?logo=archlinux&logoColor=white)](#arch-linux-pacman-configuration) -[![arXiv](https://img.shields.io/badge/arXiv-B31B1B?logo=arxiv&logoColor=white)](#arxiv-paper-download) -[![F-Droid](https://img.shields.io/badge/F--Droid-1976D2?logo=f-droid&logoColor=white)](#f-droid-repository-mirror) -[![Jenkins](https://img.shields.io/badge/Jenkins-D24939?logo=jenkins&logoColor=white)](#jenkins-plugin-download) -[![Container Registries](https://img.shields.io/badge/Container%20Registries-262261?logo=opencontainersinitiative&logoColor=white)](#container-registries) -[![AI Inference Providers](https://img.shields.io/badge/AI%20Inference%20Providers-94A3B8?logo=openrouter&logoColor=white)](#ai-inference-providers) +[![AOSP](https://img.shields.io/badge/AOSP-3DDC84?&logo=android&logoColor=white)](#aosp-android-%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE) +[![Hugging Face](https://img.shields.io/badge/Hugging%20Face-FFD21E?&logo=huggingface&logoColor=black)](#hugging-face-镜像) +[![Civitai](https://img.shields.io/badge/Civitai-1971C2)](#civitai-ai-模型平台) +[![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](#npm-包管理加速) +[![PyPI](https://img.shields.io/badge/PyPI-3775A9?logo=pypi&logoColor=white)](#python-包管理加速) +[![conda](https://img.shields.io/badge/conda-44A833?logo=anaconda&logoColor=white)](#conda-包管理加速) +[![Maven](https://img.shields.io/badge/Maven-C71A36?logo=apachemaven&logoColor=white)](#maven-包管理加速) +[![Apache](https://img.shields.io/badge/Apache-D22128?logo=apache&logoColor=white)](#apache-软件下载加速) +[![Gradle](https://img.shields.io/badge/Gradle-02303A?logo=gradle&logoColor=white)](#gradle-包管理加速) +[![Homebrew](https://img.shields.io/badge/Homebrew-FBB040?logo=homebrew&logoColor=black)](#homebrew-包管理加速) +[![RubyGems](https://img.shields.io/badge/RubyGems-E9573F?logo=rubygems&logoColor=white)](#ruby-包管理加速) +[![CRAN](https://img.shields.io/badge/CRAN-276DC3?logo=r&logoColor=white)](#r-包管理加速) +[![CPAN](https://img.shields.io/badge/CPAN-0073A1?logo=perl&logoColor=white)](#perl-包管理加速) +[![CTAN](https://img.shields.io/badge/CTAN-008080?logo=latex&logoColor=white)](#texlatex-包管理加速) +[![Go](https://img.shields.io/badge/Go-00ADD8?logo=go&logoColor=white)](#go-模块加速) +[![NuGet](https://img.shields.io/badge/NuGet-004880?logo=nuget&logoColor=white)](#nuget-包管理加速) +[![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white)](#rust-包管理加速) +[![Packagist](https://img.shields.io/badge/Packagist-F28D1A?logo=packagist&logoColor=white)](#php-包管理加速) +[![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=white)](#debianubuntu-apt-配置) +[![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?logo=ubuntu&logoColor=white)](#debianubuntu-apt-配置) +[![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=white)](#fedora-dnf-配置) +[![Rocky Linux](https://img.shields.io/badge/Rocky%20Linux-10B981?logo=rockylinux&logoColor=white)](#rocky-linux-dnf-配置) +[![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?logo=opensuse&logoColor=white)](#opensuse-zypper-配置) +[![Arch Linux](https://img.shields.io/badge/Arch%20Linux-1793D1?logo=archlinux&logoColor=white)](#arch-linux-pacman-配置) +[![arXiv](https://img.shields.io/badge/arXiv-B31B1B?logo=arxiv&logoColor=white)](#arxiv-论文下载) +[![F-Droid](https://img.shields.io/badge/F--Droid-1976D2?logo=f-droid&logoColor=white)](#f-droid-存储库镜像) +[![Jenkins](https://img.shields.io/badge/Jenkins-D24939?logo=jenkins&logoColor=white)](#jenkins-插件下载) +[![容器注册表](https://img.shields.io/badge/容器注册表-262261?logo=opencontainersinitiative&logoColor=white)](#容器注册表) +[![AI 推理提供商](https://img.shields.io/badge/AI%20推理提供商-94A3B8?logo=openrouter&logoColor=white)](#ai-推理提供商) -Ultra-high-performance, secure, all-in-one acceleration engine for developer resources that significantly outperforms traditional solutions, delivering unified, efficient acceleration across code repositories, model and dataset hubs, package registries, container registries, AI inference providers, and more. +面向开发者资源的超高性能、安全、一体化加速引擎,其性能显著优于传统解决方案,为代码存储库、模型和数据集中心、软件包注册表、容器注册表、AI 推理提供商等提供统一、高效的加速。 -In-depth technical analysis article published: ***[Deep Dive into Xget: A High-Performance, Multi-Protocol, and Secure Acceleration Engine for Developer Resources](https://blog.xi-xu.me/2025/10/07/deep-dive-into-xget-technology-en.html)***. +技术深度解析文章已发布:**[《深入剖析 Xget:一个高性能、多协议、高安全性的开发者资源加速引擎》](https://blog.xi-xu.me/2025/10/07/deep-dive-into-xget-technology.html)**。 -## 🎯 Quick Start +## 💡 存储库初衷 -**Pre-deployed Instance (no reliability guarantee): `xget.xi-xu.me`** +本存储库的初衷是为了加速在中国大陆境内访问不违反相关法律法规的平台上的开发者资源,从而为广大开发者提供一个稳定、合法的加速体验。我们致力于: -**URL Converter:** [**`xuc.xi-xu.me`**](https://xuc.xi-xu.me) - Convert any supported platform URL to Xget's acceleration format with one click! +- **🌍 消除地理限制**:帮助中国大陆开发者快速访问海外开发者资源 +- **⚖️ 合规合法**:严格遵守相关法律法规,仅加速合法资源 +- **🚀 提升效率**:显著提高开发者的工作效率和开发体验 +- **🆓 普惠开源**:为开源社区贡献力量,促进技术交流与发展 -## 🌟 Core Advantages - Why Choose Xget? +## 🎯 快速使用 -### ⚡ Extreme Performance - Breaking Through Traditional Accelerator Bottlenecks +**预部署实例(不保证可靠性):`xget.xi-xu.me`** -- **⚡ Millisecond Response**: Cloudflare's global 330+ edge nodes, average response time < 50ms -- **🌐 HTTP/3 Ultra-Fast Protocol**: Latest HTTP/3 protocol enabled, 40% reduction in connection latency, 30% increase in transmission speed -- **📦 Intelligent Multi-Compression**: Triple compression algorithms (gzip, deflate, brotli), 60% improvement in transmission efficiency -- **🔗 Zero-Latency Pre-Connection**: Connection warm-up and keep-alive, eliminating handshake overhead for second-level responses -- **⚡ Parallel Chunked Download**: Full support for HTTP Range requests, multiplied multi-threaded download speeds -- **🎯 Smart Routing Optimization**: Automatically selects optimal transmission paths, avoiding network congestion nodes +**URL 转换器:**[**`xuc.xi-xu.me`**](https://xuc.xi-xu.me) - 一键转换任意支持平台的 URL 为 Xget 的加速格式! -### 🌐 Deep Multi-Platform Integration +## 🌟 核心优势 - 为什么选择 Xget? -- **All-in-One Multi-Platform Support**: Unified support for mainstream platforms in various development scenarios -- **Intelligent Recognition and Conversion**: Automatically recognizes platform prefixes and converts to correct URL structures for target platforms -- **Consistent Acceleration Experience**: Enjoy unified and stable ultra-fast download experience regardless of file type or source +### ⚡ 极速性能 - 突破传统加速器瓶颈 -### 🔒 Enterprise-Grade Security +- **⚡ 毫秒级响应**:Cloudflare 全球 330+ 边缘节点,平均响应时间 < 50ms +- **🌐 HTTP/3 极速协议**:启用最新 HTTP/3 协议,连接延迟降低 40%,传输速度提升 30% +- **📦 智能多重压缩**:gzip、deflate、brotli 三重压缩算法,传输效率提升 60% +- **🔗 零延迟预连接**:连接预热和保持活跃,消除握手开销,实现秒级响应 +- **⚡ 并行分片下载**:完整支持 HTTP Range 请求,多线程下载速度倍增 +- **🎯 智能路由优化**:自动选择最优传输路径,避开网络拥堵节点 -- **Multi-Layer Security Headers**: - - `Strict-Transport-Security`: Enforces HTTPS transmission, prevents man-in-the-middle attacks - - `X-Frame-Options: DENY`: Prevents clickjacking attacks - - `X-XSS-Protection`: Built-in XSS protection mechanism - - `Content-Security-Policy`: Strict content security policy - - `Referrer-Policy`: Controls referrer information leakage -- **Request Validation Mechanism**: - - HTTP method whitelist: Regular requests limited to GET/HEAD, Git operations dynamically allow POST - - Path length limit: Prevents excessively long URL attacks (max 2048 characters) - - Input sanitization: Prevents path traversal and injection attacks -- **Timeout Protection**: 30-second request timeout, prevents resource exhaustion and malicious requests +### 🌐 多平台深度集成 -### 🚀 Modern Architecture and Reliability +- **一站式多平台支持**:统一支持各种开发场景中的主流平台 +- **智能识别与转换**:自动识别平台前缀并转换为目标平台的正确 URL 结构 +- **一致的加速体验**:无论文件类型或来源,均可享受统一且稳定的极速下载体验 -- **Intelligent Retry Mechanism**: - - Maximum 3 retries with linear delay strategy (1000ms × retry count) - - Automatic error recovery, improved download success rate - - Timeout detection and interruption handling -- **Efficient Caching Strategy**: - - 1800 seconds (30 minutes) default cache duration, significantly reduces origin server pressure - - Git operations skip caching to ensure real-time data - - Edge caching based on Cloudflare Cache API -- **Performance Monitoring System**: - - Built-in `PerformanceMonitor` class for real-time tracking of request stage durations - - Detailed performance data provided via `X-Performance-Metrics` response header - - Cache hit rate statistics and optimization recommendations +### 🔒 企业级安全保障 -### 🎯 Full Git Protocol Compatibility +- **多层安全标头**: + - `Strict-Transport-Security`:强制 HTTPS 传输,预防中间人攻击 + - `X-Frame-Options: DENY`:防止点击劫持攻击 + - `X-XSS-Protection`:内置 XSS 防护机制 + - `Content-Security-Policy`:严格的内容安全策略 + - `Referrer-Policy`:控制引用信息泄露 +- **请求验证机制**: + - HTTP 方法白名单:常规请求限制为 GET/HEAD,Git 操作动态允许 POST + - 路径长度限制:防止超长 URL 攻击(最大 2048 字符) + - 输入清理:防止路径遍历和注入攻击 +- **超时保护**:30 秒请求超时,防止资源耗尽和恶意请求 -- **Smart Protocol Detection**: - - Automatically recognizes Git-specific endpoints (`/info/refs`, `/git-upload-pack`, `/git-receive-pack`) - - Detects Git client User-Agent patterns - - Supports query parameters like `service=git-upload-pack` -- **Complete Operation Support**: - - `git clone`: Full repository cloning, supports shallow clones and branch specification - - `git push`: Code push and branch management - - `git pull/fetch`: Incremental updates and remote synchronization - - `git submodule`: Recursive submodule cloning -- **Protocol Optimization**: - - Preserves Git-specific request headers and authentication information - - Smart User-Agent handling (default `git/2.34.1`) - - Supports Git LFS large file transfer +### 🚀 现代架构与可靠性 -### 📱 Ecosystem Integration +- **智能重试机制**: + - 最大 3 次重试,线性延迟策略(1000ms × 重试次数) + - 自动错误恢复,提高下载成功率 + - 超时检测和中断处理 +- **高效缓存策略**: + - 1800 秒(30 分钟)默认缓存时长,显著减少源站压力 + - Git 操作跳过缓存,确保实时性 + - 基于 Cloudflare Cache API 的边缘缓存 +- **性能监控系统**: + - 内置 `PerformanceMonitor` 类,实时追踪请求各阶段耗时 + - 通过 `X-Performance-Metrics` 响应头提供详细性能数据 + - 支持缓存命中率统计和优化建议 -- **Dedicated Browser Extension**: [Xget Now](https://github.com/xixu-me/Xget-Now) provides seamless experience - - Automatic URL redirection, no manual URL modification needed - - Support for custom Xget instance domains - - Multi-platform preference settings and blacklist/whitelist management - - Local processing ensures privacy and security -- **Download Tool Compatibility**: Perfect support for wget, cURL, aria2, IDM, and other mainstream download tools -- **CI/CD Integration**: Can be used directly in GitHub Actions, GitLab CI, and other environments +### 🎯 Git 协议完全兼容 -## 📖 URL Conversion Rules +- **智能协议检测**: + - 自动识别 Git 特定端点(`/info/refs`、`/git-upload-pack`、`/git-receive-pack`) + - 检测 Git 客户端 User-Agent 模式 + - 支持 `service=git-upload-pack` 等查询参数 +- **完整操作支持**: + - `git clone`:完整存储库克隆,支持浅克隆和分支指定 + - `git push`:代码推送和分支管理 + - `git pull/fetch`:增量更新和远程同步 + - `git submodule`:子模块递归克隆 +- **协议优化**: + - 保持 Git 专用请求头和认证信息 + - 智能 User-Agent 处理(默认 `git/2.34.1`) + - 支持 Git LFS 大文件传输 -Using the pre-deployed instance **`xget.xi-xu.me`** or your own deployed instance, simply replace the domain and add the platform prefix: +### 📱 生态系统集成 -### Conversion Format +- **专用浏览器扩展**:[Xget Now](https://github.com/xixu-me/Xget-Now) 提供无缝体验 + - 自动 URL 重定向,无需手动修改 URL + - 支持自定义 Xget 实例域名 + - 多平台偏好设置和黑白名单管理 + - 本地处理,确保隐私安全 +- **下载工具兼容**:完美支持 wget、cURL、aria2、IDM 等主流下载工具 +- **CI/CD 集成**:可直接在 GitHub Actions、GitLab CI 等环境中使用 -| Platform | Platform Prefix | Original URL Format | Accelerated URL Format | -|----------|----------------|---------------------|------------------------| +## 📖 URL 转换规则 + +使用预部署实例 **`xget.xi-xu.me`** 或你自己部署的实例,只需简单替换域名并添加平台前缀: + +### 转换格式 + +| 平台 | 平台前缀 | 原始 URL 格式 | 加速 URL 格式 | +|------|----------|--------------|--------------| | GitHub | `gh` | `https://github.com/...` | `https://xget.xi-xu.me/gh/...` | | GitHub Gist | `gist` | `https://gist.github.com/...` | `https://xget.xi-xu.me/gist/...` | | GitLab | `gl` | `https://gitlab.com/...` | `https://xget.xi-xu.me/gl/...` | @@ -160,7 +169,7 @@ Using the pre-deployed instance **`xget.xi-xu.me`** or your own deployed instanc | Civitai | `civitai` | `https://civitai.com/...` | `https://xget.xi-xu.me/civitai/...` | | npm | `npm` | `https://registry.npmjs.org/...` | `https://xget.xi-xu.me/npm/...` | | PyPI | `pypi` | `https://pypi.org/...` | `https://xget.xi-xu.me/pypi/...` | -| conda | `conda` | `https://repo.anaconda.com/...` and `https://conda.anaconda.org/...` | `https://xget.xi-xu.me/conda/...` and `https://xget.xi-xu.me/conda/community/...` | +| conda | `conda` | `https://repo.anaconda.com/...` 和 `https://conda.anaconda.org/...` | `https://xget.xi-xu.me/conda/...` 和 `https://xget.xi-xu.me/conda/community/...` | | Maven | `maven` | `https://repo1.maven.org/...` | `https://xget.xi-xu.me/maven/...` | | Apache | `apache` | `https://downloads.apache.org/...` | `https://xget.xi-xu.me/apache/...` | | Gradle | `gradle` | `https://plugins.gradle.org/...` | `https://xget.xi-xu.me/gradle/...` | @@ -169,7 +178,7 @@ Using the pre-deployed instance **`xget.xi-xu.me`** or your own deployed instanc | CRAN | `cran` | `https://cran.r-project.org/...` | `https://xget.xi-xu.me/cran/...` | | CPAN | `cpan` | `https://www.cpan.org/...` | `https://xget.xi-xu.me/cpan/...` | | CTAN | `ctan` | `https://tug.ctan.org/...` | `https://xget.xi-xu.me/ctan/...` | -| Go Modules | `golang` | `https://proxy.golang.org/...` | `https://xget.xi-xu.me/golang/...` | +| Go 模块 | `golang` | `https://proxy.golang.org/...` | `https://xget.xi-xu.me/golang/...` | | NuGet | `nuget` | `https://api.nuget.org/...` | `https://xget.xi-xu.me/nuget/...` | | Rust Crates | `crates` | `https://crates.io/...` | `https://xget.xi-xu.me/crates/...` | | Packagist | `packagist` | `https://repo.packagist.org/...` | `https://xget.xi-xu.me/packagist/...` | @@ -181,530 +190,530 @@ Using the pre-deployed instance **`xget.xi-xu.me`** or your own deployed instanc | Arch Linux | `arch` | `https://geo.mirror.pkgbuild.com/...` | `https://xget.xi-xu.me/arch/...` | | arXiv | `arxiv` | `https://arxiv.org/...` | `https://xget.xi-xu.me/arxiv/...` | | F-Droid | `fdroid` | `https://f-droid.org/...` | `https://xget.xi-xu.me/fdroid/...` | -| Jenkins Plugins | `jenkins` | `https://updates.jenkins.io/...` | `https://xget.xi-xu.me/jenkins/...` | -| Container Registries | `cr` | See [Container Registries](#container-registries) | See [Container Registries](#container-registries) | -| AI Inference Providers | `ip` | See [AI Inference Providers](#ai-inference-providers) | See [AI Inference Providers](#ai-inference-providers) | +| Jenkins 插件 | `jenkins` | `https://updates.jenkins.io/...` | `https://xget.xi-xu.me/jenkins/...` | +| 容器注册表 | `cr` | 见[容器注册表](#容器注册表) | 见[容器注册表](#容器注册表) | +| AI 推理提供商 | `ip` | 见 [AI 推理提供商](#ai-推理提供商) | 见 [AI 推理提供商](#ai-推理提供商) | -### Platform Conversion Examples +### 各平台转换示例 #### GitHub ```url -# Original URL +# 原始 URL https://github.com/microsoft/vscode/archive/refs/heads/main.zip -# Converted (add gh prefix) +# 转换后(添加 gh 前缀) https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip ``` #### GitHub Gist ```url -# Original URL +# 原始 URL https://gist.github.com/xixu-me/e2ea9db6b1f143892495f796fef18631/raw/3b8807172ee492d0da3a7e370b0fb88fc97b53e6/Free-ChatGPT-Paid-Plan.md -# Converted (add gist prefix) +# 转换后(添加 gist 前缀) https://xget.xi-xu.me/gist/xixu-me/e2ea9db6b1f143892495f796fef18631/raw/3b8807172ee492d0da3a7e370b0fb88fc97b53e6/Free-ChatGPT-Paid-Plan.md ``` #### GitLab ```url -# Original URL +# 原始 URL https://gitlab.com/gitlab-org/gitlab/-/archive/master/gitlab-master.zip -# Converted (add gl prefix) +# 转换后(添加 gl 前缀) https://xget.xi-xu.me/gl/gitlab-org/gitlab/-/archive/master/gitlab-master.zip ``` #### Gitea ```url -# Original URL +# 原始 URL https://gitea.com/gitea/gitea/archive/master.zip -# Converted (add gitea prefix) +# 转换后(添加 gitea 前缀) https://xget.xi-xu.me/gitea/gitea/gitea/archive/master.zip ``` #### Codeberg ```url -# Original URL +# 原始 URL https://codeberg.org/forgejo/forgejo/archive/forgejo.zip -# Converted (add codeberg prefix) +# 转换后(添加 codeberg 前缀) https://xget.xi-xu.me/codeberg/forgejo/forgejo/archive/forgejo.zip ``` #### SourceForge ```url -# Original URL +# 原始 URL https://sourceforge.net/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download -# Converted (add sf prefix) +# 转换后(添加 sf 前缀) https://xget.xi-xu.me/sf/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download ``` -#### AOSP (Android Open Source Project) +#### AOSP (Android 开源项目) ```url -# AOSP project original URL +# AOSP 项目原始 URL https://android.googlesource.com/platform/frameworks/base -# Converted (add aosp prefix) +# 转换后(添加 aosp 前缀) https://xget.xi-xu.me/aosp/platform/frameworks/base -# AOSP device tree original URL +# AOSP 设备树原始 URL https://android.googlesource.com/device/google/pixel -# Converted (add aosp prefix) +# 转换后(添加 aosp 前缀) https://xget.xi-xu.me/aosp/device/google/pixel ``` #### Hugging Face ```url -# Model file original URL +# 模型文件原始 URL https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin -# Converted (add hf prefix) +# 转换后(添加 hf 前缀) https://xget.xi-xu.me/hf/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin -# Dataset file original URL +# 数据集文件原始 URL https://huggingface.co/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet -# Converted (add hf prefix) +# 转换后(添加 hf 前缀) https://xget.xi-xu.me/hf/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet ``` #### Civitai ```url -# AI model download original URL +# AI 模型下载原始 URL https://civitai.com/api/download/models/128713 -# Converted (add civitai prefix) +# 转换后(添加 civitai 前缀) https://xget.xi-xu.me/civitai/api/download/models/128713 -# Model API original URL +# 模型 API 原始 URL https://civitai.com/api/v1/models/7240 -# Converted (add civitai prefix) +# 转换后(添加 civitai 前缀) https://xget.xi-xu.me/civitai/api/v1/models/7240 -# Model version API original URL +# 模型版本 API 原始 URL https://civitai.com/api/v1/model-versions/128713 -# Converted (add civitai prefix) +# 转换后(添加 civitai 前缀) https://xget.xi-xu.me/civitai/api/v1/model-versions/128713 ``` #### npm ```url -# Package file original URL +# 包文件原始 URL https://registry.npmjs.org/react/-/react-18.2.0.tgz -# Converted (add npm prefix) +# 转换后(添加 npm 前缀) https://xget.xi-xu.me/npm/react/-/react-18.2.0.tgz -# Package metadata original URL +# 包元数据原始 URL https://registry.npmjs.org/lodash -# Converted (add npm prefix) +# 转换后(添加 npm 前缀) https://xget.xi-xu.me/npm/lodash ``` #### PyPI ```url -# Python package file original URL +# Python 包文件原始 URL https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz -# Converted (add pypi prefix) +# 转换后(添加 pypi 前缀) https://xget.xi-xu.me/pypi/packages/source/r/requests/requests-2.31.0.tar.gz -# Wheel file original URL +# Wheel 文件原始 URL https://pypi.org/packages/py3/r/requests/requests-2.31.0-py3-none-any.whl -# Converted (add pypi prefix) +# 转换后(添加 pypi 前缀) https://xget.xi-xu.me/pypi/packages/py3/r/requests/requests-2.31.0-py3-none-any.whl ``` #### conda ```url -# Default channel package file original URL +# 默认频道包文件原始 URL https://repo.anaconda.com/pkgs/main/linux-64/numpy-1.24.3-py311h08b1b3b_1.conda -# Converted (add conda prefix) +# 转换后(添加 conda 前缀) https://xget.xi-xu.me/conda/pkgs/main/linux-64/numpy-1.24.3-py311h08b1b3b_1.conda -# Community channel metadata original URL +# 社区频道元数据原始 URL https://conda.anaconda.org/conda-forge/linux-64/repodata.json -# Converted (add conda/community prefix) +# 转换后(添加 conda/community 前缀) https://xget.xi-xu.me/conda/community/conda-forge/linux-64/repodata.json ``` #### Maven ```url -# Maven Central Repository JAR file original URL +# Maven 中央存储库 JAR 文件原始 URL https://repo1.maven.org/maven2/org/springframework/spring-core/5.3.21/spring-core-5.3.21.jar -# Converted (add maven prefix) +# 转换后(添加 maven 前缀) https://xget.xi-xu.me/maven/maven2/org/springframework/spring-core/5.3.21/spring-core-5.3.21.jar -# Maven metadata original URL +# Maven 元数据原始 URL https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/maven-metadata.xml -# Converted (add maven prefix) +# 转换后(添加 maven 前缀) https://xget.xi-xu.me/maven/maven2/org/apache/commons/commons-lang3/maven-metadata.xml ``` -#### Apache Software Download +#### Apache 软件下载 ```url -# Apache software download original URL +# Apache 软件下载原始 URL https://downloads.apache.org/kafka/3.6.1/kafka_2.13-3.6.1.tgz -# Converted (add apache prefix) +# 转换后(添加 apache 前缀) https://xget.xi-xu.me/apache/kafka/3.6.1/kafka_2.13-3.6.1.tgz -# Apache Maven download original URL +# Apache Maven 下载原始 URL https://downloads.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz -# Converted (add apache prefix) +# 转换后(添加 apache 前缀) https://xget.xi-xu.me/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz -# Apache Spark download original URL +# Apache Spark 下载原始 URL https://downloads.apache.org/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz -# Converted (add apache prefix) +# 转换后(添加 apache 前缀) https://xget.xi-xu.me/apache/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz ``` #### Gradle ```url -# Gradle plugin portal JAR file original URL +# Gradle 插件门户 JAR 文件原始 URL https://plugins.gradle.org/m2/org/gradle/gradle-hello-world-plugin/0.2/gradle-hello-world-plugin-0.2.jar -# Converted (add gradle prefix) +# 转换后(添加 gradle 前缀) https://xget.xi-xu.me/gradle/m2/org/gradle/gradle-hello-world-plugin/0.2/gradle-hello-world-plugin-0.2.jar -# Gradle plugin metadata original URL +# Gradle 插件元数据原始 URL https://plugins.gradle.org/m2/com/github/ben-manes/gradle-versions-plugin/0.51.0/gradle-versions-plugin-0.51.0.module -# Converted (add gradle prefix) +# 转换后(添加 gradle 前缀) https://xget.xi-xu.me/gradle/m2/com/github/ben-manes/gradle-versions-plugin/0.51.0/gradle-versions-plugin-0.51.0.module ``` #### Homebrew ```url -# Homebrew formula repository original URL +# Homebrew 公式存储库原始 URL https://github.com/Homebrew/homebrew-core/raw/HEAD/Formula/g/git.rb -# Converted (add homebrew prefix) +# 转换后(添加 homebrew 前缀) https://xget.xi-xu.me/homebrew/homebrew-core/raw/HEAD/Formula/g/git.rb -# Homebrew API original URL +# Homebrew API 原始 URL https://formulae.brew.sh/api/formula/git.json -# Converted (add homebrew/api prefix) +# 转换后(添加 homebrew/api 前缀) https://xget.xi-xu.me/homebrew/api/formula/git.json -# Homebrew Bottles original URL +# Homebrew Bottles 原始 URL https://ghcr.io/v2/homebrew/core/git/manifests/2.39.0 -# Converted (add homebrew/bottles prefix) +# 转换后(添加 homebrew/bottles 前缀) https://xget.xi-xu.me/homebrew/bottles/v2/homebrew/core/git/manifests/2.39.0 ``` #### RubyGems ```url -# RubyGems package file original URL +# RubyGems 包文件原始 URL https://rubygems.org/gems/rails-7.0.4.gem -# Converted (add rubygems prefix) +# 转换后(添加 rubygems 前缀) https://xget.xi-xu.me/rubygems/gems/rails-7.0.4.gem -# RubyGems API original URL +# RubyGems API 原始 URL https://rubygems.org/api/v1/gems/nokogiri.json -# Converted (add rubygems prefix) +# 转换后(添加 rubygems 前缀) https://xget.xi-xu.me/rubygems/api/v1/gems/nokogiri.json ``` #### CRAN ```url -# CRAN package file original URL +# CRAN 包文件原始 URL https://cran.r-project.org/src/contrib/ggplot2_3.5.2.tar.gz -# Converted (add cran prefix) +# 转换后(添加 cran 前缀) https://xget.xi-xu.me/cran/src/contrib/ggplot2_3.5.2.tar.gz -# CRAN package metadata original URL +# CRAN 包元数据原始 URL https://cran.r-project.org/web/packages/dplyr/DESCRIPTION -# Converted (add cran prefix) +# 转换后(添加 cran 前缀) https://xget.xi-xu.me/cran/web/packages/dplyr/DESCRIPTION ``` -#### CPAN (Perl Package Management) +#### CPAN (Perl 包管理) ```url -# CPAN module original URL +# CPAN 模块原始 URL https://www.cpan.org/modules/by-module/DBI/DBI-1.643.tar.gz -# Converted (add cpan prefix) +# 转换后(添加 cpan 前缀) https://xget.xi-xu.me/cpan/modules/by-module/DBI/DBI-1.643.tar.gz -# CPAN author package original URL +# CPAN 作者包原始 URL https://www.cpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz -# Converted (add cpan prefix) +# 转换后(添加 cpan 前缀) https://xget.xi-xu.me/cpan/authors/id/T/TI/TIMB/DBI-1.643.tar.gz ``` -#### CTAN (TeX/LaTeX Package Management) +#### CTAN (TeX/LaTeX 包管理) ```url -# CTAN package file original URL +# CTAN 包文件原始 URL https://tug.ctan.org/tex-archive/macros/latex/contrib/beamer.zip -# Converted (add ctan prefix) +# 转换后(添加 ctan 前缀) https://xget.xi-xu.me/ctan/tex-archive/macros/latex/contrib/beamer.zip -# CTAN font file original URL +# CTAN 字体文件原始 URL https://tug.ctan.org/tex-archive/fonts/cm/pk/ljfour/public/cm/dpi600/cmr10.pk -# Converted (add ctan prefix) +# 转换后(添加 ctan 前缀) https://xget.xi-xu.me/ctan/tex-archive/fonts/cm/pk/ljfour/public/cm/dpi600/cmr10.pk ``` -#### Go Modules +#### Go 模块 ```url -# Go module proxy original URL +# Go 模块代理原始 URL https://proxy.golang.org/github.com/gin-gonic/gin/@v/v1.9.1.zip -# Converted (add golang prefix) +# 转换后(添加 golang 前缀) https://xget.xi-xu.me/golang/github.com/gin-gonic/gin/@v/v1.9.1.zip -# Go module info original URL +# Go 模块信息原始 URL https://proxy.golang.org/github.com/gorilla/mux/@v/list -# Converted (add golang prefix) +# 转换后(添加 golang 前缀) https://xget.xi-xu.me/golang/github.com/gorilla/mux/@v/list ``` #### NuGet ```url -# NuGet package download original URL +# NuGet 包下载原始 URL https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg -# Converted (add nuget prefix) +# 转换后(添加 nuget 前缀) https://xget.xi-xu.me/nuget/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg -# NuGet package metadata original URL +# NuGet 包元数据原始 URL https://api.nuget.org/v3/registration5-semver1/microsoft.aspnetcore.app/index.json -# Converted (add nuget prefix) +# 转换后(添加 nuget 前缀) https://xget.xi-xu.me/nuget/v3/registration5-semver1/microsoft.aspnetcore.app/index.json ``` #### Rust Crates ```url -# Crate download original URL +# Crate 下载原始 URL https://crates.io/api/v1/crates/serde/1.0.0/download -# Converted (add crates prefix) +# 转换后(添加 crates 前缀) https://xget.xi-xu.me/crates/serde/1.0.0/download -# Crate metadata original URL +# Crate 元数据原始 URL https://crates.io/api/v1/crates/serde -# Converted (add crates prefix) +# 转换后(添加 crates 前缀) https://xget.xi-xu.me/crates/serde -# Crate search original URL +# Crate 搜索原始 URL https://crates.io/api/v1/crates?q=serde -# Converted (add crates prefix) +# 转换后(添加 crates 前缀) https://xget.xi-xu.me/crates/?q=serde ``` #### Packagist ```url -# Packagist package metadata original URL +# Packagist 包元数据原始 URL https://repo.packagist.org/p2/symfony/console.json -# Converted (add packagist prefix) +# 转换后(添加 packagist 前缀) https://xget.xi-xu.me/packagist/p2/symfony/console.json -# Packagist package list original URL +# Packagist 包列表原始 URL https://repo.packagist.org/packages/list.json -# Converted (add packagist prefix) +# 转换后(添加 packagist 前缀) https://xget.xi-xu.me/packagist/packages/list.json ``` -#### Linux Distributions +#### Linux 发行版 ```url -# Debian package original URL +# Debian 包原始 URL https://deb.debian.org/debian/pool/main/c/curl/curl_7.88.1-10+deb12u4_amd64.deb -# Converted (add debian prefix) +# 转换后(添加 debian 前缀) https://xget.xi-xu.me/debian/debian/pool/main/c/curl/curl_7.88.1-10+deb12u4_amd64.deb -# Ubuntu package original URL +# Ubuntu 包原始 URL https://archive.ubuntu.com/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1.9_amd64.deb -# Converted (add ubuntu prefix) +# 转换后(添加 ubuntu 前缀) https://xget.xi-xu.me/ubuntu/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1.9_amd64.deb -# Fedora package original URL +# Fedora 包原始 URL https://dl.fedoraproject.org/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/n/nginx-1.24.0-1.fc39.x86_64.rpm -# Converted (add fedora prefix) +# 转换后(添加 fedora 前缀) https://xget.xi-xu.me/fedora/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/n/nginx-1.24.0-1.fc39.x86_64.rpm -# Rocky Linux package original URL +# Rocky Linux 包原始 URL https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/b/bash-5.1.8-6.el9.x86_64.rpm -# Converted (add rocky prefix) +# 转换后(添加 rocky 前缀) https://xget.xi-xu.me/rocky/pub/rocky/9/BaseOS/x86_64/os/Packages/b/bash-5.1.8-6.el9.x86_64.rpm -# openSUSE package original URL +# openSUSE 包原始 URL https://download.opensuse.org/distribution/leap/15.5/repo/oss/x86_64/vim-9.0.1572-150500.20.8.1.x86_64.rpm -# Converted (add opensuse prefix) +# 转换后(添加 opensuse 前缀) https://xget.xi-xu.me/opensuse/distribution/leap/15.5/repo/oss/x86_64/vim-9.0.1572-150500.20.8.1.x86_64.rpm -# Arch Linux package original URL +# Arch Linux 包原始 URL https://geo.mirror.pkgbuild.com/core/os/x86_64/linux-6.6.10.arch1-1-x86_64.pkg.tar.zst -# Converted (add arch prefix) +# 转换后(添加 arch 前缀) https://xget.xi-xu.me/arch/core/os/x86_64/linux-6.6.10.arch1-1-x86_64.pkg.tar.zst ``` #### arXiv ```url -# arXiv paper PDF original URL +# arXiv 论文 PDF 原始 URL https://arxiv.org/pdf/2301.07041.pdf -# Converted (add arxiv prefix) +# 转换后(添加 arxiv 前缀) https://xget.xi-xu.me/arxiv/pdf/2301.07041.pdf -# arXiv paper source original URL +# arXiv 论文源码原始 URL https://arxiv.org/e-print/2301.07041 -# Converted (add arxiv prefix) +# 转换后(添加 arxiv 前缀) https://xget.xi-xu.me/arxiv/e-print/2301.07041 ``` #### F-Droid ```url -# F-Droid app APK original URL +# F-Droid 应用 APK 原始 URL https://f-droid.org/repo/org.fdroid.fdroid_1016050.apk -# Converted (add fdroid prefix) +# 转换后(添加 fdroid 前缀) https://xget.xi-xu.me/fdroid/repo/org.fdroid.fdroid_1016050.apk -# F-Droid app metadata original URL +# F-Droid 应用元数据原始 URL https://f-droid.org/api/v1/packages/org.fdroid.fdroid -# Converted (add fdroid prefix) +# 转换后(添加 fdroid 前缀) https://xget.xi-xu.me/fdroid/api/v1/packages/org.fdroid.fdroid ``` -#### Jenkins Plugins +#### Jenkins 插件 ```url -# Jenkins update center original URL +# Jenkins 更新中心原始 URL https://updates.jenkins.io/update-center.json -# Converted (add jenkins prefix) +# 转换后(添加 jenkins 前缀) https://xget.xi-xu.me/jenkins/update-center.json -# Jenkins plugin download original URL +# Jenkins 插件下载原始 URL https://updates.jenkins.io/download/plugins/maven-plugin/3.27/maven-plugin.hpi -# Converted (add jenkins prefix) +# 转换后(添加 jenkins 前缀) https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi ``` -#### Container Registries +#### 容器注册表 -Xget supports multiple container registries, using the `cr/[Registry Prefix]` format: +Xget 支持多个容器注册表,使用 `cr/[容器注册表前缀]` 格式: -| Container Registry | Registry Prefix | Original URL Format | Accelerated URL Format | -|-------------------|----------------|---------------------|------------------------| +| 容器注册表 | 容器注册表前缀 | 原始 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/...` | -| 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/...` | -| Amazon Public ECR | `ecr` | `https://public.ecr.aws/...` | `https://xget.xi-xu.me/cr/ecr/...` | -| GitHub Container Registry | `ghcr` | `https://ghcr.io/...` | `https://xget.xi-xu.me/cr/ghcr/...` | -| GitLab Container Registry | `gitlab` | `https://registry.gitlab.com/...` | `https://xget.xi-xu.me/cr/gitlab/...` | -| Red Hat Registry | `redhat` | `https://registry.redhat.io/...` | `https://xget.xi-xu.me/cr/redhat/...` | -| Oracle Container Registry | `oracle` | `https://container-registry.oracle.com/...` | `https://xget.xi-xu.me/cr/oracle/...` | +| 谷歌容器注册表 | `gcr` | `https://gcr.io/...` | `https://xget.xi-xu.me/cr/gcr/...` | +| 微软容器注册表 | `mcr` | `https://mcr.microsoft.com/...` | `https://xget.xi-xu.me/cr/mcr/...` | +| 亚马逊公共弹性容器注册表 | `ecr` | `https://public.ecr.aws/...` | `https://xget.xi-xu.me/cr/ecr/...` | +| GitHub 容器注册表 | `ghcr` | `https://ghcr.io/...` | `https://xget.xi-xu.me/cr/ghcr/...` | +| GitLab 容器注册表 | `gitlab` | `https://registry.gitlab.com/...` | `https://xget.xi-xu.me/cr/gitlab/...` | +| 红帽注册表 | `redhat` | `https://registry.redhat.io/...` | `https://xget.xi-xu.me/cr/redhat/...` | +| 甲骨文容器注册表 | `oracle` | `https://container-registry.oracle.com/...` | `https://xget.xi-xu.me/cr/oracle/...` | | Cloudsmith | `cloudsmith` | `https://docker.cloudsmith.io/...` | `https://xget.xi-xu.me/cr/cloudsmith/...` | -| DigitalOcean Registry | `digitalocean` | `https://registry.digitalocean.com/...` | `https://xget.xi-xu.me/cr/digitalocean/...` | -| VMware Registry | `vmware` | `https://projects.registry.vmware.com/...` | `https://xget.xi-xu.me/cr/vmware/...` | -| Kubernetes Registry | `k8s` | `https://registry.k8s.io/...` | `https://xget.xi-xu.me/cr/k8s/...` | -| Heroku Registry | `heroku` | `https://registry.heroku.com/...` | `https://xget.xi-xu.me/cr/heroku/...` | -| SUSE Registry | `suse` | `https://registry.suse.com/...` | `https://xget.xi-xu.me/cr/suse/...` | -| openSUSE Registry | `opensuse` | `https://registry.opensuse.org/...` | `https://xget.xi-xu.me/cr/opensuse/...` | -| Gitpod Registry | `gitpod` | `https://registry.gitpod.io/...` | `https://xget.xi-xu.me/cr/gitpod/...` | +| DigitalOcean 注册表 | `digitalocean` | `https://registry.digitalocean.com/...` | `https://xget.xi-xu.me/cr/digitalocean/...` | +| VMware 注册表 | `vmware` | `https://projects.registry.vmware.com/...` | `https://xget.xi-xu.me/cr/vmware/...` | +| Kubernetes 注册表 | `k8s` | `https://registry.k8s.io/...` | `https://xget.xi-xu.me/cr/k8s/...` | +| Heroku 注册表 | `heroku` | `https://registry.heroku.com/...` | `https://xget.xi-xu.me/cr/heroku/...` | +| SUSE 注册表 | `suse` | `https://registry.suse.com/...` | `https://xget.xi-xu.me/cr/suse/...` | +| openSUSE 注册表 | `opensuse` | `https://registry.opensuse.org/...` | `https://xget.xi-xu.me/cr/opensuse/...` | +| Gitpod 注册表 | `gitpod` | `https://registry.gitpod.io/...` | `https://xget.xi-xu.me/cr/gitpod/...` | ```url -# Docker Hub original URL (official images) +# Docker Hub 原始 URL(官方镜像) https://registry-1.docker.io/v2/library/nginx/manifests/latest -# Converted (add cr/docker prefix) +# 转换后(添加 cr/docker 前缀) https://xget.xi-xu.me/cr/docker/v2/nginx/manifests/latest -# Docker Hub original URL (user images) +# Docker Hub 原始 URL(用户镜像) https://registry-1.docker.io/v2/nginxinc/nginx-unprivileged/manifests/latest -# Converted (add cr/docker prefix) +# 转换后(添加 cr/docker 前缀) https://xget.xi-xu.me/cr/docker/v2/nginxinc/nginx-unprivileged/manifests/latest -# GitHub Container Registry original URL +# GitHub 容器注册表原始 URL https://ghcr.io/v2/nginxinc/nginx-unprivileged/manifests/latest -# Converted (add cr/ghcr prefix) +# 转换后(添加 cr/ghcr 前缀) https://xget.xi-xu.me/cr/ghcr/v2/nginxinc/nginx-unprivileged/manifests/latest -# Google Container Registry original URL +# 谷歌容器注册表原始 URL https://gcr.io/v2/distroless/base/manifests/latest -# Converted (add cr/gcr prefix) +# 转换后(添加 cr/gcr 前缀) https://xget.xi-xu.me/cr/gcr/v2/distroless/base/manifests/latest ``` -For use cases, see [Container Image Acceleration](#container-image-acceleration). +应用场景见[容器镜像加速](#容器镜像加速)。 -#### AI Inference Providers +#### AI 推理提供商 -Xget supports API acceleration for many mainstream AI inference providers, using the `ip/[AI Provider Prefix]` format: +Xget 支持众多主流 AI 推理提供商的 API 加速,使用 `ip/[AI 推理提供商前缀]` 格式: -| AI Inference Provider | Provider Prefix | Original URL Format | Accelerated URL Format | -|----------------------|-----------------|---------------------|------------------------| +| AI 推理提供商 | AI 推理提供商前缀 | 原始 URL 格式 | 加速 URL 格式 | +|-------------|----------|-------------|-------------| | OpenAI | `openai` | `https://api.openai.com/...` | `https://xget.xi-xu.me/ip/openai/...` | | Anthropic | `anthropic` | `https://api.anthropic.com/...` | `https://xget.xi-xu.me/ip/anthropic/...` | | Gemini | `gemini` | `https://generativelanguage.googleapis.com/...` | `https://xget.xi-xu.me/ip/gemini/...` | @@ -712,7 +721,7 @@ Xget supports API acceleration for many mainstream AI inference providers, using | Cohere | `cohere` | `https://api.cohere.ai/...` | `https://xget.xi-xu.me/ip/cohere/...` | | Mistral AI | `mistralai` | `https://api.mistral.ai/...` | `https://xget.xi-xu.me/ip/mistralai/...` | | xAI | `xai` | `https://api.x.ai/...` | `https://xget.xi-xu.me/ip/xai/...` | -| GitHub Models | `githubmodels` | `https://models.github.ai/...` | `https://xget.xi-xu.me/ip/githubmodels/...` | +| GitHub 模型 | `githubmodels` | `https://models.github.ai/...` | `https://xget.xi-xu.me/ip/githubmodels/...` | | NVIDIA API | `nvidiaapi` | `https://integrate.api.nvidia.com/...` | `https://xget.xi-xu.me/ip/nvidiaapi/...` | | Perplexity | `perplexity` | `https://api.perplexity.ai/...` | `https://xget.xi-xu.me/ip/perplexity/...` | | Groq | `groq` | `https://api.groq.com/...` | `https://xget.xi-xu.me/ip/groq/...` | @@ -735,78 +744,78 @@ Xget supports API acceleration for many mainstream AI inference providers, using | Hyperbolic | `hyperbolic` | `https://api.hyperbolic.xyz/...` | `https://xget.xi-xu.me/ip/hyperbolic/...` | ```url -# OpenAI API original URL +# OpenAI API 原始 URL https://api.openai.com/v1/chat/completions -# Converted (add ip/openai prefix) +# 转换后(添加 ip/openai 前缀) https://xget.xi-xu.me/ip/openai/v1/chat/completions -# Claude API original URL +# Claude API 原始 URL https://api.anthropic.com/v1/messages -# Converted (add ip/anthropic prefix) +# 转换后(添加 ip/anthropic 前缀) https://xget.xi-xu.me/ip/anthropic/v1/messages -# Gemini API original URL +# Gemini API 原始 URL https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent -# Converted (add ip/gemini prefix) +# 转换后(添加 ip/gemini 前缀) https://xget.xi-xu.me/ip/gemini/v1beta/models/gemini-2.5-flash:generateContent -# HF Inference API original URL +# HF Inference API 原始 URL https://router.huggingface.co/hf-inference/models/openai/whisper-large-v3 -# Converted (add ip/huggingface prefix) +# 转换后(添加 ip/huggingface 前缀) https://xget.xi-xu.me/ip/huggingface/hf-inference/models/openai/whisper-large-v3 ``` -For use cases, see [AI Inference API Acceleration](#ai-inference-api-acceleration). +应用场景见 [AI 推理 API 加速](#ai-推理-api-加速)。 -## 🎯 Use Cases +## 🎯 应用场景 -### Git Operations and Configuration +### Git 操作与配置 -#### Git Operations +#### Git 操作 ```bash -# Clone repository +# 克隆存储库 git clone https://xget.xi-xu.me/gh/microsoft/vscode.git -# Clone specific branch +# 克隆指定分支 git clone -b main https://xget.xi-xu.me/gh/facebook/react.git -# Shallow clone (latest commit only) +# 浅克隆(仅最新提交) git clone --depth 1 https://xget.xi-xu.me/gh/torvalds/linux.git -# Clone GitLab repository +# 克隆 GitLab 存储库 git clone https://xget.xi-xu.me/gl/gitlab-org/gitlab.git -# Clone Gitea repository +# 克隆 Gitea 存储库 git clone https://xget.xi-xu.me/gitea/gitea/gitea.git -# Clone Codeberg repository +# 克隆 Codeberg 存储库 git clone https://xget.xi-xu.me/codeberg/forgejo/forgejo.git -# Clone SourceForge repository +# 克隆 SourceForge 存储库 git clone https://xget.xi-xu.me/sf/projects/mingw-w64/code.git -# Clone AOSP repository +# 克隆 AOSP 存储库 git clone https://xget.xi-xu.me/aosp/platform/frameworks/base.git -# Add remote repository -git remote add upstream https://xget.xi-xu.me/gh/[owner]/[repository].git +# 添加远程存储库 +git remote add upstream https://xget.xi-xu.me/gh/[所有者]/[存储库].git -# Pull updates +# 拉取更新 git pull https://xget.xi-xu.me/gh/microsoft/vscode.git main -# Recursive submodule clone -git clone --recursive https://xget.xi-xu.me/gh/[username]/[repository-with-submodules].git +# 子模块递归克隆 +git clone --recursive https://xget.xi-xu.me/gh/[用户名]/[带子模块的存储库].git ``` -#### Git Global Acceleration Configuration +#### Git 全局加速配置 ```bash -# Configure Git to use Xget for specific domains +# 为特定域名配置 Git 使用 Xget git config --global url."https://xget.xi-xu.me/gh/".insteadOf "https://github.com/" git config --global url."https://xget.xi-xu.me/gl/".insteadOf "https://gitlab.com/" git config --global url."https://xget.xi-xu.me/gitea/".insteadOf "https://gitea.com/" @@ -814,106 +823,106 @@ git config --global url."https://xget.xi-xu.me/codeberg/".insteadOf "https://cod git config --global url."https://xget.xi-xu.me/sf/".insteadOf "https://sourceforge.net/" git config --global url."https://xget.xi-xu.me/aosp/".insteadOf "https://android.googlesource.com/" -# Verify configuration +# 验证配置 git config --global --get-regexp url -# Now all git clone operations for relevant platforms will automatically use Xget -git clone https://github.com/microsoft/vscode.git # Automatically converted to Xget URL -git clone https://gitlab.com/gitlab-org/gitlab.git # Automatically converted to Xget URL -git clone https://codeberg.org/forgejo/forgejo.git # Automatically converted to Xget URL -git clone https://android.googlesource.com/platform/frameworks/base.git # Automatically converted to Xget URL +# 现在所有相关平台的 git clone 都会自动使用 Xget +git clone https://github.com/microsoft/vscode.git # 自动转换为 Xget URL +git clone https://gitlab.com/gitlab-org/gitlab.git # 自动转换为 Xget URL +git clone https://codeberg.org/forgejo/forgejo.git # 自动转换为 Xget URL +git clone https://android.googlesource.com/platform/frameworks/base.git # 自动转换为 Xget URL ``` -### Mainstream Download Tool Integration +### 主流下载工具集成 -#### wget Download +#### wget 下载 ```bash -# Download single file +# 下载单个文件 wget https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip -# Resume download +# 断点续传 wget -c https://xget.xi-xu.me/hf/microsoft/DialoGPT-large/resolve/main/pytorch_model.bin -# Batch download -wget -i urls.txt # urls.txt contains multiple Xget URLs +# 批量下载 +wget -i urls.txt # urls.txt 包含多个 Xget URL ``` -#### cURL Download +#### cURL 下载 ```bash -# Basic download +# 基本下载 curl -L -O https://xget.xi-xu.me/gh/golang/go/archive/refs/tags/go1.22.0.tar.gz -# Show progress bar +# 显示进度条 curl -L --progress-bar -o model.bin https://xget.xi-xu.me/hf/openai/whisper-large-v3/resolve/main/pytorch_model.bin -# Set user agent +# 设置用户代理 curl -L -H "User-Agent: MyApp/1.0" https://xget.xi-xu.me/gl/gitlab-org/gitlab-runner/-/archive/main/gitlab-runner-main.zip ``` -#### aria2 Multi-threaded Download +#### aria2 多线程下载 ```bash -# Multi-threaded download of large files +# 多线程下载大文件 aria2c -x 16 -s 16 https://xget.xi-xu.me/hf/microsoft/DialoGPT-large/resolve/main/pytorch_model.bin -# Resume download +# 断点续传 aria2c -c https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip -# Batch download configuration file -aria2c -i download-list.txt # File containing multiple Xget URLs +# 批量下载配置文件 +aria2c -i download-list.txt # 包含多个 Xget URL 的文件 ``` -### Hugging Face Mirror +### Hugging Face 镜像 ```python import os from transformers import AutoTokenizer, AutoModelForCausalLM -# Set environment variable to make transformers library automatically use Xget mirror +# 设置环境变量,让 transformers 库自动使用 Xget 镜像 os.environ['HF_ENDPOINT'] = 'https://xget.xi-xu.me/hf' -# Define model name +# 定义模型名称 model_name = 'microsoft/DialoGPT-medium' -print(f"Downloading model from mirror: {model_name}") +print(f"正在从镜像下载模型: {model_name}") -# Use AutoModelForCausalLM to load dialogue generation model -# Since we set the environment variable above, no additional parameters are needed here +# 使用 AutoModelForCausalLM 来加载对话生成模型 +# 由于上面设置了环境变量,这里无需添加任何额外参数 tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name) -print("Model and tokenizer loaded successfully!") +print("模型和分词器加载成功!") -# You can now use the tokenizer and model -# For example: +# 你现在可以使用 tokenizer 和 model 了 +# 例如: # new_user_input_ids = tokenizer.encode("Hello, how are you?", return_tensors='pt') # chat_history_ids = model.generate(new_user_input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id) # print(tokenizer.decode(chat_history_ids[:, new_user_input_ids.shape[-1]:][0], skip_special_tokens=True)) ``` -### Civitai AI Model Platform +### Civitai AI 模型平台 ```python import requests -# Set API base URL to use Xget +# 设置 API 基础 URL 使用 Xget base_url = "https://xget.xi-xu.me/civitai" -# Get model information +# 获取模型信息 def get_model_info(model_id): - """Get Civitai model information""" + """获取 Civitai 模型信息""" url = f"{base_url}/api/v1/models/{model_id}" response = requests.get(url) return response.json() -# Download model +# 下载模型 def download_model(model_version_id, output_path): - """Download Civitai model file""" + """下载 Civitai 模型文件""" download_url = f"{base_url}/api/download/models/{model_version_id}" - print(f"Downloading model version {model_version_id}...") + print(f"正在下载模型版本 {model_version_id}...") response = requests.get(download_url, stream=True) response.raise_for_status() @@ -922,68 +931,68 @@ def download_model(model_version_id, output_path): for chunk in response.iter_content(chunk_size=8192): f.write(chunk) - print(f"Model downloaded to: {output_path}") + print(f"模型已下载到: {output_path}") -# Usage example -model_id = 7240 # Example model ID +# 使用示例 +model_id = 7240 # 示例模型 ID model_info = get_model_info(model_id) -print(f"Model name: {model_info['name']}") +print(f"模型名称: {model_info['name']}") -# Download first model version +# 下载第一个模型版本 if model_info['modelVersions']: version_id = model_info['modelVersions'][0]['id'] download_model(version_id, f"model_{version_id}.safetensors") ``` -### npm Package Acceleration +### npm 包管理加速 -#### Configure npm to Use Xget Mirror +#### 配置 npm 使用 Xget 镜像 ```bash -# Temporarily use Xget mirror +# 临时使用 Xget 镜像 npm install --registry https://xget.xi-xu.me/npm/ -# Globally configure npm mirror +# 全局配置 npm 镜像 npm config set registry https://xget.xi-xu.me/npm/ -# Verify configuration +# 验证配置 npm config get registry ``` -#### Use in Project +#### 在项目中使用 ```bash -# Configure project-level mirror in .npmrc file +# 在 .npmrc 文件中配置项目级镜像 echo "registry=https://xget.xi-xu.me/npm/" > .npmrc -# Install dependencies +# 安装依赖 npm install -# Or use yarn +# 或者使用 yarn yarn config set registry https://xget.xi-xu.me/npm/ yarn install ``` -### Python Package Acceleration +### Python 包管理加速 -#### Configure pip to Use Xget Mirror +#### 配置 pip 使用 Xget 镜像 ```bash -# Temporarily use Xget mirror +# 临时使用 Xget 镜像 pip install requests -i https://xget.xi-xu.me/pypi/simple/ -# Globally configure pip mirror +# 全局配置 pip 镜像 pip config set global.index-url https://xget.xi-xu.me/pypi/simple/ pip config set global.trusted-host xget.xi-xu.me -# Verify configuration +# 验证配置 pip config list ``` -#### Use in Project +#### 在项目中使用 ```bash -# Create pip.conf file (Linux/macOS) +# 创建 pip.conf 文件(Linux/macOS) mkdir -p ~/.pip cat > ~/.pip/pip.conf << EOF [global] @@ -991,18 +1000,18 @@ index-url = https://xget.xi-xu.me/pypi/simple/ trusted-host = xget.xi-xu.me EOF -# Or create pip.conf in project root directory +# 或在项目根目录创建 pip.conf cat > pip.conf << EOF [global] index-url = https://xget.xi-xu.me/pypi/simple/ trusted-host = xget.xi-xu.me EOF -# Install using configuration file +# 使用配置文件安装 pip install -r requirements.txt --config-file pip.conf ``` -#### Specify Mirror in requirements.txt +#### 在 requirements.txt 中指定镜像 ```txt # requirements.txt @@ -1015,33 +1024,33 @@ pandas>=1.3.0 matplotlib>=3.4.0 ``` -### conda Package Acceleration +### conda 包管理加速 -#### Configure conda to Use Xget Mirror +#### 配置 conda 使用 Xget 镜像 ```bash -# Configure default channel mirrors +# 配置默认频道镜像 conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/msys2 conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/r conda config --add default_channels https://xget.xi-xu.me/conda/pkgs/main -# Configure all community channel mirrors (recommended) +# 配置所有社区频道镜像(推荐) conda config --set channel_alias https://xget.xi-xu.me/conda/community -# Or configure specific community channels +# 或配置特定社区频道 conda config --add channels https://xget.xi-xu.me/conda/community/conda-forge conda config --add channels https://xget.xi-xu.me/conda/community/bioconda -# Set channel priority +# 设置频道优先级 conda config --set channel_priority strict -# Verify configuration +# 验证配置 conda config --show ``` -#### Configure in .condarc +#### 在 .condarc 中配置 -The .condarc file can be placed in the user home directory (`~/.condarc`) or project root directory: +.condarc 文件可以放在用户主目录(`~/.condarc`)或项目根目录下: ```yaml default_channels: @@ -1053,9 +1062,9 @@ channel_priority: strict show_channel_urls: true ``` -#### Use Environment File +#### 使用环境文件 -The environment file can directly specify complete mirror URLs: +环境文件中可以直接指定完整的镜像 URL: ```yaml # environment.yml @@ -1077,19 +1086,19 @@ dependencies: ``` ```bash -# Create environment using environment file +# 使用环境文件创建环境 conda env create -f environment.yml -# Update environment +# 更新环境 conda env update -f environment.yml ``` -### Maven Package Acceleration +### Maven 包管理加速 -#### Configure Maven to Use Xget Mirror +#### 配置 Maven 使用 Xget 镜像 ```xml - + @@ -1102,10 +1111,10 @@ conda env update -f environment.yml ``` -#### Use in Project +#### 在项目中使用 ```xml - + @@ -1126,58 +1135,58 @@ conda env update -f environment.yml ``` ```bash -# Specify mirror using command line +# 使用命令行指定镜像 mvn clean install -Dmaven.repo.remote=https://xget.xi-xu.me/maven/maven2 -# Download specific dependency +# 下载特定依赖 mvn dependency:get -Dartifact=org.springframework:spring-core:5.3.21 \ -DremoteRepositories=https://xget.xi-xu.me/maven/maven2 ``` -### Apache Software Download Acceleration +### Apache 软件下载加速 -#### Download Apache Software Using Xget +#### 使用 Xget 下载 Apache 软件 ```bash -# Download Apache Kafka +# 下载 Apache Kafka wget https://xget.xi-xu.me/apache/kafka/3.6.1/kafka_2.13-3.6.1.tgz -# Download Apache Maven +# 下载 Apache Maven curl -L -O https://xget.xi-xu.me/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz -# Download Apache Spark +# 下载 Apache Spark aria2c https://xget.xi-xu.me/apache/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz -# Download Apache Hadoop +# 下载 Apache Hadoop wget https://xget.xi-xu.me/apache/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz -# Download Apache Flink +# 下载 Apache Flink curl -L -O https://xget.xi-xu.me/apache/flink/flink-1.18.1/flink-1.18.1-bin-scala_2.12.tgz ``` -#### Common Apache Software Downloads +#### 常用 Apache 软件下载 ```bash -# Big data related +# 大数据相关 wget https://xget.xi-xu.me/apache/hive/hive-3.1.3/apache-hive-3.1.3-bin.tar.gz wget https://xget.xi-xu.me/apache/hbase/2.5.7/hbase-2.5.7-bin.tar.gz wget https://xget.xi-xu.me/apache/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz -# Web servers +# Web 服务器 wget https://xget.xi-xu.me/apache/httpd/httpd-2.4.59.tar.gz wget https://xget.xi-xu.me/apache/tomcat/tomcat-10/v10.1.19/bin/apache-tomcat-10.1.19.tar.gz -# Development tools +# 开发工具 wget https://xget.xi-xu.me/apache/ant/1.10.14/apache-ant-1.10.14-bin.tar.gz wget https://xget.xi-xu.me/apache/netbeans/netbeans/20/netbeans-20-bin.zip ``` -### Gradle Package Acceleration +### Gradle 包管理加速 -#### Configure Gradle to Use Xget Mirror +#### 配置 Gradle 使用 Xget 镜像 ```gradle -// Configure Gradle mirror in build.gradle +// 在 build.gradle 中配置 Gradle 镜像 repositories { maven { url 'https://xget.xi-xu.me/maven/maven2' @@ -1187,7 +1196,7 @@ repositories { } } -// Configure plugin repositories +// 配置插件存储库 pluginManagement { repositories { maven { @@ -1198,10 +1207,10 @@ pluginManagement { } ``` -#### Global Configuration +#### 全局配置 ```gradle -// Configure global mirror in ~/.gradle/init.gradle +// 在 ~/.gradle/init.gradle 中配置全局镜像 allprojects { repositories { maven { @@ -1223,91 +1232,91 @@ settingsEvaluated { settings -> ``` ```bash -# Specify mirror using command line +# 使用命令行指定镜像 gradle build -Dmaven.repo.remote=https://xget.xi-xu.me/maven/maven2 -# Refresh dependencies +# 刷新依赖 gradle build --refresh-dependencies ``` -### Homebrew Package Acceleration +### Homebrew 包管理加速 -#### Configure Homebrew to Use Xget Mirror +#### 配置 Homebrew 使用 Xget 镜像 ```bash -# Set Homebrew environment variables to use Xget mirror +# 设置 Homebrew 环境变量使用 Xget 镜像 export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git" export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git" export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api" export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles" -# Update Homebrew +# 更新 Homebrew brew update ``` -#### Long-term Configuration +#### 长期配置 ```bash -# For bash users, add to ~/.bash_profile +# 为 bash 用户添加到 ~/.bash_profile echo 'export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git"' >> ~/.bash_profile echo 'export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git"' >> ~/.bash_profile echo 'export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api"' >> ~/.bash_profile echo 'export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles"' >> ~/.bash_profile -# For zsh users, add to ~/.zprofile +# 为 zsh 用户添加到 ~/.zprofile echo 'export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git"' >> ~/.zprofile echo 'export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git"' >> ~/.zprofile echo 'export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api"' >> ~/.zprofile echo 'export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles"' >> ~/.zprofile ``` -#### Use in Project +#### 在项目中使用 ```bash -# Install packages +# 安装软件包 brew install git -# Search packages +# 搜索软件包 brew search python -# Update packages +# 更新软件包 brew upgrade -# View installed packages +# 查看已安装软件包 brew list ``` -#### Verify Mirror Configuration +#### 验证镜像配置 ```bash -# Check Homebrew configuration +# 检查 Homebrew 配置 brew config -# View environment variables +# 查看环境变量 echo $HOMEBREW_API_DOMAIN echo $HOMEBREW_BOTTLE_DOMAIN ``` -### Ruby Package Acceleration +### Ruby 包管理加速 -#### Configure RubyGems to Use Xget Mirror +#### 配置 RubyGems 使用 Xget 镜像 ```bash -# Temporarily use Xget mirror +# 临时使用 Xget 镜像 gem install rails --source https://xget.xi-xu.me/rubygems/ -# Globally configure RubyGems mirror +# 全局配置 RubyGems 镜像 gem sources --add https://xget.xi-xu.me/rubygems/ gem sources --remove https://rubygems.org/ -# Verify configuration +# 验证配置 gem sources -l ``` -#### Use in Project +#### 在项目中使用 ```ruby -# Configure project-level mirror in Gemfile +# 在 Gemfile 中配置项目级镜像 source 'https://xget.xi-xu.me/rubygems/' gem 'rails', '~> 7.0.0' @@ -1316,30 +1325,30 @@ gem 'puma', '~> 5.0' ``` ```bash -# Install using bundle +# 使用 bundle 安装 bundle config mirror.https://rubygems.org https://xget.xi-xu.me/rubygems/ bundle install ``` -### R Package Acceleration +### R 包管理加速 -#### Configure R to Use Xget CRAN Mirror +#### 配置 R 使用 Xget CRAN 镜像 ```r -# Temporarily use Xget CRAN mirror in R +# 在 R 中临时使用 Xget CRAN 镜像 install.packages("ggplot2", repos = "https://xget.xi-xu.me/cran/") -# Globally configure CRAN mirror +# 全局配置 CRAN 镜像 options(repos = c(CRAN = "https://xget.xi-xu.me/cran/")) -# Verify configuration +# 验证配置 getOption("repos") ``` -#### Configure in .Rprofile +#### 在 .Rprofile 中配置 ```r -# Configure global mirror in .Rprofile file in user home directory +# 在用户主目录的 .Rprofile 文件中配置全局镜像 options(repos = c( CRAN = "https://xget.xi-xu.me/cran/", BioCsoft = "https://bioconductor.org/packages/release/bioc", @@ -1347,29 +1356,29 @@ options(repos = c( BioCexp = "https://bioconductor.org/packages/release/data/experiment" )) -# Set download method +# 设置下载方法 options(download.file.method = "libcurl") ``` -#### Use in Project +#### 在项目中使用 ```r -# Specify mirror in project's renv.lock or script +# 在项目的 renv.lock 或脚本中指定镜像 renv::init() renv::settings$repos.override(c(CRAN = "https://xget.xi-xu.me/cran/")) -# Install packages +# 安装包 install.packages(c("dplyr", "ggplot2", "tidyr")) -# Or use pak package manager +# 或使用 pak 包管理器 pak::pkg_install("tidyverse", repos = "https://xget.xi-xu.me/cran/") ``` ```bash -# Install packages using R script in command line +# 在命令行中使用 R 脚本安装包 Rscript -e "options(repos = c(CRAN = 'https://xget.xi-xu.me/cran/')); install.packages('ggplot2')" -# Batch install packages +# 批量安装包 Rscript -e " options(repos = c(CRAN = 'https://xget.xi-xu.me/cran/')) packages <- c('dplyr', 'ggplot2', 'tidyr', 'readr') @@ -1377,134 +1386,134 @@ install.packages(packages) " ``` -### Perl Package Acceleration +### Perl 包管理加速 -#### Configure CPAN to Use Xget Mirror +#### 配置 CPAN 使用 Xget 镜像 ```bash -# Configure CPAN to use Xget mirror +# 配置 CPAN 使用 Xget 镜像 cpan o conf urllist push https://xget.xi-xu.me/cpan/ cpan o conf commit -# Or directly edit configuration file ~/.cpan/CPAN/MyConfig.pm -# Add: +# 或者直接编辑配置文件 ~/.cpan/CPAN/MyConfig.pm +# 添加: # 'urllist' => [q[https://xget.xi-xu.me/cpan/]], ``` -#### Use cpanm to Install Modules +#### 使用 cpanm 安装模块 ```bash -# Install cpanm (if not available) +# 安装 cpanm(如果没有) curl -L https://cpanmin.us | perl - --sudo App::cpanminus -# Install modules using Xget mirror +# 使用 Xget 镜像安装模块 cpanm --mirror https://xget.xi-xu.me/cpan/ DBI cpanm --mirror https://xget.xi-xu.me/cpan/ Mojolicious -# Install dependencies from Makefile.PL +# 从 Makefile.PL 安装依赖 cpanm --mirror https://xget.xi-xu.me/cpan/ --installdeps . ``` -#### Use in Project +#### 在项目中使用 ```perl -# List dependencies in cpanfile +# 在 cpanfile 中列出依赖 requires 'DBI'; requires 'Mojolicious'; requires 'JSON'; -# Then install using Xget mirror +# 然后使用 Xget 镜像安装 cpanm --mirror https://xget.xi-xu.me/cpan/ --installdeps . ``` -### TeX/LaTeX Package Acceleration +### TeX/LaTeX 包管理加速 -#### Configure TeX Live to Use Xget CTAN Mirror +#### 配置 TeX Live 使用 Xget CTAN 镜像 ```bash -# Configure tlmgr to use Xget CTAN mirror +# 配置 tlmgr 使用 Xget CTAN 镜像 tlmgr option repository https://xget.xi-xu.me/ctan/systems/texlive/tlnet -# Update package database +# 更新包数据库 tlmgr update --self --all -# Install packages +# 安装包 tlmgr install beamer tlmgr install tikz ``` -#### Configure MiKTeX to Use Xget Mirror +#### 配置 MiKTeX 使用 Xget 镜像 ```bash -# Windows MiKTeX configuration +# Windows MiKTeX 配置 mpm --set-repository=https://xget.xi-xu.me/ctan/systems/win32/miktex -# Update package database +# 更新包数据库 mpm --update-db -# Install packages +# 安装包 mpm --install=beamer mpm --install=pgf ``` -#### Use in Project +#### 在项目中使用 ```bash -# Automatically install missing packages during LaTeX document compilation +# LaTeX 文档编译时自动安装缺失包 pdflatex --shell-escape document.tex -# Or manually install specific packages +# 或手动安装特定包 tlmgr install caption tlmgr install subcaption tlmgr install algorithm2e ``` -### Go Module Acceleration +### Go 模块加速 -#### Configure Go to Use Xget Proxy +#### 配置 Go 使用 Xget 代理 ```bash -# Configure Go module proxy +# 配置 Go 模块代理 export GOPROXY=https://xget.xi-xu.me/golang,direct export GOSUMDB=off -# Or permanently configure +# 或者永久配置 go env -w GOPROXY=https://xget.xi-xu.me/golang,direct go env -w GOSUMDB=off -# Verify configuration +# 验证配置 go env GOPROXY ``` -#### Use in Project +#### 在项目中使用 ```bash -# Download dependencies +# 下载依赖 go mod download -# Update dependencies +# 更新依赖 go get -u ./... -# Clean module cache +# 清理模块缓存 go clean -modcache ``` -### NuGet Package Acceleration +### NuGet 包管理加速 -#### Configure NuGet to Use Xget Mirror +#### 配置 NuGet 使用 Xget 镜像 ```bash -# Add Xget package source +# 添加 Xget 包源 dotnet nuget add source https://xget.xi-xu.me/nuget/v3/index.json -n xget -# List package sources +# 列出包源 dotnet nuget list source -# Use in project +# 在项目中使用 dotnet restore --source https://xget.xi-xu.me/nuget/v3/index.json ``` -#### Configure in NuGet.Config +#### 在 NuGet.Config 中配置 ```xml @@ -1516,12 +1525,12 @@ dotnet restore --source https://xget.xi-xu.me/nuget/v3/index.json ``` -### Rust Package Acceleration +### Rust 包管理加速 -#### Configure Cargo to Use Xget Mirror +#### 配置 Cargo 使用 Xget 镜像 ```bash -# Configure Cargo to use Xget mirror (in ~/.cargo/config.toml) +# 配置 Cargo 使用 Xget 镜像(在 ~/.cargo/config.toml 中) mkdir -p ~/.cargo cat >> ~/.cargo/config.toml << EOF [source.crates-io] @@ -1531,14 +1540,14 @@ replace-with = "xget" registry = "https://xget.xi-xu.me/crates/" EOF -# Verify configuration +# 验证配置 cargo search serde ``` -#### Use in Project +#### 在项目中使用 ```toml -# Can use dependencies normally in Cargo.toml +# 在 Cargo.toml 中可以正常使用依赖 [dependencies] serde = "1.0" tokio = "1.0" @@ -1546,32 +1555,32 @@ reqwest = "0.11" ``` ```bash -# Xget will be automatically used when building the project +# 构建项目时会自动使用 Xget cargo build -# Update dependencies +# 更新依赖 cargo update -# Add new dependency +# 添加新依赖 cargo add clap ``` -### PHP Package Acceleration +### PHP 包管理加速 -#### Configure Composer to Use Xget Mirror +#### 配置 Composer 使用 Xget 镜像 ```bash -# Globally configure Composer mirror +# 全局配置 Composer 镜像 composer config -g repo.packagist composer https://xget.xi-xu.me/packagist/ -# Project-level configuration +# 项目级配置 composer config repo.packagist composer https://xget.xi-xu.me/packagist/ -# Verify configuration +# 验证配置 composer config -l ``` -#### Configure in composer.json +#### 在 composer.json 中配置 ```json { @@ -1588,100 +1597,100 @@ composer config -l } ``` -### Linux Distribution Acceleration +### Linux 发行版加速 -#### Debian/Ubuntu APT Configuration +#### Debian/Ubuntu APT 配置 ```bash -# Backup original source list +# 备份原始源列表 sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup -# Configure Debian mirror +# 配置 Debian 镜像 echo "deb https://xget.xi-xu.me/debian/debian bookworm main" | sudo tee /etc/apt/sources.list echo "deb https://xget.xi-xu.me/debian/debian-security bookworm-security main" | sudo tee -a /etc/apt/sources.list -# Configure Ubuntu mirror +# 配置 Ubuntu 镜像 echo "deb https://xget.xi-xu.me/ubuntu/ubuntu jammy main restricted universe multiverse" | sudo tee /etc/apt/sources.list echo "deb https://xget.xi-xu.me/ubuntu/ubuntu jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list -# Update package list +# 更新包列表 sudo apt update ``` -#### Fedora DNF Configuration +#### Fedora DNF 配置 ```bash -# Configure Fedora mirror +# 配置 Fedora 镜像 sudo sed -i 's|^metalink=|#metalink=|g' /etc/yum.repos.d/fedora*.repo sudo sed -i 's|^#baseurl=http://download.example/pub/fedora/linux|baseurl=https://xget.xi-xu.me/fedora/pub/fedora/linux|g' /etc/yum.repos.d/fedora*.repo -# Update package cache +# 更新包缓存 sudo dnf makecache ``` -#### Rocky Linux DNF Configuration +#### Rocky Linux DNF 配置 ```bash -# Configure Rocky Linux mirror +# 配置 Rocky Linux 镜像 sudo sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/rocky*.repo sudo sed -i 's|^#baseurl=http://dl.rockylinux.org|baseurl=https://xget.xi-xu.me/rocky|g' /etc/yum.repos.d/rocky*.repo -# Update package cache +# 更新包缓存 sudo dnf makecache ``` -#### openSUSE Zypper Configuration +#### openSUSE Zypper 配置 ```bash -# Configure openSUSE Leap mirror +# 配置 openSUSE Leap 镜像 sudo zypper mr -d repo-oss sudo zypper ar -f https://xget.xi-xu.me/opensuse/distribution/leap/15.5/repo/oss/ repo-oss-xget -# Configure openSUSE Tumbleweed mirror +# 配置 openSUSE Tumbleweed 镜像 sudo zypper mr -d repo-oss sudo zypper ar -f https://xget.xi-xu.me/opensuse/tumbleweed/repo/oss/ repo-oss-xget -# Refresh software sources +# 刷新软件源 sudo zypper refresh -# Verify configuration +# 验证配置 sudo zypper lr -u ``` -#### Arch Linux Pacman Configuration +#### Arch Linux Pacman 配置 ```bash -# Backup original mirror list +# 备份原始镜像列表 sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup -# Configure Arch Linux mirror +# 配置 Arch Linux 镜像 echo 'Server = https://xget.xi-xu.me/arch/$repo/os/$arch' | sudo tee /etc/pacman.d/mirrorlist -# Update package database +# 更新包数据库 sudo pacman -Sy ``` -### Academic Resource Acceleration +### 学术资源加速 -#### arXiv Paper Download +#### arXiv 论文下载 ```bash -# Download arXiv paper PDF +# 下载 arXiv 论文 PDF wget https://xget.xi-xu.me/arxiv/pdf/2301.07041.pdf -# Download paper source +# 下载论文源码 curl -L -O https://xget.xi-xu.me/arxiv/e-print/2301.07041 -# Batch download multiple papers +# 批量下载多篇论文 for id in 2301.07041 2302.13971 2303.08774; do wget https://xget.xi-xu.me/arxiv/pdf/${id}.pdf done ``` -#### Use in Academic Tools +#### 在学术工具中使用 ```python -# Use arXiv accelerated download in Python +# 在 Python 中使用 arXiv 加速下载 import requests def download_arxiv_paper(arxiv_id, output_path): @@ -1695,55 +1704,55 @@ def download_arxiv_paper(arxiv_id, output_path): else: print(f"Failed to download {arxiv_id}") -# Download paper +# 下载论文 download_arxiv_paper("2301.07041", "attention_is_all_you_need.pdf") ``` -### F-Droid Repository Mirror +### F-Droid 存储库镜像 -#### Configure F-Droid Client to Use Xget Mirror +#### 配置 F-Droid 客户端使用 Xget 镜像 -1. In F-Droid app, go to **Settings** → **Repositories** -2. Click **+** and enter repository URL: `https://xget.xi-xu.me/fdroid/repo` -3. Click **Add** then click **Add Mirror** +1. 在 F-Droid 应用中进入**设置** → **存储库** +2. 点击 **+** 后输入存储库 URL:`https://xget.xi-xu.me/fdroid/repo` +3. 点击**添加**后再点击**添加镜像** -#### Supported F-Droid Services +#### 支持的 F-Droid 服务 ```url -# F-Droid app APK download -https://xget.xi-xu.me/fdroid/repo/[package-name]_[version-code].apk +# F-Droid 应用 APK 下载 +https://xget.xi-xu.me/fdroid/repo/[包名]_[版本号].apk -# F-Droid repository index +# F-Droid 存储库索引 https://xget.xi-xu.me/fdroid/repo/index-v1.jar -# F-Droid app icons -https://xget.xi-xu.me/fdroid/repo/icons-640/[package-name].[version-code].png +# F-Droid 应用图标 +https://xget.xi-xu.me/fdroid/repo/icons-640/[包名].[版本号].png -# F-Droid API endpoints -https://xget.xi-xu.me/fdroid/api/v1/packages/[package-name] +# F-Droid API 接口 +https://xget.xi-xu.me/fdroid/api/v1/packages/[包名] ``` -#### Usage Examples +#### 使用示例 ```bash -# Directly download F-Droid client APK +# 直接下载 F-Droid 客户端 APK wget https://xget.xi-xu.me/fdroid/repo/org.fdroid.fdroid_1016050.apk -# Download other open source apps +# 下载其他开源应用 curl -L -O https://xget.xi-xu.me/fdroid/repo/org.mozilla.fennec_fdroid_1014000.apk -# Get app information +# 获取应用信息 curl https://xget.xi-xu.me/fdroid/api/v1/packages/org.fdroid.fdroid ``` -#### Batch App Management +#### 批量应用管理 ```bash -# Create app download script +# 创建应用下载脚本 cat > download_fdroid_apps.sh << 'EOF' #!/bin/bash -# Define list of apps to download +# 定义要下载的应用列表 apps=( "org.fdroid.fdroid_1016050.apk" "org.mozilla.fennec_fdroid_1014000.apk" @@ -1751,28 +1760,28 @@ apps=( "org.videolan.vlc_13050399.apk" ) -# Create download directory +# 创建下载目录 mkdir -p fdroid_apps -# Batch download apps +# 批量下载应用 for app in "${apps[@]}"; do - echo "Downloading: $app" + echo "正在下载: $app" wget -P fdroid_apps "https://xget.xi-xu.me/fdroid/repo/$app" done -echo "All apps downloaded!" +echo "所有应用下载完成!" EOF chmod +x download_fdroid_apps.sh ./download_fdroid_apps.sh ``` -#### Developer Integration +#### 开发者集成 -For Android developers, F-Droid mirror can be integrated into build scripts: +对于 Android 开发者,可以在构建脚本中集成 F-Droid 镜像: ```gradle -// Configure F-Droid dependency check in build.gradle +// 在 build.gradle 中配置 F-Droid 依赖检查 task checkFDroidAvailability { doLast { def fdroidUrl = "https://xget.xi-xu.me/fdroid/api/v1/packages/${project.name}" @@ -1781,77 +1790,78 @@ task checkFDroidAvailability { connection.requestMethod = 'GET' def responseCode = connection.responseCode if (responseCode == 200) { - println "App available on F-Droid: $fdroidUrl" + println "应用在 F-Droid 上可用: $fdroidUrl" } } catch (Exception e) { - println "Error checking F-Droid availability: ${e.message}" + println "检查 F-Droid 可用性时出错: ${e.message}" } } } ``` -### Jenkins Plugin Download +### Jenkins 插件下载 -#### Use Xget to Accelerate Jenkins Plugin Download and Update +#### 使用 Xget 加速 Jenkins 插件下载和更新 -Supports Jenkins update center and plugin downloads, compatible with configuration methods of domestic mirrors like Tsinghua mirror. +支持 Jenkins 更新中心和插件下载,兼容清华镜像等国内镜像源的配置方式。 -#### Jenkins Update Center Configuration +#### Jenkins 更新中心配置 -##### Method 1: Configure in Jenkins Web Interface +##### 方法一:在 Jenkins Web 界面配置 -1. Log in to Jenkins management interface -2. Go to **Manage Jenkins** → **Plugins** → **Advanced** -3. In the **Update Site** section, change the URL to `https://xget.xi-xu.me/jenkins/update-center.json` -4. Click **Submit** to save configuration +1. 登录 Jenkins 管理界面 +2. 进入 **Manage Jenkins** → **Plugins** → **Advanced** +3. 在 **Update Site** 部分,将 URL 更改为 `https://xget.xi-xu.me/jenkins/update-center.json` -##### Method 2: Modify Configuration File +4. 点击 **Submit** 保存配置 + +##### 方法二:修改配置文件 ```bash -# Modify update center configuration file on Jenkins server -# Default location: $JENKINS_HOME/hudson.model.UpdateCenter.xml +# 在 Jenkins 服务器上修改更新中心配置文件 +# 默认位置:$JENKINS_HOME/hudson.model.UpdateCenter.xml sudo nano /var/lib/jenkins/hudson.model.UpdateCenter.xml -# Change URL to: +# 将 URL 改为: # https://xget.xi-xu.me/jenkins/update-center.json -# Restart Jenkins service +# 重启 Jenkins 服务 sudo systemctl restart jenkins ``` -#### Supported Jenkins Services +#### 支持的 Jenkins 服务 ```url -# Jenkins update center JSON +# Jenkins 更新中心 JSON https://xget.xi-xu.me/jenkins/update-center.json -# Jenkins update center (actual JSON format) +# Jenkins 更新中心(实际 JSON 格式) https://xget.xi-xu.me/jenkins/update-center.actual.json -# Jenkins plugin download -https://xget.xi-xu.me/jenkins/download/plugins/[plugin-name]/[version]/[plugin-name].hpi +# Jenkins 插件下载 +https://xget.xi-xu.me/jenkins/download/plugins/[插件名]/[版本]/[插件名].hpi -# Experimental plugin update center +# 实验性插件更新中心 https://xget.xi-xu.me/jenkins/experimental/update-center.json ``` -#### Usage Examples +#### 使用示例 ```bash -# Download Maven plugin +# 下载 Maven 插件 wget https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi -# Download Git plugin +# 下载 Git 插件 curl -L -O https://xget.xi-xu.me/jenkins/download/plugins/git/5.2.1/git.hpi -# Get update center information +# 获取更新中心信息 curl https://xget.xi-xu.me/jenkins/update-center.json -# Batch download common plugins +# 批量下载常用插件 cat > download_jenkins_plugins.sh << 'EOF' #!/bin/bash -# Define list of plugins to download +# 定义要下载的插件列表 plugins=( "git:5.2.1" "maven-plugin:3.27" @@ -1860,44 +1870,44 @@ plugins=( "docker-workflow:563.vd5d2e5c4007f" ) -# Create plugin download directory +# 创建插件下载目录 mkdir -p jenkins_plugins -# Batch download plugins +# 批量下载插件 for plugin in "${plugins[@]}"; do name=$(echo $plugin | cut -d: -f1) version=$(echo $plugin | cut -d: -f2) - echo "Downloading plugin: $name v$version" + echo "正在下载插件: $name v$version" wget -P jenkins_plugins "https://xget.xi-xu.me/jenkins/download/plugins/$name/$version/$name.hpi" done -echo "All plugins downloaded!" +echo "所有插件下载完成!" EOF chmod +x download_jenkins_plugins.sh ./download_jenkins_plugins.sh ``` -#### Offline Jenkins Deployment +#### 离线 Jenkins 部署 -For Jenkins deployment in offline environments: +对于无网络环境的 Jenkins 部署: ```bash -# 1. Download Jenkins core file +# 1. 下载 Jenkins 核心文件 wget https://xget.xi-xu.me/jenkins/war/jenkins.war -# 2. Create plugin packaging script +# 2. 创建插件打包脚本 cat > prepare_jenkins_offline.sh << 'EOF' #!/bin/bash -# Create offline deployment directory structure +# 创建离线部署目录结构 mkdir -p jenkins_offline/{plugins,update_center} -# Download update center configuration +# 下载更新中心配置 curl -o jenkins_offline/update_center/update-center.json \ https://xget.xi-xu.me/jenkins/update-center.json -# Essential plugins list +# 必备插件列表 essential_plugins=( "ant:475.vf34069fef73c" "build-timeout:1.31" @@ -1917,35 +1927,35 @@ essential_plugins=( "ws-cleanup:0.45" ) -# Download all essential plugins +# 下载所有必备插件 for plugin in "${essential_plugins[@]}"; do name=$(echo $plugin | cut -d: -f1) version=$(echo $plugin | cut -d: -f2) - echo "Downloading $name:$version" + echo "下载 $name:$version" wget -P jenkins_offline/plugins \ "https://xget.xi-xu.me/jenkins/download/plugins/$name/$version/$name.hpi" done -# Create deployment instructions +# 创建部署说明 cat > jenkins_offline/deploy_instructions.md << 'DEPLOY' -# Jenkins Offline Deployment Instructions +# Jenkins 离线部署说明 -1. Copy jenkins.war to target server -2. Start Jenkins: java -jar jenkins.war -3. Copy .hpi files from plugins/ directory to $JENKINS_HOME/plugins/ -4. Restart Jenkins +1. 将 jenkins.war 复制到目标服务器 +2. 启动 Jenkins:java -jar jenkins.war +3. 将 plugins/ 目录中的 .hpi 文件复制到 $JENKINS_HOME/plugins/ +4. 重启 Jenkins DEPLOY -echo "Offline deployment package prepared!" +echo "离线部署包准备完成!" EOF chmod +x prepare_jenkins_offline.sh ./prepare_jenkins_offline.sh ``` -#### Use in Project +#### 在项目中使用 -##### Plugin Check in Jenkinsfile +##### Jenkinsfile 中的插件检查 ```groovy pipeline { @@ -1955,16 +1965,16 @@ pipeline { stage('Check Plugin Availability') { steps { script { - // Check Maven plugin availability + // 检查 Maven 插件可用性 def pluginUrl = "https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi" try { def response = httpRequest url: pluginUrl, httpMode: 'HEAD' if (response.status == 200) { - echo "Maven plugin available: ${pluginUrl}" + echo "Maven 插件可用: ${pluginUrl}" } } catch (Exception e) { - error "Maven plugin not available: ${e.message}" + error "Maven 插件不可用: ${e.message}" } } } @@ -1972,33 +1982,33 @@ pipeline { stage('Build') { steps { - // Your build steps - echo "Building with accelerated plugins..." + // 你的构建步骤 + echo "使用加速后的插件进行构建..." } } } } ``` -### Container Image Acceleration +### 容器镜像加速 -#### Pull Images Directly +#### 直接拉取镜像 ```bash -# Pull GitHub Container Registry images +# 拉取 GitHub 容器注册表镜像 docker pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest -# Pull Google Container Registry images +# 拉取谷歌容器注册表镜像 docker pull xget.xi-xu.me/cr/gcr/distroless/base:latest -# Pull Microsoft Container Registry images +# 拉取微软容器注册表镜像 docker pull xget.xi-xu.me/cr/mcr/dotnet/runtime:8.0 ``` -#### Kubernetes Deployment Configuration +#### Kubernetes 部署配置 ```yaml -# deployment.yaml - Use Xget's images +# deployment.yaml - 使用 Xget 的镜像 apiVersion: apps/v1 kind: Deployment metadata: @@ -2024,10 +2034,10 @@ spec: - containerPort: 6379 ``` -#### Docker Compose Configuration +#### Docker Compose 配置 ```yaml -# docker-compose.yml - Use Xget accelerated images +# docker-compose.yml - 使用 Xget 加速镜像 version: '3.8' services: web: @@ -2054,10 +2064,10 @@ volumes: mssql_data: ``` -#### Dockerfile Optimization +#### Dockerfile 优化 ```dockerfile -# Use Xget accelerated base images in Dockerfile +# 在 Dockerfile 中使用 Xget 加速基础镜像 FROM xget.xi-xu.me/cr/ghcr/nodejs/node:18-alpine AS builder WORKDIR /app @@ -2067,21 +2077,21 @@ RUN npm install COPY . . RUN npm run build -# Production stage +# 生产阶段 FROM xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest COPY --from=builder /app/dist /usr/share/nginx/html -# Use Microsoft Container Registry's .NET image +# 使用微软容器注册表的 .NET 镜像 FROM xget.xi-xu.me/cr/mcr/dotnet/aspnet:8.0 AS runtime WORKDIR /app COPY --from=builder /app/publish . ENTRYPOINT ["dotnet", "MyApp.dll"] ``` -#### CI/CD Integration +#### CI/CD 集成 ```yaml -# GitHub Actions - Use Xget to accelerate container builds +# GitHub Actions - 使用 Xget 加速容器构建 name: Build and Deploy on: [push] @@ -2093,37 +2103,37 @@ jobs: - name: Build with accelerated base images run: | - # Build using Xget's base images + # 构建时使用 Xget 的基础镜像 docker build -t myapp:latest \ --build-arg BASE_IMAGE=xget.xi-xu.me/cr/ghcr/nodejs/node:18-alpine . - name: Test with accelerated images run: | - # Test using accelerated images + # 使用加速镜像进行测试 docker run --rm \ xget.xi-xu.me/cr/mcr/dotnet/runtime:8.0 \ dotnet --version ``` -#### Podman Configuration +#### Podman 配置 ```bash -# Configure Podman to use Xget image acceleration -# Edit /etc/containers/registries.conf +# 配置 Podman 使用 Xget 镜像加速 +# 编辑 /etc/containers/registries.conf [[registry]] prefix = "ghcr.io" location = "xget.xi-xu.me/cr/ghcr" -# Or pull directly +# 或者直接拉取 podman pull xget.xi-xu.me/cr/ghcr/alpine/alpine:latest podman pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest ``` -#### containerd Configuration +#### containerd 配置 ```toml -# Configure containerd to use Xget -# Edit /etc/containerd/config.toml +# 配置 containerd 使用 Xget +# 编辑 /etc/containerd/config.toml [plugins."io.containerd.grpc.v1.cri".registry.mirrors] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."ghcr.io"] endpoint = ["https://xget.xi-xu.me/cr/ghcr"] @@ -2132,11 +2142,11 @@ podman pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest ``` ```bash -# Restart containerd +# 重启 containerd sudo systemctl restart containerd ``` -### AI Inference API Acceleration +### AI 推理 API 加速 #### OpenAI API @@ -2145,7 +2155,7 @@ from openai import OpenAI client = OpenAI( api_key="your-api-key", - base_url="https://xget.xi-xu.me/ip/openai/v1", # Use Xget + base_url="https://xget.xi-xu.me/ip/openai/v1", # 使用 Xget ) response = client.responses.create( @@ -2163,7 +2173,7 @@ from anthropic import Anthropic client = Anthropic( api_key="your-api-key", - base_url="https://xget.xi-xu.me/ip/anthropic", # Use Xget + base_url="https://xget.xi-xu.me/ip/anthropic", # 使用 Xget ) message = client.messages.create( @@ -2188,7 +2198,7 @@ from google.genai import types client = genai.Client( api_key="your-api-key", - http_options=types.HttpOptions(base_url="https://xget.xi-xu.me/ip/gemini"), # Use Xget + http_options=types.HttpOptions(base_url="https://xget.xi-xu.me/ip/gemini"), # 使用 Xget ) response = client.models.generate_content( @@ -2199,7 +2209,7 @@ response = client.models.generate_content( print(response.text) ``` -#### Multi-Provider Unified Interface +#### 多提供商统一接口 ```python from openai import OpenAI @@ -2211,7 +2221,7 @@ providers = [ ] for name, key, path, model in providers: - client = OpenAI(api_key=key, base_url="https://xget.xi-xu.me/ip" + path) # Use Xget + client = OpenAI(api_key=key, base_url="https://xget.xi-xu.me/ip" + path) # 使用 Xget response = client.chat.completions.create( model=model, messages=[{"role": "user", "content": f"Hello, who are you?"}], @@ -2219,15 +2229,15 @@ for name, key, path, model in providers: print(name, "=>", response.choices[0].message.content) ``` -#### Use in JavaScript/Node.js +#### JavaScript/Node.js 中使用 ```javascript -// OpenAI API acceleration +// OpenAI API 加速 import OpenAI from "openai"; const openaiClient = new OpenAI({ apiKey: "your-openai-api-key", - baseURL: "https://xget.xi-xu.me/ip/openai/v1", // Use Xget + baseURL: "https://xget.xi-xu.me/ip/openai/v1", // 使用 Xget }); async function chatWithGPT() { @@ -2239,12 +2249,12 @@ async function chatWithGPT() { console.log(response.output_text); } -// Claude API acceleration +// Claude API 加速 import Anthropic from "@anthropic-ai/sdk"; const anthropicClient = new Anthropic({ apiKey: "your-claude-api-key", - baseURL: "https://xget.xi-xu.me/ip/anthropic", // Use Xget + baseURL: "https://xget.xi-xu.me/ip/anthropic", // 使用 Xget }); async function chatWithClaude() { @@ -2262,7 +2272,7 @@ async function chatWithClaude() { console.log(message.content[0].text); } -// Gemini API acceleration +// Gemini API 加速 import { GoogleGenAI } from "@google/genai"; const geminiClient = new GoogleGenAI({ @@ -2275,7 +2285,7 @@ async function chatWithGemini() { contents: "Hello, Gemini!", config: { httpOptions: { - baseUrl: "https://xget.xi-xu.me/ip/gemini", // Use Xget + baseUrl: "https://xget.xi-xu.me/ip/gemini", // 使用 Xget }, }, }); @@ -2284,10 +2294,10 @@ async function chatWithGemini() { } ``` -#### Environment Variable Configuration +#### 环境变量配置 ```bash -# Configure in .env file +# 在 .env 文件中配置 OPENAI_BASE_URL=https://xget.xi-xu.me/ip/openai ANTHROPIC_BASE_URL=https://xget.xi-xu.me/ip/anthropic GEMINI_BASE_URL=https://xget.xi-xu.me/ip/gemini @@ -2296,229 +2306,229 @@ MISTRAL_AI_BASE_URL=https://xget.xi-xu.me/ip/mistralai GROQ_BASE_URL=https://xget.xi-xu.me/ip/groq ``` -Then use in code: +然后在代码中使用: ```python import os from openai import OpenAI -# Read configuration from environment variables +# 从环境变量读取配置 client = OpenAI( api_key=os.getenv("OPENAI_API_KEY"), - base_url=os.getenv("OPENAI_BASE_URL") # Automatically uses Xget + base_url=os.getenv("OPENAI_BASE_URL") # 自动使用 Xget ) ``` -## 🚀 Deployment +## 🚀 部署 -### Deploy to Cloudflare Workers +### 部署到 Cloudflare Workers -1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **Get Cloudflare credentials**: - - Visit [Account API tokens](https://dash.cloudflare.com/?to=/:account/api-tokens) to create and note an API token, using the "Edit Cloudflare Workers" template. - - Visit [Workers and Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) to note the Account ID. +2. **获取 Cloudflare 凭证**: + - 访问[账户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板 + - 访问 [Workers 和 Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) 记录 Account ID -3. **Configure GitHub Secrets**: - - Go to your GitHub repository → Settings → Secrets and variables → Actions - - Add the following secrets: - - `CLOUDFLARE_API_TOKEN`: Your API token - - `CLOUDFLARE_ACCOUNT_ID`: Your Account ID +3. **配置 GitHub Secrets**: + - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions + - 添加以下 secrets: + - `CLOUDFLARE_API_TOKEN`:你的 API 令牌 + - `CLOUDFLARE_ACCOUNT_ID`:你的 Account ID -4. **Trigger deployment**: - - Pushing code to the `main` branch will automatically trigger deployment - - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment - - You can also manually trigger deployment in the GitHub Actions page +4. **触发部署**: + - 推送代码到 `main` 分支会自动触发部署 + - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 + - 也可以在 GitHub Actions 页面手动触发部署 -5. **Bind custom domain** (optional): Bind your custom domain in the Cloudflare Workers console +5. **绑定自定义域名**(可选):在 Cloudflare Workers 控制台中绑定你的自定义域名 -### Deploy to Cloudflare Pages +### 部署到 Cloudflare Pages -1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **Get Cloudflare credentials**: - - Visit [Account API tokens](https://dash.cloudflare.com/?to=/:account/api-tokens) to create and note an API token, using the "Edit Cloudflare Workers" template. - - Visit [Workers and Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) to note the Account ID. +2. **获取 Cloudflare 凭证**: + - 访问[账户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板 + - 访问 [Workers 和 Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) 记录 Account ID -3. **Configure GitHub Secrets**: - - Go to your GitHub repository → Settings → Secrets and variables → Actions - - Add the following secrets: - - `CLOUDFLARE_API_TOKEN`: Your API token - - `CLOUDFLARE_ACCOUNT_ID`: Your Account ID +3. **配置 GitHub Secrets**: + - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions + - 添加以下 secrets: + - `CLOUDFLARE_API_TOKEN`:你的 API 令牌 + - `CLOUDFLARE_ACCOUNT_ID`:你的 Account ID -4. **Trigger deployment**: - - The repository will automatically convert Workers code to Pages-compatible format and sync to the `pages` branch - - Pushing code to the `main` branch will automatically trigger sync and deployment workflows - - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment - - You can also manually trigger deployment in the GitHub Actions page +4. **触发部署**: + - 存储库会自动将 Workers 代码转换为 Pages 兼容格式并同步到 `pages` 分支 + - 推送代码到 `main` 分支会自动触发同步和部署工作流 + - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 + - 也可以在 GitHub Actions 页面手动触发部署 -5. **Bind custom domain** (optional): Bind your custom domain in the Cloudflare Pages console +5. **绑定自定义域名**(可选):在 Cloudflare Pages 控制台中绑定你的自定义域名 -**Note**: The `pages` branch is automatically generated from the `main` branch. Do not manually edit the `pages` branch as it will be overwritten by the sync workflow. +**注意**:`pages` 分支是从 `main` 分支自动生成的。请勿手动编辑 `pages` 分支,因为它会被同步工作流覆盖。 -### Deploy to EdgeOne Pages +### 部署到 EdgeOne Pages -1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **Get EdgeOne Pages API Token**: - - Visit [China EdgeOne Console](https://console.cloud.tencent.com/edgeone/pages?tab=api) or [International EdgeOne Console](https://console.tencentcloud.com/edgeone/pages?tab=api) to create and note an API Token +2. **获取 EdgeOne Pages API Token**: + - 访问[中国站 EdgeOne 控制台](https://console.cloud.tencent.com/edgeone/pages?tab=api)或[国际站 EdgeOne 控制台](https://console.tencentcloud.com/edgeone/pages?tab=api)创建并记录 API Token -3. **Configure GitHub Secrets**: - - Go to your GitHub repository → Settings → Secrets and variables → Actions - - Add the following secret: - - `EDGEONE_PAGES_API_TOKEN`: Your API Token +3. **配置 GitHub Secrets**: + - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions + - 添加以下 secret: + - `EDGEONE_API_TOKEN`:你的 API Token -4. **Trigger deployment**: - - The repository will automatically convert Workers code to Pages-compatible format and sync to the `pages` branch - - Pushing code to the `main` branch will automatically trigger sync and deployment workflows - - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment - - You can also manually trigger deployment in the GitHub Actions page +4. **触发部署**: + - 存储库会自动将 Workers 代码转换为 Pages 兼容格式并同步到 `pages` 分支 + - 推送代码到 `main` 分支会自动触发同步和部署工作流 + - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 + - 也可以在 GitHub Actions 页面手动触发部署 -5. **Bind custom domain** (optional): Bind your custom domain in the EdgeOne Pages console +5. **绑定自定义域名**(可选):在 EdgeOne Pages 控制台中绑定你的自定义域名 -**Note**: The `pages` branch is automatically generated from the `main` branch. Do not manually edit the `pages` branch as it will be overwritten by the sync workflow. +**注意**:`pages` 分支是从 `main` 分支自动生成的。请勿手动编辑 `pages` 分支,因为它会被同步工作流覆盖。 -### Deploy to Vercel +### 部署到 Vercel -1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **Get Vercel credentials**: - - Visit [Vercel Account Settings](https://vercel.com/account/settings/tokens) to create and note an Access Token - - Visit Team Settings to note the Team ID - - Visit project's Settings after creating a new project to note the Project ID +2. **获取 Vercel 凭证**: + - 访问 [Vercel Account Settings](https://vercel.com/account/settings/tokens) 创建并记录 Access Token + - 访问 Team Settings 记录 Team ID + - 新建项目后访问项目的 Settings 记录 Project ID -3. **Configure GitHub Secrets**: - - Go to your GitHub repository → Settings → Secrets and variables → Actions - - Add the following secrets: - - `VERCEL_TOKEN`: Your Access Token - - `VERCEL_ORG_ID`: Your Team ID - - `VERCEL_PROJECT_ID`: Your Project ID +3. **配置 GitHub Secrets**: + - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions + - 添加以下 secrets: + - `VERCEL_TOKEN`:你的 Access Token + - `VERCEL_ORG_ID`:你的 Team ID + - `VERCEL_PROJECT_ID`:你的 Project ID -4. **Trigger deployment**: - - The repository will automatically convert Workers code to Functions-compatible format and sync to the `functions` branch - - Pushing code to the `main` branch will automatically trigger sync and deployment workflows - - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment - - You can also manually trigger deployment in the GitHub Actions page +4. **触发部署**: + - 存储库会自动将 Workers 代码转换为 Functions 兼容格式并同步到 `functions` 分支 + - 推送代码到 `main` 分支会自动触发同步和部署工作流 + - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 + - 也可以在 GitHub Actions 页面手动触发部署 -5. **Bind custom domain** (optional): Bind your custom domain in the Vercel console +5. **绑定自定义域名**(可选):在 Vercel 控制台中绑定你的自定义域名 -**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow. +**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。 -### Deploy to Netlify +### 部署到 Netlify -1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **Get Netlify credentials**: - - Visit [Netlify User Settings](https://app.netlify.com/user/applications) to create and note a personal access token - - Visit Project configuration after creating a new project to note the Project ID +2. **获取 Netlify 凭证**: + - 访问 [Netlify User Settings](https://app.netlify.com/user/applications) 创建并记录 personal access token + - 新建项目后访问 Project configuration 记录 Project ID -3. **Configure GitHub Secrets**: - - Go to your GitHub repository → Settings → Secrets and variables → Actions - - Add the following secrets: - - `NETLIFY_AUTH_TOKEN`: Your personal access token - - `NETLIFY_SITE_ID`: Your Project ID +3. **配置 GitHub Secrets**: + - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions + - 添加以下 secrets: + - `NETLIFY_AUTH_TOKEN`:你的 personal access token + - `NETLIFY_SITE_ID`:你的 Project ID -4. **Trigger deployment**: - - The repository will automatically convert Workers code to Functions-compatible format and sync to the `functions` branch - - Pushing code to the `main` branch will automatically trigger sync and deployment workflows - - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment - - You can also manually trigger deployment in the GitHub Actions page +4. **触发部署**: + - 存储库会自动将 Workers 代码转换为 Functions 兼容格式并同步到 `functions` 分支 + - 推送代码到 `main` 分支会自动触发同步和部署工作流 + - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署 + - 也可以在 GitHub Actions 页面手动触发部署 -5. **Bind custom domain** (optional): Bind your custom domain in the Netlify console +5. **绑定自定义域名**(可选):在 Netlify 控制台中绑定你的自定义域名 -**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow. +**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。 -### Deploy to Deno Deploy +### 部署到 Deno Deploy -1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) +1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork) -2. **Switch default branch**: - - Go to your GitHub repository → Settings → General → Default branch - - Switch the default branch from `main` to `functions` +2. **切换默认分支**: + - 进入你的 GitHub 存储库 → Settings → General → Default branch + - 将默认分支从 `main` 切换到 `functions` -3. **Deploy to Deno Deploy**: - - Follow the [Deno Deploy official documentation](https://docs.deno.com/deploy/getting_started/) for deployment - - Create a new project in the Deno Deploy console and connect your GitHub repository +3. **部署到 Deno Deploy**: + - 参考 [Deno Deploy 官方文档](https://docs.deno.com/deploy/getting_started/)执行部署 + - 在 Deno Deploy 控制台创建新项目并连接你的 GitHub 存储库 -4. **Bind custom domain** (optional): Bind your custom domain in the Deno Deploy console +4. **绑定自定义域名**(可选):在 Deno Deploy 控制台中绑定你的自定义域名 -**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow. +**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。 -### Self-Hosted Deployment +### 自托管部署 -If you prefer to run Xget on your own server, you can use Docker or Podman deployment: +如果你希望在自己的服务器上运行 Xget,可以使用 Docker 或 Podman 部署: -#### Using Pre-built Image +#### 使用预构建镜像 -Pull and run the pre-built image from GitHub Container Registry: +从 GitHub Container Registry 拉取并运行预构建的镜像: -**Using Docker:** +**使用 Docker:** ```bash -# Pull the latest image +# 拉取最新镜像 docker pull ghcr.io/xixu-me/xget:latest -# Run the container +# 运行容器 docker run -d \ --name xget \ -p 8080:8080 \ ghcr.io/xixu-me/xget:latest ``` -**Using Podman:** +**使用 Podman:** ```bash -# Pull the latest image +# 拉取最新镜像 podman pull ghcr.io/xixu-me/xget:latest -# Run the container +# 运行容器 podman run -d \ --name xget \ -p 8080:8080 \ ghcr.io/xixu-me/xget:latest ``` -#### Building Locally +#### 本地构建 -Build the container image from source: +从源码构建容器镜像: -**Using Docker:** +**使用 Docker:** ```bash -# Clone the repository +# 克隆存储库 git clone https://github.com/xixu-me/Xget.git cd Xget -# Build the image +# 构建镜像 docker build -t xget:local . -# Run the container +# 运行容器 docker run -d \ --name xget \ -p 8080:8080 \ xget:local ``` -**Using Podman:** +**使用 Podman:** ```bash -# Clone the repository +# 克隆存储库 git clone https://github.com/xixu-me/Xget.git cd Xget -# Build the image +# 构建镜像 podman build -t xget:local . -# Run the container +# 运行容器 podman run -d \ --name xget \ -p 8080:8080 \ xget:local ``` -#### Using Docker Compose / Podman Compose +#### 使用 Docker Compose / Podman Compose -Create a `docker-compose.yml` file: +创建 `docker-compose.yml` 文件: ```yaml version: '3.8' @@ -2532,23 +2542,23 @@ services: restart: unless-stopped ``` -**Using Docker Compose:** +**使用 Docker Compose:** ```bash docker-compose up -d ``` -**Using Podman Compose:** +**使用 Podman Compose:** ```bash podman-compose up -d -# Or use podman compose (Podman 4.0+) +# 或者使用 podman compose (Podman 4.0+) podman compose up -d ``` -After deployment, Xget will run on port 8080. +部署完成后,Xget 将在 8080 端口运行。 -If you want to deploy and run Xget on DigitalOcean, please refer to *[Deploying and Optimizing Xget on DigitalOcean](docs/deploy-on-digitalocean.md)*. By signing up via the referral link below, you can receive USD 200 in credits to try Droplets, Kubernetes, App Platform, and more: +如果你希望在 DigitalOcean 上部署和运行 Xget,可以参考文档[《Deploying and Optimizing Xget on DigitalOcean》](docs/deploy-on-digitalocean.md)。通过下方推荐链接注册账户,可获得 200 美元代金券积分,可用于创建 Droplet、Kubernetes、App Platform 等资源:

@@ -2556,43 +2566,43 @@ If you want to deploy and run Xget on DigitalOcean, please refer to *[Deploying

-**Note**: Self-hosted deployment does not include global edge network acceleration. Performance depends on your server configuration and network environment. +**注意**:自托管部署不包括全球边缘网络加速,性能取决于你的服务器配置和网络环境。 -## 🔧 Configuration +## 🔧 配置 -### Configuration Parameters +### 配置参数 -You can customize configuration by modifying `src/config/index.js`: +你可以通过修改 `src/config/index.js` 来自定义配置: ```javascript export const CONFIG = { - TIMEOUT_SECONDS: 30, // Request timeout (seconds) - MAX_RETRIES: 3, // Maximum retry count - RETRY_DELAY_MS: 1000, // Retry delay (milliseconds) - CACHE_DURATION: 1800, // Cache duration (1800 seconds = 30 minutes) + TIMEOUT_SECONDS: 30, // 请求超时时间(秒) + MAX_RETRIES: 3, // 最大重试次数 + RETRY_DELAY_MS: 1000, // 重试延迟时间(毫秒) + CACHE_DURATION: 1800, // 缓存持续时间(1800秒 = 30分钟) SECURITY: { - ALLOWED_METHODS: ["GET", "HEAD"], // Allowed HTTP methods (Git operations dynamically allow POST) - ALLOWED_ORIGINS: ["*"], // Allowed CORS origins - MAX_PATH_LENGTH: 2048, // Maximum path length (characters) + ALLOWED_METHODS: ["GET", "HEAD"], // 允许的 HTTP 方法(Git 操作会动态允许 POST) + ALLOWED_ORIGINS: ["*"], // 允许的 CORS 源 + MAX_PATH_LENGTH: 2048, // 最大路径长度(字符) }, }; ``` -### Performance Tuning Recommendations +### 性能调优建议 -- **Cache Optimization**: Adjust `CACHE_DURATION` based on usage patterns, reduce appropriately for frequently updated repositories -- **Timeout Settings**: Increase `TIMEOUT_SECONDS` appropriately for poor network conditions -- **Retry Strategy**: Increase `MAX_RETRIES` and `RETRY_DELAY_MS` in high-latency environments +- **缓存优化**:根据使用模式调整 `CACHE_DURATION`,频繁更新的存储库可适当降低 +- **超时设置**:网络条件较差时可适当增加 `TIMEOUT_SECONDS` +- **重试策略**:高延迟环境下可增加 `MAX_RETRIES` 和 `RETRY_DELAY_MS` -### Adding New Platforms +### 添加新平台 -To add support for new platforms, edit `src/config/platforms.js`: +要添加对新平台的支持,编辑 `src/config/platforms.js`: ```javascript export const PLATFORMS = { - // Existing platforms... + // 现有平台... - // New platform example + // 新平台示例 custom: { base: "https://example.com", transform: (path) => path.replace(/^\/custom\//, "/"), @@ -2600,109 +2610,109 @@ export const PLATFORMS = { }; ``` -## 🚧 Development +## 🚧 开发 -1. **Repository Setup** +1. **存储库设置** ```bash git clone https://github.com/xixu-me/Xget.git cd Xget npm install - npx wrangler login # First time use + npx wrangler login # 首次使用 ``` -2. **Local Development** +2. **本地开发** ```bash - npm run dev # Start development server (http://localhost:8787) - npm run test:run # Run complete test suite - npm run test:coverage # Generate test coverage report - npm run lint # Code linting - npm run format # Code formatting - npm run deploy # Deploy to production + npm run dev # 启动开发服务器 (http://localhost:8787) + npm run test:run # 运行完整测试套件 + npm run test:coverage # 生成测试覆盖率报告 + npm run lint # 代码检查 + npm run format # 代码格式化 + npm run deploy # 部署到生产 ``` -## 🧪 Testing +## 🧪 测试 -The repository includes a complete test suite to ensure code quality and functional correctness. +存储库包含完整的测试套件,确保代码质量和功能正确性。 -### Complete Testing +### 完整测试 ```bash -# Install test dependencies +# 安装测试依赖 npm install -# Run all tests +# 运行所有测试 npm run test:run -# Generate coverage report +# 生成覆盖率报告 npm run test:coverage -# Watch mode +# 监视模式 npm run test:watch ``` -### Test Coverage +### 测试覆盖 -- **Unit Tests**: Core functionality, platform configuration, performance monitoring -- **Integration Tests**: End-to-end processes, platform integration, Git protocol -- **Security Tests**: Input validation, security headers, permission control -- **Performance Tests**: Response time, memory usage, concurrent processing +- **单元测试**: 核心功能、平台配置、性能监控 +- **集成测试**: 端到端流程、平台集成、Git 协议 +- **安全测试**: 输入验证、安全头、权限控制 +- **性能测试**: 响应时间、内存使用、并发处理 -## 🔍 Troubleshooting +## 🔍 故障排除 -### Common Issues +### 常见问题 -**Q: No significant speed improvement?** -A: Check if source files are already cached at CDN edge nodes. Initial access may be slower, subsequent accesses will be significantly faster. +**Q: 下载速度没有明显提升?** +A: 检查源文件是否已经在 CDN 边缘节点缓存,首次访问可能较慢,后续访问会显著提升。 -**Q: Git operations failing?** -A: Confirm correct URL format is used and Git client version supports HTTPS proxy. +**Q: Git 操作失败?** +A: 确认使用了正确的 URL 格式,且 Git 客户端版本支持 HTTPS 代理。 -**Q: Cannot access after deployment?** -A: Check if Cloudflare Workers domain is correctly bound, confirm `wrangler.toml` configuration is correct. +**Q: 部署后无法访问?** +A: 检查 Cloudflare Workers 域名是否正确绑定,确认 `wrangler.toml` 配置正确。 -**Q: Getting 400 error?** -A: Check URL path format, confirm platform prefix is correctly used. +**Q: 出现 400 错误?** +A: 检查 URL 路径格式,确认平台前缀正确使用。 -### Performance Monitoring +### 性能监控 -Performance metrics are returned in response headers: +在响应头中返回性能指标: -- `X-Performance-Metrics`: Contains timing statistics for request stages -- `X-Cache-Status`: Shows cache hit status +- `X-Performance-Metrics`: 包含请求各阶段的耗时统计 +- `X-Cache-Status`: 显示缓存命中状态 -### Log Debugging +### 日志调试 -In development environment, you can view detailed logs through Cloudflare Workers console: +在开发环境中,你可以通过 Cloudflare Workers 控制台查看详细日志: ```bash npx wrangler dev --log-level debug ``` -## ⚠️ Disclaimer +## ⚠️ 免责声明 -- **Legal and Compliant Use**: This repository aims to provide unified acceleration services for code repositories, package registries, AI inference APIs, container images, models, datasets, and other legitimate developer resources. Users must strictly comply with the laws and regulations of their jurisdiction and the terms of service of relevant platforms. Any illegal use is the sole responsibility of the user -- **Non-Affiliation and Independent Responsibility**: This repository has no affiliation, agency, or partnership relationship with any third-party platforms. Any fork, secondary development, redistribution, or derivative version based on this repository is solely the responsibility of its maintainer; authors, maintainers, and contributors bear no legal or joint liability for the actions or consequences of derivative repositories -- **No Warranty and Limitation of Liability**: To the maximum extent permitted by applicable law, this repository is provided "AS IS" without any express or implied warranties (including but not limited to merchantability, fitness for a particular purpose, non-infringement, etc.). Authors, maintainers, and contributors assume no responsibility for any direct or indirect losses (including but not limited to data loss, business interruption, profit loss, etc.) resulting from the use of this repository -- **Risk Assumption Principle**: Users should independently assess usage risks, ensure their use is legal and compliant, respect third-party rights, and must not use this repository for any illegal, infringing, malicious, or improper purposes -- **Third-Party Platform Compliance**: Users must comply with the terms of service, API usage policies, rate limits, and copyright requirements of relevant platforms, and avoid causing overload or interference to source platforms. Each platform has the final interpretation right over its content, services, and policies -- **Intellectual Property Protection**: Content obtained through this repository is protected by respective copyright laws. Users must comply with relevant licensing agreements, copyright notices, and terms of use, and must not engage in any activities that infringe intellectual property rights -- **Security Recommendations**: Although this repository adopts a no-log architecture and does not store user request data, due to inherent risks of internet transmission, users are advised to perform security scans on downloaded content, especially for executable files and scripts -- **Open Source Nature**: This repository is open source. Authors and contributors are not obligated to provide technical support, bug fixes, or continuous maintenance. The inclusion of external contributions does not constitute endorsement or commitment to specific uses or effects -- **Name Usage Guidelines**: Any representations that may imply authors or contributors provide commercial cooperation, technical support, guarantees, or endorsements are strictly prohibited. The use of repository names or author identifiers must comply with relevant laws and regulations as well as general norms -- **Disclaimer Updates**: This disclaimer may be updated and revised as the repository develops or legal environments change. Continued use, copying, distribution, or modification of this repository constitutes acceptance of the latest version of this disclaimer +- **合法合规使用**:本存储库旨在为代码存储库、软件包注册表、AI 推理 API、容器镜像、模型、数据集及更多合法开发者资源提供统一加速服务。使用者应严格遵守所在司法辖区法律法规及相关平台服务条款,任何非法用途的法律责任由使用者自行承担 +- **非关联性与独立责任**:本存储库与各第三方平台不存在任何隶属、代理或合作关系。任何基于本存储库的 fork、二次开发、再分发或衍生版本均由其维护者独立承担全部责任;作者、维护者及贡献者不对衍生存储库的任何行为或后果承担法律或连带责任 +- **无担保与免责条款**:在适用法律允许的最大范围内,本存储库按“现状(AS IS)”提供,不提供任何明示或暗示担保(包括但不限于适销性、特定用途适用性、非侵权等)。对因使用本存储库而造成的任何直接或间接损失(包括但不限于数据丢失、业务中断、利润损失等),作者、维护者及贡献者不承担任何责任 +- **风险自担原则**:使用者应自行评估使用风险,确保其使用行为合法合规,不侵犯第三方权益,不得将本存储库用于任何违法、侵权、恶意或不当用途 +- **第三方平台合规**:使用者应遵守相关平台的服务条款、API 使用政策、速率限制及版权要求,避免对源平台造成过载或干扰。各平台对其内容、服务及政策拥有最终解释权 +- **知识产权保护**:通过本存储库获取的内容受相应版权法保护。使用者应遵守相关许可协议、版权声明及使用条款,不得从事任何侵犯知识产权的行为 +- **安全防护建议**:虽然本存储库采用无日志架构,不存储用户请求数据,但基于互联网传输的固有风险,建议使用者对下载内容进行安全扫描,尤其对可执行文件、脚本等保持谨慎 +- **开源性质声明**:本存储库为开源项目,作者与贡献者不承担提供技术支持、错误修复或持续维护的义务。外部贡献的合并不代表对特定用途或效果的承诺与背书 +- **名称使用规范**:严禁任何可能暗示作者或贡献者提供商业合作、技术支持、担保或背书的表述。涉及存储库名称或作者标识的使用应遵循相关法律法规及通用规范 +- **免责声明更新**:本免责声明可能随存储库发展或法律环境变化进行更新修订。使用者继续使用、复制、分发或修改本存储库即视为接受最新版本的免责声明 -## 🤝 Contributing +## 🤝 贡献 -We welcome all forms of contribution! Please check the [Contributing Guide](CONTRIBUTING.md) to learn how to participate in repository development. +我们欢迎各种形式的贡献!请查看[贡献指南](CONTRIBUTING.md)了解如何参与存储库开发。 -1. **Report Issues**: Use [issue templates](https://github.com/xixu-me/Xget/issues/new/choose) to report bugs or propose feature requests -2. **Submit Code**: Fork the repository, create a feature branch, submit a pull request -3. **Improve Documentation**: Fix errors, add examples, improve descriptions -4. **Testing Feedback**: Test in different environments and provide feedback +1. **报告问题**: 使用 [issue 模板](https://github.com/xixu-me/Xget/issues/new/choose)报告 bug 或提出功能请求 +2. **提交代码**: fork 存储库,创建功能分支,提交 pull request +3. **改进文档**: 修正错误、添加示例、完善说明 +4. **测试反馈**: 在不同环境下测试并提供反馈 -## 🌟 Star History +## 🌟 Star 历史 @@ -2712,18 +2722,20 @@ We welcome all forms of contribution! Please check the [Contributing Guide](CONT -## 📝 License +## 📝 许可证 -Copyright © Xi Xu. +版权所有 © Xi Xu。 -This repository is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details. +本存储库采用 GPL-3.0 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。 ---
-**If this repository helps you, please consider giving it a ⭐ star!** +**如果这个存储库对您有帮助,请考虑给它一个 ⭐ star!** Made with ❤️ by [Xi Xu](https://xi-xu.me)
+ +[![Powered by DartNode](https://dartnode.com/branding/DN-Open-Source-sm.png)](https://dartnode.com "Powered by DartNode - Free VPS for Open Source")