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]
|
||||
Address = {{ .Peer.IP }}
|
||||
PrivateKey={{ .Peer.PrivateKey.Key }}
|
||||
PresharedKey={{ .Peer.PresharedKey.Key }}
|
||||
DNS = {{ .DsnetConfig.DNS }}
|
||||
|
||||
[Peer]
|
||||
PublicKey={{ .DsnetConfig.PrivateKey.PublicKey.Key }}
|
||||
PresharedKey={{ .DsnetConfig.PresharedKey.Key }}
|
||||
PresharedKey={{ .Peer.PresharedKey.Key }}
|
||||
Endpoint={{ .DsnetConfig.ExternalIP }}:{{ .DsnetConfig.ListenPort }}
|
||||
#AllowedIPs=0.0.0.0/0
|
||||
AllowedIPs={{ .DsnetConfig.Network }}
|
||||
|
@ -44,7 +44,6 @@ type DsnetConfig struct {
|
||||
// TODO Default subnets to route via VPN
|
||||
ReportFile string `validate:"required"`
|
||||
PrivateKey JSONKey `validate:"required,len=44"`
|
||||
PresharedKey JSONKey `validate:"required,len=44"`
|
||||
Peers []PeerConfig `validate:"dive"`
|
||||
}
|
||||
|
||||
|
6
init.go
6
init.go
@ -18,12 +18,8 @@ func Init() {
|
||||
ExitFail("Refusing to overwrite existing %s", CONFIG_FILE)
|
||||
}
|
||||
|
||||
privateKey := GenerateJSONPrivateKey()
|
||||
presharedKey := GenerateJSONKey()
|
||||
|
||||
conf := DsnetConfig{
|
||||
PrivateKey: privateKey,
|
||||
PresharedKey: presharedKey,
|
||||
PrivateKey: GenerateJSONPrivateKey()
|
||||
ListenPort: DEFAULT_LISTEN_PORT,
|
||||
Network: getRandomNetwork(),
|
||||
Peers: []PeerConfig{},
|
||||
|
Loading…
Reference in New Issue
Block a user