naggie / dsnet

FAST command to manage a centralised wireguard VPN. Think wg-quick but quicker: key generation + address allocation.
https://calbryant.uk/blog/how-to-set-up-a-wireguard-vpn-in-minutes-with-dsnet/
MIT License
673 stars 33 forks source link

Fix bug in regenerate command which did not update the dsnetconfig.json file #52

Closed f-koehler closed 3 years ago

f-koehler commented 3 years ago

The peer config obtained in the loop is a copy. Modifying it does not change the actual config which is then written to disk. Therefore I call MustRemovePeer and MustAddPeer to actually modify the config before saving.

I have no idea why I did not notice it while testing. Noticed it in production :smile:

naggie commented 3 years ago

Wow, I missed it too. Good job I didn't make a release then. Thanks for the fix -- I'll release soon (this has reminded me too!)