Add one-click launcher and interactive setup wizard

- setup.py: prompts only for the values the user must choose, generates a
  random auth_key, writes config.json (backs up any existing one).
- start.bat / start.sh: create a local venv, install deps (with PyPI mirror
  fallback), run the wizard if config.json is missing, then launch main.py.
- main.py: when config.json is missing on an interactive TTY, offer to run
  the wizard instead of just exiting.
- README: new "Quick Start" section up top; manual steps kept below.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilia Mirzaali
2026-04-21 19:47:48 +02:00
parent 829de0bb2e
commit a444d0f3b5
5 changed files with 387 additions and 6 deletions
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
# MasterHttpRelayVPN one-click launcher (Linux / macOS)
# Creates a local virtualenv, installs deps, runs the setup wizard
# if needed, then starts the proxy.
set -e
cd "$(dirname "$0")"
VENV_DIR=".venv"
find_python() {
for cmd in python3.12 python3.11 python3.10 python3 python; do
if command -v "$cmd" >/dev/null 2>&1; then
ver=$("$cmd" -c 'import sys;print("%d.%d"%sys.version_info[:2])' 2>/dev/null || echo "0.0")
major=${ver%.*}; minor=${ver#*.}
if [ "$major" -ge 3 ] && [ "$minor" -ge 10 ]; then
echo "$cmd"
return 0
fi
fi
done
return 1
}
PY=$(find_python) || {
echo "[X] Python 3.10+ not found. Install it and re-run this script." >&2
exit 1
}
if [ ! -x "$VENV_DIR/bin/python" ]; then
echo "[*] Creating virtual environment in $VENV_DIR ..."
"$PY" -m venv "$VENV_DIR"
fi
VPY="$VENV_DIR/bin/python"
echo "[*] Installing dependencies ..."
"$VPY" -m pip install --disable-pip-version-check -q --upgrade pip >/dev/null
if ! "$VPY" -m pip install --disable-pip-version-check -q -r requirements.txt; then
echo "[!] PyPI install failed. Retrying via runflare mirror ..."
"$VPY" -m pip install --disable-pip-version-check -q -r requirements.txt \
-i https://mirror-pypi.runflare.com/simple/ \
--trusted-host mirror-pypi.runflare.com
fi
if [ ! -f "config.json" ]; then
echo "[*] No config.json found — launching setup wizard ..."
"$VPY" setup.py
fi
echo
echo "[*] Starting MasterHttpRelayVPN ..."
echo
exec "$VPY" main.py "$@"