From 6a3f7ce32f8e34510669351ac550cfd46ba032fa Mon Sep 17 00:00:00 2001 From: xodapi <4956501+xodapi@users.noreply.github.com> Date: Sun, 28 Jun 2026 20:17:42 +0700 Subject: [PATCH] fix(gui,docs): propagate stealth mode to overlay and clean up NEUROGATE_API_KEY naming (refs #28) - SECURITY.md, .env.example, README.ru.md: replace NEUROGATE_API_KEY references with VIBEMODE_API_KEY - src/cli/doctor.rs: add deprecation hint when NEUROGATE_API_KEY/NEUROGATE_API_BASE detected - src/lib.rs: emit deprecation warning when config_value() falls back to NEUROGATE_* env vars - ui/app.slint: propagate stealth-mode to overlay (full and compact) so token-rate and percent values are masked --- .env.example | 4 ++-- README.ru.md | 4 ++-- SECURITY.md | 2 +- src/cli/doctor.rs | 10 ++++++++++ src/lib.rs | 10 ++++++++-- ui/app.slint | 12 ++++++------ 6 files changed, 29 insertions(+), 13 deletions(-) diff --git a/.env.example b/.env.example index b81290e..4a875f9 100644 --- a/.env.example +++ b/.env.example @@ -3,8 +3,8 @@ # # Do not commit real API keys. -NEUROGATE_API_KEY=YOUR_NEUROGATE_API_KEY -NEUROGATE_API_BASE=https://r-api.vibemod.pro +VIBEMODE_API_KEY=YOUR_VIBEMODE_API_KEY +VIBEMODE_API_BASE=https://r-api.vibemod.pro # Optional: custom abtop binary path. # ABTOP_BIN=abtop diff --git a/README.ru.md b/README.ru.md index 97435bb..f93e1f1 100644 --- a/README.ru.md +++ b/README.ru.md @@ -75,8 +75,8 @@ vimit doctor — system diagnostics environment: HOME: /home/user - NEUROGATE_API_BASE: (not set, will use default) - NEUROGATE_API_KEY: (set) + VIBEMODE_API_BASE: (not set, will use default) + VIBEMODE_API_KEY: (set) testing API connection to https://r-api.vibemod.pro... OK (4 window(s)) diff --git a/SECURITY.md b/SECURITY.md index 63fb5da..c853572 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,7 +5,7 @@ ## Secrets - Do not commit API keys. -- Pass the VibeMode key through `NEUROGATE_API_KEY`. +- Pass the VibeMode key through `VIBEMODE_API_KEY`. - Or keep it in a local `.env` file next to the binary or working directory. - The tool never writes the key to disk. - The tool does not print the key in normal errors. diff --git a/src/cli/doctor.rs b/src/cli/doctor.rs index ab9ab44..4fa79c7 100644 --- a/src/cli/doctor.rs +++ b/src/cli/doctor.rs @@ -75,6 +75,11 @@ pub fn run_doctor() -> Result { "NEUROGATE_API_BASE" }; println!(" {var_name}: {v}"); + if var_name != "VIBEMODE_API_BASE" { + println!( + " hint: rename {var_name} to VIBEMODE_API_BASE (old name is deprecated)" + ); + } } Err(_) => println!(" VIBEMODE_API_BASE: (not set, will use default)"), } @@ -91,6 +96,11 @@ pub fn run_doctor() -> Result { "NEUROGATE_API_KEY" }; println!(" {var_name}: (set)"); + if var_name != "VIBEMODE_API_KEY" { + println!( + " hint: rename {var_name} to VIBEMODE_API_KEY (old name is deprecated)" + ); + } } Err(_) => println!(" VIBEMODE_API_KEY: (not set, demo data only)"), } diff --git a/src/lib.rs b/src/lib.rs index a815d92..65ccd66 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1043,11 +1043,17 @@ pub fn config_value(key: &str, dotenv: &HashMap) -> Option= 90 ? #f85149 : root.five-percent >= 75 ? #d29922 : #3fb950; border-radius: 3px; } } - Text { text: "\{round(root.five-percent)}%"; width: 44px; horizontal-alignment: right; font-size: 11px; color: root.five-percent >= 90 ? #f85149 : root.five-percent >= 75 ? #d29922 : #3fb950; vertical-alignment: center; } + Text { text: root.stealth-mode ? "***" : "\{round(root.five-percent)}%"; width: 44px; horizontal-alignment: right; font-size: 11px; color: root.five-percent >= 90 ? #f85149 : root.five-percent >= 75 ? #d29922 : #3fb950; vertical-alignment: center; } } HorizontalLayout { Text { text: "24h"; width: 28px; font-size: 11px; color: #7d8590; vertical-alignment: center; } Rectangle { height: 6px; border-radius: 3px; background: #21262d; Rectangle { x: 0; width: parent.width * (root.day-percent / 100); background: root.day-percent >= 90 ? #f85149 : root.day-percent >= 75 ? #d29922 : #3fb950; border-radius: 3px; } } - Text { text: "\{round(root.day-percent)}%"; width: 44px; horizontal-alignment: right; font-size: 11px; color: root.day-percent >= 90 ? #f85149 : root.day-percent >= 75 ? #d29922 : #3fb950; vertical-alignment: center; } + Text { text: root.stealth-mode ? "***" : "\{round(root.day-percent)}%"; width: 44px; horizontal-alignment: right; font-size: 11px; color: root.day-percent >= 90 ? #f85149 : root.day-percent >= 75 ? #d29922 : #3fb950; vertical-alignment: center; } } HorizontalLayout { Text { text: "7d"; width: 28px; font-size: 11px; color: #7d8590; vertical-alignment: center; } Rectangle { height: 6px; border-radius: 3px; background: #21262d; Rectangle { x: 0; width: parent.width * (root.week-percent / 100); background: root.week-percent >= 90 ? #f85149 : root.week-percent >= 75 ? #d29922 : #3fb950; border-radius: 3px; } } - Text { text: "\{round(root.week-percent)}%"; width: 44px; horizontal-alignment: right; font-size: 11px; color: root.week-percent >= 90 ? #f85149 : root.week-percent >= 75 ? #d29922 : #3fb950; vertical-alignment: center; } + Text { text: root.stealth-mode ? "***" : "\{round(root.week-percent)}%"; width: 44px; horizontal-alignment: right; font-size: 11px; color: root.week-percent >= 90 ? #f85149 : root.week-percent >= 75 ? #d29922 : #3fb950; vertical-alignment: center; } } HorizontalLayout { Text { text: "30d"; width: 28px; font-size: 11px; color: #7d8590; vertical-alignment: center; } Rectangle { height: 6px; border-radius: 3px; background: #21262d; Rectangle { x: 0; width: parent.width * (root.month-percent / 100); background: root.month-percent >= 90 ? #f85149 : root.month-percent >= 75 ? #d29922 : #3fb950; border-radius: 3px; } } - Text { text: "\{round(root.month-percent)}%"; width: 44px; horizontal-alignment: right; font-size: 11px; color: root.month-percent >= 90 ? #f85149 : root.month-percent >= 75 ? #d29922 : #3fb950; vertical-alignment: center; } + Text { text: root.stealth-mode ? "***" : "\{round(root.month-percent)}%"; width: 44px; horizontal-alignment: right; font-size: 11px; color: root.month-percent >= 90 ? #f85149 : root.month-percent >= 75 ? #d29922 : #3fb950; vertical-alignment: center; } } } @@ -980,7 +980,7 @@ export component AppWindow inherits Window { } VerticalLayout { Text { - text: "5h: \{round(root.five-percent)}% · \{round(root.token-rate-raw)} " + root.token-rate-text; + text: "5h: " + (root.stealth-mode ? "***" : "\{round(root.five-percent)}%") + " · " + (root.stealth-mode ? "***" : "\{round(root.token-rate-raw)} " + root.token-rate-text); font-size: 12px; color: #e6edf3; font-weight: 700; } Text {