Skip to content

Commit 0bb6db1

Browse files
committed
Merge branch 'next_release' of https://github.com/netalertx/NetAlertX into next_release
2 parents 7221b4b + c490473 commit 0bb6db1

File tree

158 files changed

+7580
-2896
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+7580
-2896
lines changed

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ LOGS_LOCATION=/path/to/docker_logs
66

77
#ENVIRONMENT VARIABLES
88

9-
TZ=Europe/Paris
109
PORT=20211
1110

1211
#DEVELOPMENT VARIABLES

.github/skills/code-standards/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ description: NetAlertX coding standards and conventions. Use this when writing c
55

66
# Code Standards
77

8-
- ask me to review before going to each next step (mention n step out of x)
9-
- before starting, prepare implementation plan
8+
- ask me to review before going to each next step (mention n step out of x) (AI only)
9+
- before starting, prepare implementation plan (AI only)
1010
- ask me to review it and ask any clarifying questions first
1111
- add test creation as last step - follow repo architecture patterns - do not place in the root of /test
1212
- code has to be maintainable, no duplicate code
13-
- follow DRY principle
13+
- follow DRY principle - maintainability of code is more important than speed of implementation
1414
- code files should be less than 500 LOC for better maintainability
1515

1616
## File Length
@@ -64,7 +64,7 @@ Use timeNowUTC(as_string=False) for datetime operations (scheduling, comparisons
6464

6565
## String Sanitization
6666

67-
Use sanitizers from `server/helper.py` before storing user input.
67+
Use sanitizers from `server/helper.py` before storing user input. MAC addresses are always lowercased and normalized. IP addresses should be validated.
6868

6969
## Devcontainer Constraints
7070

.github/workflows/run-all-tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: 🧪 Manual Test Suite Selector
33
on:
44
workflow_dispatch:
55
inputs:
6+
run_all:
7+
description: '✅ Run ALL tests (overrides individual selectors)'
8+
type: boolean
9+
default: false
610
run_scan:
711
description: '📂 scan/ (Scan, Logic, Locks, IPs)'
812
type: boolean
@@ -23,6 +27,10 @@ on:
2327
description: '📂 ui/ (Selenium & Dashboard)'
2428
type: boolean
2529
default: false
30+
run_plugins:
31+
description: '📂 plugins/ (Sync insert schema-aware logic)'
32+
type: boolean
33+
default: false
2634
run_root_files:
2735
description: '📄 Root Test Files (WOL, Atomicity, etc.)'
2836
type: boolean
@@ -42,12 +50,20 @@ jobs:
4250
id: builder
4351
run: |
4452
PATHS=""
53+
54+
# run_all overrides everything
55+
if [ "${{ github.event.inputs.run_all }}" == "true" ]; then
56+
echo "final_paths=test/" >> $GITHUB_OUTPUT
57+
exit 0
58+
fi
59+
4560
# Folder Mapping with 'test/' prefix
4661
if [ "${{ github.event.inputs.run_scan }}" == "true" ]; then PATHS="$PATHS test/scan/"; fi
4762
if [ "${{ github.event.inputs.run_api }}" == "true" ]; then PATHS="$PATHS test/api_endpoints/ test/server/"; fi
4863
if [ "${{ github.event.inputs.run_backend }}" == "true" ]; then PATHS="$PATHS test/backend/ test/db/"; fi
4964
if [ "${{ github.event.inputs.run_docker_env }}" == "true" ]; then PATHS="$PATHS test/docker_tests/"; fi
5065
if [ "${{ github.event.inputs.run_ui }}" == "true" ]; then PATHS="$PATHS test/ui/"; fi
66+
if [ "${{ github.event.inputs.run_plugins }}" == "true" ]; then PATHS="$PATHS test/plugins/"; fi
5167
5268
# Root Files Mapping (files sitting directly in /test/)
5369
if [ "${{ github.event.inputs.run_root_files }}" == "true" ]; then

CONTRIBUTING.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# 🤝 Contributing to NetAlertX
1+
# Contributing to NetAlertX
22

33
First off, **thank you** for taking the time to contribute! NetAlertX is built and improved with the help of passionate people like you.
44

55
---
66

7-
## 📂 Issues, Bugs, and Feature Requests
7+
## Issues, Bugs, and Feature Requests
88

9-
Please use the [GitHub Issue Tracker](https://github.com/jokob-sk/NetAlertX/issues) for:
10-
- Bug reports 🐞
11-
- Feature requests 💡
12-
- Documentation feedback 📖
9+
Please use the [GitHub Issue Tracker](https://github.com/netalertx/NetAlertX/issues) for:
10+
- Bug reports
11+
- Feature requests
12+
- Documentation feedback
1313

1414
Before opening a new issue:
15-
- 🛑 [Check Common Issues & Debug Tips](https://docs.netalertx.com/DEBUG_TIPS#common-issues)
16-
- 🔍 [Search Closed Issues](https://github.com/jokob-sk/NetAlertX/issues?q=is%3Aissue+is%3Aclosed)
15+
- [Check Common Issues & Debug Tips](https://docs.netalertx.com/DEBUG_TIPS#common-issues)
16+
- [Search Closed Issues](https://github.com/netalertx/NetAlertX/issues?q=is%3Aissue+is%3Aclosed)
1717

1818
---
1919

20-
## 🚀 Submitting Pull Requests (PRs)
20+
## Submitting Pull Requests (PRs)
2121

2222
We welcome PRs to improve the code, docs, or UI!
2323

@@ -29,25 +29,30 @@ Please:
2929
- If relevant, add or update tests and documentation
3030
- For plugins, refer to the [Plugin Dev Guide](https://docs.netalertx.com/PLUGINS_DEV)
3131

32+
33+
## Code quality
34+
35+
- read and follow the [code-standards](/.github/skills/code-standards/SKILL.md)
36+
3237
---
3338

34-
## 🌟 First-Time Contributors
39+
## First-Time Contributors
3540

3641
New to open source? Check out these resources:
3742
- [How to Fork and Submit a PR](https://opensource.guide/how-to-contribute/)
3843
- Ask questions or get support in our [Discord](https://discord.gg/NczTUTWyRr)
3944

4045
---
4146

42-
## 🔐 Code of Conduct
47+
## Code of Conduct
4348

4449
By participating, you agree to follow our [Code of Conduct](./CODE_OF_CONDUCT.md), which ensures a respectful and welcoming community.
4550

4651
---
4752

48-
## 📬 Contact
53+
## Contact
4954

5055
If you have more in-depth questions or want to discuss contributing in other ways, feel free to reach out at:
51-
📧 [jokob@duck.com](mailto:jokob@duck.com?subject=NetAlertX%20Contribution)
56+
[jokob.sk@gmail.com](mailto:jokob.sk@gmail.com?subject=NetAlertX%20Contribution)
5257

5358
We appreciate every contribution, big or small! 💙

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Docker Size](https://img.shields.io/docker/image-size/jokobsk/netalertx?label=Size&logo=Docker&color=0aa8d2&logoColor=fff&style=for-the-badge)](https://hub.docker.com/r/jokobsk/netalertx)
22
[![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/netalertx?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff&style=for-the-badge)](https://hub.docker.com/r/jokobsk/netalertx)
3-
[![GitHub Release](https://img.shields.io/github/v/release/jokob-sk/NetAlertX?color=0aa8d2&logoColor=fff&logo=GitHub&style=for-the-badge)](https://github.com/jokob-sk/NetAlertX/releases)
3+
[![GitHub Release](https://img.shields.io/github/v/release/netalertx/NetAlertX?color=0aa8d2&logoColor=fff&logo=GitHub&style=for-the-badge)](https://github.com/netalertx/NetAlertX/releases)
44
[![Discord](https://img.shields.io/discord/1274490466481602755?color=0aa8d2&logoColor=fff&logo=Discord&style=for-the-badge)](https://discord.gg/NczTUTWyRr)
55
[![Home Assistant](https://img.shields.io/badge/Repo-blue?logo=home-assistant&style=for-the-badge&color=0aa8d2&logoColor=fff&label=Add)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Falexbelgium%2Fhassio-addons)
66

@@ -168,9 +168,9 @@ Get notified about a new release, what new functionality you can use and about b
168168
### 🔀 Other Alternative Apps
169169

170170
- [Fing](https://www.fing.com/) - Network scanner app for your Internet security (Commercial, Phone App, Proprietary hardware)
171-
- [NetBox](https://netboxlabs.com/) - Network management software (Commercial)
171+
- [NetBox](https://netboxlabs.com/) - The gold standard for Network Source of Truth (NSoT) and IPAM.
172172
- [Zabbix](https://www.zabbix.com/) or [Nagios](https://www.nagios.org/) - Strong focus on infrastructure monitoring.
173-
- [NetAlertX](https://netalertx.com) - The streamlined, discovery-focused alternative for real-time asset intelligence.
173+
- [NetAlertX](https://netalertx.com) - The streamlined, discovery-focused choice for real-time asset intelligence and noise-free alerting.
174174

175175
### 💙 Donations
176176

@@ -207,6 +207,7 @@ Proudly using [Weblate](https://hosted.weblate.org/projects/pialert/). Help out
207207
### License
208208
> GPL 3.0 | [Read more here](LICENSE.txt) | Source of the [animated GIF (Loading Animation)](https://commons.wikimedia.org/wiki/File:Loading_Animation.gif) | Source of the [selfhosted Fonts](https://github.com/adobe-fonts/source-sans)
209209
210+
_All product names, logos, and brands are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement._
210211

211212
<!--- --------------------------------------------------------------------- --->
212213
[main]: ./docs/img/devices_split.png "Main screen"

back/app.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Generated: 2022-12-30_22-19-40 #
44
# #
55
# Config file for the LAN intruder detection app: #
6-
# https://github.com/jokob-sk/NetAlertX #
6+
# https://github.com/netalertx/NetAlertX #
77
# #
88
#-----------------AUTOGENERATED FILE-----------------#
99

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ services:
1919
- CHOWN # Required for root-entrypoint to chown /data + /tmp before dropping privileges
2020
- SETUID # Required for root-entrypoint to switch to non-root user
2121
- SETGID # Required for root-entrypoint to switch to non-root group
22+
sysctls: # ARP flux mitigation for host networking accuracy
23+
net.ipv4.conf.all.arp_ignore: 1
24+
net.ipv4.conf.all.arp_announce: 2
2225
volumes:
2326

2427
- type: volume # Persistent Docker-managed Named Volume for storage

docs/API_OLD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ You can access the following files:
149149

150150
| File name | Description |
151151
|----------------------|----------------------|
152-
| `notification_json_final.json` | The json version of the last notification (e.g. used for webhooks - [sample JSON](https://github.com/jokob-sk/NetAlertX/blob/main/front/report_templates/webhook_json_sample.json)). |
152+
| `notification_json_final.json` | The json version of the last notification (e.g. used for webhooks - [sample JSON](https://github.com/netalertx/NetAlertX/blob/main/front/report_templates/webhook_json_sample.json)). |
153153
| `table_devices.json` | All of the available Devices detected by the app. |
154154
| `table_plugins_events.json` | The list of the unprocessed (pending) notification events (plugins_events DB table). |
155155
| `table_plugins_history.json` | The list of notification events history. |

docs/BACKUPS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ There are four key artifacts you can use to back up your NetAlertX configuration
1313
| File | Description | Limitations |
1414
| ------------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
1515
| `/db/app.db` | The application database | Might be in an uncommitted state or corrupted |
16-
| `/config/app.conf` | Configuration file | Can be overridden using the [`APP_CONF_OVERRIDE`](https://github.com/jokob-sk/NetAlertX/tree/main/dockerfiles#docker-environment-variables) variable |
16+
| `/config/app.conf` | Configuration file | Can be overridden using the [`APP_CONF_OVERRIDE`](https://github.com/netalertx/NetAlertX/tree/main/dockerfiles#docker-environment-variables) variable |
1717
| `/config/devices.csv` | CSV file containing device data | Does not include historical data |
1818
| `/config/workflows.json` | JSON file containing your workflows | N/A |
1919

@@ -37,7 +37,7 @@ This includes settings for:
3737

3838
### Device Data
3939

40-
Stored in `/data/config/devices_<timestamp>.csv` or `/data/config/devices.csv`, created by the [CSV Backup `CSVBCKP` Plugin](https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/csv_backup).
40+
Stored in `/data/config/devices_<timestamp>.csv` or `/data/config/devices.csv`, created by the [CSV Backup `CSVBCKP` Plugin](https://github.com/netalertx/NetAlertX/tree/main/front/plugins/csv_backup).
4141
Contains:
4242

4343
* Device names, icons, and categories

docs/DATABASE.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
1+
22
# A high-level description of the database structure
33

4-
An overview of the most important database tables as well as an detailed overview of the Devices table. The MAC address is used as a foreign key in most cases.
4+
An overview of the most important database tables as well as an detailed overview of the Devices table. The MAC address is used as a foreign key in most cases.
55

66
## Devices database table
77

@@ -23,6 +23,7 @@
2323
| `devLogEvents` | Whether events related to the device should be logged. | `0` |
2424
| `devAlertEvents` | Whether alerts should be generated for events. | `1` |
2525
| `devAlertDown` | Whether an alert should be sent when the device goes down. | `0` |
26+
| `devCanSleep` | Whether the device can enter a sleep window. When `1`, offline periods within the `NTFPRCS_sleep_time` window are shown as **Sleeping** instead of **Down** and no down alert is fired. | `0` |
2627
| `devSkipRepeated` | Whether to skip repeated alerts for this device. | `1` |
2728
| `devLastNotification` | Timestamp of the last notification sent for this device. | `2025-03-22 12:07:26+11:00` |
2829
| `devPresentLastScan` | Whether the device was present during the last scan. | `1` |
@@ -42,41 +43,47 @@
4243
| `devParentRelType` | The type of relationship between the current device and it's parent node. By default, selecting `nic` will hide it from lists. | `nic` |
4344
| `devReqNicsOnline` | If all NICs are required to be online to mark teh current device online. | `0` |
4445

46+
> [!NOTE]
47+
> `DevicesView` extends the `Devices` table with two computed fields that are never persisted:
48+
> - `devIsSleeping` (`1` when `devCanSleep=1`, device is offline, and `devLastConnection` is within the `NTFPRCS_sleep_time` window).
49+
> - `devFlapping` (`1` when the device has changed state more than the flap threshold times in the trailing window).
50+
> - `devStatus` — derived string: `On-line`, `Sleeping`, `Down`, or `Off-line`.
51+
4552

46-
To understand how values of these fields influuence application behavior, such as Notifications or Network topology, see also:
53+
To understand how values of these fields influuence application behavior, such as Notifications or Network topology, see also:
4754

4855
- [Device Management](./DEVICE_MANAGEMENT.md)
4956
- [Network Tree Topology Setup](./NETWORK_TREE.md)
5057
- [Notifications](./NOTIFICATIONS.md)
5158

5259

5360
## Other Tables overview
54-
61+
5562
| Table name | Description | Sample data |
56-
|----------------------|----------------------| ----------------------|
57-
| CurrentScan | Result of the current scan | ![Screen1][screen1] |
58-
| Devices | The main devices database that also contains the Network tree mappings. If `ScanCycle` is set to `0` device is not scanned. | ![Screen2][screen2] |
59-
| Events | Used to collect connection/disconnection events. | ![Screen4][screen4] |
60-
| Online_History | Used to display the `Device presence` chart | ![Screen6][screen6] |
61-
| Parameters | Used to pass values between the frontend and backend. | ![Screen7][screen7] |
62-
| Plugins_Events | For capturing events exposed by a plugin via the `last_result.log` file. If unique then saved into the `Plugins_Objects` table. Entries are deleted once processed and stored in the `Plugins_History` and/or `Plugins_Objects` tables. | ![Screen10][screen10] |
63-
| Plugins_History | History of all entries from the `Plugins_Events` table | ![Screen11][screen11] |
64-
| Plugins_Language_Strings | Language strings collected from the plugin `config.json` files used for string resolution in the frontend. | ![Screen12][screen12] |
65-
| Plugins_Objects | Unique objects detected by individual plugins. | ![Screen13][screen13] |
66-
| Sessions | Used to display sessions in the charts | ![Screen15][screen15] |
67-
| Settings | Database representation of the sum of all settings from `app.conf` and plugins coming from `config.json` files. | ![Screen16][screen16] |
63+
|----------------------|----------------------| ----------------------|
64+
| CurrentScan | Result of the current scan | ![Screen1][screen1] |
65+
| Devices | The main devices database that also contains the Network tree mappings. If `ScanCycle` is set to `0` device is not scanned. | ![Screen2][screen2] |
66+
| Events | Used to collect connection/disconnection events. | ![Screen4][screen4] |
67+
| Online_History | Used to display the `Device presence` chart | ![Screen6][screen6] |
68+
| Parameters | Used to pass values between the frontend and backend. | ![Screen7][screen7] |
69+
| Plugins_Events | For capturing events exposed by a plugin via the `last_result.log` file. If unique then saved into the `Plugins_Objects` table. Entries are deleted once processed and stored in the `Plugins_History` and/or `Plugins_Objects` tables. | ![Screen10][screen10] |
70+
| Plugins_History | History of all entries from the `Plugins_Events` table | ![Screen11][screen11] |
71+
| Plugins_Language_Strings | Language strings collected from the plugin `config.json` files used for string resolution in the frontend. | ![Screen12][screen12] |
72+
| Plugins_Objects | Unique objects detected by individual plugins. | ![Screen13][screen13] |
73+
| Sessions | Used to display sessions in the charts | ![Screen15][screen15] |
74+
| Settings | Database representation of the sum of all settings from `app.conf` and plugins coming from `config.json` files. | ![Screen16][screen16] |
6875

6976

7077

7178
[screen1]: ./img/DATABASE/CurrentScan.png
7279
[screen2]: ./img/DATABASE/Devices.png
73-
[screen4]: ./img/DATABASE/Events.png
80+
[screen4]: ./img/DATABASE/Events.png
7481
[screen6]: ./img/DATABASE/Online_History.png
7582
[screen7]: ./img/DATABASE/Parameters.png
7683
[screen10]: ./img/DATABASE/Plugins_Events.png
7784
[screen11]: ./img/DATABASE/Plugins_History.png
7885
[screen12]: ./img/DATABASE/Plugins_Language_Strings.png
79-
[screen13]: ./img/DATABASE/Plugins_Objects.png
86+
[screen13]: ./img/DATABASE/Plugins_Objects.png
8087
[screen15]: ./img/DATABASE/Sessions.png
8188
[screen16]: ./img/DATABASE/Settings.png
8289

0 commit comments

Comments
 (0)