This commit is contained in:
Jokob-sk
2022-12-11 13:59:53 +11:00
parent 6d9ffaabf8
commit 7b70b490e7
16 changed files with 8 additions and 632 deletions

View File

@@ -13,6 +13,8 @@ fi
# I hope this will fix DB permission issues going forward
chown -R www-data:www-data /home/pi/pialert/db/pialert.db
chmod -R a+rw /home/pi/pialert/front/log
/etc/init.d/php7.4-fpm start
/etc/init.d/nginx start

View File

@@ -406,7 +406,7 @@
----------------------------------------------------------------------------- */
.pa_semitransparent-panel {
position: absolute;
width: 100%; //calc (100% -40px);
width: 100%; /*calc (100% -40px);*/
height: 100%;
left: 0;
top: 0;

View File

@@ -4,7 +4,7 @@
#
# IP_changes.log - Back module. Logfile for Internet IP changes
#-------------------------------------------------------------------------------
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
# Puche 2021 GNU GPLv3
#-------------------------------------------------------------------------------
2021-01-01 00:00:00 0.0.0.0

View File

@@ -1,441 +0,0 @@
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:09:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:09:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 27
arp-scan Method....: 25
Pi-hole Method.....: +0
New Devices........: 0
Devices in this cycle..: 27
Down Alerts........: 0
New Down Alerts....: 0
New Connections....: 0
Disconnections.....: 1
IP Changes.........: 0
Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name...
Names updated: 0
Voiding false (ghost) disconnections...
Pairing session events (connection / disconnection) ...
Creating sessions snapshot...
Skipping repeated notifications...
Check if something to report...
No changes to report...
Notifications: 0
Cleanup Database
Timestamp: 2022-12-11 13:09:00
Cleanup Online_History...
Optimize Database...
Cleanup Events, up to the lastest 90 days...
Shrink Database...
Finished cycle: cleanup
Loop end
---------------------------
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:13:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: internet_IP
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:15:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 26
arp-scan Method....: 24
Pi-hole Method.....: +0
New Devices........: 0
Devices in this cycle..: 26
Down Alerts........: 0
New Down Alerts....: 0
New Connections....: 0
Disconnections.....: 1
IP Changes.........: 0
Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name...
Names updated: 0
Voiding false (ghost) disconnections...
Pairing session events (connection / disconnection) ...
Creating sessions snapshot...
Skipping repeated notifications...
Check if something to report...
Changes detected, sending reports...
Sending report by email...
Sending report by Apprise...
Sending report by webhook...
Sending report by NTFY...
Skip PUSHSAFER...
Establishing MQTT thread...
Connected to broker
Notifications: 1
Finished cycle: 1
Loop end
---------------------------
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:24:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:24:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 26
arp-scan Method....: 24
Pi-hole Method.....: +0
New Devices........: 0
Devices in this cycle..: 26
Down Alerts........: 0
New Down Alerts....: 0
New Connections....: 0
Disconnections.....: 0
IP Changes.........: 0
Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name...
Names updated: 0
Voiding false (ghost) disconnections...
Pairing session events (connection / disconnection) ...
Creating sessions snapshot...
Skipping repeated notifications...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: 1
Loop end
---------------------------
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:27:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: internet_IP
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:29:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 27
arp-scan Method....: 25
Pi-hole Method.....: +0
New Devices........: 0
Devices in this cycle..: 27
Down Alerts........: 0
New Down Alerts....: 0
New Connections....: 1
Disconnections.....: 0
IP Changes.........: 0
Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name...
Names updated: 0
Voiding false (ghost) disconnections...
Pairing session events (connection / disconnection) ...
Creating sessions snapshot...
Skipping repeated notifications...
Check if something to report...
Changes detected, sending reports...
Sending report by email...
Sending report by Apprise...
Sending report by webhook...
Sending report by NTFY...
Skip PUSHSAFER...
Establishing MQTT thread...
Notifications: 1
Finished cycle: 1
Loop end
---------------------------
Wait 20s
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:30:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: internet_IP
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:33:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: internet_IP
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:34:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 27
arp-scan Method....:

View File

@@ -43,8 +43,8 @@
<td>
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
<tr>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert 2.50 &nbsp; / &nbsp; 2021-01-01 </td>
<td width=25% style="text-align:Left"> Puche 2021 (+jokob-sk 2022)</td>
<td width=50% style="text-align:center"> Pi.Alert </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>

View File

@@ -12,4 +12,4 @@ Events
----------------------------------------------------------------------
Puche 2021 Pi.Alert 2.50 / 2021-01-01 GNU GPLv3
Puche 2021 (+jokob-sk 2022) Pi.Alert GNU GPLv3

View File

@@ -1,49 +0,0 @@
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3266 0 0 100 3266 0 2717 0:00:01 0:00:01 --:--:-- 2719
100 3287 100 21 100 3266 11 1769 0:00:01 0:00:01 --:--:-- 1780
100 3287 100 21 100 3266 11 1769 0:00:01 0:00:01 --:--:-- 1780
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Sat, 10 Dec 2022 23:41:47 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 21
Connection: keep-alive
Expires: Sat, 10 Dec 2022 23:41:47 GMT
Cache-Control: max-age=0, no-cache, no-store, must-revalidate, private
Notification(s) sent. % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 594 100 34 100 560 400 6588 --:--:-- --:--:-- --:--:-- 7071
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 34
ETag: W/"22-6OS7cK0FzqnV2NeDHdOSGS1bVUs"
Vary: Accept-Encoding
Date: Sat, 10 Dec 2022 23:41:47 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{"message":"Workflow was started"} % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3263 0 0 100 3263 0 2714 0:00:01 0:00:01 --:--:-- 2716
100 3284 100 21 100 3263 11 1859 0:00:01 0:00:01 --:--:-- 1871
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Sun, 11 Dec 2022 00:52:29 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 21
Connection: keep-alive
Expires: Sun, 11 Dec 2022 00:52:29 GMT
Cache-Control: max-age=0, no-cache, no-store, must-revalidate, private
Notification(s) sent. % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

View File

@@ -1 +0,0 @@
{"username": "Pi.Alert", "text": "There are new notifications", "attachments": [{"title": "Pi.Alert Notifications", "title_link": "http://100.89.112.105:20211", "text": {"internet": [], "new_devices": [], "down_devices": [], "events": [["94:b5:55:c7:cb:e0", "192.168.1.151", "2022-12-11 11:52:00", "Connected", "", 1, null, "94:b5:55:c7:cb:e0", "ESP32 - ttgo", "House", "", "Espressif Inc.", 0, "", "", "2022-10-16 16:55:00", "2022-12-11 11:52:00", "192.168.1.151", 0, 1, 1, 1, 0, 0, "2022-12-11 10:41:48.466369", 1, 0, "", 0, "d0:21:f9:8c:59:f9", ""]]}}]}

View File

@@ -1,10 +0,0 @@
#-------------------------------------------------------------------------------
# Pi.Alert
# Open Source Network Guard / WIFI & LAN intrusion detector
#
# IP_changes.log - Back module. Logfile for Internet IP changes
#-------------------------------------------------------------------------------
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
#-------------------------------------------------------------------------------
2021-01-01 00:00:00 0.0.0.0

View File

@@ -1,4 +0,0 @@
File "/home/pi/pialert/back/pialert.py", line 1639
def check_config(service)
^
SyntaxError: invalid syntax

View File

@@ -1,56 +0,0 @@
<!-- ---------------------------------------------------------------------------
# Pi.Alert
# Open Source Network Guard / WIFI & LAN intrusion detector
#
# repot_template.html - Back module. Template to email reporting in HTML format
#-------------------------------------------------------------------------------
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
#--------------------------------------------------------------------------- -->
<html>
<head>
</head>
<body>
<font face=sans-serif>
<table align=center width=80% border=1 bordercolor=#909090 cellpadding=0 cellspacing=0 style="border-collapse: collapse; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.5)">
<tr>
<td bgcolor=#EFB956 align=center style="padding: 20px 10px 10px 10px; font-size: 36px; font-weight: bold; color:#7F6000; text-shadow: 4px 4px 6px #909090">
Pi.Alert Report
</td>
</tr>
<tr>
<td>
<table width=100% border=0 bgcolor=#FFD966 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 16px; text-align:center; color:#5F5000">
<tr>
<td width=33%> Report Date: <b>2021-01-01 08:00</b> </td>
<td width=34%> Scan Cycle: <b>1</b> </td>
<td width=33%> Server: <b>pi4</b> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor=#F5F5F5 height=200 valign=top style="padding: 10px">
</td>
</tr>
<tr>
<td>
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
<tr>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert 2.50 &nbsp; / &nbsp; 2021-01-01 </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>
</td>
</tr>
</table>
</font>
</body>
</html>

View File

@@ -1,15 +0,0 @@
========================================
Pi.Alert Report
========================================
Report Date: 2021-01-01 08:00
Scan Cycle: 1
Server: pi4
Events
----------------------------------------------------------------------
----------------------------------------------------------------------
Puche 2021 Pi.Alert 2.50 / 2021-01-01 GNU GPLv3

View File

View File

@@ -1,49 +0,0 @@
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3266 0 0 100 3266 0 2717 0:00:01 0:00:01 --:--:-- 2719
100 3287 100 21 100 3266 11 1769 0:00:01 0:00:01 --:--:-- 1780
100 3287 100 21 100 3266 11 1769 0:00:01 0:00:01 --:--:-- 1780
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Sat, 10 Dec 2022 23:41:47 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 21
Connection: keep-alive
Expires: Sat, 10 Dec 2022 23:41:47 GMT
Cache-Control: max-age=0, no-cache, no-store, must-revalidate, private
Notification(s) sent. % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 594 100 34 100 560 400 6588 --:--:-- --:--:-- --:--:-- 7071
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 34
ETag: W/"22-6OS7cK0FzqnV2NeDHdOSGS1bVUs"
Vary: Accept-Encoding
Date: Sat, 10 Dec 2022 23:41:47 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{"message":"Workflow was started"} % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3263 0 0 100 3263 0 2714 0:00:01 0:00:01 --:--:-- 2716
100 3284 100 21 100 3263 11 1859 0:00:01 0:00:01 --:--:-- 1871
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Sun, 11 Dec 2022 00:52:29 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 21
Connection: keep-alive
Expires: Sun, 11 Dec 2022 00:52:29 GMT
Cache-Control: max-age=0, no-cache, no-store, must-revalidate, private
Notification(s) sent. % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

View File

@@ -1 +0,0 @@
{"username": "Pi.Alert", "text": "There are new notifications", "attachments": [{"title": "Pi.Alert Notifications", "title_link": "http://100.89.112.105:20211", "text": {"internet": [], "new_devices": [], "down_devices": [], "events": [["94:b5:55:c7:cb:e0", "192.168.1.151", "2022-12-11 11:52:00", "Connected", "", 1, null, "94:b5:55:c7:cb:e0", "ESP32 - ttgo", "House", "", "Espressif Inc.", 0, "", "", "2022-10-16 16:55:00", "2022-12-11 11:52:00", "192.168.1.151", 0, 1, 1, 1, 0, 0, "2022-12-11 10:41:48.466369", 1, 0, "", 0, "d0:21:f9:8c:59:f9", ""]]}}]}