Commit Graph
6644 Commits
Author SHA1 Message Date
Jokob @NetAlertX 7cbdeb9855 docs(tests): add guidelines for stubbing modules in standalone-capable tests 2026-08-21 22:44:08 +00:00
Jokob @NetAlertX 8000d9b453 refactor(tests): improve module stubbing in ntfy custom header tests 2026-08-21 22:38:11 +00:00
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 64ae530d36 Merge pull request #1759 from Valiante/Valiante-patch-1
Fix: theme reverts to Light after header reload (#943)
2026-08-22 08:11:10 +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
Jokob @NetAlertX fe3cfd6e48 Merge pull request #1757 from netalertx/copilot/fix-comprehensive-test-failure
fix: lazy-import write_notification to prevent partial module load in CI tests
2026-08-22 08:04:42 +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
Valiante 9fedd49e4a Fix: theme reverts to Light after header reload (#943)
Theme was applied on raw $(document).ready, which fires before the async cacheSettings() call has necessarily populated the settings cache. clearCache() (the header reload button) wipes localStorage immediately before reloading, so that reload could read an empty cache and hard-override the theme to Light via setCookie, even with Dark or System configured. Gated the theme application on callAfterAppInitialized(), which is already used elsewhere for this class of race.

Fixes #943
2026-08-21 17:44:21 +01:00
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
copilot-swe-agent[bot] baed8d458f Initial plan 2026-08-20 21:39:19 +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 9eedaaeade FE: ro session fields for dummy devices #1755 2026-08-20 17:59:36 +10:00
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 @NetAlertX d3bb857567 Merge pull request #1740 from netalertx/next_release
Next release
2026-08-20 12:42:54 +10: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
Jokob @NetAlertX 548d698b02 Merge pull request #1695 from justadityaraj/feat/ntfy-custom-query-string
Add custom header and URL query string options to the ntfy publisher
2026-08-17 07:25:01 +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 0e391eba80 PLG: UNIFIAPI devVlan, devSite import #1741 + v bump 2026-08-15 12:33:43 +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
copilot-swe-agent[bot] 208fa928ea Initial plan 2026-08-14 15:26:47 +00:00
Christian Isenberg 67bad01aca Translated using Weblate (Portuguese (Brazil))
Currently translated at 49.2% (409 of 831 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/pt_BR/
2026-08-14 15:51:24 +02: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 4ed96e9304 chore: strengthen test MAC and helper rules in code-standards and pr-analysis skills
Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 09:14:50 +00:00
copilot-swe-agent[bot]andjokob-sk 66db9a4b57 chore: add missing pr-analysis and logging-standards skills
Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 09:04:36 +00:00
Jokob @NetAlertX 6208e00dd8 Merge pull request #1738 from netalertx/copilot/fix-skip-repeated-notifications
fix: correct UTC/localtime mismatch in skip_repeated_notifications cooldown
2026-08-13 18:57:04 +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] c0718d8618 Initial plan 2026-08-13 08:38:19 +00:00
copilot-swe-agent[bot]andjokob-sk 80f2b03870 fix: use db_test_helpers and lowercase MACs in skip_repeated test
Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 08:35:40 +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
copilot-swe-agent[bot] 16210a9f19 Initial plan 2026-08-13 06:20:50 +00:00
Jokob @NetAlertX eed8a3960c Merge pull request #1735 from Valiante/patch-2
Fix: clock shows wrong timezone after header reload (#1640)
2026-08-13 10:18:04 +10:00
Valiante 229755bf56 Fix: clock shows wrong timezone after header reload (#1640)
tz/LOCALE were evaluated once as module-level consts at script-load time. clearCache() (the header reload button) wipes localStorage right before reloading, so that reload could read an empty settings cache, fall back to the hardcoded 'Europe/Berlin' default, and stay locked to that wrong value for the rest of the page's life. Moved the reads inside localizeTimestamp() so they're evaluated fresh on every call instead.
2026-08-12 15:35:23 +01:00
Anonymous 21aeaf2de8 Translated using Weblate (Arabic)
Currently translated at 81.1% (674 of 831 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ar/
2026-08-11 08:51:30 +02:00
Anonymous 4c5b8dfeee Translated using Weblate (Turkish)
Currently translated at 53.9% (448 of 831 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/tr/
2026-08-11 08:51:28 +02:00
Anonymous a5060d303b Translated using Weblate (Polish)
Currently translated at 80.9% (673 of 831 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/pl/
2026-08-11 08:51:26 +02:00