fix(wireguard): исправить endpoint и поля клиентского шаблона
This commit is contained in:
1 parent
206255b856
commit
c82e8fa12b
13 files changed
+128
-29
No files matched your search
+5
-2
@@ -324,13 +324,16 @@ export function generatePeerClientConf(args: {
|
||||
const lines: string[] = []
|
||||
lines.push(`[Interface]`)
|
||||
lines.push(`# PrivateKey = <ключ клиента>`)
|
||||
if (args.peerAddress) lines.push(`Address = ${args.peerAddress}`)
|
||||
if (args.peerAddress?.trim()) lines.push(`Address = ${args.peerAddress.trim()}`)
|
||||
else lines.push(`# Address = <укажите адрес клиента>`)
|
||||
if (args.peerDns) lines.push(`DNS = ${args.peerDns}`)
|
||||
lines.push(``)
|
||||
lines.push(`[Peer]`)
|
||||
lines.push(`PublicKey = ${args.serverPublicKey}`)
|
||||
lines.push(`AllowedIPs = ${(args.allowedIps?.length ? args.allowedIps : ["0.0.0.0/0"]).join(", ")}`)
|
||||
if (args.allowedIps?.length) lines.push(`AllowedIPs = ${args.allowedIps.join(", ")}`)
|
||||
else lines.push(`# AllowedIPs = <укажите сети через туннель>`)
|
||||
if (args.endpoint) lines.push(`Endpoint = ${args.endpoint}`)
|
||||
else lines.push(`# Endpoint = <укажите адрес сервера и порт>`)
|
||||
if (args.persistentKeepalive != null && args.persistentKeepalive > 0) {
|
||||
lines.push(`PersistentKeepalive = ${args.persistentKeepalive}`)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user