mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
removing unnecessary config
This commit is contained in:
@@ -115,7 +115,8 @@ DDNS_ACTIVE = False
|
|||||||
|
|
||||||
# PIHOLE settings
|
# PIHOLE settings
|
||||||
# ----------------------
|
# ----------------------
|
||||||
PIHOLE_ACTIVE = False
|
PIHOLE_ACTIVE = False # if enabled you need to map '/etc/pihole/pihole-FTL.db' in docker-compose.yml
|
||||||
|
DHCP_ACTIVE = False # if enabled you need to map '/etc/pihole/dhcp.leases' in docker-compose.yml
|
||||||
|
|
||||||
# keep 90 days of network activity if not specified how many days to keep
|
# keep 90 days of network activity if not specified how many days to keep
|
||||||
DAYS_TO_KEEP_EVENTS = 90
|
DAYS_TO_KEEP_EVENTS = 90
|
||||||
@@ -124,6 +125,8 @@ pialertPath = '/home/pi/pialert'
|
|||||||
dbPath = pialertPath + '/db/pialert.db'
|
dbPath = pialertPath + '/db/pialert.db'
|
||||||
vendorsDB = '/usr/share/arp-scan/ieee-oui.txt'
|
vendorsDB = '/usr/share/arp-scan/ieee-oui.txt'
|
||||||
logPath = pialertPath + '/front/log'
|
logPath = pialertPath + '/front/log'
|
||||||
|
piholeDB = '/etc/pihole/pihole-FTL.db'
|
||||||
|
piholeDhcpleases = '/etc/pihole/dhcp.leases'
|
||||||
|
|
||||||
# load user configuration
|
# load user configuration
|
||||||
|
|
||||||
@@ -723,7 +726,7 @@ def copy_pihole_network ():
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Open Pi-hole DB
|
# Open Pi-hole DB
|
||||||
sql.execute ("ATTACH DATABASE '"+ PIHOLE_DB +"' AS PH")
|
sql.execute ("ATTACH DATABASE '"+ piholeDB +"' AS PH")
|
||||||
|
|
||||||
# Copy Pi-hole Network table
|
# Copy Pi-hole Network table
|
||||||
sql.execute ("DELETE FROM PiHole_Network")
|
sql.execute ("DELETE FROM PiHole_Network")
|
||||||
@@ -755,16 +758,12 @@ def read_DHCP_leases ():
|
|||||||
# 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)
|
||||||
data = []
|
data = []
|
||||||
with open(DHCP_LEASES, 'r') as f:
|
with open(piholeDhcpleases, 'r') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
reporting = True
|
reporting = True
|
||||||
row = line.rstrip().split()
|
row = line.rstrip().split()
|
||||||
if len(row) == 5 :
|
if len(row) == 5 :
|
||||||
data.append (row)
|
data.append (row)
|
||||||
# with open(DHCP_LEASES) as f:
|
|
||||||
# reader = csv.reader(f, delimiter=' ')
|
|
||||||
# data = [(col1, col2, col3, col4, col5)
|
|
||||||
# for col1, col2, col3, col4, col5 in reader]
|
|
||||||
|
|
||||||
# Insert into PiAlert table
|
# Insert into PiAlert table
|
||||||
sql.execute ("DELETE FROM DHCP_Leases")
|
sql.execute ("DELETE FROM DHCP_Leases")
|
||||||
|
|||||||
Reference in New Issue
Block a user