Skip to content

Commit

Permalink
Fix logic error and make some settings optional in wg.conf template. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nanhantianyi authored Dec 27, 2023
1 parent c2a6ced commit 867aa13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/wg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Table = {{ .globalSettings.Table }}
[Peer]
PublicKey = {{ .Client.PublicKey }}
{{if .Client.PresharedKey }}PresharedKey = {{ .Client.PresharedKey }}{{end}}
AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}{{range .Client.ExtraAllowedIPs }},{{.}}{{end}}{{end}}
AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}{{range .Client.ExtraAllowedIPs }},{{.}}{{end}}
{{if .Client.Endpoint }}Endpoint = {{ .Client.Endpoint }}{{end}}
{{end}}
{{end}}{{end}}

0 comments on commit 867aa13

Please sign in to comment.