From 471615ebfa1768aecd263cb52fed616cdb2def00 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 14:37:07 -0400 Subject: [PATCH 01/12] Add exits to script. --- config/lokilaunch.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config/lokilaunch.sh b/config/lokilaunch.sh index a56ffd7..9ae565d 100644 --- a/config/lokilaunch.sh +++ b/config/lokilaunch.sh @@ -37,8 +37,18 @@ bootstrap) systemclt start lokinet ;; +exitup) + lokinet-vpn --up --exit "$2" --token "$3" + echo -n "lokinet-vpn --up --exit ""$2"" --token ""$3" + ;; + +exitdown) + echo -n "Stopping Exit" + lokinet-vpn --down + ;; + *) - echo "Usage: "$1" {start|stop|gen|bootstrap}" + echo "Usage: "$1" {start|stop|gen|bootstrap|exitup|exitdown}" exit 1 ;; esac From 73a16c428f0fee1975a002a9baa14e8c4ea4c637 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 14:47:17 -0400 Subject: [PATCH 02/12] Add initial exit functionality to GUI. --- includes/functions.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index ac0d525..555ec29 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -379,7 +379,7 @@ function DisplayLokinetConfig()
' , PHP_EOL; } else { echo '' , PHP_EOL; @@ -394,9 +394,9 @@ function DisplayLokinetConfig()

Lokient Daemon

