Commit Graph
620 Commits
Author SHA1 Message Date
Jokob @NetAlertX 474c3574ee feat(models): add initial models package with domain model descriptions 2026-08-21 22:23:54 +00:00
Jokob @NetAlertX 99897988e4 Merge pull request #1760 from netalertx/main
sync
2026-08-22 08:12:23 +10:00
Jokob @NetAlertX fe2c3f8948 Merge pull request #1756 from justadityaraj/feat/ntfy-multiple-custom-headers
feat(ntfy): allow more than one custom header
2026-08-22 08:07:45 +10:00
Aditya Raj Singh 63b20d060e docs(ntfy): document per-entry header skipping
The whitespace note contradicted itself: it said surrounding whitespace is
trimmed and then that leading or trailing whitespace is invalid. The parser
strips, so trimming is what actually happens.

Also lists the new non-ASCII/newline skip reason and states that skipping is
per entry, and adds the language identifier markdownlint wants on the two
fenced blocks (MD040).
2026-08-21 23:18:09 +05:30
Aditya Raj Singh 2d4e2d5f05 fix(ntfy): skip custom headers that cannot be sent
A custom header carrying a non-ASCII character raised UnicodeEncodeError from
inside http.client. That is a ValueError, not a RequestException, so it escaped
both handlers in send() and took the whole publisher down - every notification
lost because of one typo in one header.

build_custom_headers now rejects newlines and non-ASCII the same way it already
rejects malformed and colliding entries: warn, skip that entry, keep the rest.
UnicodeEncodeError is still caught at the request, as a backstop for the
plugin's own headers, since REPORT_DASHBOARD_URL feeds one of them.

Verified against real requests: before, send() raised UnicodeEncodeError; after,
the bad header is dropped and the notification is still posted.
2026-08-21 23:17:28 +05:30
copilot-swe-agent[bot]andjokob-sk 05bdf1985e fix: lazy-import write_notification to prevent partial module load in tests
Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-20 22:09:27 +00:00
Aditya Raj Singh 4f604e4e2b feat(ntfy): allow more than one custom header
The custom header added in #1695 was a single name/value pair, which is
enough for a proxy that authenticates with one token but not for Pangolin,
which expects both P-Access-Token-Id and P-Access-Token.

NTFY_CUSTOMHEADER_NAME and NTFY_CUSTOMHEADER_VALUE are replaced by a single
list setting, NTFY_CUSTOM_HEADERS, holding one "Name: Value" entry per
header. The list widget is the same one the other list settings use.

Only the first colon separates the name from the value, so values may
contain colons. An entry is skipped and logged when it is malformed, when
the name repeats, or when it collides with a header the plugin already set,
so a custom header still cannot clobber the ntfy credentials.

Values are never written to the log, since they are usually secrets. That
also applies to the invalid-header error, which now names the headers that
were applied without quoting any of them.
2026-08-21 00:12:42 +05:30
jokob-sk 7a21bad8be FE+BE: Pause/Resume scans #1754 2026-08-20 14:48:42 +10:00
Jokob @NetAlertX 5c4aa85b34 FE: Implement pause/resume functionality for automatic scans with API endpoints and UI updates 2026-08-20 03:09:50 +00:00
jokob-sk 8ecf1ace65 FE: Add devComments to columns selection #1751 2026-08-20 11:17:55 +10:00
jokob-sk 457281c0c5 PLG: UNIFIAPI devVlan removal #1741 + v bump 2026-08-19 08:15:03 +10:00
Jokob @NetAlertX 14a34dfd51 Merge pull request #1748 from netalertx/main
sync
2026-08-17 07:44:34 +10:00
Aditya Raj Singh 5c6faaba2a Document the new ntfy settings and stop leaking the custom header value
Adds README examples for the custom header and URL query string settings,
and handles requests' InvalidHeader separately: its message embeds the
offending header value, so logging it leaked NTFY_CUSTOMHEADER_VALUE into
the plugin result file and the UI.
2026-08-17 01:24:33 +05:30
Aditya Raj Singh a297bf18c6 Add custom header and URL query string options to the ntfy publisher
Lets users authenticate ntfy notifications through a reverse proxy or tunnel
(Pangolin, Tailscale, ...) in front of the ntfy instance. Adds three optional,
backward-compatible settings that default to empty and are no-ops when unset:

