Skip to content

Commit 3722ab2

Browse files
committed
v1.2.9: fix UI build for youtube_via_relay (v1.2.8 CI abandoned)
v1.2.8 tagged cleanly but CI failed compiling mhrv-rs-ui with: error[E0063]: missing field `youtube_via_relay` in initializer of `mhrv_rs::config::Config` When I added the youtube_via_relay field to the main Config struct in 21912cc, I missed the struct-literal construction in src/bin/ui.rs (FormState::save_to_config) and the ConfigWire serializer. Fixed here: - Added youtube_via_relay field to FormState (line 214), read path (line 291), default path (line 316), and the save path (line 451) - Added youtube_via_relay field to ConfigWire (line 493) with skip_serializing_if on false, plus its From impl (line 544) UI still doesn't expose a checkbox for the toggle — it's config-only for now, same treatment as normalize_x_graphql. A future PR can add the checkbox to the Advanced pane. v1.2.8 tag exists but has no GitHub Release (release job skipped on failure); v1.2.9 is the clean cut. Same payload as v1.2.8 plus this fix.
1 parent 8701794 commit 3722ab2

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

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 = "1.2.8"
3+
version = "1.2.9"
44
edition = "2021"
55
description = "Rust port of MasterHttpRelayVPN -- DPI bypass via Google Apps Script relay with domain fronting"
66
license = "MIT"

android/app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId = "com.therealaleph.mhrv"
1515
minSdk = 24 // Android 7.0 — covers 99%+ of live devices.
1616
targetSdk = 34
17-
versionCode = 128
18-
versionName = "1.2.8"
17+
versionCode = 129
18+
versionName = "1.2.9"
1919

