correct distribution of PSKs
This commit is contained in:
parent
b697afc2ee
commit
78b28be231
3
add.go
3
add.go
@ -51,12 +51,11 @@ func PrintPeerCfg(peer PeerConfig, conf *DsnetConfig) {
|
|||||||
const peerConf = `[Interface]
|
const peerConf = `[Interface]
|
||||||
Address = {{ .Peer.IP }}
|
Address = {{ .Peer.IP }}
|
||||||
PrivateKey={{ .Peer.PrivateKey.Key }}
|
PrivateKey={{ .Peer.PrivateKey.Key }}
|
||||||
PresharedKey={{ .Peer.PresharedKey.Key }}
|
|
||||||
DNS = {{ .DsnetConfig.DNS }}
|
DNS = {{ .DsnetConfig.DNS }}
|
||||||
|
|
||||||
[Peer]
|
[Peer]
|
||||||
PublicKey={{ .DsnetConfig.PrivateKey.PublicKey.Key }}
|
PublicKey={{ .DsnetConfig.PrivateKey.PublicKey.Key }}
|
||||||
PresharedKey={{ .DsnetConfig.PresharedKey.Key }}
|
PresharedKey={{ .Peer.PresharedKey.Key }}
|
||||||
Endpoint={{ .DsnetConfig.ExternalIP }}:{{ .DsnetConfig.ListenPort }}
|
Endpoint={{ .DsnetConfig.ExternalIP }}:{{ .DsnetConfig.ListenPort }}
|
||||||
#AllowedIPs=0.0.0.0/0
|
#AllowedIPs=0.0.0.0/0
|
||||||
AllowedIPs={{ .DsnetConfig.Network }}
|
AllowedIPs={{ .DsnetConfig.Network }}
|
||||||
|
@ -44,7 +44,6 @@ type DsnetConfig struct {
|
|||||||
// 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"`
|
||||||
PresharedKey JSONKey `validate:"required,len=44"`
|
|
||||||
Peers []PeerConfig `validate:"dive"`
|
Peers []PeerConfig `validate:"dive"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
init.go
6
init.go
@ -18,12 +18,8 @@ func Init() {
|
|||||||
ExitFail("Refusing to overwrite existing %s", CONFIG_FILE)
|
ExitFail("Refusing to overwrite existing %s", CONFIG_FILE)
|
||||||
}
|
}
|
||||||
|
|
||||||
privateKey := GenerateJSONPrivateKey()
|
|
||||||
presharedKey := GenerateJSONKey()
|
|
||||||
|
|
||||||
conf := DsnetConfig{
|
conf := DsnetConfig{
|
||||||
PrivateKey: privateKey,
|
PrivateKey: GenerateJSONPrivateKey()
|
||||||
PresharedKey: presharedKey,
|
|
||||||
ListenPort: DEFAULT_LISTEN_PORT,
|
ListenPort: DEFAULT_LISTEN_PORT,
|
||||||
Network: getRandomNetwork(),
|
Network: getRandomNetwork(),
|
||||||
Peers: []PeerConfig{},
|
Peers: []PeerConfig{},
|
||||||
|
Loading…
Reference in New Issue
Block a user