From ffb3b6911411230130124a2c65261789fe23062e Mon Sep 17 00:00:00 2001 From: coward Date: Mon, 11 Mar 2024 16:34:37 +0800 Subject: [PATCH] =?UTF-8?q?:see=5Fno=5Fevil:=E9=87=8A=E6=94=BE.conf?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=8E=A8=E9=80=81=EF=BC=8C=E5=8F=AA=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E6=96=87=E4=BB=B6=E5=8D=B3=E5=8F=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- template/wg.conf | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 template/wg.conf 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 }}