windows: zapret's hostlistRules, and the SSH tunnel
- hostlistRules (zapret-discord-youtube): a group of sites with its own strategy, as upstream's patch-zapret-config.py makes them: the preset's profiles for the rule's family (or another preset's, with configName; Discord's voice profile with it), pointed at the rule's own list with the standard excludes, or the rule's nfqwsArgs; ahead of the preset's own. WinDivert's filter takes the ports they add. Rules with enableDirectSync join the direct list. Names of zapret's own lists, and the instagram/soundcloud/twitter families (not in Flowseal's Windows release), are refused. Every preset with sample rules checked by winws.exe --dry-run (tools/winws-dry-run.sh); one without the profile a rule copies is refused, as upstream refuses it. - The SSH tunnel (sshProxy): Windows' own OpenSSH (System32) as ssh -N -D, with upstream's options and only the configured key offered (IdentitiesOnly: an agent's keys used up the server's tries); the key copied below the protected state root, as Windows' OpenSSH wants it and sing-box's SSH outbound reads it; the server's keys from hostKey, hostKeyFile or knownHostsFile. End to end on Linux against an sshd of the test's own: a page through each, two logins with the copied key. - The dev shell has OpenSSH, for that test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
88c8b88a49
commit
fb6c5962d0
14 files changed
+776
-24
No files matched your search
@@ -32,6 +32,24 @@ while IFS= read -r preset; do
|
||||
done < <(ls "$REL"/*.bat | xargs -n1 -d '\n' basename | grep -vi '^service' | sed 's/\.bat$//')
|
||||
echo "$((n - fail))/$n preset runs verified by winws.exe"
|
||||
|
||||
# The same presets with hostlistRules (tools/zapret-rules-sample.json): their profiles ahead.
|
||||
r=0 na=0
|
||||
while IFS= read -r preset; do
|
||||
built=$(target/debug/examples/zapret_args "$REL" "$(win "$REL")" "$(win "$WORK/lists")" "$preset" null tools/zapret-rules-sample.json "$WORK/lists" 2>&1) || {
|
||||
# A preset without a profile a rule's family needs: refused, as upstream refuses it.
|
||||
if grep -q "the preset has no .* profile to copy" <<<"$built"; then na=$((na + 1)); echo " $preset: $built"; continue; fi
|
||||
fail=$((fail + 1)); echo "FAIL: $preset with rules: $built"; continue
|
||||
}
|
||||
mapfile -t args <<<"$built"
|
||||
r=$((r + 1))
|
||||
if out=$(cd "$REL/bin" && wine ./winws.exe --dry-run "${args[@]}" 2>&1) && grep -q "parameters verified" <<<"$out"; then
|
||||
:
|
||||
else
|
||||
fail=$((fail + 1)); echo "FAIL: $preset with rules"; grep -v Cygwin <<<"$out" | tail -4
|
||||
fi
|
||||
done < <(ls "$REL"/*.bat | xargs -n1 -d '\n' basename | grep -vi '^service' | sed 's/\.bat$//')
|
||||
echo "$r presets with hostlist rules verified by winws.exe; $na refused, lacking a profile a rule copies"
|
||||
|
||||
# zapret2: nfqws2-keenetic's strategies as the service renders them, its lists in place.
|
||||
Z2="$STAGE/zapret2"
|
||||
mkdir -p "$WORK/z2/learned" && : > "$WORK/z2/zapret-hosts-user.txt" && : > "$WORK/z2/zapret-hosts-user-exclude.txt" && : > "$WORK/z2/learned/zapret-hosts-auto.txt"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[
|
||||
{ "name": "mine", "domains": ["example.com"], "preset": "general" },
|
||||
{ "name": "yt", "defaultDomains": ["youtube"], "domains": ["extra.example"] },
|
||||
{ "name": "voice", "defaultDomains": ["discord"], "configName": "general (ALT9)" },
|
||||
{ "name": "own", "domains": ["own.example"], "ips": ["198.51.100.0/24"], "nfqwsArgs": ["--filter-tcp=8443 --dpi-desync=fake --dpi-desync-repeats=6"] }
|
||||
]
|
||||
Reference in new issue
Block a user