From 64e29609b3b0a7269de60fc0d57e9416c56ed503 Mon Sep 17 00:00:00 2001 From: datadunia Date: Sat, 23 May 2026 04:16:13 +0700 Subject: [PATCH] chore: update .gitignore, add docs site, plan docs --- .gitignore | 33 + .sisyphus/plans/agents-deep-init.md | 349 +++++++++ .sisyphus/plans/nodes-wg-hooks-and-docs.md | 220 ++++++ .../plans/server-core-multistage-build.md | 702 ++++++++++++++++++ AGENTS.md | 109 +++ apps/dashboard-ui | 2 +- apps/device-agent | 2 +- apps/docs/.vitepress/config.mts | 22 + apps/docs/guides/access-remote-server.md | 15 + .../guides/add-wireguard-configuration.md | 15 + apps/docs/guides/email-service.md | 21 + apps/docs/guides/peers.md | 15 + apps/docs/guides/sign-in.md | 16 + apps/docs/guides/webhooks.md | 21 + apps/docs/index.md | 13 + apps/docs/package.json | 14 + apps/server-core | 2 +- 17 files changed, 1568 insertions(+), 3 deletions(-) create mode 100644 .sisyphus/plans/agents-deep-init.md create mode 100644 .sisyphus/plans/nodes-wg-hooks-and-docs.md create mode 100644 .sisyphus/plans/server-core-multistage-build.md create mode 100644 AGENTS.md create mode 100644 apps/docs/.vitepress/config.mts create mode 100644 apps/docs/guides/access-remote-server.md create mode 100644 apps/docs/guides/add-wireguard-configuration.md create mode 100644 apps/docs/guides/email-service.md create mode 100644 apps/docs/guides/peers.md create mode 100644 apps/docs/guides/sign-in.md create mode 100644 apps/docs/guides/webhooks.md create mode 100644 apps/docs/index.md create mode 100644 apps/docs/package.json diff --git a/.gitignore b/.gitignore index 78ee752..fcbb055 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,49 @@ # OS files .DS_Store Thumbs.db +Desktop.ini # IDE .idea/ .vscode/ +*.swp +*.swo # Env .env .env.local +.env.production + +# Logs +*.log + +# Archives & binaries +*.tar.gz +*.zip +*.b64 +*.exe +*.dll +*.so +*.dylib + +# Temp +tmp/ +temp_* +*.tmp + +# Build output +dist/ +/dist/ # OpenCode .sisyphus/notepads/ .sisyphus/boulder.json connect_remote.txt +.sisyphus/drafts/ + +# Node +node_modules/ + +# Go workspace +go.work +go.work.sum diff --git a/.sisyphus/plans/agents-deep-init.md b/.sisyphus/plans/agents-deep-init.md new file mode 100644 index 0000000..850c3d4 --- /dev/null +++ b/.sisyphus/plans/agents-deep-init.md @@ -0,0 +1,349 @@ +# init-deep: AGENTS.md Generation Plan + +**Generated:** 2026-05-22 +**Branch:** `main` (`92051d5`) + +## Overview + +Generate hierarchical AGENTS.md files for the NexusGuard SD-WAN Suite monorepo. +Scored 4 locations for AGENTS.md: root + 3 submodules. + +## Scoring Results + +| Location | Score | Reason | Action | +|----------|-------|--------|--------| +| `.` (root) | — | Always create root | CREATE | +| `apps/server-core/` | 3+2+2+1=8+ | 54 files (3x), 9 subdirs (2x), go.mod (2x), Dockerfile (1x) | CREATE | +| `apps/dashboard-ui/` | 3+2+2+1=8+ | 54 files (3x), 8 subdirs (2x), package.json (2x), tsconfig (1x) | CREATE | +| `apps/device-agent/` | 3+0+2+0=5+ | 21 files (3x), 5 subdirs (0x), go.mod (2x) | CREATE (≥15) | +| `apps/server-core/api/` | 0 | 17 files (<20) | SKIP (parent covers) | +| `apps/dashboard-ui/views/` | 0 | 7 files (<20) | SKIP (parent covers) | +| `apps/dashboard-ui/api/` | 0 | 7 files (<20) | SKIP (parent covers) | + +## Files to Create/Update + +No existing AGENTS.md files found. All 4 are new files (`Write`). + +--- + +## File 1: `./AGENTS.md` (Root — 122 lines) + +```markdown +# PROJECT KNOWLEDGE BASE + +**Generated:** 2026-05-22 +**Commit:** `92051d5` +**Branch:** `main` + +## OVERVIEW +NexusGuard SD-WAN Suite — Enterprise Zero-Trust SD-WAN with WireGuard tunneling, centralized IPAM, and real-time nftables network isolation. Monorepo with 3 git submodules: Go backend (Gin), Vue 3 dashboard, Go device agent. + +## STRUCTURE +``` +./ +├── apps/ +│ ├── server-core/ # Go/Gin API backend (submodule) +│ ├── dashboard-ui/ # Vue 3 + Vite frontend (submodule) +│ └── device-agent/ # Go stealth daemon (submodule) +├── docker-compose.yml # Production orchestration +├── docker-compose.dev.yml # Dev (air hot-reload) +├── Makefile # up/down/dev/migrate/reset-db +├── setup.sh # First-run: generate .env + random keys +├── .env.example # DB/JWT/SALT/VITE config template +├── .gitmodules # 3 submodules → git.datadunia.com +└── .opencode/ # IDE agent config (tooling, not project code) +``` + +**CRITICAL**: `apps/*` are **git submodules** — clone with `--recurse-submodules`. + +## WHERE TO LOOK +| Task | Location | Notes | +|------|----------|-------| +| API handlers | `apps/server-core/api/` | 17 files: auth, devices, peers, rules, share, provisioning, servers, wg | +| Backend core | `apps/server-core/internal/` | auth, config, firewall, heartbeat, ipam, models, wgmanager | +| Dev migration | `apps/server-core/main_dev.go` | GORM AutoMigrate (build tag `dev`) | +| Firewall rules | `apps/server-core/internal/firewall/` | nftables Linux rules | +| Dashboard views | `apps/dashboard-ui/src/views/` | Vue SFC pages | +| Dashboard API client | `apps/dashboard-ui/src/api/` | Axios API modules | +| Dashboard stores | `apps/dashboard-ui/src/stores/` | Pinia state stores | +| Agent client | `apps/device-agent/internal/client/` | Provisioning + heartbeat | +| Agent tunnel | `apps/device-agent/internal/tunnel/` | Memory-injected WireGuard | +| Shared crypto | `apps/*/shared/crypto/encryptor.go` | AES-256-GCM (duplicated identical) | +| CI workflows | `apps/*/.gitea/workflows/build.yml` | Gitea Actions per submodule | +| Build config | `apps/dashboard-ui/vite.config.ts` | Vite 8 + Vue + TailwindCSS v4 | +| Source of truth | `apps/server-core/docs/` | API_SPEC, KEY_ROTATION, PEER_DISCOVERY | +| Plan guardrails | `.sisyphus/plans/` | Anti-patterns, "Must NOT do" rules | + +## CODE MAP +| Symbol | Type | Location | Role | +|--------|------|----------|------| +| `main()` (server-core) | func | `apps/server-core/main.go` | Entry: CLI flags + Gin init | +| `main()` (device-agent) | func | `apps/device-agent/main.go` | Entry: agent daemon lifecycle | +| `config.Load()` | func | `apps/server-core/internal/config/` | Env-based config loader | +| `auth.Init()` | func | `apps/server-core/internal/auth/` | JWT sign/verify init | +| `firewall.InitNetwork()` | func | `apps/server-core/internal/firewall/` | nftables table/set creation | +| `ipam.AllocateIP()` | func | `apps/server-core/internal/ipam/` | IP pool allocation from CIDR | +| `wgmanager.SetConfig()` | func | `apps/server-core/internal/wgmanager/` | WireGuard config push | +| `models.AutoMigrate()` | func | `apps/server-core/internal/models/` | GORM schema migration | +| `encrypt()` / `decrypt()` | func | `apps/*/shared/crypto/encryptor.go` | AES-256-GCM (identical) | + +## CONVENTIONS +- **Go**: Standard layout (`main.go` in root, `internal/`, `api/`) +- **Vue 3**: Composition API + `