donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python & Vue.js
https://donaldzou.github.io/WGDashboard-Documentation/
Apache License 2.0
1.63k stars 248 forks source link

Get Peer Config via API. "Peer does not exist" #485

Closed NovianPutera closed 1 week ago

NovianPutera commented 1 week ago

The Problem I want to know why I can't get peer config via API with error "Peer does not exist".

I tried to reinstall WGDashboard (Delete Folder -> reclone -> ./wgd.sh install -> ./wgd.sh start). After that process, API get config peer can be obtained.

However, 1 day later, peer config can't be obtained again with the same error, "Peer does not exist".

Can the symbols in the public key affect the API?

Error No error found at error-xxx.log

Configuration

OS Information:

Screenshot 2024-11-13 at 09 06 53 Screenshot 2024-11-13 at 09 07 20

DaanSelen commented 1 week ago

I am going to try to recreate this.

DaanSelen commented 1 week ago

@NovianPutera can you URL encode your peer's public key in the URL? https://www.urlencoder.org/

NovianPutera commented 1 week ago

Sorry for late reply.

Ahh, after I encode my public key at https://www.urlencoder.org/. And I tried to get the configuration via API, apparently it works.

The problem is Postman does not encode the "+" sign to URL-encoded format on Query Params.

Thanks @DaanSelen

DaanSelen commented 1 week ago

Sorry for late reply.

Ahh, after I encode my public key at https://www.urlencoder.org/. And I tried to get the configuration via API, apparently it works.

The problem is Postman does not encode the "+" sign to URL-encoded format on Query Params.

Thanks @DaanSelen

I was afraid it was not passing something correctly! Good to hear it works.