Feat: show client endpoint (#2058)
* show client endpoint * improve * fix status code
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user