Fix AllowedIPs from ui to server config
this MR fixed AllowedIPs from this issue https://github.com/ngoduykhanh/wireguard-ui/issues/77
This commit is contained in:
		
							parent
							
								
									2fdafd34ca
								
							
						
					
					
						commit
						29232c6b36
					
				|  | @ -27,7 +27,14 @@ Table = {{ .globalSettings.Table }} | ||||||
| [Peer] | [Peer] | ||||||
| PublicKey = {{ .Client.PublicKey }} | PublicKey = {{ .Client.PublicKey }} | ||||||
| {{if .Client.PresharedKey}}PresharedKey = {{ .Client.PresharedKey }}{{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}} | AllowedIPs = {{ $first := true }} | ||||||
|  | {{- range .Client.AllowedIPs -}} | ||||||
|  |   {{- if not $first}}, {{ end -}}{{ . -}}{{ $first = false -}} | ||||||
|  | {{- end -}} | ||||||
|  | {{- range .Client.ExtraAllowedIPs -}} | ||||||
|  |   {{- if not $first}}, {{ end -}}{{ . -}}{{ $first = false -}} | ||||||
|  | {{- end }} | ||||||
|  | {{"\n"}} | ||||||
| {{if $.globalSettings.PersistentKeepalive}}PersistentKeepalive = {{ $.globalSettings.PersistentKeepalive }}{{end}} | {{if $.globalSettings.PersistentKeepalive}}PersistentKeepalive = {{ $.globalSettings.PersistentKeepalive }}{{end}} | ||||||
| {{if .Client.Endpoint}}Endpoint = {{ .Client.Endpoint }}{{end}} | {{if .Client.Endpoint}}Endpoint = {{ .Client.Endpoint }}{{end}} | ||||||
| {{end}}{{end}} | {{end}}{{end}} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue