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}} | Address = {{$first :=true}}{{range .serverConfig.Interface.Addresses }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}} | ||||||
| ListenPort = {{ .serverConfig.Interface.ListenPort }} | ListenPort = {{ .serverConfig.Interface.ListenPort }} | ||||||
| PrivateKey = {{ .serverConfig.KeyPair.PrivateKey }} | PrivateKey = {{ .serverConfig.KeyPair.PrivateKey }} | ||||||
| {{if .globalSettings.MTU}}MTU = {{ .globalSettings.MTU }}{{end}} | {{if .globalSettings.MTU }}MTU = {{ .globalSettings.MTU }} | ||||||
| PostUp = {{ .serverConfig.Interface.PostUp }} | {{end}}{{if .serverConfig.Interface.PostUp }}PostUp = {{ .serverConfig.Interface.PostUp }} | ||||||
| PreDown = {{ .serverConfig.Interface.PreDown }} | {{end}}{{if .serverConfig.Interface.PreDown }}PreDown = {{ .serverConfig.Interface.PreDown }} | ||||||
| PostDown = {{ .serverConfig.Interface.PostDown }} | {{end}}{{if .serverConfig.Interface.PostDown }}PostDown = {{ .serverConfig.Interface.PostDown }} | ||||||
| Table = {{ .globalSettings.Table }} | {{end}}{{if .globalSettings.Table }}Table = {{ .globalSettings.Table }}{{end}} | ||||||
| 
 | 
 | ||||||
| {{range .clientDataList}}{{if eq .Client.Enabled true}} | {{range .clientDataList}}{{if eq .Client.Enabled true}} | ||||||
| # ID:           {{ .Client.ID }} | # ID:           {{ .Client.ID }} | ||||||
|  | @ -21,7 +21,7 @@ Table = {{ .globalSettings.Table }} | ||||||
| # Update at:    {{ .Client.UpdatedAt }} | # Update at:    {{ .Client.UpdatedAt }} | ||||||
| [Peer] | [Peer] | ||||||
| PublicKey = {{ .Client.PublicKey }} | PublicKey = {{ .Client.PublicKey }} | ||||||
| {{if .Client.PresharedKey }}PresharedKey = {{ .Client.PresharedKey }}{{end}} | {{if .Client.PresharedKey }}PresharedKey = {{ .Client.PresharedKey }} | ||||||
| AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}{{range .Client.ExtraAllowedIPs }},{{.}}{{end}}{{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}} | {{if .Client.Endpoint }}Endpoint = {{ .Client.Endpoint }}{{end}} | ||||||
| {{end}} | {{end}}{{end}} | ||||||
		Loading…
	
		Reference in New Issue