Feat: show client endpoint (#2058)

* show client endpoint

* improve

* fix status code
This commit is contained in:
Bernd Storath
2025-07-25 12:00:42 +02:00
committed by GitHub
parent b5318086d2
commit 07f89d15a9
5 changed files with 54 additions and 2 deletions
+11
View File
@@ -93,6 +93,17 @@ class WireGuard {
return clients;
}
async dumpByPublicKey(publicKey: string) {
const wgInterface = await Database.interfaces.get();
const dump = await wg.dump(wgInterface.name);
const clientDump = dump.find(
({ publicKey: dumpPublicKey }) => dumpPublicKey === publicKey
);
return clientDump;
}
async getAllClients() {
const wgInterface = await Database.interfaces.get();
const dbClients = await Database.clients.getAllPublic();