-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdistribution.toml
More file actions
212 lines (183 loc) · 6.41 KB
/
distribution.toml
File metadata and controls
212 lines (183 loc) · 6.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# vx Distribution Configuration
# This file defines multiple distribution channels for vx binary releases
# to solve GitHub API rate limiting and improve global accessibility
[distribution]
# Primary distribution channel
primary = "github"
# Fallback channels in order of preference
fallbacks = ["jsdelivr", "fastly", "direct"]
# Enable automatic fallback on failures
auto_fallback = true
# GitHub Releases (Primary)
[channels.github]
name = "GitHub Releases"
type = "github"
base_url = "https://github.com/loonghao/vx/releases"
api_url = "https://api.github.com/repos/loonghao/vx/releases"
# Supports authentication for higher rate limits
supports_auth = true
rate_limit = { unauthenticated = 60, authenticated = 5000 }
# Timeout settings
timeout = { connect = 10, total = 30 }
# jsDelivr CDN (Fast global CDN)
[channels.jsdelivr]
name = "jsDelivr CDN"
type = "cdn"
base_url = "https://cdn.jsdelivr.net/gh/loonghao/vx@{version}"
api_url = "https://data.jsdelivr.com/v1/package/gh/loonghao/vx"
# No rate limits for public CDN
rate_limit = { unlimited = true }
# Automatically syncs from GitHub releases
sync_source = "github"
timeout = { connect = 10, total = 30 }
# Fastly CDN (Alternative CDN)
[channels.fastly]
name = "Fastly CDN"
type = "cdn"
base_url = "https://fastly.jsdelivr.net/gh/loonghao/vx@{version}"
rate_limit = { unlimited = true }
sync_source = "github"
timeout = { connect = 10, total = 30 }
# Direct download (Self-hosted mirror)
[channels.direct]
name = "Direct Download"
type = "direct"
base_url = "https://releases.vx.dev"
# Custom self-hosted solution
rate_limit = { unlimited = true }
# Manual sync required
sync_source = "manual"
timeout = { connect = 15, total = 60 }
# Platform-specific binary naming conventions
# New format: vx-{version}-{target}.{ext} (e.g., vx-0.5.29-x86_64-pc-windows-msvc.zip)
# Legacy format: vx-{target}.{ext} (e.g., vx-x86_64-pc-windows-msvc.zip)
# Both formats are available for backward compatibility
[binaries]
# Windows binaries
"windows-x64" = "vx-x86_64-pc-windows-msvc.zip"
"windows-x64-versioned" = "vx-{version}-x86_64-pc-windows-msvc.zip"
# Linux binaries (prefer musl for static linking)
"linux-x64" = "vx-x86_64-unknown-linux-musl.tar.gz"
"linux-x64-versioned" = "vx-{version}-x86_64-unknown-linux-musl.tar.gz"
"linux-x64-fallback" = "vx-x86_64-unknown-linux-gnu.tar.gz"
"linux-x64-fallback-versioned" = "vx-{version}-x86_64-unknown-linux-gnu.tar.gz"
"linux-arm64" = "vx-aarch64-unknown-linux-musl.tar.gz"
"linux-arm64-versioned" = "vx-{version}-aarch64-unknown-linux-musl.tar.gz"
"linux-arm64-fallback" = "vx-aarch64-unknown-linux-gnu.tar.gz"
"linux-arm64-fallback-versioned" = "vx-{version}-aarch64-unknown-linux-gnu.tar.gz"
# macOS binaries
"macos-x64" = "vx-x86_64-apple-darwin.tar.gz"
"macos-x64-versioned" = "vx-{version}-x86_64-apple-darwin.tar.gz"
"macos-arm64" = "vx-aarch64-apple-darwin.tar.gz"
"macos-arm64-versioned" = "vx-{version}-aarch64-apple-darwin.tar.gz"
# Package manager integrations
[package_managers.homebrew]
enabled = true
formula_repo = "loonghao/homebrew-vx"
install_command = "brew install loonghao/vx/vx"
[package_managers.chocolatey]
enabled = true
package_id = "vx"
install_command = "choco install vx"
[package_managers.scoop]
enabled = true
bucket_repo = "loonghao/scoop-vx"
install_command = "scoop install vx"
[package_managers.winget]
enabled = true
package_id = "loonghao.vx"
install_command = "winget install loonghao.vx"
[package_managers.cargo]
enabled = true
crate_name = "vx"
install_command = "cargo install vx"
[package_managers.aur]
enabled = true
package_name = "vx-bin"
install_command = "yay -S vx-bin"
[package_managers.apt]
enabled = true
package_name = "vx"
install_command = "sudo dpkg -i vx_*.deb"
[package_managers.rpm]
enabled = true
package_name = "vx"
install_command = "sudo rpm -i vx-*.rpm"
[package_managers.docker]
enabled = true
image_name = "loonghao/vx"
ghcr_image = "ghcr.io/loonghao/vx"
install_command = "docker pull loonghao/vx:latest"
[package_managers.nix]
enabled = true
flake_url = "github:loonghao/vx"
install_command = "nix profile install github:loonghao/vx"
# Mirror configuration for different regions
[mirrors]
# China mirrors for faster access
[mirrors.china]
enabled = true
# Use domestic CDN for faster access
jsdelivr_mirror = "https://fastly.jsdelivr.net"
github_mirror = "https://hub.fastgit.xyz"
# Alternative: use Gitee mirror
gitee_mirror = "https://gitee.com/loonghao/vx/releases"
# Europe mirrors
[mirrors.europe]
enabled = true
jsdelivr_mirror = "https://cdn.jsdelivr.net"
# Asia-Pacific mirrors
[mirrors.asia]
enabled = true
jsdelivr_mirror = "https://cdn.jsdelivr.net"
# Installation script configuration
[install_scripts]
# Support multiple installation methods
methods = ["curl", "wget", "powershell", "package_manager"]
# Curl-based installation (Linux/macOS)
[install_scripts.curl]
url = "https://raw.githubusercontent.com/loonghao/vx/main/install.sh"
mirror_url = "https://fastly.jsdelivr.net/gh/loonghao/vx@main/install.sh"
description = "Universal installer for Linux and macOS"
# PowerShell-based installation (Windows)
[install_scripts.powershell]
url = "https://raw.githubusercontent.com/loonghao/vx/main/install.ps1"
mirror_url = "https://fastly.jsdelivr.net/gh/loonghao/vx@main/install.ps1"
description = "Windows installer using PowerShell"
# Smart installer with multi-channel support
[install_scripts.smart]
url = "https://raw.githubusercontent.com/loonghao/vx/main/install-smart.sh"
mirror_url = "https://fastly.jsdelivr.net/gh/loonghao/vx@main/install-smart.sh"
description = "Smart installer with automatic fallback"
# Monitoring and analytics
[monitoring]
# Track download statistics
analytics = { enabled = true, provider = "github" }
# Health checks for distribution channels
health_checks = { enabled = true, interval = "5m" }
# Fallback triggers
fallback_triggers = ["rate_limit", "timeout", "404", "500", "connection_error"]
# Error handling configuration
[error_handling]
# Retry configuration
retry = { max_attempts = 3, delay = 1, backoff = "exponential" }
# Minimum file size validation (in bytes)
min_file_size = 1024
# Timeout for health checks
health_check_timeout = 10
# Security configuration
[security]
# Verify checksums when available
verify_checksums = true
# Use HTTPS only
https_only = true
# Validate SSL certificates
verify_ssl = true
# Cache configuration
[cache]
# Cache duration for version information
version_cache_duration = "1h"
# Cache duration for download URLs
url_cache_duration = "24h"
# Enable local caching
local_cache = true