New Feature: API Key Access! #15
Replies: 3 comments 7 replies
-
Beta Was this translation helpful? Give feedback.
-
The API looks very cool, but I have a question: wireguard_webadmin has a peer name already which is captured when the peer is defined. Could this not be exposed as a standard field within the output of For example:
The flask app is interesting, but it requires a separate lookup of friendly name to public key. The usage I am looking at is for a centralised monitoring platform which we currently have discovering Wireguard tunnels and monitoring them using shell Using wireguared_webadmin we could do the same using the api if the name was exposed as I describe above. |
Beta Was this translation helpful? Give feedback.
-
Hello @kamilner ! Thank you for your feedback. I just released this on the latest version. The instance information can be found at: /api/instance_info/ both endpoints support instance filtering (defaults to all). Just use &instance= (wg0,wg1.... all) Cheers! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
I'm excited to announce some updates to our API! We now support the following endpoints that you can access using your API key. Below is a detailed list of each endpoint along with usage instructions.
1.
/api/wireguard_status/
Description:
This endpoint returns the complete, JSON-formatted output of the WireGuard service's wg show command. It provides real-time status information, including interface details, peer connection data, and transfer statistics, all formatted and ready for immediate integration into your monitoring or automation systems.
Usage:
2.
/api/peer_list/
Description:
Returns a detailed list of configured peers for each instance.
Usage:
Instance Filtering:
You can filter the results by instance. By default, all instances are returned. To filter, append the
&instance=
parameter with a comma-separated list (e.g.,wg0,wg1
):3.
/api/instance_info/
Description:
Provides information about the configured wireguard instances
Usage:
Instance Filtering:
Like the peer list endpoint, you can filter by instance. Use the same
&instance=
parameter:Generating an API Key
Your API key must be a valid UUID. You can generate one using the following commands:
Outside the Container:
cat /proc/sys/kernel/random/uuid > /var/lib/docker/volumes/wireguard_webadmin_wireguard/_data/api_key
Inside the Container:
cat /proc/sys/kernel/random/uuid > /etc/wireguard/api_key
Disabling the API Key
If you ever need to disable your API key, simply generate a new one or delete the
api_key
file.I released these features in the latest version while working on an integration of my own. Feel free to explore them and share any cool projects you build using this functionality.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions