# Plan: WG Auto Up + PrivateKey Node Registration

## TL;DR
> Fix WireGuard interface goes down after `update.sh` (container restart) and allow registering nodes using PrivateKey (from MikroTik export) instead of requiring PublicKey manually.

**Status**: ✅ ALL DONE + VERIFIED ON PRODUCTION

---

## TODOs

- [x] 1. **main.go: auto `wg up` on startup** — commit `8e476db`
- [x] 2. **servers.go: accept PrivateKey in Create** — commit `8e476db`
- [x] 3. **Servers.vue + servers.ts: PrivateKey input** — commit `8e770ae`
- [x] 4. **update.sh** — SKIPPED (backend auto-init is the real fix)

---

## Final Verification

- [x] F1: `go build -tags dev ./...` — PASS
- [x] F2: `npm run build` — PASS
- [x] F3: Server starts, `/wg/status` shows is_running=true — **VERIFIED** `{"IsRunning":true,"PeerCount":1}`
- [x] F4: Can register node using PrivateKey via API — **VERIFIED** `PublicKey auto-derived from PrivateKey`

## Commits

- ✅ `8e476db` — Backend (auto wg up + accept PrivateKey)
- ✅ `8e770ae` — Frontend (PrivateKey input in Register form)
- ✅ `4a56516` — Root (submodule refs)
- ✅ All pushed + deployed to production
