pub const APP_NAME: &str = env!("CARGO_PKG_NAME");
pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
pub const DEFAULT_TICK_RATE: u64 = 1000;
pub const DEFAULT_TELEMETRY_POLL_RATE: u64 = 30;
pub const DEFAULT_API_TIMEOUT: u64 = 5;
pub const DEFAULT_PING_TIMEOUT: u64 = 2;
pub const DEFAULT_CONNECT_TIMEOUT: u64 = 20;
#[cfg(target_os = "macos")]
pub const CMD_TIMEOUT_SECS: u64 = 5;
pub const DEFAULT_DISCONNECT_TIMEOUT: u64 = 30;
pub const DEFAULT_CONNECT_MAX_RETRIES: u32 = 3;
pub const DEFAULT_CONNECT_RETRY_BASE_DELAY_SECS: u64 = 2;
pub const DEFAULT_CONNECT_RETRY_MAX_DELAY_SECS: u64 = 300;
pub const DEFAULT_AUTO_RECONNECT: bool = true;
pub const DEFAULT_AUTO_RECONNECT_DELAY_SECS: u64 = 3;
pub const NETWORK_MONITOR_POLL_SECS: u64 = 3;
pub const FLIP_ANIMATION_DURATION_MS: u64 = 200;
pub const FLIP_ANIMATION_FRAME_MS: u64 = 25;
pub const DEFAULT_IP_API_PRIMARY: &str = "https://ipinfo.io/json";
pub const DEFAULT_IP_API_FALLBACK_1: &str = "https://api.ipify.org";
pub const DEFAULT_IP_API_FALLBACK_2: &str = "https://icanhazip.com";
pub const DEFAULT_IP_API_FALLBACK_3: &str = "https://ifconfig.me/ip";
pub const DEFAULT_IPV6_CHECK_APIS: [&str; 3] = [
"https://ipv6.icanhazip.com",
"https://v6.ident.me",
"https://api6.ipify.org",
];
pub const DEFAULT_PING_TARGETS: [&str; 4] = [
"1.1.1.1", "8.8.8.8", "9.9.9.9", "208.67.222.222", ];
pub const PROFILES_DIR_NAME: &str = "profiles";
pub const LOGS_DIR_NAME: &str = "logs";
pub const METADATA_FILE_NAME: &str = "metadata.json";
pub const KILLSWITCH_STATE_FILE: &str = "killswitch.state";
#[cfg(target_os = "macos")]
pub const PF_CONF_PATH: &str = "/var/run/vortix/killswitch.conf";
#[cfg(target_os = "macos")]
pub const PF_CONF_PATH_LEGACY: &str = "/tmp/vortix_killswitch.conf";
#[cfg(target_os = "macos")]
pub const WIREGUARD_RUN_DIR: &str = "/var/run/wireguard";
#[cfg(target_os = "linux")]
pub const PROC_NET_DEV_PATH: &str = "/proc/net/dev";
pub const RESOLV_CONF_PATH: &str = "/etc/resolv.conf";
#[cfg(target_os = "linux")]
pub const IPTABLES_CHAIN_NAME: &str = "VORTIX_KILLSWITCH";
#[cfg(target_os = "linux")]
pub const NFT_TABLE_NAME: &str = "vortix_killswitch";
pub const DEFAULT_MAX_LOG_ENTRIES: usize = 1000;
pub const DEFAULT_LOG_LEVEL: &str = "info";
pub const DEFAULT_LOG_ROTATION_SIZE: u64 = 5 * 1024 * 1024;
pub const DEFAULT_LOG_RETENTION_DAYS: u64 = 7;
pub const LOG_CLEANUP_INTERVAL: u32 = 100;
pub const SCANNER_LOG_INTERVAL_SECS: u64 = 5;
pub const SESSION_TIME_DRIFT_SECS: u64 = 5;
pub const HTTP_TIMEOUT_SECS: u64 = 10;
pub const RETRY_DELAY_MS: u64 = 500;
pub const RETRY_ATTEMPTS: u8 = 2;
pub const LOG_CATEGORY_WIDTH: usize = 9;
pub const LOG_PREFIX_WIDTH: usize = 12 + 6 + LOG_CATEGORY_WIDTH + 2;
pub const NETWORK_HISTORY_SIZE: usize = 60;
pub const LOGS_AUTO_SCROLL_THRESHOLD: u16 = 5;
pub const PROFILE_LIST_PAGE_SIZE: usize = 10;
pub const MIN_TERMINAL_WIDTH: u16 = 60;
pub const MIN_TERMINAL_HEIGHT: u16 = 20;
pub const CONFIG_VIEWER_HEIGHT_PCT: u16 = 85;
pub const CONFIG_VIEWER_CHROME_LINES: u16 = 4;
pub const MSG_BACKEND_INIT: &str = "IO: Initializing VPN backend...";
pub const MSG_DETECTING: &str = "Detecting...";
pub const MSG_FETCHING: &str = "Fetching...";
pub const MSG_NO_DATA: &str = "---";
#[cfg(target_os = "macos")]
pub const DEFAULT_VPN_INTERFACE: &str = "utun0";
#[cfg(target_os = "linux")]
pub const DEFAULT_VPN_INTERFACE: &str = "wg0";
#[cfg(target_os = "macos")]
pub const KILLSWITCH_EMERGENCY_MSG: &str = "You may need to run: sudo pfctl -F all";
#[cfg(target_os = "linux")]
pub const KILLSWITCH_EMERGENCY_MSG: &str =
"You may need to run: sudo iptables -F VORTIX_KILLSWITCH && sudo iptables -X VORTIX_KILLSWITCH (or: sudo nft delete table inet vortix_killswitch)";
pub const OPENVPN_RUN_DIR: &str = "run";
pub const OVPN_LOG_SUCCESS: &str = "Initialization Sequence Completed";
pub const OVPN_LOG_ERRORS: &[&str] = &[
"AUTH_FAILED",
"TLS Error",
"TLS handshake failed",
"FATAL",
"Cannot open TUN/TAP",
"ERROR:",
"Exiting due to fatal error",
"Options error",
];
pub const OVPN_LOG_POLL_MS: u64 = 500;
pub const OVPN_CHOWN_DELAY_MS: u64 = 200;
pub const OVPN_HEALTH_CHECK_DELAY_SECS: u64 = 2;
pub const OVPN_PID_FILE_TIMEOUT_SECS: u64 = 3;
pub const OVPN_ERROR_LOG_TAIL_LINES: usize = 5;
pub const OVPN_KILL_WAIT_SECS: u64 = 10;
pub const DEFAULT_OVPN_VERBOSITY: &str = "3";
pub const OPENVPN_AUTH_DIR: &str = "auth";
pub const OVPN_AUTH_USER_PASS: &str = "auth-user-pass";
pub const TITLE_AUTH_PROMPT: &str = " VPN Authentication ";
pub const TITLE_AUTH_MANAGE: &str = " Edit Auth Credentials ";
pub const TITLE_AUTH_FOOTER: &str = " [Tab] Switch [Enter] Connect [Esc] Cancel ";
pub const TITLE_AUTH_MANAGE_FOOTER: &str = " [Tab] Switch [Enter] Save [Esc] Cancel ";
pub const MAX_CONFIG_SIZE_BYTES: u64 = 1_024 * 1_024;
pub const DEFAULT_IMPORTED_FILENAME: &str = "imported_profile.conf";
pub const TITLE_IMPORT_PROFILE: &str = " Import VPN Profile ";
pub const TITLE_IMPORT_FOOTER: &str = " [Enter] Import [Esc] Cancel ";
pub const PROMPT_IMPORT_PATH: &str = "Enter path to file, directory, or URL:";
pub const TITLE_FLIP_NETWORK_ACTIVITY: &str = " ◀ Network Activity ";
pub const TITLE_FLIP_QUALITY_TIMELINE: &str = " ◀ Quality Timeline ";
pub const TITLE_FLIP_CONNECTIONS_AUDIT: &str = " ◀ Connections Audit ";
pub const FLIP_BACK_HINT: &str = " [f] flip back ";
pub const FLIP_ANIMATION_MIN_WIDTH: u16 = 3;
pub const HINT_IMPORT_BULK: &str = "💡 Tip: Enter a directory to bulk import all profiles";
pub const LABEL_SUPPORTED_FORMATS: &str = "Supported formats:";
pub const EXT_CONF: &str = ".conf";
pub const EXT_OVPN: &str = ".ovpn";
pub const PROTO_WIREGUARD: &str = "WireGuard";
pub const PROTO_OPENVPN: &str = "OpenVPN";
pub const MSG_DOWNLOADING: &str = "Downloading profile...";
pub const MSG_DOWNLOAD_FAILED: &str = "Download failed: ";
pub const MSG_IMPORT_SUCCESS: &str = "Imported: ";
pub const MSG_IMPORT_ERROR: &str = "Error: ";
pub const MSG_NO_FILES_FOUND: &str = "No .conf or .ovpn files found";
pub const MSG_BATCH_IMPORTED: &str = "Imported ";
pub const MSG_BATCH_IMPORTED_SUFFIX: &str = " profile(s)";
pub const CLI_MSG_DOWNLOADING: &str = "Downloading profile from URL...";
pub const CLI_MSG_IMPORT_SUCCESS: &str = "Imported profile: ";
pub const CLI_MSG_IMPORT_DETAILS_PROTO: &str = " Protocol: ";
pub const CLI_MSG_IMPORT_DETAILS_LOC: &str = " Location: ";
pub const CLI_MSG_IMPORT_DETAILS_PATH: &str = " Saved to: ";
pub const CLI_MSG_IMPORT_FAILED: &str = "Import failed: ";
pub const CLI_MSG_SUMMARY_HEADER: &str = "\nImport Summary:";
pub const CLI_MSG_SUMMARY_IMPORTED: &str = " Imported: ";
pub const CLI_MSG_SUMMARY_FAILED: &str = " Failed: ";
pub const CLI_MSG_NO_FILES: &str = "\nNo .conf or .ovpn files found in directory";
pub const CLI_MSG_DIR_ERROR: &str = "Error reading directory: ";
pub const CLI_MSG_ERROR: &str = "Error: ";
pub const CLI_MSG_UPDATE_START: &str = "🔄 Updating vortix...\n";
pub const CLI_MSG_UPDATE_SUCCESS: &str = "Successfully updated vortix!";
pub const CLI_MSG_UPDATE_CHECK: &str = " Run 'vortix --version' to see the new version.";
pub const CLI_MSG_UPDATE_FAIL_MANUAL: &str = "\nUpdate failed. Please try manually:";
pub const CLI_MSG_UPDATE_CMD: &str = " cargo install vortix --force";
pub const CLI_MSG_UPDATE_FAIL_CARGO: &str = "Failed to run cargo: ";
pub const CLI_MSG_UPDATE_PATH_HINT: &str = " Make sure cargo is installed and in your PATH.";
pub const GITHUB_REPO_URL: &str = env!("CARGO_PKG_REPOSITORY");
pub const GITHUB_ISSUE_URL_LIMIT: usize = 8100;
pub const ERR_HTML_CONTENT: &str =
"URL returned HTML content. Did you mean to use the 'raw' version of the link?";
pub const ERR_EMPTY_CONTENT: &str = "Downloaded content is empty";
pub const ERR_SERVER_ERROR: &str = "Server returned error: ";
pub const ERR_HTTP_CLIENT_BUILD_FAILED: &str = "Failed to build HTTP client";
pub const ERR_NETWORK_REQUEST_FAILED: &str = "Network request failed";