Files
proxy-suite-flake/windows/tools/screenshots.sh
T
faumarayandClaude Opus 5.5 5cf3a237e6 windows: AmneziaWG as a system-wide VPN
Each profile without asOutbound is a tunnel service of its own,
AmneziaWGTunnel$<interface>, as amneziawg-windows's client installs one:
amneziawg-go on Wintun, its routes and DNS, and for one peer that takes
everything its firewall blocking what would leave outside the tunnel.
It runs awg-tunnel.exe, amneziawg-windows built from its pinned commit
with a main of ours (its Run(), its log in a file) instead of its
tunnel.dll, beside Wintun's signed DLL (tools/build-amneziawg.sh).

The service writes each profile's .conf below its state root, registers
the tunnel (unrestricted service SID, which its firewall exempts it by),
starts the autostart ones with itself, and removes the tunnels of
profiles gone, and all of them on uninstall. proxy-ctl awg
list|on|off|log, and the app's AmneziaWG page: profiles (a system-wide
one switched on and off, its log), one added from a vpn:// link or a
.conf, or removed.

tools/lib.sh: clone_commit, and fetch_pinned, which fetches in pieces a
download that stalls (some networks cut TLS after about 16 KB, as
wintun.net's here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:23:11 +03:00

75 lines
4.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Screenshots of every page of the app, for the README: the service on Linux with a demo
# configuration (a local Shadowsocks exit, zapret's presets from a built release, autoProxy,
# whitelist-bypass, the Telegram proxy), the app on a virtual display (tools/gui-shot.sh).
# In the dev shell, after tools/package.sh:
#
# tools/screenshots.sh [OUT_DIR] (OUT_DIR: docs/screenshots)
set -euo pipefail
cd "$(dirname "$0")/.."
OUT=$(realpath -m "${1:-docs/screenshots}")
mkdir -p "$OUT"
WORK=$(mktemp -d)
STATE=$WORK/state
SOCK=${XDG_RUNTIME_DIR:-/tmp}/proxy-suite-shots.sock
rm -f "$SOCK"
mkdir -p "$STATE/bin"
port() { python3 -c 'import socket;s=socket.socket();s.bind(("127.0.0.1",0));print(s.getsockname()[1])'; }
SS=$(port) PROXY=$(port) CLASH=$(port) TEST=$(port)
KEY=a2tra2tra2tra2tra2traw==
cat >"$WORK/server.json" <<JSON
{ "log": { "level": "warn" },
"inbounds": [{ "type": "shadowsocks", "listen": "127.0.0.1", "listen_port": $SS, "method": "2022-blake3-aes-128-gcm", "password": "$KEY" }],
"dns": { "servers": [{ "type": "https", "tag": "local", "server": "1.1.1.1" }] },
"outbounds": [{ "type": "direct" }], "route": { "default_domain_resolver": "local" } }
JSON
sing-box run -c "$WORK/server.json" >/dev/null 2>&1 &
SERVER=$!
SS_URL="ss://2022-blake3-aes-128-gcm:${KEY//=/%3D}@127.0.0.1:$SS"
cat >"$STATE/config.json" <<JSON
{ "proxy": { "enable": true, "listener": { "port": $PROXY },
"singBox": { "clashApiPort": $CLASH, "testPort": $TEST },
"selection": "urltest",
"routing": { "directRu": false,
"rules": [{ "name": "streaming", "outbound": "Netherlands", "domains": ["youtube.com", "googlevideo.com"] }] },
"autoProxy": { "enable": true, "slowBelowKiBps": 0 },
"outbounds": [{ "tag": "Netherlands", "url": "$SS_URL#Netherlands" },
{ "tag": "Germany", "url": "$SS_URL#Germany" },
{ "tag": "Finland", "url": "$SS_URL#Finland" }] },
"zapret": { "enable": true, "engine": "zapret-discord-youtube",
"zapret-discord-youtube": { "configName": "general (ALT9)", "gameFilter": "all" } },
"tgWsProxy": { "enable": false },
"amneziaWg": { "enable": true, "profiles": {
"home": { "autostart": true, "config": "[Interface]\nPrivateKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=\nAddress = 10.8.0.2/32\nDNS = 1.1.1.1\nJc = 4\nJmin = 40\nJmax = 70\nS1 = 12\nS2 = 34\nH1 = 1\nH2 = 2\nH3 = 3\nH4 = 4\n\n[Peer]\nPublicKey = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = 203.0.113.7:51820\n" },
"office": { "asOutbound": "singBox", "config": "[Interface]\nPrivateKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=\nAddress = 10.8.0.2/32\nDNS = 1.1.1.1\nJc = 4\nJmin = 40\nJmax = 70\nS1 = 12\nS2 = 34\nH1 = 1\nH2 = 2\nH3 = 3\nH4 = 4\n\n[Peer]\nPublicKey = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = 203.0.113.7:51820\n" } } },
"whitelistBypass": { "enable": true,
"joiners": { "wl": { "platform": "wbstream" } },
"creators": { "office": { "platform": "bitrix" } } } }
JSON
release=$(ls -d dist/ProxySuite-*-windows-x64/components 2>/dev/null | tail -1 || true)
[ -n "$release" ] && cp -r "$release/zapret" "$STATE/bin/" 2>/dev/null || true
cargo build -q -p ps-service -p ps-gui
target/debug/proxy-suite-service --console --state-dir "$STATE" --socket "$SOCK" >"$WORK/service.log" 2>&1 &
SERVICE=$!
trap 'kill $SERVICE $SERVER 2>/dev/null || true; rm -rf "$WORK"' EXIT
for _ in $(seq 60); do target/debug/proxy-ctl --socket "$SOCK" status 2>/dev/null | grep -q 'proxy: active' && break; sleep 0.5; done
# Something for the Logs and Outbounds pages to show: delays, a few lines.
target/debug/proxy-ctl --socket "$SOCK" proxy outbounds test >/dev/null 2>&1 || true
# Sidebar entries, top to bottom (points on a 1280x820 screen).
shot() {
local name=$1 y=$2 extra=${3:-}
SHOT_STEPS="click:197,$y wait:2 $extra" tools/gui-shot.sh "$OUT/$name.png" 8 -- --socket "$SOCK" >/dev/null
echo "$OUT/$name.png"
}
shot overview 162
shot dpi-bypass 198
shot telegram 234
shot whitelist-bypass 270
shot outbounds 306
shot autoproxy 342
shot amneziawg 378
shot logs 414
shot settings 450
shot components 486