mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
terorero merge fix
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.DS_Store
|
||||||
|
config/pialert.conf_
|
||||||
|
db/
|
||||||
@@ -100,8 +100,6 @@ With the work of [jokob-sk/Pi.Alert](https://github.com/jokob-sk/Pi.Alert) and o
|
|||||||
|
|
||||||
![Maintain screen dark][maintain_dark]
|
![Maintain screen dark][maintain_dark]
|
||||||
|
|
||||||
In addition, the network page was created from this collaboration. Here you can map your network in a rudimentary way by assigning the devices to specific nodes (switches, routers).
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
Initially designed to run on a Raspberry Pi, probably it can run on many other
|
Initially designed to run on a Raspberry Pi, probably it can run on many other
|
||||||
@@ -202,5 +200,6 @@ Instructions for [leiweibau's fork](https://github.com/leiweibau/Pi.Alert/)
|
|||||||
[screen6]: ./docs/img/2_5_device_nmap_ready.jpg "Screen 6"
|
[screen6]: ./docs/img/2_5_device_nmap_ready.jpg "Screen 6"
|
||||||
[report1]: ./docs/img/4_report_1.jpg "Report sample 1"
|
[report1]: ./docs/img/4_report_1.jpg "Report sample 1"
|
||||||
[report2]: ./docs/img/4_report_2.jpg "Report sample 2"
|
[report2]: ./docs/img/4_report_2.jpg "Report sample 2"
|
||||||
|
[main_dark]: /docs/img/1_devices_dark.jpg "Main screen dark"
|
||||||
[maintain_dark]: /docs/img/5_maintain.jpg "Maintain screen dark"
|
[maintain_dark]: /docs/img/5_maintain.jpg "Maintain screen dark"
|
||||||
|
|
||||||
|
|||||||
@@ -7,17 +7,16 @@
|
|||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
# General Settings
|
|
||||||
# ----------------------
|
|
||||||
PIALERT_PATH = '/home/pi/pialert'
|
PIALERT_PATH = '/home/pi/pialert'
|
||||||
DB_PATH = PIALERT_PATH + '/db/pialert.db'
|
DB_PATH = PIALERT_PATH + '/db/pialert.db'
|
||||||
LOG_PATH = PIALERT_PATH + '/log'
|
LOG_PATH = PIALERT_PATH + '/log'
|
||||||
VENDORS_DB = '/usr/share/arp-scan/ieee-oui.txt'
|
VENDORS_DB = '/usr/share/arp-scan/ieee-oui.txt'
|
||||||
PRINT_LOG = False
|
PRINT_LOG = False
|
||||||
|
TIMEZONE = 'Europe/Berlin'
|
||||||
PIALERT_WEB_PROTECTION = False
|
PIALERT_WEB_PROTECTION = False
|
||||||
PIALERT_WEB_PASSWORD = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'
|
PIALERT_WEB_PASSWORD = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'
|
||||||
|
|
||||||
# Mail-Account Settings
|
# EMAIL settings
|
||||||
# ----------------------
|
# ----------------------
|
||||||
SMTP_SERVER = 'smtp.gmail.com'
|
SMTP_SERVER = 'smtp.gmail.com'
|
||||||
SMTP_PORT = 587
|
SMTP_PORT = 587
|
||||||
@@ -26,23 +25,22 @@ SMTP_PASS = 'password'
|
|||||||
SMTP_SKIP_TLS = False
|
SMTP_SKIP_TLS = False
|
||||||
SMTP_SKIP_LOGIN = False
|
SMTP_SKIP_LOGIN = False
|
||||||
|
|
||||||
# Mail Reporting
|
|
||||||
# ----------------------
|
|
||||||
REPORT_MAIL = False
|
REPORT_MAIL = False
|
||||||
REPORT_FROM = 'Pi.Alert <' + SMTP_USER +'>'
|
REPORT_FROM = 'Pi.Alert <' + SMTP_USER +'>'
|
||||||
REPORT_TO = 'user@gmail.com'
|
REPORT_TO = 'user@gmail.com'
|
||||||
REPORT_DEVICE_URL = 'http://pi.alert/deviceDetails.php?mac='
|
REPORT_DEVICE_URL = 'http://pi.alert/deviceDetails.php?mac='
|
||||||
REPORT_DASHBOARD_URL = 'http://pi.alert/'
|
REPORT_DASHBOARD_URL = 'http://pi.alert/'
|
||||||
|
|
||||||
# Pushsafer
|
# NTFY (https://ntfy.sh/) settings
|
||||||
# ----------------------
|
|
||||||
REPORT_PUSHSAFER = False
|
|
||||||
PUSHSAFER_TOKEN = 'ApiKey'
|
|
||||||
|
|
||||||
# ntfy
|
|
||||||
# ----------------------
|
# ----------------------
|
||||||
REPORT_NTFY = False
|
REPORT_NTFY = False
|
||||||
NTFY_TOPIC = 'replace_my_secure_topicname_91h889f28'
|
NTFY_TOPIC = 'replace_my_secure_topicname_91h889f28'
|
||||||
|
REPORT_DASHBOARD_URL = 'http://pi.alert/'
|
||||||
|
|
||||||
|
# PUSHSAFER (https://www.pushsafer.com/) settings
|
||||||
|
# ----------------------
|
||||||
|
REPORT_PUSHSAFER = False
|
||||||
|
PUSHSAFER_TOKEN = 'ApiKey'
|
||||||
|
|
||||||
# DynDNS
|
# DynDNS
|
||||||
# ----------------------
|
# ----------------------
|
||||||
@@ -54,7 +52,7 @@ DDNS_USER = 'dynu_user'
|
|||||||
DDNS_PASSWORD = 'A0000000B0000000C0000000D0000000'
|
DDNS_PASSWORD = 'A0000000B0000000C0000000D0000000'
|
||||||
DDNS_UPDATE_URL = 'https://api.dynu.com/nic/update?'
|
DDNS_UPDATE_URL = 'https://api.dynu.com/nic/update?'
|
||||||
|
|
||||||
# Pi-hole Configuration
|
# PIHOLE settings
|
||||||
# ----------------------
|
# ----------------------
|
||||||
PIHOLE_ACTIVE = False
|
PIHOLE_ACTIVE = False
|
||||||
PIHOLE_DB = '/etc/pihole/pihole-FTL.db'
|
PIHOLE_DB = '/etc/pihole/pihole-FTL.db'
|
||||||
@@ -71,6 +69,7 @@ DHCP_LEASES = '/etc/pihole/dhcp.leases'
|
|||||||
#
|
#
|
||||||
# Scan using interface eth0
|
# Scan using interface eth0
|
||||||
# SCAN_SUBNETS = '--localnet --interface=eth0'
|
# SCAN_SUBNETS = '--localnet --interface=eth0'
|
||||||
|
|
||||||
SCAN_SUBNETS = '--localnet'
|
SCAN_SUBNETS = '--localnet'
|
||||||
|
|
||||||
# Maintenance Tasks Cron
|
# Maintenance Tasks Cron
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ if ($ENABLED_DARKMODE === True) {
|
|||||||
|
|
||||||
<div id="myDIV" class="box-body" style="margin-top: 50px; <?php echo $login_display_mode;?>">
|
<div id="myDIV" class="box-body" style="margin-top: 50px; <?php echo $login_display_mode;?>">
|
||||||
<div class="alert alert-<?php echo $login_mode;?> alert-dismissible">
|
<div class="alert alert-<?php echo $login_mode;?> alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true"><3E></button>
|
||||||
<h4><i class="icon fa <?php echo $login_icon;?>"></i><?php echo $login_headline;?></h4>
|
<h4><i class="icon fa <?php echo $login_icon;?>"></i><?php echo $login_headline;?></h4>
|
||||||
<p><?php echo $login_info;?></p>
|
<p><?php echo $login_info;?></p>
|
||||||
<p><?php echo $pia_lang['Login_Psw_run'];?><br><span style="border: solid 1px yellow; padding: 2px;">./reset_password.sh <?php echo $pia_lang['Login_Psw_new'];?></span><br><?php echo $pia_lang['Login_Psw_folder'];?></p>
|
<p><?php echo $pia_lang['Login_Psw_run'];?><br><span style="border: solid 1px yellow; padding: 2px;">./reset_password.sh <?php echo $pia_lang['Login_Psw_new'];?></span><br><?php echo $pia_lang['Login_Psw_folder'];?></p>
|
||||||
|
|||||||
@@ -912,35 +912,6 @@ function getLocations() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// Query Device Data
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
function getNetworkNodes() {
|
|
||||||
global $db;
|
|
||||||
|
|
||||||
// Device Data
|
|
||||||
$sql = 'SELECT * FROM network_infrastructure';
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
|
||||||
|
|
||||||
// arrays of rows
|
|
||||||
$tableData = array();
|
|
||||||
while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
|
||||||
// Push row data
|
|
||||||
$tableData[] = array('id' => $row['device_id'],
|
|
||||||
'name' => $row['net_device_name'].'/'.$row['net_device_typ'] );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Control no rows
|
|
||||||
if (empty($tableData)) {
|
|
||||||
$tableData = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return json
|
|
||||||
echo (json_encode ($tableData));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Status Where conditions
|
// Status Where conditions
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -8,6 +8,20 @@
|
|||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
// ###################################
|
||||||
|
// ## TimeZone processing start
|
||||||
|
// ###################################
|
||||||
|
$config_file = "../config/pialert.conf";
|
||||||
|
$config_file_lines = file($config_file);
|
||||||
|
$config_file_lines_timezone = array_values(preg_grep('/^TIMEZONE\s.*/', $config_file_lines));
|
||||||
|
$timezone_line = explode("'", $config_file_lines_timezone[0]);
|
||||||
|
$Pia_TimeZone = $timezone_line[1];
|
||||||
|
date_default_timezone_set($Pia_TimeZone);
|
||||||
|
// ###################################
|
||||||
|
// ## TimeZone processing end
|
||||||
|
// ###################################
|
||||||
|
|
||||||
|
|
||||||
// ###################################
|
// ###################################
|
||||||
// ## GUI settings processing start
|
// ## GUI settings processing start
|
||||||
// ###################################
|
// ###################################
|
||||||
|
|||||||
Reference in New Issue
Block a user