Merge branch 'master' into feat-cidr-notation

This commit is contained in:
Philip H 2024-03-14 13:49:26 +01:00 committed by GitHub
commit 68187e07a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 161 additions and 46 deletions

View file

@ -148,7 +148,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,
@ -203,8 +203,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}/${client.cidrBlock}
${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}\n` : ''}\
${WG_MTU ? `MTU = ${WG_MTU}\n` : ''}\