move networks after dns

This commit is contained in:
Callan Bryant 2020-03-08 20:49:35 +00:00
parent d250f2b23b
commit 130d3ba8cc
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

View File

@ -20,13 +20,13 @@ type PeerConfig struct {
Description string `validate:"required,gte=1,lte=255"` Description string `validate:"required,gte=1,lte=255"`
// Internal VPN IP address. Added to AllowedIPs in server config as a /32 // Internal VPN IP address. Added to AllowedIPs in server config as a /32
IP net.IP `validate:"required` IP net.IP `validate:"required`
PublicKey JSONKey `validate:"required,len=44"`
PrivateKey JSONKey `json:"-"` // omitted from config!
PresharedKey JSONKey `validate:"required,len=44"`
// TODO ExternalIP support (Endpoint) // TODO ExternalIP support (Endpoint)
//ExternalIP net.UDPAddr `validate:"required,udp4_addr"` //ExternalIP net.UDPAddr `validate:"required,udp4_addr"`
// TODO support routing additional networks (AllowedIPs) // TODO support routing additional networks (AllowedIPs)
Networks []JSONIPNet `validate:"required"` Networks []JSONIPNet `validate:"required"`
PublicKey JSONKey `validate:"required,len=44"`
PrivateKey JSONKey `json:"-"` // omitted from config!
PresharedKey JSONKey `validate:"required,len=44"`
} }
type DsnetConfig struct { type DsnetConfig struct {
@ -41,12 +41,12 @@ type DsnetConfig struct {
Network JSONIPNet `validate:"required"` Network JSONIPNet `validate:"required"`
IP net.IP `validate:"required"` IP net.IP `validate:"required"`
DNS net.IP `validate:"required"` DNS net.IP `validate:"required"`
// extra networks available, will be added to AllowedIPs
Networks []JSONIPNet `validate:"required"`
// TODO Default subnets to route via VPN // TODO Default subnets to route via VPN
ReportFile string `validate:"required"` ReportFile string `validate:"required"`
PrivateKey JSONKey `validate:"required,len=44"` PrivateKey JSONKey `validate:"required,len=44"`
Peers []PeerConfig `validate:"dive"` Peers []PeerConfig `validate:"dive"`
// extra networks available, will be added to AllowedIPs
Networks []JSONIPNet `validate:"required"`
} }
func MustLoadDsnetConfig() *DsnetConfig { func MustLoadDsnetConfig() *DsnetConfig {