fix: improve proxy-ctl

This commit is contained in:
fufsob committed 2026-09-14 04:37:17 +00:00
1 parent 7f76c4ffbb
commit 006ac60b9a
5 files changed
+29 -11

No files matched your search

+7 -1
View File
@@ -503,7 +503,8 @@
grep -q '"url":"https://example.test/robots.txt"' <<<"$out"
# A working apex is never second-guessed by the fallback path.
out="$(probe_with '0|0.10|200|500|' '0|0.20|200|500|' '0|0.10|403|10|' '0|0.20|200|10|')"
# set -e: proxy-ctl runs under it, and $() does not inherit it.
out="$(set -e; probe_with '0|0.10|200|500|' '0|0.20|200|500|' '0|0.10|403|10|' '0|0.20|200|10|')"
grep -q '"verdict":"ok"' <<<"$out"
# --- walking more than two exits ---
@@ -522,6 +523,11 @@
out="$(cmd_proxy_probe --json sekai.test)"
jq -e '.verdict == "destination" and .exit == "de"' <<<"$out" > /dev/null
# --keep-going tries every exit but keeps the first that worked.
out="$(cmd_proxy_probe --json --keep-going --exits de,fi sekai.test)"
jq -e '.exit == "de" and [.exits[].tag] == ["direct", "de", "fi", "direct", "de", "fi"]' \
<<<"$out" > /dev/null
# --exits restricts and orders the walk; direct is always tried first.
out="$(cmd_proxy_probe --json --exits de sekai.test)"
jq -e '[.exits[].tag] == ["direct", "de"]' <<<"$out" > /dev/null
+4
View File
@@ -174,6 +174,10 @@ in
detect=$(grep -o '/nix/store/[^:]*-z2k-detect-[^:/]*/bin' ${cutoffProbe} | head -n1)
"$detect/z2k-detect" tcp16 -h 2>/dev/null
# New maps restart only the zapret units this config installs.
grep -qF 'try-restart zapret-discord-youtube.service' ${cutoffProbe}
if grep -qF 'proxy-suite-per-app-zapret.service' ${cutoffProbe}; then exit 1; fi
# The proxy carries what no name fixes, unless the fallback is off.
grep -qF 'tag: "zapret-cutoff"' ${socksStart zapret2Global}
if grep -qF 'zapret-cutoff' ${socksStart zapret2NoFallback}; then exit 1; fi