1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Define RASPI_DHCPCD_LOG. Resolves #1058

This commit is contained in:
billz 2021-11-17 18:06:43 +00:00
parent a2e1b4bb68
commit f077aedde0
6 changed files with 7 additions and 5 deletions

View File

@ -15,6 +15,7 @@ define('RASPI_ADBLOCK_LISTPATH', '/etc/raspap/adblock/');
define('RASPI_ADBLOCK_CONFIG', RASPI_DNSMASQ_PREFIX.'adblock.conf'); define('RASPI_ADBLOCK_CONFIG', RASPI_DNSMASQ_PREFIX.'adblock.conf');
define('RASPI_HOSTAPD_CONFIG', '/etc/hostapd/hostapd.conf'); define('RASPI_HOSTAPD_CONFIG', '/etc/hostapd/hostapd.conf');
define('RASPI_DHCPCD_CONFIG', '/etc/dhcpcd.conf'); define('RASPI_DHCPCD_CONFIG', '/etc/dhcpcd.conf');
define('RASPI_DHCPCD_LOG', '/var/log/dnsmasq.log'),
define('RASPI_WPA_SUPPLICANT_CONFIG', '/etc/wpa_supplicant/wpa_supplicant.conf'); define('RASPI_WPA_SUPPLICANT_CONFIG', '/etc/wpa_supplicant/wpa_supplicant.conf');
define('RASPI_HOSTAPD_CTRL_INTERFACE', '/var/run/hostapd'); define('RASPI_HOSTAPD_CTRL_INTERFACE', '/var/run/hostapd');
define('RASPI_WPA_CTRL_INTERFACE', '/var/run/wpa_supplicant'); define('RASPI_WPA_CTRL_INTERFACE', '/var/run/wpa_supplicant');

View File

@ -78,7 +78,7 @@ function DisplayAdBlockConfig()
$adblock_custom_content = file_get_contents(RASPI_ADBLOCK_LISTPATH .'custom.txt'); $adblock_custom_content = file_get_contents(RASPI_ADBLOCK_LISTPATH .'custom.txt');
$adblock_log = ''; $adblock_log = '';
exec('sudo chmod o+r /tmp/dnsmasq.log'); exec('sudo chmod o+r'. RASPI_DHCPCD_LOG);
$handle = fopen("/tmp/dnsmasq.log", "r"); $handle = fopen("/tmp/dnsmasq.log", "r");
if ($handle) { if ($handle) {
while (($line = fgets($handle)) !== false) { while (($line = fgets($handle)) !== false) {

View File

@ -20,6 +20,7 @@ $defaults = [
'RASPI_ADBLOCK_CONFIG' => RASPI_DNSMASQ_PREFIX.'adblock.conf', 'RASPI_ADBLOCK_CONFIG' => RASPI_DNSMASQ_PREFIX.'adblock.conf',
'RASPI_HOSTAPD_CONFIG' => '/etc/hostapd/hostapd.conf', 'RASPI_HOSTAPD_CONFIG' => '/etc/hostapd/hostapd.conf',
'RASPI_DHCPCD_CONFIG' => '/etc/dhcpcd.conf', 'RASPI_DHCPCD_CONFIG' => '/etc/dhcpcd.conf',
'RASPI_DHCPCD_LOG' => '/var/log/dnsmasq.log',
'RASPI_WPA_SUPPLICANT_CONFIG' => '/etc/wpa_supplicant/wpa_supplicant.conf', 'RASPI_WPA_SUPPLICANT_CONFIG' => '/etc/wpa_supplicant/wpa_supplicant.conf',
'RASPI_HOSTAPD_CTRL_INTERFACE' => '/var/run/hostapd', 'RASPI_HOSTAPD_CTRL_INTERFACE' => '/var/run/hostapd',
'RASPI_WPA_CTRL_INTERFACE' => '/var/run/wpa_supplicant', 'RASPI_WPA_CTRL_INTERFACE' => '/var/run/wpa_supplicant',

View File

@ -226,7 +226,7 @@ function updateDnsmasqConfig($iface,$status)
// write default 090_raspap.conf // write default 090_raspap.conf
$config = '# RaspAP default config'.PHP_EOL; $config = '# RaspAP default config'.PHP_EOL;
$config .='log-facility=/tmp/dnsmasq.log'.PHP_EOL; $config .='log-facility='.RASPI_DHCPCD_LOG.PHP_EOL;
$config .='conf-dir=/etc/dnsmasq.d'.PHP_EOL; $config .='conf-dir=/etc/dnsmasq.d'.PHP_EOL;
// handle log option // handle log option
if ($_POST['log-dhcp'] == "1") { if ($_POST['log-dhcp'] == "1") {

View File

@ -37,7 +37,7 @@ www-data ALL=(ALL) NOPASSWD:/etc/raspap/hostapd/servicestart.sh
www-data ALL=(ALL) NOPASSWD:/etc/raspap/lighttpd/configport.sh www-data ALL=(ALL) NOPASSWD:/etc/raspap/lighttpd/configport.sh
www-data ALL=(ALL) NOPASSWD:/etc/raspap/openvpn/configauth.sh www-data ALL=(ALL) NOPASSWD:/etc/raspap/openvpn/configauth.sh
www-data ALL=(ALL) NOPASSWD:/bin/chmod o+r /tmp/hostapd.log www-data ALL=(ALL) NOPASSWD:/bin/chmod o+r /tmp/hostapd.log
www-data ALL=(ALL) NOPASSWD:/bin/chmod o+r /tmp/dnsmasq.log www-data ALL=(ALL) NOPASSWD:/bin/chmod o+r /var/log/dnsmasq.log
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dnsmasqdata /etc/dnsmasq.d/090_adblock.conf www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dnsmasqdata /etc/dnsmasq.d/090_adblock.conf
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dnsmasq_custom /etc/raspap/adblock/custom.txt www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dnsmasq_custom /etc/raspap/adblock/custom.txt
www-data ALL=(ALL) NOPASSWD:/etc/raspap/adblock/update_blocklist.sh www-data ALL=(ALL) NOPASSWD:/etc/raspap/adblock/update_blocklist.sh

View File

@ -16,8 +16,8 @@
<div class="form-group col-md-8 mt-2"> <div class="form-group col-md-8 mt-2">
<?php <?php
if ($conf['log-dhcp'] == 1 || $conf['log-queries'] == 1) { if ($conf['log-dhcp'] == 1 || $conf['log-queries'] == 1) {
exec('sudo chmod o+r /tmp/dnsmasq.log'); exec('sudo chmod o+r '.RASPI_DHCPCD_LOG);
$log = file_get_contents('/tmp/dnsmasq.log'); $log = file_get_contents(RASPI_DHCPCD_LOG);
echo '<textarea class="logoutput">'.htmlspecialchars($log, ENT_QUOTES).'</textarea>'; echo '<textarea class="logoutput">'.htmlspecialchars($log, ENT_QUOTES).'</textarea>';
} else { } else {
echo '<textarea class="logoutput my-3"></textarea>'; echo '<textarea class="logoutput my-3"></textarea>';