perara / wg-manager

A easy to use WireGuard dashboard and management tool
MIT License
599 stars 72 forks source link

confused about api create user #95

Open outbackdingo opened 3 years ago

outbackdingo commented 3 years ago

we deployed on bare metal with a systemd init file, and can login to the ui and create accounts / download configs we verified that the server and wg do in fact work fine

now, im looking for a way that "clients" can make an api call generate and retrieve their certificate via some automated method

preferably a curl method done in the background on system boot. the images are all identical, the only thing unique to each device is a MAC address.... which we can "calculate" a number key from to identify specific device, so the question is how do we accomplish the next step

curl post api url POST /api/v1/peer/add and grab the response

200 Response

{ "id": 0, "name": "string", "address": "string", "v6_address": "string", "private_key": "string", "public_key": "string", "shared_key": "string", "server_id": "string", "dns": "string", "allowed_ips": "string", "configuration": "string" } to a local wg.conf file

perara commented 3 years ago

I have not really seen the use case to directly create users from the backend. Surely this is a good idea, and I'll have a look at this when I get the time. Generally, you can find all API endpoints on the /docs endpoint