mirror of
https://github.com/DJSundog/wg-portal.git
synced 2024-11-13 18:23:51 -05:00
24 lines
596 B
Go
24 lines
596 B
Go
package wireguard
|
|
|
|
var (
|
|
ClientCfgTpl = `[Interface]
|
|
#{{ .Client.Identifier }}
|
|
Address = {{ .Client.IPsStr }}
|
|
PrivateKey = {{ .Client.PrivateKey }}
|
|
{{ if ne (len .Server.DNS) 0 -}}
|
|
DNS = {{ .Server.DNSStr }}
|
|
{{- end }}
|
|
{{ if ne .Server.Mtu 0 -}}
|
|
MTU = {{.Server.Mtu}}
|
|
{{- end}}
|
|
[Peer]
|
|
PublicKey = {{ .Server.PublicKey }}
|
|
PresharedKey = {{ .Client.PresharedKey }}
|
|
AllowedIPs = {{ .Client.AllowedIPsStr }}
|
|
Endpoint = {{ .Server.Endpoint }}
|
|
{{ if and (ne .Server.PersistentKeepalive 0) (not .Client.IgnorePersistentKeepalive) -}}
|
|
PersistentKeepalive = {{.Server.PersistentKeepalive}}
|
|
{{- end}}
|
|
`
|
|
)
|