mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
updated contact info
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
# pialert.py - Back module. Network scanner
|
# pialert.py - Back module. Network scanner
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@@ -870,29 +870,45 @@ def scan_network ():
|
|||||||
|
|
||||||
# file_print("---------------------------------------------")
|
# file_print("---------------------------------------------")
|
||||||
|
|
||||||
# client = SSDPClient()
|
# client = SSDPClient()
|
||||||
# devices = client.m_search("ssdp:all")
|
|
||||||
# for device in devices:
|
|
||||||
# file_print(device.get("usn"))
|
|
||||||
|
|
||||||
# file_print("---------------------------------------------")
|
# devices = client.m_search("ssdp:all")
|
||||||
|
|
||||||
|
# for device in devices:
|
||||||
|
# print(device.get("usn"))
|
||||||
|
# print("000000000000000000000000000000000000000000000000000000000000\n")
|
||||||
|
# print(device)
|
||||||
|
|
||||||
|
# print("---------------------------------------------")
|
||||||
|
|
||||||
# devices = upnpclient.discover()
|
# devices = upnpclient.discover()
|
||||||
|
|
||||||
# file_print("---------------------------------------------")
|
# print("---------------------------------------------")
|
||||||
|
|
||||||
# for device in devices:
|
# for device in devices:
|
||||||
# file_print(device)
|
# print(device)
|
||||||
|
|
||||||
# file_print("---------------------------------------------")
|
# print("---------------------------------------------")
|
||||||
|
|
||||||
|
|
||||||
|
# sockAddr = ("192.168.1.14", 443);
|
||||||
|
|
||||||
|
# sockInfo = socket.getnameinfo(sockAddr, socket.NI_NAMEREQD);
|
||||||
|
|
||||||
|
# # find an example using NI_MAXHOST
|
||||||
|
|
||||||
|
# print(sockInfo);
|
||||||
|
|
||||||
|
|
||||||
|
# nmap > vendor > espressifg > ESP32 type
|
||||||
|
# UDP ports
|
||||||
|
# nmap -sU 192.168.1.14
|
||||||
|
|
||||||
# # devtest end
|
# # devtest end
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
updateState("Scan: Network")
|
updateState("Scan: Network")
|
||||||
file_print('[', startTime, '] Scan Devices:' )
|
file_print('[', startTime, '] Scan Devices:' )
|
||||||
file_print(' ScanCycle:', cycle)
|
|
||||||
|
|
||||||
|
|
||||||
# # Query ScanCycle properties
|
# # Query ScanCycle properties
|
||||||
print_log ('Query ScanCycle confinguration')
|
print_log ('Query ScanCycle confinguration')
|
||||||
@@ -914,14 +930,16 @@ def scan_network ():
|
|||||||
# DEBUG - print number of rows updated
|
# DEBUG - print number of rows updated
|
||||||
# file_print('aspr-scan result:', len(arpscan_devices))
|
# file_print('aspr-scan result:', len(arpscan_devices))
|
||||||
|
|
||||||
# Pi-hole method
|
# Pi-hole method
|
||||||
file_print(' Pi-hole start')
|
if PIHOLE_ACTIVE :
|
||||||
openDB()
|
file_print(' Pi-hole start')
|
||||||
reporting = copy_pihole_network() or reporting
|
openDB()
|
||||||
|
reporting = copy_pihole_network() or reporting
|
||||||
|
|
||||||
# DHCP Leases method
|
# DHCP Leases method
|
||||||
file_print(' DHCP Leases start')
|
if DHCP_ACTIVE :
|
||||||
reporting = read_DHCP_leases () or reporting
|
file_print(' DHCP Leases start')
|
||||||
|
reporting = read_DHCP_leases () or reporting
|
||||||
|
|
||||||
# Load current scan data
|
# Load current scan data
|
||||||
file_print(' Processing scan results')
|
file_print(' Processing scan results')
|
||||||
@@ -998,15 +1016,12 @@ def execute_arpscan ():
|
|||||||
arpscan_output = ""
|
arpscan_output = ""
|
||||||
|
|
||||||
# multiple interfaces
|
# multiple interfaces
|
||||||
if type(SCAN_SUBNETS) is list:
|
if type(SCAN_SUBNETS) is list:
|
||||||
file_print(" arp-scan: Multiple interfaces")
|
|
||||||
for interface in SCAN_SUBNETS :
|
for interface in SCAN_SUBNETS :
|
||||||
arpscan_output += execute_arpscan_on_interface (interface)
|
arpscan_output += execute_arpscan_on_interface (interface)
|
||||||
# one interface only
|
# one interface only
|
||||||
else:
|
else:
|
||||||
file_print(" arp-scan: One interface")
|
|
||||||
arpscan_output += execute_arpscan_on_interface (SCAN_SUBNETS)
|
arpscan_output += execute_arpscan_on_interface (SCAN_SUBNETS)
|
||||||
|
|
||||||
|
|
||||||
# Search IP + MAC + Vendor as regular expresion
|
# Search IP + MAC + Vendor as regular expresion
|
||||||
re_ip = r'(?P<ip>((2[0-5]|1[0-9]|[0-9])?[0-9]\.){3}((2[0-5]|1[0-9]|[0-9])?[0-9]))'
|
re_ip = r'(?P<ip>((2[0-5]|1[0-9]|[0-9])?[0-9]\.){3}((2[0-5]|1[0-9]|[0-9])?[0-9]))'
|
||||||
@@ -1017,7 +1032,6 @@ def execute_arpscan ():
|
|||||||
# Create Userdict of devices
|
# Create Userdict of devices
|
||||||
devices_list = [device.groupdict()
|
devices_list = [device.groupdict()
|
||||||
for device in re.finditer (re_pattern, arpscan_output)]
|
for device in re.finditer (re_pattern, arpscan_output)]
|
||||||
|
|
||||||
|
|
||||||
# Delete duplicate MAC
|
# Delete duplicate MAC
|
||||||
unique_mac = []
|
unique_mac = []
|
||||||
@@ -1026,8 +1040,7 @@ def execute_arpscan ():
|
|||||||
for device in devices_list :
|
for device in devices_list :
|
||||||
if device['mac'] not in unique_mac:
|
if device['mac'] not in unique_mac:
|
||||||
unique_mac.append(device['mac'])
|
unique_mac.append(device['mac'])
|
||||||
unique_devices.append(device)
|
unique_devices.append(device)
|
||||||
|
|
||||||
|
|
||||||
# DEBUG
|
# DEBUG
|
||||||
# file_print(devices_list)
|
# file_print(devices_list)
|
||||||
@@ -1061,9 +1074,6 @@ def execute_arpscan_on_interface (SCAN_SUBNETS):
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
def copy_pihole_network ():
|
def copy_pihole_network ():
|
||||||
# check if Pi-hole is active
|
|
||||||
if not PIHOLE_ACTIVE :
|
|
||||||
return
|
|
||||||
|
|
||||||
# Open Pi-hole DB
|
# Open Pi-hole DB
|
||||||
sql.execute ("ATTACH DATABASE '"+ piholeDB +"' AS PH")
|
sql.execute ("ATTACH DATABASE '"+ piholeDB +"' AS PH")
|
||||||
@@ -1090,10 +1100,6 @@ def copy_pihole_network ():
|
|||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
def read_DHCP_leases ():
|
def read_DHCP_leases ():
|
||||||
reporting = False
|
reporting = False
|
||||||
|
|
||||||
# check DHCP Leases is active
|
|
||||||
if not DHCP_ACTIVE :
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Read DHCP Leases
|
# Read DHCP Leases
|
||||||
# Bugfix #1 - dhcp.leases: lines with different number of columns (5 col)
|
# Bugfix #1 - dhcp.leases: lines with different number of columns (5 col)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
# update_vendors.sh - Back module. IEEE Vendors db update
|
# update_vendors.sh - Back module. IEEE Vendors db update
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# pialert.css - Front module. CSS styles
|
# pialert.css - Front module. CSS styles
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
----------------------------------------------------------------------------- */
|
----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# deviceDetails.php - Front module. Device management page
|
# deviceDetails.php - Front module. Device management page
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@@ -1558,9 +1558,4 @@ function setTextValue (textElement, textValue) {
|
|||||||
activateSaveRestoreData ();
|
activateSaveRestoreData ();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addNewDrpItem(textElement)
|
|
||||||
{
|
|
||||||
showModalDefault("Add new item","Enter new item: <input><input>","Cancel","OK", "alert");
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# devices.php - Front module. Devices list page
|
# devices.php - Front module. Devices list page
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# events.php - Front module. Events page
|
# events.php - Front module. Events page
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* pialert_common.js - Front module. Common Javascript functions
|
* pialert_common.js - Front module. Common Javascript functions
|
||||||
*-------------------------------------------------------------------------------
|
*-------------------------------------------------------------------------------
|
||||||
* Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
----------------------------------------------------------------------------- */
|
----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// db.php - Front module. Server side. DB common file
|
// db.php - Front module. Server side. DB common file
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
// ## TimeZone processing
|
// ## TimeZone processing
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// devices.php - Front module. Server side. Manage Devices
|
// devices.php - Front module. Server side. Manage Devices
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
// External files
|
// External files
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// events.php - Front module. Server side. Manage Events
|
// events.php - Front module. Server side. Manage Events
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// External files
|
// External files
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// parameters.php - Front module. Server side. Manage Parameters
|
// parameters.php - Front module. Server side. Manage Parameters
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// util.php - Front module. Server side. Common generic functions
|
// util.php - Front module. Server side. Common generic functions
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
require '/home/pi/pialert/front/php/templates/timezone.php';
|
require '/home/pi/pialert/front/php/templates/timezone.php';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# footer.php - Front module. Common footer to all the web pages
|
# footer.php - Front module. Common footer to all the web pages
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<!-- Main Footer -->
|
<!-- Main Footer -->
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<!-- © 2020 Puche -->
|
<!-- © 2020 Puche -->
|
||||||
<?php
|
<?php
|
||||||
echo '<span style="display:inline-block; transform: rotate(180deg)">©</span> 2020 Puche (2022+ jokob-sk)';
|
echo '<span style="display:inline-block; transform: rotate(180deg)">©</span> 2020 Puche (2022+ <a href="mailto:jokob@duck.com?subject=PiAlert">jokob-sk</a>)';
|
||||||
?>
|
?>
|
||||||
<!-- To the right -->
|
<!-- To the right -->
|
||||||
<div class="pull-right no-hidden-xs">
|
<div class="pull-right no-hidden-xs">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# header.php - Front module. Common header to all the web pages
|
# header.php - Front module. Common header to all the web pages
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# notificacion.php - Front module. Common notification & modal window
|
# notificacion.php - Front module. Common notification & modal window
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<!-- Modal Ok -->
|
<!-- Modal Ok -->
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
# presence.php - Front module. Device Presence calendar page
|
# presence.php - Front module. Device Presence calendar page
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
Reference in New Issue
Block a user