windows: zapret2 on winws2 with nfqws2-keenetic's strategies

ps-core::zapret2 reads nfqws2-keenetic's nfqws2.conf and patches it as
upstream's sources.nix does, expands the hostlist markers as zapret2's
list.sh does (autohostlist with its detector settings, the configured
domains), fills circular's unset detector settings from autoHostlist,
merges the extra ports into the profiles that tell traffic by protocol,
and gives winws2 WinDivert port filters in place of the queue's rules.
The service runs it with the learned list in a directory labelled Low
integrity, where winws2 can still write once it drops to Low. winws2
verifies the whole command line under Wine.

detect.lua, z2k and the cutoff probe are not there yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 5.5 committed 2026-10-27 00:04:21 +03:00
1 parent 9b0d7021f9
commit bceb754e65
6 files changed
+516 -4

No files matched your search

+13 -2
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# Every preset of Flowseal's release, with the arguments and lists the service builds,
# checked by its own winws.exe (`--dry-run`) under Wine.
# checked by its own winws.exe (`--dry-run`) under Wine; then zapret2's command line, by
# winws2.exe.
#
# nix develop --command nix shell nixpkgs#wineWow64Packages.stable -c tools/winws-dry-run.sh STAGE_DIR
set -euo pipefail
@@ -10,7 +11,7 @@ REL="$STAGE/zapret"
WORK=$(mktemp -d)
export WINEPREFIX=${WINEPREFIX:-$WORK/prefix} WINEDEBUG=-all
trap 'wineserver -k 2>/dev/null || true; rm -rf "$WORK"' EXIT
cargo build -q -p ps-core --example zapret_args
cargo build -q -p ps-core --example zapret_args --example zapret2_args
win() { echo "Z:$(realpath "$1" | sed 's|/|\\|g')\\"; }
# The lists as the service writes them: the release's, and the user's placeholders.
mkdir -p "$WORK/lists" && cp "$REL"/lists/*.txt "$WORK/lists/"
@@ -30,4 +31,14 @@ while IFS= read -r preset; do
done
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"
# 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"
mapfile -t args < <(target/debug/examples/zapret2_args "$Z2" "$(win "$Z2")" "$(win "$WORK/z2")")
if out=$(cd "$Z2" && wine ./winws2.exe --dry-run "${args[@]}" 2>&1) && grep -q "parameters verified" <<<"$out"; then
echo "zapret2: verified by winws2.exe"
else
fail=$((fail + 1)); echo "FAIL: zapret2"; grep -v -i cygwin <<<"$out" | tail -4
fi
[ "$fail" = 0 ]