Commit graph

196 commits

Author SHA1 Message Date
d9876d8217
Remove misleading duplicate header test from CaptureTimezone
The test incorrectly suggested the plug handles duplicate headers,
but put_req_header replaces values. Cloudflare only sends one
cf-timezone header, making this test unnecessary.
2026-02-01 11:08:12 -06:00
c4e8c70e7d
Add CaptureTimezone plug to extract cf-timezone header 2026-02-01 11:02:57 -06:00
61a06fc11c
Add firmware version tracking system
- Add firmware context module with upsert, query, and logging functions
- Add FirmwareVersionFetcherWorker to fetch MikroTik RSS daily
- Add Oban cron schedules (2 AM dev, 4 AM prod)
- Add version change detection to Discovery module
- Track firmware history with PubSub broadcasts
- All tests passing

Phase 3-5 of firmware tracking implementation complete.
Next: LiveView UI indicators.
2026-02-01 10:46:27 -06:00
d392c2d788
Add VersionComparator module for semantic version comparison
Implements compare/2 and newer?/2 functions for comparing semantic versions.

Parsing rules:
- Supports 0-3 part versions (e.g., '7', '7.14', '7.14.1')
- Strips v/V prefix and whitespace
- Ignores suffixes after hyphen or space
- Pads missing parts with 0
- Invalid versions (4+ parts, non-numeric, negative) fall back to 0.0.0

Part of firmware version tracking feature (Phase 2).
2026-02-01 10:24:13 -06:00
004189aaf9
Add firmware tracking database schema
- Create firmware_releases table to store latest available firmware versions
- Create device_firmware_history table to track version changes over time
- Add FirmwareRelease and DeviceFirmwareHistory Ecto schemas with validations
- Add comprehensive tests for both schemas (23 tests, 100% coverage)

firmware_releases stores one record per vendor/product_line with latest version.
device_firmware_history is append-only audit log of device firmware changes.

Part of firmware version tracking system for MikroTik (extensible to other vendors).
2026-02-01 10:13:16 -06:00
b30f2cf5af
filter more honeybadger alerts, format dates to users time zone, email template cleanup 2026-02-01 09:27:42 -06:00
feed25080c
add HIBP password check 2026-02-01 08:57:01 -06:00
2fab08f5f8
forgot password flow 2026-01-31 17:03:22 -06:00
021c86a130
more tests and fixes 2026-01-31 16:00:07 -06:00
dff9c26905
fix TOTP enrollment with recovery codes 2026-01-31 14:54:44 -06:00
c690827ee0 user setting re-auth redirect hopeful fix 2026-01-31 13:32:26 -06:00
480789c3e2 banner dissmiss and mikrotik version and license 2026-01-31 13:07:09 -06:00
12a777d13d fix routeros temperature divisor 2026-01-31 12:19:53 -06:00
3c00dcf37c remove passkeys for now 2026-01-31 09:50:35 -06:00
22ae257b60 refactor 2026-01-31 09:35:07 -06:00
b709ae9fbe fix prod crash with yaml parsing 2026-01-31 08:25:07 -06:00
ac66926367 agent overhaul 2026-01-30 16:05:23 -06:00
c22a1c94ea test: add C NIF integration tests for web context
Add lightweight integration tests to verify:
- C NIF module loads properly in web application
- MIB library initializes successfully
- Standard MIB name resolution works
- MibTranslator wrapper functions correctly
- Error handling for invalid MIB names
- SNMP profiles can be loaded (uses MIB translation)

