diff --git a/dockerfiles/README.md b/dockerfiles/README.md index 72bb525f..f77e0878 100755 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -44,8 +44,8 @@ docker run -d --rm --network=host \ | | Path | Description | | :------------- | :------------- |:-------------| -| **Required** | `:/home/pi/pialert/config` | Folder which will contain the `pialert.conf` file (see below for details) | -| **Required** | `:/home/pi/pialert/db` | Folder which will contain the `pialert.db` file | +| ⚠ **Required** | `:/home/pi/pialert/config` | Folder which will contain the `pialert.conf` file (see below for details) | +| ⚠ **Required** | `:/home/pi/pialert/db` | Folder which will contain the `pialert.db` file | |Optional| `:/home/pi/pialert/front/log` | Logs folder useful for debugging if you have issues setting up the container | |Optional| `:/etc/pihole/pihole-FTL.db` | PiHole's `pihole-FTL.db` database file. Required if you want to use PiHole | |Optional| `:/etc/pihole/dhcp.leases` | PiHole's `dhcp.leases` file. Required if you want to use PiHole `dhcp.leases` file. This has to be matched with a corresponding `DHCPLSS_paths_to_check` setting entry. (the path in the container must contain `pihole`)| diff --git a/docs/HW_INSTALL.md b/docs/HW_INSTALL.md index 768aa86b..2416c095 100755 --- a/docs/HW_INSTALL.md +++ b/docs/HW_INSTALL.md @@ -1,6 +1,6 @@ # How to install PiAlert on the server hardware -To download and install PiAlert on the hardware/server directly use `curl` or `wget` commands. +To download and install PiAlert on the hardware/server directly use the `curl` or `wget` commands at the bottom of this page. > [!NOTE] > This is an Experimental feature πŸ§ͺ and it relies on community support. @@ -32,13 +32,13 @@ Some facts about what and where something will be changed/installed by the HW in - Only tested to work on Debian Bookworm (Debian 12). - **EXPERIMENTAL** and not recommended way to install PiAlert. -## CURL +## πŸ“₯ Installation via CURL ```bash curl -o install.sh https://raw.githubusercontent.com/jokob-sk/Pi.Alert/main/install/install.sh && sudo chmod +x install.sh && sudo ./install.sh ``` -## WGET +## πŸ“₯ Installation via WGET ```bash wget https://raw.githubusercontent.com/jokob-sk/Pi.Alert/main/install/install.sh -O install.sh && sudo chmod +x install.sh && sudo ./install.sh diff --git a/docs/NETWORK_TREE.md b/docs/NETWORK_TREE.md index 64b0c803..21368df2 100755 --- a/docs/NETWORK_TREE.md +++ b/docs/NETWORK_TREE.md @@ -8,12 +8,11 @@ Make sure you have a root device with the MAC `Internet` (No other MAC addresses ## ⚑Quick setup: -* Go to Devices > Device Details. -* Find the device(s) you want to use as network devices (network nodes). -* Set the Type of such a device to one of the following: AP, Firewall, Gateway, PLC, Powerline, Router, Switch, USB LAN Adapter, USB WIFI Adapter and WLAN. +* Go to a Device you want to use as network device (network nodes, such as a Switch). +* Set the **Type** of such a device to one of the following: AP, Firewall, Gateway, PLC, Powerline, Router, Switch, USB LAN Adapter, USB WIFI Adapter and WLAN (you can create a custom network type device with in Settings -> General -> `NETWORK_DEVICE_TYPES`). * Save and go to Network where the devices you've marked as network devices (by selecting the Type as mentioned above) will show up as tabs. -* You can now assign the Unassigend devices to the correct network node. -* If port is empty or 0 a wifi icon is rendered, otherwise a ethernet port icon +* You can now assign the Unassigend devices to the network node. +* If port is empty or 0 a wifi icon is rendered, otherwise a ethernet port icon. > [!NOTE] @@ -46,7 +45,7 @@ In this example you will setup a device named `rapberrypi` as a `Switch` in our ![Network page](/docs/img/NETWORK_TREE/Network_Page.png) - Notice the newly added `raspberrypi` (2) tab which now represents a network node, also showing up in the tree (3). -- As we asssigned the `raspberrypi` in the previous 1) Device details page section to the `Internet` parent network node in step (6), the link is also showing up in the tree diagram (4) +- As we asssigned the `raspberrypi` in the previous (1) Device details page section to the `Internet` parent network node in step (6), the link is also showing up in the tree diagram (4) - We can now assign the device `(AppleTV)` (5) to this `raspberrypi` node, representing a network Switch in this example ### 3. Network page with 2 levels diff --git a/docs/README.md b/docs/README.md index 69359daf..3bed8e38 100755 --- a/docs/README.md +++ b/docs/README.md @@ -1,16 +1,27 @@ ## Documentation overview -In the app hover over settings or fields/labels or click blue in-app ❔ (question-mark) icons to get to relevant documentation pages. +
+ :information_source: In the app hover over settings or fields/labels or click blue in-app ❔ (question-mark) icons to get to relevant documentation pages. -![In-app help](/docs/img/GENERAL/in-app-help.png) + ![In-app help](/docs/img/GENERAL/in-app-help.png) + +
There is also an in-app Help / FAQ section that should be answering frequently asked questions. ### πŸ“₯ Installation - ⚠ Only tested as a [docker container - follow these instructions here](https://github.com/jokob-sk/Pi.Alert/blob/main/dockerfiles/README.md). - > Check out [leiweibau's fork](https://github.com/leiweibau/Pi.Alert/) if you want to install Pi.Alert on the server directly or original instructions for [pucherot's original code](https://github.com/pucherot/Pi.Alert/) +#### 🐳 Docker (Fully supported) +- The main installation method is as a [docker container - follow these instructions here](https://github.com/jokob-sk/Pi.Alert/blob/main/dockerfiles/README.md). + +#### πŸ’» Bare-metal / On-server (Experimental/community supported πŸ§ͺ) + +- [(Experimental πŸ§ͺ) On-hardware instructions](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/HW_INSTALL.md) + +- Alternative forks: + - [leiweibau's fork](https://github.com/leiweibau/Pi.Alert/) (maintained) + - [pucherot's original code](https://github.com/pucherot/Pi.Alert/) (un-maintained) ### πŸ“š Table of contents diff --git a/pialert/notification.py b/pialert/notification.py index e9264df3..6d190dfe 100755 --- a/pialert/notification.py +++ b/pialert/notification.py @@ -37,8 +37,16 @@ class Notification_obj: self.save() - # Create a new DB entry if new notiifcations available, otherwise skip - def create(self, JSON, Extra=""): + # Method to override processing of notifications + def on_before_create(self, JSON, Extra): + + return JSON, Extra + + + # Create a new DB entry if new notifications available, otherwise skip + def create(self, JSON, Extra=""): + + JSON, Extra = self.on_before_create(self, JSON, Extra) # Write output data for debug write_file (logPath + '/report_output.json', json.dumps(JSON))