mirror of
https://github.com/therealaleph/MasterHttpRelayVPN-RUST.git
synced 2026-05-17 21:24:48 +03:00
v0.4.1: launcher scripts (run.sh / run.command / run.bat)
First run needs the CLI to install the MITM CA into the system trust store (sudo/admin prompt), which the UI alone can't do reliably from a double-click. Add a small launcher for each platform that runs the CLI with --install-cert once, then starts the UI. Each release archive now contains a run.* script alongside the binaries.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
@echo off
|
||||
REM mhrv-rs launcher for Windows.
|
||||
REM Runs the CLI once to initialize the MITM CA (may trigger a UAC prompt when
|
||||
REM installing into the Windows trust store), then launches the UI.
|
||||
|
||||
setlocal
|
||||
cd /d "%~dp0"
|
||||
|
||||
if not exist "mhrv-rs.exe" (
|
||||
echo error: mhrv-rs.exe not found next to this script.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Initializing MITM CA (a UAC prompt may appear)...
|
||||
mhrv-rs.exe --install-cert
|
||||
if errorlevel 1 (
|
||||
echo warning: CA install returned non-zero. The UI can still run,
|
||||
echo but HTTPS sites may show certificate warnings until the CA is trusted.
|
||||
)
|
||||
|
||||
if exist "mhrv-rs-ui.exe" (
|
||||
echo Starting mhrv-rs UI...
|
||||
start "" "mhrv-rs-ui.exe"
|
||||
) else (
|
||||
echo UI binary not found. Running CLI proxy instead.
|
||||
mhrv-rs.exe
|
||||
)
|
||||
|
||||
endlocal
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
# Double-clickable launcher for macOS Finder.
|
||||
# Same as run.sh but with .command extension so Finder opens it in Terminal.
|
||||
set -eu
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
CLI="$DIR/mhrv-rs"
|
||||
UI="$DIR/mhrv-rs-ui"
|
||||
|
||||
if [ ! -x "$CLI" ]; then
|
||||
echo "error: $CLI not found or not executable"
|
||||
echo "Press return to close..."
|
||||
read _
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Initializing MITM CA (you may be asked for your password)..."
|
||||
"$CLI" --install-cert || echo "warning: CA install returned non-zero. The UI can still run."
|
||||
|
||||
if [ ! -x "$UI" ]; then
|
||||
echo "UI binary not found. Starting CLI proxy instead."
|
||||
exec "$CLI"
|
||||
fi
|
||||
|
||||
echo "Starting mhrv-rs UI..."
|
||||
"$UI"
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
# mhrv-rs launcher for Linux / macOS.
|
||||
# Runs the CLI once (initializes the MITM CA in the user data dir and installs
|
||||
# it into the system trust store; may prompt for sudo), then launches the UI.
|
||||
set -eu
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
CLI="$DIR/mhrv-rs"
|
||||
UI="$DIR/mhrv-rs-ui"
|
||||
|
||||
if [ ! -x "$CLI" ]; then
|
||||
echo "error: $CLI not found or not executable" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Initializing MITM CA (you may be asked for your password)..."
|
||||
"$CLI" --install-cert || echo "warning: CA install returned non-zero; the UI can still run, but HTTPS sites may show cert errors until the CA is trusted."
|
||||
|
||||
if [ ! -x "$UI" ]; then
|
||||
echo "UI binary not found. Starting CLI proxy instead."
|
||||
exec "$CLI"
|
||||
fi
|
||||
|
||||
echo "Starting mhrv-rs UI..."
|
||||
exec "$UI"
|
||||
Reference in New Issue
Block a user