Commit Graph

65 Commits

Author SHA1 Message Date
f2b52959e6 a 2026-03-25 07:23:07 +01:00
4c718b625f refractor: generate missing MacOS specific icns 2026-03-25 07:16:45 +01:00
778a3fc258 refractor: add missing MacOS depencies for tauri application 2026-03-25 07:11:37 +01:00
3aca2ca55a feat: suppress WireGuard GUI auto-launch after MSI installation on Windows
Add DO_NOT_LAUNCH=1 argument to msiexec command to prevent WireGuard application from automatically starting after runtime installation completes.
2026-03-24 18:56:52 +01:00
5003a2f0f7 feat: add automated WireGuard runtime installation for Windows desktop client with bundled MSI installer
Add install-runtime command to tunnel-helper for automated WireGuard installation on Windows. Download and bundle official WireGuard MSI during build process with automatic version discovery from wireguard.com.

Add ensure_windows_runtime_installed checks before connect/disconnect operations. Implement install_windows_runtime with UAC elevation prompt and install_windows_runtime_direct for MS
2026-03-24 18:35:19 +01:00
bee9e63ace s 2026-03-18 15:06:44 +01:00
4b2d50b603 fix: resolve symlinks when copying WireGuard tools for macOS bundle
Add -L flag to cp commands to dereference symlinks and copy actual binaries instead of symlink references when bundling wg and wg-quick tools for aarch64-apple-darwin target.
2026-03-18 14:39:55 +01:00
a80a87e5ca feat: add macOS tunnel interface verification with retry logic after wg-quick up
Add wait_for_macos_tunnel_running helper with 6-second polling loop checking tunnel_service_is_active after wg-quick up command. Retry up to 12 times with 500ms intervals before returning error if interface not verified.
2026-03-18 14:34:17 +01:00
8eb293e01e feat: add bundled WireGuard tools support for macOS desktop client with fallback path resolution
Add wg and wg-quick bundling to build-tunnel-helper.sh for aarch64-apple-darwin target. Check for wireguard-tools installation and copy binaries to output directory with execute permissions.

Implement find_wg_quick helper with bundled tool detection and standard path fallbacks. Add bundled_macos_tool to check for tools in current executable directory. Update connect_direct and disconnect_direct to use explicit
2026-03-18 14:31:37 +01:00
5233e90dce feat: add macOS desktop client build workflow with ARM64 support and fix tunnel metrics task ownership
Add macos-desktop-client.yml workflow with manual dispatch trigger running on macos-arm64 runner. Install Node.js 22 and Rust toolchain with aarch64-apple-darwin target. Build bundled tunnel helper and Tauri application bundle, then upload .app, .dmg, and raw build artifacts.

Fix tunnel_metrics handler to clone app handle before spawn_blocking to prevent ownership issues when passing to tunnel
2026-03-18 14:27:26 +01:00
6cf49ff3e0 feat: add service catalog management with policy integration for domain-based resource access control
Add ServiceCatalogItem type and services CRUD API endpoints (list, create, update, delete). Extend Policy type to include services array with domain, upstream_ip, proxy_ip, and ports metadata.

Add ServicesPage component with table view and create/edit modals for managing service definitions. Include service name, domain, proxy, and upstream columns with port parsing logic.

Integrate service selection
2026-03-18 13:09:54 +01:00
0ac93dfeb6 refactor: wrap tunnel connect/disconnect operations in spawn_blocking and add pending state UI feedback
Move tunnel_manager::connect and disconnect calls into spawn_blocking tasks to prevent blocking async runtime. Clone app handle and profile path before spawning. Add map_err for task join failures.

Add tunnelActionPending state to track in-progress tunnel operations. Pass busy prop to AppHeader and disable sync/logout/connect buttons during tunnel actions. Update connect button text to show "
2026-03-18 12:35:25 +01:00
aaa601a8ba feat: add access profile selection support with device-specific profile persistence
Add SelectOwnProfile handler to allow users to choose from available access profiles. Store selected profile ID per device in settings table with device_access_profile category. Implement GetSelectedProfileID and SetSelectedProfileID repository methods using JSONB storage.

