Skip to content

Implement Plan 03 limen-side WireGuard control plane and Forculus client - #20

Merged
PianoNic merged 2 commits into
mainfrom
feature/19_Plan03WgLimenSide
Apr 15, 2026
Merged

Implement Plan 03 limen-side WireGuard control plane and Forculus client#20
PianoNic merged 2 commits into
mainfrom
feature/19_Plan03WgLimenSide

Conversation

@PianoNic

Copy link
Copy Markdown
Member

Summary

  • Adds Forculus HTTP contracts (PeerSpec, ConfigSnapshot) to Limen.Contracts
  • EnrollResponse now carries WireGuardConfig (private key returned once, never stored); replaces the placeholder TunnelSubnet string
  • WireGuardPeer domain entity + EF config + Tunnels migration (wireguard_peers table, unique indexes on PublicKey and TunnelIp)
  • ITunnelCoordinator + TunnelCoordinator: Curve25519 keypair generation via NSec 25.4.0, 10.42.0.0/24 sequential IP allocation
  • IForculusClient + ForculusHttpClient: typed HTTP client for peer upsert/remove against Forculus
  • EnrollAgentCommand now allocates tunnel IP, persists WireGuardPeer, pushes peer to Forculus (failure swallowed — reconcile loop will sync), and returns WireGuardConfig to agent
  • GET /api/forculus/config endpoint via GetForculusConfigQuery for Forculus boot-time config pull and reconcile
  • ForculusSettings and WgServerSettings option classes placed in Limen.Application layer (not Infrastructure) to avoid layer violation

Limentinus WireGuard client integration is a separate follow-up PR. Closes #19

Test plan

  • EnrollAgentCommandTests updated: 5 cases (happy path with peer row + coordinator + Forculus call assertions, Forculus failure tolerance, expired key, used key, unknown key)
  • All 9 tests pass
  • Build: 0 errors, 0 warnings
  • Migration verified: creates wireguard_peers with expected columns and unique indexes

- ForculusHttp contracts (PeerSpec, ConfigSnapshot) in Limen.Contracts
- WireGuardConfig added to EnrollResponse; replaces TunnelSubnet string
- WireGuardPeer domain entity + EF configuration + Tunnels migration
- ITunnelCoordinator + TunnelCoordinator: Curve25519 keygen via NSec 25.4.0, 10.42.0.0/24 IP allocation
- IForculusClient + ForculusHttpClient: HTTP peer upsert/remove
- EnrollAgentCommand now allocates tunnel IP, persists WireGuardPeer, pushes to Forculus (failure swallowed), returns WireGuardConfig
- GET /api/forculus/config endpoint (GetForculusConfigQuery) for Forculus boot and reconcile
- ForculusSettings and WgServerSettings options classes in Application layer
- EnrollAgentCommandTests updated: 5 cases covering happy path, Forculus failure tolerance, expired/used/unknown key
@PianoNic PianoNic added feature New capability or feature work plan Full implementation plan tracking issue labels Apr 15, 2026
@PianoNic
PianoNic merged commit 197b3c5 into main Apr 15, 2026
2 checks passed
@PianoNic
PianoNic deleted the feature/19_Plan03WgLimenSide branch April 15, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New capability or feature work plan Full implementation plan tracking issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Plan 03 WireGuard control plane and peer orchestration for Forculus

1 participant