Compare commits

...

4 Commits

Author SHA1 Message Date
jokob-sk
8acb0a876a DOCS: cleanup
Some checks failed
Code checks / check-url-paths (push) Has been cancelled
Code checks / lint (push) Has been cancelled
Code checks / docker-tests (push) Has been cancelled
docker / docker_dev (push) Has been cancelled
Deploy MkDocs / deploy (push) Has been cancelled
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-26 10:20:19 +11:00
jokob-sk
d1be41eca4 DOCS: cleanup
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-26 10:02:15 +11:00
jokob-sk
00e953a7ce DOCS: cleanup
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-26 09:52:12 +11:00
jokob-sk
b9ef9ad041 DOCS: tmpfs cleanup
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-26 09:25:37 +11:00
25 changed files with 527 additions and 454 deletions

View File

@@ -34,20 +34,22 @@ Get visibility of what's going on on your WIFI/LAN network and enable presence d
## 🚀 Quick Start ## 🚀 Quick Start
> [!WARNING] > [!WARNING]
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed. > ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container. > If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
> These docs reflect the latest development version and may differ from the production image. > These docs reflect the latest development version and may differ from the production image.
Start NetAlertX in seconds with Docker: Start NetAlertX in seconds with Docker:
```bash ```bash
docker run -d --rm --network=host \ docker run -d \
--network=host \
--restart unless-stopped \
-v /local_data_dir/config:/data/config \ -v /local_data_dir/config:/data/config \
-v /local_data_dir/db:/data/db \ -v /local_data_dir/db:/data/db \
-v /etc/localtime:/etc/localtime \ -v /etc/localtime:/etc/localtime:ro \
--mount type=tmpfs,target=/tmp/api \ --tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
-e PORT=20211 \ -e PORT=20211 \
-e APP_CONF_OVERRIDE={"GRAPHQL_PORT":"20214"} \ -e APP_CONF_OVERRIDE='{"GRAPHQL_PORT":"20214"}' \
ghcr.io/jokob-sk/netalertx:latest ghcr.io/jokob-sk/netalertx:latest
``` ```
@@ -67,9 +69,9 @@ For other install methods, check the [installation docs](#-documentation)
| [📑 Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) | [🚀 Releases](https://github.com/jokob-sk/NetAlertX/releases) | [📚 Docs](https://jokob-sk.github.io/NetAlertX/) | [🔌 Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md) | [🤖 Ask AI](https://gurubase.io/g/netalertx) | [📑 Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) | [🚀 Releases](https://github.com/jokob-sk/NetAlertX/releases) | [📚 Docs](https://jokob-sk.github.io/NetAlertX/) | [🔌 Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md) | [🤖 Ask AI](https://gurubase.io/g/netalertx)
|----------------------| ----------------------| ----------------------| ----------------------| ----------------------| |----------------------| ----------------------| ----------------------| ----------------------| ----------------------|
![showcase][showcase] ![showcase][showcase]
<details> <details>
<summary>📷 Click for more screenshots</summary> <summary>📷 Click for more screenshots</summary>
@@ -87,15 +89,15 @@ For other install methods, check the [installation docs](#-documentation)
### Scanners ### Scanners
The app scans your network for **New devices**, **New connections** (re-connections), **Disconnections**, **"Always Connected" devices down**, Devices **IP changes** and **Internet IP address changes**. Discovery & scan methods include: **arp-scan**, **Pi-hole - DB import**, **Pi-hole - DHCP leases import**, **Generic DHCP leases import**, **UNIFI controller import**, **SNMP-enabled router import**. Check the [Plugins](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) docs for a full list of avaliable plugins. The app scans your network for **New devices**, **New connections** (re-connections), **Disconnections**, **"Always Connected" devices down**, Devices **IP changes** and **Internet IP address changes**. Discovery & scan methods include: **arp-scan**, **Pi-hole - DB import**, **Pi-hole - DHCP leases import**, **Generic DHCP leases import**, **UNIFI controller import**, **SNMP-enabled router import**. Check the [Plugins](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) docs for a full list of avaliable plugins.
### Notification gateways ### Notification gateways
Send notifications to more than 80+ services, including Telegram via [Apprise](https://hub.docker.com/r/caronc/apprise), or use native [Pushsafer](https://www.pushsafer.com/), [Pushover](https://www.pushover.net/), or [NTFY](https://ntfy.sh/) publishers. Send notifications to more than 80+ services, including Telegram via [Apprise](https://hub.docker.com/r/caronc/apprise), or use native [Pushsafer](https://www.pushsafer.com/), [Pushover](https://www.pushover.net/), or [NTFY](https://ntfy.sh/) publishers.
### Integrations and Plugins ### Integrations and Plugins
Feed your data and device changes into [Home Assistant](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HOME_ASSISTANT.md), read [API endpoints](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md), or use [Webhooks](https://github.com/jokob-sk/NetAlertX/blob/main/docs/WEBHOOK_N8N.md) to setup custom automation flows. You can also Feed your data and device changes into [Home Assistant](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HOME_ASSISTANT.md), read [API endpoints](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md), or use [Webhooks](https://github.com/jokob-sk/NetAlertX/blob/main/docs/WEBHOOK_N8N.md) to setup custom automation flows. You can also
build your own scanners with the [Plugin system](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) in as little as [15 minutes](https://www.youtube.com/watch?v=cdbxlwiWhv8). build your own scanners with the [Plugin system](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) in as little as [15 minutes](https://www.youtube.com/watch?v=cdbxlwiWhv8).
### Workflows ### Workflows
@@ -108,10 +110,10 @@ The [workflows module](https://github.com/jokob-sk/NetAlertX/blob/main/docs/WORK
Supported browsers: Chrome, Firefox Supported browsers: Chrome, Firefox
- [[Installation] Docker](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) - [[Installation] Docker](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md)
- [[Installation] Home Assistant](https://github.com/alexbelgium/hassio-addons/tree/master/netalertx) - [[Installation] Home Assistant](https://github.com/alexbelgium/hassio-addons/tree/master/netalertx)
- [[Installation] Bare metal](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md) - [[Installation] Bare metal](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md)
- [[Installation] Unraid App](https://unraid.net/community/apps) - [[Installation] Unraid App](https://unraid.net/community/apps)
- [[Setup] Usage and Configuration](https://github.com/jokob-sk/NetAlertX/blob/main/docs/README.md) - [[Setup] Usage and Configuration](https://github.com/jokob-sk/NetAlertX/blob/main/docs/README.md)
- [[Development] API docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) - [[Development] API docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md)
- [[Development] Custom Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS_DEV.md) - [[Development] Custom Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS_DEV.md)
@@ -132,19 +134,19 @@ See [Security Best Practices](https://github.com/jokob-sk/NetAlertX/security) fo
## ❓ FAQ ## ❓ FAQ
**Q: Why dont I see any devices?** **Q: Why dont I see any devices?**
A: Ensure the container has proper network access (e.g., use `--network host` on Linux). Also check that your scan method is properly configured in the UI. A: Ensure the container has proper network access (e.g., use `--network host` on Linux). Also check that your scan method is properly configured in the UI.
**Q: Does this work on Wi-Fi-only devices like Raspberry Pi?** **Q: Does this work on Wi-Fi-only devices like Raspberry Pi?**
A: Yes, but some scanners (e.g. ARP) work best on Ethernet. For Wi-Fi, try SNMP, DHCP, or Pi-hole import. A: Yes, but some scanners (e.g. ARP) work best on Ethernet. For Wi-Fi, try SNMP, DHCP, or Pi-hole import.
**Q: Will this send any data to the internet?** **Q: Will this send any data to the internet?**
A: No. All scans and data remain local, unless you set up cloud-based notifications. A: No. All scans and data remain local, unless you set up cloud-based notifications.
**Q: Can I use this without Docker?** **Q: Can I use this without Docker?**
A: Yes! You can install it bare-metal. See the [bare metal installation guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md). A: Yes! You can install it bare-metal. See the [bare metal installation guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md).
**Q: Where is the data stored?** **Q: Where is the data stored?**
A: In the `/data/config` and `/data/db` folders. Back up these folders regularly. A: In the `/data/config` and `/data/db` folders. Back up these folders regularly.
@@ -162,9 +164,9 @@ Check the [GitHub Issues](https://github.com/jokob-sk/NetAlertX/issues) for the
### 📧 Get notified what's new ### 📧 Get notified what's new
Get notified about a new release, what new functionality you can use and about breaking changes. Get notified about a new release, what new functionality you can use and about breaking changes.
![Follow and star][follow_star] ![Follow and star][follow_star]
### 🔀 Other Alternative Apps ### 🔀 Other Alternative Apps
@@ -175,15 +177,15 @@ Get notified about a new release, what new functionality you can use and about b
### 💙 Donations ### 💙 Donations
Thank you to everyone who appreciates this tool and donates. Thank you to everyone who appreciates this tool and donates.
<details> <details>
<summary>Click for more ways to donate</summary> <summary>Click for more ways to donate</summary>
<hr> <hr>
| [![GitHub](https://i.imgur.com/emsRCPh.png)](https://github.com/sponsors/jokob-sk) | [![Buy Me A Coffee](https://i.imgur.com/pIM6YXL.png)](https://www.buymeacoffee.com/jokobsk) | [![Patreon](https://i.imgur.com/MuYsrq1.png)](https://www.patreon.com/user?u=84385063) | | [![GitHub](https://i.imgur.com/emsRCPh.png)](https://github.com/sponsors/jokob-sk) | [![Buy Me A Coffee](https://i.imgur.com/pIM6YXL.png)](https://www.buymeacoffee.com/jokobsk) | [![Patreon](https://i.imgur.com/MuYsrq1.png)](https://www.patreon.com/user?u=84385063) |
| --- | --- | --- | | --- | --- | --- |
- Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM` - Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM`
- Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7` - Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7`
@@ -194,11 +196,11 @@ Thank you to everyone who appreciates this tool and donates.
### 🏗 Contributors ### 🏗 Contributors
This project would be nothing without the amazing work of the community, with special thanks to: This project would be nothing without the amazing work of the community, with special thanks to:
> [pucherot/Pi.Alert](https://github.com/pucherot/Pi.Alert) (the original creator of PiAlert), [leiweibau](https://github.com/leiweibau/Pi.Alert): Dark mode (and much more), [Macleykun](https://github.com/Macleykun) (Help with Dockerfile clean-up), [vladaurosh](https://github.com/vladaurosh) for Alpine re-base help, [Final-Hawk](https://github.com/Final-Hawk) (Help with NTFY, styling and other fixes), [TeroRERO](https://github.com/terorero) (Spanish translations), [Data-Monkey](https://github.com/Data-Monkey), (Split-up of the python.py file and more), [cvc90](https://github.com/cvc90) (Spanish translation and various UI work) to name a few. Check out all the [amazing contributors](https://github.com/jokob-sk/NetAlertX/graphs/contributors). > [pucherot/Pi.Alert](https://github.com/pucherot/Pi.Alert) (the original creator of PiAlert), [leiweibau](https://github.com/leiweibau/Pi.Alert): Dark mode (and much more), [Macleykun](https://github.com/Macleykun) (Help with Dockerfile clean-up), [vladaurosh](https://github.com/vladaurosh) for Alpine re-base help, [Final-Hawk](https://github.com/Final-Hawk) (Help with NTFY, styling and other fixes), [TeroRERO](https://github.com/terorero) (Spanish translations), [Data-Monkey](https://github.com/Data-Monkey), (Split-up of the python.py file and more), [cvc90](https://github.com/cvc90) (Spanish translation and various UI work) to name a few. Check out all the [amazing contributors](https://github.com/jokob-sk/NetAlertX/graphs/contributors).
### 🌍 Translations ### 🌍 Translations
Proudly using [Weblate](https://hosted.weblate.org/projects/pialert/). Help out and suggest languages in the [online portal of Weblate](https://hosted.weblate.org/projects/pialert/core/). Proudly using [Weblate](https://hosted.weblate.org/projects/pialert/). Help out and suggest languages in the [online portal of Weblate](https://hosted.weblate.org/projects/pialert/core/).

View File

@@ -1,66 +1,114 @@
### Loading... # Troubleshooting Common Issues
Often if the application is misconfigured the `Loading...` dialog is continuously displayed. This is most likely caused by the backed failing to start. The **Maintenance -> Logs** section should give you more details on what's happening. If there is no exception, check the Portainer log, or start the container in the foreground (without the `-d` parameter) to observe any exceptions. It's advisable to enable `trace` or `debug`. Check the [Debug tips](./DEBUG_TIPS.md) on detailed instructions. > [!TIP]
> Before troubleshooting, ensure you have set the correct [Debugging and LOG_LEVEL](./DEBUG_TIPS.md).
The issue might be related to the backend server, so please check [Debugging GraphQL issues](./DEBUG_API_SERVER.md). ---
Please also check the browser logs (usually accessible by pressing `F12`): ## Docker Container Doesn't Start
1. Switch to the Console tab and refresh the page Initial setup issues are often caused by **missing permissions** or **incorrectly mapped volumes**. Always double-check your `docker run` or `docker-compose.yml` against the [official setup guide](./DOCKER_INSTALLATION.md) before proceeding.
2. Switch to teh Network tab and refresh the page
If you are not sure how to resolve the errors yourself, please post screenshots of the above into the issue, or discord discussion, where your problem is being solved.
### Incorrect SCAN_SUBNETS
One of the most common issues is not configuring `SCAN_SUBNETS` correctly. If this setting is misconfigured you will only see one or two devices in your devices list after a scan. Please read the [subnets docs](./SUBNETS.md) carefully to resolve this.
### Duplicate devices and notifications
The app uses the MAC address as an unique identifier for devices. If a new MAC is detected a new device is added to the application and corresponding notifications are triggered. This means that if the MAC of an existing device changes, the device will be logged as a new device. You can usually prevent this from happening by changing the device configuration (in Android, iOS, or Windows) for your network. See the [Random Macs](./RANDOM_MAC.md) guide for details.
### Permissions ### Permissions
Make sure you [File permissions](./FILE_PERMISSIONS.md) are set correctly. Make sure your [file permissions](./FILE_PERMISSIONS.md) are correctly set:
* If facing issues (AJAX errors, can't write to DB, empty screen, etc,) make sure permissions are set correctly, and check the logs under `/tmp/log`. * If you encounter AJAX errors, cannot write to the database, or see an empty screen, check that permissions are correct and review the logs under `/tmp/log`.
* To solve permission issues you can try setting the owner and group of the `app.db` by executing the following on the host system: `docker exec netalertx chown -R www-data:www-data /data/db/app.db`. * To fix permission issues with the database, update the owner and group of `app.db` as described in the [File Permissions guide](./FILE_PERMISSIONS.md).
* If still facing issues, try to map the app.db file (⚠ not folder) to `:/data/db/app.db` (see [docker-compose Examples](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#-docker-composeyml-examples) for details)
### Container restarts / crashes ### Container Restarts / Crashes
* Check the logs for details. Often a required setting for a notification method is missing. * Check the logs for details. Often, required settings are missing.
* For more detailed troubleshooting, see [Debug and Troubleshooting Tips](./DEBUG_TIPS.md).
* To observe errors directly, run the container in the foreground instead of `-d`:
### unable to resolve host ```bash
docker run --rm -it <your_image>
```
* Check that your `SCAN_SUBNETS` variable is using the correct mask and `--interface`. See the [subnets docs for details](./SUBNETS.md). ---
### Invalid JSON ## Docker Container Starts, But the Application Misbehaves
Check the [Invalid JSON errors debug help](./DEBUG_INVALID_JSON.md) docs on how to proceed. If the container starts but the app shows unexpected behavior, the cause is often **data corruption**, **incorrect configuration**, or **unexpected input data**.
### sudo execution failing (e.g.: on arpscan) on a Raspberry Pi 4 ### Continuous "Loading..." Screen
> sudo: unexpected child termination condition: 0 A misconfigured application may display a persistent `Loading...` dialog. This is usually caused by the backend failing to start.
Resolution based on [this issue](https://github.com/linuxserver/docker-papermerge/issues/4#issuecomment-1003657581) **Steps to troubleshoot:**
1. Check **Maintenance → Logs** for exceptions.
2. If no exception is visible, check the Portainer logs.
3. Start the container in the foreground to observe exceptions.
4. Enable `trace` or `debug` logging for detailed output (see [Debug Tips](./DEBUG_TIPS.md)).
5. Verify that `GRAPHQL_PORT` is correctly configured.
6. Check browser logs (press `F12`):
* **Console tab** → refresh the page
* **Network tab** → refresh the page
If you are unsure how to resolve errors, provide screenshots or log excerpts in your issue report or Discord discussion.
---
### Common Configuration Issues
#### Incorrect `SCAN_SUBNETS`
If `SCAN_SUBNETS` is misconfigured, you may see only a few devices in your device list after a scan. See the [Subnets Documentation](./SUBNETS.md) for proper configuration.
#### Duplicate Devices and Notifications
* Devices are identified by their **MAC address**.
* If a device's MAC changes, it will be treated as a new device, triggering notifications.
* Prevent this by adjusting your device configuration for Android, iOS, or Windows. See the [Random MACs Guide](./RANDOM_MAC.md).
#### Unable to Resolve Host
* Ensure `SCAN_SUBNETS` uses the correct mask and `--interface`.
* Refer to the [Subnets Documentation](./SUBNETS.md) for detailed guidance.
#### Invalid JSON Errors
* Follow the steps in [Invalid JSON Errors Debug Help](./DEBUG_INVALID_JSON.md).
#### Sudo Execution Fails (e.g., on arpscan on Raspberry Pi 4)
Error:
``` ```
sudo: unexpected child termination condition: 0
```
**Resolution**:
```bash
wget ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.3-2_armhf.deb wget ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.3-2_armhf.deb
sudo dpkg -i libseccomp2_2.5.3-2_armhf.deb sudo dpkg -i libseccomp2_2.5.3-2_armhf.deb
``` ```
The link above will probably break in time too. Go to https://packages.debian.org/sid/armhf/libseccomp2/download to find the new version number and put that in the url. > ⚠️ The link may break over time. Check [Debian Packages](https://packages.debian.org/sid/armhf/libseccomp2/download) for the latest version.
### Only Router and own device show up #### Only Router and Own Device Show Up
Make sure that the subnet and interface in `SCAN_SUBNETS` are correct. If your device/NAS has multiple ethernet ports, you probably need to change `eth0` to something else. * Verify the subnet and interface in `SCAN_SUBNETS`.
* On devices with multiple Ethernet ports, you may need to change `eth0` to the correct interface.
### Losing my settings and devices after an update #### Losing Settings or Devices After Update
If you lose your devices and/or settings after an update that means you don't have the `/data/db` and `/data/config` folders mapped to a permanent storage. That means every time you update these folders are re-created. Make sure you have the [volumes specified correctly](./DOCKER_COMPOSE.md) in your `docker-compose.yml` or run command. * Ensure `/data/db` and `/data/config` are mapped to persistent storage.
* Without persistent volumes, these folders are recreated on every update.
* See [Docker Volumes Setup](./DOCKER_COMPOSE.md) for proper configuration.
#### Application Performance Issues
### The application is slow Slowness can be caused by:
* Incorrect settings (causing app restarts) → check `app.log`.
* Too many background processes → disable unnecessary scanners.
* Long scans → limit the number of scanned devices.
* Excessive disk operations or failing maintenance plugins.
> See [Performance Tips](./PERFORMANCE.md) for detailed optimization steps.
Slowness is usually caused by incorrect settings (the app might restart, so check the `app.log`), too many background processes (disable unnecessary scanners), too long scans (limit the number of scanned devices), too many disk operations, or some maintenance plugins might have failed. See the [Performance tips](./PERFORMANCE.md) docs for details.

View File

@@ -1,12 +1,12 @@
# Debugging GraphQL server issues # Debugging GraphQL server issues
The GraphQL server is an API middle layer, running on it's own port specified by `GRAPHQL_PORT`, to retrieve and show the data in the UI. It can also be used to retrieve data for custom third party integarions. Check the [API documentation](./API.md) for details. The GraphQL server is an API middle layer, running on it's own port specified by `GRAPHQL_PORT`, to retrieve and show the data in the UI. It can also be used to retrieve data for custom third party integarions. Check the [API documentation](./API.md) for details.
The most common issue is that the GraphQL server doesn't start properly, usually due to a **port conflict**. If you are running multiple NetAlertX instances, make sure to use **unique ports** by changing the `GRAPHQL_PORT` setting. The default is `20212`. The most common issue is that the GraphQL server doesn't start properly, usually due to a **port conflict**. If you are running multiple NetAlertX instances, make sure to use **unique ports** by changing the `GRAPHQL_PORT` setting. The default is `20212`.
## How to update the `GRAPHQL_PORT` in case of issues ## How to update the `GRAPHQL_PORT` in case of issues
As a first troubleshooting step try changing the default `GRAPHQL_PORT` setting. Please remember NetAlertX is running on the host so any application uising the same port will cause issues. As a first troubleshooting step try changing the default `GRAPHQL_PORT` setting. Please remember NetAlertX is running on the host so any application uising the same port will cause issues.
### Updating the setting via the Settings UI ### Updating the setting via the Settings UI
@@ -14,7 +14,7 @@ Ideally use the Settings UI to update the setting under General -> Core -> Graph
![GrapQL settings](./img/DEBUG_API_SERVER/graphql_settings_port_token.png) ![GrapQL settings](./img/DEBUG_API_SERVER/graphql_settings_port_token.png)
You might need to temporarily stop other applications or NetAlertX instances causing conflicts to update the setting. The `API_TOKEN` is used to authenticate any API calls, including GraphQL requests. You might need to temporarily stop other applications or NetAlertX instances causing conflicts to update the setting. The `API_TOKEN` is used to authenticate any API calls, including GraphQL requests.
### Updating the `app.conf` file ### Updating the `app.conf` file
@@ -24,7 +24,7 @@ If the UI is not accessible, you can directly edit the `app.conf` file in your `
### Using a docker variable ### Using a docker variable
All application settings can also be initialized via the `APP_CONF_OVERRIDE` docker env variable. All application settings can also be initialized via the `APP_CONF_OVERRIDE` docker env variable.
```yaml ```yaml
... ...

View File

@@ -3,13 +3,13 @@
Check the the HTTP response of the failing backend call by following these steps: Check the the HTTP response of the failing backend call by following these steps:
- Open developer console in your browser (usually, e. g. for Chrome, key F12 on the keyboard). - Open developer console in your browser (usually, e. g. for Chrome, key F12 on the keyboard).
- Follow the steps in this screenshot: - Follow the steps in this screenshot:
![F12DeveloperConsole][F12DeveloperConsole] ![F12DeveloperConsole][F12DeveloperConsole]
- Copy the URL causing the error and enter it in the address bar of your browser directly and hit enter. The copied URLs could look something like this (notice the query strings at the end): - Copy the URL causing the error and enter it in the address bar of your browser directly and hit enter. The copied URLs could look something like this (notice the query strings at the end):
- `http://<NetAlertX URL>:20211/api/table_devices.json?nocache=1704141103121` - `http://<server>:20211/api/table_devices.json?nocache=1704141103121`
- `http://<NetAlertX URL>:20211/php/server/devices.php?action=getDevicesTotals` - `http://<server>:20211/php/server/devices.php?action=getDevicesTotals`
- Post the error response in the existing issue thread on GitHub or create a new issue and include the redacted response of the failing query. - Post the error response in the existing issue thread on GitHub or create a new issue and include the redacted response of the failing query.

View File

@@ -1,5 +1,8 @@
# Troubleshooting plugins # Troubleshooting plugins
> [!TIP]
> Before troubleshooting, please ensure you have the right [Debugging and LOG_LEVEL set](./DEBUG_TIPS.md).
## High-level overview ## High-level overview
If a Plugin supplies data to the main app it's done either vie a SQL query or via a script that updates the `last_result.log` file in the plugin log folder (`app/log/plugins/`). If a Plugin supplies data to the main app it's done either vie a SQL query or via a script that updates the `last_result.log` file in the plugin log folder (`app/log/plugins/`).
@@ -9,7 +12,7 @@ For a more in-depth overview on how plugins work check the [Plugins development
### Prerequisites ### Prerequisites
- Make sure you read and followed the specific plugin setup instructions. - Make sure you read and followed the specific plugin setup instructions.
- Ensure you have [debug enabled (see More Logging)](./DEBUG_TIPS.md) - Ensure you have [debug enabled (see More Logging)](./DEBUG_TIPS.md)
### Potential issues ### Potential issues
@@ -47,9 +50,9 @@ Input data from the plugin might cause mapping issues in specific edge cases. Lo
17:31:05 [Plugins] history_to_insert count: 4 17:31:05 [Plugins] history_to_insert count: 4
17:31:05 [Plugins] objects_to_insert count: 0 17:31:05 [Plugins] objects_to_insert count: 0
17:31:05 [Plugins] objects_to_update count: 4 17:31:05 [Plugins] objects_to_update count: 4
17:31:05 [Plugin utils] In pluginEvents there are 2 events with the status "watched-not-changed" 17:31:05 [Plugin utils] In pluginEvents there are 2 events with the status "watched-not-changed"
17:31:05 [Plugin utils] In pluginObjects there are 2 events with the status "missing-in-last-scan" 17:31:05 [Plugin utils] In pluginObjects there are 2 events with the status "missing-in-last-scan"
17:31:05 [Plugin utils] In pluginObjects there are 2 events with the status "watched-not-changed" 17:31:05 [Plugin utils] In pluginObjects there are 2 events with the status "watched-not-changed"
17:31:05 [Plugins] Mapping objects to database table: CurrentScan 17:31:05 [Plugins] Mapping objects to database table: CurrentScan
17:31:05 [Plugins] SQL query for mapping: INSERT into CurrentScan ( "cur_MAC", "cur_IP", "cur_LastQuery", "cur_Name", "cur_Vendor", "cur_ScanMethod") VALUES ( ?, ?, ?, ?, ?, ?) 17:31:05 [Plugins] SQL query for mapping: INSERT into CurrentScan ( "cur_MAC", "cur_IP", "cur_LastQuery", "cur_Name", "cur_Vendor", "cur_ScanMethod") VALUES ( ?, ?, ?, ?, ?, ?)
17:31:05 [Plugins] SQL sqlParams for mapping: [('01:01:01:01:01:01', '172.30.0.1', 0, 'aaaa', 'vvvvvvvvv', 'PIHOLE'), ('02:42:ac:1e:00:02', '172.30.0.2', 0, 'dddd', 'vvvvv2222', 'PIHOLE')] 17:31:05 [Plugins] SQL sqlParams for mapping: [('01:01:01:01:01:01', '172.30.0.1', 0, 'aaaa', 'vvvvvvvvv', 'PIHOLE'), ('02:42:ac:1e:00:02', '172.30.0.2', 0, 'dddd', 'vvvvv2222', 'PIHOLE')]
@@ -80,7 +83,7 @@ These values, if formatted correctly, will also show up in the UI:
### Sharing application state ### Sharing application state
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong. Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files). 1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
2. Wait for the issue to occur. 2. Wait for the issue to occur.

View File

@@ -1,30 +1,35 @@
# Debugging and troubleshooting # Debugging and troubleshooting
Please follow tips 1 - 4 to get a more detailed error. Please follow tips 1 - 4 to get a more detailed error.
## 1. More Logging ## 1. More Logging
When debugging an issue always set the highest log level: When debugging an issue always set the highest log level:
`LOG_LEVEL='trace'` `LOG_LEVEL='trace'`
## 2. Surfacing errors when container restarts ## 2. Surfacing errors when container restarts
Start the container via the **terminal** with a command similar to this one: Start the container via the **terminal** with a command similar to this one:
```bash ```bash
docker run --rm --network=host \ docker run \
-v /local_data_dir/netalertx/config:/data/config \ --network=host \
-v /local_data_dir/netalertx/db:/data/db \ --restart unless-stopped \
-v /etc/localtime:/etc/localtime \ -v /local_data_dir/config:/data/config \
-v /local_data_dir/db:/data/db \
-v /etc/localtime:/etc/localtime:ro \
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
-e PORT=20211 \ -e PORT=20211 \
-e APP_CONF_OVERRIDE='{"GRAPHQL_PORT":"20214"}' \
ghcr.io/jokob-sk/netalertx:latest ghcr.io/jokob-sk/netalertx:latest
``` ```
> ⚠ Please note, don't use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description. > [!NOTE]
> ⚠ The most important part is NOT to use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description.
## 3. Check the _dev image and open issues ## 3. Check the _dev image and open issues
If possible, check if your issue got fixed in the `_dev` image before opening a new issue. The container is: If possible, check if your issue got fixed in the `_dev` image before opening a new issue. The container is:
@@ -34,7 +39,7 @@ If possible, check if your issue got fixed in the `_dev` image before opening a
Please also search [open issues](https://github.com/jokob-sk/NetAlertX/issues). Please also search [open issues](https://github.com/jokob-sk/NetAlertX/issues).
## 4. Disable restart behavior ## 4. Disable restart behavior
To prevent a Docker container from automatically restarting in a Docker Compose file, specify the restart policy as `no`: To prevent a Docker container from automatically restarting in a Docker Compose file, specify the restart policy as `no`:
@@ -48,9 +53,14 @@ services:
# Other service configurations... # Other service configurations...
``` ```
## 5. Sharing application state ## 5. TMP mount directories to rule host out permission issues
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong. Try starting the container with all data to be in non-persistent volumes. If this works, the issue might be related to the permissions of your persistent data mount locations on your server. See teh [Permissions guide](./FILE_PERMISSIONS.md) for details.
## 6. Sharing application state
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files). 1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
2. Wait for the issue to occur. 2. Wait for the issue to occur.
@@ -61,4 +71,4 @@ Sometimes specific log sections are needed to debug issues. The Devices and Curr
## Common issues ## Common issues
See [Common issues](./COMMON_ISSUES.md) for details. See [Common issues](./COMMON_ISSUES.md) for additional troubleshooting tips.

View File

@@ -4,8 +4,8 @@ NetAlertX allows you to mass-edit devices via a CSV export and import feature, o
## UI multi edit ## UI multi edit
> [!NOTE] > [!NOTE]
> Make sure you have your backups saved and restorable before doing any mass edits. Check [Backup strategies](./BACKUPS.md). > Make sure you have your backups saved and restorable before doing any mass edits. Check [Backup strategies](./BACKUPS.md).
You can select devices in the _Devices_ view by selecting devices to edit and then clicking the _Multi-edit_ button or via the _Maintenance_ > _Multi-Edit_ section. You can select devices in the _Devices_ view by selecting devices to edit and then clicking the _Multi-edit_ button or via the _Maintenance_ > _Multi-Edit_ section.
@@ -16,23 +16,23 @@ You can select devices in the _Devices_ view by selecting devices to edit and th
The database and device structure may change with new releases. When using the CSV import functionality, ensure the format matches what the application expects. To avoid issues, you can first export the devices and review the column formats before importing any custom data. The database and device structure may change with new releases. When using the CSV import functionality, ensure the format matches what the application expects. To avoid issues, you can first export the devices and review the column formats before importing any custom data.
> [!NOTE] > [!NOTE]
> As always, backup everything, just in case. > As always, backup everything, just in case.
1. In _Maintenance_ > _Backup / Restore_ click the _CSV Export_ button. 1. In _Maintenance_ > _Backup / Restore_ click the _CSV Export_ button.
2. A `devices.csv` is generated in the `/config` folder 2. A `devices.csv` is generated in the `/config` folder
3. Edit the `devices.csv` file however you like. 3. Edit the `devices.csv` file however you like.
![Maintenance > CSV Export](./img/DEVICES_BULK_EDITING/MAINTENANCE_CSV_EXPORT.png) ![Maintenance > CSV Export](./img/DEVICES_BULK_EDITING/MAINTENANCE_CSV_EXPORT.png)
> [!NOTE] > [!NOTE]
> The file containing a list of Devices including the Network relationships between Network Nodes and connected devices. You can also trigger this by acessing this URL: `<your netalertx url>/php/server/devices.php?action=ExportCSV` or via the `CSV Backup` plugin. (💡 You can schedule this) > The file containing a list of Devices including the Network relationships between Network Nodes and connected devices. You can also trigger this by acessing this URL: `<server>:20211/php/server/devices.php?action=ExportCSV` or via the `CSV Backup` plugin. (💡 You can schedule this)
![Settings > CSV Backup](./img/DEVICES_BULK_EDITING/CSV_BACKUP_SETTINGS.png) ![Settings > CSV Backup](./img/DEVICES_BULK_EDITING/CSV_BACKUP_SETTINGS.png)
### File encoding format ### File encoding format
> [!NOTE] > [!NOTE]
> Keep Linux line endings (suggested editors: Nano, Notepad++) > Keep Linux line endings (suggested editors: Nano, Notepad++)
![Nodepad++ line endings](./img/DEVICES_BULK_EDITING/NOTEPAD++.png) ![Nodepad++ line endings](./img/DEVICES_BULK_EDITING/NOTEPAD++.png)

View File

@@ -7,7 +7,7 @@
# NetAlertX - Network scanner & notification framework # NetAlertX - Network scanner & notification framework
| [📑 Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) | [🚀 Releases](https://github.com/jokob-sk/NetAlertX/releases) | [📚 Docs](https://jokob-sk.github.io/NetAlertX/) | [🔌 Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md) | [🤖 Ask AI](https://gurubase.io/g/netalertx) | [📑 Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) | [🚀 Releases](https://github.com/jokob-sk/NetAlertX/releases) | [📚 Docs](https://jokob-sk.github.io/NetAlertX/) | [🔌 Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md) | [🤖 Ask AI](https://gurubase.io/g/netalertx)
|----------------------| ----------------------| ----------------------| ----------------------| ----------------------| |----------------------| ----------------------| ----------------------| ----------------------| ----------------------|
<a href="https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/docs/img/GENERAL/github_social_image.jpg" target="_blank"> <a href="https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/docs/img/GENERAL/github_social_image.jpg" target="_blank">
<img src="https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/docs/img/GENERAL/github_social_image.jpg" width="1000px" /> <img src="https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/docs/img/GENERAL/github_social_image.jpg" width="1000px" />
@@ -16,9 +16,9 @@
Head to [https://netalertx.com/](https://netalertx.com/) for more gifs and screenshots 📷. Head to [https://netalertx.com/](https://netalertx.com/) for more gifs and screenshots 📷.
> [!NOTE] > [!NOTE]
> There is also an experimental 🧪 [bare-metal install](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md) method available. > There is also an experimental 🧪 [bare-metal install](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md) method available.
## 📕 Basic Usage ## 📕 Basic Usage
> [!WARNING] > [!WARNING]
> You will have to run the container on the `host` network and specify `SCAN_SUBNETS` unless you use other [plugin scanners](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). The initial scan can take a few minutes, so please wait 5-10 minutes for the initial discovery to finish. > You will have to run the container on the `host` network and specify `SCAN_SUBNETS` unless you use other [plugin scanners](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). The initial scan can take a few minutes, so please wait 5-10 minutes for the initial discovery to finish.
@@ -28,7 +28,7 @@ docker run -d --rm --network=host \
-v /local_data_dir/config:/data/config \ -v /local_data_dir/config:/data/config \
-v /local_data_dir/db:/data/db \ -v /local_data_dir/db:/data/db \
-v /etc/localtime:/etc/localtime \ -v /etc/localtime:/etc/localtime \
--mount type=tmpfs,target=/tmp/api \ --tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
-e PORT=20211 \ -e PORT=20211 \
-e APP_CONF_OVERRIDE={"GRAPHQL_PORT":"20214"} \ -e APP_CONF_OVERRIDE={"GRAPHQL_PORT":"20214"} \
ghcr.io/jokob-sk/netalertx:latest ghcr.io/jokob-sk/netalertx:latest
@@ -58,49 +58,49 @@ See alternative [docked-compose examples](https://github.com/jokob-sk/NetAlertX/
### Docker paths ### Docker paths
> [!NOTE] > [!NOTE]
> See also [Backup strategies](https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md). > See also [Backup strategies](https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md).
| Required | Path | Description | | Required | Path | Description |
| :------------- | :------------- | :-------------| | :------------- | :------------- | :-------------|
| ✅ | `:/data/config` | Folder which will contain the `app.conf` & `devices.csv` ([read about devices.csv](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md)) files | | ✅ | `:/data/config` | Folder which will contain the `app.conf` & `devices.csv` ([read about devices.csv](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md)) files |
| ✅ | `:/data/db` | Folder which will contain the `app.db` database file | | ✅ | `:/data/db` | Folder which will contain the `app.db` database file |
| ✅ | `/etc/localtime:/etc/localtime:ro` | Ensuring the timezone is teh same as on teh server. | | ✅ | `/etc/localtime:/etc/localtime:ro` | Ensuring the timezone is teh same as on teh server. |
| | `:/tmp/log` | Logs folder useful for debugging if you have issues setting up the container | | | `:/tmp/log` | Logs folder useful for debugging if you have issues setting up the container |
| | `:/tmp/api` | The [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. Path configurable via `NETALERTX_API` environment variable. | | | `:/tmp/api` | The [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. Path configurable via `NETALERTX_API` environment variable. |
| | `:/app/front/plugins/<plugin>/ignore_plugin` | Map a file `ignore_plugin` to ignore a plugin. Plugins can be soft-disabled via settings. More in the [Plugin docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). | | | `:/app/front/plugins/<plugin>/ignore_plugin` | Map a file `ignore_plugin` to ignore a plugin. Plugins can be soft-disabled via settings. More in the [Plugin docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). |
| | `:/etc/resolv.conf` | Use a custom `resolv.conf` file for [better name resolution](https://github.com/jokob-sk/NetAlertX/blob/main/docs/REVERSE_DNS.md). | | | `:/etc/resolv.conf` | Use a custom `resolv.conf` file for [better name resolution](https://github.com/jokob-sk/NetAlertX/blob/main/docs/REVERSE_DNS.md). |
> Use separate `db` and `config` directories, do not nest them. > Use separate `db` and `config` directories, do not nest them.
### Initial setup ### Initial setup
- If unavailable, the app generates a default `app.conf` and `app.db` file on the first run. - If unavailable, the app generates a default `app.conf` and `app.db` file on the first run.
- The preferred way is to manage the configuration via the Settings section in the UI, if UI is inaccessible you can modify [app.conf](https://github.com/jokob-sk/NetAlertX/tree/main/back) in the `/data/config/` folder directly - The preferred way is to manage the configuration via the Settings section in the UI, if UI is inaccessible you can modify [app.conf](https://github.com/jokob-sk/NetAlertX/tree/main/back) in the `/data/config/` folder directly
#### Setting up scanners #### Setting up scanners
You have to specify which network(s) should be scanned. This is done by entering subnets that are accessible from the host. If you use the default `ARPSCAN` plugin, you have to specify at least one valid subnet and interface in the `SCAN_SUBNETS` setting. See the documentation on [How to set up multiple SUBNETS, VLANs and what are limitations](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md) for troubleshooting and more advanced scenarios. You have to specify which network(s) should be scanned. This is done by entering subnets that are accessible from the host. If you use the default `ARPSCAN` plugin, you have to specify at least one valid subnet and interface in the `SCAN_SUBNETS` setting. See the documentation on [How to set up multiple SUBNETS, VLANs and what are limitations](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md) for troubleshooting and more advanced scenarios.
If you are running PiHole you can synchronize devices directly. Check the [PiHole configuration guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PIHOLE_GUIDE.md) for details. If you are running PiHole you can synchronize devices directly. Check the [PiHole configuration guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PIHOLE_GUIDE.md) for details.
> [!NOTE] > [!NOTE]
> You can bulk-import devices via the [CSV import method](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md). > You can bulk-import devices via the [CSV import method](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md).
#### Community guides #### Community guides
You can read or watch several [community configuration guides](https://github.com/jokob-sk/NetAlertX/blob/main/docs/COMMUNITY_GUIDES.md) in Chinese, Korean, German, or French. You can read or watch several [community configuration guides](https://github.com/jokob-sk/NetAlertX/blob/main/docs/COMMUNITY_GUIDES.md) in Chinese, Korean, German, or French.
> Please note these might be outdated. Rely on official documentation first.
> Please note these might be outdated. Rely on official documentation first.
#### Common issues #### Common issues
- Before creating a new issue, please check if a similar issue was [already resolved](https://github.com/jokob-sk/NetAlertX/issues?q=is%3Aissue+is%3Aclosed). - Before creating a new issue, please check if a similar issue was [already resolved](https://github.com/jokob-sk/NetAlertX/issues?q=is%3Aissue+is%3Aclosed).
- Check also common issues and [debugging tips](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEBUG_TIPS.md). - Check also common issues and [debugging tips](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEBUG_TIPS.md).
## 💙 Support me ## 💙 Support me
| [![GitHub](https://i.imgur.com/emsRCPh.png)](https://github.com/sponsors/jokob-sk) | [![Buy Me A Coffee](https://i.imgur.com/pIM6YXL.png)](https://www.buymeacoffee.com/jokobsk) | [![Patreon](https://i.imgur.com/MuYsrq1.png)](https://www.patreon.com/user?u=84385063) | | [![GitHub](https://i.imgur.com/emsRCPh.png)](https://github.com/sponsors/jokob-sk) | [![Buy Me A Coffee](https://i.imgur.com/pIM6YXL.png)](https://www.buymeacoffee.com/jokobsk) | [![Patreon](https://i.imgur.com/MuYsrq1.png)](https://www.patreon.com/user?u=84385063) |
| --- | --- | --- | | --- | --- | --- |
- Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM` - Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM`
- Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7` - Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7`

View File

@@ -34,30 +34,26 @@ Copy and paste the following YAML into the **Web editor**:
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
# Use this line for stable release # Use this line for stable release
image: "ghcr.io/jokob-sk/netalertx:latest" image: "ghcr.io/jokob-sk/netalertx:latest"
# Or, use this for the latest development build # Or, use this for the latest development build
# image: "ghcr.io/jokob-sk/netalertx-dev:latest" # image: "ghcr.io/jokob-sk/netalertx-dev:latest"
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
cap_drop: # Drop all capabilities for enhanced security
- ALL
cap_add: # Re-add necessary capabilities
- NET_RAW
- NET_ADMIN
- NET_BIND_SERVICE
volumes: volumes:
- ${APP_FOLDER}/netalertx/config:/data/config - ${APP_FOLDER}/netalertx/config:/data/config
- ${APP_FOLDER}/netalertx/db:/data/db - ${APP_FOLDER}/netalertx/db:/data/db
# Optional: logs (useful for debugging setup issues, comment out for performance) # to sync with system time
- ${APP_FOLDER}/netalertx/log:/tmp/log - /etc/localtime:/etc/localtime:ro
tmpfs:
# API storage options: # All writable runtime state resides under /tmp; comment out to persist logs between restarts
# (Option 1) tmpfs (default, best performance) - "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
- type: tmpfs
target: /tmp/api
# (Option 2) bind mount (useful for debugging)
# - ${APP_FOLDER}/netalertx/api:/tmp/api
environment: environment:
- PORT=${PORT} - PORT=${PORT}
- APP_CONF_OVERRIDE=${APP_CONF_OVERRIDE} - APP_CONF_OVERRIDE=${APP_CONF_OVERRIDE}
@@ -78,11 +74,12 @@ In the **Environment variables** section of Portainer, add the following:
## 5. Ensure permissions ## 5. Ensure permissions
> [!TIP] > [!TIP]
> If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located). > If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located).
> ```bash >
> sudo chown -R 20211:20211 /local_data_dir > `sudo chown -R 20211:20211 /local_data_dir`
> sudo chmod -R a+rwx /local_data_dir >
> ``` > `sudo chmod -R a+rwx /local_data_dir1`
>
--- ---
@@ -104,4 +101,4 @@ http://<your-docker-host-ip>:22022
* Check logs via Portainer → **Containers**`netalertx`**Logs**. * Check logs via Portainer → **Containers**`netalertx`**Logs**.
* Logs are stored under `${APP_FOLDER}/netalertx/log` if you enabled that volume. * Logs are stored under `${APP_FOLDER}/netalertx/log` if you enabled that volume.
Once the application is running, configure it by reading the [initial setup](INITIAL_SETUP.md) guide, or [troubleshoot common issues](COMMON_ISSUES.md). Once the application is running, configure it by reading the [initial setup](INITIAL_SETUP.md) guide, or [troubleshoot common issues](COMMON_ISSUES.md).

View File

@@ -41,15 +41,7 @@ Use the following Compose snippet to deploy NetAlertX with a **static LAN IP** a
services: services:
netalertx: netalertx:
image: ghcr.io/jokob-sk/netalertx:latest image: ghcr.io/jokob-sk/netalertx:latest
ports: ...
- 20211:20211
volumes:
- /mnt/YOUR_SERVER/netalertx/config:/data/config:rw
- /mnt/YOUR_SERVER/netalertx/db:/netalertx/data/db:rw
- /mnt/YOUR_SERVER/netalertx/logs:/netalertx/tmp/log:rw
- /etc/localtime:/etc/localtime:ro
environment:
- PORT=20211
networks: networks:
swarm-ipvlan: swarm-ipvlan:
ipv4_address: 192.168.1.240 # ⚠️ Choose a free IP from your LAN ipv4_address: 192.168.1.240 # ⚠️ Choose a free IP from your LAN

View File

@@ -1,8 +1,23 @@
# Managing File Permissions for NetAlertX on a Read-Only Container # Managing File Permissions for NetAlertX on a Read-Only Container
Sometimes, permission issues arise if your existing host directories were created by a previous container running as root or another UID. The container will fail to start with "Permission Denied" errors.
> [!TIP] > [!TIP]
> NetAlertX runs in a **secure, read-only Alpine-based container** under a dedicated `netalertx` user (UID 20211, GID 20211). All writable paths are either mounted as **persistent volumes** or **`tmpfs` filesystems**. This ensures consistent file ownership and prevents privilege escalation. > NetAlertX runs in a **secure, read-only Alpine-based container** under a dedicated `netalertx` user (UID 20211, GID 20211). All writable paths are either mounted as **persistent volumes** or **`tmpfs` filesystems**. This ensures consistent file ownership and prevents privilege escalation.
Try starting the container with all data to be in non-persistent volumes. If this works, the issue might be related to the permissions of your persistent data mount locations on your server.
```bash
docker run --rm --network=host \
-v /etc/localtime:/etc/localtime:ro \
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
-e PORT=20211 \
ghcr.io/jokob-sk/netalertx:latest
```
> [!WARNING]
> The above should be only used as a test - once the container restarts, all data is lost.
--- ---
## Writable Paths ## Writable Paths
@@ -25,10 +40,6 @@ NetAlertX requires certain paths to be writable at runtime. These paths should b
--- ---
## Fixing Permission Problems
Sometimes, permission issues arise if your existing host directories were created by a previous container running as root or another UID. The container will fail to start with "Permission Denied" errors.
### Solution ### Solution
1. **Run the container once as root** (`--user "0"`) to allow it to correct permissions automatically: 1. **Run the container once as root** (`--user "0"`) to allow it to correct permissions automatically:
@@ -37,6 +48,7 @@ Sometimes, permission issues arise if your existing host directories were create
docker run -it --rm --name netalertx --user "0" \ docker run -it --rm --name netalertx --user "0" \
-v /local_data_dir/config:/data/config \ -v /local_data_dir/config:/data/config \
-v /local_data_dir/db:/data/db \ -v /local_data_dir/db:/data/db \
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
ghcr.io/jokob-sk/netalertx:latest ghcr.io/jokob-sk/netalertx:latest
``` ```
@@ -47,11 +59,12 @@ docker run -it --rm --name netalertx --user "0" \
> The container startup script detects `root` and runs `chown -R 20211:20211` on all volumes, fixing ownership for the secure `netalertx` user. > The container startup script detects `root` and runs `chown -R 20211:20211` on all volumes, fixing ownership for the secure `netalertx` user.
> [!TIP] > [!TIP]
> If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located). > If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located).
> ```bash >
> sudo chown -R 20211:20211 /local_data_dir > `sudo chown -R 20211:20211 /local_data_dir`
> sudo chmod -R a+rwx /local_data_dir >
> ``` > `sudo chmod -R a+rwx /local_data_dir1`
>
--- ---
@@ -59,22 +72,22 @@ docker run -it --rm --name netalertx --user "0" \
```yaml ```yaml
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
image: "ghcr.io/jokob-sk/netalertx" image: "ghcr.io/jokob-sk/netalertx"
network_mode: "host" network_mode: "host"
cap_drop: # Drop all capabilities for enhanced security cap_drop: # Drop all capabilities for enhanced security
- ALL - ALL
cap_add: # Add only the necessary capabilities cap_add: # Add only the necessary capabilities
- NET_ADMIN # Required for ARP scanning - NET_ADMIN # Required for ARP scanning
- NET_RAW # Required for raw socket operations - NET_RAW # Required for raw socket operations
- NET_BIND_SERVICE # Required to bind to privileged ports (nbtscan) - NET_BIND_SERVICE # Required to bind to privileged ports (nbtscan)
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config:/data/config - /local_data_dir/config:/data/config
- /local_data_dir/db:/data/db - /local_data_dir/db:/data/db
- /etc/localtime:/etc/localtime - /etc/localtime:/etc/localtime
environment: environment:
- PORT=20211 - PORT=20211
tmpfs: tmpfs:
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime" - "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"

View File

@@ -1,8 +1,8 @@
# Migration # Migration
> [!WARNING] > [!WARNING]
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed. > ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container. > If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
> These docs reflect the latest development version and may differ from the production image. > These docs reflect the latest development version and may differ from the production image.
@@ -13,13 +13,13 @@ When upgrading from older versions of NetAlertX (or PiAlert by jokob-sk), follow
## Migration scenarios ## Migration scenarios
- You are running PiAlert (by jokob-sk) - You are running PiAlert (by jokob-sk)
→ [Read the 1.1 Migration from PiAlert to NetAlertX `v25.5.24`](#11-migration-from-pialert-to-netalertx-v25524) → [Read the 1.1 Migration from PiAlert to NetAlertX `v25.5.24`](#11-migration-from-pialert-to-netalertx-v25524)
- You are running NetAlertX (by jokob-sk) `25.5.24` or older - You are running NetAlertX (by jokob-sk) `25.5.24` or older
→ [Read the 1.2 Migration from NetAlertX `v25.5.24`](#12-migration-from-netalertx-v25524) → [Read the 1.2 Migration from NetAlertX `v25.5.24`](#12-migration-from-netalertx-v25524)
- You are running NetAlertX (by jokob-sk) (`v25.6.7` to `v25.10.1`) - You are running NetAlertX (by jokob-sk) (`v25.6.7` to `v25.10.1`)
→ [Read the 1.3 Migration from NetAlertX `v25.10.1`](#13-migration-from-netalertx-v25101) → [Read the 1.3 Migration from NetAlertX `v25.10.1`](#13-migration-from-netalertx-v25101)
@@ -30,40 +30,40 @@ You can migrate data manually, for example by exporting and importing devices us
### 1.1 Migration from PiAlert to NetAlertX `v25.5.24` ### 1.1 Migration from PiAlert to NetAlertX `v25.5.24`
#### STEPS: #### STEPS:
The application will automatically migrate the database, configuration, and all device information. The application will automatically migrate the database, configuration, and all device information.
A banner message will appear at the top of the web UI reminding you to update your Docker mount points. A banner message will appear at the top of the web UI reminding you to update your Docker mount points.
1. Stop the container 1. Stop the container
2. [Back up your setup](./BACKUPS.md) 2. [Back up your setup](./BACKUPS.md)
3. Update the Docker file mount locations in your `docker-compose.yml` or docker run command (See below **New Docker mount locations**). 3. Update the Docker file mount locations in your `docker-compose.yml` or docker run command (See below **New Docker mount locations**).
4. Rename the DB and conf files to `app.db` and `app.conf` and place them in the appropriate location. 4. Rename the DB and conf files to `app.db` and `app.conf` and place them in the appropriate location.
5. Start the container 5. Start the container
> [!TIP] > [!TIP]
> If you have trouble accessing past backups, config or database files you can copy them into the newly mapped directories, for example by running this command in the container: `cp -r /data/config /home/pi/pialert/config/old_backup_files`. This should create a folder in the `config` directory called `old_backup_files` containing all the files in that location. Another approach is to map the old location and the new one at the same time to copy things over. > If you have trouble accessing past backups, config or database files you can copy them into the newly mapped directories, for example by running this command in the container: `cp -r /data/config /home/pi/pialert/config/old_backup_files`. This should create a folder in the `config` directory called `old_backup_files` containing all the files in that location. Another approach is to map the old location and the new one at the same time to copy things over.
#### New Docker mount locations #### New Docker mount locations
The internal application path in the container has changed from `/home/pi/pialert` to `/app`. Update your volume mounts as follows: The internal application path in the container has changed from `/home/pi/pialert` to `/app`. Update your volume mounts as follows:
| Old mount point | New mount point | | Old mount point | New mount point |
|----------------------|---------------| |----------------------|---------------|
| `/home/pi/pialert/config` | `/data/config` | | `/home/pi/pialert/config` | `/data/config` |
| `/home/pi/pialert/db` | `/data/db` | | `/home/pi/pialert/db` | `/data/db` |
If you were mounting files directly, please note the file names have changed: If you were mounting files directly, please note the file names have changed:
| Old file name | New file name | | Old file name | New file name |
|----------------------|---------------| |----------------------|---------------|
| `pialert.conf` | `app.conf` | | `pialert.conf` | `app.conf` |
| `pialert.db` | `app.db` | | `pialert.db` | `app.db` |
> [!NOTE] > [!NOTE]
> The application automatically creates symlinks from the old database and config locations to the new ones, so data loss should not occur. Read the [backup strategies](./BACKUPS.md) guide to backup your setup. > The application automatically creates symlinks from the old database and config locations to the new ones, so data loss should not occur. Read the [backup strategies](./BACKUPS.md) guide to backup your setup.
@@ -80,17 +80,17 @@ services:
pialert: pialert:
container_name: pialert container_name: pialert
# use the below line if you want to test the latest dev image # use the below line if you want to test the latest dev image
# image: "ghcr.io/jokob-sk/netalertx-dev:latest" # image: "ghcr.io/jokob-sk/netalertx-dev:latest"
image: "jokobsk/pialert:latest" image: "jokobsk/pialert:latest"
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config:/home/pi/pialert/config - /local_data_dir/config:/home/pi/pialert/config
- /local_data_dir/db:/home/pi/pialert/db - /local_data_dir/db:/home/pi/pialert/db
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- /local_data_dir/logs:/home/pi/pialert/front/log - /local_data_dir/logs:/home/pi/pialert/front/log
environment: environment:
- TZ=Europe/Berlin - TZ=Europe/Berlin
- PORT=20211 - PORT=20211
``` ```
@@ -98,26 +98,26 @@ services:
```yaml ```yaml
services: services:
netalertx: # 🆕 This has changed netalertx: # 🆕 This has changed
container_name: netalertx # 🆕 This has changed container_name: netalertx # 🆕 This has changed
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This has changed image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This has changed
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config:/data/config # 🆕 This has changed - /local_data_dir/config:/data/config # 🆕 This has changed
- /local_data_dir/db:/data/db # 🆕 This has changed - /local_data_dir/db:/data/db # 🆕 This has changed
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- /local_data_dir/logs:/tmp/log # 🆕 This has changed - /local_data_dir/logs:/tmp/log # 🆕 This has changed
environment: environment:
- TZ=Europe/Berlin - TZ=Europe/Berlin
- PORT=20211 - PORT=20211
``` ```
##### Example 2: Mapping files ##### Example 2: Mapping files
> [!NOTE] > [!NOTE]
> The recommendation is to map folders as in Example 1, map files directly only when needed. > The recommendation is to map folders as in Example 1, map files directly only when needed.
###### Old docker-compose.yml ###### Old docker-compose.yml
@@ -126,17 +126,17 @@ services:
pialert: pialert:
container_name: pialert container_name: pialert
# use the below line if you want to test the latest dev image # use the below line if you want to test the latest dev image
# image: "ghcr.io/jokob-sk/netalertx-dev:latest" # image: "ghcr.io/jokob-sk/netalertx-dev:latest"
image: "jokobsk/pialert:latest" image: "jokobsk/pialert:latest"
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config/pialert.conf:/home/pi/pialert/config/pialert.conf - /local_data_dir/config/pialert.conf:/home/pi/pialert/config/pialert.conf
- /local_data_dir/db/pialert.db:/home/pi/pialert/db/pialert.db - /local_data_dir/db/pialert.db:/home/pi/pialert/db/pialert.db
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- /local_data_dir/logs:/home/pi/pialert/front/log - /local_data_dir/logs:/home/pi/pialert/front/log
environment: environment:
- TZ=Europe/Berlin - TZ=Europe/Berlin
- PORT=20211 - PORT=20211
``` ```
@@ -144,18 +144,18 @@ services:
```yaml ```yaml
services: services:
netalertx: # 🆕 This has changed netalertx: # 🆕 This has changed
container_name: netalertx # 🆕 This has changed container_name: netalertx # 🆕 This has changed
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This has changed image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This has changed
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config/app.conf:/data/config/app.conf # 🆕 This has changed - /local_data_dir/config/app.conf:/data/config/app.conf # 🆕 This has changed
- /local_data_dir/db/app.db:/data/db/app.db # 🆕 This has changed - /local_data_dir/db/app.db:/data/db/app.db # 🆕 This has changed
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- /local_data_dir/logs:/tmp/log # 🆕 This has changed - /local_data_dir/logs:/tmp/log # 🆕 This has changed
environment: environment:
- TZ=Europe/Berlin - TZ=Europe/Berlin
- PORT=20211 - PORT=20211
``` ```
@@ -164,13 +164,13 @@ services:
Versions before `v25.10.1` require an intermediate migration through `v25.5.24` to ensure database compatibility. Skipping this step may cause compatibility issues due to database schema changes introduced after `v25.5.24`. Versions before `v25.10.1` require an intermediate migration through `v25.5.24` to ensure database compatibility. Skipping this step may cause compatibility issues due to database schema changes introduced after `v25.5.24`.
#### STEPS: #### STEPS:
1. Stop the container 1. Stop the container
2. [Back up your setup](./BACKUPS.md) 2. [Back up your setup](./BACKUPS.md)
3. Upgrade to `v25.5.24` by pinning the release version (See Examples below) 3. Upgrade to `v25.5.24` by pinning the release version (See Examples below)
4. Start the container and verify everything works as expected. 4. Start the container and verify everything works as expected.
5. Stop the container 5. Stop the container
6. Upgrade to `v25.10.1` by pinning the release version (See Examples below) 6. Upgrade to `v25.10.1` by pinning the release version (See Examples below)
7. Start the container and verify everything works as expected. 7. Start the container and verify everything works as expected.
@@ -184,62 +184,62 @@ Examples of docker files with the tagged version.
```yaml ```yaml
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This is important image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This is important
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config:/data/config - /local_data_dir/config:/data/config
- /local_data_dir/db:/data/db - /local_data_dir/db:/data/db
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- /local_data_dir/logs:/tmp/log - /local_data_dir/logs:/tmp/log
environment: environment:
- TZ=Europe/Berlin - TZ=Europe/Berlin
- PORT=20211 - PORT=20211
``` ```
```yaml ```yaml
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
image: "ghcr.io/jokob-sk/netalertx:25.10.1" # 🆕 This is important image: "ghcr.io/jokob-sk/netalertx:25.10.1" # 🆕 This is important
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config:/data/config - /local_data_dir/config:/data/config
- /local_data_dir/db:/data/db - /local_data_dir/db:/data/db
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- /local_data_dir/logs:/tmp/log - /local_data_dir/logs:/tmp/log
environment: environment:
- TZ=Europe/Berlin - TZ=Europe/Berlin
- PORT=20211 - PORT=20211
``` ```
### 1.3 Migration from NetAlertX `v25.10.1` ### 1.3 Migration from NetAlertX `v25.10.1`
Starting from v25.10.1, the container uses a [more secure, read-only runtime environment](./SECURITY_FEATURES.md), which requires all writable paths (e.g., logs, API cache, temporary data) to be mounted as `tmpfs` or permanent writable volumes, with sufficient access [permissions](./FILE_PERMISSIONS.md). Starting from v25.10.1, the container uses a [more secure, read-only runtime environment](./SECURITY_FEATURES.md), which requires all writable paths (e.g., logs, API cache, temporary data) to be mounted as `tmpfs` or permanent writable volumes, with sufficient access [permissions](./FILE_PERMISSIONS.md).
#### STEPS: #### STEPS:
1. Stop the container 1. Stop the container
2. [Back up your setup](./BACKUPS.md) 2. [Back up your setup](./BACKUPS.md)
3. Upgrade to `v25.10.1` by pinning the release version (See the example below) 3. Upgrade to `v25.10.1` by pinning the release version (See the example below)
```yaml ```yaml
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
image: "ghcr.io/jokob-sk/netalertx:25.10.1" # 🆕 This is important image: "ghcr.io/jokob-sk/netalertx:25.10.1" # 🆕 This is important
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config:/data/config - /local_data_dir/config:/data/config
- /local_data_dir/db:/data/db - /local_data_dir/db:/data/db
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- /local_data_dir/logs:/tmp/log - /local_data_dir/logs:/tmp/log
environment: environment:
- TZ=Europe/Berlin - TZ=Europe/Berlin
- PORT=20211 - PORT=20211
``` ```
@@ -248,13 +248,14 @@ services:
6. Perform a one-off migration to the latest `netalertx` image and `20211` user: 6. Perform a one-off migration to the latest `netalertx` image and `20211` user:
> [!NOTE] > [!NOTE]
> The example below assumes your `/config` and `/db` folders are stored in `local_data_dir`. > The example below assumes your `/config` and `/db` folders are stored in `local_data_dir`.
> Replace this path with your actual configuration directory. `netalertx` is the container name, which might differ from your setup. > Replace this path with your actual configuration directory. `netalertx` is the container name, which might differ from your setup.
```sh ```sh
docker run -it --rm --name netalertx --user "0" \ docker run -it --rm --name netalertx --user "0" \
-v /local_data_dir/config:/data/config \ -v /local_data_dir/config:/data/config \
-v /local_data_dir/db:/data/db \ -v /local_data_dir/db:/data/db \
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
ghcr.io/jokob-sk/netalertx:latest ghcr.io/jokob-sk/netalertx:latest
``` ```
@@ -271,22 +272,22 @@ sudo chmod -R a+rwx /local_data_dir/
```yaml ```yaml
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
image: "ghcr.io/jokob-sk/netalertx" # 🆕 This is important image: "ghcr.io/jokob-sk/netalertx" # 🆕 This has changed
network_mode: "host" network_mode: "host"
cap_drop: # 🆕 New line cap_drop: # 🆕 New line
- ALL # 🆕 New line - ALL # 🆕 New line
cap_add: # 🆕 New line cap_add: # 🆕 New line
- NET_RAW # 🆕 New line - NET_RAW # 🆕 New line
- NET_ADMIN # 🆕 New line - NET_ADMIN # 🆕 New line
- NET_BIND_SERVICE # 🆕 New line - NET_BIND_SERVICE # 🆕 New line
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- /local_data_dir/config:/data/config - /local_data_dir/config:/data/config
- /local_data_dir/db:/data/db - /local_data_dir/db:/data/db
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
#- /local_data_dir/logs:/tmp/log #- /local_data_dir/logs:/tmp/log
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured # Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
- /etc/localtime:/etc/localtime:ro # 🆕 New line - /etc/localtime:/etc/localtime:ro # 🆕 New line
environment: environment:

View File

@@ -1,47 +1,50 @@
# Performance Optimization Guide # Performance Optimization Guide
There are several ways to improve the application's performance. The application has been tested on a range of devices, from a Raspberry Pi 4 to NAS and NUC systems. If you are running the application on a lower-end device, carefully fine-tune the performance settings to ensure an optimal user experience. There are several ways to improve the application's performance. The application has been tested on a range of devices, from Raspberry Pi 4 units to NAS and NUC systems. If you are running the application on a lower-end device, fine-tuning the performance settings can significantly improve the user experience.
## Common Causes of Slowness ## Common Causes of Slowness
Performance issues are usually caused by: Performance issues are usually caused by:
- **Incorrect settings** The app may restart unexpectedly. Check `app.log` under **Maintenance → Logs** for details. * **Incorrect settings** The app may restart unexpectedly. Check `app.log` under **Maintenance → Logs** for details.
- **Too many background processes** Disable unnecessary scanners. * **Too many background processes** Disable unnecessary scanners.
- **Long scan durations** Limit the number of scanned devices. * **Long scan durations** Limit the number of scanned devices.
- **Excessive disk operations** Optimize scanning and logging settings. * **Excessive disk operations** Optimize scanning and logging settings.
- **Failed maintenance plugins** Ensure maintenance tasks are running properly. * **Maintenance plugin failures** If cleanup tasks fail, performance can degrade over time.
The application performs regular maintenance and database cleanup. If these tasks fail, performance may degrade. The application performs regular maintenance and database cleanup. If these tasks are failing, you will see slowdowns.
### Database and Log File Size ### Database and Log File Size
A large database or oversized log files can slow down performance. You can check database and table sizes on the **Maintenance** page. A large database or oversized log files can impact performance. You can check database and table sizes on the **Maintenance** page.
![DB size check](./img/PERFORMANCE/db_size_check.png) ![DB size check](./img/PERFORMANCE/db_size_check.png)
> [!NOTE] > [!NOTE]
> - For **~100 devices**, the database should be around **50MB**. >
> - No table should exceed **10,000 rows** in a healthy system. > * For **~100 devices**, the database should be around **50 MB**.
> - These numbers vary based on network activity and settings. > * No table should exceed **10,000 rows** in a healthy system.
> * Actual values vary based on network activity and plugin settings.
--- ---
## Maintenance Plugins ## Maintenance Plugins
Two plugins help maintain the applications performance: Two plugins help maintain the systems performance:
### **1. Database Cleanup (DBCLNP)** ### **1. Database Cleanup (DBCLNP)**
- Responsible for database maintenance.
- Check settings in the [DB Cleanup Plugin Docs](/front/plugins/db_cleanup/README.md). * Handles database maintenance and cleanup.
- Ensure its not failing by checking logs. * See the [DB Cleanup Plugin Docs](/front/plugins/db_cleanup/README.md).
- Adjust the schedule (`DBCLNP_RUN_SCHD`) and timeout (`DBCLNP_RUN_TIMEOUT`) if needed. * Ensure its not failing by checking logs.
* Adjust the schedule (`DBCLNP_RUN_SCHD`) and timeout (`DBCLNP_RUN_TIMEOUT`) if necessary.
### **2. Maintenance (MAINT)** ### **2. Maintenance (MAINT)**
- Handles log cleanup and other maintenance tasks.
- Check settings in the [Maintenance Plugin Docs](/front/plugins/maintenance/README.md). * Cleans logs and performs general maintenance tasks.
- Ensure its running correctly by checking logs. * See the [Maintenance Plugin Docs](/front/plugins/maintenance/README.md).
- Adjust the schedule (`MAINT_RUN_SCHD`) and timeout (`MAINT_RUN_TIMEOUT`) if needed. * Verify proper operation via logs.
* Adjust the schedule (`MAINT_RUN_SCHD`) and timeout (`MAINT_RUN_TIMEOUT`) if needed.
--- ---
@@ -50,48 +53,56 @@ Two plugins help maintain the applications performance:
Frequent scans increase resource usage, network traffic, and database read/write cycles. Frequent scans increase resource usage, network traffic, and database read/write cycles.
### **Optimizations** ### **Optimizations**
- **Increase scan intervals** (`<PLUGIN>_RUN_SCHD`) on busy networks or low-end hardware.
- **Extend scan timeouts** (`<PLUGIN>_RUN_TIMEOUT`) to prevent failures.
- **Reduce the subnet size** e.g., from `/16` to `/24` to lower scan loads.
Some plugins have additional options to limit the number of scanned devices. If certain plugins take too long to complete, check if you can optimize scan times by selecting a scan range. * **Increase scan intervals** (`<PLUGIN>_RUN_SCHD`) on busy networks or low-end hardware.
* **Increase timeouts** (`<PLUGIN>_RUN_TIMEOUT`) to avoid plugin failures.
* **Reduce subnet size** e.g., use `/24` instead of `/16` to reduce scan load.
For example, the **ICMP plugin** allows you to specify a regular expression to scan only IPs that match a specific pattern. Some plugins also include options to limit which devices are scanned. If certain plugins consistently run long, consider narrowing their scope.
For example, the **ICMP plugin** allows scanning only IPs that match a specific regular expression.
--- ---
## Storing Temporary Files in Memory ## Storing Temporary Files in Memory
On systems with slower I/O speeds, you can optimize performance by storing temporary files in memory. This primarily applies to the API directory (default: `/tmp/api`, configurable via `NETALERTX_API`) and `/tmp/log` folders. On devices with slower I/O, you can improve performance by storing temporary files (and optionally the database) in memory using `tmpfs`.
Using `tmpfs` reduces disk writes and improves performance. However, it should be **disabled** if persistent logs or API data storage are required. > [!WARNING]
> Storing the **database** in `tmpfs` is generally discouraged. Use this only if device data and historical records are not required to persist. If needed, you can pair this setup with the `SYNC` plugin to store important persistent data on another node. See the [Plugins docs](./PLUGINS.md) for details.
Below is an optimized `docker-compose.yml` snippet: Using `tmpfs` reduces disk writes and speeds up I/O, but **all data stored in memory will be lost on restart**.
Below is an optimized `docker-compose.yml` snippet using non-persistent logs, API data, and DB:
```yaml ```yaml
version: "3"
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
# Uncomment the line below to test the latest dev image # Use this line for the stable release
image: "ghcr.io/jokob-sk/netalertx:latest"
# Or use this line for the latest development build
# image: "ghcr.io/jokob-sk/netalertx-dev:latest" # image: "ghcr.io/jokob-sk/netalertx-dev:latest"
image: "ghcr.io/jokob-sk/netalertx:latest" network_mode: "host"
network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes:
- /local_data_dir/config:/data/config
- /local_data_dir/db:/data/db
# (Optional) Useful for debugging setup issues
- /local_data_dir/logs:/tmp/log
# (API: OPTION 1) Store temporary files in memory (recommended for performance)
- type: tmpfs # ◀ 🔺
target: /tmp/api # ◀ 🔺
# (API: OPTION 2) Store API data on disk (useful for debugging)
# - /local_data_dir/api:/tmp/api
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
- /etc/localtime:/etc/localtime:ro
environment:
- PORT=20211
cap_drop: # Drop all capabilities for enhanced security
- ALL
cap_add: # Re-add necessary capabilities
- NET_RAW
- NET_ADMIN
- NET_BIND_SERVICE
volumes:
- ${APP_FOLDER}/netalertx/config:/data/config
- /etc/localtime:/etc/localtime:ro
tmpfs:
# All writable runtime state resides under /tmp; comment out to persist logs between restarts
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
- "/data/db:uid=20211,gid=20211,mode=1700" # ⚠ You will lose historical data on restart
environment:
- PORT=${PORT}
- APP_CONF_OVERRIDE=${APP_CONF_OVERRIDE}
``` ```

View File

@@ -2,21 +2,21 @@
If you are running a DNS server, such as **AdGuard**, set up **Private reverse DNS servers** for a better name resolution on your network. Enabling this setting will enable NetAlertX to execute dig and nslookup commands to automatically resolve device names based on their IP addresses. If you are running a DNS server, such as **AdGuard**, set up **Private reverse DNS servers** for a better name resolution on your network. Enabling this setting will enable NetAlertX to execute dig and nslookup commands to automatically resolve device names based on their IP addresses.
> [!TIP] > [!TIP]
> Before proceeding, ensure that [name resolution plugins](/local_data_dir/NAME_RESOLUTION.md) are enabled. > Before proceeding, ensure that [name resolution plugins](/local_data_dir/NAME_RESOLUTION.md) are enabled.
> You can customize how names are cleaned using the `NEWDEV_NAME_CLEANUP_REGEX` setting. > You can customize how names are cleaned using the `NEWDEV_NAME_CLEANUP_REGEX` setting.
> To auto-update Fully Qualified Domain Names (FQDN), enable the `REFRESH_FQDN` setting. > To auto-update Fully Qualified Domain Names (FQDN), enable the `REFRESH_FQDN` setting.
> Example 1: Reverse DNS `disabled` > Example 1: Reverse DNS `disabled`
> >
> ``` > ```
> jokob@Synology-NAS:/$ nslookup 192.168.1.58 > jokob@Synology-NAS:/$ nslookup 192.168.1.58
> ** server can't find 58.1.168.192.in-addr.arpa: NXDOMAIN > ** server can't find 58.1.168.192.in-addr.arpa: NXDOMAIN
> ``` > ```
> Example 2: Reverse DNS `enabled` > Example 2: Reverse DNS `enabled`
> >
> ``` > ```
> jokob@Synology-NAS:/$ nslookup 192.168.1.58 > jokob@Synology-NAS:/$ nslookup 192.168.1.58
> 45.1.168.192.in-addr.arpa name = jokob-NUC.localdomain. > 45.1.168.192.in-addr.arpa name = jokob-NUC.localdomain.
@@ -33,23 +33,14 @@ If you are running a DNS server, such as **AdGuard**, set up **Private reverse D
### Specifying the DNS in the container ### Specifying the DNS in the container
You can specify the DNS server in the docker-compose to improve name resolution on your network. You can specify the DNS server in the docker-compose to improve name resolution on your network.
```yaml ```yaml
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
image: "ghcr.io/jokob-sk/netalertx:latest" image: "ghcr.io/jokob-sk/netalertx:latest"
restart: unless-stopped ...
volumes:
- /local_data_dir/config:/data/config
- /local_data_dir/db:/data/db
# - /local_data_dir/log:/tmp/log
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
- /etc/localtime:/etc/localtime:ro
environment:
- PORT=20211
network_mode: host
dns: # specifying the DNS servers used for the container dns: # specifying the DNS servers used for the container
- 10.8.0.1 - 10.8.0.1
- 10.8.0.17 - 10.8.0.17
@@ -57,7 +48,7 @@ services:
### Using a custom resolv.conf file ### Using a custom resolv.conf file
You can configure a custom **/etc/resolv.conf** file in **docker-compose.yml** and set the nameserver to your LAN DNS server (e.g.: Pi-Hole). See the relevant [resolv.conf man](https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html) entry for details. You can configure a custom **/etc/resolv.conf** file in **docker-compose.yml** and set the nameserver to your LAN DNS server (e.g.: Pi-Hole). See the relevant [resolv.conf man](https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html) entry for details.
#### docker-compose.yml: #### docker-compose.yml:
@@ -66,18 +57,10 @@ version: "3"
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
image: "ghcr.io/jokob-sk/netalertx:latest"
restart: unless-stopped
volumes: volumes:
- /local_data_dir/config/app.conf:/data/config/app.conf ...
- /local_data_dir/db:/data/db
- /local_data_dir/log:/tmp/log
- /local_data_dir/config/resolv.conf:/etc/resolv.conf # ⚠ Mapping the /resolv.conf file for better name resolution - /local_data_dir/config/resolv.conf:/etc/resolv.conf # ⚠ Mapping the /resolv.conf file for better name resolution
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured ...
- /etc/localtime:/etc/localtime:ro
environment:
- PORT=20211
network_mode: host
``` ```
#### /local_data_dir/config/resolv.conf: #### /local_data_dir/config/resolv.conf:

View File

@@ -2,9 +2,9 @@
> Submitted by amazing [cvc90](https://github.com/cvc90) 🙏 > Submitted by amazing [cvc90](https://github.com/cvc90) 🙏
> [!NOTE] > [!NOTE]
> There are various NGINX config files for NetAlertX, some for the bare-metal install, currently Debian 12 and Ubuntu 24 (`netalertx.conf`), and one for the docker container (`netalertx.template.conf`). > There are various NGINX config files for NetAlertX, some for the bare-metal install, currently Debian 12 and Ubuntu 24 (`netalertx.conf`), and one for the docker container (`netalertx.template.conf`).
> >
> The first one you can find in the respective bare metal installer folder `/app/install/\<system\>/netalertx.conf`. > The first one you can find in the respective bare metal installer folder `/app/install/\<system\>/netalertx.conf`.
> The docker one can be found in the [install](https://github.com/jokob-sk/NetAlertX/tree/main/install) folder. Map, or use, the one appropriate for your setup. > The docker one can be found in the [install](https://github.com/jokob-sk/NetAlertX/tree/main/install) folder. Map, or use, the one appropriate for your setup.
@@ -17,14 +17,14 @@
2. In this file, paste the following code: 2. In this file, paste the following code:
``` ```
server { server {
listen 80; listen 80;
server_name netalertx; server_name netalertx;
proxy_preserve_host on; proxy_preserve_host on;
proxy_pass http://localhost:20211/; proxy_pass http://localhost:20211/;
proxy_pass_reverse http://localhost:20211/; proxy_pass_reverse http://localhost:20211/;
} }
``` ```
3. Activate the new website by running the following command: 3. Activate the new website by running the following command:
@@ -43,18 +43,18 @@
2. In this file, paste the following code: 2. In this file, paste the following code:
``` ```
server { server {
listen 80; listen 80;
server_name netalertx; server_name netalertx;
proxy_preserve_host on; proxy_preserve_host on;
location ^~ /netalertx/ { location ^~ /netalertx/ {
proxy_pass http://localhost:20211/; proxy_pass http://localhost:20211/;
proxy_pass_reverse http://localhost:20211/; proxy_pass_reverse http://localhost:20211/;
proxy_redirect ~^/(.*)$ /netalertx/$1; proxy_redirect ~^/(.*)$ /netalertx/$1;
rewrite ^/netalertx/?(.*)$ /$1 break; rewrite ^/netalertx/?(.*)$ /$1 break;
} }
} }
``` ```
3. Check your config with `nginx -t`. If there are any issues, it will tell you. 3. Check your config with `nginx -t`. If there are any issues, it will tell you.
@@ -73,13 +73,13 @@
2. In this file, paste the following code: 2. In this file, paste the following code:
``` ```
server { server {
listen 80; listen 80;
server_name netalertx; server_name netalertx;
proxy_preserve_host on; proxy_preserve_host on;
location ^~ /netalertx/ { location ^~ /netalertx/ {
proxy_pass http://localhost:20211/; proxy_pass http://localhost:20211/;
proxy_pass_reverse http://localhost:20211/; proxy_pass_reverse http://localhost:20211/;
proxy_redirect ~^/(.*)$ /netalertx/$1; proxy_redirect ~^/(.*)$ /netalertx/$1;
rewrite ^/netalertx/?(.*)$ /$1 break; rewrite ^/netalertx/?(.*)$ /$1 break;
sub_filter_once off; sub_filter_once off;
@@ -89,13 +89,13 @@
sub_filter '(?>$host)/js' '/netalertx/js'; sub_filter '(?>$host)/js' '/netalertx/js';
sub_filter '/img' '/netalertx/img'; sub_filter '/img' '/netalertx/img';
sub_filter '/lib' '/netalertx/lib'; sub_filter '/lib' '/netalertx/lib';
sub_filter '/php' '/netalertx/php'; sub_filter '/php' '/netalertx/php';
} }
} }
``` ```
3. Check your config with `nginx -t`. If there are any issues, it will tell you. 3. Check your config with `nginx -t`. If there are any issues, it will tell you.
4. Activate the new website by running the following command: 4. Activate the new website by running the following command:
`nginx -s reload` or `systemctl restart nginx` `nginx -s reload` or `systemctl restart nginx`
@@ -111,17 +111,17 @@
2. In this file, paste the following code: 2. In this file, paste the following code:
``` ```
server { server {
listen 443; listen 443;
server_name netalertx; server_name netalertx;
SSLEngine On; SSLEngine On;
SSLCertificateFile /etc/ssl/certs/netalertx.pem; SSLCertificateFile /etc/ssl/certs/netalertx.pem;
SSLCertificateKeyFile /etc/ssl/private/netalertx.key; SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
proxy_preserve_host on; proxy_preserve_host on;
proxy_pass http://localhost:20211/; proxy_pass http://localhost:20211/;
proxy_pass_reverse http://localhost:20211/; proxy_pass_reverse http://localhost:20211/;
} }
``` ```
3. Check your config with `nginx -t`. If there are any issues, it will tell you. 3. Check your config with `nginx -t`. If there are any issues, it will tell you.
@@ -140,23 +140,23 @@
2. In this file, paste the following code: 2. In this file, paste the following code:
``` ```
server { server {
listen 443; listen 443;
server_name netalertx; server_name netalertx;
SSLEngine On; SSLEngine On;
SSLCertificateFile /etc/ssl/certs/netalertx.pem; SSLCertificateFile /etc/ssl/certs/netalertx.pem;
SSLCertificateKeyFile /etc/ssl/private/netalertx.key; SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
location ^~ /netalertx/ { location ^~ /netalertx/ {
proxy_pass http://localhost:20211/; proxy_pass http://localhost:20211/;
proxy_pass_reverse http://localhost:20211/; proxy_pass_reverse http://localhost:20211/;
proxy_redirect ~^/(.*)$ /netalertx/$1; proxy_redirect ~^/(.*)$ /netalertx/$1;
rewrite ^/netalertx/?(.*)$ /$1 break; rewrite ^/netalertx/?(.*)$ /$1 break;
} }
} }
``` ```
3. Check your config with `nginx -t`. If there are any issues, it will tell you. 3. Check your config with `nginx -t`. If there are any issues, it will tell you.
4. Activate the new website by running the following command: 4. Activate the new website by running the following command:
`nginx -s reload` or `systemctl restart nginx` `nginx -s reload` or `systemctl restart nginx`
@@ -172,15 +172,15 @@
2. In this file, paste the following code: 2. In this file, paste the following code:
``` ```
server { server {
listen 443; listen 443;
server_name netalertx; server_name netalertx;
SSLEngine On; SSLEngine On;
SSLCertificateFile /etc/ssl/certs/netalertx.pem; SSLCertificateFile /etc/ssl/certs/netalertx.pem;
SSLCertificateKeyFile /etc/ssl/private/netalertx.key; SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
location ^~ /netalertx/ { location ^~ /netalertx/ {
proxy_pass http://localhost:20211/; proxy_pass http://localhost:20211/;
proxy_pass_reverse http://localhost:20211/; proxy_pass_reverse http://localhost:20211/;
proxy_redirect ~^/(.*)$ /netalertx/$1; proxy_redirect ~^/(.*)$ /netalertx/$1;
rewrite ^/netalertx/?(.*)$ /$1 break; rewrite ^/netalertx/?(.*)$ /$1 break;
sub_filter_once off; sub_filter_once off;
@@ -190,13 +190,13 @@
sub_filter '(?>$host)/js' '/netalertx/js'; sub_filter '(?>$host)/js' '/netalertx/js';
sub_filter '/img' '/netalertx/img'; sub_filter '/img' '/netalertx/img';
sub_filter '/lib' '/netalertx/lib'; sub_filter '/lib' '/netalertx/lib';
sub_filter '/php' '/netalertx/php'; sub_filter '/php' '/netalertx/php';
} }
} }
``` ```
3. Check your config with `nginx -t`. If there are any issues, it will tell you. 3. Check your config with `nginx -t`. If there are any issues, it will tell you.
4. Activate the new website by running the following command: 4. Activate the new website by running the following command:
`nginx -s reload` or `systemctl restart nginx` `nginx -s reload` or `systemctl restart nginx`
@@ -218,10 +218,10 @@
ProxyPass / http://localhost:20211/ ProxyPass / http://localhost:20211/
ProxyPassReverse / http://localhost:20211/ ProxyPassReverse / http://localhost:20211/
</VirtualHost> </VirtualHost>
``` ```
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you. 3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
4. Activate the new website by running the following command: 4. Activate the new website by running the following command:
`a2ensite netalertx` or `service apache2 reload` `a2ensite netalertx` or `service apache2 reload`
@@ -245,10 +245,10 @@
ProxyPassReverse / http://localhost:20211/ ProxyPassReverse / http://localhost:20211/
} }
</VirtualHost> </VirtualHost>
``` ```
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you. 3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
4. Activate the new website by running the following command: 4. Activate the new website by running the following command:
`a2ensite netalertx` or `service apache2 reload` `a2ensite netalertx` or `service apache2 reload`
@@ -273,10 +273,10 @@
ProxyPass / http://localhost:20211/ ProxyPass / http://localhost:20211/
ProxyPassReverse / http://localhost:20211/ ProxyPassReverse / http://localhost:20211/
</VirtualHost> </VirtualHost>
``` ```
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you. 3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
4. Activate the new website by running the following command: 4. Activate the new website by running the following command:
`a2ensite netalertx` or `service apache2 reload` `a2ensite netalertx` or `service apache2 reload`
@@ -290,11 +290,11 @@
1. On your Apache server, create a new file called /etc/apache2/sites-available/netalertx.conf. 1. On your Apache server, create a new file called /etc/apache2/sites-available/netalertx.conf.
2. In this file, paste the following code: 2. In this file, paste the following code:
``` ```
<VirtualHost *:443> <VirtualHost *:443>
ServerName netalertx ServerName netalertx
SSLEngine On SSLEngine On
SSLCertificateFile /etc/ssl/certs/netalertx.pem SSLCertificateFile /etc/ssl/certs/netalertx.pem
SSLCertificateKeyFile /etc/ssl/private/netalertx.key SSLCertificateKeyFile /etc/ssl/private/netalertx.key
location ^~ /netalertx/ { location ^~ /netalertx/ {
@@ -303,10 +303,10 @@
ProxyPassReverse / http://localhost:20211/ ProxyPassReverse / http://localhost:20211/
} }
</VirtualHost> </VirtualHost>
``` ```
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you. 3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
4. Activate the new website by running the following command: 4. Activate the new website by running the following command:
`a2ensite netalertx` or `service apache2 reload` `a2ensite netalertx` or `service apache2 reload`
@@ -381,7 +381,7 @@ location ^~ /netalertx/ {
> Submitted by [Isegrimm](https://github.com/Isegrimm) 🙏 (based on this [discussion](https://github.com/jokob-sk/NetAlertX/discussions/449#discussioncomment-7281442)) > Submitted by [Isegrimm](https://github.com/Isegrimm) 🙏 (based on this [discussion](https://github.com/jokob-sk/NetAlertX/discussions/449#discussioncomment-7281442))
Assuming the user already has a working Traefik setup, this is what's needed to make NetAlertX work at a URL like www.domain.com/netalertx/. Assuming the user already has a working Traefik setup, this is what's needed to make NetAlertX work at a URL like www.domain.com/netalertx/.
Note: Everything in these configs assumes '**www.domain.com**' as your domainname and '**section31**' as an arbitrary name for your certificate setup. You will have to substitute these with your own. Note: Everything in these configs assumes '**www.domain.com**' as your domainname and '**section31**' as an arbitrary name for your certificate setup. You will have to substitute these with your own.
@@ -496,14 +496,9 @@ server {
Mapping the updated file (on the local filesystem at `/appl/docker/netalertx/default`) into the docker container: Mapping the updated file (on the local filesystem at `/appl/docker/netalertx/default`) into the docker container:
```bash ```yaml
docker run -d --rm --network=host \ ...
--name=netalertx \ volumes:
-v /appl/docker/netalertx/config:/data/config \ - /appl/docker/netalertx/default:/etc/nginx/sites-available/default
-v /appl/docker/netalertx/db:/data/db \ ...
-v /etc/localtime:/etc/localtime \
-v /appl/docker/netalertx/default:/etc/nginx/sites-available/default \
-e PORT=20211 \
ghcr.io/jokob-sk/netalertx:latest
``` ```

View File

@@ -1,10 +1,10 @@
# Installation on a Synology NAS # Installation on a Synology NAS
There are different ways to install NetAlertX on a Synology, including SSH-ing into the machine and using the command line. For this guide, we will use the Project option in Container manager. There are different ways to install NetAlertX on a Synology, including SSH-ing into the machine and using the command line. For this guide, we will use the Project option in Container manager.
## Create the folder structure ## Create the folder structure
The folders you are creating below will contain the configuration and the database. Back them up regularly. The folders you are creating below will contain the configuration and the database. Back them up regularly.
1. Create a parent folder named `netalertx` 1. Create a parent folder named `netalertx`
2. Create a `db` sub-folder 2. Create a `db` sub-folder
@@ -29,23 +29,31 @@ The folders you are creating below will contain the configuration and the databa
- Path: `/app_storage/netalertx` (will differ from yours) - Path: `/app_storage/netalertx` (will differ from yours)
- Paste in the following template: - Paste in the following template:
```yaml ```yaml
version: "3" version: "3"
services: services:
netalertx: netalertx:
container_name: netalertx container_name: netalertx
# use the below line if you want to test the latest dev image # use the below line if you want to test the latest dev image
# image: "ghcr.io/jokob-sk/netalertx-dev:latest" # image: "ghcr.io/jokob-sk/netalertx-dev:latest"
image: "ghcr.io/jokob-sk/netalertx:latest" image: "ghcr.io/jokob-sk/netalertx:latest"
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
cap_drop: # Drop all capabilities for enhanced security
- ALL
cap_add: # Re-add necessary capabilities
- NET_RAW
- NET_ADMIN
- NET_BIND_SERVICE
volumes: volumes:
- local/path/config:/data/config - /app_storage/netalertx/config:/data/config
- local/path/db:/data/db - /app_storage/netalertx/db:/data/db
# (optional) useful for debugging if you have issues setting up the container # to sync with system time
- local/path/logs:/tmp/log - /etc/localtime:/etc/localtime:ro
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured tmpfs:
- /etc/localtime:/etc/localtime:ro # All writable runtime state resides under /tmp; comment out to persist logs between restarts
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
environment: environment:
- PORT=20211 - PORT=20211
``` ```
@@ -59,7 +67,7 @@ services:
```yaml ```yaml
volumes: volumes:
- /volume1/app_storage/netalertx/config:/data/config - /volume1/app_storage/netalertx/config:/data/config
- /volume1/app_storage/netalertx/db:/data/db - /volume1/app_storage/netalertx/db:/data/db
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
# - local/path/logs:/tmp/log <- commented out with # ⚠ # - local/path/logs:/tmp/log <- commented out with # ⚠
``` ```
@@ -72,4 +80,13 @@ services:
![Build](./img/SYNOLOGY/09_Run_and_build.png) ![Build](./img/SYNOLOGY/09_Run_and_build.png)
10. Navigate to `<Synology URL>:20211` (or your custom port). 10. Navigate to `<Synology URL>:20211` (or your custom port).
11. Read the [Subnets](./SUBNETS.md) and [Plugins](/docs/PLUGINS.md) docs to complete your setup. 11. Read the [Subnets](./SUBNETS.md) and [Plugins](/docs/PLUGINS.md) docs to complete your setup.
> [!TIP]
> If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located).
>
> `sudo chown -R 20211:20211 /local_data_dir`
>
> `sudo chmod -R a+rwx /local_data_dir1`
>

View File

@@ -2,7 +2,7 @@
The application uses the following default ports: The application uses the following default ports:
- **Web UI**: `20211` - **Web UI**: `20211`
- **GraphQL API**: `20212` - **GraphQL API**: `20212`
The **Web UI** is served by an **nginx** server, while the **API backend** runs on a **Flask (Python)** server. The **Web UI** is served by an **nginx** server, while the **API backend** runs on a **Flask (Python)** server.
@@ -25,8 +25,8 @@ Follow all of the below in order to disqualify potential causes of issues and to
When opening an issue or debugging: When opening an issue or debugging:
1. Include a screenshot of what you see when accessing `HTTP://<your rpi IP>/20211` (or your custom port) 1. Include a screenshot of what you see when accessing `HTTP://<your_server>:20211` (or your custom port)
1. [Follow steps 1, 2, 3, 4 on this page](./DEBUG_TIPS.md) 1. [Follow steps 1, 2, 3, 4 on this page](./DEBUG_TIPS.md)
1. Execute the following in the container to see the processes and their ports and submit a screenshot of the result: 1. Execute the following in the container to see the processes and their ports and submit a screenshot of the result:
- `sudo apk add lsof` - `sudo apk add lsof`
- `sudo lsof -i` - `sudo lsof -i`
@@ -36,21 +36,21 @@ When opening an issue or debugging:
![lsof ports](./img/WEB_UI_PORT_DEBUG/container_port.png) ![lsof ports](./img/WEB_UI_PORT_DEBUG/container_port.png)
### 2. JavaScript issues ### 2. JavaScript issues
Check for browser console (F12 browser dev console) errors + check different browsers. Check for browser console (F12 browser dev console) errors + check different browsers.
### 3. Clear the app cache and cached JavaScript files ### 3. Clear the app cache and cached JavaScript files
Refresh the browser cache (usually shoft + refresh), try a private window, or different browsers. Please also refresh the app cache by clicking the 🔃 (reload) button in the header of the application. Refresh the browser cache (usually shoft + refresh), try a private window, or different browsers. Please also refresh the app cache by clicking the 🔃 (reload) button in the header of the application.
### 4. Disable proxies ### 4. Disable proxies
If you have any reverse proxy or similar, try disabling it. If you have any reverse proxy or similar, try disabling it.
### 5. Disable your firewall ### 5. Disable your firewall
If you are using a firewall, try to temporarily disabling it. If you are using a firewall, try to temporarily disabling it.
### 6. Post your docker start details ### 6. Post your docker start details
@@ -67,6 +67,6 @@ In the container execute and investigate:
### 8. Make sure permissions are correct ### 8. Make sure permissions are correct
> [!TIP] > [!TIP]
> You can try to start the container without mapping the `/data/config` and `/data/db` dirs and if the UI shows up then the issue is most likely related to your file system permissions or file ownership. > You can try to start the container without mapping the `/data/config` and `/data/db` dirs and if the UI shows up then the issue is most likely related to your file system permissions or file ownership.
Please read the [Permissions troubleshooting guide](./FILE_PERMISSIONS.md) and provide a screesnhot of the permissions and ownership in the `/data/db` and `app/config` directories. Please read the [Permissions troubleshooting guide](./FILE_PERMISSIONS.md) and provide a screesnhot of the permissions and ownership in the `/data/db` and `app/config` directories.

View File

@@ -1,22 +1,22 @@
# Workflows debugging and troubleshooting # Workflows debugging and troubleshooting
> [!TIP] > [!TIP]
> Before troubleshooting, please ensure you have [Debugging enabled](./DEBUG_TIPS.md). > Before troubleshooting, please ensure you have the right [Debugging and LOG_LEVEL set](./DEBUG_TIPS.md).
Workflows are triggered by various events. These events are captured and listed in the _Integrations -> App Events_ section of the application. Workflows are triggered by various events. These events are captured and listed in the _Integrations -> App Events_ section of the application.
## Troubleshooting triggers ## Troubleshooting triggers
> [!NOTE] > [!NOTE]
> Workflow events are processed once every 5 seconds. However, if a scan or other background tasks are running, this can cause a delay up to a few minutes. > Workflow events are processed once every 5 seconds. However, if a scan or other background tasks are running, this can cause a delay up to a few minutes.
If an event doesn't trigger a workflow as expected, check the _App Events_ section for the event. You can filter these by the ID of the device (`devMAC` or `devGUID`). If an event doesn't trigger a workflow as expected, check the _App Events_ section for the event. You can filter these by the ID of the device (`devMAC` or `devGUID`).
![App events search](./img/WORKFLOWS/workflows_app_events_search.png) ![App events search](./img/WORKFLOWS/workflows_app_events_search.png)
Once you find the _Event Guid_ and _Object GUID_, use them to find relevant debug entries. Once you find the _Event Guid_ and _Object GUID_, use them to find relevant debug entries.
Navigate to _Mainetenace -> Logs_ where you can filter the logs based on the _Event or Object GUID_. Navigate to _Mainetenace -> Logs_ where you can filter the logs based on the _Event or Object GUID_.
![Log events search](./img/WORKFLOWS/workflows_logs_search.png) ![Log events search](./img/WORKFLOWS/workflows_logs_search.png)
@@ -24,9 +24,9 @@ Below you can find some example `app.log` entries that will help you understand
```bash ```bash
16:27:03 [WF] Checking if '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggers the workflow 'Sample Device Update Workflow' 16:27:03 [WF] Checking if '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggers the workflow 'Sample Device Update Workflow'
16:27:03 [WF] self.triggered 'False' for event '[[155], ['13f0ce26-1835-4c48-ae03-cdaf38f328fe'], [0], ['2025-04-02 05:26:56'], ['Devices'], ['050b6980-7af6-4409-950d-08e9786b7b33'], ['DEVICES'], ['00:11:32:ef:a5:6c'], ['192.168.1.82'], ['050b6980-7af6-4409-950d-08e9786b7b33'], [None], [0], [0], ['devPresentLastScan'], ['online'], ['update'], [None], [None], [None], [None]] and trigger {"object_type": "Devices", "event_type": "insert"}' 16:27:03 [WF] self.triggered 'False' for event '[[155], ['13f0ce26-1835-4c48-ae03-cdaf38f328fe'], [0], ['2025-04-02 05:26:56'], ['Devices'], ['050b6980-7af6-4409-950d-08e9786b7b33'], ['DEVICES'], ['00:11:32:ef:a5:6c'], ['192.168.1.82'], ['050b6980-7af6-4409-950d-08e9786b7b33'], [None], [0], [0], ['devPresentLastScan'], ['online'], ['update'], [None], [None], [None], [None]] and trigger {"object_type": "Devices", "event_type": "insert"}'
16:27:03 [WF] Checking if '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggers the workflow 'Location Change' 16:27:03 [WF] Checking if '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggers the workflow 'Location Change'
16:27:03 [WF] self.triggered 'True' for event '[[155], ['13f0ce26-1835-4c48-ae03-cdaf38f328fe'], [0], ['2025-04-02 05:26:56'], ['Devices'], ['050b6980-7af6-4409-950d-08e9786b7b33'], ['DEVICES'], ['00:11:32:ef:a5:6c'], ['192.168.1.82'], ['050b6980-7af6-4409-950d-08e9786b7b33'], [None], [0], [0], ['devPresentLastScan'], ['online'], ['update'], [None], [None], [None], [None]] and trigger {"object_type": "Devices", "event_type": "update"}' 16:27:03 [WF] self.triggered 'True' for event '[[155], ['13f0ce26-1835-4c48-ae03-cdaf38f328fe'], [0], ['2025-04-02 05:26:56'], ['Devices'], ['050b6980-7af6-4409-950d-08e9786b7b33'], ['DEVICES'], ['00:11:32:ef:a5:6c'], ['192.168.1.82'], ['050b6980-7af6-4409-950d-08e9786b7b33'], [None], [0], [0], ['devPresentLastScan'], ['online'], ['update'], [None], [None], [None], [None]] and trigger {"object_type": "Devices", "event_type": "update"}'
16:27:03 [WF] Event with GUID '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggered the workflow 'Location Change' 16:27:03 [WF] Event with GUID '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggered the workflow 'Location Change'
``` ```

View File

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -9,11 +9,11 @@ site_description: >-
nav: nav:
- Home: index.md - Home: index.md
- Installation: - Installation:
- Installation options: INSTALLATION.md - Installation options: INSTALLATION.md
- Quick setup: INITIAL_SETUP.md - Quick setup: INITIAL_SETUP.md
- Docker: - Docker:
- Docker Guide: DOCKER_INSTALLATION.md - Docker Guide: DOCKER_INSTALLATION.md
- Docker Compose: DOCKER_COMPOSE.md - Docker Compose: DOCKER_COMPOSE.md
- Docker File Permissions: FILE_PERMISSIONS.md - Docker File Permissions: FILE_PERMISSIONS.md
- Docker Updates: UPDATES.md - Docker Updates: UPDATES.md
@@ -25,24 +25,24 @@ nav:
- Bare-metal (Experimental): HW_INSTALL.md - Bare-metal (Experimental): HW_INSTALL.md
- Migration Guide: MIGRATION.md - Migration Guide: MIGRATION.md
- Help: - Help:
- Common issues: COMMON_ISSUES.md - Common issues: COMMON_ISSUES.md
- Setup: - Setup:
- Getting started: - Getting started:
- Subnets: SUBNETS.md - Subnets: SUBNETS.md
- Enable Plugins: PLUGINS.md - Enable Plugins: PLUGINS.md
- Pi-hole Guide: PIHOLE_GUIDE.md - Pi-hole Guide: PIHOLE_GUIDE.md
- Home Assistant: HOME_ASSISTANT.md - Home Assistant: HOME_ASSISTANT.md
- Emails: SMTP.md - Emails: SMTP.md
- Backups: BACKUPS.md - Backups: BACKUPS.md
- Security Features: SECURITY_FEATURES.md - Security Features: SECURITY_FEATURES.md
- Security Considerations: SECURITY.md - Security Considerations: SECURITY.md
- Advanced guides: - Advanced guides:
- Remote Networks: REMOTE_NETWORKS.md - Remote Networks: REMOTE_NETWORKS.md
- Notifications Guide: NOTIFICATIONS.md - Notifications Guide: NOTIFICATIONS.md
- Name Resolution: NAME_RESOLUTION.md - Name Resolution: NAME_RESOLUTION.md
- Authelia: AUTHELIA.md - Authelia: AUTHELIA.md
- Performance: PERFORMANCE.md - Performance: PERFORMANCE.md
- Reverse DNS: REVERSE_DNS.md - Reverse DNS: REVERSE_DNS.md
- Reverse Proxy: REVERSE_PROXY.md - Reverse Proxy: REVERSE_PROXY.md
- Webhooks (n8n): WEBHOOK_N8N.md - Webhooks (n8n): WEBHOOK_N8N.md
- Workflows: WORKFLOWS.md - Workflows: WORKFLOWS.md
@@ -63,14 +63,15 @@ nav:
- Icons: ICONS.md - Icons: ICONS.md
- Network Topology: NETWORK_TREE.md - Network Topology: NETWORK_TREE.md
- Troubleshooting: - Troubleshooting:
- General Tips: DEBUG_TIPS.md
- Common Issues: COMMON_ISSUES.md
- Inspecting Logs: LOGGING.md - Inspecting Logs: LOGGING.md
- Debugging Tips: DEBUG_TIPS.md - API Server Issues: DEBUG_API_SERVER.md
- Debugging GraphQL: DEBUG_GRAPHQL.md - Invalid JSON Issues: DEBUG_INVALID_JSON.md
- Debugging Invalid JSON: DEBUG_INVALID_JSON.md - PHP Issues: DEBUG_PHP.md
- Debugging PHP: DEBUG_PHP.md - Plugin Issues: DEBUG_PLUGINS.md
- Debugging Plugins: DEBUG_PLUGINS.md - Web UI Port Issues: WEB_UI_PORT_DEBUG.md
- Debugging Web UI Port: WEB_UI_PORT_DEBUG.md - Workflows Issues: WORKFLOWS_DEBUGGING.md
- Debugging Workflows: WORKFLOWS_DEBUGGING.md
- Development: - Development:
- Plugin and app development: - Plugin and app development:
- Environment Setup: DEV_ENV_SETUP.md - Environment Setup: DEV_ENV_SETUP.md
@@ -83,8 +84,8 @@ nav:
- Settings: SETTINGS_SYSTEM.md - Settings: SETTINGS_SYSTEM.md
- Versions: VERSIONS.md - Versions: VERSIONS.md
- Icon and Type guessing: DEVICE_HEURISTICS.md - Icon and Type guessing: DEVICE_HEURISTICS.md
- API: - API:
- Overview: API.md - Overview: API.md
- Devices Collection: API_DEVICES.md - Devices Collection: API_DEVICES.md
- Device: API_DEVICE.md - Device: API_DEVICE.md
- Sessions: API_SESSIONS.md - Sessions: API_SESSIONS.md
@@ -98,9 +99,9 @@ nav:
- GraphQL: API_GRAPHQL.md - GraphQL: API_GRAPHQL.md
- DB query: API_DBQUERY.md - DB query: API_DBQUERY.md
- Tests: API_TESTS.md - Tests: API_TESTS.md
- SUPERSEDED OLD API Overview: API_OLD.md - SUPERSEDED OLD API Overview: API_OLD.md
- Integrations: - Integrations:
- Webhook Secret: WEBHOOK_SECRET.md - Webhook Secret: WEBHOOK_SECRET.md
- Helper scripts: HELPER_SCRIPTS.md - Helper scripts: HELPER_SCRIPTS.md