From 527ae42affa14db794a412f05bb5c9ad2f7f6d66 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Fri, 13 Sep 2019 20:33:00 -0400 Subject: [PATCH] Redirect all lokilaunch.sh commands to /var/lib/lokinet/ directory --- README.md | 2 +- includes/functions.php | 10 +++++----- installers/common.sh | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d77299f..9fb75e4 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Now comes the fun part. For security reasons, the `www-data` user which lighttpd So what I have done is added the `www-data` user to the sudoers file, but with restrictions on what commands the user can run. Add the following to the end of `/etc/sudoers`, substituting your wireless interface for `wlan0` if needed: ```sh -www-data ALL=(ALL) NOPASSWD:/home/pi/loki-network/lokilaunch.sh* +www-data ALL=(ALL) NOPASSWD:/var/lib/lokinet/lokilaunch.sh* www-data ALL=(ALL) NOPASSWD:/sbin/ifdown wlan0 www-data ALL=(ALL) NOPASSWD:/sbin/ifup wlan0 www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wpa_supplicant/wpa_supplicant.conf diff --git a/includes/functions.php b/includes/functions.php index 0f59435..c44f953 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -602,7 +602,7 @@ function SaveTORAndVPNConfig() Launching Lokinet. $output"; } elseif (isset($_POST['StopDaemon'])) { ?> @@ -615,7 +615,7 @@ function SaveTORAndVPNConfig() Stopping Lokinet background daemon process. $output"; } elseif (isset($_POST['GenerateLokinet'])) { ?> @@ -623,7 +623,7 @@ function SaveTORAndVPNConfig() Generating Lokinet Configuration $output"; } elseif (isset($_POST['ReGenerateLokinet'])) { ?> @@ -631,7 +631,7 @@ function SaveTORAndVPNConfig() Regenerating Lokinet Configuration $output"; } elseif (isset($_POST['ApplyLokinetSettings'])) { ?> @@ -644,7 +644,7 @@ function SaveTORAndVPNConfig() Stopping Lokinet background daemon process. $output"; $bootstrap = $_POST['lokinetbootstrap']; ?> diff --git a/installers/common.sh b/installers/common.sh index 84c174f..93df1c6 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -219,7 +219,7 @@ function default_configuration() { 'echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward #RASPAP' '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 \/var\/lib\/lokinet\/.\/lokilaunch.sh start #RASPAP' ) @@ -247,7 +247,7 @@ function patch_system_files() { sudo ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /etc/dhcp/dhclient-enter-hooks.d/ # Set commands array cmds=( - "/home/pi/loki-network/lokilaunch.sh*" + "/var/lib/lokinet/lokilaunch.sh*" #added for forced Lokinet "/sbin/ip" #