wip: wireguard
This commit is contained in:
@@ -283,9 +283,12 @@ function Peers() {
|
||||
const serverAllowedIPs = peer.allowed_ips || "0.0.0.0/0";
|
||||
const privateKey = peer.private_key || 'YOUR_PRIVATE_KEY_HERE';
|
||||
|
||||
// Check if IP already has a subnet mask, if not add /32
|
||||
const peerAddress = peer.ip.includes('/') ? peer.ip : `${peer.ip}/32`;
|
||||
|
||||
return `[Interface]
|
||||
PrivateKey = ${privateKey}
|
||||
Address = ${peer.ip}/32
|
||||
Address = ${peerAddress}
|
||||
DNS = 8.8.8.8, 1.1.1.1
|
||||
|
||||
[Peer]
|
||||
@@ -301,11 +304,14 @@ PersistentKeepalive = ${peer.persistent_keepalive || 25}`;
|
||||
const serverEndpoint = peer.server_endpoint || "YOUR_SERVER_IP:51820";
|
||||
const privateKey = peer.private_key || 'YOUR_PRIVATE_KEY_HERE';
|
||||
|
||||
// Check if IP already has a subnet mask, if not add /32
|
||||
const peerAddress = peer.ip.includes('/') ? peer.ip : `${peer.ip}/32`;
|
||||
|
||||
// Create a config that's compatible with qrencode and mobile apps
|
||||
// Use proper spacing and format that WireGuard apps expect
|
||||
return `[Interface]
|
||||
PrivateKey = ${privateKey}
|
||||
Address = ${peer.ip}/32
|
||||
Address = ${peerAddress}
|
||||
DNS = 8.8.8.8, 1.1.1.1
|
||||
|
||||
[Peer]
|
||||
|
||||
Reference in New Issue
Block a user