diff --git a/README.en.md b/README.en.md index f841fb7..fb84671 100644 --- a/README.en.md +++ b/README.en.md @@ -8,8 +8,8 @@ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/xixu-me/Xget) [![Chromium Extension](https://img.shields.io/badge/Chromium%20Extension-4285F4?logo=googlechrome&logoColor=white)](#-ecosystem-integration) -[![Firefox Extension](https://img.shields.io/badge/Firefox%20Extension-582ACB?logo=firefox&logoColor=white)](#-ecosystem-integration) -[![Cloudflare Workers](https://img.shields.io/badge/Cloudflare%20Workers-F38020?&logo=cloudflare&logoColor=white)](#cloudflare-workers) +[![Firefox Extension](https://img.shields.io/badge/Firefox%20Extension-582ACB?logo=Firefox&logoColor=white)](#-ecosystem-integration) +[![Cloudflare Workers](https://img.shields.io/badge/Cloudflare%20Workers-F38020?&logo=cloudflare&logoColor=white)](#-deployment) [![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) @@ -17,23 +17,23 @@ [![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=white)](#hugging-face) +[![Hugging Face](https://img.shields.io/badge/Hugging%20Face-FFD21E?&logo=huggingface&logoColor=white)](#hugging-face-mirror) [![Civitai](https://img.shields.io/badge/Civitai-0066CC)](#civitai-ai-model-platform) -[![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](#npm-package-management-acceleration) -[![PyPI](https://img.shields.io/badge/PyPI-3775A9?logo=pypi&logoColor=white)](#python-package-management-acceleration) -[![conda](https://img.shields.io/badge/conda-44A833?logo=anaconda&logoColor=white)](#conda-package-management-acceleration) -[![Maven](https://img.shields.io/badge/Maven-C71A36?logo=apachemaven&logoColor=white)](#maven-package-management-acceleration) +[![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-management-acceleration) -[![Homebrew](https://img.shields.io/badge/Homebrew-FBB040?logo=homebrew&logoColor=black)](#homebrew-package-management-acceleration) -[![RubyGems](https://img.shields.io/badge/RubyGems-CC342D?logo=rubygems&logoColor=white)](#ruby-package-management-acceleration) -[![CRAN](https://img.shields.io/badge/CRAN-276DC3?logo=r&logoColor=white)](#r-package-management-acceleration) -[![CPAN](https://img.shields.io/badge/CPAN-39457E?logo=perl&logoColor=white)](#perl-package-management-acceleration) -[![CTAN](https://img.shields.io/badge/CTAN-008080?logo=latex&logoColor=white)](#texlatex-package-management-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-CC342D?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-39457E?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-management-acceleration) -[![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white)](#rust-package-management-acceleration) -[![Packagist](https://img.shields.io/badge/Packagist-F28D1A?logo=packagist&logoColor=white)](#php-package-management-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-294172?logo=fedora&logoColor=white)](#fedora-dnf-configuration) @@ -43,101 +43,101 @@ [![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-D33833?logo=jenkins&logoColor=white)](#jenkins-plugin-download) -[![AI Inference APIs](https://img.shields.io/badge/AI%20Inference%20APIs-412991?logo=openai&logoColor=white)](#ai-inference-api-acceleration) -[![Container Registry](https://img.shields.io/badge/Container%20Registry-%23007EC6.svg?logo=docker&logoColor=white)](#container-image-acceleration) +[![AI Inference Providers](https://img.shields.io/badge/AI%20Inference%20Providers-412991?logo=openai&logoColor=white)](#ai-inference-providers) +[![Container Registries](https://img.shields.io/badge/Container%20Registries-%23007EC6.svg?logo=docker&logoColor=white)](#container-registries) -An ultra-high-performance, secure, all-in-one acceleration engine for developer resources whose performance far surpasses traditional accelerators, delivering a unified, efficient acceleration experience across multiple platforms, including code repositories, package management, AI inference APIs, container images, models and datasets, and more. +Ultra-high-performance, secure, all-in-one acceleration engine for developer resources that significantly outperforms traditional solutions, delivering unified, efficient acceleration across code repositories, package registries, AI inference APIs, container images, models, datasets, and more. -The technical in-depth analysis article has been posted: ***[A 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)***. +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 instances (no reliability guaranteed): `xget.xi-xu.me`** - Out of the box, no deployment required! +**Pre-deployed Instance (no reliability guarantee): `xget.xi-xu.me`** - Ready to use out of the box, no deployment required! -**URL Converter:**[**`xuc.xi-xu.me`**](https://xuc.xi-xu.me) - One-click conversion of any URL that supports the platform to an accelerated format of Xget! +**URL Converter:** [**`xuc.xi-xu.me`**](https://xuc.xi-xu.me) - Convert any supported platform URL to Xget's acceleration format with one click! -> **⚡ Experience the fast download now**: No registration required, no configuration required, you can experience the average download speed directly! +> **⚡ Experience Lightning-Fast Downloads Now**: No registration, no configuration required, just start using to experience blazing-fast download speeds! -## 🌟 Core Advantages — Why Choose Xget? +## 🌟 Core Advantages - Why Choose Xget? -### ⚡ Blazing Performance — Breaking Traditional Bottlenecks +### ⚡ Extreme Performance - Breaking Through Traditional Accelerator Bottlenecks -- **⚡ Millisecond response**: Cloudflare Global 330+ edge nodes, average response time < 50ms -- **🌐 HTTP/3 Extreme Speed ​​Protocol**: Enable the latest HTTP/3 protocol, reduce connection latency by 40%, and increase transmission speed by 30%. -- **📦 Intelligent Multiple Compression**: gzip, deflate, brotli triple compression algorithm, transmission efficiency is improved by 60% -- **🔗 Zero-delay pre-connection**: Connection warms up and stays active, eliminates handshake overhead, and achieves second-level response -- **⚡ Parallel shard download**: Full support for HTTP Range requests, multi-threaded download speed doubles -- **🎯 Intelligent routing optimization**: Automatically select the optimal transmission path to avoid network congestion nodes +- **⚡ 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 ### 🌐 Deep Multi-Platform Integration -- **One-stop multi-platform support**: Unified support for code repository, package manager, AI inference provider, container registry, model and dataset hosting platform -- **Intelligent recognition and conversion**: Automatically identify the platform prefix and convert it to the correct URL structure for the target platform -- **Consistent acceleration experience**: You can enjoy a unified and stable and fast download experience regardless of file type or source +- **All-in-One Multi-Platform Support**: Unified support for code repositories, package managers, AI inference providers, container registries, model and dataset hosting platforms +- **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 -- **Multi-layer security header**: - - `Strict-Transport-Security`: Force HTTPS transmission to prevent man-in-the-middle attacks - - `X-Frame-Options: DENY`: Prevent click hijacking attacks +- **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`: Controlling the leakage of reference information -- **Request verification mechanism**: - - HTTP method whitelist: General requests are limited to GET/HEAD, Git operations dynamically allow POST - - Path length limit: Prevents excessively long URL attacks (maximum 2048 characters) - - Input Cleanup: Prevent path traversal and injection attacks -- **Timeout Protection**: 30-second request timeout to prevent resource exhaustion and malicious requests + - `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 -- **Intelligent retry mechanism**: - - Maximum 3 retry, linear delay strategy (1000ms × retry times) - - Automatic error recovery to improve download success rate - - Timeout detection and interrupt handling -- **Efficient Caching Policy**: - - 1800 seconds (30 minutes) default cache time, significantly reducing source station pressure - - Git operation skips cache to ensure real-time - - Edge Cache Based on Cloudflare Cache API +- **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, real-time tracking of requests for each stage - - Provide detailed performance data through the `X-Performance-Metrics` response header - - Support cache hit rate statistics and optimization suggestions + - 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 - **Smart Protocol Detection**: - - Automatically identify Git-specific endpoints (`/info/refs`, `/git-upload-pack`, `/git-receive-pack`) - - Detect Git client User-Agent mode - - Support `service=git-upload-pack` and other query parameters -- **Full operation support**: - - `git clone`: Full repository clone, support for shallow clones and branch specifications + - 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 update and remote synchronization - - `git submodule`: submodule recursive cloning + - `git pull/fetch`: Incremental updates and remote synchronization + - `git submodule`: Recursive submodule cloning - **Protocol Optimization**: - - Keep Git-specific request headers and authentication information - - Intelligent User-Agent processing (default `git/2.34.1`) - - Support Git LFS large file transfer + - 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 -- **Special browser extension**: [Xget Now](https://github.com/xixu-me/Xget-Now) provides a seamless experience - - Automatic URL redirection without manual URL modification - - Support custom Xget instance domain names - - Multi-platform preferences and black and white list management - - Local processing to ensure privacy and security -- **Download tool compatible**: Perfectly support mainstream download tools such as wget, cURL, aria2, IDM, etc. -- **CI/CD integration**: Can be used directly in GitHub Actions, GitLab CI and other environments +- **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 ## 📖 URL Conversion Rules -Using pre-deployed instances **`xget.xi-xu.me`** or your own deployed instance, simply replace the domain name and add the platform prefix: +Using the pre-deployed instance **`xget.xi-xu.me`** or your own deployed instance, simply replace the domain and add the platform prefix: -### Convert format +### Conversion Format | Platform | Platform Prefix | Original URL Format | Accelerated URL Format | -|------|----------|--------------|--------------| +|----------|----------------|---------------------|------------------------| | GitHub | `gh` | `https://github.com/...` | `https://xget.xi-xu.me/gh/...` | | GitLab | `gl` | `https://gitlab.com/...` | `https://xget.xi-xu.me/gl/...` | | Gitea | `gitea` | `https://gitea.com/...` | `https://xget.xi-xu.me/gitea/...` | @@ -157,7 +157,7 @@ Using pre-deployed instances **`xget.xi-xu.me`** or your own deployed instance, | 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 module | `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/...` | @@ -169,11 +169,11 @@ Using pre-deployed instances **`xget.xi-xu.me`** or your own deployed instance, | 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 plugin | `jenkins` | `https://updates.jenkins.io/...` | `https://xget.xi-xu.me/jenkins/...` | -| AI Inference Provider | `ip` | See [AI Inference Provider](#ai-Inference Provider) | See [AI Inference Provider](#ai-Inference Provider) | -| Container Registration | `cr` | See [Container Registration] (#Container Registration) | See [Container Registration] (#Container Registration) | +| Jenkins Plugins | `jenkins` | `https://updates.jenkins.io/...` | `https://xget.xi-xu.me/jenkins/...` | +| AI Inference Providers | `ip` | See [AI Inference Providers](#ai-inference-providers) | See [AI Inference Providers](#ai-inference-providers) | +| Container Registries | `cr` | See [Container Registries](#container-registries) | See [Container Registries](#container-registries) | -### Examples of conversion of each platform +### Platform Conversion Examples #### GitHub @@ -181,7 +181,7 @@ Using pre-deployed instances **`xget.xi-xu.me`** or your own deployed instance, # Original URL https://github.com/microsoft/vscode/archive/refs/heads/main.zip -# After conversion (add gh prefix) +# Converted (add gh prefix) https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip ``` @@ -191,7 +191,7 @@ https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip # Original URL https://gitlab.com/gitlab-org/gitlab/-/archive/master/gitlab-master.zip -# After conversion (add gl prefix) +# Converted (add gl prefix) https://xget.xi-xu.me/gl/gitlab-org/gitlab/-/archive/master/gitlab-master.zip ``` @@ -201,7 +201,7 @@ https://xget.xi-xu.me/gl/gitlab-org/gitlab/-/archive/master/gitlab-master.zip # Original URL https://gitea.com/gitea/gitea/archive/master.zip -# After conversion (add gitea prefix) +# Converted (add gitea prefix) https://xget.xi-xu.me/gitea/gitea/gitea/archive/master.zip ``` @@ -211,7 +211,7 @@ https://xget.xi-xu.me/gitea/gitea/gitea/archive/master.zip # Original URL https://codeberg.org/forgejo/forgejo/archive/forgejo.zip -# After conversion (add codeberg prefix) +# Converted (add codeberg prefix) https://xget.xi-xu.me/codeberg/forgejo/forgejo/archive/forgejo.zip ``` @@ -221,39 +221,39 @@ https://xget.xi-xu.me/codeberg/forgejo/forgejo/archive/forgejo.zip # Original URL https://sourceforge.net/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download -# After conversion (add sf prefix) +# Converted (add sf prefix) https://xget.xi-xu.me/sf/projects/sevenzip/files/7-Zip/23.01/7z2301-x64.exe/download ``` -#### AOSP (Android open source project) +#### AOSP (Android Open Source Project) ```url # AOSP project original URL https://android.googlesource.com/platform/frameworks/base -# After conversion (add aosp prefix) +# Converted (add aosp prefix) https://xget.xi-xu.me/aosp/platform/frameworks/base -# AOSP Device Tree Original URL +# AOSP device tree original URL https://android.googlesource.com/device/google/pixel -# After conversion (add aosp prefix) +# Converted (add aosp prefix) https://xget.xi-xu.me/aosp/device/google/pixel ``` #### Hugging Face ```url -# Original URL of model file +# Model file original URL https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin -# After conversion (add hf prefix) +# Converted (add hf prefix) https://xget.xi-xu.me/hf/microsoft/DialoGPT-medium/resolve/main/pytorch_model.bin # Dataset file original URL https://huggingface.co/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet -# After conversion (add hf prefix) +# Converted (add hf prefix) https://xget.xi-xu.me/hf/datasets/rajpurkar/squad/resolve/main/plain_text/train-00000-of-00001.parquet ``` @@ -263,35 +263,35 @@ https://xget.xi-xu.me/hf/datasets/rajpurkar/squad/resolve/main/plain_text/train- # AI model download original URL https://civitai.com/api/download/models/128713 -# After conversion (add civitai prefix) +# Converted (add civitai prefix) https://xget.xi-xu.me/civitai/api/download/models/128713 -# Model API Original URL +# Model API original URL https://civitai.com/api/v1/models/7240 -# After conversion (add civitai prefix) +# Converted (add civitai prefix) https://xget.xi-xu.me/civitai/api/v1/models/7240 -# Model Version API Original URL +# Model version API original URL https://civitai.com/api/v1/model-versions/128713 -# After conversion (add civitai prefix) +# Converted (add civitai prefix) https://xget.xi-xu.me/civitai/api/v1/model-versions/128713 ``` #### npm ```url -# Original URL of package file +# Package file original URL https://registry.npmjs.org/react/-/react-18.2.0.tgz -# After conversion (add npm prefix) +# Converted (add npm prefix) https://xget.xi-xu.me/npm/react/-/react-18.2.0.tgz # Package metadata original URL https://registry.npmjs.org/lodash -# After conversion (add npm prefix) +# Converted (add npm prefix) https://xget.xi-xu.me/npm/lodash ``` @@ -301,29 +301,29 @@ https://xget.xi-xu.me/npm/lodash # Python package file original URL https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz -# After conversion (add pypi prefix) +# Converted (add pypi prefix) https://xget.xi-xu.me/pypi/packages/source/r/requests/requests-2.31.0.tar.gz # Wheel file original URL https://pypi.org/packages/py3/r/requests/requests-2.31.0-py3-none-any.whl -# After conversion (add pypi prefix) +# Converted (add pypi prefix) https://xget.xi-xu.me/pypi/packages/py3/r/requests/requests-2.31.0-py3-none-any.whl ``` #### conda ```url -# The default channel package file original URL +# Default channel package file original URL https://repo.anaconda.com/pkgs/main/linux-64/numpy-1.24.3-py311h08b1b3b_1.conda -# After conversion (add conda prefix) +# Converted (add conda prefix) https://xget.xi-xu.me/conda/pkgs/main/linux-64/numpy-1.24.3-py311h08b1b3b_1.conda -# Community Channel Metadata Original URL +# Community channel metadata original URL https://conda.anaconda.org/conda-forge/linux-64/repodata.json -# After conversion (add conda/community prefix) +# Converted (add conda/community prefix) https://xget.xi-xu.me/conda/community/conda-forge/linux-64/repodata.json ``` @@ -333,35 +333,35 @@ https://xget.xi-xu.me/conda/community/conda-forge/linux-64/repodata.json # 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 -# After conversion (add maven prefix) +# 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 metadata raw URL +# Maven metadata original URL https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/maven-metadata.xml -# After conversion (add maven prefix) +# Converted (add maven prefix) https://xget.xi-xu.me/maven/maven2/org/apache/commons/commons-lang3/maven-metadata.xml ``` -#### Apache software download +#### Apache Software Download ```url # Apache software download original URL https://downloads.apache.org/kafka/3.6.1/kafka_2.13-3.6.1.tgz -# After conversion (add apache prefix) +# Converted (add apache prefix) https://xget.xi-xu.me/apache/kafka/3.6.1/kafka_2.13-3.6.1.tgz -# Apache Maven Download Original 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 -# After conversion (add apache prefix) +# 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 Download Original URL +# Apache Spark download original URL https://downloads.apache.org/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz -# After conversion (add apache prefix) +# Converted (add apache prefix) https://xget.xi-xu.me/apache/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz ``` @@ -371,35 +371,35 @@ https://xget.xi-xu.me/apache/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz # 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 -# After conversion (add gradle prefix) +# 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 plugin metadata raw 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 -# After conversion (add gradle prefix) +# 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 Formula Repository Original URL +# Homebrew formula repository original URL https://github.com/Homebrew/homebrew-core/raw/HEAD/Formula/g/git.rb -# After conversion (add homebrew prefix) +# Converted (add homebrew prefix) https://xget.xi-xu.me/homebrew/homebrew-core/raw/HEAD/Formula/g/git.rb -# Homebrew API Original URL +# Homebrew API original URL https://formulae.brew.sh/api/formula/git.json -# After conversion (add homebrew/api prefix) +# Converted (add homebrew/api prefix) https://xget.xi-xu.me/homebrew/api/formula/git.json -# Homebrew Bottles Original URL +# Homebrew Bottles original URL https://ghcr.io/v2/homebrew/core/git/manifests/2.39.0 -# After conversion (add homebrew/bottles prefix) +# Converted (add homebrew/bottles prefix) https://xget.xi-xu.me/homebrew/bottles/v2/homebrew/core/git/manifests/2.39.0 ``` @@ -409,13 +409,13 @@ https://xget.xi-xu.me/homebrew/bottles/v2/homebrew/core/git/manifests/2.39.0 # RubyGems package file original URL https://rubygems.org/gems/rails-7.0.4.gem -# After conversion (add rubygems prefix) +# Converted (add rubygems prefix) https://xget.xi-xu.me/rubygems/gems/rails-7.0.4.gem -# RubyGems API Original URL +# RubyGems API original URL https://rubygems.org/api/v1/gems/nokogiri.json -# After conversion (add rubygems prefix) +# Converted (add rubygems prefix) https://xget.xi-xu.me/rubygems/api/v1/gems/nokogiri.json ``` @@ -425,13 +425,13 @@ https://xget.xi-xu.me/rubygems/api/v1/gems/nokogiri.json # CRAN package file original URL https://cran.r-project.org/src/contrib/ggplot2_3.5.2.tar.gz -# After conversion (add cran prefix) +# Converted (add cran prefix) https://xget.xi-xu.me/cran/src/contrib/ggplot2_3.5.2.tar.gz -# CRAN package metadata raw URL +# CRAN package metadata original URL https://cran.r-project.org/web/packages/dplyr/DESCRIPTION -# After conversion (add cran prefix) +# Converted (add cran prefix) https://xget.xi-xu.me/cran/web/packages/dplyr/DESCRIPTION ``` @@ -441,13 +441,13 @@ https://xget.xi-xu.me/cran/web/packages/dplyr/DESCRIPTION # CPAN module original URL https://www.cpan.org/modules/by-module/DBI/DBI-1.643.tar.gz -# After conversion (add cpan prefix) +# Converted (add cpan prefix) https://xget.xi-xu.me/cpan/modules/by-module/DBI/DBI-1.643.tar.gz -# CPAN Author Package Original URL +# CPAN author package original URL https://www.cpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz -# After conversion (add cpan prefix) +# Converted (add cpan prefix) https://xget.xi-xu.me/cpan/authors/id/T/TI/TIMB/DBI-1.643.tar.gz ``` @@ -457,29 +457,29 @@ https://xget.xi-xu.me/cpan/authors/id/T/TI/TIMB/DBI-1.643.tar.gz # CTAN package file original URL https://tug.ctan.org/tex-archive/macros/latex/contrib/beamer.zip -# After conversion (add ctan prefix) +# Converted (add ctan prefix) https://xget.xi-xu.me/ctan/tex-archive/macros/latex/contrib/beamer.zip # CTAN font file original URL https://tug.ctan.org/tex-archive/fonts/cm/pk/ljfour/public/cm/dpi600/cmr10.pk -# After conversion (add ctan prefix) +# Converted (add ctan prefix) https://xget.xi-xu.me/ctan/tex-archive/fonts/cm/pk/ljfour/public/cm/dpi600/cmr10.pk ``` -#### Go module +#### Go Modules ```url # Go module proxy original URL https://proxy.golang.org/github.com/gin-gonic/gin/@v/v1.9.1.zip -# After conversion (add golang prefix) +# Converted (add golang prefix) https://xget.xi-xu.me/golang/github.com/gin-gonic/gin/@v/v1.9.1.zip -# Go module information original URL +# Go module info original URL https://proxy.golang.org/github.com/gorilla/mux/@v/list -# After conversion (add golang prefix) +# Converted (add golang prefix) https://xget.xi-xu.me/golang/github.com/gorilla/mux/@v/list ``` @@ -489,148 +489,148 @@ https://xget.xi-xu.me/golang/github.com/gorilla/mux/@v/list # NuGet package download original URL https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg -# After conversion (add nuget prefix) +# Converted (add nuget prefix) https://xget.xi-xu.me/nuget/v3-flatcontainer/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg -# NuGet package metadata raw URL +# NuGet package metadata original URL https://api.nuget.org/v3/registration5-semver1/microsoft.aspnetcore.app/index.json -# After conversion (add nuget prefix) +# Converted (add nuget prefix) https://xget.xi-xu.me/nuget/v3/registration5-semver1/microsoft.aspnetcore.app/index.json ``` #### Rust Crates ```url -# Crate Download Original URL +# Crate download original URL https://crates.io/api/v1/crates/serde/1.0.0/download -# After conversion (add crates prefix) +# Converted (add crates prefix) https://xget.xi-xu.me/crates/serde/1.0.0/download -# Crate metadata raw URL +# Crate metadata original URL https://crates.io/api/v1/crates/serde -# After conversion (add crates prefix) +# Converted (add crates prefix) https://xget.xi-xu.me/crates/serde -# Crate Search for original URL +# Crate search original URL https://crates.io/api/v1/crates?q=serde -# After conversion (add crates prefix) +# Converted (add crates prefix) https://xget.xi-xu.me/crates/?q=serde ``` #### Packagist ```url -# Packagist package metadata raw URL +# Packagist package metadata original URL https://repo.packagist.org/p2/symfony/console.json -# After conversion (add packagist prefix) +# Converted (add packagist prefix) https://xget.xi-xu.me/packagist/p2/symfony/console.json # Packagist package list original URL https://repo.packagist.org/packages/list.json -# After conversion (add packagist prefix) +# Converted (add packagist prefix) https://xget.xi-xu.me/packagist/packages/list.json ``` -#### Linux Distribution +#### Linux Distributions ```url # Debian package original URL https://deb.debian.org/debian/pool/main/c/curl/curl_7.88.1-10+deb12u4_amd64.deb -# After conversion (add debian prefix) +# Converted (add debian prefix) https://xget.xi-xu.me/debian/debian/pool/main/c/curl/curl_7.88.1-10+deb12u4_amd64.deb # Ubuntu package original URL https://archive.ubuntu.com/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1.9_amd64.deb -# After conversion (add ubuntu prefix) +# Converted (add ubuntu prefix) https://xget.xi-xu.me/ubuntu/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1.9_amd64.deb # 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 -# After conversion (adding fedora prefix) +# 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 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 -# After conversion (add rocky prefix) +# 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 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 -# After conversion (add opensuse prefix) +# 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 package original URL https://geo.mirror.pkgbuild.com/core/os/x86_64/linux-6.6.10.arch1-1-x86_64.pkg.tar.zst -# After conversion (add arch prefix) +# 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 Paper PDF Original URL +# arXiv paper PDF original URL https://arxiv.org/pdf/2301.07041.pdf -# After conversion (add arxiv prefix) +# Converted (add arxiv prefix) https://xget.xi-xu.me/arxiv/pdf/2301.07041.pdf -# arXiv paper source code original URL +# arXiv paper source original URL https://arxiv.org/e-print/2301.07041 -# After conversion (add arxiv prefix) +# Converted (add arxiv prefix) https://xget.xi-xu.me/arxiv/e-print/2301.07041 ``` #### F-Droid ```url -# F-Droid App APK Original URL +# F-Droid app APK original URL https://f-droid.org/repo/org.fdroid.fdroid_1016050.apk -# After conversion (add fdroid prefix) +# Converted (add fdroid prefix) https://xget.xi-xu.me/fdroid/repo/org.fdroid.fdroid_1016050.apk -# F-Droid application metadata raw URL +# F-Droid app metadata original URL https://f-droid.org/api/v1/packages/org.fdroid.fdroid -# After conversion (add fdroid prefix) +# Converted (add fdroid prefix) https://xget.xi-xu.me/fdroid/api/v1/packages/org.fdroid.fdroid ``` -#### Jenkins plugin +#### Jenkins Plugins ```url -# Jenkins Update Center Original URL +# Jenkins update center original URL https://updates.jenkins.io/update-center.json -# After conversion (add jenkins prefix) +# Converted (add jenkins prefix) https://xget.xi-xu.me/jenkins/update-center.json # Jenkins plugin download original URL https://updates.jenkins.io/download/plugins/maven-plugin/3.27/maven-plugin.hpi -# After conversion (add jenkins prefix) +# Converted (add jenkins prefix) https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi ``` #### AI Inference Providers -Xget supports API acceleration for many mainstream AI inference providers, using the `ip/[AI inference provider prefix]` format: +Xget supports API acceleration for many mainstream AI inference providers, using the `ip/[AI Provider Prefix]` format: -| AI Inference Provider | AI Inference Provider Prefix | Original URL Format | Accelerated URL Format | -|-------------|----------|-------------|-------------| +| 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/...` | @@ -661,92 +661,92 @@ 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 original URL https://api.openai.com/v1/chat/completions -# After conversion (add ip/openai prefix) +# Converted (add ip/openai prefix) https://xget.xi-xu.me/ip/openai/v1/chat/completions -# Anthropic API Original URL +# Anthropic API original URL https://api.anthropic.com/v1/messages -# After conversion (add ip/anthropic prefix) +# Converted (add ip/anthropic prefix) https://xget.xi-xu.me/ip/anthropic/v1/messages -# Gemini API Original URL +# Gemini API original URL https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent -# After conversion (add ip/gemini prefix) +# Converted (add ip/gemini prefix) https://xget.xi-xu.me/ip/gemini/v1beta/models/gemini-2.5-flash:generateContent -# HF Inference API Original URL +# HF Inference API original URL https://router.huggingface.co/hf-inference/models/openai/whisper-large-v3 -# After conversion (add ip/huggingface prefix) +# Converted (add ip/huggingface prefix) https://xget.xi-xu.me/ip/huggingface/hf-inference/models/openai/whisper-large-v3 ``` -For application scenarios, see [AI Inference API Acceleration](#ai-inference-api-acceleration). +For use cases, see [AI Inference API Acceleration](#ai-inference-api-acceleration). #### Container Registries -Xget supports multiple container registries, using the `cr/[Container registry prefix]` format: +Xget supports multiple container registries, using the `cr/[Registry Prefix]` format: -| Container Registry | Container Registry Prefix | Original URL Format | Accelerated URL Format | -|----------|------|--------------|--------------| +| Container Registry | Registry Prefix | Original URL Format | Accelerated URL Format | +|-------------------|----------------|---------------------|------------------------| | 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 Elastic Container Registration | `ecr` | `https://public.ecr.aws/...` | `https://xget.xi-xu.me/cr/ecr/...` | +| 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 Registration | `oracle` | `https://container-registry.oracle.com/...` | `https://xget.xi-xu.me/cr/oracle/...` | +| 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 Registration | `digitalocean` | `https://registry.digitalocean.com/...` | `https://xget.xi-xu.me/cr/digitalocean/...` | +| 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 Registration | `heroku` | `https://registry.heroku.com/...` | `https://xget.xi-xu.me/cr/heroku/...` | -| SUSE Registration | `suse` | `https://registry.suse.com/...` | `https://xget.xi-xu.me/cr/suse/...` | -| openSUSE Registration | `opensuse` | `https://registry.opensuse.org/...` | `https://xget.xi-xu.me/cr/opensuse/...` | +| 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 -# GitHub Container Registration Original URL +# GitHub Container Registry original URL https://ghcr.io/v2/nginxinc/nginx-unprivileged/manifests/latest -# After conversion (add cr/ghcr prefix) +# Converted (add cr/ghcr prefix) https://xget.xi-xu.me/cr/ghcr/v2/nginxinc/nginx-unprivileged/manifests/latest -# Google Container Registration Original URL +# Google Container Registry original URL https://gcr.io/v2/distroless/base/manifests/latest -# After conversion (add cr/gcr prefix) +# Converted (add cr/gcr prefix) https://xget.xi-xu.me/cr/gcr/v2/distroless/base/manifests/latest ``` -For application scenarios, see [Container Mirror Acceleration] (#Container Mirror Acceleration). +For use cases, see [Container Image Acceleration](#container-image-acceleration). -## 🎯 Application Scenarios +## 🎯 Use Cases ### Git Operations and Configuration -#### Git Operation +#### Git Operations ```bash -# Clone the repository +# Clone repository git clone https://xget.xi-xu.me/gh/microsoft/vscode.git -# Clone the specified branch +# Clone specific branch git clone -b main https://xget.xi-xu.me/gh/facebook/react.git -# shallow clone (last latest submissions only) +# Shallow clone (latest commit only) git clone --depth 1 https://xget.xi-xu.me/gh/torvalds/linux.git -# Clone the GitLab repository +# Clone GitLab repository git clone https://xget.xi-xu.me/gl/gitlab-org/gitlab.git -# Clone the Git repository +# Clone Gitea repository git clone https://xget.xi-xu.me/gitea/gitea/gitea.git # Clone Codeberg repository @@ -758,20 +758,20 @@ git clone https://xget.xi-xu.me/sf/projects/mingw-w64/code.git # Clone AOSP repository git clone https://xget.xi-xu.me/aosp/platform/frameworks/base.git -# Add a remote repository +# Add remote repository git remote add upstream https://xget.xi-xu.me/gh/[owner]/[repository].git -# Pull update +# Pull updates git pull https://xget.xi-xu.me/gh/microsoft/vscode.git main -# Submodule recursive cloning +# Recursive submodule clone git clone --recursive https://xget.xi-xu.me/gh/[username]/[repository-with-submodules].git ``` -#### Git global acceleration configuration +#### Git Global Acceleration Configuration ```bash -# Configure Git for a specific domain name using 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/" @@ -782,22 +782,22 @@ git config --global url."https://xget.xi-xu.me/aosp/".insteadOf "https://android # Verify configuration git config --global --get-regexp url -# Now all git clones on related platforms will automatically use Xget -git clone https://github.com/microsoft/vscode.git # Automatically converted to an Xget URL -git clone https://gitlab.com/gitlab-org/gitlab.git # Automatically converted to an Xget URL -git clone https://codeberg.org/forgejo/forgejo.git # Automatically converted to an Xget URL -git clone https://android.googlesource.com/platform/frameworks/base.git # Automatically converted to an 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 +### Mainstream Download Tool Integration -#### wget download +#### wget Download ```bash -# Download a single file +# Download single file wget https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip -# Breakpoint continuous transmission +# Resume download wget -c https://xget.xi-xu.me/hf/microsoft/DialoGPT-large/resolve/main/pytorch_model.bin # Batch download @@ -813,21 +813,21 @@ 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 up user agent +# 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 Multi-threaded Download ```bash -# Download large files from multiple threads +# 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 -# Breakpoint continuous transmission +# Resume download aria2c -c https://xget.xi-xu.me/gh/microsoft/vscode/archive/refs/heads/main.zip -# Download configuration files in batches -aria2c -i download-list.txt # file containing multiple Xget URLs +# Batch download configuration file +aria2c -i download-list.txt # File containing multiple Xget URLs ``` ### Hugging Face Mirror @@ -836,22 +836,22 @@ aria2c -i download-list.txt # file containing multiple Xget URLs import os from transformers import AutoTokenizer, AutoModelForCausalLM -# Set environment variables so that the transformers library automatically uses Xget images +# Set environment variable to make transformers library automatically use Xget mirror os.environ['HF_ENDPOINT'] = 'https://xget.xi-xu.me/hf' -# Define the model name +# Define model name model_name = 'microsoft/DialoGPT-medium' print(f"Downloading model from mirror: {model_name}") -# Use AutoModelForCausalLM to load conversation generation models -# Since the environment variable is set above, no additional parameters need to be added here +# 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("Model and tokenizer loaded successfully!") -# You can now use tokenizer and 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) @@ -863,19 +863,19 @@ print("Model and tokenizer loaded successfully!") ```python import requests -# Setting up API Basic URL Use 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): - """Fetch Civitai model metadata""" + """Get Civitai model information""" url = f"{base_url}/api/v1/models/{model_id}" response = requests.get(url) return response.json() -# Download the model +# Download model def download_model(model_version_id, output_path): - """Download the Civitai model file""" + """Download Civitai model file""" download_url = f"{base_url}/api/download/models/{model_version_id}" print(f"Downloading model version {model_version_id}...") @@ -887,41 +887,41 @@ def download_model(model_version_id, output_path): for chunk in response.iter_content(chunk_size=8192): f.write(chunk) - print(f"Model saved to: {output_path}") + print(f"Model downloaded to: {output_path}") -# Example of usage +# Usage example model_id = 7240 # Example model ID model_info = get_model_info(model_id) print(f"Model name: {model_info['name']}") -# Download the first model version +# 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 management acceleration +### npm Package Acceleration -#### Configure npm using Xget mirroring +#### Configure npm to Use Xget Mirror ```bash -# Temporary use of Xget mirrors +# Temporarily use Xget mirror npm install --registry https://xget.xi-xu.me/npm/ -# Global configuration npm mirroring +# Globally configure npm mirror npm config set registry https://xget.xi-xu.me/npm/ # Verify configuration npm config get registry ``` -#### Use in the project +#### Use in Project ```bash -# Configure project-level mirroring in .npmrc file +# Configure project-level mirror in .npmrc file echo "registry=https://xget.xi-xu.me/npm/" > .npmrc -# Installation dependencies +# Install dependencies npm install # Or use yarn @@ -929,15 +929,15 @@ yarn config set registry https://xget.xi-xu.me/npm/ yarn install ``` -### Python package management acceleration +### Python Package Acceleration -#### Configure pip using Xget mirroring +#### Configure pip to Use Xget Mirror ```bash -# Temporary use of Xget mirrors +# Temporarily use Xget mirror pip install requests -i https://xget.xi-xu.me/pypi/simple/ -# Global configuration pip mirroring +# 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 @@ -945,10 +945,10 @@ pip config set global.trusted-host xget.xi-xu.me pip config list ``` -#### Use in the project +#### Use in Project ```bash -# Create a pip.conf file (Linux/macOS) +# Create pip.conf file (Linux/macOS) mkdir -p ~/.pip cat > ~/.pip/pip.conf << EOF [global] @@ -956,18 +956,18 @@ index-url = https://xget.xi-xu.me/pypi/simple/ trusted-host = xget.xi-xu.me EOF -# Or create pip.conf in the project root directory +# 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 files +# Install using configuration file pip install -r requirements.txt --config-file pip.conf ``` -#### Specify the image in requirements.txt +#### Specify Mirror in requirements.txt ```txt # requirements.txt @@ -980,17 +980,17 @@ pandas>=1.3.0 matplotlib>=3.4.0 ``` -### conda package management acceleration +### conda Package Acceleration -#### Configure conda using Xget mirroring +#### Configure conda to Use Xget Mirror ```bash -# Configure the default channel mirroring +# 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 images (recommended) +# Configure all community channel mirrors (recommended) conda config --set channel_alias https://xget.xi-xu.me/conda/community # Or configure specific community channels @@ -1006,7 +1006,7 @@ conda config --show #### Configure in .condarc -The .condarc file can be placed in the user's home directory (`~/.condarc`) or in the project root directory: +The .condarc file can be placed in the user home directory (`~/.condarc`) or project root directory: ```yaml default_channels: @@ -1018,9 +1018,9 @@ channel_priority: strict show_channel_urls: true ``` -#### Use environment files +#### Use Environment File -The complete image URL can be directly specified in the environment file: +The environment file can directly specify complete mirror URLs: ```yaml # environment.yml @@ -1042,19 +1042,19 @@ dependencies: ``` ```bash -# Create an environment using environment files +# Create environment using environment file conda env create -f environment.yml -# Update the environment +# Update environment conda env update -f environment.yml ``` -### Maven package management acceleration +### Maven Package Acceleration -#### Configure Maven to use Xget mirroring +#### Configure Maven to Use Xget Mirror ```xml - + @@ -1067,10 +1067,10 @@ conda env update -f environment.yml ``` -#### Use in the project +#### Use in Project ```xml - + @@ -1091,17 +1091,17 @@ conda env update -f environment.yml ``` ```bash -# Specify the image using the command line +# Specify mirror using command line mvn clean install -Dmaven.repo.remote=https://xget.xi-xu.me/maven/maven2 -# Download specific dependencies +# 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 Software Download Acceleration -#### Download Apache software using Xget +#### Download Apache Software Using Xget ```bash # Download Apache Kafka @@ -1120,7 +1120,7 @@ wget https://xget.xi-xu.me/apache/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz curl -L -O https://xget.xi-xu.me/apache/flink/flink-1.18.1/flink-1.18.1-bin-scala_2.12.tgz ``` -#### Commonly used Apache software download +#### Common Apache Software Downloads ```bash # Big data related @@ -1128,21 +1128,21 @@ 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 Server +# 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 +# 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 management acceleration +### Gradle Package Acceleration -#### Configure Gradle to use Xget mirroring +#### Configure Gradle to Use Xget Mirror ```gradle -// Configure Gradle Image in build.gradle +// Configure Gradle mirror in build.gradle repositories { maven { url 'https://xget.xi-xu.me/maven/maven2' @@ -1152,7 +1152,7 @@ repositories { } } -// Configure plug-in repository +// Configure plugin repositories pluginManagement { repositories { maven { @@ -1166,7 +1166,7 @@ pluginManagement { #### Global Configuration ```gradle -// Configure global mirroring in ~/.gradle/init.gradle +// Configure global mirror in ~/.gradle/init.gradle allprojects { repositories { maven { @@ -1188,19 +1188,19 @@ settingsEvaluated { settings -> ``` ```bash -# Specify the image using the command line +# 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 Management Acceleration +### Homebrew Package Acceleration -#### Configure Homebrew to use Xget mirroring +#### Configure Homebrew to Use Xget Mirror ```bash -# Setting up Homebrew environment variables using Xget mirror +# 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" @@ -1210,39 +1210,39 @@ export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles" brew update ``` -#### Long-term configuration +#### Long-term Configuration ```bash -# Add to ~/.bash_profile for bash users +# 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 -# Add to ~/.zprofile for zsh users +# 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 the project +#### Use in Project ```bash -# Install the software package +# Install packages brew install git -# Search for packages +# Search packages brew search python -# Update the package +# Update packages brew upgrade # View installed packages brew list ``` -#### Verify the mirror configuration +#### Verify Mirror Configuration ```bash # Check Homebrew configuration @@ -1253,15 +1253,15 @@ echo $HOMEBREW_API_DOMAIN echo $HOMEBREW_BOTTLE_DOMAIN ``` -### Ruby package management acceleration +### Ruby Package Acceleration -#### Configure RubyGems to use Xget mirroring +#### Configure RubyGems to Use Xget Mirror ```bash -# Temporary use of Xget mirrors +# Temporarily use Xget mirror gem install rails --source https://xget.xi-xu.me/rubygems/ -# Global configuration RubyGems mirroring +# Globally configure RubyGems mirror gem sources --add https://xget.xi-xu.me/rubygems/ gem sources --remove https://rubygems.org/ @@ -1269,10 +1269,10 @@ gem sources --remove https://rubygems.org/ gem sources -l ``` -#### Use in the project +#### Use in Project ```ruby -# Configure project-level mirroring in Gemfile +# Configure project-level mirror in Gemfile source 'https://xget.xi-xu.me/rubygems/' gem 'rails', '~> 7.0.0' @@ -1286,15 +1286,15 @@ bundle config mirror.https://rubygems.org https://xget.xi-xu.me/rubygems/ bundle install ``` -### R package management acceleration +### R Package Acceleration -#### Configure R Using Xget CRAN Mirror +#### Configure R to Use Xget CRAN Mirror ```r -# Temporarily use Xget CRAN image in R +# Temporarily use Xget CRAN mirror in R install.packages("ggplot2", repos = "https://xget.xi-xu.me/cran/") -# Global configuration CRAN image +# Globally configure CRAN mirror options(repos = c(CRAN = "https://xget.xi-xu.me/cran/")) # Verify configuration @@ -1304,7 +1304,7 @@ getOption("repos") #### Configure in .Rprofile ```r -# Configure global mirroring in the .Rprofile file in the user's home directory +# 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", @@ -1312,29 +1312,29 @@ options(repos = c( BioCexp = "https://bioconductor.org/packages/release/data/experiment" )) -# Set up download method +# Set download method options(download.file.method = "libcurl") ``` -#### Use in the project +#### Use in Project ```r -# Specify the image in the project's renv.lock or script +# Specify mirror in project's renv.lock or script renv::init() renv::settings$repos.override(c(CRAN = "https://xget.xi-xu.me/cran/")) -# Installation package +# Install packages install.packages(c("dplyr", "ggplot2", "tidyr")) -# Or use the pak package manager +# Or use pak package manager pak::pkg_install("tidyverse", repos = "https://xget.xi-xu.me/cran/") ``` ```bash -# Install packages using R scripts on the command line +# Install packages using R script in command line Rscript -e "options(repos = c(CRAN = 'https://xget.xi-xu.me/cran/')); install.packages('ggplot2')" -# Bulk installation package +# Batch install packages Rscript -e " options(repos = c(CRAN = 'https://xget.xi-xu.me/cran/')) packages <- c('dplyr', 'ggplot2', 'tidyr', 'readr') @@ -1342,27 +1342,27 @@ install.packages(packages) " ``` -### Perl package management acceleration +### Perl Package Acceleration -#### Configure CPAN to use Xget mirroring +#### Configure CPAN to Use Xget Mirror ```bash -# Configure CPAN to use Xget mirroring +# Configure CPAN to use Xget mirror cpan o conf urllist push https://xget.xi-xu.me/cpan/ cpan o conf commit -# Or directly edit the configuration file ~/.cpan/CPAN/MyConfig.pm -# Add to: +# Or directly edit configuration file ~/.cpan/CPAN/MyConfig.pm +# Add: # 'urllist' => [q[https://xget.xi-xu.me/cpan/]], ``` -#### Use cpanm to install modules +#### Use cpanm to Install Modules ```bash -# Install cpanm (if not) +# Install cpanm (if not available) curl -L https://cpanmin.us | perl - --sudo App::cpanminus -# Install the module using Xget mirror +# Install modules using Xget mirror cpanm --mirror https://xget.xi-xu.me/cpan/ DBI cpanm --mirror https://xget.xi-xu.me/cpan/ Mojolicious @@ -1370,7 +1370,7 @@ cpanm --mirror https://xget.xi-xu.me/cpan/ Mojolicious cpanm --mirror https://xget.xi-xu.me/cpan/ --installdeps . ``` -#### Use in the project +#### Use in Project ```perl # List dependencies in cpanfile @@ -1378,44 +1378,44 @@ requires 'DBI'; requires 'Mojolicious'; requires 'JSON'; -# Then use Xget mirror to install +# Then install using Xget mirror cpanm --mirror https://xget.xi-xu.me/cpan/ --installdeps . ``` -### TeX/LaTeX Package Management Acceleration +### TeX/LaTeX Package Acceleration -#### Configure TeX Live with Xget CTAN mirroring +#### Configure TeX Live to Use Xget CTAN Mirror ```bash -# Configure tlmgr to use Xget CTAN mirroring +# 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 -# Installation package +# Install packages tlmgr install beamer tlmgr install tikz ``` -#### Configuring MiKTeX to use Xget mirroring +#### Configure MiKTeX to Use Xget Mirror ```bash -# Windows MiKTeX Configuration +# Windows MiKTeX configuration mpm --set-repository=https://xget.xi-xu.me/ctan/systems/win32/miktex # Update package database mpm --update-db -# Installation package +# Install packages mpm --install=beamer mpm --install=pgf ``` -#### Use in the project +#### Use in Project ```bash -# LaTeX document automatically installs missing packages when compiling +# Automatically install missing packages during LaTeX document compilation pdflatex --shell-escape document.tex # Or manually install specific packages @@ -1424,16 +1424,16 @@ tlmgr install subcaption tlmgr install algorithm2e ``` -### Go module acceleration +### Go Module Acceleration -#### Configure Go to use Xget proxy +#### Configure Go to Use Xget Proxy ```bash -# Configure Go module agent +# Configure Go module proxy export GOPROXY=https://xget.xi-xu.me/golang,direct export GOSUMDB=off -# Or permanent configuration +# Or permanently configure go env -w GOPROXY=https://xget.xi-xu.me/golang,direct go env -w GOSUMDB=off @@ -1441,7 +1441,7 @@ go env -w GOSUMDB=off go env GOPROXY ``` -#### Use in the project +#### Use in Project ```bash # Download dependencies @@ -1450,13 +1450,13 @@ go mod download # Update dependencies go get -u ./... -# Clean the module cache +# Clean module cache go clean -modcache ``` -### NuGet Package Management Acceleration +### NuGet Package Acceleration -#### Configure NuGet to use Xget mirroring +#### Configure NuGet to Use Xget Mirror ```bash # Add Xget package source @@ -1465,7 +1465,7 @@ dotnet nuget add source https://xget.xi-xu.me/nuget/v3/index.json -n xget # List package sources dotnet nuget list source -# Use in a project +# Use in project dotnet restore --source https://xget.xi-xu.me/nuget/v3/index.json ``` @@ -1481,12 +1481,12 @@ dotnet restore --source https://xget.xi-xu.me/nuget/v3/index.json ``` -### Rust package management acceleration +### Rust Package Acceleration -#### Configure Cargo using Xget mirroring +#### Configure Cargo to Use Xget Mirror ```bash -# Configure Cargo to use Xget image (in ~/.cargo/config.toml) +# Configure Cargo to use Xget mirror (in ~/.cargo/config.toml) mkdir -p ~/.cargo cat >> ~/.cargo/config.toml << EOF [source.crates-io] @@ -1500,10 +1500,10 @@ EOF cargo search serde ``` -#### Use in the project +#### Use in Project ```toml -# Dependencies can be used normally in Cargo.toml +# Can use dependencies normally in Cargo.toml [dependencies] serde = "1.0" tokio = "1.0" @@ -1517,16 +1517,16 @@ cargo build # Update dependencies cargo update -# Add new dependencies +# Add new dependency cargo add clap ``` -### PHP package management acceleration +### PHP Package Acceleration -#### Configure Composer to use Xget mirroring +#### Configure Composer to Use Xget Mirror ```bash -# Global configuration Composer image +# Globally configure Composer mirror composer config -g repo.packagist composer https://xget.xi-xu.me/packagist/ # Project-level configuration @@ -1553,19 +1553,19 @@ composer config -l } ``` -### Linux distribution acceleration +### Linux Distribution Acceleration -#### Debian/Ubuntu APT configuration +#### Debian/Ubuntu APT Configuration ```bash -# Back up the original source list +# Backup original source list sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup -# Configure Debian Image +# 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 -# Configure Ubuntu mirroring +# 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 @@ -1576,7 +1576,7 @@ sudo apt update #### Fedora DNF Configuration ```bash -# Configure Fedora Image +# 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 @@ -1584,10 +1584,10 @@ sudo sed -i 's|^#baseurl=http://download.example/pub/fedora/linux|baseurl=https: sudo dnf makecache ``` -#### Rocky Linux DNF configuration +#### Rocky Linux DNF Configuration ```bash -# Configure Rocky Linux Image +# 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 @@ -1595,18 +1595,18 @@ sudo sed -i 's|^#baseurl=http://dl.rockylinux.org|baseurl=https://xget.xi-xu.me/ sudo dnf makecache ``` -#### openSUSE Zypper configuration +#### openSUSE Zypper Configuration ```bash -# Configure openSUSE Leap image +# 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 -# Configure openSUSE Tumbleweed image +# 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 the software source +# Refresh software sources sudo zypper refresh # Verify configuration @@ -1616,10 +1616,10 @@ sudo zypper lr -u #### Arch Linux Pacman Configuration ```bash -# Back up the original image list +# Backup original mirror list sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup -# Configure Arch Linux Mirroring +# Configure Arch Linux mirror echo 'Server = https://xget.xi-xu.me/arch/$repo/os/$arch' | sudo tee /etc/pacman.d/mirrorlist # Update package database @@ -1628,25 +1628,25 @@ sudo pacman -Sy ### Academic Resource Acceleration -#### arXiv paper download +#### arXiv Paper Download ```bash # Download arXiv paper PDF wget https://xget.xi-xu.me/arxiv/pdf/2301.07041.pdf -# Download the paper source code +# Download paper source curl -L -O https://xget.xi-xu.me/arxiv/e-print/2301.07041 -# Download multiple papers in batches +# 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 +#### Use in Academic Tools ```python -# Accelerate downloads with arXiv in Python +# Use arXiv accelerated download in Python import requests def download_arxiv_paper(arxiv_id, output_path): @@ -1660,55 +1660,55 @@ def download_arxiv_paper(arxiv_id, output_path): else: print(f"Failed to download {arxiv_id}") -# Download the paper +# Download paper download_arxiv_paper("2301.07041", "attention_is_all_you_need.pdf") ``` ### F-Droid Repository Mirror -#### Configure the F-Droid Client to Use the Xget Mirror +#### Configure F-Droid Client to Use Xget Mirror -1. Enter **Settings** in the F-Droid app → **Repository** -2. Click **+** and enter the repository URL: `https://xget.xi-xu.me/fdroid/repo` -3. Click **Add** and then click **Add mirror** +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** #### Supported F-Droid Services ```url -# F-Droid App APK Download -https://xget.xi-xu.me/fdroid/repo/[package-name]_[version].apk +# F-Droid app APK download +https://xget.xi-xu.me/fdroid/repo/[package-name]_[version-code].apk # F-Droid repository index https://xget.xi-xu.me/fdroid/repo/index-v1.jar -# F-Droid app icon -https://xget.xi-xu.me/fdroid/repo/icons-640/[package-name].[version].png +# F-Droid app icons +https://xget.xi-xu.me/fdroid/repo/icons-640/[package-name].[version-code].png -# F-Droid API Interface +# F-Droid API endpoints https://xget.xi-xu.me/fdroid/api/v1/packages/[package-name] ``` -#### Example Usage +#### Usage Examples ```bash -# Download the F-Droid Client APK directly +# Directly download F-Droid client APK wget https://xget.xi-xu.me/fdroid/repo/org.fdroid.fdroid_1016050.apk -# Download other open source applications +# Download other open source apps curl -L -O https://xget.xi-xu.me/fdroid/repo/org.mozilla.fennec_fdroid_1014000.apk -# Get application information +# Get app information curl https://xget.xi-xu.me/fdroid/api/v1/packages/org.fdroid.fdroid ``` -#### Batch Application Management +#### Batch App Management ```bash -# Create an application download script +# Create app download script cat > download_fdroid_apps.sh << 'EOF' -# !/bin/bash +#!/bin/bash -# Define the list of applications to download +# Define list of apps to download apps=( "org.fdroid.fdroid_1016050.apk" "org.mozilla.fennec_fdroid_1014000.apk" @@ -1716,16 +1716,16 @@ apps=( "org.videolan.vlc_13050399.apk" ) -# Create a download directory +# Create download directory mkdir -p fdroid_apps -# Download the application in batches +# Batch download apps for app in "${apps[@]}"; do echo "Downloading: $app" wget -P fdroid_apps "https://xget.xi-xu.me/fdroid/repo/$app" done -echo "All applications downloaded!" +echo "All apps downloaded!" EOF chmod +x download_fdroid_apps.sh @@ -1734,10 +1734,10 @@ chmod +x download_fdroid_apps.sh #### Developer Integration -For Android developers, you can integrate F-Droid images in build scripts: +For Android developers, F-Droid mirror can be integrated into build scripts: ```gradle -// Configure F-Droid dependency checking in build.gradle +// Configure F-Droid dependency check in build.gradle task checkFDroidAvailability { doLast { def fdroidUrl = "https://xget.xi-xu.me/fdroid/api/v1/packages/${project.name}" @@ -1746,10 +1746,10 @@ task checkFDroidAvailability { connection.requestMethod = 'GET' def responseCode = connection.responseCode if (responseCode == 200) { - println("App available on F-Droid: $fdroidUrl") + println "App available on F-Droid: $fdroidUrl" } } catch (Exception e) { - println("Failed to check F-Droid availability: ${e.message}") + println "Error checking F-Droid availability: ${e.message}" } } } @@ -1757,53 +1757,53 @@ task checkFDroidAvailability { ### Jenkins Plugin Download -#### Accelerate Jenkins Plugin Downloads and Updates with Xget +#### Use Xget to Accelerate Jenkins Plugin Download and Update -Supports Jenkins update center and plug-in downloads, and is compatible with the configuration methods of domestic mirror sources such as Tsinghua mirroring. +Supports Jenkins update center and plugin downloads, compatible with configuration methods of domestic mirrors like Tsinghua mirror. #### Jenkins Update Center Configuration -##### Method 1: Configure in the Jenkins Web Interface +##### Method 1: Configure in Jenkins Web Interface -1. Log in to the Jenkins Management Interface -2. Enter **Manage Jenkins** → **Plugins** → **Advanced** +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 the configuration +4. Click **Submit** to save configuration -##### Method 2: Modify the Configuration File +##### Method 2: Modify Configuration File ```bash -# Modify update center configuration files on Jenkins server +# 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 -# Change the URL to: +# Change URL to: # https://xget.xi-xu.me/jenkins/update-center.json -# Restart Jenkins Service +# Restart Jenkins service sudo systemctl restart jenkins ``` #### Supported Jenkins Services ```url -# Jenkins Update Center JSON +# Jenkins update center JSON https://xget.xi-xu.me/jenkins/update-center.json -# Jenkins Update Center (actual JSON format) +# Jenkins update center (actual JSON format) 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 -# Experimental Plugin Update Center +# Experimental plugin update center https://xget.xi-xu.me/jenkins/experimental/update-center.json ``` -#### Example Usage +#### Usage Examples ```bash -# Download the Maven plugin +# Download Maven plugin wget https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi # Download Git plugin @@ -1812,11 +1812,11 @@ 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 of commonly used plug-ins +# Batch download common plugins cat > download_jenkins_plugins.sh << 'EOF' -# !/bin/bash +#!/bin/bash -# Define a list of plugins to download +# Define list of plugins to download plugins=( "git:5.2.1" "maven-plugin:3.27" @@ -1825,10 +1825,10 @@ plugins=( "docker-workflow:563.vd5d2e5c4007f" ) -# Create a plug-in download directory +# Create plugin download directory mkdir -p jenkins_plugins -# Batch download plug-in +# Batch download plugins for plugin in "${plugins[@]}"; do name=$(echo $plugin | cut -d: -f1) version=$(echo $plugin | cut -d: -f2) @@ -1845,24 +1845,24 @@ chmod +x download_jenkins_plugins.sh #### Offline Jenkins Deployment -For Jenkins deployments without network environments: +For Jenkins deployment in offline environments: ```bash -# 1. Download the Jenkins core file +# 1. Download Jenkins core file wget https://xget.xi-xu.me/jenkins/war/jenkins.war -# 2. Create plug-in packaging scripts +# 2. Create plugin packaging script cat > prepare_jenkins_offline.sh << 'EOF' -# !/bin/bash +#!/bin/bash -# Create an offline deployment directory structure +# Create offline deployment directory structure mkdir -p jenkins_offline/{plugins,update_center} -# Download Update Center Configuration +# Download update center configuration curl -o jenkins_offline/update_center/update-center.json \ https://xget.xi-xu.me/jenkins/update-center.json -# List of essential plugins +# Essential plugins list essential_plugins=( "ant:475.vf34069fef73c" "build-timeout:1.31" @@ -1882,7 +1882,7 @@ essential_plugins=( "ws-cleanup:0.45" ) -# Download all the essential plugins +# Download all essential plugins for plugin in "${essential_plugins[@]}"; do name=$(echo $plugin | cut -d: -f1) version=$(echo $plugin | cut -d: -f2) @@ -1891,26 +1891,26 @@ for plugin in "${essential_plugins[@]}"; do "https://xget.xi-xu.me/jenkins/download/plugins/$name/$version/$name.hpi" done -# Creation deployment instructions +# Create deployment instructions cat > jenkins_offline/deploy_instructions.md << 'DEPLOY' # Jenkins Offline Deployment Instructions -1. Copy jenkins.war to the target server +1. Copy jenkins.war to target server 2. Start Jenkins: java -jar jenkins.war -3. Copy the .hpi files in the plugins/ directory to $JENKINS_HOME/plugins/ +3. Copy .hpi files from plugins/ directory to $JENKINS_HOME/plugins/ 4. Restart Jenkins DEPLOY -echo "Offline deployment bundle ready!" +echo "Offline deployment package prepared!" EOF chmod +x prepare_jenkins_offline.sh ./prepare_jenkins_offline.sh ``` -#### Use in the project +#### Use in Project -##### Plugin Checks in Jenkinsfile +##### Plugin Check in Jenkinsfile ```groovy pipeline { @@ -1929,7 +1929,7 @@ pipeline { echo "Maven plugin available: ${pluginUrl}" } } catch (Exception e) { - error "Maven plugin unavailable: ${e.message}" + error "Maven plugin not available: ${e.message}" } } } @@ -1952,13 +1952,13 @@ pipeline { ```python import openai -# OpenAI API using Xget +# Use Xget's OpenAI API client = openai.OpenAI( api_key="your-api-key", base_url="https://xget.xi-xu.me/ip/openai/v1" # Use Xget ) -# Chat completed +# Chat completion response = client.chat.completions.create( model="gpt-4", messages=[ @@ -1974,13 +1974,13 @@ print(response.choices[0].message.content) ```python import anthropic -# Anthropic API using Xget +# Use Xget's Anthropic API client = anthropic.Anthropic( api_key="your-api-key", base_url="https://xget.xi-xu.me/ip/anthropic" # Use Xget ) -# Create a message +# Create message message = client.messages.create( model="claude-3-sonnet-20240229", max_tokens=1000, @@ -1997,10 +1997,10 @@ print(message.content) ```python import google.generativeai as genai -# Configure API keys +# Configure API key genai.configure(api_key="your-api-key") -# Using custom transfer configuration Xget +# Use custom transport to configure Xget import requests class XgetTransport: @@ -2008,20 +2008,20 @@ class XgetTransport: self.base_url = base_url def request(self, method, url, **kwargs): - # Forward the request to Xget + # Forward request to Xget accelerated_url = url.replace("https://generativelanguage.googleapis.com", "https://xget.xi-xu.me/ip/gemini") return requests.request(method, accelerated_url, **kwargs) -# Create a model instance +# Create model instance model = genai.GenerativeModel('gemini-pro') # Generate content -response = model.generate_content("Write a short introduction to artificial intelligence") +response = model.generate_content("Write a brief introduction about artificial intelligence") print(response.text) ``` -#### Multi-provider unified interface +#### Multi-Provider Unified Interface ```python import requests @@ -2029,20 +2029,20 @@ import json def call_ai_api(provider, endpoint, data, api_key): """ - Unified AI API helper that supports multiple providers + Unified AI API calling function, supports multiple providers """ headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } - # Acceleration URL with Xget + # Use Xget's accelerated URL url = f"https://xget.xi-xu.me/ip/{provider}/{endpoint}" response = requests.post(url, headers=headers, json=data) return response.json() -# Example of usage +# Usage example providers = { "openai": { "endpoint": "v1/chat/completions", @@ -2069,7 +2069,7 @@ providers = { } } -# Looping calls to different providers +# Loop through different providers for provider, config in providers.items(): try: result = call_ai_api( @@ -2086,7 +2086,7 @@ for provider, config in providers.items(): #### Use in JavaScript/Node.js ```javascript -// OpenAI API Acceleration +// OpenAI API acceleration import OpenAI from 'openai'; const openai = new OpenAI({ @@ -2122,7 +2122,7 @@ async function chatWithClaude() { } ``` -#### Environment variable configuration +#### Environment Variable Configuration ```bash # Configure in .env file @@ -2134,25 +2134,25 @@ MISTRAL_AI_BASE_URL=https://xget.xi-xu.me/ip/mistralai GROQ_BASE_URL=https://xget.xi-xu.me/ip/groq ``` -Then use in the code: +Then use in code: ```python import os from openai import OpenAI -# Read configuration from environment variable +# Read configuration from environment variables client = OpenAI( api_key=os.getenv("OPENAI_API_KEY"), - base_url=os.getenv("OPENAI_BASE_URL") # Automatically use Xget + base_url=os.getenv("OPENAI_BASE_URL") # Automatically uses Xget ) ``` ### Container Image Acceleration -#### Docker configuration +#### Docker Configuration ```bash -# Configure Docker to use Xget mirror acceleration +# Configure Docker to use Xget image acceleration # Edit /etc/docker/daemon.json (Linux) or ~/.docker/daemon.json (macOS/Windows) { "registry-mirrors": [ @@ -2162,7 +2162,7 @@ client = OpenAI( # Restart Docker service sudo systemctl restart docker # Linux -# Or restart the service in Docker Desktop +# Or restart service in Docker Desktop # Verify configuration docker info | grep -A 10 "Registry Mirrors" @@ -2171,20 +2171,20 @@ docker info | grep -A 10 "Registry Mirrors" #### Pull Images Directly ```bash -# Pull the GitHub container registry image +# Pull GitHub Container Registry images docker pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest -# Pull Google Container Registry Image +# Pull Google Container Registry images docker pull xget.xi-xu.me/cr/gcr/distroless/base:latest -# Pull the Microsoft Container Registry Image +# Pull Microsoft Container Registry images docker pull xget.xi-xu.me/cr/mcr/dotnet/runtime:8.0 ``` -#### Kubernetes deployment configuration +#### Kubernetes Deployment Configuration ```yaml -# deployment.yaml - Mirror using Xget +# deployment.yaml - Use Xget's images apiVersion: apps/v1 kind: Deployment metadata: @@ -2213,7 +2213,7 @@ spec: #### Docker Compose Configuration ```yaml -# docker-compose.yml - Accelerate image using Xget +# docker-compose.yml - Use Xget accelerated images version: '3.8' services: web: @@ -2240,10 +2240,10 @@ volumes: mssql_data: ``` -#### Dockerfile optimization +#### Dockerfile Optimization ```dockerfile -# Use Xget to accelerate basic images in Dockerfile +# Use Xget accelerated base images in Dockerfile FROM xget.xi-xu.me/cr/ghcr/nodejs/node:18-alpine AS builder WORKDIR /app @@ -2257,7 +2257,7 @@ RUN npm run build FROM xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest COPY --from=builder /app/dist /usr/share/nginx/html -# .NET image using Microsoft Container Registry +# 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 . @@ -2267,7 +2267,7 @@ ENTRYPOINT ["dotnet", "MyApp.dll"] #### CI/CD Integration ```yaml -# GitHub Actions - Accelerate container building with Xget +# GitHub Actions - Use Xget to accelerate container builds name: Build and Deploy on: [push] @@ -2279,13 +2279,13 @@ jobs: - name: Build with accelerated base images run: | - # Use Xget's basic image when building + # 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. + --build-arg BASE_IMAGE=xget.xi-xu.me/cr/ghcr/nodejs/node:18-alpine . - name: Test with accelerated images run: | - # Testing with accelerated image + # Test using accelerated images docker run --rm \ xget.xi-xu.me/cr/mcr/dotnet/runtime:8.0 \ dotnet --version @@ -2294,13 +2294,13 @@ jobs: #### Podman Configuration ```bash -# Configure Podman to use Xget mirror acceleration +# 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 it directly +# 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 ``` @@ -2308,7 +2308,7 @@ podman pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest #### containerd Configuration ```toml -# Configure containerd using Xget +# 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"] @@ -2324,23 +2324,12 @@ sudo systemctl restart containerd ## 🚀 Deployment -### Cloudflare Workers - -[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/xixu-me/Xget) - -**Xget is designed and optimized for Cloudflare Workers to deliver the best performance and experience: - -- **💰 Cost Advantage**: In most cases, it is free in addition to the fee of registering a domain name. -- **🚀 Highest performance**: Global edge nodes, fastest response speed -- **🔧 Simple maintenance**: No server management required, automatic expansion and update -- **🛡️ Safe and reliable**: Built-in DDoS protection and security features - -#### Deployment Steps +### Deployment Steps 1. **Fork this repository**: Click the Fork button in the upper right corner of the GitHub page -2. **Get Cloudflare Credentials**: +2. **Get Cloudflare credentials**: - Visit [Cloudflare Dashboard](https://dash.cloudflare.com/) → My Profile → API Tokens - Create an API Token with "Edit Cloudflare Workers" permission - Note your Account ID (visible on the right side of the Workers page) @@ -2351,64 +2340,64 @@ sudo systemctl restart containerd - `CLOUDFLARE_API_TOKEN`: Your API Token - `CLOUDFLARE_ACCOUNT_ID`: Your Account ID -4. **Trigger Deployment**: +4. **Trigger deployment**: - Pushing code to the `main` branch will automatically trigger deployment - - Changes only to documentation files (`.md`), `LICENSE`, `.gitignore`, etc. won't trigger deployment - - You can also manually trigger deployment from the GitHub Actions page + - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment + - You can also manually trigger deployment in the GitHub Actions page -5. **Bind custom domain name** (optional): - Bind your custom domain name in the Cloudflare Workers console +5. **Bind custom domain** (optional): + Bind your custom domain in the Cloudflare Workers console -Once the deployment is complete, your Xget service will be available at the following address: +After deployment completes, your Xget service will be available at: -- Worker domain name: `your-worker-name.your-subdomain.workers.dev` -- Custom domain name: `your-domain.com` (if bound) +- Worker domain: `your-worker-name.your-subdomain.workers.dev` +- Custom domain: `your-domain.com` (if bound) -#### Environment variable configuration +### Environment Variable Configuration -You can set the following environment variables in the Cloudflare Workers console to customize the configuration: +You can set the following environment variables in the Cloudflare Workers console to customize configuration: -- `TIMEOUT_SECONDS`: Request timeout time (default: 30) -- `MAX_RETRIES`: Maximum number of retries (default: 3) +- `TIMEOUT_SECONDS`: Request timeout (default: 30) +- `MAX_RETRIES`: Maximum retry count (default: 3) - `RETRY_DELAY_MS`: Retry delay time (default: 1000) -- `CACHE_DURATION`: cache duration (default: 1800) -- `ALLOWED_METHODS`: Allowed HTTP methods (default: GET, HEAD) -- `ALLOWED_ORIGINS`: Allowed CORS source (default: *) +- `CACHE_DURATION`: Cache duration (default: 1800) +- `ALLOWED_METHODS`: Allowed HTTP methods (default: GET,HEAD) +- `ALLOWED_ORIGINS`: Allowed CORS origins (default: *) - `MAX_PATH_LENGTH`: Maximum path length (default: 2048) ## 🔧 Configuration ### Configuration Parameters -You can customize the configuration by modifying `src/config/index.js`: +You can customize configuration by modifying `src/config/index.js`: ```javascript export const CONFIG = { TIMEOUT_SECONDS: 30, // Request timeout (seconds) - MAX_RETRIES: 3, // Maximum number of retries - RETRY_DELAY_MS: 1000, // Retry delay (ms) + 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"], // Allowed HTTP methods (POST enabled dynamically for Git operations) + 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 Tips +### Performance Tuning Recommendations -- **Cache Optimization**: Adjust `CACHE_DURATION` according to usage mode, frequently updated repositories can be appropriately reduced -- **Timeout setting**: When network conditions are poor, you can add appropriately `TIMEOUT_SECONDS` -- **Retry policy**: `MAX_RETRIES` and `RETRY_DELAY_MS` can be added in high-latency environments +- **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 a New Platform +### Adding New Platforms -To add support for the new platform, edit `src/config/platforms.js`: +To add support for new platforms, edit `src/config/platforms.js`: ```javascript export const PLATFORMS = { - // Existing platform... + // Existing platforms... // New platform example custom: { @@ -2420,31 +2409,31 @@ export const PLATFORMS = { ## 🚧 Development -1. **Repository settings** +1. **Repository Setup** ```bash git clone https://github.com/xixu-me/Xget.git cd Xget npm install - npx wrangler login # First-time login + npx wrangler login # First time use ``` 2. **Local Development** ```bash - npm run dev # Start the dev server (http://localhost:8787) - npm run test:run # Run the full test suite - npm run test:coverage # Generate code coverage report - npm run lint # Lint the codebase - npm run format # Format the code + 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 ``` -## 🧪 Test +## 🧪 Testing -The repository contains a complete test suite to ensure code quality and functional correctness. +The repository includes a complete test suite to ensure code quality and functional correctness. -### Full Test Suite +### Complete Testing ```bash # Install test dependencies @@ -2462,37 +2451,37 @@ npm run test:watch ### Test Coverage -- **Unit Test**: Core functions, platform configuration, performance monitoring -- **Integration Test**: End-to-end process, platform integration, Git protocol -- **Security Test**: Input verification, security header, permission control -- **Performance Test**: Response time, memory usage, concurrent processing +- **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 -### FAQ +### Common Issues -**Q: Didn’t the download speed significantly improve?** -A: Check whether the source file is already cached on the CDN edge node. The first access may be slow, and subsequent access will be significantly improved. +**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 operation failed?** -A: Confirm that the correct URL format is used and that the Git client version supports HTTPS proxy. +**Q: Git operations failing?** +A: Confirm correct URL format is used and Git client version supports HTTPS proxy. -**Q: Is it inaccessible after deployment?** -A: Check whether the Cloudflare Workers domain name is correctly bound and confirm that the `wrangler.toml` configuration is correct. +**Q: Cannot access after deployment?** +A: Check if Cloudflare Workers domain is correctly bound, confirm `wrangler.toml` configuration is correct. -**Q: A 400 error occurred?** -A: Check the URL path format to confirm that the platform prefix is ​​used correctly. +**Q: Getting 400 error?** +A: Check URL path format, confirm platform prefix is correctly used. ### Performance Monitoring -Returns performance metrics in response header: +Performance metrics are returned in response headers: -- `X-Performance-Metrics`: Contains time-consuming statistics for each phase of the request -- `X-Cache-Status`: Show cache hit status +- `X-Performance-Metrics`: Contains timing statistics for request stages +- `X-Cache-Status`: Shows cache hit status ### Log Debugging -In a development environment, you can view detailed logs through the Cloudflare Workers console: +In development environment, you can view detailed logs through Cloudflare Workers console: ```bash npx wrangler dev --log-level debug @@ -2500,25 +2489,25 @@ npx wrangler dev --log-level debug ## ⚠️ Disclaimer -- **Legal and Compliant Use**: This repository is designed to accelerate legal public resource access (such as file downloads, Git operations, AI inference APIs, container image pulling and package management). Please strictly abide by the laws and regulations of the jurisdiction you are in and the terms of service and use agreements of the relevant platforms. Any use of any behavior that exceeds the scope of legally disclosed resources shall be borne by the user at their sole responsibility. -- **Non-relatedness and liability**: Any fork, secondary development, redistribution or derivative version based on this repository shall be independently responsible for its maintainers; the author, maintainer and contributor of this repository shall not bear any legal or joint liability for their actions or consequences, nor shall it constitute employment, cooperation, agency, endorsement or warranty relationship -- **No Warranty and Limitation of Liability**: To the maximum extent permitted by applicable law, this Repository is provided as “AS IS” and the author, maintainer and contributor do not provide any warranties of express or implied (including but not limited to merchantability, fitness for a particular purpose and non-infringement), nor are they liable for any direct or indirect losses, loss of data, business interruption or other consequences arising from the use of this Repository -- **User's obligation**: Users should evaluate and control the risks of use on their own, ensure that their actions and purposes are legal, compliant and do not infringe on the rights and interests of third parties, and do not use this repository for illegal, infringing or malicious purposes in any form. -- **Third-party platforms and rate limits**: Please comply with the terms of service, API usage restrictions and rate control of GitHub, GitLab, Gitea, Codeberg, SourceForge, Hugging Face, major package management platforms and container registry, etc., to avoid excessive load on the source platform -- **Intellectual Property and Content Compliance**: Ensure that content accessed or distributed through this repository complies with relevant copyright and licensing requirements; for copyrighted content, please comply with its license agreement and terms of use -- **Data and Security**: This repository adopts a log-free architecture and does not store, record or analyze user requested data. However, Internet transmission has inherent risks. It is recommended to scan downloaded files safely, especially executable files and scripts, and handle sensitive information with caution -- **Support and Maintenance**: This repository is an open source, community-driven work, and the authors and contributors do not assume the obligation to provide support, repair or continuous maintenance; the merged external contribution does not constitute a commitment or endorsement of its purpose, effect, or results. -- **Denotation and Name Use**: No cooperation, endorsement or warranty shall be implied in any scenario. External display or publicity involving the name of the repository, the author's name or logo shall comply with applicable laws and the usage specifications of the name/logo -- **Update and Applicable**: This disclaimer may be updated with changes in the repository or legal environment without notice; when you use, copy, distribute or modify this repository, you are deemed to have read and agree to the latest version of this disclaimer. +- **Legal and Compliant Use**: This repository is intended to accelerate access to legal public resources (such as file downloads, Git operations, AI inference APIs, container image pulls, and package management). Please strictly comply with the laws and regulations of your jurisdiction as well as the terms of service and usage agreements of relevant platforms. Any use beyond legal public resources is the user's own legal responsibility +- **Non-Affiliation and Self-Responsibility**: Any fork, secondary development, redistribution, or derivative version based on this repository is independently responsible by its maintainer; the authors, maintainers, and contributors of this repository bear no legal or joint liability for their actions or consequences, nor does it constitute employment, cooperation, agency, endorsement, or guarantee +- **No Warranty and Limitation of Liability**: To the maximum extent permitted by applicable law, this repository is provided "AS IS", and the authors, maintainers, and contributors provide no express or implied warranties (including but not limited to merchantability, fitness for a particular purpose, and non-infringement), nor are they responsible for any direct or indirect losses, data loss, business interruption, or other consequences caused by the use of this repository +- **User Obligations**: Users should independently evaluate and control usage risks, ensuring their actions and purposes are legal, compliant, and do not infringe third-party rights, and not use this repository for illegal, infringing, or malicious purposes in any form +- **Third-Party Platforms and Rate Limits**: Please comply with the terms of service, API usage limits, and rate controls of platforms such as GitHub, GitLab, Gitea, Codeberg, SourceForge, Hugging Face, various package management platforms, and container registries to avoid excessive load on source platforms +- **Intellectual Property and Content Compliance**: Ensure that content accessed or distributed through this repository complies with relevant copyright and licensing requirements; for copyrighted content, please comply with its licensing agreements and terms of use +- **Data and Security**: This repository adopts a no-log architecture and does not store, record, or analyze user request data. However, internet transmission has inherent risks. It is recommended to perform security scans on downloaded files, especially executable files and scripts, and handle sensitive information carefully +- **Support and Maintenance**: This repository is an open source, community-driven work. Authors and contributors are not obligated to provide support, fixes, or continuous maintenance; merged external contributions do not constitute commitments or endorsements for their purposes, effects, or results +- **Representation and Name Use**: Do not imply cooperation, endorsement, or guarantee from authors or contributors in any scenario. External display or promotion involving the repository name, author name, or logos should comply with applicable laws and common name/logo usage norms +- **Updates and Applicability**: This disclaimer may be updated as the repository or legal environment changes without separate notice; by using, copying, distributing, or modifying this repository, you are deemed to have read and agreed to the latest version of this disclaimer -## 🤝 Contribution +## 🤝 Contributing -We welcome contributions in all forms!Please see the [Contribution Guide] (CONTRIBUTING.md) to learn how to participate in repository development. +We welcome all forms of contribution! Please check the [Contributing Guide](CONTRIBUTING.md) to learn how to participate in repository development. -1. **Reporting issues**: Use [issue template](https://github.com/xixu-me/Xget/issues/new/choose) to report a bug or make a feature request -2. **Commit code**: fork repository, create feature branches, submit pull request -3. **Improve documentation**: Fix errors, add examples, and improve instructions -4. **Test Feedback**: Test and provide feedback in different environments +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 History @@ -2534,17 +2523,19 @@ We welcome contributions in all forms!Please see the [Contribution Guide] (CONTR - **Author**: [Xi Xu](https://xi-xu.me) - **Email**: [Contact Email](mailto:i@xi-xu.me) -- **Sponsored**: [Sponsored URL](https://xi-xu.me/#sponsorships) +- **Sponsor**: [Sponsor URL](https://xi-xu.me/#sponsorships) ## 📝 License -This repository is under a GPL-3.0 license - view the [LICENSE](LICENSE) file for details. +Copyright © Xi Xu. + +This repository is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details. ---
-**If this repository is helpful to you, consider giving it a ⭐star!** +**If this repository helps you, please consider giving it a ⭐ star!** Made with ❤️ by [Xi Xu](https://xi-xu.me) diff --git a/README.md b/README.md index 30cba61..18c1f84 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ [![AI 推理提供商](https://img.shields.io/badge/AI%20推理提供商-412991?logo=openai&logoColor=white)](#ai-推理提供商) [![容器注册表](https://img.shields.io/badge/容器注册表-%23007EC6.svg?logo=docker&logoColor=white)](#容器注册表) -超高性能、安全的一站式开发者资源加速引擎,其性能远超传统加速器,提供跨多个平台的统一高效的加速体验,涵盖代码储存库、包管理、AI 推理 API、容器镜像、模型及数据集等。 +面向开发者资源的超高性能、安全、一体化加速引擎,其性能显著优于传统解决方案,为代码存储库、软件包注册表、AI 推理 API、容器镜像、模型、数据集及更多资源提供统一且高效的加速。 技术深度解析文章已发布:**[《深入剖析 Xget:一个高性能、多协议、高安全性的开发者资源加速引擎》](https://blog.xi-xu.me/2025/10/07/deep-dive-into-xget-technology.html)**。 @@ -2334,18 +2334,7 @@ sudo systemctl restart containerd ## 🚀 部署 -### Cloudflare Workers - -[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/xixu-me/Xget) - -**Xget 专为 Cloudflare Workers 设计并优化**,提供最佳的性能和体验: - -- **💰 成本优势**:除了注册域名的费用外,在大多数情况下是免费的 -- **🚀 性能最高**:全球边缘节点,响应速度最快 -- **🔧 维护简单**:无需服务器管理,自动扩展和更新 -- **🛡️ 安全可靠**:内置 DDoS 防护和安全特性 - -#### 部署步骤 +### 部署步骤 1. **fork 本存储库**: 点击 GitHub 页面右上角的 Fork 按钮 @@ -2374,7 +2363,7 @@ sudo systemctl restart containerd - Worker 域名:`your-worker-name.your-subdomain.workers.dev` - 自定义域名:`your-domain.com`(如果已绑定) -#### 环境变量配置 +### 环境变量配置 你可以在 Cloudflare Workers 控制台中设置以下环境变量来自定义配置: @@ -2548,6 +2537,8 @@ npx wrangler dev --log-level debug ## 📝 许可证 +版权所有 © Xi Xu。 + 本存储库采用 GPL-3.0 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。 --- diff --git a/scripts/test.js b/scripts/test.js deleted file mode 100644 index 618852f..0000000 --- a/scripts/test.js +++ /dev/null @@ -1,320 +0,0 @@ -#!/usr/bin/env node - -/** - * Test runner script with additional utilities - */ - -import { spawn } from 'child_process'; -import { existsSync, mkdirSync, writeFileSync } from 'fs'; -import { dirname, join } from 'path'; -import { fileURLToPath } from 'url'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -const rootDir = join(__dirname, '..'); - -// Test configuration -const TEST_CONFIG = { - timeout: 30000, - coverage: { - threshold: 80, - formats: ['text', 'html', 'lcov', 'json'] - }, - reporters: ['default', 'json'], - environments: ['node', 'workers'] -}; - -/** - * Main test runner - */ -async function main() { - const args = process.argv.slice(2); - const command = args[0] || 'run'; - - console.log('🧪 Xget Test Runner'); - console.log('=================='); - - try { - switch (command) { - case 'run': - await runTests(args.slice(1)); - break; - case 'watch': - await watchTests(args.slice(1)); - break; - case 'coverage': - await runCoverage(args.slice(1)); - break; - case 'bench': - await runBenchmarks(args.slice(1)); - break; - case 'lint': - await runLinting(); - break; - case 'format': - await runFormatting(); - break; - case 'ci': - await runCITests(); - break; - case 'setup': - await setupTestEnvironment(); - break; - case 'clean': - await cleanTestArtifacts(); - break; - default: - showHelp(); - } - } catch (error) { - console.error('❌ Test runner failed:', error.message); - process.exit(1); - } -} - -/** - * Run tests - */ -async function runTests(args = []) { - console.log('🏃 Running tests...'); - - const vitestArgs = ['run', '--config', 'vitest.config.js', ...args]; - - await runCommand('npx', ['vitest', ...vitestArgs]); -} - -/** - * Watch tests - */ -async function watchTests(args = []) { - console.log('👀 Watching tests...'); - - const vitestArgs = ['--config', 'vitest.config.js', '--watch', ...args]; - - await runCommand('npx', ['vitest', ...vitestArgs]); -} - -/** - * Run coverage - */ -async function runCoverage(args = []) { - console.log('📊 Generating coverage report...'); - - const vitestArgs = ['run', '--config', 'vitest.config.js', '--coverage', ...args]; - - await runCommand('npx', ['vitest', ...vitestArgs]); - - console.log('📈 Coverage report generated in ./coverage/'); - - // Generate coverage summary - await generateCoverageSummary(); -} - -/** - * Run benchmarks - */ -async function runBenchmarks(args = []) { - console.log('⚡ Running performance benchmarks...'); - - const vitestArgs = ['bench', '--config', 'vitest.config.js', ...args]; - - await runCommand('npx', ['vitest', ...vitestArgs]); -} - -/** - * Run linting - */ -async function runLinting() { - console.log('🔍 Running ESLint...'); - - await runCommand('npx', ['eslint', 'src/', 'test/', '--ext', '.js']); - - console.log('✅ Linting completed'); -} - -/** - * Run formatting - */ -async function runFormatting() { - console.log('💅 Running Prettier...'); - - await runCommand('npx', ['prettier', '--write', 'src/', 'test/', '*.js', '*.json', '*.md']); - - console.log('✅ Formatting completed'); -} - -/** - * Run CI tests - */ -async function runCITests() { - console.log('🤖 Running CI test suite...'); - - // Run linting - await runLinting(); - - // Check formatting - console.log('📝 Checking code formatting...'); - await runCommand('npx', ['prettier', '--check', 'src/', 'test/', '*.js', '*.json', '*.md']); - - // Run tests with coverage - await runCoverage(['--reporter=json', '--reporter=text']); - - // Run benchmarks - await runBenchmarks(['--reporter=json']); - - console.log('✅ CI test suite completed'); -} - -/** - * Setup test environment - */ -async function setupTestEnvironment() { - console.log('🔧 Setting up test environment...'); - - // Create necessary directories - const dirs = ['coverage', 'test/tmp', 'test/logs']; - dirs.forEach(dir => { - const fullPath = join(rootDir, dir); - if (!existsSync(fullPath)) { - mkdirSync(fullPath, { recursive: true }); - console.log(`📁 Created directory: ${dir}`); - } - }); - - // Create test configuration file - const testConfig = { - ...TEST_CONFIG, - timestamp: new Date().toISOString(), - version: process.env.npm_package_version || '1.0.0' - }; - - writeFileSync(join(rootDir, 'test/config.json'), JSON.stringify(testConfig, null, 2)); - - console.log('✅ Test environment setup completed'); -} - -/** - * Clean test artifacts - */ -async function cleanTestArtifacts() { - console.log('🧹 Cleaning test artifacts...'); - - const { rmSync } = await import('fs'); - const artifactDirs = ['coverage', 'test/tmp', 'test/logs']; - - artifactDirs.forEach(dir => { - const fullPath = join(rootDir, dir); - if (existsSync(fullPath)) { - rmSync(fullPath, { recursive: true, force: true }); - console.log(`🗑️ Removed: ${dir}`); - } - }); - - console.log('✅ Cleanup completed'); -} - -/** - * Generate coverage summary - */ -async function generateCoverageSummary() { - const coverageFile = join(rootDir, 'coverage/coverage-summary.json'); - - if (existsSync(coverageFile)) { - const { readFileSync } = await import('fs'); - const coverage = JSON.parse(readFileSync(coverageFile, 'utf8')); - - console.log('\n📊 Coverage Summary:'); - console.log('==================='); - - const total = coverage.total; - console.log(`Lines: ${total.lines.pct}% (${total.lines.covered}/${total.lines.total})`); - console.log( - `Functions: ${total.functions.pct}% (${total.functions.covered}/${total.functions.total})` - ); - console.log( - `Branches: ${total.branches.pct}% (${total.branches.covered}/${total.branches.total})` - ); - console.log( - `Statements: ${total.statements.pct}% (${total.statements.covered}/${total.statements.total})` - ); - - // Check if coverage meets threshold - const threshold = TEST_CONFIG.coverage.threshold; - const meetsThreshold = [ - total.lines.pct >= threshold, - total.functions.pct >= threshold, - total.branches.pct >= threshold, - total.statements.pct >= threshold - ].every(Boolean); - - if (meetsThreshold) { - console.log(`\n✅ Coverage meets threshold (${threshold}%)`); - } else { - console.log(`\n⚠️ Coverage below threshold (${threshold}%)`); - } - } -} - -/** - * Run command with proper error handling - */ -function runCommand(command, args = [], options = {}) { - return new Promise((resolve, reject) => { - const child = spawn(command, args, { - stdio: 'inherit', - cwd: rootDir, - ...options - }); - - child.on('close', code => { - if (code === 0) { - resolve(); - } else { - reject(new Error(`Command failed with exit code ${code}`)); - } - }); - - child.on('error', error => { - reject(error); - }); - }); -} - -/** - * Show help information - */ -function showHelp() { - console.log(` -Usage: node scripts/test.js [options] - -Commands: - run [args] Run tests once (default) - watch [args] Run tests in watch mode - coverage Generate coverage report - bench Run performance benchmarks - lint Run ESLint - format Run Prettier - ci Run full CI test suite - setup Setup test environment - clean Clean test artifacts - help Show this help - -Examples: - node scripts/test.js run - node scripts/test.js watch --grep "GitHub" - node scripts/test.js coverage - node scripts/test.js ci - -Environment Variables: - VERBOSE_TESTS=true Enable verbose test output - TEST_TIMEOUT=30000 Set test timeout (ms) - NODE_ENV=test Set environment to test -`); -} - -// Run if called directly -if (import.meta.url === `file://${process.argv[1]}`) { - main().catch(console.error); -} - -export { main, runBenchmarks, runCoverage, runTests };