Skip to content

Commit 899ef06

Browse files
committed
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.
1 parent 3eb0d96 commit 899ef06

7 files changed

Lines changed: 102 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ jobs:
9999
cp target/${{ matrix.target }}/release/mhrv-rs-ui dist/mhrv-rs-ui
100100
chmod +x dist/mhrv-rs-ui
101101
fi
102+
cp assets/launchers/run.sh dist/run.sh
103+
chmod +x dist/run.sh
104+
if [ "${{ runner.os }}" = "macOS" ]; then
105+
cp assets/launchers/run.command dist/run.command
106+
chmod +x dist/run.command
107+
fi
102108
103109
- name: Build macOS .app bundle
104110
if: runner.os == 'macOS'
@@ -118,15 +124,18 @@ jobs:
118124
if (Test-Path target/${{ matrix.target }}/release/mhrv-rs-ui.exe) {
119125
Copy-Item target/${{ matrix.target }}/release/mhrv-rs-ui.exe dist/mhrv-rs-ui.exe
120126
}
127+
Copy-Item assets/launchers/run.bat dist/run.bat
121128
122129
- name: Make archive
123130
shell: bash
124131
run: |
125132
cd dist
126133
if [ "${{ runner.os }}" = "Windows" ]; then
127-
7z a -tzip "${{ matrix.name }}.zip" mhrv-rs.exe mhrv-rs-ui.exe
134+
7z a -tzip "${{ matrix.name }}.zip" mhrv-rs.exe mhrv-rs-ui.exe run.bat
135+
elif [ "${{ runner.os }}" = "macOS" ]; then
136+
tar czf "${{ matrix.name }}.tar.gz" mhrv-rs mhrv-rs-ui run.sh run.command
128137
else
129-
tar czf "${{ matrix.name }}.tar.gz" mhrv-rs mhrv-rs-ui 2>/dev/null || tar czf "${{ matrix.name }}.tar.gz" mhrv-rs
138+
tar czf "${{ matrix.name }}.tar.gz" mhrv-rs mhrv-rs-ui run.sh 2>/dev/null || tar czf "${{ matrix.name }}.tar.gz" mhrv-rs run.sh
130139
fi
131140
132141
- uses: actions/upload-artifact@v4

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mhrv-rs"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
edition = "2021"
55
description = "Rust port of MasterHttpRelayVPN -- DPI bypass via Google Apps Script relay with domain fronting"
66
license = "MIT"

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ Each release ships two binaries:
3636
- **`mhrv-rs`** — the CLI. Always works. Headless servers, Docker, automation. No system deps on macOS/Windows; on Linux works even without a display server.
3737
- **`mhrv-rs-ui`** — the desktop UI (egui). Form for the config, Start/Stop/Test buttons, live stats, recent log. macOS releases also include `mhrv-rs.app` (double-click to launch). Linux UI requires a display server and common desktop libraries (`libxkbcommon`, `libwayland-client`, `libxcb`, `libgl`, `libx11`, `libgtk-3`); install them via your distro's package manager if missing.
3838

39+
On first run the MITM CA must be installed into the system trust store (this typically needs sudo/admin), and this is easiest to do from the CLI. Each archive therefore ships a launcher that does both steps in order:
40+
41+
- Linux: `./run.sh`
42+
- macOS: `./run.command` (double-click in Finder) or `./run.sh` from a terminal
43+
- Windows: `run.bat`
44+
45+
The launchers run `mhrv-rs --install-cert` once, then start `mhrv-rs-ui`. Subsequent runs can launch the UI directly.
46+
3947
Config + the MITM CA live in the platform user-data dir:
4048

4149
- macOS: `~/Library/Application Support/mhrv-rs/`

assets/launchers/run.bat

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@echo off
2+
REM mhrv-rs launcher for Windows.
3+
REM Runs the CLI once to initialize the MITM CA (may trigger a UAC prompt when
4+
REM installing into the Windows trust store), then launches the UI.
5+
6+
setlocal
7+
cd /d "%~dp0"
8+
9+
if not exist "mhrv-rs.exe" (
10+
echo error: mhrv-rs.exe not found next to this script.
11+
pause
12+
exit /b 1
13+
)
14+
15+
echo Initializing MITM CA (a UAC prompt may appear)...
16+
mhrv-rs.exe --install-cert
17+
if errorlevel 1 (
18+
echo warning: CA install returned non-zero. The UI can still run,
19+
echo but HTTPS sites may show certificate warnings until the CA is trusted.
20+
)
21+
22+
if exist "mhrv-rs-ui.exe" (
23+
echo Starting mhrv-rs UI...
24+
start "" "mhrv-rs-ui.exe"
25+
) else (
26+
echo UI binary not found. Running CLI proxy instead.
27+
mhrv-rs.exe
28+
)
29+
30+
endlocal

assets/launchers/run.command

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
# Double-clickable launcher for macOS Finder.
3+
# Same as run.sh but with .command extension so Finder opens it in Terminal.
4+
set -eu
5+
6+
DIR="$(cd "$(dirname "$0")" && pwd)"
7+
CLI="$DIR/mhrv-rs"
8+
UI="$DIR/mhrv-rs-ui"
9+
10+
if [ ! -x "$CLI" ]; then
11+
echo "error: $CLI not found or not executable"
12+
echo "Press return to close..."
13+
read _
14+
exit 1
15+
fi
16+
17+
echo "Initializing MITM CA (you may be asked for your password)..."
18+
"$CLI" --install-cert || echo "warning: CA install returned non-zero. The UI can still run."
19+
20+
if [ ! -x "$UI" ]; then
21+
echo "UI binary not found. Starting CLI proxy instead."
22+
exec "$CLI"
23+
fi
24+
25+
echo "Starting mhrv-rs UI..."
26+
"$UI"

assets/launchers/run.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
# mhrv-rs launcher for Linux / macOS.
3+
# Runs the CLI once (initializes the MITM CA in the user data dir and installs
4+
# it into the system trust store; may prompt for sudo), then launches the UI.
5+
set -eu
6+
7+
DIR="$(cd "$(dirname "$0")" && pwd)"
8+
CLI="$DIR/mhrv-rs"
9+
UI="$DIR/mhrv-rs-ui"
10+
11+
if [ ! -x "$CLI" ]; then
12+
echo "error: $CLI not found or not executable" >&2
13+
exit 1
14+
fi
15+
16+
echo "Initializing MITM CA (you may be asked for your password)..."
17+
"$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."
18+
19+
if [ ! -x "$UI" ]; then
20+
echo "UI binary not found. Starting CLI proxy instead."
21+
exec "$CLI"
22+
fi
23+
24+
echo "Starting mhrv-rs UI..."
25+
exec "$UI"

0 commit comments

Comments
 (0)