All checks were successful
Build and Release / build-and-release (push) Successful in 2m7s
- Implement per-collector interval timing respecting NixOS config - Remove all hardcoded timeout/interval values and make configurable - Add tmux session requirement check for TUI mode (bypassed for headless) - Update agent to send config hash in Build field instead of nixos version - Add nginx check interval, HTTP timeouts, and ZMQ transmission interval configs - Update NixOS configuration with new configurable values Breaking changes: - Build field now shows nix store config hash (8 chars) instead of nixos version - All intervals now follow individual collector configuration instead of global New configuration fields: - systemd.nginx_check_interval_seconds - systemd.http_timeout_seconds - systemd.http_connect_timeout_seconds - zmq.transmission_interval_seconds
32 lines
2.0 KiB
Rust
32 lines
2.0 KiB
Rust
#!/usr/bin/env rust-script
|
|
|
|
use std::process;
|
|
|
|
/// Check if running inside tmux session
|
|
fn check_tmux_session() {
|
|
// Check for TMUX environment variable which is set when inside a tmux session
|
|
if std::env::var("TMUX").is_err() {
|
|
eprintln!("╭─────────────────────────────────────────────────────────────╮");
|
|
eprintln!("│ ⚠️ TMUX REQUIRED │");
|
|
eprintln!("├─────────────────────────────────────────────────────────────┤");
|
|
eprintln!("│ CM Dashboard must be run inside a tmux session for proper │");
|
|
eprintln!("│ terminal handling and remote operation functionality. │");
|
|
eprintln!("│ │");
|
|
eprintln!("│ Please start a tmux session first: │");
|
|
eprintln!("│ tmux new-session -d -s dashboard cm-dashboard │");
|
|
eprintln!("│ tmux attach-session -t dashboard │");
|
|
eprintln!("│ │");
|
|
eprintln!("│ Or simply: │");
|
|
eprintln!("│ tmux │");
|
|
eprintln!("│ cm-dashboard │");
|
|
eprintln!("╰─────────────────────────────────────────────────────────────╯");
|
|
process::exit(1);
|
|
} else {
|
|
println!("✅ Running inside tmux session - OK");
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
println!("Testing tmux check function...");
|
|
check_tmux_session();
|
|
} |