fix newlines in template

This commit is contained in:
Christoph Haas 2020-12-17 14:01:03 +01:00
parent 814f57d357
commit edd09a9e13
1 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ var (
[Interface] [Interface]
Address = {{ .Client.IPsStr }} Address = {{ .Client.IPsStr }}
PrivateKey = {{ .Client.PrivateKey }} PrivateKey = {{ .Client.PrivateKey }}
{{if .Server.DNSStr -}} {{- if .Server.DNSStr}}
DNS = {{ .Server.DNSStr }} DNS = {{ .Server.DNSStr }}
{{- end}} {{- end}}
{{- if ne .Server.Mtu 0}} {{- if ne .Server.Mtu 0}}
@ -14,19 +14,19 @@ MTU = {{.Server.Mtu}}
[Peer] [Peer]
PublicKey = {{ .Server.PublicKey }} PublicKey = {{ .Server.PublicKey }}
{{- if .Client.PresharedKey -}} {{- if .Client.PresharedKey}}
PresharedKey = {{ .Client.PresharedKey }} PresharedKey = {{ .Client.PresharedKey }}
{{- end -}} {{- end}}
AllowedIPs = {{ .Client.AllowedIPsStr }} AllowedIPs = {{ .Client.AllowedIPsStr }}
Endpoint = {{ .Server.Endpoint }} Endpoint = {{ .Server.Endpoint }}
{{if and (ne .Server.PersistentKeepalive 0) (not .Client.IgnorePersistentKeepalive) -}} {{- if and (ne .Server.PersistentKeepalive 0) (not .Client.IgnorePersistentKeepalive)}}
PersistentKeepalive = {{.Server.PersistentKeepalive}} PersistentKeepalive = {{.Server.PersistentKeepalive}}
{{- end}} {{- end}}
` `
DeviceCfgTpl = `# AUTOGENERATED FILE - DO NOT EDIT DeviceCfgTpl = `# AUTOGENERATED FILE - DO NOT EDIT
# Updated: {{ .Server.UpdatedAt }} / Created: {{ .Server.CreatedAt }} # Updated: {{ .Server.UpdatedAt }} / Created: {{ .Server.CreatedAt }}
[Interface] [Interface]
{{- range .Server.IPs }} {{- range .Server.IPs}}
Address = {{ . }} Address = {{ . }}
{{- end}} {{- end}}
ListenPort = {{ .Server.ListenPort }} ListenPort = {{ .Server.ListenPort }}