windows: authorize streamed requests, self-removal on uninstall, tun on

- Every request is authorized before it is handled, including `logs -f`,
  which skipped the check.
- The state root is checked once per process: a second check under Wine
  moved the live root (and its log) aside.
- uninstall removes Program Files after it exits: cmd got a garbled
  quoted command line; it now runs raw, outside the folder, windowless.
- install no longer fails when the first start does; it says how to start.
- `proxy-ctl proxy tun on` also turns on proxy.tun.enable.
- build-tg-ws-proxy.sh resolves its output path before changing directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 5.5 committed 2026-10-27 00:41:53 +03:00
1 parent 28cc7b2cbe
commit 8af7b2e628
5 files changed
+62 -15

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@
#
# tools/build-tg-ws-proxy.sh OUT_DIR (needs curl, git, unzip, pip)
set -euo pipefail
OUT=$(realpath -m "${1:?output directory}")
cd "$(dirname "$0")"
OUT=${1:?output directory}
PY_VERSION=3.12.10
PY_URL=https://www.python.org/ftp/python/$PY_VERSION/python-$PY_VERSION-embed-amd64.zip
PY_SHA256=4acbed6dd1c744b0376e3b1cf57ce906f9dc9e95e68824584c8099a63025a3c3
@@ -25,7 +25,7 @@ pip download -q --require-hashes --no-deps --only-binary=:all: --platform win_am
mkdir -p "$OUT/python/Lib/site-packages"
for w in "$WORK"/wheels/*.whl; do unzip -q -o "$w" -d "$OUT/python/Lib/site-packages"; done
git clone -q --depth 1 --branch "$TG_TAG" https://github.com/Flowseal/tg-ws-proxy "$WORK/src"
git -c advice.detachedHead=false clone -q --depth 1 --branch "$TG_TAG" https://github.com/Flowseal/tg-ws-proxy "$WORK/src"
[ "$(git -C "$WORK/src" rev-parse HEAD)" = "$TG_COMMIT" ] || { echo "tag $TG_TAG moved off $TG_COMMIT"; exit 1; }
cp -r "$WORK/src/proxy" "$WORK/src/utils" "$WORK/src/LICENSE" "$OUT/app/"