From 66a7dff5e9d68eba55235d38f148cafcc6abed5c Mon Sep 17 00:00:00 2001 From: axelsimon Date: Tue, 1 Dec 2020 18:54:39 +0000 Subject: [PATCH] Update patch to use the new ExternalHost feature. --- add.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/add.go b/add.go index 87d6ca3..e30f0d6 100644 --- a/add.go +++ b/add.go @@ -66,7 +66,7 @@ commit; save ` const nixosPeerConf = `networking.wireguard.interfaces = {{ "{" }} - {{ .Wgif }} = {{ "{" }} + dsnet = {{ "{" }} ips = [ {{ if gt (.DsnetConfig.Network.IPNet.IP | len) 0 -}} "{{ .Peer.IP }}/{{ .CidrSize }}" @@ -79,7 +79,7 @@ const nixosPeerConf = `networking.wireguard.interfaces = {{ "{" }} {{- if .DsnetConfig.DNS }} dns = [ "{{ .DsnetConfig.DNS }}" ]; {{ end }} - peers= [ + peers = [ {{ "{" }} publicKey = "{{ .DsnetConfig.PrivateKey.PublicKey.Key }}"; presharedKey = "{{ .Peer.PresharedKey.Key }}"; @@ -91,11 +91,7 @@ const nixosPeerConf = `networking.wireguard.interfaces = {{ "{" }} "{{ .DsnetConfig.Network6 }}" {{ end -}} ]; - {{ if gt (.DsnetConfig.ExternalIP | len) 0 -}} - endpoint = "{{ .DsnetConfig.ExternalIP }}:{{ .DsnetConfig.ListenPort }}"; - {{ else -}} - endpoint = "{{ .DsnetConfig.ExternalIP6 }}:{{ .DsnetConfig.ListenPort }}"; - {{ end -}} + endpoint = "{{ .Endpoint }}:{{ .DsnetConfig.ListenPort }}"; persistentKeepalive = {{ .Keepalive }}; {{ "}" }} ];