mirror of
https://github.com/necronicle/z2k.git
synced 2026-04-28 11:30:30 +00:00
Some Russian ISPs (MGTS, Rostelecom recent) intermittently block
raw.githubusercontent.com via DNS poisoning or SNI filter, making the
first curl in z2k.sh fail and the entire install abort. Borrow z4r's
DNS-override trick, stack three mirrors in front of it.
New z2k_fetch() wrapper, defined inline in z2k.sh (bootstrap-safe) and
duplicated in lib/utils.sh (for modules). Tries in order:
1. raw.githubusercontent.com — primary
2. cdn.jsdelivr.net/gh/<owner>/<repo>@<branch>/<p> — CDN, 12h edge
cache (purgeable via purge.jsdelivr.net/gh/...)
3. gh-proxy.com/<raw-url> — reverse-proxy,
no cache, works from RU
4. Keenetic-only: nslookup <host> 8.8.8.8 + ndmc "ip host <host> <ip>"
then retry layers 1+2 — mirrors zapret4rocket z4r.sh:1075-1107.
Replaces every direct curl to raw.github or ${GITHUB_RAW}/... across
z2k.sh (14 sites), lib/install.sh (4 sites: two AloofLibra/zapret4rocket
lua/orchestrator fetches + two bol-van/zapret2 custom.d examples),
lib/menu.sh (tg-mtproxy binary download), and the standalone cron
files/z2k-update-lists.sh (which gets its own inline copy of the
function — it is not source'd via utils.sh).
Smoke-tested: all three delivering layers fetch the same 29272-byte
z2k.sh, and a bogus path correctly falls through all layers and
returns 1. Layer 4 (ndmc) not tested on the Mac — semantics copied
verbatim from z4r, which proves it on Keenetic in production.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| config.sh | ||
| config_official.sh | ||
| install.sh | ||
| menu.sh | ||
| strategies.sh | ||
| system_init.sh | ||
| utils.sh | ||
| webpanel.sh | ||