fix(singbox): prevent cold-start crash loop on missing community rulesets (#46)
- Bundle universal 17-byte empty SRS stub and add is_valid_srs_file/ensure_empty_srs_stub in rulesets.uc - Add prepare_community_rulesets in lifecycle.uc to pre-fetch via gh-proxy mirrors or initialize safe local stub before sing-box start - Support local community rulesets and stubs in generator_routes.uc - Add fallback to component proxy for list downloads in updates.uc and preserve cached stubs - Skip non-functional jsdelivr for release downloads and prioritize gh-proxy mirrors in core/url.uc - Add tests/cold_boot_community_stub.sh testing cold boot fallback behavior
This commit is contained in:
@@ -294,14 +294,15 @@ function download_candidates(value) {
|
||||
let is_http = substr(value, 0, 7) == "http://" || substr(value, 0, 8) == "https://";
|
||||
|
||||
if (is_github || is_http) {
|
||||
let jsd = github_to_jsdelivr(value);
|
||||
let is_release = index(value, "/releases/") >= 0;
|
||||
let jsd = !is_release ? github_to_jsdelivr(value) : "";
|
||||
if (jsd != "")
|
||||
push(candidates, jsd);
|
||||
|
||||
let mirrors = [
|
||||
"https://gh-proxy.com/",
|
||||
"https://ghproxy.net/",
|
||||
"https://mirror.ghproxy.com/",
|
||||
"https://gh-proxy.com/"
|
||||
"https://mirror.ghproxy.com/"
|
||||
];
|
||||
for (let prefix in mirrors) {
|
||||
if (index(value, prefix) != 0)
|
||||
|
||||
Reference in New Issue
Block a user