feat: no private key (#887)

Thank you @willtho89!
This commit is contained in:
Philip H 2024-03-06 17:03:33 +01:00 committed by GitHub
commit 3621bdebad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 40 additions and 9 deletions

View file

@ -141,7 +141,7 @@ ${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : ''
createdAt: new Date(client.createdAt),
updatedAt: new Date(client.updatedAt),
allowedIPs: client.allowedIPs,
downloadableConfig: 'privateKey' in client,
persistentKeepalive: null,
latestHandshakeAt: null,
transferRx: null,
@ -196,8 +196,9 @@ ${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : ''
const config = await this.getConfig();
const client = await this.getClient({ clientId });
return `[Interface]
PrivateKey = ${client.privateKey}
return `
[Interface]
PrivateKey = ${client.privateKey ? `${client.privateKey}` : 'REPLACE_ME'}
Address = ${client.address}/24
${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}\n` : ''}\
${WG_MTU ? `MTU = ${WG_MTU}\n` : ''}\