Feat: Server Endpoint (#1785)

* add server endpoint to client

* be able to update endpoint over api
This commit is contained in:
Bernd Storath
2025-04-01 16:13:51 +02:00
committed by GitHub
parent 9df049d3f4
commit e92ee0464e
8 changed files with 30 additions and 6 deletions

View File

@@ -13,11 +13,16 @@ export const wg = {
...(client.serverAllowedIps ?? []),
];
const extraLines = [];
if (client.serverEndpoint) {
extraLines.push(`Endpoint = ${client.serverEndpoint}`);
}
return `# Client: ${client.name} (${client.id})
[Peer]
PublicKey = ${client.publicKey}
PresharedKey = ${client.preSharedKey}
AllowedIPs = ${allowedIps.join(', ')}`;
AllowedIPs = ${allowedIps.join(', ')}${extraLines.length ? `\n${extraLines.join('\n')}` : ''}`;
},
generateServerInterface: (wgInterface: InterfaceType, hooks: HooksType) => {