wg-api icon indicating copy to clipboard operation
wg-api copied to clipboard

Call /peer/remove/username doesn't work

Open douwezijlstra-frl opened this issue 4 years ago • 2 comments

Hello!

I have found a small bug. I am able to create a peer, but I can't remove them afterwards. This is what I get;

root@server:~# curl http://x.x.x.x:3000/peer/create/removetest
{
  "code": 200,
  "profile": {
    "Interface": {
      "Address": "10.9.0.5/24",
      "PrivateKey": "<hidden>",
      "DNS": "1.1.1.1, 1.0.0.1"
    },
    "Peer": {
      "PublicKey": "07G4gg98uYm0LNO+Xwon01zVnzWwFRFGTjxMJgP88AI=",
      "AllowedIPs": "0.0.0.0/0, ::/0",
      "Endpoint": "x.x.x.x:2000",
      "PersistentKeepalive": "25"
    },
    "qr": "/peer/qr/removetest"
  }
}root@server:~#
root@server:~# curl http://x.x.x.x:3000/peer/remove/removetest
{"message":"Route GET:/peer/remove/removetest not found","error":"Not Found","statusCode":404}root@server:~#

Further, very enthousiastic about this API, comes in useful!

douwezijlstra-frl avatar Dec 18 '20 09:12 douwezijlstra-frl

Update: found it. Using '/client/remove/removetest' it does work. Minor error in the code then

douwezijlstra-frl avatar Dec 23 '20 13:12 douwezijlstra-frl

Thanks @frykandelbroadsje! Will look into this.

alectrocute avatar Jan 16 '21 15:01 alectrocute