Skip to content

Commit

Permalink
v2.52
Browse files Browse the repository at this point in the history
Fix bug #2
  • Loading branch information
pucherot committed Jan 11, 2021
1 parent 8bf95ae commit 424cf11
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion back/pialert.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = '2.51'
VERSION = '2.52'
VERSION_YEAR = '2021'
VERSION_DATE = '2021-01-11'

Expand Down
10 changes: 6 additions & 4 deletions back/pialert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Pi.Alert v2.51 / 2021-01-11
# Pi.Alert v2.52 / 2021-01-11
# Puche 2020
# GNU GPLv3

Expand Down Expand Up @@ -645,25 +645,27 @@ def create_new_devices ():

# Pi-hole - Insert events for new devices
# NOT STRICYLY NECESARY (Devices can be created through Current_Scan)
# Bugfix #2 - Pi-hole devices w/o IP
print_log ('New devices - 3 Pi-hole Events')
sql.execute ("""INSERT INTO Events (eve_MAC, eve_IP, eve_DateTime,
eve_EventType, eve_AdditionalInfo,
eve_PendingAlertEmail)
SELECT PH_MAC, PH_IP, ?, 'New Device',
SELECT PH_MAC, IFNULL (PH_IP,'-'), ?, 'New Device',
'(Pi-Hole) ' || PH_Vendor, 1
FROM PiHole_Network
WHERE NOT EXISTS (SELECT 1 FROM Devices
WHERE dev_MAC = PH_MAC) """,
(startTime, ) )

# Pi-hole - Create New Devices
# Bugfix #2 - Pi-hole devices w/o IP
print_log ('New devices - 4 Pi-hole Create devices')
sql.execute ("""INSERT INTO Devices (dev_MAC, dev_name, dev_Vendor,
dev_LastIP, dev_FirstConnection, dev_LastConnection,
dev_ScanCycle, dev_AlertEvents, dev_AlertDeviceDown,
dev_PresentLastScan)
SELECT PH_MAC, PH_Name, PH_Vendor, PH_IP, ?, ?,
1, 1, 0, 1
SELECT PH_MAC, PH_Name, PH_Vendor, IFNULL (PH_IP,'-'),
?, ?, 1, 1, 0, 1
FROM PiHole_Network
WHERE NOT EXISTS (SELECT 1 FROM Devices
WHERE dev_MAC = PH_MAC) """,
Expand Down
6 changes: 3 additions & 3 deletions docs/report_sample_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<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-11 08:00</b> </td>
<td width=33%> Report Date: <b>2021-01-01 08:00</b> </td>
<td width=34%> Scan Cycle: <b>Internet</b> </td>
<td width=33%> Server: <b>pi4</b> </td>
</tr>
Expand All @@ -39,7 +39,7 @@

<tr>
<td> Internet IP Changed </td>
<td> 2021-01-02 08:20:00 </td>
<td> 2021-01-01 08:00:00 </td>
<td style="font-size: 24px; color:#D02020"> 1.1.1.0 </td>
<td> Previous Internet IP: 1.1.0.0 </td>
</tr>
Expand All @@ -59,7 +59,7 @@
<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.51 &nbsp; / &nbsp; 2021-01-11 </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>
Expand Down
14 changes: 7 additions & 7 deletions docs/report_sample_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<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-11 08:00</b> </td>
<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>
Expand All @@ -43,13 +43,13 @@

<tr>
<td> f8:d0:27:00:00:00 </td>
<td> 2021-01-02 08:20:00 </td>
<td> 2021-01-01 08:00:00 </td>
<td> 192.168.1.20 </td>
<td> Seiko Epson Corporation </td>
</tr>
<tr>
<td> c8:6c:3d:00:00:00 </td>
<td> 2021-01-02 08:20:00 </td>
<td> 2021-01-01 08:00:00 </td>
<td> 192.168.1.181 </td>
<td> Amazon Technologies Inc. </td>
</tr>
Expand All @@ -72,7 +72,7 @@

<tr>
<td> 0c:ee:99:00:00:00 </td>
<td> 2021-01-02 08:20:00 </td>
<td> 2021-01-01 08:00:00 </td>
<td> 192.168.1.171 </td>
<td> Alexa - Echo </td>
</tr>
Expand All @@ -97,15 +97,15 @@

<tr>
<td> 94:0c:98:00:00:00 </td>
<td> 2021-01-02 08:20:00 </td>
<td> 2021-01-01 08:00:00 </td>
<td> 192.168.1.132 </td>
<td> Connected </td>
<td> Person 1 - iPhone 11 </td>
<td> </td>
</tr>
<tr>
<td> 5c:41:5a:00:00:00 </td>
<td> 2021-01-02 08:20:00 </td>
<td> 2021-01-01 08:00:00 </td>
<td> 192.168.1.170 </td>
<td> IP Changed </td>
<td> Alexa Dot </td>
Expand All @@ -122,7 +122,7 @@
<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.51 &nbsp; / &nbsp; 2021-01-11 </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>
Expand Down
2 changes: 1 addition & 1 deletion front/php/templates/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
&copy; 2021 Puche
<!-- To the right -->
<div class="pull-right no-hidden-xs">
Pi.alert&nbsp&nbsp2.51&nbsp&nbsp<small>(2021-01-11)</small>
Pi.alert&nbsp&nbsp2.52&nbsp&nbsp<small>(2021-01-11)</small>
</div>
</footer>
Expand Down
9 changes: 8 additions & 1 deletion install/create_tar.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#
PIALERT_VERSION=2.50
PIALERT_VERSION=2.52
PIALERT_DEV_PATH=/media/WD_4TB/dev

cd $PIALERT_DEV_PATH

tar tvf pialert/install/pialert_$PIALERT_VERSION.tar | wc -l
rm pialert/install/pialert_$PIALERT_VERSION.tar

tar cvf pialert/install/pialert_$PIALERT_VERSION.tar --exclude="pialert/install" --exclude="pialert/.git" pialert | wc -l

rm pialert/install/pialert_latest.tar
ln -s pialert_$PIALERT_VERSION.tar pialert/install/pialert_latest.tar



Binary file not shown.
Binary file modified install/pialert_latest.tar
Binary file not shown.
4 changes: 2 additions & 2 deletions log/report_output.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<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-04 18:08</b> </td>
<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>
Expand All @@ -35,7 +35,7 @@
<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 DEV 2.51 &nbsp; / &nbsp; 2021-01-11 </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>
Expand Down
4 changes: 2 additions & 2 deletions log/report_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pi.Alert Report
========================================

Report Date: 2021-01-11 00:00
Report Date: 2021-01-01 08:00
Scan Cycle: 1
Server: pi4

Expand All @@ -12,4 +12,4 @@ Events


----------------------------------------------------------------------
Puche 2021 Pi.Alert 2.51 / 2021-01-11 GNU GPLv3
Puche 2021 Pi.Alert 2.50 / 2021-01-01 GNU GPLv3

0 comments on commit 424cf11

Please sign in to comment.