Fixed PersistentKeepalive serialization
This commit is contained in:
parent
d80ea58156
commit
f04d44ff8d
@ -110,7 +110,7 @@ PrivateKey = {{ .PrivateKey | wgKey }}
|
||||
PublicKey = {{ .PublicKey | wgKey }}
|
||||
AllowedIPs = {{ range $i, $el := .AllowedIPs }}{{if $i}}, {{ end }}{{ $el }}{{ end }}
|
||||
{{- if .PresharedKey }}{{ "\n" }}PresharedKey = {{ .PresharedKey }}{{ end }}
|
||||
{{- if .PersistentKeepaliveInterval }}{{ "\n" }}PersistentKeepaliveInterval = {{ .PersistentKeepaliveInterval | toSeconds }}{{ end }}
|
||||
{{- if .PersistentKeepaliveInterval }}{{ "\n" }}PersistentKeepalive = {{ .PersistentKeepaliveInterval | toSeconds }}{{ end }}
|
||||
{{- if .Endpoint }}{{ "\n" }}Endpoint = {{ .Endpoint }}{{ end }}
|
||||
{{- end }}
|
||||
`
|
||||
|
@ -1,8 +1,9 @@
|
||||
package wgquick
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var testConfigs = map[string]string{
|
||||
@ -47,6 +48,7 @@ PreDown = ip rule delete ipproto tcp dport 22 table 1234
|
||||
[Peer]
|
||||
PublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
PersistentKeepalive = 25
|
||||
`,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user