windows: whitelist-bypass
Creators and joiners, built from upstream's tag with upstream's patches (links and passwords from the environment, never argv), run by the service as whitelist-bypass.nix runs them: joiners while the proxy runs, as its outbounds, creators while the suite is on, their logins kept in a working copy they refresh. proxy-ctl wl list|link|auth|join|new|restart over new API requests (whitelistBypass scope). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f4fcf540d
commit
610e36a28b
15 files changed
+585
-7
No files matched your search
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
# whitelist-bypass's headless ends for Windows (creators and joiners: a tunnel through the media
|
||||
# servers of video calls), built from upstream's tag as upstream's pkgs/whitelist-bypass.nix
|
||||
# builds them: the call link, the local proxy's password and a joiner's SOCKS password read
|
||||
# from the environment by default, never the command line (any local user reads that).
|
||||
#
|
||||
# tools/build-whitelist-bypass.sh OUT_DIR [GOOS] (needs git, go, sed; GOOS: windows)
|
||||
set -euo pipefail
|
||||
OUT=$(realpath -m "${1:?output directory}")
|
||||
GOOS=${2:-windows}
|
||||
VERSION=0.4.4
|
||||
COMMIT=7c19a7ec40900940fe0c43ea1db7768ee632393d
|
||||
WORK=$(mktemp -d)
|
||||
trap 'rm -rf "$WORK"' EXIT
|
||||
|
||||
git -c advice.detachedHead=false clone -q --depth 1 --branch "v$VERSION" https://github.com/kulikov0/whitelist-bypass "$WORK/src"
|
||||
[ "$(git -C "$WORK/src" rev-parse HEAD)" = "$COMMIT" ] || { echo "tag v$VERSION moved off $COMMIT"; exit 1; }
|
||||
cd "$WORK/src"
|
||||
|
||||
# upstream's postPatch: flag.String("NAME", "", …) defaults to os.Getenv("VAR").
|
||||
env_default() {
|
||||
local file="headless/$1/main.go"
|
||||
grep -q "flag.String(\"$2\", \"\"," "$file" || { echo "$file has no flag $2 to patch"; exit 1; }
|
||||
sed -i "s|flag.String(\"$2\", \"\",|flag.String(\"$2\", os.Getenv(\"$3\"),|" "$file"
|
||||
}
|
||||
for p in vk telemost wbstream dion bitrix; do env_default "$p" upstream-pass WB_UPSTREAM_PASS; done
|
||||
for p in bitrix dion dion-joiner wbstream wbstream-joiner; do env_default "$p" room WB_LINK; done
|
||||
for p in telemost-joiner wbstream-joiner dion-joiner bitrix-joiner; do env_default "$p" socks-pass WB_SOCKS_PASS; done
|
||||
env_default bitrix-joiner link WB_LINK
|
||||
env_default telemost tm-link WB_LINK
|
||||
env_default telemost-joiner tm-link WB_LINK
|
||||
env_default vk vk-link WB_LINK
|
||||
|
||||
export GOTOOLCHAIN=local CGO_ENABLED=0 GOOS GOARCH=amd64
|
||||
ext=
|
||||
[ "$GOOS" = windows ] && ext=.exe
|
||||
rm -rf "$OUT" && mkdir -p "$OUT"
|
||||
# Upstream's names (build-headless.sh): headless-<platform>-creator and -joiner.
|
||||
for p in vk telemost wbstream dion bitrix; do
|
||||
go build -trimpath -ldflags "-s -w" -o "$OUT/headless-$p-creator$ext" "./headless/$p"
|
||||
done
|
||||
for p in telemost wbstream dion bitrix; do
|
||||
go build -trimpath -ldflags "-s -w" -o "$OUT/headless-$p-joiner$ext" "./headless/$p-joiner"
|
||||
done
|
||||
cp LICENSE "$OUT/"
|
||||
echo "$VERSION" >"$OUT/.version"
|
||||
echo "whitelist-bypass $VERSION ($GOOS) in $OUT"
|
||||
@@ -17,6 +17,7 @@ mkdir -p "$DIST/components"
|
||||
echo "== components"
|
||||
tools/build-tg-ws-proxy.sh "$DIST/components/tg-ws-proxy"
|
||||
tools/build-wireproxy-awg.sh "$DIST/components/wireproxy-awg" windows
|
||||
tools/build-whitelist-bypass.sh "$DIST/components/whitelist-bypass" windows
|
||||
cargo build -q --release -p ps-service
|
||||
target/release/proxy-suite-service stage-components --to "$DIST/components" --cache "$CACHE"
|
||||
rm -rf "$DIST"/components/*.old "$DIST"/components/*.staging
|
||||
@@ -52,6 +53,7 @@ echo "== THIRD-PARTY.md"
|
||||
echo "- **zapret2** (winws2.exe, its Lua) and **nfqws2-keenetic** (its strategies, lists, blobs): MIT, https://github.com/bol-van/zapret2, https://github.com/nfqws/nfqws2-keenetic"
|
||||
echo "- **wintun** (inside sing-box): WireGuard's prebuilt-binary license, https://www.wintun.net"
|
||||
echo "- **amneziawg-go** (inside wireproxy-awg, with the suite's patch): MIT, https://github.com/amnezia-vpn/amneziawg-go"
|
||||
echo "- **Go modules** (inside wireproxy-awg and whitelist-bypass, e.g. Pion's WebRTC): as each project's go.mod pins them, under their own licenses (MIT, BSD-3-Clause, Apache-2.0)"
|
||||
echo "- **lyrebird** and **conjure** (Tor's pluggable transports, in the Expert Bundle): their licenses are in components/tor/docs"
|
||||
echo "- **CPython $( sed 's/.*+py//' "$DIST/components/tg-ws-proxy/.version" )** (tg-ws-proxy): PSF License, https://www.python.org"
|
||||
echo "- **The programs themselves** (proxy-suite-service, proxy-ctl, proxy-suite) are built from"
|
||||
|
||||
Reference in new issue
Block a user