@@ -1126,58 +1135,58 @@ conda env update -f environment.yml
```
```bash
-# Specify mirror using command line
+# 使用命令行指定镜像
mvn clean install -Dmaven.repo.remote=https://xget.xi-xu.me/maven/maven2
-# Download specific dependency
+# 下载特定依赖
mvn dependency:get -Dartifact=org.springframework:spring-core:5.3.21 \
-DremoteRepositories=https://xget.xi-xu.me/maven/maven2
```
-### Apache Software Download Acceleration
+### Apache 软件下载加速
-#### Download Apache Software Using Xget
+#### 使用 Xget 下载 Apache 软件
```bash
-# Download Apache Kafka
+# 下载 Apache Kafka
wget https://xget.xi-xu.me/apache/kafka/3.6.1/kafka_2.13-3.6.1.tgz
-# Download Apache Maven
+# 下载 Apache Maven
curl -L -O https://xget.xi-xu.me/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz
-# Download Apache Spark
+# 下载 Apache Spark
aria2c https://xget.xi-xu.me/apache/spark/spark-3.5.0/spark-3.5.0-bin-hadoop3.tgz
-# Download Apache Hadoop
+# 下载 Apache Hadoop
wget https://xget.xi-xu.me/apache/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz
-# Download Apache Flink
+# 下载 Apache Flink
curl -L -O https://xget.xi-xu.me/apache/flink/flink-1.18.1/flink-1.18.1-bin-scala_2.12.tgz
```
-#### Common Apache Software Downloads
+#### 常用 Apache 软件下载
```bash
-# Big data related
+# 大数据相关
wget https://xget.xi-xu.me/apache/hive/hive-3.1.3/apache-hive-3.1.3-bin.tar.gz
wget https://xget.xi-xu.me/apache/hbase/2.5.7/hbase-2.5.7-bin.tar.gz
wget https://xget.xi-xu.me/apache/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
-# Web servers
+# Web 服务器
wget https://xget.xi-xu.me/apache/httpd/httpd-2.4.59.tar.gz
wget https://xget.xi-xu.me/apache/tomcat/tomcat-10/v10.1.19/bin/apache-tomcat-10.1.19.tar.gz
-# Development tools
+# 开发工具
wget https://xget.xi-xu.me/apache/ant/1.10.14/apache-ant-1.10.14-bin.tar.gz
wget https://xget.xi-xu.me/apache/netbeans/netbeans/20/netbeans-20-bin.zip
```
-### Gradle Package Acceleration
+### Gradle 包管理加速
-#### Configure Gradle to Use Xget Mirror
+#### 配置 Gradle 使用 Xget 镜像
```gradle
-// Configure Gradle mirror in build.gradle
+// 在 build.gradle 中配置 Gradle 镜像
repositories {
maven {
url 'https://xget.xi-xu.me/maven/maven2'
@@ -1187,7 +1196,7 @@ repositories {
}
}
-// Configure plugin repositories
+// 配置插件存储库
pluginManagement {
repositories {
maven {
@@ -1198,10 +1207,10 @@ pluginManagement {
}
```
-#### Global Configuration
+#### 全局配置
```gradle
-// Configure global mirror in ~/.gradle/init.gradle
+// 在 ~/.gradle/init.gradle 中配置全局镜像
allprojects {
repositories {
maven {
@@ -1223,91 +1232,91 @@ settingsEvaluated { settings ->
```
```bash
-# Specify mirror using command line
+# 使用命令行指定镜像
gradle build -Dmaven.repo.remote=https://xget.xi-xu.me/maven/maven2
-# Refresh dependencies
+# 刷新依赖
gradle build --refresh-dependencies
```
-### Homebrew Package Acceleration
+### Homebrew 包管理加速
-#### Configure Homebrew to Use Xget Mirror
+#### 配置 Homebrew 使用 Xget 镜像
```bash
-# Set Homebrew environment variables to use Xget mirror
+# 设置 Homebrew 环境变量使用 Xget 镜像
export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git"
export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api"
export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles"
-# Update Homebrew
+# 更新 Homebrew
brew update
```
-#### Long-term Configuration
+#### 长期配置
```bash
-# For bash users, add to ~/.bash_profile
+# 为 bash 用户添加到 ~/.bash_profile
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git"' >> ~/.bash_profile
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git"' >> ~/.bash_profile
echo 'export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api"' >> ~/.bash_profile
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles"' >> ~/.bash_profile
-# For zsh users, add to ~/.zprofile
+# 为 zsh 用户添加到 ~/.zprofile
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://xget.xi-xu.me/homebrew/brew.git"' >> ~/.zprofile
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://xget.xi-xu.me/homebrew/homebrew-core.git"' >> ~/.zprofile
echo 'export HOMEBREW_API_DOMAIN="https://xget.xi-xu.me/homebrew/api"' >> ~/.zprofile
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://xget.xi-xu.me/homebrew/bottles"' >> ~/.zprofile
```
-#### Use in Project
+#### 在项目中使用
```bash
-# Install packages
+# 安装软件包
brew install git
-# Search packages
+# 搜索软件包
brew search python
-# Update packages
+# 更新软件包
brew upgrade
-# View installed packages
+# 查看已安装软件包
brew list
```
-#### Verify Mirror Configuration
+#### 验证镜像配置
```bash
-# Check Homebrew configuration
+# 检查 Homebrew 配置
brew config
-# View environment variables
+# 查看环境变量
echo $HOMEBREW_API_DOMAIN
echo $HOMEBREW_BOTTLE_DOMAIN
```
-### Ruby Package Acceleration
+### Ruby 包管理加速
-#### Configure RubyGems to Use Xget Mirror
+#### 配置 RubyGems 使用 Xget 镜像
```bash
-# Temporarily use Xget mirror
+# 临时使用 Xget 镜像
gem install rails --source https://xget.xi-xu.me/rubygems/
-# Globally configure RubyGems mirror
+# 全局配置 RubyGems 镜像
gem sources --add https://xget.xi-xu.me/rubygems/
gem sources --remove https://rubygems.org/
-# Verify configuration
+# 验证配置
gem sources -l
```
-#### Use in Project
+#### 在项目中使用
```ruby
-# Configure project-level mirror in Gemfile
+# 在 Gemfile 中配置项目级镜像
source 'https://xget.xi-xu.me/rubygems/'
gem 'rails', '~> 7.0.0'
@@ -1316,30 +1325,30 @@ gem 'puma', '~> 5.0'
```
```bash
-# Install using bundle
+# 使用 bundle 安装
bundle config mirror.https://rubygems.org https://xget.xi-xu.me/rubygems/
bundle install
```
-### R Package Acceleration
+### R 包管理加速
-#### Configure R to Use Xget CRAN Mirror
+#### 配置 R 使用 Xget CRAN 镜像
```r
-# Temporarily use Xget CRAN mirror in R
+# 在 R 中临时使用 Xget CRAN 镜像
install.packages("ggplot2", repos = "https://xget.xi-xu.me/cran/")
-# Globally configure CRAN mirror
+# 全局配置 CRAN 镜像
options(repos = c(CRAN = "https://xget.xi-xu.me/cran/"))
-# Verify configuration
+# 验证配置
getOption("repos")
```
-#### Configure in .Rprofile
+#### 在 .Rprofile 中配置
```r
-# Configure global mirror in .Rprofile file in user home directory
+# 在用户主目录的 .Rprofile 文件中配置全局镜像
options(repos = c(
CRAN = "https://xget.xi-xu.me/cran/",
BioCsoft = "https://bioconductor.org/packages/release/bioc",
@@ -1347,29 +1356,29 @@ options(repos = c(
BioCexp = "https://bioconductor.org/packages/release/data/experiment"
))
-# Set download method
+# 设置下载方法
options(download.file.method = "libcurl")
```
-#### Use in Project
+#### 在项目中使用
```r
-# Specify mirror in project's renv.lock or script
+# 在项目的 renv.lock 或脚本中指定镜像
renv::init()
renv::settings$repos.override(c(CRAN = "https://xget.xi-xu.me/cran/"))
-# Install packages
+# 安装包
install.packages(c("dplyr", "ggplot2", "tidyr"))
-# Or use pak package manager
+# 或使用 pak 包管理器
pak::pkg_install("tidyverse", repos = "https://xget.xi-xu.me/cran/")
```
```bash
-# Install packages using R script in command line
+# 在命令行中使用 R 脚本安装包
Rscript -e "options(repos = c(CRAN = 'https://xget.xi-xu.me/cran/')); install.packages('ggplot2')"
-# Batch install packages
+# 批量安装包
Rscript -e "
options(repos = c(CRAN = 'https://xget.xi-xu.me/cran/'))
packages <- c('dplyr', 'ggplot2', 'tidyr', 'readr')
@@ -1377,134 +1386,134 @@ install.packages(packages)
"
```
-### Perl Package Acceleration
+### Perl 包管理加速
-#### Configure CPAN to Use Xget Mirror
+#### 配置 CPAN 使用 Xget 镜像
```bash
-# Configure CPAN to use Xget mirror
+# 配置 CPAN 使用 Xget 镜像
cpan o conf urllist push https://xget.xi-xu.me/cpan/
cpan o conf commit
-# Or directly edit configuration file ~/.cpan/CPAN/MyConfig.pm
-# Add:
+# 或者直接编辑配置文件 ~/.cpan/CPAN/MyConfig.pm
+# 添加:
# 'urllist' => [q[https://xget.xi-xu.me/cpan/]],
```
-#### Use cpanm to Install Modules
+#### 使用 cpanm 安装模块
```bash
-# Install cpanm (if not available)
+# 安装 cpanm(如果没有)
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
-# Install modules using Xget mirror
+# 使用 Xget 镜像安装模块
cpanm --mirror https://xget.xi-xu.me/cpan/ DBI
cpanm --mirror https://xget.xi-xu.me/cpan/ Mojolicious
-# Install dependencies from Makefile.PL
+# 从 Makefile.PL 安装依赖
cpanm --mirror https://xget.xi-xu.me/cpan/ --installdeps .
```
-#### Use in Project
+#### 在项目中使用
```perl
-# List dependencies in cpanfile
+# 在 cpanfile 中列出依赖
requires 'DBI';
requires 'Mojolicious';
requires 'JSON';
-# Then install using Xget mirror
+# 然后使用 Xget 镜像安装
cpanm --mirror https://xget.xi-xu.me/cpan/ --installdeps .
```
-### TeX/LaTeX Package Acceleration
+### TeX/LaTeX 包管理加速
-#### Configure TeX Live to Use Xget CTAN Mirror
+#### 配置 TeX Live 使用 Xget CTAN 镜像
```bash
-# Configure tlmgr to use Xget CTAN mirror
+# 配置 tlmgr 使用 Xget CTAN 镜像
tlmgr option repository https://xget.xi-xu.me/ctan/systems/texlive/tlnet
-# Update package database
+# 更新包数据库
tlmgr update --self --all
-# Install packages
+# 安装包
tlmgr install beamer
tlmgr install tikz
```
-#### Configure MiKTeX to Use Xget Mirror
+#### 配置 MiKTeX 使用 Xget 镜像
```bash
-# Windows MiKTeX configuration
+# Windows MiKTeX 配置
mpm --set-repository=https://xget.xi-xu.me/ctan/systems/win32/miktex
-# Update package database
+# 更新包数据库
mpm --update-db
-# Install packages
+# 安装包
mpm --install=beamer
mpm --install=pgf
```
-#### Use in Project
+#### 在项目中使用
```bash
-# Automatically install missing packages during LaTeX document compilation
+# LaTeX 文档编译时自动安装缺失包
pdflatex --shell-escape document.tex
-# Or manually install specific packages
+# 或手动安装特定包
tlmgr install caption
tlmgr install subcaption
tlmgr install algorithm2e
```
-### Go Module Acceleration
+### Go 模块加速
-#### Configure Go to Use Xget Proxy
+#### 配置 Go 使用 Xget 代理
```bash
-# Configure Go module proxy
+# 配置 Go 模块代理
export GOPROXY=https://xget.xi-xu.me/golang,direct
export GOSUMDB=off
-# Or permanently configure
+# 或者永久配置
go env -w GOPROXY=https://xget.xi-xu.me/golang,direct
go env -w GOSUMDB=off
-# Verify configuration
+# 验证配置
go env GOPROXY
```
-#### Use in Project
+#### 在项目中使用
```bash
-# Download dependencies
+# 下载依赖
go mod download
-# Update dependencies
+# 更新依赖
go get -u ./...
-# Clean module cache
+# 清理模块缓存
go clean -modcache
```
-### NuGet Package Acceleration
+### NuGet 包管理加速
-#### Configure NuGet to Use Xget Mirror
+#### 配置 NuGet 使用 Xget 镜像
```bash
-# Add Xget package source
+# 添加 Xget 包源
dotnet nuget add source https://xget.xi-xu.me/nuget/v3/index.json -n xget
-# List package sources
+# 列出包源
dotnet nuget list source
-# Use in project
+# 在项目中使用
dotnet restore --source https://xget.xi-xu.me/nuget/v3/index.json
```
-#### Configure in NuGet.Config
+#### 在 NuGet.Config 中配置
```xml
@@ -1516,12 +1525,12 @@ dotnet restore --source https://xget.xi-xu.me/nuget/v3/index.json
```
-### Rust Package Acceleration
+### Rust 包管理加速
-#### Configure Cargo to Use Xget Mirror
+#### 配置 Cargo 使用 Xget 镜像
```bash
-# Configure Cargo to use Xget mirror (in ~/.cargo/config.toml)
+# 配置 Cargo 使用 Xget 镜像(在 ~/.cargo/config.toml 中)
mkdir -p ~/.cargo
cat >> ~/.cargo/config.toml << EOF
[source.crates-io]
@@ -1531,14 +1540,14 @@ replace-with = "xget"
registry = "https://xget.xi-xu.me/crates/"
EOF
-# Verify configuration
+# 验证配置
cargo search serde
```
-#### Use in Project
+#### 在项目中使用
```toml
-# Can use dependencies normally in Cargo.toml
+# 在 Cargo.toml 中可以正常使用依赖
[dependencies]
serde = "1.0"
tokio = "1.0"
@@ -1546,32 +1555,32 @@ reqwest = "0.11"
```
```bash
-# Xget will be automatically used when building the project
+# 构建项目时会自动使用 Xget
cargo build
-# Update dependencies
+# 更新依赖
cargo update
-# Add new dependency
+# 添加新依赖
cargo add clap
```
-### PHP Package Acceleration
+### PHP 包管理加速
-#### Configure Composer to Use Xget Mirror
+#### 配置 Composer 使用 Xget 镜像
```bash
-# Globally configure Composer mirror
+# 全局配置 Composer 镜像
composer config -g repo.packagist composer https://xget.xi-xu.me/packagist/
-# Project-level configuration
+# 项目级配置
composer config repo.packagist composer https://xget.xi-xu.me/packagist/
-# Verify configuration
+# 验证配置
composer config -l
```
-#### Configure in composer.json
+#### 在 composer.json 中配置
```json
{
@@ -1588,100 +1597,100 @@ composer config -l
}
```
-### Linux Distribution Acceleration
+### Linux 发行版加速
-#### Debian/Ubuntu APT Configuration
+#### Debian/Ubuntu APT 配置
```bash
-# Backup original source list
+# 备份原始源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
-# Configure Debian mirror
+# 配置 Debian 镜像
echo "deb https://xget.xi-xu.me/debian/debian bookworm main" | sudo tee /etc/apt/sources.list
echo "deb https://xget.xi-xu.me/debian/debian-security bookworm-security main" | sudo tee -a /etc/apt/sources.list
-# Configure Ubuntu mirror
+# 配置 Ubuntu 镜像
echo "deb https://xget.xi-xu.me/ubuntu/ubuntu jammy main restricted universe multiverse" | sudo tee /etc/apt/sources.list
echo "deb https://xget.xi-xu.me/ubuntu/ubuntu jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
-# Update package list
+# 更新包列表
sudo apt update
```
-#### Fedora DNF Configuration
+#### Fedora DNF 配置
```bash
-# Configure Fedora mirror
+# 配置 Fedora 镜像
sudo sed -i 's|^metalink=|#metalink=|g' /etc/yum.repos.d/fedora*.repo
sudo sed -i 's|^#baseurl=http://download.example/pub/fedora/linux|baseurl=https://xget.xi-xu.me/fedora/pub/fedora/linux|g' /etc/yum.repos.d/fedora*.repo
-# Update package cache
+# 更新包缓存
sudo dnf makecache
```
-#### Rocky Linux DNF Configuration
+#### Rocky Linux DNF 配置
```bash
-# Configure Rocky Linux mirror
+# 配置 Rocky Linux 镜像
sudo sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/rocky*.repo
sudo sed -i 's|^#baseurl=http://dl.rockylinux.org|baseurl=https://xget.xi-xu.me/rocky|g' /etc/yum.repos.d/rocky*.repo
-# Update package cache
+# 更新包缓存
sudo dnf makecache
```
-#### openSUSE Zypper Configuration
+#### openSUSE Zypper 配置
```bash
-# Configure openSUSE Leap mirror
+# 配置 openSUSE Leap 镜像
sudo zypper mr -d repo-oss
sudo zypper ar -f https://xget.xi-xu.me/opensuse/distribution/leap/15.5/repo/oss/ repo-oss-xget
-# Configure openSUSE Tumbleweed mirror
+# 配置 openSUSE Tumbleweed 镜像
sudo zypper mr -d repo-oss
sudo zypper ar -f https://xget.xi-xu.me/opensuse/tumbleweed/repo/oss/ repo-oss-xget
-# Refresh software sources
+# 刷新软件源
sudo zypper refresh
-# Verify configuration
+# 验证配置
sudo zypper lr -u
```
-#### Arch Linux Pacman Configuration
+#### Arch Linux Pacman 配置
```bash
-# Backup original mirror list
+# 备份原始镜像列表
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
-# Configure Arch Linux mirror
+# 配置 Arch Linux 镜像
echo 'Server = https://xget.xi-xu.me/arch/$repo/os/$arch' | sudo tee /etc/pacman.d/mirrorlist
-# Update package database
+# 更新包数据库
sudo pacman -Sy
```
-### Academic Resource Acceleration
+### 学术资源加速
-#### arXiv Paper Download
+#### arXiv 论文下载
```bash
-# Download arXiv paper PDF
+# 下载 arXiv 论文 PDF
wget https://xget.xi-xu.me/arxiv/pdf/2301.07041.pdf
-# Download paper source
+# 下载论文源码
curl -L -O https://xget.xi-xu.me/arxiv/e-print/2301.07041
-# Batch download multiple papers
+# 批量下载多篇论文
for id in 2301.07041 2302.13971 2303.08774; do
wget https://xget.xi-xu.me/arxiv/pdf/${id}.pdf
done
```
-#### Use in Academic Tools
+#### 在学术工具中使用
```python
-# Use arXiv accelerated download in Python
+# 在 Python 中使用 arXiv 加速下载
import requests
def download_arxiv_paper(arxiv_id, output_path):
@@ -1695,55 +1704,55 @@ def download_arxiv_paper(arxiv_id, output_path):
else:
print(f"Failed to download {arxiv_id}")
-# Download paper
+# 下载论文
download_arxiv_paper("2301.07041", "attention_is_all_you_need.pdf")
```
-### F-Droid Repository Mirror
+### F-Droid 存储库镜像
-#### Configure F-Droid Client to Use Xget Mirror
+#### 配置 F-Droid 客户端使用 Xget 镜像
-1. In F-Droid app, go to **Settings** → **Repositories**
-2. Click **+** and enter repository URL: `https://xget.xi-xu.me/fdroid/repo`
-3. Click **Add** then click **Add Mirror**
+1. 在 F-Droid 应用中进入**设置** → **存储库**
+2. 点击 **+** 后输入存储库 URL:`https://xget.xi-xu.me/fdroid/repo`
+3. 点击**添加**后再点击**添加镜像**
-#### Supported F-Droid Services
+#### 支持的 F-Droid 服务
```url
-# F-Droid app APK download
-https://xget.xi-xu.me/fdroid/repo/[package-name]_[version-code].apk
+# F-Droid 应用 APK 下载
+https://xget.xi-xu.me/fdroid/repo/[包名]_[版本号].apk
-# F-Droid repository index
+# F-Droid 存储库索引
https://xget.xi-xu.me/fdroid/repo/index-v1.jar
-# F-Droid app icons
-https://xget.xi-xu.me/fdroid/repo/icons-640/[package-name].[version-code].png
+# F-Droid 应用图标
+https://xget.xi-xu.me/fdroid/repo/icons-640/[包名].[版本号].png
-# F-Droid API endpoints
-https://xget.xi-xu.me/fdroid/api/v1/packages/[package-name]
+# F-Droid API 接口
+https://xget.xi-xu.me/fdroid/api/v1/packages/[包名]
```
-#### Usage Examples
+#### 使用示例
```bash
-# Directly download F-Droid client APK
+# 直接下载 F-Droid 客户端 APK
wget https://xget.xi-xu.me/fdroid/repo/org.fdroid.fdroid_1016050.apk
-# Download other open source apps
+# 下载其他开源应用
curl -L -O https://xget.xi-xu.me/fdroid/repo/org.mozilla.fennec_fdroid_1014000.apk
-# Get app information
+# 获取应用信息
curl https://xget.xi-xu.me/fdroid/api/v1/packages/org.fdroid.fdroid
```
-#### Batch App Management
+#### 批量应用管理
```bash
-# Create app download script
+# 创建应用下载脚本
cat > download_fdroid_apps.sh << 'EOF'
#!/bin/bash
-# Define list of apps to download
+# 定义要下载的应用列表
apps=(
"org.fdroid.fdroid_1016050.apk"
"org.mozilla.fennec_fdroid_1014000.apk"
@@ -1751,28 +1760,28 @@ apps=(
"org.videolan.vlc_13050399.apk"
)
-# Create download directory
+# 创建下载目录
mkdir -p fdroid_apps
-# Batch download apps
+# 批量下载应用
for app in "${apps[@]}"; do
- echo "Downloading: $app"
+ echo "正在下载: $app"
wget -P fdroid_apps "https://xget.xi-xu.me/fdroid/repo/$app"
done
-echo "All apps downloaded!"
+echo "所有应用下载完成!"
EOF
chmod +x download_fdroid_apps.sh
./download_fdroid_apps.sh
```
-#### Developer Integration
+#### 开发者集成
-For Android developers, F-Droid mirror can be integrated into build scripts:
+对于 Android 开发者,可以在构建脚本中集成 F-Droid 镜像:
```gradle
-// Configure F-Droid dependency check in build.gradle
+// 在 build.gradle 中配置 F-Droid 依赖检查
task checkFDroidAvailability {
doLast {
def fdroidUrl = "https://xget.xi-xu.me/fdroid/api/v1/packages/${project.name}"
@@ -1781,77 +1790,78 @@ task checkFDroidAvailability {
connection.requestMethod = 'GET'
def responseCode = connection.responseCode
if (responseCode == 200) {
- println "App available on F-Droid: $fdroidUrl"
+ println "应用在 F-Droid 上可用: $fdroidUrl"
}
} catch (Exception e) {
- println "Error checking F-Droid availability: ${e.message}"
+ println "检查 F-Droid 可用性时出错: ${e.message}"
}
}
}
```
-### Jenkins Plugin Download
+### Jenkins 插件下载
-#### Use Xget to Accelerate Jenkins Plugin Download and Update
+#### 使用 Xget 加速 Jenkins 插件下载和更新
-Supports Jenkins update center and plugin downloads, compatible with configuration methods of domestic mirrors like Tsinghua mirror.
+支持 Jenkins 更新中心和插件下载,兼容清华镜像等国内镜像源的配置方式。
-#### Jenkins Update Center Configuration
+#### Jenkins 更新中心配置
-##### Method 1: Configure in Jenkins Web Interface
+##### 方法一:在 Jenkins Web 界面配置
-1. Log in to Jenkins management interface
-2. Go to **Manage Jenkins** → **Plugins** → **Advanced**
-3. In the **Update Site** section, change the URL to `https://xget.xi-xu.me/jenkins/update-center.json`
-4. Click **Submit** to save configuration
+1. 登录 Jenkins 管理界面
+2. 进入 **Manage Jenkins** → **Plugins** → **Advanced**
+3. 在 **Update Site** 部分,将 URL 更改为 `https://xget.xi-xu.me/jenkins/update-center.json`
-##### Method 2: Modify Configuration File
+4. 点击 **Submit** 保存配置
+
+##### 方法二:修改配置文件
```bash
-# Modify update center configuration file on Jenkins server
-# Default location: $JENKINS_HOME/hudson.model.UpdateCenter.xml
+# 在 Jenkins 服务器上修改更新中心配置文件
+# 默认位置:$JENKINS_HOME/hudson.model.UpdateCenter.xml
sudo nano /var/lib/jenkins/hudson.model.UpdateCenter.xml
-# Change URL to:
+# 将 URL 改为:
# https://xget.xi-xu.me/jenkins/update-center.json
-# Restart Jenkins service
+# 重启 Jenkins 服务
sudo systemctl restart jenkins
```
-#### Supported Jenkins Services
+#### 支持的 Jenkins 服务
```url
-# Jenkins update center JSON
+# Jenkins 更新中心 JSON
https://xget.xi-xu.me/jenkins/update-center.json
-# Jenkins update center (actual JSON format)
+# Jenkins 更新中心(实际 JSON 格式)
https://xget.xi-xu.me/jenkins/update-center.actual.json
-# Jenkins plugin download
-https://xget.xi-xu.me/jenkins/download/plugins/[plugin-name]/[version]/[plugin-name].hpi
+# Jenkins 插件下载
+https://xget.xi-xu.me/jenkins/download/plugins/[插件名]/[版本]/[插件名].hpi
-# Experimental plugin update center
+# 实验性插件更新中心
https://xget.xi-xu.me/jenkins/experimental/update-center.json
```
-#### Usage Examples
+#### 使用示例
```bash
-# Download Maven plugin
+# 下载 Maven 插件
wget https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi
-# Download Git plugin
+# 下载 Git 插件
curl -L -O https://xget.xi-xu.me/jenkins/download/plugins/git/5.2.1/git.hpi
-# Get update center information
+# 获取更新中心信息
curl https://xget.xi-xu.me/jenkins/update-center.json
-# Batch download common plugins
+# 批量下载常用插件
cat > download_jenkins_plugins.sh << 'EOF'
#!/bin/bash
-# Define list of plugins to download
+# 定义要下载的插件列表
plugins=(
"git:5.2.1"
"maven-plugin:3.27"
@@ -1860,44 +1870,44 @@ plugins=(
"docker-workflow:563.vd5d2e5c4007f"
)
-# Create plugin download directory
+# 创建插件下载目录
mkdir -p jenkins_plugins
-# Batch download plugins
+# 批量下载插件
for plugin in "${plugins[@]}"; do
name=$(echo $plugin | cut -d: -f1)
version=$(echo $plugin | cut -d: -f2)
- echo "Downloading plugin: $name v$version"
+ echo "正在下载插件: $name v$version"
wget -P jenkins_plugins "https://xget.xi-xu.me/jenkins/download/plugins/$name/$version/$name.hpi"
done
-echo "All plugins downloaded!"
+echo "所有插件下载完成!"
EOF
chmod +x download_jenkins_plugins.sh
./download_jenkins_plugins.sh
```
-#### Offline Jenkins Deployment
+#### 离线 Jenkins 部署
-For Jenkins deployment in offline environments:
+对于无网络环境的 Jenkins 部署:
```bash
-# 1. Download Jenkins core file
+# 1. 下载 Jenkins 核心文件
wget https://xget.xi-xu.me/jenkins/war/jenkins.war
-# 2. Create plugin packaging script
+# 2. 创建插件打包脚本
cat > prepare_jenkins_offline.sh << 'EOF'
#!/bin/bash
-# Create offline deployment directory structure
+# 创建离线部署目录结构
mkdir -p jenkins_offline/{plugins,update_center}
-# Download update center configuration
+# 下载更新中心配置
curl -o jenkins_offline/update_center/update-center.json \
https://xget.xi-xu.me/jenkins/update-center.json
-# Essential plugins list
+# 必备插件列表
essential_plugins=(
"ant:475.vf34069fef73c"
"build-timeout:1.31"
@@ -1917,35 +1927,35 @@ essential_plugins=(
"ws-cleanup:0.45"
)
-# Download all essential plugins
+# 下载所有必备插件
for plugin in "${essential_plugins[@]}"; do
name=$(echo $plugin | cut -d: -f1)
version=$(echo $plugin | cut -d: -f2)
- echo "Downloading $name:$version"
+ echo "下载 $name:$version"
wget -P jenkins_offline/plugins \
"https://xget.xi-xu.me/jenkins/download/plugins/$name/$version/$name.hpi"
done
-# Create deployment instructions
+# 创建部署说明
cat > jenkins_offline/deploy_instructions.md << 'DEPLOY'
-# Jenkins Offline Deployment Instructions
+# Jenkins 离线部署说明
-1. Copy jenkins.war to target server
-2. Start Jenkins: java -jar jenkins.war
-3. Copy .hpi files from plugins/ directory to $JENKINS_HOME/plugins/
-4. Restart Jenkins
+1. 将 jenkins.war 复制到目标服务器
+2. 启动 Jenkins:java -jar jenkins.war
+3. 将 plugins/ 目录中的 .hpi 文件复制到 $JENKINS_HOME/plugins/
+4. 重启 Jenkins
DEPLOY
-echo "Offline deployment package prepared!"
+echo "离线部署包准备完成!"
EOF
chmod +x prepare_jenkins_offline.sh
./prepare_jenkins_offline.sh
```
-#### Use in Project
+#### 在项目中使用
-##### Plugin Check in Jenkinsfile
+##### Jenkinsfile 中的插件检查
```groovy
pipeline {
@@ -1955,16 +1965,16 @@ pipeline {
stage('Check Plugin Availability') {
steps {
script {
- // Check Maven plugin availability
+ // 检查 Maven 插件可用性
def pluginUrl = "https://xget.xi-xu.me/jenkins/download/plugins/maven-plugin/3.27/maven-plugin.hpi"
try {
def response = httpRequest url: pluginUrl, httpMode: 'HEAD'
if (response.status == 200) {
- echo "Maven plugin available: ${pluginUrl}"
+ echo "Maven 插件可用: ${pluginUrl}"
}
} catch (Exception e) {
- error "Maven plugin not available: ${e.message}"
+ error "Maven 插件不可用: ${e.message}"
}
}
}
@@ -1972,33 +1982,33 @@ pipeline {
stage('Build') {
steps {
- // Your build steps
- echo "Building with accelerated plugins..."
+ // 你的构建步骤
+ echo "使用加速后的插件进行构建..."
}
}
}
}
```
-### Container Image Acceleration
+### 容器镜像加速
-#### Pull Images Directly
+#### 直接拉取镜像
```bash
-# Pull GitHub Container Registry images
+# 拉取 GitHub 容器注册表镜像
docker pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest
-# Pull Google Container Registry images
+# 拉取谷歌容器注册表镜像
docker pull xget.xi-xu.me/cr/gcr/distroless/base:latest
-# Pull Microsoft Container Registry images
+# 拉取微软容器注册表镜像
docker pull xget.xi-xu.me/cr/mcr/dotnet/runtime:8.0
```
-#### Kubernetes Deployment Configuration
+#### Kubernetes 部署配置
```yaml
-# deployment.yaml - Use Xget's images
+# deployment.yaml - 使用 Xget 的镜像
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -2024,10 +2034,10 @@ spec:
- containerPort: 6379
```
-#### Docker Compose Configuration
+#### Docker Compose 配置
```yaml
-# docker-compose.yml - Use Xget accelerated images
+# docker-compose.yml - 使用 Xget 加速镜像
version: '3.8'
services:
web:
@@ -2054,10 +2064,10 @@ volumes:
mssql_data:
```
-#### Dockerfile Optimization
+#### Dockerfile 优化
```dockerfile
-# Use Xget accelerated base images in Dockerfile
+# 在 Dockerfile 中使用 Xget 加速基础镜像
FROM xget.xi-xu.me/cr/ghcr/nodejs/node:18-alpine AS builder
WORKDIR /app
@@ -2067,21 +2077,21 @@ RUN npm install
COPY . .
RUN npm run build
-# Production stage
+# 生产阶段
FROM xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest
COPY --from=builder /app/dist /usr/share/nginx/html
-# Use Microsoft Container Registry's .NET image
+# 使用微软容器注册表的 .NET 镜像
FROM xget.xi-xu.me/cr/mcr/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
COPY --from=builder /app/publish .
ENTRYPOINT ["dotnet", "MyApp.dll"]
```
-#### CI/CD Integration
+#### CI/CD 集成
```yaml
-# GitHub Actions - Use Xget to accelerate container builds
+# GitHub Actions - 使用 Xget 加速容器构建
name: Build and Deploy
on: [push]
@@ -2093,37 +2103,37 @@ jobs:
- name: Build with accelerated base images
run: |
- # Build using Xget's base images
+ # 构建时使用 Xget 的基础镜像
docker build -t myapp:latest \
--build-arg BASE_IMAGE=xget.xi-xu.me/cr/ghcr/nodejs/node:18-alpine .
- name: Test with accelerated images
run: |
- # Test using accelerated images
+ # 使用加速镜像进行测试
docker run --rm \
xget.xi-xu.me/cr/mcr/dotnet/runtime:8.0 \
dotnet --version
```
-#### Podman Configuration
+#### Podman 配置
```bash
-# Configure Podman to use Xget image acceleration
-# Edit /etc/containers/registries.conf
+# 配置 Podman 使用 Xget 镜像加速
+# 编辑 /etc/containers/registries.conf
[[registry]]
prefix = "ghcr.io"
location = "xget.xi-xu.me/cr/ghcr"
-# Or pull directly
+# 或者直接拉取
podman pull xget.xi-xu.me/cr/ghcr/alpine/alpine:latest
podman pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest
```
-#### containerd Configuration
+#### containerd 配置
```toml
-# Configure containerd to use Xget
-# Edit /etc/containerd/config.toml
+# 配置 containerd 使用 Xget
+# 编辑 /etc/containerd/config.toml
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."ghcr.io"]
endpoint = ["https://xget.xi-xu.me/cr/ghcr"]
@@ -2132,11 +2142,11 @@ podman pull xget.xi-xu.me/cr/ghcr/nginxinc/nginx-unprivileged:latest
```
```bash
-# Restart containerd
+# 重启 containerd
sudo systemctl restart containerd
```
-### AI Inference API Acceleration
+### AI 推理 API 加速
#### OpenAI API
@@ -2145,7 +2155,7 @@ from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
- base_url="https://xget.xi-xu.me/ip/openai/v1", # Use Xget
+ base_url="https://xget.xi-xu.me/ip/openai/v1", # 使用 Xget
)
response = client.responses.create(
@@ -2163,7 +2173,7 @@ from anthropic import Anthropic
client = Anthropic(
api_key="your-api-key",
- base_url="https://xget.xi-xu.me/ip/anthropic", # Use Xget
+ base_url="https://xget.xi-xu.me/ip/anthropic", # 使用 Xget
)
message = client.messages.create(
@@ -2188,7 +2198,7 @@ from google.genai import types
client = genai.Client(
api_key="your-api-key",
- http_options=types.HttpOptions(base_url="https://xget.xi-xu.me/ip/gemini"), # Use Xget
+ http_options=types.HttpOptions(base_url="https://xget.xi-xu.me/ip/gemini"), # 使用 Xget
)
response = client.models.generate_content(
@@ -2199,7 +2209,7 @@ response = client.models.generate_content(
print(response.text)
```
-#### Multi-Provider Unified Interface
+#### 多提供商统一接口
```python
from openai import OpenAI
@@ -2211,7 +2221,7 @@ providers = [
]
for name, key, path, model in providers:
- client = OpenAI(api_key=key, base_url="https://xget.xi-xu.me/ip" + path) # Use Xget
+ client = OpenAI(api_key=key, base_url="https://xget.xi-xu.me/ip" + path) # 使用 Xget
response = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": f"Hello, who are you?"}],
@@ -2219,15 +2229,15 @@ for name, key, path, model in providers:
print(name, "=>", response.choices[0].message.content)
```
-#### Use in JavaScript/Node.js
+#### JavaScript/Node.js 中使用
```javascript
-// OpenAI API acceleration
+// OpenAI API 加速
import OpenAI from "openai";
const openaiClient = new OpenAI({
apiKey: "your-openai-api-key",
- baseURL: "https://xget.xi-xu.me/ip/openai/v1", // Use Xget
+ baseURL: "https://xget.xi-xu.me/ip/openai/v1", // 使用 Xget
});
async function chatWithGPT() {
@@ -2239,12 +2249,12 @@ async function chatWithGPT() {
console.log(response.output_text);
}
-// Claude API acceleration
+// Claude API 加速
import Anthropic from "@anthropic-ai/sdk";
const anthropicClient = new Anthropic({
apiKey: "your-claude-api-key",
- baseURL: "https://xget.xi-xu.me/ip/anthropic", // Use Xget
+ baseURL: "https://xget.xi-xu.me/ip/anthropic", // 使用 Xget
});
async function chatWithClaude() {
@@ -2262,7 +2272,7 @@ async function chatWithClaude() {
console.log(message.content[0].text);
}
-// Gemini API acceleration
+// Gemini API 加速
import { GoogleGenAI } from "@google/genai";
const geminiClient = new GoogleGenAI({
@@ -2275,7 +2285,7 @@ async function chatWithGemini() {
contents: "Hello, Gemini!",
config: {
httpOptions: {
- baseUrl: "https://xget.xi-xu.me/ip/gemini", // Use Xget
+ baseUrl: "https://xget.xi-xu.me/ip/gemini", // 使用 Xget
},
},
});
@@ -2284,10 +2294,10 @@ async function chatWithGemini() {
}
```
-#### Environment Variable Configuration
+#### 环境变量配置
```bash
-# Configure in .env file
+# 在 .env 文件中配置
OPENAI_BASE_URL=https://xget.xi-xu.me/ip/openai
ANTHROPIC_BASE_URL=https://xget.xi-xu.me/ip/anthropic
GEMINI_BASE_URL=https://xget.xi-xu.me/ip/gemini
@@ -2296,229 +2306,229 @@ MISTRAL_AI_BASE_URL=https://xget.xi-xu.me/ip/mistralai
GROQ_BASE_URL=https://xget.xi-xu.me/ip/groq
```
-Then use in code:
+然后在代码中使用:
```python
import os
from openai import OpenAI
-# Read configuration from environment variables
+# 从环境变量读取配置
client = OpenAI(
api_key=os.getenv("OPENAI_API_KEY"),
- base_url=os.getenv("OPENAI_BASE_URL") # Automatically uses Xget
+ base_url=os.getenv("OPENAI_BASE_URL") # 自动使用 Xget
)
```
-## 🚀 Deployment
+## 🚀 部署
-### Deploy to Cloudflare Workers
+### 部署到 Cloudflare Workers
-1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
+1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
-2. **Get Cloudflare credentials**:
- - Visit [Account API tokens](https://dash.cloudflare.com/?to=/:account/api-tokens) to create and note an API token, using the "Edit Cloudflare Workers" template.
- - Visit [Workers and Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) to note the Account ID.
+2. **获取 Cloudflare 凭证**:
+ - 访问[账户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板
+ - 访问 [Workers 和 Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) 记录 Account ID
-3. **Configure GitHub Secrets**:
- - Go to your GitHub repository → Settings → Secrets and variables → Actions
- - Add the following secrets:
- - `CLOUDFLARE_API_TOKEN`: Your API token
- - `CLOUDFLARE_ACCOUNT_ID`: Your Account ID
+3. **配置 GitHub Secrets**:
+ - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions
+ - 添加以下 secrets:
+ - `CLOUDFLARE_API_TOKEN`:你的 API 令牌
+ - `CLOUDFLARE_ACCOUNT_ID`:你的 Account ID
-4. **Trigger deployment**:
- - Pushing code to the `main` branch will automatically trigger deployment
- - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment
- - You can also manually trigger deployment in the GitHub Actions page
+4. **触发部署**:
+ - 推送代码到 `main` 分支会自动触发部署
+ - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署
+ - 也可以在 GitHub Actions 页面手动触发部署
-5. **Bind custom domain** (optional): Bind your custom domain in the Cloudflare Workers console
+5. **绑定自定义域名**(可选):在 Cloudflare Workers 控制台中绑定你的自定义域名
-### Deploy to Cloudflare Pages
+### 部署到 Cloudflare Pages
-1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
+1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
-2. **Get Cloudflare credentials**:
- - Visit [Account API tokens](https://dash.cloudflare.com/?to=/:account/api-tokens) to create and note an API token, using the "Edit Cloudflare Workers" template.
- - Visit [Workers and Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) to note the Account ID.
+2. **获取 Cloudflare 凭证**:
+ - 访问[账户 API 令牌](https://dash.cloudflare.com/?to=/:account/api-tokens)创建并记录 API 令牌,使用“编辑 Cloudflare Workers”模板
+ - 访问 [Workers 和 Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages) 记录 Account ID
-3. **Configure GitHub Secrets**:
- - Go to your GitHub repository → Settings → Secrets and variables → Actions
- - Add the following secrets:
- - `CLOUDFLARE_API_TOKEN`: Your API token
- - `CLOUDFLARE_ACCOUNT_ID`: Your Account ID
+3. **配置 GitHub Secrets**:
+ - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions
+ - 添加以下 secrets:
+ - `CLOUDFLARE_API_TOKEN`:你的 API 令牌
+ - `CLOUDFLARE_ACCOUNT_ID`:你的 Account ID
-4. **Trigger deployment**:
- - The repository will automatically convert Workers code to Pages-compatible format and sync to the `pages` branch
- - Pushing code to the `main` branch will automatically trigger sync and deployment workflows
- - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment
- - You can also manually trigger deployment in the GitHub Actions page
+4. **触发部署**:
+ - 存储库会自动将 Workers 代码转换为 Pages 兼容格式并同步到 `pages` 分支
+ - 推送代码到 `main` 分支会自动触发同步和部署工作流
+ - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署
+ - 也可以在 GitHub Actions 页面手动触发部署
-5. **Bind custom domain** (optional): Bind your custom domain in the Cloudflare Pages console
+5. **绑定自定义域名**(可选):在 Cloudflare Pages 控制台中绑定你的自定义域名
-**Note**: The `pages` branch is automatically generated from the `main` branch. Do not manually edit the `pages` branch as it will be overwritten by the sync workflow.
+**注意**:`pages` 分支是从 `main` 分支自动生成的。请勿手动编辑 `pages` 分支,因为它会被同步工作流覆盖。
-### Deploy to EdgeOne Pages
+### 部署到 EdgeOne Pages
-1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
+1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
-2. **Get EdgeOne Pages API Token**:
- - Visit [China EdgeOne Console](https://console.cloud.tencent.com/edgeone/pages?tab=api) or [International EdgeOne Console](https://console.tencentcloud.com/edgeone/pages?tab=api) to create and note an API Token
+2. **获取 EdgeOne Pages API Token**:
+ - 访问[中国站 EdgeOne 控制台](https://console.cloud.tencent.com/edgeone/pages?tab=api)或[国际站 EdgeOne 控制台](https://console.tencentcloud.com/edgeone/pages?tab=api)创建并记录 API Token
-3. **Configure GitHub Secrets**:
- - Go to your GitHub repository → Settings → Secrets and variables → Actions
- - Add the following secret:
- - `EDGEONE_PAGES_API_TOKEN`: Your API Token
+3. **配置 GitHub Secrets**:
+ - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions
+ - 添加以下 secret:
+ - `EDGEONE_API_TOKEN`:你的 API Token
-4. **Trigger deployment**:
- - The repository will automatically convert Workers code to Pages-compatible format and sync to the `pages` branch
- - Pushing code to the `main` branch will automatically trigger sync and deployment workflows
- - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment
- - You can also manually trigger deployment in the GitHub Actions page
+4. **触发部署**:
+ - 存储库会自动将 Workers 代码转换为 Pages 兼容格式并同步到 `pages` 分支
+ - 推送代码到 `main` 分支会自动触发同步和部署工作流
+ - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署
+ - 也可以在 GitHub Actions 页面手动触发部署
-5. **Bind custom domain** (optional): Bind your custom domain in the EdgeOne Pages console
+5. **绑定自定义域名**(可选):在 EdgeOne Pages 控制台中绑定你的自定义域名
-**Note**: The `pages` branch is automatically generated from the `main` branch. Do not manually edit the `pages` branch as it will be overwritten by the sync workflow.
+**注意**:`pages` 分支是从 `main` 分支自动生成的。请勿手动编辑 `pages` 分支,因为它会被同步工作流覆盖。
-### Deploy to Vercel
+### 部署到 Vercel
-1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
+1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
-2. **Get Vercel credentials**:
- - Visit [Vercel Account Settings](https://vercel.com/account/settings/tokens) to create and note an Access Token
- - Visit Team Settings to note the Team ID
- - Visit project's Settings after creating a new project to note the Project ID
+2. **获取 Vercel 凭证**:
+ - 访问 [Vercel Account Settings](https://vercel.com/account/settings/tokens) 创建并记录 Access Token
+ - 访问 Team Settings 记录 Team ID
+ - 新建项目后访问项目的 Settings 记录 Project ID
-3. **Configure GitHub Secrets**:
- - Go to your GitHub repository → Settings → Secrets and variables → Actions
- - Add the following secrets:
- - `VERCEL_TOKEN`: Your Access Token
- - `VERCEL_ORG_ID`: Your Team ID
- - `VERCEL_PROJECT_ID`: Your Project ID
+3. **配置 GitHub Secrets**:
+ - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions
+ - 添加以下 secrets:
+ - `VERCEL_TOKEN`:你的 Access Token
+ - `VERCEL_ORG_ID`:你的 Team ID
+ - `VERCEL_PROJECT_ID`:你的 Project ID
-4. **Trigger deployment**:
- - The repository will automatically convert Workers code to Functions-compatible format and sync to the `functions` branch
- - Pushing code to the `main` branch will automatically trigger sync and deployment workflows
- - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment
- - You can also manually trigger deployment in the GitHub Actions page
+4. **触发部署**:
+ - 存储库会自动将 Workers 代码转换为 Functions 兼容格式并同步到 `functions` 分支
+ - 推送代码到 `main` 分支会自动触发同步和部署工作流
+ - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署
+ - 也可以在 GitHub Actions 页面手动触发部署
-5. **Bind custom domain** (optional): Bind your custom domain in the Vercel console
+5. **绑定自定义域名**(可选):在 Vercel 控制台中绑定你的自定义域名
-**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow.
+**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。
-### Deploy to Netlify
+### 部署到 Netlify
-1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
+1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
-2. **Get Netlify credentials**:
- - Visit [Netlify User Settings](https://app.netlify.com/user/applications) to create and note a personal access token
- - Visit Project configuration after creating a new project to note the Project ID
+2. **获取 Netlify 凭证**:
+ - 访问 [Netlify User Settings](https://app.netlify.com/user/applications) 创建并记录 personal access token
+ - 新建项目后访问 Project configuration 记录 Project ID
-3. **Configure GitHub Secrets**:
- - Go to your GitHub repository → Settings → Secrets and variables → Actions
- - Add the following secrets:
- - `NETLIFY_AUTH_TOKEN`: Your personal access token
- - `NETLIFY_SITE_ID`: Your Project ID
+3. **配置 GitHub Secrets**:
+ - 进入你的 GitHub 存储库 → Settings → Secrets and variables → Actions
+ - 添加以下 secrets:
+ - `NETLIFY_AUTH_TOKEN`:你的 personal access token
+ - `NETLIFY_SITE_ID`:你的 Project ID
-4. **Trigger deployment**:
- - The repository will automatically convert Workers code to Functions-compatible format and sync to the `functions` branch
- - Pushing code to the `main` branch will automatically trigger sync and deployment workflows
- - Modifying only documentation files (`.md`), `LICENSE`, `.gitignore`, etc. will not trigger deployment
- - You can also manually trigger deployment in the GitHub Actions page
+4. **触发部署**:
+ - 存储库会自动将 Workers 代码转换为 Functions 兼容格式并同步到 `functions` 分支
+ - 推送代码到 `main` 分支会自动触发同步和部署工作流
+ - 仅修改文档文件(`.md`)、`LICENSE`、`.gitignore` 等不会触发部署
+ - 也可以在 GitHub Actions 页面手动触发部署
-5. **Bind custom domain** (optional): Bind your custom domain in the Netlify console
+5. **绑定自定义域名**(可选):在 Netlify 控制台中绑定你的自定义域名
-**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow.
+**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。
-### Deploy to Deno Deploy
+### 部署到 Deno Deploy
-1. **Fork this repository**: [Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
+1. **fork 本存储库**:[Fork xixu-me/Xget](https://github.com/xixu-me/Xget/fork)
-2. **Switch default branch**:
- - Go to your GitHub repository → Settings → General → Default branch
- - Switch the default branch from `main` to `functions`
+2. **切换默认分支**:
+ - 进入你的 GitHub 存储库 → Settings → General → Default branch
+ - 将默认分支从 `main` 切换到 `functions`
-3. **Deploy to Deno Deploy**:
- - Follow the [Deno Deploy official documentation](https://docs.deno.com/deploy/getting_started/) for deployment
- - Create a new project in the Deno Deploy console and connect your GitHub repository
+3. **部署到 Deno Deploy**:
+ - 参考 [Deno Deploy 官方文档](https://docs.deno.com/deploy/getting_started/)执行部署
+ - 在 Deno Deploy 控制台创建新项目并连接你的 GitHub 存储库
-4. **Bind custom domain** (optional): Bind your custom domain in the Deno Deploy console
+4. **绑定自定义域名**(可选):在 Deno Deploy 控制台中绑定你的自定义域名
-**Note**: The `functions` branch is automatically generated from the `main` branch. Do not manually edit the `functions` branch as it will be overwritten by the sync workflow.
+**注意**:`functions` 分支是从 `main` 分支自动生成的。请勿手动编辑 `functions` 分支,因为它会被同步工作流覆盖。
-### Self-Hosted Deployment
+### 自托管部署
-If you prefer to run Xget on your own server, you can use Docker or Podman deployment:
+如果你希望在自己的服务器上运行 Xget,可以使用 Docker 或 Podman 部署:
-#### Using Pre-built Image
+#### 使用预构建镜像
-Pull and run the pre-built image from GitHub Container Registry:
+从 GitHub Container Registry 拉取并运行预构建的镜像:
-**Using Docker:**
+**使用 Docker:**
```bash
-# Pull the latest image
+# 拉取最新镜像
docker pull ghcr.io/xixu-me/xget:latest
-# Run the container
+# 运行容器
docker run -d \
--name xget \
-p 8080:8080 \
ghcr.io/xixu-me/xget:latest
```
-**Using Podman:**
+**使用 Podman:**
```bash
-# Pull the latest image
+# 拉取最新镜像
podman pull ghcr.io/xixu-me/xget:latest
-# Run the container
+# 运行容器
podman run -d \
--name xget \
-p 8080:8080 \
ghcr.io/xixu-me/xget:latest
```
-#### Building Locally
+#### 本地构建
-Build the container image from source:
+从源码构建容器镜像:
-**Using Docker:**
+**使用 Docker:**
```bash
-# Clone the repository
+# 克隆存储库
git clone https://github.com/xixu-me/Xget.git
cd Xget
-# Build the image
+# 构建镜像
docker build -t xget:local .
-# Run the container
+# 运行容器
docker run -d \
--name xget \
-p 8080:8080 \
xget:local
```
-**Using Podman:**
+**使用 Podman:**
```bash
-# Clone the repository
+# 克隆存储库
git clone https://github.com/xixu-me/Xget.git
cd Xget
-# Build the image
+# 构建镜像
podman build -t xget:local .
-# Run the container
+# 运行容器
podman run -d \
--name xget \
-p 8080:8080 \
xget:local
```
-#### Using Docker Compose / Podman Compose
+#### 使用 Docker Compose / Podman Compose
-Create a `docker-compose.yml` file:
+创建 `docker-compose.yml` 文件:
```yaml
version: '3.8'
@@ -2532,23 +2542,23 @@ services:
restart: unless-stopped
```
-**Using Docker Compose:**
+**使用 Docker Compose:**
```bash
docker-compose up -d
```
-**Using Podman Compose:**
+**使用 Podman Compose:**
```bash
podman-compose up -d
-# Or use podman compose (Podman 4.0+)
+# 或者使用 podman compose (Podman 4.0+)
podman compose up -d
```
-After deployment, Xget will run on port 8080.
+部署完成后,Xget 将在 8080 端口运行。
-If you want to deploy and run Xget on DigitalOcean, please refer to *[Deploying and Optimizing Xget on DigitalOcean](docs/deploy-on-digitalocean.md)*. By signing up via the referral link below, you can receive USD 200 in credits to try Droplets, Kubernetes, App Platform, and more:
+如果你希望在 DigitalOcean 上部署和运行 Xget,可以参考文档[《Deploying and Optimizing Xget on DigitalOcean》](docs/deploy-on-digitalocean.md)。通过下方推荐链接注册账户,可获得 200 美元代金券积分,可用于创建 Droplet、Kubernetes、App Platform 等资源:
@@ -2556,43 +2566,43 @@ If you want to deploy and run Xget on DigitalOcean, please refer to *[Deploying
-**Note**: Self-hosted deployment does not include global edge network acceleration. Performance depends on your server configuration and network environment.
+**注意**:自托管部署不包括全球边缘网络加速,性能取决于你的服务器配置和网络环境。
-## 🔧 Configuration
+## 🔧 配置
-### Configuration Parameters
+### 配置参数
-You can customize configuration by modifying `src/config/index.js`:
+你可以通过修改 `src/config/index.js` 来自定义配置:
```javascript
export const CONFIG = {
- TIMEOUT_SECONDS: 30, // Request timeout (seconds)
- MAX_RETRIES: 3, // Maximum retry count
- RETRY_DELAY_MS: 1000, // Retry delay (milliseconds)
- CACHE_DURATION: 1800, // Cache duration (1800 seconds = 30 minutes)
+ TIMEOUT_SECONDS: 30, // 请求超时时间(秒)
+ MAX_RETRIES: 3, // 最大重试次数
+ RETRY_DELAY_MS: 1000, // 重试延迟时间(毫秒)
+ CACHE_DURATION: 1800, // 缓存持续时间(1800秒 = 30分钟)
SECURITY: {
- ALLOWED_METHODS: ["GET", "HEAD"], // Allowed HTTP methods (Git operations dynamically allow POST)
- ALLOWED_ORIGINS: ["*"], // Allowed CORS origins
- MAX_PATH_LENGTH: 2048, // Maximum path length (characters)
+ ALLOWED_METHODS: ["GET", "HEAD"], // 允许的 HTTP 方法(Git 操作会动态允许 POST)
+ ALLOWED_ORIGINS: ["*"], // 允许的 CORS 源
+ MAX_PATH_LENGTH: 2048, // 最大路径长度(字符)
},
};
```
-### Performance Tuning Recommendations
+### 性能调优建议
-- **Cache Optimization**: Adjust `CACHE_DURATION` based on usage patterns, reduce appropriately for frequently updated repositories
-- **Timeout Settings**: Increase `TIMEOUT_SECONDS` appropriately for poor network conditions
-- **Retry Strategy**: Increase `MAX_RETRIES` and `RETRY_DELAY_MS` in high-latency environments
+- **缓存优化**:根据使用模式调整 `CACHE_DURATION`,频繁更新的存储库可适当降低
+- **超时设置**:网络条件较差时可适当增加 `TIMEOUT_SECONDS`
+- **重试策略**:高延迟环境下可增加 `MAX_RETRIES` 和 `RETRY_DELAY_MS`
-### Adding New Platforms
+### 添加新平台
-To add support for new platforms, edit `src/config/platforms.js`:
+要添加对新平台的支持,编辑 `src/config/platforms.js`:
```javascript
export const PLATFORMS = {
- // Existing platforms...
+ // 现有平台...
- // New platform example
+ // 新平台示例
custom: {
base: "https://example.com",
transform: (path) => path.replace(/^\/custom\//, "/"),
@@ -2600,109 +2610,109 @@ export const PLATFORMS = {
};
```
-## 🚧 Development
+## 🚧 开发
-1. **Repository Setup**
+1. **存储库设置**
```bash
git clone https://github.com/xixu-me/Xget.git
cd Xget
npm install
- npx wrangler login # First time use
+ npx wrangler login # 首次使用
```
-2. **Local Development**
+2. **本地开发**
```bash
- npm run dev # Start development server (http://localhost:8787)
- npm run test:run # Run complete test suite
- npm run test:coverage # Generate test coverage report
- npm run lint # Code linting
- npm run format # Code formatting
- npm run deploy # Deploy to production
+ npm run dev # 启动开发服务器 (http://localhost:8787)
+ npm run test:run # 运行完整测试套件
+ npm run test:coverage # 生成测试覆盖率报告
+ npm run lint # 代码检查
+ npm run format # 代码格式化
+ npm run deploy # 部署到生产
```
-## 🧪 Testing
+## 🧪 测试
-The repository includes a complete test suite to ensure code quality and functional correctness.
+存储库包含完整的测试套件,确保代码质量和功能正确性。
-### Complete Testing
+### 完整测试
```bash
-# Install test dependencies
+# 安装测试依赖
npm install
-# Run all tests
+# 运行所有测试
npm run test:run
-# Generate coverage report
+# 生成覆盖率报告
npm run test:coverage
-# Watch mode
+# 监视模式
npm run test:watch
```
-### Test Coverage
+### 测试覆盖
-- **Unit Tests**: Core functionality, platform configuration, performance monitoring
-- **Integration Tests**: End-to-end processes, platform integration, Git protocol
-- **Security Tests**: Input validation, security headers, permission control
-- **Performance Tests**: Response time, memory usage, concurrent processing
+- **单元测试**: 核心功能、平台配置、性能监控
+- **集成测试**: 端到端流程、平台集成、Git 协议
+- **安全测试**: 输入验证、安全头、权限控制
+- **性能测试**: 响应时间、内存使用、并发处理
-## 🔍 Troubleshooting
+## 🔍 故障排除
-### Common Issues
+### 常见问题
-**Q: No significant speed improvement?**
-A: Check if source files are already cached at CDN edge nodes. Initial access may be slower, subsequent accesses will be significantly faster.
+**Q: 下载速度没有明显提升?**
+A: 检查源文件是否已经在 CDN 边缘节点缓存,首次访问可能较慢,后续访问会显著提升。
-**Q: Git operations failing?**
-A: Confirm correct URL format is used and Git client version supports HTTPS proxy.
+**Q: Git 操作失败?**
+A: 确认使用了正确的 URL 格式,且 Git 客户端版本支持 HTTPS 代理。
-**Q: Cannot access after deployment?**
-A: Check if Cloudflare Workers domain is correctly bound, confirm `wrangler.toml` configuration is correct.
+**Q: 部署后无法访问?**
+A: 检查 Cloudflare Workers 域名是否正确绑定,确认 `wrangler.toml` 配置正确。
-**Q: Getting 400 error?**
-A: Check URL path format, confirm platform prefix is correctly used.
+**Q: 出现 400 错误?**
+A: 检查 URL 路径格式,确认平台前缀正确使用。
-### Performance Monitoring
+### 性能监控
-Performance metrics are returned in response headers:
+在响应头中返回性能指标:
-- `X-Performance-Metrics`: Contains timing statistics for request stages
-- `X-Cache-Status`: Shows cache hit status
+- `X-Performance-Metrics`: 包含请求各阶段的耗时统计
+- `X-Cache-Status`: 显示缓存命中状态
-### Log Debugging
+### 日志调试
-In development environment, you can view detailed logs through Cloudflare Workers console:
+在开发环境中,你可以通过 Cloudflare Workers 控制台查看详细日志:
```bash
npx wrangler dev --log-level debug
```
-## ⚠️ Disclaimer
+## ⚠️ 免责声明
-- **Legal and Compliant Use**: This repository aims to provide unified acceleration services for code repositories, package registries, AI inference APIs, container images, models, datasets, and other legitimate developer resources. Users must strictly comply with the laws and regulations of their jurisdiction and the terms of service of relevant platforms. Any illegal use is the sole responsibility of the user
-- **Non-Affiliation and Independent Responsibility**: This repository has no affiliation, agency, or partnership relationship with any third-party platforms. Any fork, secondary development, redistribution, or derivative version based on this repository is solely the responsibility of its maintainer; authors, maintainers, and contributors bear no legal or joint liability for the actions or consequences of derivative repositories
-- **No Warranty and Limitation of Liability**: To the maximum extent permitted by applicable law, this repository is provided "AS IS" without any express or implied warranties (including but not limited to merchantability, fitness for a particular purpose, non-infringement, etc.). Authors, maintainers, and contributors assume no responsibility for any direct or indirect losses (including but not limited to data loss, business interruption, profit loss, etc.) resulting from the use of this repository
-- **Risk Assumption Principle**: Users should independently assess usage risks, ensure their use is legal and compliant, respect third-party rights, and must not use this repository for any illegal, infringing, malicious, or improper purposes
-- **Third-Party Platform Compliance**: Users must comply with the terms of service, API usage policies, rate limits, and copyright requirements of relevant platforms, and avoid causing overload or interference to source platforms. Each platform has the final interpretation right over its content, services, and policies
-- **Intellectual Property Protection**: Content obtained through this repository is protected by respective copyright laws. Users must comply with relevant licensing agreements, copyright notices, and terms of use, and must not engage in any activities that infringe intellectual property rights
-- **Security Recommendations**: Although this repository adopts a no-log architecture and does not store user request data, due to inherent risks of internet transmission, users are advised to perform security scans on downloaded content, especially for executable files and scripts
-- **Open Source Nature**: This repository is open source. Authors and contributors are not obligated to provide technical support, bug fixes, or continuous maintenance. The inclusion of external contributions does not constitute endorsement or commitment to specific uses or effects
-- **Name Usage Guidelines**: Any representations that may imply authors or contributors provide commercial cooperation, technical support, guarantees, or endorsements are strictly prohibited. The use of repository names or author identifiers must comply with relevant laws and regulations as well as general norms
-- **Disclaimer Updates**: This disclaimer may be updated and revised as the repository develops or legal environments change. Continued use, copying, distribution, or modification of this repository constitutes acceptance of the latest version of this disclaimer
+- **合法合规使用**:本存储库旨在为代码存储库、软件包注册表、AI 推理 API、容器镜像、模型、数据集及更多合法开发者资源提供统一加速服务。使用者应严格遵守所在司法辖区法律法规及相关平台服务条款,任何非法用途的法律责任由使用者自行承担
+- **非关联性与独立责任**:本存储库与各第三方平台不存在任何隶属、代理或合作关系。任何基于本存储库的 fork、二次开发、再分发或衍生版本均由其维护者独立承担全部责任;作者、维护者及贡献者不对衍生存储库的任何行为或后果承担法律或连带责任
+- **无担保与免责条款**:在适用法律允许的最大范围内,本存储库按“现状(AS IS)”提供,不提供任何明示或暗示担保(包括但不限于适销性、特定用途适用性、非侵权等)。对因使用本存储库而造成的任何直接或间接损失(包括但不限于数据丢失、业务中断、利润损失等),作者、维护者及贡献者不承担任何责任
+- **风险自担原则**:使用者应自行评估使用风险,确保其使用行为合法合规,不侵犯第三方权益,不得将本存储库用于任何违法、侵权、恶意或不当用途
+- **第三方平台合规**:使用者应遵守相关平台的服务条款、API 使用政策、速率限制及版权要求,避免对源平台造成过载或干扰。各平台对其内容、服务及政策拥有最终解释权
+- **知识产权保护**:通过本存储库获取的内容受相应版权法保护。使用者应遵守相关许可协议、版权声明及使用条款,不得从事任何侵犯知识产权的行为
+- **安全防护建议**:虽然本存储库采用无日志架构,不存储用户请求数据,但基于互联网传输的固有风险,建议使用者对下载内容进行安全扫描,尤其对可执行文件、脚本等保持谨慎
+- **开源性质声明**:本存储库为开源项目,作者与贡献者不承担提供技术支持、错误修复或持续维护的义务。外部贡献的合并不代表对特定用途或效果的承诺与背书
+- **名称使用规范**:严禁任何可能暗示作者或贡献者提供商业合作、技术支持、担保或背书的表述。涉及存储库名称或作者标识的使用应遵循相关法律法规及通用规范
+- **免责声明更新**:本免责声明可能随存储库发展或法律环境变化进行更新修订。使用者继续使用、复制、分发或修改本存储库即视为接受最新版本的免责声明
-## 🤝 Contributing
+## 🤝 贡献
-We welcome all forms of contribution! Please check the [Contributing Guide](CONTRIBUTING.md) to learn how to participate in repository development.
+我们欢迎各种形式的贡献!请查看[贡献指南](CONTRIBUTING.md)了解如何参与存储库开发。
-1. **Report Issues**: Use [issue templates](https://github.com/xixu-me/Xget/issues/new/choose) to report bugs or propose feature requests
-2. **Submit Code**: Fork the repository, create a feature branch, submit a pull request
-3. **Improve Documentation**: Fix errors, add examples, improve descriptions
-4. **Testing Feedback**: Test in different environments and provide feedback
+1. **报告问题**: 使用 [issue 模板](https://github.com/xixu-me/Xget/issues/new/choose)报告 bug 或提出功能请求
+2. **提交代码**: fork 存储库,创建功能分支,提交 pull request
+3. **改进文档**: 修正错误、添加示例、完善说明
+4. **测试反馈**: 在不同环境下测试并提供反馈
-## 🌟 Star History
+## 🌟 Star 历史
@@ -2712,18 +2722,20 @@ We welcome all forms of contribution! Please check the [Contributing Guide](CONT
-## 📝 License
+## 📝 许可证
-Copyright © Xi Xu.
+版权所有 © Xi Xu。
-This repository is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.
+本存储库采用 GPL-3.0 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。
---
-**If this repository helps you, please consider giving it a ⭐ star!**
+**如果这个存储库对您有帮助,请考虑给它一个 ⭐ star!**
Made with ❤️ by [Xi Xu](https://xi-xu.me)
+
+[](https://dartnode.com "Powered by DartNode - Free VPS for Open Source")