Redirect all lokilaunch.sh commands to /var/lib/lokinet/ directory

pull/26/head
necro-nemesis 6 years ago
parent 33fd287059
commit 527ae42aff

@ -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

@ -602,7 +602,7 @@ function SaveTORAndVPNConfig()
Launching Lokinet.
</div>
<?php
$output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh start');
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh start');
echo "<pre><strong>$output</strong></pre>";
} elseif (isset($_POST['StopDaemon'])) {
?>
@ -615,7 +615,7 @@ function SaveTORAndVPNConfig()
Stopping Lokinet background daemon process.
</div>
<?php
$output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh stop');
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh stop');
echo "<pre><strong>$output</strong></pre>";
} elseif (isset($_POST['GenerateLokinet'])) {
?>
@ -623,7 +623,7 @@ function SaveTORAndVPNConfig()
Generating Lokinet Configuration
</div>
<?php
$output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh gen');
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh gen');
echo "<pre><strong>$output</strong></pre>";
} elseif (isset($_POST['ReGenerateLokinet'])) {
?>
@ -631,7 +631,7 @@ function SaveTORAndVPNConfig()
Regenerating Lokinet Configuration
</div>
<?php
$output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh gen');
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh gen');
echo "<pre><strong>$output</strong></pre>";
} elseif (isset($_POST['ApplyLokinetSettings'])) {
?>
@ -644,7 +644,7 @@ function SaveTORAndVPNConfig()
Stopping Lokinet background daemon process.
</div>
<?php
$output = shell_exec('sudo /home/pi/loki-network/lokilaunch.sh stop');
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh stop');
echo "<pre><strong>$output</strong></pre>";
$bootstrap = $_POST['lokinetbootstrap'];
?>

@ -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"
#

Loading…
Cancel
Save