Merge pull request #45 from necro-nemesis/master

update to master
exit
necro-nemesis 2 years ago committed by GitHub
commit 537ebfdf8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
![](https://i.imgur.com/2ZrhaiH.png)
# `LabyrinthAP / Lokinet Access Point` [![Release 2.6](https://img.shields.io/badge/Release-2.6-green.svg)](https://github.com/necro-nemesis/raspap-webgui/releases)
# `LabyrinthAP / Lokinet Access Point` [![Release 2.7](https://img.shields.io/badge/Release-2.7-green.svg)](https://github.com/necro-nemesis/raspap-webgui/releases)
LabyrinthAP interfaces with Lokinet daemon to facilitate connections to the Lokinet global privacy network. LabyrinthAP provides a simple, responsive web interface to control wifi, hostapd, Lokinet daemon and related services necessary to access Lokinet on the Raspberry Pi or Orange Pi.

@ -17,7 +17,7 @@ if (empty($interface)) {
} else {
exit('No network interfaces found.');
}
}
}
define('IFNAMSIZ', 16);
if (strlen($interface) > IFNAMSIZ) {
@ -38,10 +38,10 @@ $jsonobj = json_decode($jsonstdoutvnstat[0], true);
$timeunits = filter_input(INPUT_GET, 'tu');
if ($timeunits === 'm') {
// months
$jsonData = $jsonobj['interfaces'][0]['traffic']['months'];
$jsonData = $jsonobj['interfaces'][0]['traffic']['month'];
} else {
// default: days
$jsonData = $jsonobj['interfaces'][0]['traffic']['days'];
$jsonData = $jsonobj['interfaces'][0]['traffic']['day'];
}
$datasizeunits = filter_input(INPUT_GET, 'dsu');
@ -74,14 +74,12 @@ for ($i = count($jsonData) - 1; $i >= 0; --$i) {
}
if ($timeunits === 'm') {
echo '{ "date": "' , $dt->format('Y-m') , '", "rx": "' , $datareceived ,
echo '{ "date": "' , $dt->format('Y-m') , '", "rx": "' , $datareceived ,
'", "tx": "' , $datasend , '" }';
} else {
echo '{ "date": "' , $dt->format('Y-m-d') , '", "rx": "' , $datareceived ,
echo '{ "date": "' , $dt->format('Y-m-d') , '", "rx": "' , $datareceived ,
'", "tx": "' , $datasend , '" }';
}
}
echo ' ]';

@ -1,4 +1,4 @@
<?php
<?php
if (filter_input(INPUT_GET, 'tu') == 'h') {
header('X-Content-Type-Options: nosniff');
@ -40,10 +40,10 @@ if (filter_input(INPUT_GET, 'tu') == 'h') {
}
$jsonobj = json_decode($jsonstdoutvnstat[0], true)['interfaces'][0];
$jsonData = $jsonobj['traffic']['hours'];
$jsonData = $jsonobj['traffic']['hour'];
for ($i = count($jsonData) - 1; $i >= 0; --$i) {
$data_template[$jsonData[$i]['id']]['rx'] = round($jsonData[$i]['rx'] / 1024, 0);
$data_template[$jsonData[$i]['id']]['tx'] = round($jsonData[$i]['tx'] / 1024, 0);
$data_template[$jsonData[$i]['time']['hour']]['rx'] = round($jsonData[$i]['rx'] / 1024, 0);
$data_template[$jsonData[$i]['time']['hour']]['tx'] = round($jsonData[$i]['tx'] / 1024, 0);
}
$data = array();

@ -1,6 +1,6 @@
<?php
define('RASPI_VERSION', '2.6');
define('RASPI_VERSION', '2.7');
define('RASPI_CONFIG', '/etc/raspap');
define('RASPI_CONFIG_NETWORKING',RASPI_CONFIG.'/networking');
define('RASPI_ADMIN_DETAILS', RASPI_CONFIG.'/raspap.auth');

@ -278,16 +278,55 @@ function DisplayLokinetConfig()
</ul>
<!-- Tab panes -->
<div class="tab-content">
<p><?php echo $status; ?></p>
<p><?php echo $status; ?></p>
<p><?php echo "Current Lokinet $lokiversion"; ?></p>
<div class="tab-pane fade in active" id="basic">
<form role="form" action="?page=save_hostapd_conf" method="POST">
<h5>Enter Exit Node Data to activate:</h5>
<label for="exitaddress">Exit Address:</label>
<input type="text" class="form-control" placeholder="enter exit address here" id="exitaddress" name="exitaddress">
<label for="exitaddress">Exit:</label>
<input type="text" class="form-control" list="exitaddresses" placeholder="enter exit address here" id="exitaddress" name="exitaddress" onchange="OnSelectionChange()">
<?php $api_url = 'https://my-json-server.typicode.com/necro-nemesis/exits-api/exits';
// Read JSON file
$json_data = file_get_contents($api_url);
// Decode JSON data into PHP array
$response_data = json_decode($json_data,true);
?>
<datalist id="exitaddresses">
<?php foreach($response_data as $response){
$listedexits = '<option value=\''.$response['exit'].'\'>';
echo $listedexits;
}
?>
</datalist>
<script>
//JSON Authentication Token Handler
async function OnSelectionChange(){
var selection = document.getElementById("exitaddress").value;
const endpoint = 'https://my-json-server.typicode.com/necro-nemesis/exits-api/db';
const response = await fetch(endpoint);
const data = await response.json();
for (var i = 0; i < data['exits'].length; i++) {
if (data['exits'][i]['exit'] == selection) {
const { exit, auth, geo, rate } = data['exits'][i];
console.log('Exit name : ' + exit);
console.log('Exit token : '+ auth);
console.log('Exit location : ' + geo);
console.log('Exit rate : ' + rate);
console.log('Dropdown selection : ' + selection);
alert('EXIT NODE INFORMATION\r\rExit Address : ' + exit + '\rExit Location : ' + geo + '\rExit Autorization Key : ' + auth + '\rMonthly Rate : ' + rate);
document.getElementById("auth").value = auth;
break;
}
}
}
</script>
<label for="exitkey">Exit Key: (optional)</label>
<input type="text" class="form-control" placeholder="enter exit key here" id="exitkey" name="exitkey">
<br/>
<input type="text" class="form-control" id="auth" placeholder="optional exit authorization key" id="exitkey" name="exitkey">
<br/>
<input type="reset" class="btn btn-default" value="Clear">
<?php
if ($exitstatus != "no exits") {
echo '<input type="submit" class="btn btn-danger" name="StopExit" value="Stop Exit" />', PHP_EOL;
@ -323,7 +362,7 @@ function DisplayLokinetConfig()
<?php echo '<input type="submit" class="btn btn-success" name="checkaddress" value="Submit" />',
PHP_EOL; ?><h5><?php echo "Your development support is greatly appreciated <br>Independent LabyrinthAP developer TechnicalTumbleweed's OXEN wallet address:"; ?></h5>
<h5><pre><?php echo "LA8VDcoJgiv2bSiVqyaT6hJ67LXbnQGpf9Uk3zh9ikUKPJUWeYbgsd9gxQ5ptM2hQNSsCaRETQ3GM9FLDe7BGqcm4ve69bh"; ?></pre></h5>
</div>
</div></div>
<?php
}

@ -12,7 +12,7 @@
*
* @author TechnicalTumbleweed (Oxen-> Session Lokinet/Telegram Oxen Community)
* @license GNU General Public License, version 3 (GPL-3.0)
* @version 2.6
* @version 2.7
* @link https://github.com/necro-nemesis/LabyrinthAP
*/

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save