start peer conf file, update README
This commit is contained in:
parent
8baaa06d84
commit
19668c0334
13
README.md
13
README.md
@ -1,8 +1,4 @@
|
|||||||
Purpose: to allow an overview of Darksky peers and provide a mechanism to allow
|
dsnet is a simple tool to manage a wireguard VPN. Think wg-quick but quicker.
|
||||||
easy joining
|
|
||||||
|
|
||||||
|
|
||||||
dsnet is a simple tool to manage a wireguard VPN.
|
|
||||||
|
|
||||||
Usage: dsnet <cmd>
|
Usage: dsnet <cmd>
|
||||||
|
|
||||||
@ -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.
|
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
|
||||||
|
16
add.go
16
add.go
@ -19,7 +19,6 @@ func Add(hostname string, owner string, description string) { //, publicKey stri
|
|||||||
Description: description,
|
Description: description,
|
||||||
PublicKey: publicKey,
|
PublicKey: publicKey,
|
||||||
PresharedKey: presharedKey,
|
PresharedKey: presharedKey,
|
||||||
// TODO Endpoint:
|
|
||||||
AllowedIPs: []JSONIPNet{
|
AllowedIPs: []JSONIPNet{
|
||||||
JSONIPNet{
|
JSONIPNet{
|
||||||
IPNet: net.IPNet{
|
IPNet: net.IPNet{
|
||||||
@ -33,3 +32,18 @@ func Add(hostname string, owner string, description string) { //, publicKey stri
|
|||||||
conf.MustAddPeer(peer)
|
conf.MustAddPeer(peer)
|
||||||
conf.MustSave()
|
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
|
||||||
|
`
|
||||||
|
}
|
||||||
|
3
types.go
3
types.go
@ -39,7 +39,8 @@ type Peer struct {
|
|||||||
|
|
||||||
PublicKey wgtypes.Key
|
PublicKey wgtypes.Key
|
||||||
PresharedKey wgtypes.Key
|
PresharedKey wgtypes.Key
|
||||||
Endpoint *net.UDPAddr
|
// TODO peer endpoint support
|
||||||
|
//Endpoint *net.UDPAddr
|
||||||
LastHandshakeTime time.Time
|
LastHandshakeTime time.Time
|
||||||
ReceiveBytes int64
|
ReceiveBytes int64
|
||||||
TransmitBytes int64
|
TransmitBytes int64
|
||||||
|
Loading…
Reference in New Issue
Block a user