mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-07 17:23:14 +03:00
add client postup & postdown
This commit is contained in:
parent
a89fb34555
commit
03428646e1
5 changed files with 37 additions and 5 deletions
|
@ -22,6 +22,8 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
clientAddress := fmt.Sprintf("Address = %s", strings.Join(client.AllocatedIPs, ","))
|
||||
clientPrivateKey := fmt.Sprintf("PrivateKey = %s", client.PrivateKey)
|
||||
clientDNS := fmt.Sprintf("DNS = %s", strings.Join(setting.DNSServers, ","))
|
||||
clientPostUp := fmt.Sprintf("PostUp = %s", client.PostUp)
|
||||
clientPostDown := fmt.Sprintf("PostDown = %s", client.PostDown)
|
||||
|
||||
// Peer section
|
||||
peerPublicKey := fmt.Sprintf("PublicKey = %s", server.KeyPair.PublicKey)
|
||||
|
@ -34,7 +36,9 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
strConfig := "[Interface]\n" +
|
||||
clientAddress + "\n" +
|
||||
clientPrivateKey + "\n" +
|
||||
clientDNS + "\n\n" +
|
||||
clientDNS + "\n" +
|
||||
clientPostUp + "\n" +
|
||||
clientPostDown + "\n\n" +
|
||||
"[Peer]" + "\n" +
|
||||
peerPublicKey + "\n" +
|
||||
peerPresharedKey + "\n" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue