zapret: Flowseal's release run as its service.bat runs it: the preset's winws.exe line (continuations, cmd's caret escapes, %BIN%, %LISTS%, the game filter) as winws's arguments, the user's domains and addresses in the lists upstream's module puts them in (kept in the service's own run directory, the verified release untouched), TCP timestamps on, and zapret's sites in the proxy's direct list. tools/winws-dry-run.sh has the release's own winws.exe verify every preset's arguments under Wine: all 22, both game filters. tg-ws-proxy: Flowseal's headless proxy on the embeddable CPython 3.12 with hash-pinned win_amd64 wheels (tools/build-tg-ws-proxy.sh), run with upstream's flags; its relay goes direct under the TUN. Runs under Wine. proxy-ctl: zapret status|on|off|preset|game-filter, components list|install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.5 KiB
Bash
Executable File
34 lines
1.5 KiB
Bash
Executable File
#!/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.
|
|
#
|
|
# nix develop --command nix shell nixpkgs#wineWow64Packages.stable -c tools/winws-dry-run.sh STAGE_DIR
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
STAGE=${1:?staged components directory}
|
|
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
|
|
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/"
|
|
echo domain.example.abc > "$WORK/lists/list-general-user.txt"
|
|
echo domain.example.abc > "$WORK/lists/list-exclude-user.txt"
|
|
echo 203.0.113.113/32 > "$WORK/lists/ipset-exclude-user.txt"
|
|
fail=0 n=0
|
|
while IFS= read -r preset; do
|
|
for game in null all; do
|
|
mapfile -t args < <(target/debug/examples/zapret_args "$REL" "$(win "$REL")" "$(win "$WORK/lists")" "$preset" "$game")
|
|
n=$((n + 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 ($game)"; grep -v Cygwin <<<"$out" | tail -4
|
|
fi
|
|
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"
|
|
[ "$fail" = 0 ]
|