Add notification support

testing 1669761100
Cole Deck 2 years ago
parent d62fa3b79f
commit 2680f78cd6

@ -2,7 +2,7 @@ core:
autostart: true
clockspeed: 20
interval: 10
level: 2
level: 3
localadmin: true
sftp:
filepath:
@ -16,4 +16,4 @@ sftp:
port: 22
user: ec2-user
ui:
darkmode: false
darkmode: true

@ -10,6 +10,7 @@ from util import find_data_file
from util import fprint
from util import kill
from util import run_cmd
from notification import send_notification
import taskbartool
import util
import netstat
@ -18,6 +19,7 @@ import auth
import panel
import block
history = list()
displaydata = None
settings = None
@ -215,9 +217,11 @@ def mainloop(pool):
tmplist = settings["badapps"]
settings["badapps"] = list()
for x in tmplist:
send_notification("Killing PID " + str(x))
kill(x)
if settings["fwll"] == True:
global history
tmplist = settings["badlines"]
tmpstat = settings["stats"]
tmpstat[0] += len(tmplist)
@ -227,8 +231,10 @@ def mainloop(pool):
badproto = line[1]
badip = line[4]
badport = line[5]
fprint("Firewalling " + badip + ":" + str(badport))
if (badip, badport) not in history:
fprint("Firewalling " + badip + ":" + str(badport))
send_notification("Firewalling " + badip + ":" + str(badport))
if win32:
cmd = 'New-NetFirewallRule -DisplayName "IPPigeon Security Rule ' + badip + ':' + str(badport) + '" -Group "IPPigeon" -Direction Outbound -LocalPort Any -Protocol ' + badproto + ' -Action Block -RemoteAddress ' + badip + ' -RemotePort ' + str(badport)
run_cmd(cmd)
@ -237,6 +243,7 @@ def mainloop(pool):
run_cmd(cmd)
else:
history.append((badip, badport))
settings["badapps"] = list()
if settings["applyconfig"] == True:

@ -5,4 +5,6 @@ cx_Freeze
pandas
pyyaml
numpy
bcrypt
bcrypt
plyer
playsound
Loading…
Cancel
Save