Merge pull request #9 from necro-nemesis/Customization

Lokinet Configuration editable
pull/11/head
necro-nemesis 5 years ago committed by GitHub
commit dabf8b6355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,10 +14,11 @@ define('RASPI_HOSTAPD_CONFIG', '/etc/hostapd/hostapd.conf');
define('RASPI_WPA_SUPPLICANT_CONFIG', '/etc/wpa_supplicant/wpa_supplicant.conf');
define('RASPI_HOSTAPD_CTRL_INTERFACE', '/var/run/hostapd');
define('RASPI_WPA_CTRL_INTERFACE', '/var/run/wpa_supplicant');
define('RASPI_LOKINET_ENABLED', true );
define('RASPI_LOKINET_CONFIG', '~/.lokinet');
define('RASPI_OPENVPN_CLIENT_CONFIG', '/etc/openvpn/client.conf');
define('RASPI_OPENVPN_SERVER_CONFIG', '/etc/openvpn/server.conf');
define('RASPI_TORPROXY_CONFIG', '/etc/tor/torrc');
define('RASPI_LOKINET_CONFIG', '~/.lokinet');
// Optional services, set to true to enable.
define('RASPI_WIFICLIENT_ENABLED', true );
@ -25,14 +26,11 @@ define('RASPI_HOTSPOT_ENABLED', true );
define('RASPI_NETWORK_ENABLED', true );
define('RASPI_DHCP_ENABLED', true );
define('RASPI_OPENVPN_ENABLED', false );
define('RASPI_TORPROXY_ENABLED', true );
define('RASPI_TORPROXY_ENABLED', false );
define('RASPI_CONFAUTH_ENABLED', true );
define('RASPI_CHANGETHEME_ENABLED', true );
define('RASPI_VNSTAT_ENABLED', true );
define('RASPI_LOKINET_ENABLED', true );
// Locale settings
define('LOCALE_ROOT', 'locale');
define('LOCALE_DOMAIN', 'messages');

@ -324,19 +324,20 @@ function DisplayOpenVPNConfig() {
*
*
*/
function DisplayTorProxyConfig(){
/*LOKINET FUNCTIONS ADDED HERE*/
function DisplayLokinetConfig(){
exec( 'cat '. RASPI_TORPROXY_CONFIG, $return );
exec( 'pidof tor | wc -l', $torproxystatus);
exec( 'pidof lokinet | wc -l', $lokinetstatus);
if( $torproxystatus[0] == 0 ) {
$status = '<div class="alert alert-warning alert-dismissable">TOR is not running
if( $lokinetstatus[0] == 0 ) {
$status = '<div class="alert alert-warning alert-dismissable">Lokinet daemon is not running
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
} else {
$status = '<div class="alert alert-success alert-dismissable">TOR is running
$status = '<div class="alert alert-success alert-dismissable">Lokinet is running
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
}
$arrConfig = array();
foreach( $return as $a ) {
if( $a[0] != "#" ) {
@ -466,46 +467,7 @@ function DisplayTorProxyConfig(){
*
*
*/
function SaveTORAndVPNConfig(){
if( isset($_POST['SaveOpenVPNSettings']) ) {
// TODO
} elseif( isset($_POST['SaveTORProxySettings']) ) {
// TODO
} elseif( isset($_POST['StartOpenVPN']) ) {
echo "Attempting to start openvpn";
exec( 'sudo /etc/init.d/openvpn start', $return );
foreach( $return as $line ) {
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
}
} elseif( isset($_POST['StopOpenVPN']) ) {
echo "Attempting to stop openvpn";
exec( 'sudo /etc/init.d/openvpn stop', $return );
foreach( $return as $line ) {
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
}
} elseif( isset($_POST['StartTOR']) ) {
echo "Attempting to start TOR";
exec( 'sudo /etc/init.d/tor start', $return );
foreach( $return as $line ) {
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
}
} elseif( isset($_POST['StopTOR']) ) {
echo "Attempting to stop TOR";
exec( 'sudo /etc/init.d/tor stop', $return );
foreach( $return as $line ) {
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
}
}
}
/**
LOKINET FUNCTIONS ADDED HERE TO END
function DisplayLokinetConfig(){
function DisplayTorProxyConfig(){
exec( 'cat '. RASPI_TORPROXY_CONFIG, $return );
exec( 'pidof tor | wc -l', $torproxystatus);
@ -643,7 +605,10 @@ function DisplayLokinetConfig(){
<?php
}
/**
*
*
*/
function SaveTORAndVPNConfig(){
if( isset($_POST['SaveOpenVPNSettings']) ) {
// TODO
@ -673,6 +638,5 @@ function SaveTORAndVPNConfig(){
foreach( $return as $line ) {
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
}
}
}
}
**/

Loading…
Cancel
Save