Add global PersistentKeepalive setting to wg.conf template.

If set, this will insert PersistentKeepalive into the server side config
Peer sections. PersistentKeepalive is not permissible under Interface
sections. Only Peer sections.

Refer to man page or source:

https://git.zx2c4.com/wireguard-tools/tree/src/config.c

Resolves issue #432.
This commit is contained in:
Paul Donald 2023-12-02 20:52:12 +01:00
parent 88fe812523
commit cc82ca6a0f

View file

@ -22,4 +22,5 @@ PrivateKey = {{ .serverConfig.KeyPair.PrivateKey }}
PublicKey = {{ .Client.PublicKey }} PublicKey = {{ .Client.PublicKey }}
{{if .Client.PresharedKey }}PresharedKey = {{ .Client.PresharedKey }} {{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}}AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}}{{range .Client.ExtraAllowedIPs }},{{.}}{{end}}
{{if $.globalSettings.PersistentKeepalive}}PersistentKeepalive = {{ $.globalSettings.PersistentKeepalive }}{{end}}
{{end}}{{end}} {{end}}{{end}}