wip: wireguard

This commit is contained in:
Cloud
2025-09-14 03:31:14 -05:00
parent 5bd7443681
commit bb6ccfe023
8 changed files with 1468 additions and 91 deletions
+8 -2
View File
@@ -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]