-
The 3 buttons below must be armed (red) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be green. The .ini file must be generated prior to connecting to Lokinet by pressing the button which will automatically write the required .ini file. Similarly the absense of a valid bootstrap will be indicated by a green "Bootstrap" button. Applying a bootstrap by pressing the apply button without submitting a valid URL in the textbox area will apply the original default bootstrap in place of one being provided. Stopping the daemon also exits Lokinet. To summarize, if necessary generate the .ini and bootstrap Lokinet then you are able to connect to Lokinet by starting the daemon and letting the network establish itself. +
-
+
The 3 buttons below must be armed (red) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be gre$
@@ -623,6 +623,22 @@ function SaveTORAndVPNConfig() } elseif (isset($_POST['StopDaemon'])) { exec('sudo /var/lib/lokinet/lokilaunch.sh stop'); + //START EXIT + } elseif (isset($_POST['StartExit'])) { + $exit = $_POST['exitaddress']; + $token = $_POST['exitkey']; + $exit=str_replace("'", "", $exit); + $token=str_replace("'", "", $token); + $output = shell_exec("sudo /var/lib/lokinet/lokilaunch.sh exitup '".$exit."''" .$token."'"); + echo "
$output
"; + + //exec ('sudo /var/lib/lokinet/lokilaunch.sh exitup'); + $exitstatus = True; + //STOP EXIT + } elseif (isset($_POST['StopExit'])) { + exec ('sudo /var/lib/lokinet/lokilaunch.sh exitdown'); + $exitstatus = False; + //GENERATE LOKINET.INI } elseif (isset($_POST['GenerateLokinet'])) { ?> From b4a04ea911f593ed2c0b73555462d4cb8f3caf2c Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 17:09:39 -0400 Subject: [PATCH 03/12] Update bootstrap script. --- config/lokilaunch.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/lokilaunch.sh b/config/lokilaunch.sh index 9ae565d..a3a3579 100644 --- a/config/lokilaunch.sh +++ b/config/lokilaunch.sh @@ -30,11 +30,11 @@ case "$1" in bootstrap) echo -n "Lokinet daemon shutdown for bootstrapping\n" systemctl stop lokinet - pidof lokinet >/dev/null && echo "Daemon shutdown failure\n" || echo "Daemon is stopped\n" + pidof lokinet >/dev/null && echo "Daemon shutdown failure" || echo "Daemon is stopped" echo -n "Fetching bootstrap <---- " lokinet-bootstrap "$2" - echo -n "Bootstrapped with ---> $2\n\n" - systemclt start lokinet + systemctl start lokinet + echo -n "Lokinet daemon restarted" ;; exitup) From 2a0d449931d6fe7b0d7079aca6ad3afdd106cca6 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 19:49:38 -0400 Subject: [PATCH 04/12] Use toggle of $exitstatus to cycle exit function. --- includes/functions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 555ec29..b77e20d 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -379,7 +379,8 @@ function DisplayLokinetConfig()
' , PHP_EOL; } else { echo '' , PHP_EOL; @@ -631,13 +632,14 @@ function SaveTORAndVPNConfig() $token=str_replace("'", "", $token); $output = shell_exec("sudo /var/lib/lokinet/lokilaunch.sh exitup '".$exit."''" .$token."'"); echo "
$output
"; + GLOBAL $existatus; + $exitstatus = TRUE; - //exec ('sudo /var/lib/lokinet/lokilaunch.sh exitup'); - $exitstatus = True; //STOP EXIT } elseif (isset($_POST['StopExit'])) { exec ('sudo /var/lib/lokinet/lokilaunch.sh exitdown'); - $exitstatus = False; + GLOBAL $exitstatus; + $exitstatus = FALSE; //GENERATE LOKINET.INI } elseif (isset($_POST['GenerateLokinet'])) { From a5e0b614be592bca0e2a0ca476c2eee5fe008ef5 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 20:05:54 -0400 Subject: [PATCH 05/12] Bump version and update readme. --- README.md | 10 +++++++--- includes/config.php | 2 +- index.php | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5b7e388..579cb8a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ ![](https://i.imgur.com/mXuacOH.jpg) -# `$ Lokiap-webgui` [![Release 1.8](https://img.shields.io/badge/Release-1.8-green.svg)](https://github.com/necro-nemesis/raspap-webgui/releases) +# `$ Lokiap-webgui` [![Release 1.9](https://img.shields.io/badge/Release-1.9-green.svg)](https://github.com/necro-nemesis/raspap-webgui/releases) -LokiAP interfaces witht Lokinet daemon to facilitate connections to the the Lokinet global privacy network. LokiAP 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. +LokiAP interfaces witht Lokinet daemon to facilitate connections to the Lokinet global privacy network. LokiAP 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. ### WHAT IS LOKI? @@ -28,7 +28,7 @@ Loki - [License](#license) ## Prerequisites -Start with a clean install of [Armbian](https://www.armbian.com/) or [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) (currently Buster and Stretch are verified as working). Lite versions are recommended. If using Raspbian Buster you will need to run the command ```sudo apt-get update --allow-releaseinfo-change``` then elevate to root with ```sudo su``` before running the LokiAP installer script. These additional steps are not required when using Armbian. +Start with a clean install of [Armbian](https://www.armbian.com/) or [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) (currently Buster and Stretch are verified as working). Lite versions are recommended as all additional dependencies are added by the installer. If using Raspbian you will need to elevate to root with ```sudo su``` before running the LokiAP installer script. This additional steps is not required when using Armbian. For Orange Pi R1 use Armbian Buster found here: https://www.armbian.com/orange-pi-r1/. Recommend using "minimal" which is available for direct download at the bottom of the page or much faster download by .torrent also linked there. @@ -97,6 +97,10 @@ configured as an access point as follows: To test the connection navigate to Loki's wiki page found at http://dw68y1xhptqbhcm5s8aaaip6dbopykagig5q5u1za4c7pzxto77y.loki/wiki/index.php?title=Main_Page +## Connecting to an Exit Node + +Exit nodes provide privacy on the internet through onion routing connections through the global network of Lokinet relay nodes and dedicated exit nodes. In order to connect to an exit node you will require the exit address from the exit node provider. These can be found through various social media linked at https://loki.network/. From the GUI this information can be entered and activated. + ## Support us LokiAP is free software, but powered by your support. If you find it beneficial or wish to contribute to inspire ongoing development your donations of any amount; be they even symbolic, are a show of approval and are greatly appreciated. diff --git a/includes/config.php b/includes/config.php index eb0a78b..32911e3 100755 --- a/includes/config.php +++ b/includes/config.php @@ -1,6 +1,6 @@ Discord/Telegram) * @license GNU General Public License, version 3 (GPL-3.0) - * @version 1.8 + * @version 1.9 * @link https://github.com/necro-nemesis/Lokiap-webgui */ From aef14f6d9dc3bc6e12d3cbf1a92c0ecd64801aeb Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 20:09:44 -0400 Subject: [PATCH 06/12] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 579cb8a..f7a695f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Loki - [License](#license) ## Prerequisites -Start with a clean install of [Armbian](https://www.armbian.com/) or [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) (currently Buster and Stretch are verified as working). Lite versions are recommended as all additional dependencies are added by the installer. If using Raspbian you will need to elevate to root with ```sudo su``` before running the LokiAP installer script. This additional steps is not required when using Armbian. +Start with a clean install of [Armbian](https://www.armbian.com/) or [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) (currently Buster and Stretch are verified as working). Lite versions are recommended as all additional dependencies are added by the installer. If using Raspbian you will need to elevate to root with ```sudo su``` before running the LokiAP installer script. This additional step is not required when using Armbian. For Orange Pi R1 use Armbian Buster found here: https://www.armbian.com/orange-pi-r1/. Recommend using "minimal" which is available for direct download at the bottom of the page or much faster download by .torrent also linked there. @@ -99,7 +99,7 @@ http://dw68y1xhptqbhcm5s8aaaip6dbopykagig5q5u1za4c7pzxto77y.loki/wiki/index.php? ## Connecting to an Exit Node -Exit nodes provide privacy on the internet through onion routing connections through the global network of Lokinet relay nodes and dedicated exit nodes. In order to connect to an exit node you will require the exit address from the exit node provider. These can be found through various social media linked at https://loki.network/. From the GUI this information can be entered and activated. +Exit nodes provide privacy on the internet through onion routing connections via the global network of Lokinet relay nodes and dedicated exit nodes. In order to connect to an exit node you will require the exit address from the exit node provider. These can be found through various social media linked at https://loki.network/. From the GUI this information can be entered and activated. ## Support us From a226e519ddd1e4063808d198183e29273742e1e9 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 21:32:27 -0400 Subject: [PATCH 07/12] change from url to text input --- includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index b77e20d..88dfc7c 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -374,9 +374,9 @@ function DisplayLokinetConfig()
Enter Exit Node Data to activate:
- + - +
Date: Sat, 3 Oct 2020 21:39:43 -0400 Subject: [PATCH 08/12] clean out ascii color characters from lokinet-bootstrapping. --- includes/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/functions.php b/includes/functions.php index 88dfc7c..66ef41d 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -673,6 +673,7 @@ function SaveTORAndVPNConfig() $output"; } From 9746f9b5f5401a3c91c6e41f7c954d249b895a6b Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 21:44:42 -0400 Subject: [PATCH 09/12] existatus > exitstatus --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 66ef41d..3eee548 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -632,7 +632,7 @@ function SaveTORAndVPNConfig() $token=str_replace("'", "", $token); $output = shell_exec("sudo /var/lib/lokinet/lokilaunch.sh exitup '".$exit."''" .$token."'"); echo "
$output
"; - GLOBAL $existatus; + GLOBAL $exitstatus; $exitstatus = TRUE; //STOP EXIT From 84933bc99ba5db463236b9e99ecc6b2b768eeeb5 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 22:39:56 -0400 Subject: [PATCH 10/12] Update Instructions --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 3eee548..08e5a1b 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -397,7 +397,7 @@ function DisplayLokinetConfig()
-
The 3 buttons below must be armed (red) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be gre$ +
The 3 buttons below must be armed (red) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be green. The .ini file must be generated prior to connecting to Lokinet by pressing the button which will automatically write the required .ini file. Similarly the absense of a valid bootstrap will be indicated by a green "Bootstrap" button. Applying a bootstrap by pressing the apply button without submitting a valid URL in the textbox area will apply the original default bootstrap in place of one being provided. Stopping the daemon also exits Lokinet. To summarize, if necessary generate the .ini and bootstrap Lokinet then you are able to connect to Lokinet by starting the daemon and letting the network establish itself.
From 146729ec706280d05ec75bea5832354cb1626b44 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 22:59:02 -0400 Subject: [PATCH 11/12] move ascii code cleanup --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 08e5a1b..e6bf049 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -673,8 +673,8 @@ function SaveTORAndVPNConfig() $output"; } From 77aac040e6bff2ac9664e177a2b11935cdd2dcb4 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 23:47:07 -0400 Subject: [PATCH 12/12] Replace alerts with messages. --- includes/functions.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index e6bf049..ccddf90 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -346,13 +346,7 @@ function DisplayLokinetConfig() exec('pidof lokinet | wc -l', $lokinetstatus); $rulestate = exec("ip rule show default | grep lokinet | awk {'print $5'}", $output); $lokiversion = exec("dpkg -s lokinet | grep '^Version:'", $output); - if ($lokinetstatus[0] == 0) { - $status = '
Lokinet daemon is not running -
'; - } else { - $status = '
Lokinet daemon is running -
'; - } ?> + ?>
@@ -663,14 +657,6 @@ function SaveTORAndVPNConfig() //APPLY LOKINET-BOOTSTRAP } elseif (isset($_POST['ApplyLokinetSettings'])) { - ?> -
- Stopping Lokinet background daemon process. -
-
- Applying Bootstrap -
-