perara / wg-manager

A easy to use WireGuard dashboard and management tool
MIT License
594 stars 74 forks source link

Peer does not get removed from server config if removed from GUI. #22

Closed sputnic42 closed 4 years ago

sputnic42 commented 4 years ago

If a peer is created on a sever and then deleted it still remains in the server configuration an is still able to connect. If a new peer is created on the same server both peers are visible in server config and able to connect.

The old deleted peer dissappears from server configuration after server restart, but only if a new peer was created afterwards.

Steps to reproduce:

  1. create server
  2. create peer1 2.1 connect witch peer1
  3. delete peer1 3.1 connect with peer1 (should still work)
  4. create new peer2 4.1 both peers sould be able to connect
  5. restart server 5.1 peer1 sould now not be able to connect anymore and be gone fom server config
perara commented 4 years ago

Hi, Thanks for the bug report. I found a bug related to this. The deletion code tried to lookup the interface by ID and not the actual interface name. Additionally, I've suppressed exceptions where the interface is missing. Should be fixed now, and I've made a logging message when this happens.

Please reopen if the problem persists (pull from dev)