partial merge https://github.com/leiweibau/Pi.Alert/pull/9
- merged timezone configuration with pialert.conf as the settings file - merged NTFY support - the variable REPORT_DASHBOARD_URL was merged (duplication in Pushsafer and NTFY) - update README
This commit is contained in:
21
README.md
21
README.md
@@ -4,7 +4,7 @@
|
|||||||
WIFI / LAN intruder detector.
|
WIFI / LAN intruder detector.
|
||||||
|
|
||||||
Scan the devices connected to your WIFI / LAN and alert you the connection of
|
Scan the devices connected to your WIFI / LAN and alert you the connection of
|
||||||
unknown devices. It also warns the disconnection of "always connected" devices.
|
unknown devices. It also warns if a "always connected" devices disconnects.
|
||||||
|
|
||||||
![Main screen][main]
|
![Main screen][main]
|
||||||
*(Apologies for my English and my limited knowledge of Python, php and
|
*(Apologies for my English and my limited knowledge of Python, php and
|
||||||
@@ -43,14 +43,16 @@ In charge of:
|
|||||||
- Scan the network searching connected devices using the scanning methods
|
- Scan the network searching connected devices using the scanning methods
|
||||||
described
|
described
|
||||||
- Store the information in the DB
|
- Store the information in the DB
|
||||||
- Report the changes detected by e-mail
|
- Report the changes detected by e-mail and/or other services (Pushsafer, NTFY, Gotify)
|
||||||
- Optional speedtest for Device "Internet"
|
- Optional speedtest for Device "Internet"
|
||||||
|
|
||||||
| ![Report 1][report1] | ![Report 2][report2] |
|
| ![Report 1][report1] | ![Report 2][report2] |
|
||||||
| -------------------- | -------------------- |
|
| -------------------- | -------------------- |
|
||||||
|
|
||||||
### Front
|
### Front
|
||||||
A web frontal that allows:
|
There is a configurable login to prevent unauthorized use. The default password is "123456"
|
||||||
|
|
||||||
|
A web frontend that allows:
|
||||||
- Manage the devices inventory and the characteristics
|
- Manage the devices inventory and the characteristics
|
||||||
- Display in a visual way all the information collected by the back
|
- Display in a visual way all the information collected by the back
|
||||||
- Sessions
|
- Sessions
|
||||||
@@ -61,8 +63,8 @@ A web frontal that allows:
|
|||||||
- Concurrent devices
|
- Concurrent devices
|
||||||
- Down alerts
|
- Down alerts
|
||||||
- IP's
|
- IP's
|
||||||
- manuel nmap scans
|
- Manuel Nmap scans
|
||||||
- Optional speedtest for Device "Internet"
|
- Optional speedtest for Device "Internet" in the details view
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
| ![Screen 1][screen1] | ![Screen 2][screen2] |
|
| ![Screen 1][screen1] | ![Screen 2][screen2] |
|
||||||
@@ -148,6 +150,15 @@ Linux distributions.
|
|||||||
|
|
||||||
***Suggestions and comments are welcome***
|
***Suggestions and comments are welcome***
|
||||||
|
|
||||||
|
### Special thanks 🥇
|
||||||
|
|
||||||
|
This code is a collaborative body of work, with special thanks to:
|
||||||
|
|
||||||
|
- [leiweibau](https://github.com/leiweibau/Pi.Alert): Dark mode (and Last X scans activity chart)
|
||||||
|
- [Macleykun](https://github.com/Macleykun): Help with Dockerfile clean-up
|
||||||
|
- [Final-Hawk](https://github.com/Final-Hawk): Help with NTFY, styling and other fixes
|
||||||
|
- [terorero](https://github.com/terorero): Spanish translation
|
||||||
|
- [jokob-sk/Pi.Alert](https://github.com/jokob-sk/Pi.Alert): DB Maintenance tools
|
||||||
|
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
[main]: ./docs/img/1_devices.jpg "Main screen"
|
[main]: ./docs/img/1_devices.jpg "Main screen"
|
||||||
|
|||||||
@@ -1363,6 +1363,11 @@ def email_reporting ():
|
|||||||
send_pushsafer (mail_text)
|
send_pushsafer (mail_text)
|
||||||
else :
|
else :
|
||||||
print (' Skip PUSHSAFER...')
|
print (' Skip PUSHSAFER...')
|
||||||
|
if REPORT_NTFY :
|
||||||
|
print (' Sending report by NTFY...')
|
||||||
|
send_ntfy (mail_text)
|
||||||
|
else :
|
||||||
|
print (' Skip NTFY...')
|
||||||
else :
|
else :
|
||||||
print (' No changes to report...')
|
print (' No changes to report...')
|
||||||
|
|
||||||
@@ -1404,6 +1409,18 @@ def send_pushsafer (_Text):
|
|||||||
json = urlopen(request).read().decode()
|
json = urlopen(request).read().decode()
|
||||||
# print(json)
|
# print(json)
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def send_ntfy (_Text):
|
||||||
|
requests.post("https://ntfy.sh/{}".format(NTFY_TOPIC),
|
||||||
|
data=_Text,
|
||||||
|
headers={
|
||||||
|
"Title": "Pi.Alert Notification",
|
||||||
|
"Click": REPORT_DASHBOARD_URL,
|
||||||
|
"Priority": "urgent",
|
||||||
|
"Tags": "warning"
|
||||||
|
})
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
def format_report_section (pActive, pSection, pTable, pText, pHTML):
|
def format_report_section (pActive, pSection, pTable, pText, pHTML):
|
||||||
global mail_text
|
global mail_text
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ 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'
|
||||||
|
|
||||||
@@ -26,11 +27,14 @@ 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_PUSHSAFER = False
|
REPORT_PUSHSAFER = False
|
||||||
REPORT_DASHBOARD_URL = ''
|
|
||||||
PUSHSAFER_TOKEN = 'ApiKey'
|
PUSHSAFER_TOKEN = 'ApiKey'
|
||||||
|
|
||||||
|
REPORT_NTFY = False
|
||||||
|
NTFY_TOPIC = 'replace_my_secure_topicname_91h889f28'
|
||||||
|
|
||||||
# QUERY_MYIP_SERVER = 'https://diagnostic.opendns.com/myip'
|
# QUERY_MYIP_SERVER = 'https://diagnostic.opendns.com/myip'
|
||||||
QUERY_MYIP_SERVER = 'http://ipv4.icanhazip.com'
|
QUERY_MYIP_SERVER = 'http://ipv4.icanhazip.com'
|
||||||
DDNS_ACTIVE = False
|
DDNS_ACTIVE = False
|
||||||
|
|||||||
@@ -8,7 +8,23 @@
|
|||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<?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
|
||||||
|
###################################
|
||||||
if (file_exists('../db/setting_darkmode')) {
|
if (file_exists('../db/setting_darkmode')) {
|
||||||
$ENABLED_DARKMODE = True;
|
$ENABLED_DARKMODE = True;
|
||||||
}
|
}
|
||||||
@@ -22,7 +38,9 @@ foreach (glob("../db/setting_language*") as $filename) {
|
|||||||
}
|
}
|
||||||
if (strlen($pia_lang_selected) == 0) {$pia_lang_selected = 'en_us';}
|
if (strlen($pia_lang_selected) == 0) {$pia_lang_selected = 'en_us';}
|
||||||
require 'php/templates/language/'.$pia_lang_selected.'.php';
|
require 'php/templates/language/'.$pia_lang_selected.'.php';
|
||||||
|
###################################
|
||||||
|
## GUI settings processing end
|
||||||
|
###################################
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
Reference in New Issue
Block a user