2020
// Ship all four mainstream Android ABIs:
2121
// - arm64-v8a — 95%+ of real-world Android phones since 2019
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
• گزینهٔ ‫`youtube_via_relay`‬ (issue #102): پورت شده از ‫Python‬ بالادست. وقتی فعال شود، ترافیک یوتیوب از مسیر ‫SNI-rewrite‬ خارج می‌شود و از طریق ‫Apps Script‬ می‌رود تا فیلتر ‫SafeSearch-on-SNI‬ گوگل دور زده شود. ترید-آف: ‫User-Agent‬ ثابت می‌شود روی ‫Google-Apps-Script‬ و سهمیهٔ روزانهٔ شما مصرف می‌شود. پیش‌فرض خاموش
44
• رفع دستور ‫scan-sni‬ (PR #97): پاسخ‌های ‫dns.google‬ با ‫Transfer-Encoding: chunked‬ برمی‌گردند و قبل از JSON decode باید ‫unchunk‬ شوند. بدون این پچ هیچ دامنه‌ای کشف نمی‌شد
55
• اعتبارسنجی ‫TLS‬ در ‫scan-sni‬ (PR #98): درخواست ‫DoH‬ به ‫dns.google‬ از ‫NoVerify‬ به ‫webpki roots‬ سوئیچ شد تا یک ‫on-path MITM‬ نتواند ‫PTR‬های جعلی برگرداند و pool ‫SNI‬ را مسموم کند
6+
• رفع کامپایل ‫UI‬ برای ‫`youtube_via_relay`‬: اضافه کردن فیلد به ‫`FormState`‬ و ‫`ConfigWire`‬ در ‫`src/bin/ui.rs`‬ که ‫v1.2.8‬ در ‫CI‬ سقوط کرده بود چون در ‫mhrv-rs-ui‬ فراموش شده بود
67
---
78
• Real-IP leak fix (issue #104): extended the forwarded-headers filter in the Apps Script relay path to strip every identity-revealing header (`X-Forwarded-For`, `X-Real-IP`, `Forwarded`, `Via`, `CF-Connecting-IP`, `True-Client-IP`, `Fastly-Client-IP` and 10 more) before we ship the request to Apps Script. If a user sits behind a local proxy (xray/v2rayNG) or a browser extension that inserts any of these, the real IP no longer leaks through the relay path to the origin
89
`youtube_via_relay` config toggle (issue #102): ported from upstream Python. When enabled, YouTube traffic opts out of the SNI-rewrite tunnel and goes through Apps Script instead, bypassing Google's SafeSearch-on-SNI filter that sometimes marks normal videos as "restricted." Trade-off: adds the fixed `Google-Apps-Script` User-Agent and counts YouTube against your daily quota. Off by default
910
• scan-sni chunked-DoH fix (PR #97): `dns.google` replies with `Transfer-Encoding: chunked`; the raw payload was going to serde_json with chunk framing still embedded, so every PTR parse failed and scan-sni discovered nothing. Proper HTTP-body parsing now (chunked + Content-Length), plus unit tests
1011
• scan-sni TLS verification (PR #98): the DoH client to `dns.google` was using `NoVerify` — an on-path MITM could forge PTR answers and poison the discovered SNI pool. Switched to the normal webpki root store; the rest of the scan flow is unchanged
12+
• UI build fix for `youtube_via_relay`: the new config field was added to `Config` but not propagated to `FormState` / `ConfigWire` in `src/bin/ui.rs`, so v1.2.8's CI failed compiling `mhrv-rs-ui` with `missing field youtube_via_relay in initializer of Config`. v1.2.8 tag exists but no Release assets — v1.2.9 is the clean cut.

src/bin/ui.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ struct FormState {
212212
scan_batch_size:usize,
213213
google_ip_validation: bool,
214214
normalize_x_graphql: bool,
215+
youtube_via_relay: bool,
215216
}
216217

217218
#[derive(Clone, Debug)]
@@ -289,6 +290,7 @@ fn load_form() -> (FormState, Option<String>) {
289290
google_ip_validation: c.google_ip_validation,
290291
scan_batch_size:c.scan_batch_size,
291292
normalize_x_graphql: c.normalize_x_graphql,
293+
youtube_via_relay: c.youtube_via_relay,
292294
}
293295
} else {
294296
FormState {
@@ -314,6 +316,7 @@ fn load_form() -> (FormState, Option<String>) {
314316
google_ip_validation:true,
315317
scan_batch_size:500,
316318
normalize_x_graphql: false,
319+
youtube_via_relay: false,
317320
}
318321
};
319322
(form, load_err)
@@ -449,6 +452,10 @@ impl FormState {
449452
google_ip_validation:self.google_ip_validation,
450453
scan_batch_size:self.scan_batch_size,
451454
normalize_x_graphql: self.normalize_x_graphql,
455+
// UI form doesn't expose youtube_via_relay yet — it's a
456+
// config-only flag for now. Passed through from the loaded
457+
// config if set, otherwise defaults to false.
458+
youtube_via_relay: self.youtube_via_relay,
452459
})
453460
}
454461
}
@@ -487,6 +494,8 @@ struct ConfigWire<'a> {
487494
sni_hosts: Option<Vec<&'a str>>,
488495
#[serde(skip_serializing_if = "is_false")]
489496
normalize_x_graphql: bool,
497+
#[serde(skip_serializing_if = "is_false")]
498+
youtube_via_relay: bool,
490499
// IP-scan knobs. These used to be missing from the wire struct, so
491500
// every Save-config silently dropped them — the user would toggle
492501
// "fetch from API" on, save, reopen, and find it off again. Add
@@ -538,6 +547,7 @@ impl<'a> From<&'a Config> for ConfigWire<'a> {
538547
.as_ref()
539548
.map(|v| v.iter().map(String::as_str).collect()),
540549
normalize_x_graphql: c.normalize_x_graphql,
550+
youtube_via_relay: c.youtube_via_relay,
541551
fetch_ips_from_api: c.fetch_ips_from_api,
542552
max_ips_to_scan: c.max_ips_to_scan,
543553
scan_batch_size: c.scan_batch_size,

0 commit comments

Comments
 (0)