From acf9e0e81d20e6a1dc44f62cad6bda63902cc576 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sat, 26 Aug 2023 18:26:11 +0000 Subject: [PATCH] zones: extend WriteWireguardConfig to include a Name indicating the ring ID Signed-off-by: Alejandro Mery --- pkg/zones/rings.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/zones/rings.go b/pkg/zones/rings.go index 1cbdd06..a2d2176 100644 --- a/pkg/zones/rings.go +++ b/pkg/zones/rings.go @@ -210,6 +210,7 @@ func (r *Ring) AddPeer(p *Machine) bool { Address: addr, PrivateKey: ri.Keys.PrivateKey, PeerConfig: wireguard.PeerConfig{ + Name: fmt.Sprintf("%s-%v", p.Name, r.ID), PublicKey: ri.Keys.PublicKey, Endpoint: wireguard.EndpointAddress{ Host: p.FullName(), @@ -300,6 +301,7 @@ func (r *Ring) ExportConfig(p *Machine) (*wireguard.Config, error) { case pp.Node == p: // current found = true + out.Interface.Name = pp.PeerConfig.Name out.Interface.Address = pp.Address out.Interface.PrivateKey = pp.PrivateKey default: