Commit Graph

61 Commits

Author SHA1 Message Date
4b16e0d4fc feat: switch gateway container to host network mode and replace host.docker.internal with 127.0.0.1
Change gateway service from bridge networking to host network mode to enable direct access to host network interfaces. Replace host.docker.internal references with 127.0.0.1 in gateway URLs and backend host configuration. Remove port mapping, extra_hosts, and explicit network attachments since host mode provides direct network access.
2026-03-18 08:28:33 +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
9ea2345982 feat: make gateway UDP port configurable via GATEWAY_UDP_PORT environment variable
Add GATEWAY_UDP_PORT environment variable with default value 51900 to replace hardcoded port 51820. Update DEFAULT_GATEWAY_ENDPOINT in .env.example to use new port. Add UDP port mapping to gateway service in docker-compose using GATEWAY_UDP_PORT. Add NEXAVPN_GATEWAY_LISTEN_PORT environment variable to gateway container. Update gateway-entrypoint.sh to use GATEWAY_LISTEN_PORT variable in bootstrap payload and WireGuard interface configuration.
2026-03-18 07:54:18 +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
0b29331f26 refactor: remove admin portal link and promote API health check to primary action
Remove admin portal link from public-web landing page actions. Change API health check button from secondary to primary style.
2026-03-17 22:16:16 +01:00
1d69b20fcc refactor: consolidate public-web port to 8080 and add API proxy configuration
Remove backend port exposure and change public-web from port 8082 to 8080. Add backend dependency to public-web service. Remove public-web dependency from nginx service. Add /api/ location block to public-web nginx config with proxy_pass to backend:8080 and proxy headers for Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto.
2026-03-17 22:13:46 +01:00
65e74c6832 feat: add public-facing web interface with domain-based routing
Add public-web service with static landing page for client enrollment and device provisioning. Add public-web container to docker-compose with port 8082. Configure nginx reverse proxy with domain-based routing: admin-vpn.nesterovic.cc for admin interface and vpn.nesterovic.cc for public interface. Add proxy headers for X-Real-IP, X-Forwarded-For and X-Forwarded-Proto to both server blocks. Create public-web Dockerfile with nginx serving
2026-03-17 22:09:37 +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
1b684aecbb refactor: split toggleTarget into separate handlers for create and edit forms
Replace conditional setter pattern with explicit if/else branches for editing and creating modes. Handle editForm state updates separately from form state updates to improve code clarity and maintainability.
2026-03-17 21:44:54 +01:00
b16564ac5c feat: add database-backed IP allocation with fallback to IPAM service
Add FindNextAvailableIP repository method to query ip_allocations table and find next available IP address within gateway VPN CIDR range. Query existing allocations from database and build used IP map. Iterate through CIDR range starting at offset to find first unused address. Update Enroll service method to call FindNextAvailableIP first with fallback to IPAM service Allocate method on error. Add netip and errors imports to repository
2026-03-17 21:43:42 +01:00
a8fbe725a2 feat: add groups management with CRUD operations and policy target assignment
Add Group type with id, name, description, members array and optional user_ids field. Add name field to policy targets for display. Add groups API client methods for list, create, update and delete operations. Add GroupsPage component with create form, edit modal, member selection and table view. Add groups route and navigation item to Layout. Add reusable Modal component with title, subtitle and close handler. Update
2026-03-17 21:42:46 +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
72c5bb6f55 feat: add targets field to Policy type for policy assignment tracking
Add optional targets array to Policy type containing type and id fields to support tracking policy assignments to users and groups.
2026-03-17 20:51:20 +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
a52777602f feat: resolve policy destinations before device enrollment with fallback default
Fetch policy destinations before calling repo.Enroll instead of after, passing destinations to enrollment creation. Add fallback to default 172.16.10.0/24 destination when no policies are resolved. Re-resolve destinations after enrollment with device ID for final response.
2026-03-17 19:59:40 +01:00
09dd3a5ea6 feat: add bootstrap availability check to login page with conditional UI
Add useEffect hook to fetch bootstrap status on component mount. Add bootstrapAvailable and bootstrapStatusLoaded state variables to track bootstrap endpoint availability. Hide mode toggle button when bootstrap is unavailable or status hasn't loaded yet. Add auth-brand and auth-brand-copy CSS classes to improve login page layout and branding. Add BootstrapStatus handler and BootstrapAvailable service method to expose bootstrap availability
2026-03-17 19:59:15 +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
f596f89665 fix: change serde field naming from camelCase to snake_case with explicit renames
Remove container-level camelCase rename attributes from LoginRequest, LoginResponse, EnrollRequest, EnrollResponse, PeerView, and GatewayView structs. Add explicit field-level serde rename attributes for snake_case fields (access_token, refresh_token, os_version, app_version, device_fingerprint, public_key, assigned_ip, profile_revision) to match backend API contract.
2026-03-17 19:53:56 +01:00
dab7159cc5 fix: improve error handling and display in desktop client enrollment flow
Add formatInvokeError helper function to handle various error types from Tauri invoke calls with fallback messages. Update enroll_device to include response body in error message when enrollment fails with non-success status. Add windows_subsystem attribute to main.rs to suppress console window in release builds on Windows.
2026-03-17 19:51:02 +01:00
4a2985ae5e fix: change gateway backend URLs from service name to host.docker.internal
Update gateway configuration to use host.docker.internal instead of backend service name for API communication. Add extra_hosts mapping in docker-compose to enable host.docker.internal resolution. Add NEXAVPN_BACKEND_HOST environment variable to .env.example with host.docker.internal default.
2026-03-17 19:43:56 +01:00
c921e86a11 feat: enable static_secrets feature for x25519-dalek in desktop client
Add static_secrets feature flag to x25519-dalek dependency to support deterministic key generation from seed material.
2026-03-17 19:40:56 +01:00
210cf3b4f4 fix: add clang-cl wrapper script and update Windows build to ensure clang availability
Add clang-cl wrapper script that invokes clang in MSVC-compatible mode with availability check and helpful error message. Update Linux Windows build script to make clang-cl wrapper executable and include scripts directory in PATH for both cargo-xwin and clang-cl resolution.
2026-03-17 19:39:51 +01:00
e2362c6033 feat: add logout functionality and auto-logout on 401 responses
Add AUTH_EXPIRED_EVENT constant and dispatch event on 401 responses in API client, clearing stored token. Add handleLogout function to App component and wire up event listener to trigger logout on auth expiration. Pass onLogout prop to Layout component and add Logout button to topbar-actions. Update CSS to apply flex layout to topbar-actions and make responsive. Add backend hostname and network aliases in docker-compose to ensure consistent
2026-03-17 19:39:13 +01:00
61d2b4b25c feat: add branding assets and favicon support across admin-web and desktop-client
Add NexaVPN logo images (full logo and mark-only variants) to admin-web and desktop-client public directories. Add favicon.ico and favicon.png to admin-web, and icon.png to desktop-client. Update index.html files to reference favicon assets. Add icon.png and icon.ico to desktop-client Tauri icons directory and configure bundle.icon in tauri.conf.json. Update Layout component to display logo in sidebar brand-block with
2026-03-17 19:37:58 +01:00
d4e8fc28c7 fix: remove DNS resolution check from gateway bootstrap flow
Remove wait_for_backend_dns function and its invocation from apply_bundle, relying instead on curl connectivity checks in main loop to handle backend availability. Simplifies bootstrap logic by removing redundant DNS verification step.
2026-03-17 19:30:38 +01:00
7902e772bf docs: add clang/lld/llvm prerequisites for Linux Windows cross-builds
Add apt install instructions for clang, lld, llvm, and nsis to README Ubuntu-to-Windows build section. Add clang-cl availability check to cargo-xwin wrapper script with helpful error message directing users to install LLVM/Clang toolchain when missing.
2026-03-17 19:29:37 +01:00
39e70ec526 fix: use PATH-based cargo-xwin resolution instead of direct wrapper path
Update Linux Windows build script to add scripts directory to PATH and reference cargo-xwin by name rather than direct path to wrapper script, improving compatibility with Tauri's runner resolution mechanism.
2026-03-17 19:26:36 +01:00
92618ee65b fix: make backend DNS check optional when getent is unavailable
Add getent availability check before attempting DNS resolution in wait_for_backend_dns function. Fall back to allowing curl connectivity check in main loop when getent is not available, supporting Alpine-based images that don't ship getent by default.
2026-03-17 19:26:10 +01:00
61e6213b67 fix: use cargo-xwin wrapper script to resolve Tauri runner compatibility
Add cargo-xwin wrapper script that invokes `cargo xwin` subcommand and update Linux Windows build script to use wrapper as --runner instead of cargo-xwin binary name directly. Add chmod +x to ensure wrapper is executable before build.
2026-03-17 19:25:04 +01:00
cfe38e5c3b chore: update Tauri dependencies to 2.10.1 and tauri-build to 2.5.5
Update @tauri-apps/api and @tauri-apps/cli to version 2.10.1, and tauri runtime to 2.10.1 for consistency across desktop client dependencies. Update tauri-build to version 2.5.5.
2026-03-17 19:23:12 +01:00
6349147d8d feat: add backend DNS resolution check and improve gateway sync reliability
Add wait_for_backend_dns function to verify backend hostname resolution before attempting bootstrap/sync operations. Configure NEXAVPN_BACKEND_HOST environment variable and net.ipv4.ip_forward sysctl in docker-compose. Use atomic write pattern for state.json via temporary file to prevent corruption on failed downloads. Make sysctl ip_forward call conditional on write permissions and non-fatal.
2026-03-17 19:21:39 +01:00
ebc449079b chore: update Tauri dependencies to 2.3.1
Update @tauri-apps/api, @tauri-apps/cli, and tauri-build to version 2.3.1 for consistency across desktop client dependencies.
2026-03-17 19:20:55 +01:00
4d687082af fix: add backend dependency and retry logic to gateway bootstrap
Add depends_on backend service to gateway in docker-compose to ensure backend is available before gateway starts. Refactor gateway-entrypoint.sh to move bootstrap logic into apply_bundle function with error handling, enabling automatic retry on bootstrap failure instead of exiting immediately.
2026-03-17 19:18:35 +01:00
991df88d58 refactor: migrate Windows target from x86 to x64 architecture
Update all Windows build configurations, scripts, and documentation from i686-pc-windows-msvc (x86) to x86_64-pc-windows-msvc (x64). Update npm scripts, build-tunnel-helper.sh target validation, bundled helper paths, and tunnel manager strategy references. Add XWIN_ARCH=x86_64 environment variable to Linux cross-build command and --xwin-arch flag to cargo xwin invocation.
2026-03-17 19:13:56 +01:00
8d8a3a7859 fix: check cargo-xwin availability using subcommand instead of binary name
Change cargo-xwin detection from `command -v cargo-xwin` to `cargo xwin --version` to properly verify cargo subcommand availability on Linux systems cross-compiling to Windows targets.
2026-03-17 19:08:51 +01:00