Fix logic error and make some settings optional in wg.conf template.
This commit is contained in:
		
							parent
							
								
									e73047b14f
								
							
						
					
					
						commit
						bf73524f21
					
				|  | @ -7,11 +7,11 @@ | |||
| Address = {{$first :=true}}{{range .serverConfig.Interface.Addresses }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}} | ||||
| ListenPort = {{ .serverConfig.Interface.ListenPort }} | ||||
| PrivateKey = {{ .serverConfig.KeyPair.PrivateKey }} | ||||
| {{if .globalSettings.MTU}}MTU = {{ .globalSettings.MTU }}{{end}} | ||||
| PostUp = {{ .serverConfig.Interface.PostUp }} | ||||
| PreDown = {{ .serverConfig.Interface.PreDown }} | ||||
| PostDown = {{ .serverConfig.Interface.PostDown }} | ||||
| Table = {{ .globalSettings.Table }} | ||||
| {{if .globalSettings.MTU }}MTU = {{ .globalSettings.MTU }} | ||||
| {{end}}{{if .serverConfig.Interface.PostUp }}PostUp = {{ .serverConfig.Interface.PostUp }} | ||||
| {{end}}{{if .serverConfig.Interface.PreDown }}PreDown = {{ .serverConfig.Interface.PreDown }} | ||||
| {{end}}{{if .serverConfig.Interface.PostDown }}PostDown = {{ .serverConfig.Interface.PostDown }} | ||||
| {{end}}{{if .globalSettings.Table }}Table = {{ .globalSettings.Table }}{{end}} | ||||
| 
 | ||||
| {{range .clientDataList}}{{if eq .Client.Enabled true}} | ||||
| # ID:           {{ .Client.ID }} | ||||
|  | @ -21,7 +21,7 @@ Table = {{ .globalSettings.Table }} | |||
| # Update at:    {{ .Client.UpdatedAt }} | ||||
| [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}} | ||||
| {{if .Client.PresharedKey }}PresharedKey = {{ .Client.PresharedKey }} | ||||
| {{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}} | ||||
		Loading…
	
		Reference in New Issue