diff --git a/.gitignore b/.gitignore index 6be10ee..56e15dc 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ logs # Go workspace file go.work wg.db +wg0.conf *.db *.yaml -*.conf + diff --git a/template/wg.conf b/template/wg.conf new file mode 100644 index 0000000..6a00e3b --- /dev/null +++ b/template/wg.conf @@ -0,0 +1,24 @@ +[Interface] +Address = {{ .Server.Address|html }} +ListenPort = {{ .Server.ListenPort|html }} +PrivateKey = {{ .Server.PrivateKey|html }} +MTU = {{ .Server.MTU|html }} +PostUp = {{ .Server.PostUp|html }} +PreDown = {{ .Server.PreDown|html }} +PostDown = {{ .Server.PostDown|html }} +Table = {{ .Server.Table|html }} + +{{ range .Clients }}{{ if eq .Enabled true }} +# ID: {{ .ID|html }} +# Name: {{ .Name|html }} +# Emil: {{ .Email|html }} +# CreatedAt: {{ .CreatedAt|html }} +# UpdatedAt: {{ .UpdatedAt|html }} +# CreateUser: {{ .CreateUser|html }} +[Peer] +PublicKey = {{ .PublicKey|html }} +PresharedKey = {{ .PresharedKey|html }} +AllowedIPs = {{ .AllowedIPS|html }} +PersistentKeepalive = {{ .PersistentKeepalive|html }} +Endpoint = {{ .Endpoint|html }} +{{ end }}{{ end }}