Add ListSelectableProfiles to policy repository and service to query user/group/device-specific profiles ordered by priority. Filter gateway
2026-03-18 12:21:48 +01:00
1ddcbf0b14 refactor: extract UI components and redesign desktop client interface with improved visual hierarchy
Extract App.tsx logic into reusable components: AppHeader, ResourcePanel, StatusCard, StatTile, and ActionButton. Replace inline markup with component composition and props-based data flow.

Redesign visual system with enhanced gradients, refined color palette, and improved spacing. Update app-shell grid layout with 18px gaps and 1140px max width. Add radial gradient overlays and linear background
2026-03-18 11:42:34 +01:00
caec578985 refactor: add PATH search logic to cargo-xwin wrapper script to find real binary outside script directory
Replace direct cargo xwin execution with PATH traversal to locate actual cargo-xwin binary outside script's own directory. Add error handling with installation instructions when binary not found. Skip script's own directory and empty PATH entries during search.
2026-03-18 10:56:58 +01:00
fcc32f253b refactor: adjust grid alignment and responsive breakpoint for improved layout consistency
Add align-items: start to body-grid and align-content: start to status-grid to prevent vertical stretching and maintain top alignment. Reduce responsive breakpoint from 960px to 760px to match new default window width.
2026-03-18 10:41:10 +01:00
1c496435f5 refactor: reduce UI spacing and dimensions throughout desktop client for more compact layout
Reduce padding, gaps, and font sizes across all components. Change html/body/root from min-height to fixed height with overflow hidden. Decrease app-frame padding from 18px to 12px and add grid-template-rows with overflow handling. Reduce brand lockup logo from 54px to 44px and adjust gaps throughout. Decrease button padding, surface padding, and card padding. Reduce body-grid sidebar from 290px to 250px.
2026-03-18 10:37:52 +01:00
56acc96229 refactor: reduce window size and remove transfer metrics display from main UI
Reduce default window dimensions from 1120x760 to 940x640 pixels and disable resizing. Remove TunnelMetrics and RawTunnelMetrics types, formatDataSize and normalizeTunnelMetrics helpers, and all transfer statistics tracking from App component. Replace refreshTunnelMetrics with simpler refreshTunnelStatus that only queries tunnel active state. Remove received/sent data display cards from status panel and eliminate metrics
2026-03-18 10:34:12 +01:00
799bc6550e feat: add dynamic tray icon with connected/disconnected states and green checkmark badge
Add png dependency and tauri image-png feature to support custom tray icon rendering. Load base disconnected icon from bundled PNG and generate connected variant with green circular badge containing white checkmark overlay. Implement draw_check_badge, draw_line, and blend_pixel helpers using Bresenham's line algorithm for badge rendering. Store both icon variants and TrayIcon reference in TrayState and update icon
2026-03-18 10:28:03 +01:00
9f32c273e0 refactor: replace async runtime with blocking thread for tray menu refresh and mark unused state parameter
Replace tauri::async_runtime::spawn with std::thread::spawn for periodic tray menu refresh background task and change async sleep to blocking thread sleep. Prefix unused state parameter with underscore in sync_profile command to suppress compiler warnings.
2026-03-18 10:06:18 +01:00
0fcea99006 feat: add periodic tray menu refresh and normalize tunnel metrics field names
Add background task to refresh tray menu every 5 seconds to keep status display current. Add RawTunnelMetrics type and normalizeTunnelMetrics helper to handle both snake_case and camelCase field names from backend responses. Update refreshTunnelMetrics to normalize metrics before setting state and explicitly cast active status to boolean.
2026-03-18 10:04:55 +01:00
184192e1c2 feat: add fallback to wg show command for transfer metrics when dump command fails
Add read_transfer_totals_from_show function to parse transfer statistics from wg show output as fallback when wg show dump command fails. Add parse_human_wireguard_bytes helper to convert human-readable byte values (B, KiB, MiB, GiB, TiB) to u64. Update read_transfer_totals to call fallback instead of returning error when dump command fails.
2026-03-18 09:59:44 +01:00
d032950dfb refactor: replace metrics-based tunnel status check with direct status command in is_active function
Replace metrics query in is_active with direct tunnel_backend status command call to avoid unnecessary metrics overhead when only checking tunnel state. Parse status command stdout and compare against "active" string case-insensitively. Add Windows CREATE_NO_WINDOW flag to status command execution.
2026-03-18 09:56:42 +01:00
3d70655cfa feat: add fallback tunnel status check and improve Windows service command calls
Add fallback to tunnel_status when metrics query fails in current_metrics function, returning zero bytes with actual tunnel state. Update waitForTunnelStatus in frontend to use tunnel_status instead of tunnel_metrics for status polling and refresh metrics separately on success. Change CloseRequested window event handler to call app_handle().exit(0) instead of no-op. Replace "sc" with "sc.exe" in all Windows service command
2026-03-18 09:53:46 +01:00
eff143d5b3 refactor: remove direct Windows metrics from tunnel_manager and update wg.exe fallback in tunnel-helper
Remove direct_windows_metrics, read_windows_metrics_from_show, parse_human_wireguard_bytes, and find_windows_wg functions from tunnel_manager.rs to rely on bundled backend for all metrics queries. Update find_wg_cli in tunnel-helper to return "wg.exe" as fallback when WireGuard installation paths don't exist, removing "wg" from candidate list.
2026-03-18 09:49:20 +01:00
d1940e6f28 feat: add automatic token refresh on 401 responses during profile sync
Add RefreshRequest struct for token refresh API calls. Update sync_current_session to detect 401 responses and automatically refresh access tokens using refresh token before retrying profile sync. Store refreshed access and refresh tokens in existing session state. Extract profile URL to variable for reuse in retry logic.
2026-03-18 09:23:52 +01:00
d5c6760a2d feat: add visual separators and disable click events for status menu items in tray
Add PredefinedMenuItem import and create separator items to visually group tray menu sections. Update menu item labels from "Open/Quit NexaVPN" to "Open/Quit NexaVPN Client" for clarity. Add separators around toggle item to separate status display from actions. Add no-op event handlers for status, received, and sent menu items to prevent unintended interactions with display-only elements.
2026-03-18 09:18:52 +01:00
137fb1d3e7 feat: sync profile before connection and apply current policy to enrollment responses
Add applyCurrentPolicy function to resolve and apply policy destinations to enrollment responses with fallback to 172.16.10.0/24 when no destinations exist. Replace withDebugProfile calls with applyCurrentPolicy in GetLatestEnrollmentByUser and GetEnrollmentByDeviceID. Extract sync_current_session helper function to deduplicate profile sync logic between sync_profile and connect_tunnel commands. Update connect
2026-03-18 08:56:59 +01:00
cb79bdafbd feat: add dynamic tray menu with connection status, transfer metrics, and toggle action
Add TrayState struct to track menu items for status, received/sent bytes, and connection toggle. Add format_data_size helper to convert bytes to human-readable units (B, KB, MB, GB, TB). Add current_metrics, update_tray_menu, refresh_tray_menu, and toggle_tray_connection functions to manage tray state. Update tray menu to include status, received, sent, and toggle items. Call refresh_tray_menu after enroll_device
2026-03-18 08:45:06 +01:00
aeb0b8f8b4 feat: add fallback to wg show transfer parsing when dump command fails on Windows
Add read_windows_metrics_from_show function that parses human-readable transfer output from wg show command when wg show dump fails. Add parse_human_wireguard_bytes helper to convert human-readable byte values (B, KiB, MiB, GiB, TiB) to u64. Update direct_windows_metrics to fall back to transfer parsing instead of returning zero metrics when dump command fails.
2026-03-18 08:27:36 +01:00
86c9c1a80c feat: add direct WireGuard metrics collection on Windows with service status check and wg show dump parsing
Add direct_windows_metrics function that queries WireGuard tunnel metrics directly using sc query and wg show dump commands instead of tunnel helper. Add find_windows_wg helper to locate wg.exe in standard installation paths. Update metrics function to attempt direct collection first on Windows before falling back to tunnel helper. Parse rx_bytes and tx_bytes from wg show dump output by sum
2026-03-18 08:17:20 +01:00
e70a9dd0c9 feat: suppress console window for tunnel helper commands on Windows
Add CREATE_NO_WINDOW flag to all tunnel helper Command invocations on Windows to prevent console window flashing during connect, disconnect, and metrics operations. Import CommandExt trait and define CREATE_NO_WINDOW constant for Windows builds.
2026-03-18 08:12:34 +01:00
46127ad73c refactor: remove windows_subsystem attribute to enable console output in tunnel-helper
Remove windows_subsystem = "windows" attribute from tunnel-helper to allow console output for debugging and logging. This enables stdout/stderr visibility when running the helper binary directly.
2026-03-18 08:06:32 +01:00
cc99e45ebb feat: add pre-installation cleanup with service and process termination
Add NSIS_HOOK_PREINSTALL macro that stops WireGuardTunnel$NexaVPN service, kills nexavpn-desktop.exe and nexavpn-tunnel-helper.exe processes, and stops NexaVPNTunnelService before installation. Add WireGuardTunnel$NexaVPN service stop to NSIS_HOOK_PREUNINSTALL before service uninstallation.
2026-03-18 07:59:52 +01:00
bbea4f8bd0 feat: add idempotent tunnel connection with state polling and already-running detection
Add tunnel_service_is_active check before Windows tunnel installation to skip if already running. Add is_already_running_error helper to detect "already installed and running" message in WireGuard output. Add wait_for_windows_tunnel_running that polls tunnel state up to 12 times with 500ms intervals after installation. Add describe_windows_tunnel_state for detailed error messages when tunnel fails to reach RUNNING state.
2026-03-18 07:53:38 +01:00
610c5459e5 feat: add device traffic metrics with gateway telemetry reporting and admin UI display
Add rx_bytes and tx_bytes fields to Device type and API responses. Add formatDataSize helper for human-readable byte formatting with units from B to TB. Add Received and Sent columns to devices table in admin UI with formatted traffic totals. Add traffic metrics display to device action panel.

