mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-15 18:38:15 +03:00
PresharedKey is now only included if set
PresharedKey is now only set in the server and client config if the key is set and not null (or empty). I added this feature because I was importing old config files from clients that did not have a preshared key set. Clients can be created without preshared keys when editing db/client/ files manually. If the field is not set, wireguard-ui creates invalid configs by producing: PresharedKey = This patch remvoes this behavior and just skips the preshared key if not set.
This commit is contained in:
parent
f3a788e3a4
commit
38bb8c343c
2 changed files with 23 additions and 19 deletions
|
@ -19,6 +19,6 @@ PostDown = {{ .serverConfig.Interface.PostDown }}
|
|||
# Update at: {{ .Client.UpdatedAt }}
|
||||
[Peer]
|
||||
PublicKey = {{ .Client.PublicKey }}
|
||||
PresharedKey = {{ .Client.PresharedKey }}
|
||||
AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}
|
||||
{{if .Client.PresharedKey }}PresharedKey = {{ .Client.PresharedKey }}
|
||||
{{end}}AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}
|
||||
{{end}}{{end}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue