From 821169a1792eed16daa37fe032e95137bcc4c57a Mon Sep 17 00:00:00 2001 From: datadunia Date: Fri, 22 May 2026 10:19:11 +0700 Subject: [PATCH] chore: mark completed plan checklists (CORS, peer fix, deployment tools, phase 4.5) --- .sisyphus/plans/nxg-deployment-tools.md | 8 +++---- .sisyphus/plans/nxg-fix-cors.md | 17 ++++++-------- .../nxg-fix-peers-500-and-delete-device.md | 22 +++++++++---------- .../plans/nxg-phase-4.5-production-ready.md | 8 +++---- 4 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.sisyphus/plans/nxg-deployment-tools.md b/.sisyphus/plans/nxg-deployment-tools.md index 4f6ebcb..e40f687 100644 --- a/.sisyphus/plans/nxg-deployment-tools.md +++ b/.sisyphus/plans/nxg-deployment-tools.md @@ -2,7 +2,7 @@ ## TODOs -- [ ] 1. Create Makefile with reset-db command +- [x] 1. Create Makefile with reset-db command **What to do**: - Create `D:\www-project\NexusGuard\Makefile` with this content: @@ -42,7 +42,7 @@ **Recommended Agent Profile**: `build` (file creation + git) -- [ ] 2. SSH: Migrate empty HWIDs to NULL + restart container +- [x] 2. SSH: Migrate empty HWIDs to NULL + restart container **What to do**: - SSH into 172.20.8.191: @@ -63,9 +63,9 @@ Expected Result: count = 0 ``` -- [ ] 3. Commit and push all changes (server-core HWID fix, frontend delete button, Makefile) +- [x] 3. Commit and push all changes (server-core HWID fix, frontend delete button, Makefile) -- [ ] 4. Verify POST /api/v1/peers returns 201 +- [x] 4. Verify POST /api/v1/peers returns 201 ```bash ssh root@172.20.8.191 'curl -s -X POST http://localhost:3000/api/v1/auth/login -H "Content-Type: application/json" -d "{\"username\":\"admin\",\"password\":\"...\"}"' diff --git a/.sisyphus/plans/nxg-fix-cors.md b/.sisyphus/plans/nxg-fix-cors.md index 252f030..8f5348e 100644 --- a/.sisyphus/plans/nxg-fix-cors.md +++ b/.sisyphus/plans/nxg-fix-cors.md @@ -18,8 +18,7 @@ Current CORS config in `main.go:114-130`: --- ## Task 1: Fix CORS config in `main.go` - -**File**: `apps/server-core/main.go` lines 114-130 +- [x] **File**: `apps/server-core/main.go` lines 114-130 **Replace** the current CORS block with: @@ -65,8 +64,7 @@ r.Use(cors.New(corsConfig)) --- ## Task 2: Add `CORS_ALLOWED_ORIGINS` to root `.env.example` - -**File**: `.env.example` +- [x] **File**: `.env.example` **Add** after `VITE_API_BASE_URL` line (section 5): @@ -85,8 +83,7 @@ SHARE_LINK_TTL=24h --- ## Task 3: Add `CORS_ALLOWED_ORIGINS` to server-core `.env.example` - -**File**: `apps/server-core/.env.example` +- [x] **File**: `apps/server-core/.env.example` **Add** at the end: @@ -105,7 +102,7 @@ SHARE_LINK_TTL=24h ## Final Verification Wave -- [ ] `go build ./...` passes in `apps/server-core/` -- [ ] `CORS_ALLOWED_ORIGINS` present in root `.env.example` -- [ ] `CORS_ALLOWED_ORIGINS` present in `apps/server-core/.env.example` -- [ ] No other files reference `CORS_ALLOWED_ORIGINS` that need updating +- [x] `go build ./...` passes in `apps/server-core/` +- [x] `CORS_ALLOWED_ORIGINS` present in root `.env.example` +- [x] `CORS_ALLOWED_ORIGINS` present in `apps/server-core/.env.example` +- [x] No other files reference `CORS_ALLOWED_ORIGINS` that need updating diff --git a/.sisyphus/plans/nxg-fix-peers-500-and-delete-device.md b/.sisyphus/plans/nxg-fix-peers-500-and-delete-device.md index e9060b7..d336dbd 100644 --- a/.sisyphus/plans/nxg-fix-peers-500-and-delete-device.md +++ b/.sisyphus/plans/nxg-fix-peers-500-and-delete-device.md @@ -24,7 +24,7 @@ ## TODOs -- [ ] 1. Backend: Change HWID to `*string` in Device model +- [x] 1. Backend: Change HWID to `*string` in Device model **What to do**: - Edit `apps/server-core/internal/models/models.go` line 60: @@ -46,7 +46,7 @@ Evidence: .sisyphus/evidence/task-1-build.txt ``` -- [ ] 2. Backend: Fix CreatePeer to not set empty HWID +- [x] 2. Backend: Fix CreatePeer to not set empty HWID **What to do**: - Edit `apps/server-core/api/peers.go` — remove `HWID: ""` line (line 96) @@ -63,14 +63,14 @@ Evidence: .sisyphus/evidence/task-2-build.txt ``` -- [ ] 3. Backend: Fix CreateDevice to not set empty HWID +- [x] 3. Backend: Fix CreateDevice to not set empty HWID **What to do**: - Edit `apps/server-core/api/devices.go` — verify `Create` function (line 84-89) doesn't set HWID - It currently doesn't set HWID at all, so with `*string` it will default to nil — correct - Verify `Delete` function (line 235-255) already works — it does, no changes needed -- [ ] 4. Migration: Convert existing empty HWIDs to NULL on server +- [x] 4. Migration: Convert existing empty HWIDs to NULL on server **What to do**: - SSH into 172.20.8.191 and run SQL against the postgres container: @@ -100,7 +100,7 @@ Evidence: .sisyphus/evidence/task-4-peers-api.txt ``` -- [ ] 5. Frontend: Add delete button to Devices.vue list +- [x] 5. Frontend: Add delete button to Devices.vue list **What to do**: - Edit `apps/dashboard-ui/src/views/Devices.vue` @@ -137,7 +137,7 @@ Evidence: .sisyphus/evidence/task-5-tsc.txt ``` -- [ ] 6. Commit and push changes +- [x] 6. Commit and push changes **What to do**: - Commit server-core changes @@ -147,8 +147,8 @@ ## Success Criteria -- [ ] `go build ./...` passes -- [ ] `vue-tsc --noEmit` passes -- [ ] POST `/api/v1/peers` returns 201, not 500 -- [ ] Devices.vue has a delete button per row that works -- [ ] Existing empty HWIDs migrated to NULL +- [x] `go build ./...` passes +- [x] `vue-tsc --noEmit` passes +- [x] POST `/api/v1/peers` returns 201, not 500 +- [x] Devices.vue has a delete button per row that works +- [x] Existing empty HWIDs migrated to NULL diff --git a/.sisyphus/plans/nxg-phase-4.5-production-ready.md b/.sisyphus/plans/nxg-phase-4.5-production-ready.md index 63c5f49..d96397c 100644 --- a/.sisyphus/plans/nxg-phase-4.5-production-ready.md +++ b/.sisyphus/plans/nxg-phase-4.5-production-ready.md @@ -3,27 +3,27 @@ **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` +- [x] **Files**: `models.go`, `001_init.sql`, `api/servers.go`, `main.go` - **Actions**: - Add `WgServerID` foreign key to the `Device` model. - Implement full CRUD REST API for `WgServer` (`/api/v1/servers`) to allow Admin to register multiple public WireGuard nodes. ## Task 4.5.2: Provisioning API Multi-Node Fix -- **Files**: `api/provisioning.go`, `api/provisioning_test.go` +- [x] **Files**: `api/provisioning.go`, `api/provisioning_test.go` - **Actions**: - Remove the hardcoded `127.0.0.1:51820` fallback. - During provisioning, fetch the exact `WgServer` related to the device. - Return the true `Endpoint` and `PublicKey` of that specific node to the connecting agent. ## Task 4.5.3: Dashboard UI - Nodes Management -- **Files**: `src/views/Servers.vue`, `src/views/Devices.vue`, `src/api/servers.ts`, `src/App.vue` +- [x] **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` +- [x] **Files**: `main.go` - **Actions**: - Add logic to verify if the DB is empty on startup. - Add `-migrate-prod` flag that uses the `goose` library to apply `001_init.sql` automatically in production without needing AutoMigrate.