mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-05-23 00:15:19 +03:00
Add preshared key in wireguard config (#15)
This commit is contained in:
parent
f76de28a17
commit
9617425033
4 changed files with 13 additions and 1 deletions
|
@ -25,6 +25,7 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
|
||||
// Peer section
|
||||
peerPublicKey := fmt.Sprintf("PublicKey = %s", server.KeyPair.PublicKey)
|
||||
peerPresharedKey := fmt.Sprintf("PresharedKey = %s", client.PresharedKey)
|
||||
peerAllowedIPs := fmt.Sprintf("AllowedIPs = %s", strings.Join(client.AllowedIPs, ","))
|
||||
peerEndpoint := fmt.Sprintf("Endpoint = %s:%d", setting.EndpointAddress, server.Interface.ListenPort)
|
||||
peerPersistentKeepalive := fmt.Sprintf("PersistentKeepalive = %d", setting.PersistentKeepalive)
|
||||
|
@ -36,6 +37,7 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
clientDNS + "\n\n" +
|
||||
"[Peer]" + "\n" +
|
||||
peerPublicKey + "\n" +
|
||||
peerPresharedKey + "\n" +
|
||||
peerAllowedIPs + "\n" +
|
||||
peerEndpoint + "\n" +
|
||||
peerPersistentKeepalive + "\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue