diff --git a/app/js/custom.js b/app/js/custom.js index 817256a1..e2c89ac6 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -357,7 +357,7 @@ function generateWgKey() { var jsonData = JSON.parse(data); console.log(jsonData); $('#wg-srvpubkey').val(jsonData); - $('#wg-srvpubkey-status').removeClass('check-hidden').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700); + $('#wg-server-pubkey-status').removeClass('check-hidden').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700); }) } diff --git a/config/defaults.json b/config/defaults.json index b02d4022..46fce72c 100644 --- a/config/defaults.json +++ b/config/defaults.json @@ -35,10 +35,15 @@ } }, "wireguard": { - "interface": { - "address": [ "10.3.141.1/24" ], - "listenport": [ "51820" ], - "dns": [ "10.3.141.1" ] + "server": { + "Address": [ "10.3.141.1/24" ], + "ListenPort": [ "51820" ], + "DNS": [ "10.3.141.1" ] + }, + "peer": { + "Endpoint": [ "server ip:53" ], + "AllowedIPs": ["0.0.0.0/0"], + "PersistentKeepalive": [ "15" ] } } } diff --git a/includes/wireguard.php b/includes/wireguard.php index a3772ed9..406172b7 100644 --- a/includes/wireguard.php +++ b/includes/wireguard.php @@ -107,9 +107,9 @@ function DisplayWireGuardConfig() $wg_srvipaddress = ($conf['Address'] == '') ? getDefaultNetValue('wireguard','server','Address') : $conf['Address']; $wg_srvpubkey = $conf['PublicKey']; $wg_srvprivkey = $conf['PrivateKey']; - $wg_endpoint = $conf['Endpoint']; - $wg_allowedips = $conf['AllowedIPs']; - $wg_pkeepalive = $conf['PersistentKeepalive']; + $wg_pendpoint = ($conf['Endpoint'] == '') ? getDefaultNetValue('wireguard','peer','Endpoint') : $conf['Endpoint']; + $wg_pallowedips = ($conf['AllowedIPs'] == '') ? getDefaultNetValue('wireguard','peer','AllowedIPs') : $conf['AllowedIPs']; + $wg_pkeepalive = ($conf['PersistentKeepalive'] == '') ? getDefaultNetValue('wireguard','peer','PersistentKeepalive') : $conf['PersistentKeepalive']; // fetch service status exec('pidof wg-crypt-wg0 | wc -l', $wgstatus); @@ -128,8 +128,8 @@ function DisplayWireGuardConfig() "wg_srvipaddress", "wg_srvpubkey", "wg_srvprivkey", - "wg_endpoint", - "wg_allowedips", + "wg_pendpoint", + "wg_pallowedips", "wg_pkeepalive" ) ); diff --git a/templates/wg/general.php b/templates/wg/general.php index 68edfa5e..3be32e45 100644 --- a/templates/wg/general.php +++ b/templates/wg/general.php @@ -28,7 +28,7 @@
- +
diff --git a/templates/wg/peers.php b/templates/wg/peers.php index 16337a08..2b70680a 100644 --- a/templates/wg/peers.php +++ b/templates/wg/peers.php @@ -16,14 +16,14 @@
- +
- +
@@ -39,15 +39,14 @@
- +
- +
-