1 parent
1ed4de50e7
commit
6f0d7e15f8
6 files changed
+161
-1
No files matched your search
@@ -36,6 +36,7 @@
|
||||
[](#apache-software-download-acceleration)
|
||||
[](#gradle-package-acceleration)
|
||||
[](#homebrew-package-acceleration)
|
||||
[](#scoop-package-acceleration)
|
||||
[](#ruby-package-acceleration)
|
||||
[](#r-package-acceleration)
|
||||
[](#perl-package-acceleration)
|
||||
@@ -239,6 +240,7 @@ Using the pre-deployed instance **`xget.xi-xu.me`** or your own deployed instanc
|
||||
| Apache | `apache` | `https://downloads.apache.org/...` | `https://xget.xi-xu.me/apache/...` |
|
||||
| Gradle | `gradle` | `https://plugins.gradle.org/...` | `https://xget.xi-xu.me/gradle/...` |
|
||||
| Homebrew | `homebrew` | `https://github.com/Homebrew/...` | `https://xget.xi-xu.me/homebrew/...` |
|
||||
| Scoop | `scoop` | `https://github.com/ScoopInstaller/...` | `https://xget.xi-xu.me/scoop/...` |
|
||||
| RubyGems | `rubygems` | `https://rubygems.org/...` | `https://xget.xi-xu.me/rubygems/...` |
|
||||
| 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/...` |
|
||||
@@ -499,6 +501,22 @@ https://ghcr.io/v2/homebrew/core/git/manifests/2.39.0
|
||||
https://xget.xi-xu.me/homebrew/bottles/v2/homebrew/core/git/manifests/2.39.0
|
||||
```
|
||||
|
||||
#### Scoop
|
||||
|
||||
```url
|
||||
# Scoop default bucket original URL
|
||||
https://github.com/ScoopInstaller/Main
|
||||
|
||||
# Converted (add scoop prefix)
|
||||
https://xget.xi-xu.me/scoop/Main
|
||||
|
||||
# Scoop core repository original URL
|
||||
https://github.com/ScoopInstaller/Scoop.git
|
||||
|
||||
# Converted (add scoop prefix)
|
||||
https://xget.xi-xu.me/scoop/Scoop.git
|
||||
```
|
||||
|
||||
#### RubyGems
|
||||
|
||||
```url
|
||||
@@ -1362,6 +1380,21 @@ echo $HOMEBREW_API_DOMAIN
|
||||
echo $HOMEBREW_BOTTLE_DOMAIN
|
||||
```
|
||||
|
||||
### Scoop Package Acceleration
|
||||
|
||||
#### Access Official Scoop Repositories Through Xget
|
||||
|
||||
```bash
|
||||
# Clone the Scoop core repository through Xget
|
||||
git clone https://xget.xi-xu.me/scoop/Scoop.git
|
||||
|
||||
# Add the default main bucket through Xget
|
||||
scoop bucket add main https://xget.xi-xu.me/scoop/Main
|
||||
|
||||
# Add another official bucket through Xget
|
||||
scoop bucket add extras https://xget.xi-xu.me/scoop/Extras
|
||||
```
|
||||
|
||||
### Ruby Package Acceleration
|
||||
|
||||
#### Configure RubyGems to Use Xget Mirror
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
[](#apache-软件下载加速)
|
||||
[](#gradle-包管理加速)
|
||||
[](#homebrew-包管理加速)
|
||||
[](#scoop-包管理加速)
|
||||
[](#ruby-包管理加速)
|
||||
[](#r-包管理加速)
|
||||
[](#perl-包管理加速)
|
||||
@@ -239,6 +240,7 @@ classDiagram
|
||||
| Apache | `apache` | `https://downloads.apache.org/...` | `https://xget.xi-xu.me/apache/...` |
|
||||
| Gradle | `gradle` | `https://plugins.gradle.org/...` | `https://xget.xi-xu.me/gradle/...` |
|
||||
| Homebrew | `homebrew` | `https://github.com/Homebrew/...` | `https://xget.xi-xu.me/homebrew/...` |
|
||||
| Scoop | `scoop` | `https://github.com/ScoopInstaller/...` | `https://xget.xi-xu.me/scoop/...` |
|
||||
| RubyGems | `rubygems` | `https://rubygems.org/...` | `https://xget.xi-xu.me/rubygems/...` |
|
||||
| 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/...` |
|
||||
@@ -499,6 +501,22 @@ https://ghcr.io/v2/homebrew/core/git/manifests/2.39.0
|
||||
https://xget.xi-xu.me/homebrew/bottles/v2/homebrew/core/git/manifests/2.39.0
|
||||
```
|
||||
|
||||
#### Scoop
|
||||
|
||||
```url
|
||||
# Scoop 默认 bucket 原始 URL
|
||||
https://github.com/ScoopInstaller/Main
|
||||
|
||||
# 转换后(添加 scoop 前缀)
|
||||
https://xget.xi-xu.me/scoop/Main
|
||||
|
||||
# Scoop 核心仓库原始 URL
|
||||
https://github.com/ScoopInstaller/Scoop.git
|
||||
|
||||
# 转换后(添加 scoop 前缀)
|
||||
https://xget.xi-xu.me/scoop/Scoop.git
|
||||
```
|
||||
|
||||
#### RubyGems
|
||||
|
||||
```url
|
||||
@@ -1362,6 +1380,21 @@ echo $HOMEBREW_API_DOMAIN
|
||||
echo $HOMEBREW_BOTTLE_DOMAIN
|
||||
```
|
||||
|
||||
### Scoop 包管理加速
|
||||
|
||||
#### 通过 Xget 访问官方 Scoop 仓库
|
||||
|
||||
```bash
|
||||
# 通过 Xget 克隆 Scoop 核心仓库
|
||||
git clone https://xget.xi-xu.me/scoop/Scoop.git
|
||||
|
||||
# 通过 Xget 添加默认 main bucket
|
||||
scoop bucket add main https://xget.xi-xu.me/scoop/Main
|
||||
|
||||
# 通过 Xget 添加其他官方 bucket
|
||||
scoop bucket add extras https://xget.xi-xu.me/scoop/Extras
|
||||
```
|
||||
|
||||
### Ruby 包管理加速
|
||||
|
||||
#### 配置 RubyGems 使用 Xget 镜像
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
[](#apache-軟體下載加速)
|
||||
[](#gradle-軟體包管理加速)
|
||||
[](#homebrew-軟體包管理加速)
|
||||
[](#scoop-軟體包管理加速)
|
||||
[](#ruby-軟體包管理加速)
|
||||
[](#r-軟體包管理加速)
|
||||
[](#perl-軟體包管理加速)
|
||||
@@ -239,6 +240,7 @@ classDiagram
|
||||
| Apache | `apache` | `https://downloads.apache.org/...` | `https://xget.xi-xu.me/apache/...` |
|
||||
| Gradle | `gradle` | `https://plugins.gradle.org/...` | `https://xget.xi-xu.me/gradle/...` |
|
||||
| Homebrew | `homebrew` | `https://github.com/Homebrew/...` | `https://xget.xi-xu.me/homebrew/...` |
|
||||
| Scoop | `scoop` | `https://github.com/ScoopInstaller/...` | `https://xget.xi-xu.me/scoop/...` |
|
||||
| RubyGems | `rubygems` | `https://rubygems.org/...` | `https://xget.xi-xu.me/rubygems/...` |
|
||||
| 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/...` |
|
||||
@@ -499,6 +501,22 @@ https://ghcr.io/v2/homebrew/core/git/manifests/2.39.0
|
||||
https://xget.xi-xu.me/homebrew/bottles/v2/homebrew/core/git/manifests/2.39.0
|
||||
```
|
||||
|
||||
#### Scoop
|
||||
|
||||
```url
|
||||
# Scoop 預設 bucket 原始 URL
|
||||
https://github.com/ScoopInstaller/Main
|
||||
|
||||
# 轉換後(新增 scoop 前綴)
|
||||
https://xget.xi-xu.me/scoop/Main
|
||||
|
||||
# Scoop 核心儲存庫原始 URL
|
||||
https://github.com/ScoopInstaller/Scoop.git
|
||||
|
||||
# 轉換後(新增 scoop 前綴)
|
||||
https://xget.xi-xu.me/scoop/Scoop.git
|
||||
```
|
||||
|
||||
#### RubyGems
|
||||
|
||||
```url
|
||||
@@ -1362,6 +1380,21 @@ echo $HOMEBREW_API_DOMAIN
|
||||
echo $HOMEBREW_BOTTLE_DOMAIN
|
||||
```
|
||||
|
||||
### Scoop 軟體包管理加速
|
||||
|
||||
#### 透過 Xget 存取官方 Scoop 儲存庫
|
||||
|
||||
```bash
|
||||
# 透過 Xget 複製 Scoop 核心儲存庫
|
||||
git clone https://xget.xi-xu.me/scoop/Scoop.git
|
||||
|
||||
# 透過 Xget 新增預設 main bucket
|
||||
scoop bucket add main https://xget.xi-xu.me/scoop/Main
|
||||
|
||||
# 透過 Xget 新增其他官方 bucket
|
||||
scoop bucket add extras https://xget.xi-xu.me/scoop/Extras
|
||||
```
|
||||
|
||||
### Ruby 軟體包管理加速
|
||||
|
||||
#### 配置 RubyGems 使用 Xget 鏡像
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
* - `homebrew` - Homebrew repositories (github.com/Homebrew)
|
||||
* - `homebrew-api` - Homebrew API (formulae.brew.sh/api)
|
||||
* - `homebrew-bottles` - Homebrew bottles (ghcr.io)
|
||||
* - `scoop` - Scoop repositories (github.com/ScoopInstaller)
|
||||
* - `rubygems` - RubyGems (rubygems.org)
|
||||
* - `cran` - R CRAN (cran.r-project.org)
|
||||
* - `cpan` - Perl CPAN (cpan.org)
|
||||
@@ -152,6 +153,7 @@ export const PLATFORMS = {
|
||||
homebrew: 'https://github.com/Homebrew',
|
||||
'homebrew-api': 'https://formulae.brew.sh/api',
|
||||
'homebrew-bottles': 'https://ghcr.io',
|
||||
scoop: 'https://github.com/ScoopInstaller',
|
||||
rubygems: 'https://rubygems.org',
|
||||
cran: 'https://cran.r-project.org',
|
||||
cpan: 'https://www.cpan.org',
|
||||
@@ -268,6 +270,10 @@ export const SORTED_PLATFORMS = Object.keys(PLATFORMS).sort((a, b) => {
|
||||
* transformPath('/homebrew/api/formula/git.json', 'homebrew-api')
|
||||
* // Returns: '/formula/git.json'
|
||||
* @example
|
||||
* // Scoop repository paths (pass-through)
|
||||
* transformPath('/scoop/Main/blob/master/bucket/git.json', 'scoop')
|
||||
* // Returns: '/Main/blob/master/bucket/git.json'
|
||||
* @example
|
||||
* // Unknown platform (no transformation)
|
||||
* transformPath('/unknown/path', 'nonexistent')
|
||||
* // Returns: '/unknown/path'
|
||||
@@ -389,5 +395,19 @@ export function transformPath(path, platformKey) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Special handling for Scoop repositories
|
||||
*
|
||||
* Scoop's official buckets and core repository are hosted under the
|
||||
* ScoopInstaller organization on GitHub. Paths are passed through as-is.
|
||||
*
|
||||
* Example: `/Main`, `/Main.git/info/refs`, `/Extras/blob/master/bucket/7zip.json`
|
||||
*/
|
||||
if (platformKey === 'scoop') {
|
||||
if (transformedPath.startsWith('/')) {
|
||||
return transformedPath;
|
||||
}
|
||||
}
|
||||
|
||||
return transformedPath;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { transformPath } from '../../src/config/platforms.js';
|
||||
|
||||
describe('Scoop path transformation', () => {
|
||||
it('should handle default bucket repository paths correctly', () => {
|
||||
const path = '/scoop/Main.git/info/refs?service=git-upload-pack';
|
||||
const result = transformPath(path, 'scoop');
|
||||
expect(result).toBe('/Main.git/info/refs?service=git-upload-pack');
|
||||
});
|
||||
|
||||
it('should handle bucket manifest paths correctly', () => {
|
||||
const path = '/scoop/Main/blob/master/bucket/git.json';
|
||||
const result = transformPath(path, 'scoop');
|
||||
expect(result).toBe('/Main/blob/master/bucket/git.json');
|
||||
});
|
||||
|
||||
it('should handle additional official bucket paths correctly', () => {
|
||||
const path = '/scoop/Extras/tree/master/bucket';
|
||||
const result = transformPath(path, 'scoop');
|
||||
expect(result).toBe('/Extras/tree/master/bucket');
|
||||
});
|
||||
|
||||
it('should handle Scoop core repository paths correctly', () => {
|
||||
const path = '/scoop/Scoop/archive/refs/heads/master.zip';
|
||||
const result = transformPath(path, 'scoop');
|
||||
expect(result).toBe('/Scoop/archive/refs/heads/master.zip');
|
||||
});
|
||||
});
|
||||
@@ -16,7 +16,8 @@ describe('Platform Configuration', () => {
|
||||
'npm',
|
||||
'pypi',
|
||||
'conda',
|
||||
'homebrew'
|
||||
'homebrew',
|
||||
'scoop'
|
||||
];
|
||||
|
||||
requiredPlatforms.forEach(platform => {
|
||||
@@ -143,6 +144,14 @@ describe('Platform Configuration', () => {
|
||||
'/v2/distroless/base/manifests/latest'
|
||||
);
|
||||
});
|
||||
|
||||
it('should transform Scoop paths correctly', () => {
|
||||
expect(transformPath('/scoop/Main.git/info/refs', 'scoop')).toBe('/Main.git/info/refs');
|
||||
|
||||
expect(transformPath('/scoop/Main/blob/master/bucket/git.json', 'scoop')).toBe(
|
||||
'/Main/blob/master/bucket/git.json'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Platform Base URLs', () => {
|
||||
@@ -191,6 +200,10 @@ describe('Platform Configuration', () => {
|
||||
expect(PLATFORMS['conda-community']).toBe('https://conda.anaconda.org');
|
||||
});
|
||||
|
||||
it('should have correct Scoop base URL', () => {
|
||||
expect(PLATFORMS.scoop).toBe('https://github.com/ScoopInstaller');
|
||||
});
|
||||
|
||||
it('should have correct container registry base URLs', () => {
|
||||
expect(PLATFORMS['cr-ghcr']).toBe('https://ghcr.io');
|
||||
expect(PLATFORMS['cr-gcr']).toBe('https://gcr.io');
|
||||
|
||||
Reference in new issue
Block a user