- NTFY_URL_QUERY_STRING: appended to the request URL (e.g. p_token=...). A
  leading '?' is tolerated, and the value is redacted from error logs / the
  plugin result file since the request URL can carry a secret token.
- NTFY_CUSTOMHEADER_NAME / NTFY_CUSTOMHEADER_VALUE: a custom request header,
  skipped with a warning if it would clobber a built-in header (e.g.
  Authorization) so ntfy's own auth stays intact.

Secret-bearing fields are password-masked in the UI. Addresses #1663.
2026-08-17 01:24:33 +05:30
jokob-sk 2ec90334d5 PLG:ADGUARDIMP add static_leases #1746 #1742 2026-08-16 08:31:01 +10:00
jokob-sk 85918cc4e0 PLG:ADGUARDIMP add static_leases #1746 #1742 2026-08-15 12:48:08 +10:00
jokob-sk 383ab12eb1 PLG: UNIFIAPI devVlan, devSite import #1741 2026-08-15 12:31:11 +10:00
jokob-sk 9adb39e0b3 Merge branch 'next_release' of github.com:netalertx/NetAlertX into next_release 2026-08-15 12:21:24 +10:00
jokob-sk f33800f2d6 PLG: UNIFIAPI devVlan, devSite import #1741 2026-08-15 12:21:01 +10:00
Jokob @NetAlertX 3196b8088a Merge pull request #1744 from netalertx/copilot/fix-devcomments-xml-issue
Escape notification HTML device fields and fall back on indent errors
2026-08-15 10:15:38 +10:00
copilot-swe-agent[bot]andjokob-sk 13da2ddbf1 fix: use valid notification fallback log level
Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-14 23:51:15 +00:00
copilot-swe-agent[bot]andjokob-sk 44ed53cb69 test: cover escaped notification html fallback
Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-14 15:34:07 +00:00
copilot-swe-agent[bot]andjokob-sk 0197e7c2cf fix: escape notification HTML device fields
Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-14 15:29:44 +00:00
Jokob @NetAlertX f14364335b Merge pull request #1739 from netalertx/copilot/fix-nic-child-relationship-issue
Fix: NIC child presence no longer forces a directly-detected parent offline (#1736)
2026-08-13 19:20:28 +10:00
copilot-swe-agent[bot]andjokob-sk f52cc50705 fix: address review feedback on NIC presence logic and tests
- Replace max() with explicit if/else for readability
- Use db_test_helpers (make_db, make_device_dict, insert_device_from_dict,
  DummyDB) instead of local mock DB objects in test_nic_presence.py
- Lowercase all MAC addresses in tests

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 08:52:43 +00:00
copilot-swe-agent[bot]andjokob-sk 283bea21c9 fix: NIC child presence no longer forces a directly-detected parent offline
When a parent device has NIC children, update_devPresentLastScan_based_on_nics
previously replaced the parent's devPresentLastScan unconditionally with the
NIC-derived value. This discarded any genuine direct detection of the parent:
if the parent was found by ARP/save_own_device (present=1) but its NIC child
was absent (present=0), the NIC step forced the parent back to 0. The next
scan re-detected the parent → Connected event → NIC forced it down again,
producing an endless one-directional Connected event stream.

Fix: use max(original, nic_derived) so NIC children can only raise a parent's
presence (bring an undetected parent online), never lower it when the parent
itself was directly detected this cycle.

Adds test/scan/test_nic_presence.py covering the exact regression scenario
and surrounding cases (raise, no-NIC unchanged, req_all modes).

Fixes #1736

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 08:44:00 +00:00
copilot-swe-agent[bot]andjokob-sk 2dc2207228 fix: remove localtime modifier from skip_repeated_notifications cooldown comparison; add UTC regression tests
Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 06:23:09 +00:00
Jokob @NetAlertX a06dc259a8 Refactor plugin paths in scripts and tests to ensure consistent directory structure 2026-08-10 03:51:23 +00:00
Jokob @NetAlertX 9e38cfd8b4 Add website monitoring plugin and update workflows configuration
- Introduced a new plugin for monitoring website health, including functionality to check URLs and log results.
- Created README and configuration files for the workflows plugin, detailing its purpose and settings.
- Updated import paths in various test files to reflect the new directory structure.
- Ensured compatibility of test cases with the updated plugin architecture.
2026-08-10 02:32:49 +00:00
jokob-sk 1aea4e8216 DOCS: email 2026-07-25 10:25:33 +10:00
jokob-sk 02987fa558 BE+FE: NOTI TEXT template -> textarea 2026-07-25 09:58:15 +10:00
jokob-sk 2396bb610a DOCS: email update 2026-07-25 08:11:08 +10:00
jokob-sk 056f5ed2a4 PLG+BE: more notification fields + RSTIMP devVlan in SET_ALWAYS #1719 2026-07-24 08:19:37 +10:00
jokob-sk 62bcb077d7 BE: preheader + typo 2026-07-13 19:52:04 +10:00
jokob-sk e294a1833d BE: review fixes 2026-07-12 10:39:07 +10:00
jokob-sk 1636d155c7 BE+FE: report findinfg fixes + css 2026-07-12 10:26:53 +10:00
jokob-sk 7f4c7907be BE: better notification preview 2026-07-10 12:06:45 +10:00
jokob-sk 2658d5703e BE+FE: less logging bloat + better notification preview + skeletons 2026-07-09 13:34:54 +10:00
jokob-sk 7e6189cbd4 BE+FE: change log 2026-07-06 15:00:41 +10:00
jokob-sk e0449bed8e BE+FE: change log 2026-07-05 22:38:29 +10:00
Jokob @NetAlertX 18ec0ce96c feat: Implement DevicesHistory feature with triggers and history tracking
- Added db_history.py to manage DevicesHistory table and triggers for INSERT and UPDATE operations.
- Created device_history_instance.py for querying and grouping DevicesHistory records.
- Developed change_history.php for displaying device change history with filtering and pagination.
- Introduced skel_device_details_tab_history.php for skeleton loading state in device details tab.
- Added unit tests in test_device_history.py to validate trigger functionality and history management.
- Implemented filter population and pagination in the change history UI.
2026-07-04 23:34:52 +00:00
jokob-sk 351b6a7d28 BE: unable to exclude loacl_MAC entries #1700 2026-07-04 09:36:24 +10:00
jokob-sk 9b297b218f Merge branch 'next_release' of github.com:netalertx/NetAlertX into next_release 2026-07-02 08:08:46 +10:00
jokob-sk 2eb3f88426 BE: clearer setings initializing message #1696 2026-07-02 08:08:31 +10:00
Jokob @NetAlertX 636b0d9ca7 Add 'not_equals' and 'not_contains' operators; enhance workflow examples and tests 2026-07-01 08:14:00 +00:00
Jokob @NetAlertX f52e303c19 FE: add 'Wait for settings reload' option to UI settings 2026-06-21 01:08:56 +00:00
Jokob @NetAlertX 102a62c8b7 FE: enhance settings save functionality with reload wait detection and background processing 2026-06-21 00:57:17 +00:00
Jokob @NetAlertX 4075aa469b Merge pull request #1675 from netalertx/next_release
Next release
2026-06-17 15:37:23 +10:00
Jokob @NetAlertX 26b337d6a7 feat(workflows): Enhance device management with query capabilities and conflict resolution
- Added `queryByConditions` method to `DeviceInstance` for flexible device querying based on dynamic conditions.
- Introduced `interpolate_tokens` function to replace placeholders in action values with actual device data.
- Updated `UpdateFieldAction` to handle cross-device updates and archive conflicting MAC addresses.
- Implemented cascade prevention in `WorkflowManager` to avoid processing events for devices modified in the same batch.
- Added unit tests for new functionalities, including token interpolation, condition querying, and action execution.
- Created constants for device column validation to enhance security and maintainability.
- Established a structured research skill specification to guide development practices.
2026-06-16 11:40:28 +00:00
Jokob @NetAlertX 62c4833d0f Merge pull request #1672 from netalertx/next_release
BE: Removal of stdout.log
2026-06-14 10:58:09 +10:00