These tests verify the C NIF works end-to-end without checking
full page content, focusing on functional verification only.
2026-01-30 13:29:04 -06:00
0214c2a100 complete overhaul of snmp engine to C nif 2026-01-30 12:27:12 -06:00
836749ba6b complete overhaul of snmp engine 2026-01-30 10:41:07 -06:00
2a36917738 mfa enforced on login 2026-01-29 14:31:13 -06:00
c0736d4c2e gdpr consent tracking 2026-01-29 11:12:35 -06:00
e0552ac97d add security headers 2026-01-29 10:33:24 -06:00
8e739283ad refactoring 2026-01-29 10:03:43 -06:00
d29fb8cfd7 totp fixes 2026-01-28 16:16:59 -06:00
b13de895f7 relax totp time 2026-01-28 15:32:06 -06:00
9833f61043 login redirect fix 2026-01-28 15:18:08 -06:00
0995abbccb Add mandatory TOTP MFA 2026-01-28 15:09:38 -06:00
1f6151b5a8 filter snmp communities from log 2026-01-28 14:51:47 -06:00
aed15dd6a1 impersonate fixes 2026-01-28 14:41:27 -06:00
0b27300931 support prod ip db import 2026-01-28 13:48:33 -06:00
b341f89332 prod ip db import 2026-01-28 13:28:11 -06:00
220f1edce3 cookie improvements 2026-01-28 12:30:28 -06:00
f350a9ade4 test cleanup 2026-01-28 10:31:22 -06:00
88c003d474 major snmp overhaul 2026-01-28 09:07:13 -06:00
5fb92dd961
add device/org limit 2026-01-27 14:14:25 -06:00
328d4659a7
show correct agent on edit screen and fix airfiber/ltu 2026-01-27 12:52:43 -06:00
1af381b5bf
snmp tests and docker attempt to build locally 2026-01-27 10:16:54 -06:00
421f2e05f3
faster tests 2026-01-27 09:30:18 -06:00
6c238c52e5
fix a few things and fix device discovery 2026-01-26 17:17:31 -06:00
bb86dec559
add oban pro 2026-01-26 17:07:42 -06:00
b20a58aec4
test fixes 2026-01-26 15:27:59 -06:00
756a6b4cd4
poller agent fix and trigger device rediscovery 2026-01-26 14:51:32 -06:00
51a73b3a44
allow superuser impersonation 2026-01-26 11:37:50 -06:00
c41b479ed8
more tests 2026-01-26 11:01:47 -06:00
99414459d3
device reorder 2026-01-26 10:22:12 -06:00
9c5b4096f9
discovery working 2026-01-25 14:48:57 -06:00
9c2efec473
test: add coverage for MikroTik wrong unit type override
Adds test case for the real-world scenario where MikroTik devices
report incorrect mtxrGaugeUnit values (e.g., reporting unit type 1
for celsius/temperature when the sensor is actually a voltage sensor).

This test verifies that the name-based override logic in
maybe_override_sensor_type/2 correctly handles this case:
- Sensor name: "psu1-voltage" or "psu2-voltage"
- Reported unit type: 1 (celsius/temperature)
- Expected result: voltage sensor with divisor 10

The override code was added in commit f402dcb (Jan 22, 2026) and
works correctly for new discoveries. Existing sensors created before
this date need the migration from commit 68a4ebf to fix their values.

Related: 20260125182836_fix_misclassified_mikrotik_voltage_sensors.exs

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-25 12:34:19 -06:00
a9405f6818
refactor: alias DiscoveryWorker at module top and skip flaky performance test
- Fixes credo warning about nested module alias
- Tags performance test to exclude from precommit hook (flaky timing on slow machines)
2026-01-25 09:14:07 -06:00
a92d003aec
refactor: replace Task.async_stream with Oban jobs for discovery
Changed discover_all/1 to enqueue individual Oban jobs instead of using
Task.async_stream for better error visibility and resilience.

Benefits:
- Errors are visible in Oban dashboard with full stack traces
- Automatic retries on failure via Oban
- Jobs persist across pod restarts
- No more silent failures from Task crashes
- Better concurrency control via Oban queue configuration

Changes:
- discover_all/1 now enqueues DiscoveryWorker jobs and returns immediately
- Return type changed from %{success, failed, errors} to %{enqueued, failed, errors}
- Updated tests to match new async behavior
- Added DiscoveryWorker alias to Discovery module

All tests passing (3,625 tests, 0 failures).
2026-01-24 17:15:36 -06:00