diff --git a/README.md b/README.md index 79c4d2b..748c437 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,4 @@ -Purpose: to allow an overview of Darksky peers and provide a mechanism to allow -easy joining - - -dsnet is a simple tool to manage a wireguard VPN. +dsnet is a simple tool to manage a wireguard VPN. Think wg-quick but quicker. Usage: dsnet @@ -19,3 +15,10 @@ dsnet is a simple tool to manage a wireguard VPN. To send configurations, ffsend (with separately transferred password) or a local QR code generator may be used. + +TODO after first release: + + * Hooks for adding routes/ IPtables forwarding rules + * Forward option + * Support for additional subnets in peer config + * Peer endpoint support diff --git a/add.go b/add.go index ce9c517..b1762e3 100644 --- a/add.go +++ b/add.go @@ -19,7 +19,6 @@ func Add(hostname string, owner string, description string) { //, publicKey stri Description: description, PublicKey: publicKey, PresharedKey: presharedKey, - // TODO Endpoint: AllowedIPs: []JSONIPNet{ JSONIPNet{ IPNet: net.IPNet{ @@ -33,3 +32,18 @@ func Add(hostname string, owner string, description string) { //, publicKey stri conf.MustAddPeer(peer) conf.MustSave() } + + +func GetPeerWgQuickConf(peer PeerConfig, privKey JSONKey) string { + return `[Interface] +Address = 10.50.60.2/24 +PrivateKey=REDACTED +DNS = 8.8.8.8 + +[Peer] +PublicKey=cAR+SMd+yvGw2TVzVSRoLtxF5TLA2Y/ceebO8ZAyITw= +Endpoint=3.9.82.135:51820 +AllowedIPs=0.0.0.0/0 +PersistentKeepalive=21 +` +} diff --git a/types.go b/types.go index 276471d..6e8b28f 100644 --- a/types.go +++ b/types.go @@ -39,7 +39,8 @@ type Peer struct { PublicKey wgtypes.Key PresharedKey wgtypes.Key - Endpoint *net.UDPAddr + // TODO peer endpoint support + //Endpoint *net.UDPAddr LastHandshakeTime time.Time ReceiveBytes int64 TransmitBytes int64