FokiDoki / WireRest

REST API for Wireguard
MIT License
18 stars 5 forks source link

There should be an endpoint for generating plain wireguard configurations for peer #64

Closed shivanshtalwar0 closed 9 months ago

shivanshtalwar0 commented 10 months ago

something like this should be returned from that endpoint , courtesy: https://wgrest.forestvpn.com/swagger/#/device/GetDevicePeerQuickConfig

[Interface]
Address = 10.7.0.4/24
DNS = 8.8.8.8, 8.8.4.4
PrivateKey = somesecurekey

[Peer]
PublicKey = someokaykey
PresharedKey = somesecurekey
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = serverip:51820
PersistentKeepalive = 25
FokiDoki commented 10 months ago

Hello, thanks for your suggestion. I'll add it to the TODO list and try to implement it when I have time to work on the project.

For now you can create configurations on the side of your application, it's quite simple.

[Interface]
PrivateKey = <peer privateKey> 
Address = <peer allowedSubnets> 
DNS = <dns servers> 

[Peer]
PublicKey = <Interface publicKey> 
PresharedKey = <peer presharedKey> 
Endpoint = <server ip:port>
AllowedIPs = <allowed ips, 0.0.0.0/0, ::/0 for route all traffic> 

You can get the publicKey and port of interface using GET in /v1/interface. Peer keys and allowedSubnets can be obtained with POST to /v1/peers. Thank you for your interest in the project.