Add TelemetrySnapshot and PeerTelemetry types for gateway runtime stats. Add gateway telemetry endpoint at POST /gateway
2026-03-18 07:43:22 +01:00
21b7a140dd feat: add client-side private key persistence and profile materialization
Store generated private key in SessionState and persist across enrollment and profile sync operations. Add materialize_profile helper that replaces placeholder tokens (__CLIENT_GENERATED_PRIVATE_KEY__ and __CLIENT_PRIVATE_KEY_REQUIRED__) with actual private key before writing profile to disk. Update enroll_device and sync_profile to materialize profile content with private key before writing.
2026-03-18 07:19:10 +01:00
aef6bf998b refactor: update bundled binary path and add tunnel status polling with retry logic
Change NSIS installer hooks to use bundled/ instead of resources/bundled/ path for tunnel helper executable. Add waitForTunnelStatus helper that polls tunnel status up to 8 times with 500ms intervals to verify expected state after connect/disconnect operations. Update toggle handler to use polling instead of single status check and add error message for failed disconnect operations.
2026-03-18 07:15:54 +01:00
fc6969d7fb feat: add automatic Windows service installation and startup with privilege elevation
Add connect_to_service helper that attempts service connection with automatic fallback to service start and installation. Add install-service-direct command for elevated service installation. Split install_windows_service into privilege-checking wrapper and install_windows_service_direct for actual installation. Add start_windows_service function using sc start command. Add is_windows_admin helper using net session to
2026-03-18 07:12:01 +01:00
d72a32cce1 feat: add single instance enforcement with TCP socket lock
Add single instance check using TCP listener on 127.0.0.1:53190 to prevent multiple application instances. Move AppState initialization into setup closure to include single_instance_lock field. Remove window close prevention and focus restoration handlers. Make main window non-resizable and non-maximizable.
2026-03-18 07:06:20 +01:00
31369a7743 feat: add tunnel status checking with active interface verification
Add tunnel_status command to desktop client for querying active tunnel state. Add is_active method to tunnel_manager that calls status command on bundled backend. Add status command to tunnel-helper that checks WireGuard service state on Windows via sc query and interface state on macOS via wg show. Add windows_client_status function for IPC-based status queries with active field in TunnelResponse. Update App.tsx to query tunnel status on
2026-03-18 07:02:39 +01:00
a67fae5c44 refactor: use explicit empty array type for Windows service start arguments
Replace inline empty array literal with explicitly typed empty_args variable to satisfy Rust type inference requirements for service.start() call.
2026-03-17 21:57:34 +01:00
357c35de42 refactor: change Windows service start type from Automatic to AutoStart
Update service configuration to use ServiceStartType::AutoStart instead of Automatic for consistency with Windows service API naming conventions.
2026-03-17 21:56:57 +01:00
a3e5eb32ec feat: add Windows service for elevated tunnel operations with IPC communication
Add Windows service to handle WireGuard tunnel operations with elevated privileges. Implement IPC server on TCP port 53189 for client-service communication using JSON protocol. Add install-service and uninstall-service commands to NSIS installer hooks for automatic service installation. Replace direct WireGuard calls with IPC requests when running on Windows. Add TunnelRequest and TunnelResponse types for IPC protocol
2026-03-17 21:56:13 +01:00
767c633afa refactor: simplify desktop client UI labels and remove local config section
Replace Unix timestamp with "Just now" label in now_label helper. Update profile label from "No profile provisioned" to "Not provisioned". Change brand copy subtitle based on enrollment state. Rename "Current profile" to "Overview" and "Profile" to "Access" in status panel. Remove "Stored config" surface section showing profile path and revision. Update resources sidebar instructions and rename resource-list to resource-
2026-03-17 21:49:55 +01:00
0986a36aca feat: add logout functionality and redesign desktop client UI for simplified workflow
Add clear_session command to remove session state and profile files from disk. Add resetEnrollment handler in frontend to clear local state and invoke clear_session. Remove hero surface section with profile metadata tiles. Simplify top strip to show profile label in brand copy when enrolled. Add Logout button to top actions and resources sidebar. Redesign status panel with simplified labels and layout. Update surface
2026-03-17 21:34:53 +01:00
464dca0795 refactor: split window restoration into type-specific helpers and add focus event handler
Rename restore_main_window to restore_webview_window for WebviewWindow type. Add new restore_window helper for generic Window type. Update tray menu and click handlers to use restore_webview_window. Add WindowEvent::Focused handler to restore window state when focused.
2026-03-17 21:25:38 +01:00
a4c5a3f0ca feat: add profile sync functionality and redesign desktop client UI
Add sync_profile command to fetch latest profile from backend without re-enrollment. Add DeviceView struct to EnrollResponse. Replace hardcoded "just now" timestamp with now_label helper using Unix epoch seconds. Add sync button to UI with loading state. Redesign client interface with top strip containing brand lockup and action buttons, hero surface with profile metadata tiles, body grid with login/status panels and resources sidebar
2026-03-17 21:24:50 +01:00
cf65dc0e41 feat: add update and delete operations for users and policies in admin interface
Add updateUser and deleteUser API client methods with PATCH and DELETE endpoints. Add updatePolicy and deletePolicy API client methods. Add email field to User type. Add Actions column to users and policies tables with Edit and Delete buttons. Implement inline edit forms for users and policies with state management for editing mode. Add update and delete mutations with query invalidation on success. Add error notices
2026-03-17 20:49:38 +01:00
b288f0d155 feat: add system tray icon with minimize-to-tray behavior
Enable tray-icon feature in Tauri dependencies. Add system tray with Open and Quit menu items. Implement tray icon click handlers to restore main window. Add window event handlers to hide window on close/minimize instead of exiting application. Add restore_main_window and hide_main_window helper functions for window visibility management.
2026-03-17 19:56:46 +01:00