Allow disabling GitHub download mirrors (#320)

This commit is contained in:
Arvin
2026-09-24 15:19:32 +08:00
parent a83d1325d1
commit 0ed44117e6
5 changed files with 80 additions and 7 deletions
+12
View File
@@ -410,6 +410,13 @@ github_proxy_prefix() {
echo "$prefix"
}
github_mirror_enabled() {
case "${CLASH_GH_PROXY_ENABLED:-true}" in
false|0|no|off) return 1 ;;
*) return 0 ;;
esac
}
bundled_asset_enabled() {
case "${CLASH_BUNDLED_ASSET_ENABLED:-true}" in
true|1|yes|on) return 0 ;;
@@ -760,6 +767,11 @@ github_mirror_candidate_entries() {
return 0
}
if ! github_mirror_enabled; then
echo "origin||origin"
return 0
fi
if [ -n "$(github_proxy_prefix)" ]; then
entry="custom|$(github_proxy_prefix)|full"
normalized="$(normalize_github_mirror_entry "$entry" 2>/dev/null || true)"