Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions src/cli/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ pub fn run_doctor() -> Result<i32, String> {
"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)"),
}
Expand All @@ -91,6 +96,11 @@ pub fn run_doctor() -> Result<i32, String> {
"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)"),
}
Expand Down
10 changes: 8 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,11 +1043,17 @@ pub fn config_value(key: &str, dotenv: &HashMap<String, String>) -> Option<Strin
vec![key]
};

for k in keys {
for k in &keys {
if let Some(val) = env::var(k).ok().filter(|v| !v.is_empty()) {
if let Some(suffix) = k.strip_prefix("NEUROGATE_") {
eprintln!("warning: {k} is deprecated, rename to VIBEMODE_{suffix}");
}
return Some(val);
}
if let Some(val) = dotenv.get(k).cloned().filter(|v| !v.is_empty()) {
if let Some(val) = dotenv.get(*k).cloned().filter(|v| !v.is_empty()) {
if let Some(suffix) = k.strip_prefix("NEUROGATE_") {
eprintln!("warning: {k} is deprecated, rename to VIBEMODE_{suffix}");
}
return Some(val);
}
}
Expand Down
12 changes: 6 additions & 6 deletions ui/app.slint
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ export component AppWindow inherits Window {
// Rate row
HorizontalLayout {
Text {
text: "\{round(root.token-rate-raw)}";
text: root.stealth-mode ? "***" : "\{round(root.token-rate-raw)}";
font-size: 28px;
color: #e6edf3;
font-weight: 700;
Expand All @@ -905,28 +905,28 @@ export component AppWindow inherits Window {
Rectangle { height: 6px; border-radius: 3px; background: #21262d;
Rectangle { x: 0; width: parent.width * (root.five-percent / 100); background: root.five-percent >= 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; }
}
}

Expand Down Expand Up @@ -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 {
Expand Down
Loading