mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-07 17:23:14 +03:00
fix QCCode bug
This commit is contained in:
parent
03428646e1
commit
a53a85618f
2 changed files with 15 additions and 9 deletions
16
util/util.go
16
util/util.go
|
@ -22,8 +22,6 @@ 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)
|
||||
|
@ -36,10 +34,16 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
strConfig := "[Interface]\n" +
|
||||
clientAddress + "\n" +
|
||||
clientPrivateKey + "\n" +
|
||||
clientDNS + "\n" +
|
||||
clientPostUp + "\n" +
|
||||
clientPostDown + "\n\n" +
|
||||
"[Peer]" + "\n" +
|
||||
clientDNS + "\n\n"
|
||||
|
||||
if client.HasPrivateSubnet {
|
||||
clientPostUp := fmt.Sprintf("PostUp = %s", client.PostUp)
|
||||
clientPostDown := fmt.Sprintf("PostDown = %s", client.PostDown)
|
||||
strConfig += clientPostUp + "\n" +
|
||||
clientPostDown + "\n\n"
|
||||
}
|
||||
|
||||
strConfig += "[Peer]" + "\n" +
|
||||
peerPublicKey + "\n" +
|
||||
peerPresharedKey + "\n" +
|
||||
peerAllowedIPs + "\n" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue