Files
NetAlertX/server
Mauricio CamayoandClaude Opus 5.5 8cee6b51bf WIFICANARY: bound the iw scan so a stuck one can't outlive the run
Core kills the plugin script when RUN_TIMEOUT is reached, but not its
children. A scan stuck on a busy or wedged radio (seen on a Pi Zero W
right after boot) left an orphaned `sudo iw dev wlan0 scan` spinning at
~70% CPU for as long as nobody killed it, slowing the whole host down.

The scan used the same timeout as core (RUN_TIMEOUT), so core always won
and the plugin's own TimeoutExpired handling never ran. Now `iw` runs
under `timeout -s KILL` inside sudo, RUN_TIMEOUT - 15s (min 10s), so it is
bounded even if the script itself gets killed, and the plugin logs the
timeout before core steps in. Works with the Docker image's sudo shim
(busybox timeout) and with real sudo (coreutils timeout).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 08:41:12 -05:00
..
2026-10-09 09:59:14 +11:00
2026-10-27 18:00:20 +11:00
2026-10-27 18:00:20 +11:00
2026-10-27 14:19:55 +11:00
2026-09-14 18:17:06 +10:00
2026-10-27 15:06:30 +11:00
2026-09-14 08:29:02 +10:00
…

NetAlertX modules

The original pilaert.py code is now moved to this new folder and split into different modules.

Module Description
__main__.py The MAIN program of NetAlertX
__init__.py an empty init file
README.md this readme file
../server/plugins a folder containing all plugins that publish notifications or scan for devices
api.py updating the API endpoints with the relevant data.
appevent.py TBC
const.py A place to define the constants for NetAlertX like log path or config path.
conf.py conf.py holds the configuration variables and makes them available for all modules. It is also the workaround for global variables that need to be resolved at some point
database.py This module connects to the DB, makes sure the DB is up to date and defines some standard queries and interfaces.
device.py The device module looks after the devices and saves the scan results into the devices
flows.py TBC
helper.py Helper as the name suggest contains multiple little functions and methods used in many of the other modules and helps keep things clean
initialise.py Initiatlise sets up the environment and makes everything ready to go
logger.py Logger is there the keep all the logs organised and looking identical.
networscan.py Networkscan collects the scan results (maybe to merge with reporting.py)
notification.py Creates and handles the notification object and generates ther HTML and text variants of the message
plugin.py This is where the plugins get integrated into the backend of NetAlertX
plugin_utils.py Helper utilities for plugin.py
reporting.py Reporting collects the data for the notification reports
scheduler.py All things scheduling