diff --git a/config/blocklists.json b/config/blocklists.json new file mode 100644 index 00000000..6a4ea178 --- /dev/null +++ b/config/blocklists.json @@ -0,0 +1,5 @@ +{ + "notracking/hosts-blocklist": [ + "notracking-master" + ] +} diff --git a/config/config.php b/config/config.php index 9966bd93..479419d1 100755 --- a/config/config.php +++ b/config/config.php @@ -30,6 +30,7 @@ define('RASPI_WIFICLIENT_ENABLED', true); define('RASPI_HOTSPOT_ENABLED', true); define('RASPI_NETWORK_ENABLED', true); define('RASPI_DHCP_ENABLED', true); +define('RASPI_ADBLOCK_ENABLED', true); define('RASPI_OPENVPN_ENABLED', false); define('RASPI_TORPROXY_ENABLED', false); define('RASPI_CONFAUTH_ENABLED', true); diff --git a/includes/adblock.php b/includes/adblock.php new file mode 100644 index 00000000..b4da1a58 --- /dev/null +++ b/includes/adblock.php @@ -0,0 +1,35 @@ + 0); + $serviceStatus = $dnsmasq_state ? "up" : "down"; + + echo renderTemplate( + "adblock", compact( + "status", + "serviceStatus" + ) + ); +} + +/** + * BZ: todo + * + */ +function SaveAdBlockConfig() +{ + +} diff --git a/includes/defaults.php b/includes/defaults.php index a3e7374c..36147b91 100755 --- a/includes/defaults.php +++ b/includes/defaults.php @@ -31,6 +31,7 @@ $defaults = [ 'RASPI_HOTSPOT_ENABLED' => true, 'RASPI_NETWORK_ENABLED' => true, 'RASPI_DHCP_ENABLED' => true, + 'RASPI_ADBLOCK_ENABLED' => true, 'RASPI_OPENVPN_ENABLED' => false, 'RASPI_TORPROXY_ENABLED' => false, 'RASPI_CONFAUTH_ENABLED' => true, diff --git a/includes/functions.php b/includes/functions.php index e177aa52..0386ef63 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -352,6 +352,12 @@ function dnsServers() return (array) $data; } +function blocklistProviders() +{ + $data = json_decode(file_get_contents("./config/blocklists.json")); + return (array) $data; +} + function optionsForSelect($options) { $html = ""; diff --git a/index.php b/index.php index 4ba4e760..7dcdacb8 100755 --- a/index.php +++ b/index.php @@ -31,6 +31,7 @@ require_once 'includes/authenticate.php'; require_once 'includes/admin.php'; require_once 'includes/dhcp.php'; require_once 'includes/hostapd.php'; +require_once 'includes/adblock.php'; require_once 'includes/system.php'; require_once 'includes/sysstats.php'; require_once 'includes/configure_client.php'; @@ -137,6 +138,11 @@ $bridgedEnabled = $arrHostapdConf['BridgedEnable'];