Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-25 17:40:42 +00:00
parent 051e441a68
commit 2525026e2d
3 changed files with 50 additions and 0 deletions
+26
View File
@@ -261,3 +261,29 @@ func (m *Machine) RemoveWireguardConfig(ring int) error {
return err
}
// SyncWireguardConfig updates all wgN.conf files for the specified
// ring
func (m *Machine) SyncWireguardConfig(ring int) error {
return m.zone.SyncWireguardConfig(ring)
}
func (m *Machine) createRingInfo(ring int, enabled bool) (*RingInfo, error) {
keys, err := wireguard.NewKeyPair()
if err != nil {
return nil, err
}
ri := &RingInfo{
Ring: ring,
Enabled: enabled,
Keys: keys,
}
err = m.applyRingInfo(ring, ri)
if err != nil {
return nil, err
}
return ri, nil
}