1.6 KiB
1.6 KiB
NexusGuard SD-WAN — Phase 4.5: Multi-Node Architecture & Production Readiness
Goal: Transform the system from a single-node mockup into a true Multi-Server (WGDashboard-style) architecture, and harden the database startup mechanisms for production environments.
Task 4.5.1: Multi-Server Database & API
- Files:
models.go,001_init.sql,api/servers.go,main.go - Actions:
- Add
WgServerIDforeign key to theDevicemodel. - Implement full CRUD REST API for
WgServer(/api/v1/servers) to allow Admin to register multiple public WireGuard nodes.
- Add
Task 4.5.2: Provisioning API Multi-Node Fix
- Files:
api/provisioning.go,api/provisioning_test.go - Actions:
- Remove the hardcoded
127.0.0.1:51820fallback. - During provisioning, fetch the exact
WgServerrelated to the device. - Return the true
EndpointandPublicKeyof that specific node to the connecting agent.
- Remove the hardcoded
Task 4.5.3: Dashboard UI - Nodes Management
- Files:
src/views/Servers.vue,src/views/Devices.vue,src/api/servers.ts,src/App.vue - Actions:
- Build the "Nodes" page to manage external WireGuard servers.
- Update the "Add Device" form to include a required dropdown where the Admin selects which Node the device will connect to.
- Update the Sidebar to reflect the new navigation.
Task 4.5.4: Production Readiness (Install Detection)
- Files:
main.go - Actions:
- Add logic to verify if the DB is empty on startup.
- Add
-migrate-prodflag that uses thegooselibrary to apply001_init.sqlautomatically in production without needing AutoMigrate.