MQTT rework v0.4, install scripts rework, Traefik docs 📦

This commit is contained in:
Jokob-sk
2023-10-15 16:37:32 +11:00
parent 31e1116483
commit 897112e466
22 changed files with 50461 additions and 204 deletions

0
pialert/appevent.py Normal file → Executable file
View File

View File

@@ -14,8 +14,8 @@ logPath = pialertPath + '/front/log'
apiPath = pialertPath + '/front/api/'
fullConfPath = pialertPath + confPath
fullDbPath = pialertPath + dbPath
vendorsPath6 = '/usr/share/arp-scan/ieee-oui.txt'
vendorsPath9 = '/usr/share/arp-scan/ieee-iab.txt'
vendorsPath = '/usr/share/arp-scan/ieee-oui.txt'

View File

@@ -5,7 +5,7 @@ import conf
import re
from helper import timeNowTZ, get_setting, get_setting_value,resolve_device_name_dig, resolve_device_name_pholus, check_IP_format
from logger import mylog, print_log
from const import vendorsPath6, vendorsPath9
from const import vendorsPath
#-------------------------------------------------------------------------------
@@ -343,19 +343,13 @@ def query_MAC_vendor (pMAC):
mac_start_string9 = mac[0:9]
try:
with open(vendorsPath6, 'r') as f:
with open(vendorsPath, 'r') as f:
for line in f:
if line.startswith(mac_start_string6):
vendor = line.split(' ', 1)[1].strip()
mylog('debug', [f"[Vendor Check] Found '{vendor}' for '{pMAC}' in {vendorsPath6}"])
mylog('debug', [f"[Vendor Check] Found '{vendor}' for '{pMAC}' in {vendorsPath}"])
return vendor
with open(vendorsPath9, 'r') as f:
for line in f:
if line.startswith(mac_start_string9):
vendor = line.split(' ', 1)[1].strip()
mylog('debug', [f"[Vendor Check] Found '{vendor}' for '{pMAC}' in {vendorsPath9}"])
return vendor
return -1 # MAC address not found in the database
except FileNotFoundError:

View File

@@ -65,7 +65,7 @@ def process_scan (db):
skip_repeated_notifications (db)
# Clear current scan as processed
db.sql.execute ("DELETE FROM CurrentScan")
db.sql.execute ("DELETE FROM CurrentScan")
# Commit changes
db.commitDB()

0
pialert/notification.py Normal file → Executable file
View File

View File

@@ -3,7 +3,7 @@ import json
import conf
from logger import mylog
from const import pluginsPath, logPath
from const import pluginsPath, logPath, apiPath
from helper import timeNowTZ, updateState, get_file_content, write_file, get_setting, get_setting_value
module_name = 'Plugin utils'