From 2dad92b771b1b85ad00d1ef867a61df0ac49cc49 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Mon, 6 May 2019 20:18:34 -0400 Subject: [PATCH 01/24] remove dns no cache --- config/dnsmasq.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/config/dnsmasq.conf b/config/dnsmasq.conf index 0e26b87..4ab35b7 100644 --- a/config/dnsmasq.conf +++ b/config/dnsmasq.conf @@ -1,7 +1,6 @@ interface=wlan0 dhcp-range=10.3.141.1,10.3.141.24,255.255.255.0,12h bind-dynamic -no-negcache server=127.3.2.1 server=127.0.0.1 server=1.1.1.1 From ed614676972b59d8930d27f71d68d845b25e8f0f Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Mon, 6 May 2019 20:20:32 -0400 Subject: [PATCH 02/24] remove iproute2 rules and routes. --- config/lokilaunch.sh | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/config/lokilaunch.sh b/config/lokilaunch.sh index f531b52..f6016dd 100644 --- a/config/lokilaunch.sh +++ b/config/lokilaunch.sh @@ -7,33 +7,11 @@ case "$1" in lokinet > /dev/null 2>&1 & ;; - connect) - ehco -n "rerouted iptables\n" - sudo ip rule add from 10.3.141.1 lookup main prio 1000 - echo -n "added wlan0 address rule\n" - sudo ip rule add from 10.3.141.0/24 lookup lokinet prio 1000 - echo -n "added wifi-clients rule\n" - sleep 3 - sudo ip route add default dev lokitun0 table lokinet - echo -n "added lokitun0 route\n" - echo -n "Restarting DNSMASQ\n" - ;; - stop) echo -n "Stopping LOKINET daemon\n" pkill lokinet ;; -disconnect) - sudo ip rule del from 10.3.141.1 lookup main prio 1000 #LOKIPAP - echo -n "removed wlan0 address rule\n" - sudo ip rule del from 10.3.141.0/24 lookup lokinet prio 1000 #LOKIPAP - echo -n "removed wifi-clients rule\n" - sudo ip route del default dev lokitun0 table lokinet - echo -n "removed lokitun0 route\n" - echo -n "Lokinet terminated - Network encryption services ended\n" - ;; - gen) echo -n "NEW lokinet.ini FILE CREATED\n" lokinet "-g" @@ -53,7 +31,7 @@ bootstrap) ;; *) - echo "Usage: "$1" {start|stop|gen|bootstrap|connect|disconnect}" + echo "Usage: "$1" {start|stop|gen|bootstrap}" exit 1 ;; esac From 952fbd32d5ca3bd7a29c895acfaccfba54bc873f Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Mon, 6 May 2019 20:41:13 -0400 Subject: [PATCH 03/24] remove connect/disconnect lokinet --- includes/functions.php | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index f3f7efd..fc13073 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -352,13 +352,13 @@ function DisplayLokinetConfig() $status = '
Lokinet daemon is running
'; } - if ($rulestate != "lokinet") { + /* if ($rulestate != "lokinet") { $status = '
Not Connected to Lokinet
'; } else { $status = '
Successfully Connected to Lokinet
'; - } + } */ ?>
@@ -389,11 +389,11 @@ function DisplayLokinetConfig() ' , PHP_EOL; } else { echo '' , PHP_EOL; - } + } */ if ($lokinetstatus[0] == 0) { echo '' , PHP_EOL; } else { @@ -614,20 +614,20 @@ function SaveTORAndVPNConfig() Starting Lokinet background daemon process.
$output";*/ + $output = shell_exec('sudo /etc/init.d/dnsmasq stop'); + echo "
$output
"; $output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh start'); echo "
$output
"; - /*$output = shell_exec('sudo /etc/init.d/dnsmasq start'); - echo "
$output
";*/ + $output = shell_exec('sudo /etc/init.d/dnsmasq start'); + echo "
$output
"; } elseif (isset($_POST['StopDaemon'])) { ?>
Exiting Lokinet.
$output"; + /* $output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh disconnect'); + echo "
$output
"; */ ?>
Stopping Lokinet background daemon process. @@ -635,7 +635,7 @@ function SaveTORAndVPNConfig() $output"; - +/* } elseif (isset($_POST['UseLokinet'])) { ?>
@@ -648,13 +648,15 @@ function SaveTORAndVPNConfig() if ($lokinetstatus[0] == 0){ $output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh start'); echo "
$output
"; - } + $output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh connect'); echo "
$output
"; $output = shell_exec('sudo /etc/init.d/dnsmasq start'); # sleep(5); # $output = shell_exec('sudo dnsmasq --interface=wlan0 --bind-interfaces --dhcp-range=10.3.141.0,10.3.141.24,12h --conf-file=/etc/resolv.conf'); echo "
$output
"; +} + } elseif (isset($_POST['ExitLokinet'])) { ?>
@@ -663,7 +665,7 @@ function SaveTORAndVPNConfig() $output"; - +*/ } elseif (isset($_POST['GenerateLokinet'])) { ?>
@@ -686,8 +688,9 @@ function SaveTORAndVPNConfig() Exiting Lokinet.
$output"; +*/ ?>
Stopping Lokinet background daemon process. From 36d99f35810d8708e63d4a5953e3370e044be20d Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Mon, 6 May 2019 20:48:20 -0400 Subject: [PATCH 04/24] change redundant message to be more informative. --- config/lokilaunch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/lokilaunch.sh b/config/lokilaunch.sh index f6016dd..46205d3 100644 --- a/config/lokilaunch.sh +++ b/config/lokilaunch.sh @@ -8,7 +8,7 @@ case "$1" in ;; stop) - echo -n "Stopping LOKINET daemon\n" + echo -n "daemon stop command sent\n" pkill lokinet ;; From 463d9b66db06866d74bbc4dab7f6a84e319483ad Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Mon, 6 May 2019 20:48:49 -0400 Subject: [PATCH 05/24] clean up messages sent. --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index fc13073..6ed9d75 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -611,7 +611,7 @@ function SaveTORAndVPNConfig() } elseif (isset($_POST['StartDaemon'])) { ?>
- Starting Lokinet background daemon process. + Launching Lokinet.
Date: Mon, 6 May 2019 20:53:52 -0400 Subject: [PATCH 06/24] Instruction re-write for 3 button operation. --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 6ed9d75..9c0f75a 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -379,7 +379,7 @@ function DisplayLokinetConfig()

-
All 4 buttons below must be active (green) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be red. The .ini file must be generated first by pressing the button. Similarly the absense of a valid bootstrap will be indicated by the red "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. If you simply exit Lokinet the daemon is left running in the background. So in summary if necessary generate the .ini and bootstrap then you are able to connect to lokinet and the daemon will be started. +
The 3 buttons below must be active (green) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be red. 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 the red "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 634bdd8fe462d9f3e8df3e2e01beafee584a1972 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Mon, 6 May 2019 20:56:35 -0400 Subject: [PATCH 07/24] Edit instructions to some form of English. --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 9c0f75a..f6bc891 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -379,7 +379,7 @@ function DisplayLokinetConfig()

-
The 3 buttons below must be active (green) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be red. 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 the red "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 active (green) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be red. 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 red "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 5e520db3c03e07e21f354341fa945401637dd212 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Mon, 6 May 2019 21:02:45 -0400 Subject: [PATCH 08/24] comment out removed command to 'connect' to lokinet. --- installers/common.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 5c20e0c..8e45602 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -1,4 +1,3 @@ -# test staging push raspap_dir="/etc/raspap" raspap_user="www-data" version=`sed 's/\..*//' /etc/debian_version` @@ -213,7 +212,7 @@ function default_configuration() { 'iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP' 'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP' 'sudo \/home\/pi\/loki-network\/.\/lokilaunch.sh start #RASPAP' - 'sudo \/home\/pi\/loki-network\/.\/lokilaunch.sh connect #RASPAP' + # 'sudo \/home\/pi\/loki-network\/.\/lokilaunch.sh connect #RASPAP' ) From 24dc82ac6839a934f3ae3b4b782f1fffcdaefd79 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 10:23:13 -0400 Subject: [PATCH 09/24] Install configure resolvconf --- config/head | 1 + config/rt_tables | 12 ------------ installers/common.sh | 5 ++--- installers/raspbian.sh | 2 +- 4 files changed, 4 insertions(+), 16 deletions(-) create mode 100644 config/head delete mode 100644 config/rt_tables diff --git a/config/head b/config/head new file mode 100644 index 0000000..471ca1b --- /dev/null +++ b/config/head @@ -0,0 +1 @@ +nameserver 127.3.2.1 diff --git a/config/rt_tables b/config/rt_tables deleted file mode 100644 index 4d9087d..0000000 --- a/config/rt_tables +++ /dev/null @@ -1,12 +0,0 @@ -# -# reserved values -# -2 lokinet -255 local -254 main -253 default -0 unspec -# -# local -# -#1 inr.ruhep diff --git a/installers/common.sh b/installers/common.sh index 8e45602..89fb6d7 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -196,14 +196,14 @@ function default_configuration() { sudo mv $webroot_dir/config/hostapd.conf /etc/hostapd/hostapd.conf || install_error "Unable to move hostapd configuration file" sudo mv $webroot_dir/config/dnsmasq.conf /etc/dnsmasq.conf || install_error "Unable to move dnsmasq configuration file" sudo mv $webroot_dir/config/dhcpcd.conf /etc/dhcpcd.conf || install_error "Unable to move dhcpcd configuration file" - sudo mv $webroot_dir/config/rt_tables /etc/iproute2/ || install_error "Unable to move dhcpcd configuration file" + sudo mv $webroot_dir/config/head /etc/resolvconf/resolvconf.d/ || install_error "Unable to move resolvconf head file" + sudo resolvconf -u || install_error "Unable to update resolv.conf" # LokiPAP Batch file relocation and permissions in user loki-network directory sudo mv $webroot_dir/config/lokilaunch.sh $HOME/loki-network/ || install error "Unable to move, install Lokinet first" sudo chmod 755 $HOME/loki-network/lokilaunch.sh - # sudo chown $raspap_user:$raspap_user lokilaunch.sh # Generate required lines for Rasp AP to place into rc.local file. # #RASPAP is for removal script @@ -212,7 +212,6 @@ function default_configuration() { 'iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP' 'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP' 'sudo \/home\/pi\/loki-network\/.\/lokilaunch.sh start #RASPAP' - # 'sudo \/home\/pi\/loki-network\/.\/lokilaunch.sh connect #RASPAP' ) diff --git a/installers/raspbian.sh b/installers/raspbian.sh index 944e037..759c0c5 100755 --- a/installers/raspbian.sh +++ b/installers/raspbian.sh @@ -9,7 +9,7 @@ function update_system_packages() { function install_dependencies() { install_log "Installing required packages" - sudo apt-get install lighttpd $php_package git hostapd dnsmasq vnstat || install_error "Unable to install dependencies" + sudo apt-get install lighttpd $php_package git hostapd dnsmasq vnstat resolvconf || install_error "Unable to install dependencies" } install_raspap From 9ce45057ed3aa529fca7b0beb7b493bf7f87505f Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 10:28:26 -0400 Subject: [PATCH 10/24] correct head file directory --- installers/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/common.sh b/installers/common.sh index 89fb6d7..be2637f 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -196,7 +196,7 @@ function default_configuration() { sudo mv $webroot_dir/config/hostapd.conf /etc/hostapd/hostapd.conf || install_error "Unable to move hostapd configuration file" sudo mv $webroot_dir/config/dnsmasq.conf /etc/dnsmasq.conf || install_error "Unable to move dnsmasq configuration file" sudo mv $webroot_dir/config/dhcpcd.conf /etc/dhcpcd.conf || install_error "Unable to move dhcpcd configuration file" - sudo mv $webroot_dir/config/head /etc/resolvconf/resolvconf.d/ || install_error "Unable to move resolvconf head file" + sudo mv $webroot_dir/config/head /etc/resolvconf/resolvconf.d/head || install_error "Unable to move resolvconf head file" sudo resolvconf -u || install_error "Unable to update resolv.conf" From 94b04d422f46331c193a10078144cedc8f1ba895 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 10:35:36 -0400 Subject: [PATCH 11/24] correct directory for resolv.conf.d --- installers/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/common.sh b/installers/common.sh index be2637f..90faba4 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -196,7 +196,7 @@ function default_configuration() { sudo mv $webroot_dir/config/hostapd.conf /etc/hostapd/hostapd.conf || install_error "Unable to move hostapd configuration file" sudo mv $webroot_dir/config/dnsmasq.conf /etc/dnsmasq.conf || install_error "Unable to move dnsmasq configuration file" sudo mv $webroot_dir/config/dhcpcd.conf /etc/dhcpcd.conf || install_error "Unable to move dhcpcd configuration file" - sudo mv $webroot_dir/config/head /etc/resolvconf/resolvconf.d/head || install_error "Unable to move resolvconf head file" + sudo mv $webroot_dir/config/head /etc/resolvconf/resolv.conf.d/head || install_error "Unable to move resolvconf head file" sudo resolvconf -u || install_error "Unable to update resolv.conf" From b86bd92e5d152590ec6605835552f540621b8b28 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:06:59 -0400 Subject: [PATCH 12/24] Modify installer to copy over scripts to root and chmod. Add visudo to /sbin/ip --- installers/common.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 90faba4..345c22c 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -200,11 +200,26 @@ function default_configuration() { sudo resolvconf -u || install_error "Unable to update resolv.conf" - # LokiPAP Batch file relocation and permissions in user loki-network directory + # LokiPAP Batch file relocation and permissions in user loki-network directory + + sudo mv $webroot_dir/config/lokilaunch.sh $HOME/loki-network/ || install error "Unable to move lokilaunch.sh, install Lokinet first" + + # Forces all traffic through Lokinet (drop scripts into root's .lokinet folder) + + sudo mv $webroot_dir/config/on-up.sh /.lokinet/ || install error "Unable to move on-up.sh, install Lokinet first" + sudo mv $webroot_dir/config/on-down.sh /.lokinet/ || install error "Unable to move on-down.sh, install Lokinet first" + sudo mv $webroot_dir/config/on-ready.sh /.lokinet/ || install error "Unable to move on-ready, install Lokinet first" + + #changes persmission on lokilaunch.sh - sudo mv $webroot_dir/config/lokilaunch.sh $HOME/loki-network/ || install error "Unable to move, install Lokinet first" sudo chmod 755 $HOME/loki-network/lokilaunch.sh + # Forces all traffic through Lokinet (change permissions) + + sudo chmod 755 /.lokinet/on-up.sh + sudo chmod 755 /.lokinet/on-down.sh + sudo chmod 755 /.lokinet/on-ready.sh + # Generate required lines for Rasp AP to place into rc.local file. # #RASPAP is for removal script lines=( @@ -213,7 +228,6 @@ function default_configuration() { 'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP' 'sudo \/home\/pi\/loki-network\/.\/lokilaunch.sh start #RASPAP' - ) for line in "${lines[@]}"; do @@ -241,6 +255,9 @@ function patch_system_files() { # Set commands array cmds=( "/home/pi/loki-network/lokilaunch.sh*" + #added for forced Lokinet + "/sbin/ip" + # "/sbin/ifdown" "/sbin/ifup" "/bin/cat /etc/wpa_supplicant/wpa_supplicant.conf" From b920234cd4b72610e9938d7e38029c3e4d2045e4 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:07:49 -0400 Subject: [PATCH 13/24] Create on-up.sh for addition by installer --- config/on-up.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 config/on-up.sh diff --git a/config/on-up.sh b/config/on-up.sh new file mode 100644 index 0000000..f1b354b --- /dev/null +++ b/config/on-up.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -x +gateway_route=$(ip route | grep ^default | grep via | head -n1) +gateway_addr=$(echo "$gateway_route" | cut -d' ' -f3 ) +for addr in $STRICT_CONNECT_ADDRS ; do + sudo ip route add $(echo $addr | cut -d':' -f 1) via $gateway_addr +done +sudo ip route del $gateway_route +sudo ip route add default dev lokitun0 +cat < /.lokinet/on-down.sh +#!/usr/bin/env bash +set -x +for addr in \$STRICT_CONNECT_ADDRS ; do + sudo ip route del \$(echo \$addr | cut -d':' -f 1) via $gateway_addr +done +sudo ip route del default dev lokitun0 +sudo ip route add $gateway_route + +EOF +chmod +x /.lokinet/on-down.sh From 0a41dd1de335b4dd7c00ad35e5a8a29beeb39250 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:08:20 -0400 Subject: [PATCH 14/24] Create on-ready.sh for addition by installer --- config/on-ready.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 config/on-ready.sh diff --git a/config/on-ready.sh b/config/on-ready.sh new file mode 100644 index 0000000..e69de29 From f5a6498be41ce76219f659a49caa1d38db12cbf8 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:08:40 -0400 Subject: [PATCH 15/24] Create on-down.sh for addition by installer --- config/on-down.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 config/on-down.sh diff --git a/config/on-down.sh b/config/on-down.sh new file mode 100644 index 0000000..e69de29 From ff53f01531d45ed0669c206b1bcda0600f52f690 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:34:14 -0400 Subject: [PATCH 16/24] add bash content --- config/on-down.sh | 2 ++ config/on-ready.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/config/on-down.sh b/config/on-down.sh index e69de29..e6ddd10 100644 --- a/config/on-down.sh +++ b/config/on-down.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +# this will be overriden by on-up.sh diff --git a/config/on-ready.sh b/config/on-ready.sh index e69de29..c8c20ff 100644 --- a/config/on-ready.sh +++ b/config/on-ready.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +notify-send "$@ Our Loki Address $LOKINET_ADDR is ready on address $IF_ADDR on $IF_NAME" From 4922030246a2a0bd4b21fb7e4d5f9f4e19c91c2f Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:38:25 -0400 Subject: [PATCH 17/24] fix install path --- installers/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 345c22c..8f0b13c 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -206,9 +206,9 @@ function default_configuration() { # Forces all traffic through Lokinet (drop scripts into root's .lokinet folder) - sudo mv $webroot_dir/config/on-up.sh /.lokinet/ || install error "Unable to move on-up.sh, install Lokinet first" - sudo mv $webroot_dir/config/on-down.sh /.lokinet/ || install error "Unable to move on-down.sh, install Lokinet first" - sudo mv $webroot_dir/config/on-ready.sh /.lokinet/ || install error "Unable to move on-ready, install Lokinet first" + sudo mv $webroot_dir/config/on-up.sh /.lokinet/on-up.sh || install error "Unable to move on-up.sh, install Lokinet first" + sudo mv $webroot_dir/config/on-down.sh /.lokinet/on-down.sh || install error "Unable to move on-down.sh, install Lokinet first" + sudo mv $webroot_dir/config/on-ready.sh /.lokinet/on-ready.sh || install error "Unable to move on-ready.sh, install Lokinet first" #changes persmission on lokilaunch.sh From a934ed3b759895450494ad95ff3a3f1d4521d6a0 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:48:26 -0400 Subject: [PATCH 18/24] try it again with feeling --- installers/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 8f0b13c..09452d7 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -206,9 +206,9 @@ function default_configuration() { # Forces all traffic through Lokinet (drop scripts into root's .lokinet folder) - sudo mv $webroot_dir/config/on-up.sh /.lokinet/on-up.sh || install error "Unable to move on-up.sh, install Lokinet first" - sudo mv $webroot_dir/config/on-down.sh /.lokinet/on-down.sh || install error "Unable to move on-down.sh, install Lokinet first" - sudo mv $webroot_dir/config/on-ready.sh /.lokinet/on-ready.sh || install error "Unable to move on-ready.sh, install Lokinet first" + sudo mv $webroot_dir/config/on-up.sh /root/.lokinet/on-up.sh || install error "Unable to move on-up.sh, install Lokinet first" + sudo mv $webroot_dir/config/on-down.sh /root/.lokinet/on-down.sh || install error "Unable to move on-down.sh, install Lokinet first" + sudo mv $webroot_dir/config/on-ready.sh /root/.lokinet/on-ready.sh || install error "Unable to move on-ready.sh, install Lokinet first" #changes persmission on lokilaunch.sh From f58b41c5821a650a1048e76f099e4e141ddb5b3f Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:51:58 -0400 Subject: [PATCH 19/24] chmod 755 on-*.sh's --- installers/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 09452d7..55ee5d0 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -216,9 +216,9 @@ function default_configuration() { # Forces all traffic through Lokinet (change permissions) - sudo chmod 755 /.lokinet/on-up.sh - sudo chmod 755 /.lokinet/on-down.sh - sudo chmod 755 /.lokinet/on-ready.sh + sudo chmod 755 /root/.lokinet/on-up.sh + sudo chmod 755 /root/.lokinet/on-down.sh + sudo chmod 755 /root/.lokinet/on-ready.sh # Generate required lines for Rasp AP to place into rc.local file. # #RASPAP is for removal script From 1ca877390d899fb779a89c2bd6c2beadb39cba10 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Tue, 7 May 2019 17:53:56 -0400 Subject: [PATCH 20/24] modify to /root/.lokinet/on-down to conform to AP requirements --- config/on-up.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/on-up.sh b/config/on-up.sh index f1b354b..6eefab0 100644 --- a/config/on-up.sh +++ b/config/on-up.sh @@ -7,7 +7,7 @@ for addr in $STRICT_CONNECT_ADDRS ; do done sudo ip route del $gateway_route sudo ip route add default dev lokitun0 -cat < /.lokinet/on-down.sh +cat < /root/.lokinet/on-down.sh #!/usr/bin/env bash set -x for addr in \$STRICT_CONNECT_ADDRS ; do @@ -17,4 +17,4 @@ sudo ip route del default dev lokitun0 sudo ip route add $gateway_route EOF -chmod +x /.lokinet/on-down.sh +chmod +x /root/.lokinet/on-down.sh From 1d77778b99cfaec200744f434c8a66c629a24842 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Sun, 11 Aug 2019 21:25:18 -0400 Subject: [PATCH 21/24] Add Buster support --- installers/common.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 55ee5d0..bf872f6 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -1,24 +1,29 @@ raspap_dir="/etc/raspap" raspap_user="www-data" +webroot_dir="/var/www/html" version=`sed 's/\..*//' /etc/debian_version` # Determine version, set default home location for lighttpd and # php package to install -webroot_dir="/var/www/html" -if [ $version -eq 9 ]; then - version_msg="Raspian 9.0 (Stretch)" +if [ $version -eq 10 ]; then + version_msg="Raspbian 10.0 (Buster)" + php_package="php7.1-cgi" +elif [ $version -eq 9 ]; then + version_msg="Raspbian 9.0 (Stretch)" php_package="php7.0-cgi" elif [ $version -eq 8 ]; then - version_msg="Raspian 8.0 (Jessie)" + version_msg="Raspbian 8.0 (Jessie)" php_package="php5-cgi" else - version_msg="Raspian earlier than 8.0 (Wheezy)" + version_msg="Raspbian earlier than 8.0 (Wheezy)" webroot_dir="/var/www" php_package="php5-cgi" fi phpcgiconf="" -if [ "$php_package" = "php7.0-cgi" ]; then +if [ "$php_package" = "php7.1-cgi" ]; then + phpcgiconf="/etc/php/7.1/cgi/php.ini" +elif [ "$php_package" = "php7.0-cgi" ]; then phpcgiconf="/etc/php/7.0/cgi/php.ini" elif [ "$php_package" = "php5-cgi" ]; then phpcgiconf="/etc/php5/cgi/php.ini" From 3a11d501f0912d39d8a179d04fc91c02f57ff5cd Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Thu, 12 Sep 2019 06:23:06 -0400 Subject: [PATCH 22/24] Direct all .loki dns lookups to Lokinet --- config/dnsmasq.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/dnsmasq.conf b/config/dnsmasq.conf index 4ab35b7..f152e8b 100644 --- a/config/dnsmasq.conf +++ b/config/dnsmasq.conf @@ -1,6 +1,5 @@ interface=wlan0 dhcp-range=10.3.141.1,10.3.141.24,255.255.255.0,12h bind-dynamic -server=127.3.2.1 +server=/loki/127.3.2.1 server=127.0.0.1 -server=1.1.1.1 From a7abf488cf189ba8f82b9b9c8562e48e6ec01a40 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Thu, 12 Sep 2019 06:48:39 -0400 Subject: [PATCH 23/24] Change default seed address placeholder to current valid one --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index f6bc891..3e8d608 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -386,7 +386,7 @@ function DisplayLokinetConfig()
Enter a valid bootstrap url below and apply to overwrite the current bootstrap:
- + Date: Thu, 12 Sep 2019 07:07:56 -0400 Subject: [PATCH 24/24] Remove stop and restart of DNSMasq when launching lokinet daemon --- includes/functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 3e8d608..9a5b97f 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -614,12 +614,14 @@ function SaveTORAndVPNConfig() Launching Lokinet.
$output"; +*/ $output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh start'); echo "
$output
"; - $output = shell_exec('sudo /etc/init.d/dnsmasq start'); +/* $output = shell_exec('sudo /etc/init.d/dnsmasq start'); echo "
$output
"; +*/ } elseif (isset($_POST['StopDaemon'])) { ?>