forked from mirrors/amnezia-wg-easy
allow clients with no privateKey
see https://github.com/wg-easy/wg-easy/discussions/791 I disabled the download from the frontend. If someone tries to manually call the API, the privateKey block is set to "REPLACE_ME" to indicate that this value must be set manually.
This commit is contained in:
parent
bfd281fc9f
commit
c7cc3eca4a
4 changed files with 27 additions and 8 deletions
|
@ -141,7 +141,7 @@ AllowedIPs = ${client.address}/32`;
|
|||
createdAt: new Date(client.createdAt),
|
||||
updatedAt: new Date(client.updatedAt),
|
||||
allowedIPs: client.allowedIPs,
|
||||
|
||||
downloadableConfig: 'privateKey' in client,
|
||||
persistentKeepalive: null,
|
||||
latestHandshakeAt: null,
|
||||
transferRx: null,
|
||||
|
@ -198,7 +198,7 @@ AllowedIPs = ${client.address}/32`;
|
|||
|
||||
return `
|
||||
[Interface]
|
||||
PrivateKey = ${client.privateKey}
|
||||
PrivateKey = ${client.privateKey ? `${client.privateKey}` : 'REPLACE_ME'}
|
||||
Address = ${client.address}/24
|
||||
${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}` : ''}
|
||||
${WG_MTU ? `MTU = ${WG_MTU}` : ''}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue