From 867aa1305d47308d63283b54340550952a68c923 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 28 Dec 2023 03:50:30 +0800 Subject: [PATCH] Fix logic error and make some settings optional in wg.conf template. (#506) --- templates/wg.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/wg.conf b/templates/wg.conf index 9269912..2112a0c 100644 --- a/templates/wg.conf +++ b/templates/wg.conf @@ -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}}