Commit graph

174 commits

Author SHA1 Message Date
0995abbccb Add mandatory TOTP MFA 2026-01-28 15:09:38 -06:00
aed15dd6a1 impersonate fixes 2026-01-28 14:41:27 -06:00
220f1edce3 cookie improvements 2026-01-28 12:30:28 -06:00
f350a9ade4 test cleanup 2026-01-28 10:31:22 -06:00
5fb92dd961
add device/org limit 2026-01-27 14:14:25 -06:00
3bb89670bd
enable agent debugging 2026-01-27 13:25:04 -06:00
328d4659a7
show correct agent on edit screen and fix airfiber/ltu 2026-01-27 12:52:43 -06:00
378dc5f8ec
dialyzer fix 2026-01-27 11:09:59 -06:00
6920333d6a
impersonate fix 2026-01-27 10:45:06 -06:00
19a818647b
documentation updates 2026-01-26 16:36:52 -06:00
6782309682
add default temp unit 2026-01-26 15:39:36 -06:00
a05b125600
update cloud poller icon 2026-01-26 15:38:09 -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
5e7576bc3f
api token whitespace fix and magic link login fix 2026-01-26 14:05:44 -06:00
74f2970664
ui tweaks 2026-01-26 13:34:52 -06:00
902d21eeee
poller detail screen fix 2026-01-26 12:46:14 -06:00
5f1bbab420
cloud poller fixes 2026-01-26 11:57:32 -06:00
c41b479ed8
more tests 2026-01-26 11:01:47 -06:00
99414459d3
device reorder 2026-01-26 10:22:12 -06:00
e781a70c7e
device list update 2026-01-26 09:44:08 -06:00
d2abe9a14d
add network map 2026-01-25 15:24:35 -06:00
21802eede4
adjust timestamps to be relative 2026-01-25 14:52:13 -06:00
9c5b4096f9
discovery working 2026-01-25 14:48:57 -06:00
a30d6b8219
unit fixes 2026-01-25 13:59:09 -06:00
277d3be2bd
remove agent version display 2026-01-25 12:22:47 -06:00
d12ffda8b0
show unit 2026-01-25 12:18:41 -06:00
788004cb97
fix: handle :global agent source in device form template
Production was crashing with CaseClauseError when viewing device edit
form for devices using the global default cloud poller.

Added missing :global case branch to the agent source case statement
in form.html.heex line 127.

Displays: 'Using global default cloud poller: <agent_name>'
2026-01-25 11:04:29 -06:00
6516f509e9
cleanup: remove debug logging from agent creation (again)
The user had manually added debug logging in commit 66fd6fa.
Now that the cloud poller checkbox issue is fixed, removing the debug output.
2026-01-25 09:10:47 -06:00
97cdb8e46c
fix: handle cloud pollers in agent show page and fix NoResultsError
Two issues fixed:
1. Cloud pollers (organization_id = nil) were causing access denied errors
   when superadmins tried to view them. Now allows access if user is
   superadmin and agent is a cloud poller.

2. Ecto.NoResultsError was being raised without required :queryable option,
   causing KeyError crash. Now properly raises with queryable parameter.

Error was:
  KeyError: key :queryable not found in []
  (ecto 3.13.5) lib/ecto/exceptions.ex:203: Ecto.NoResultsError.exception/1
  (towerops) lib/towerops_web/live/agent_live/show.ex:16: mount/3
2026-01-25 09:09:50 -06:00
66fd6fa3b6
cloud poller id 2026-01-25 08:52:35 -06:00
1d638c0c83
cleanup: remove debug logging from agent creation
The checkbox issue has been fixed, no longer need the debug output.
2026-01-25 08:39:35 -06:00
e27cc5495a
fix: handle checkbox 'on' value for cloud poller creation
HTML checkboxes send value='on' when checked, not 'true'. Updated
parse_agent_params to accept both 'on' and 'true' values for the
is_cloud_poller field.

Added debug logging to help diagnose future form submission issues.
2026-01-25 08:22:31 -06:00
6c1f344b5e
fix: resolve all dialyzer unmatched return and pattern match warnings
Fixed dialyzer warnings across multiple files by properly handling return
values from functions that are called for side effects.

Changes:
- lib/towerops/agents.ex: Explicitly match broadcast and if-expression returns
- lib/towerops/devices.ex: Match worker start function returns in if-expressions
- lib/towerops/workers/agent_latency_evaluator.ex: Match broadcast return
- lib/towerops/workers/device_monitor_worker.ex: Match perform_check and handle_status_change returns, handle schedule_next_check errors
- lib/towerops/workers/device_poller_worker.ex: Match all PubSub broadcast returns, handle schedule_next_poll errors, remove unreachable pattern
- lib/towerops/workers/stale_agent_worker.ex: Match process_stale_agents and broadcast returns
- lib/towerops_web/channels/agent_channel.ex: Match PubSub.subscribe return, improve get_addr pattern matching, remove unreachable format_ip clause
- lib/towerops_web/live/device_live/form.ex: Match enqueue_discovery return, replace compile-time @dev_env with runtime check

Pattern applied:
- PubSub broadcasts: `_ = Phoenix.PubSub.broadcast(...)`
- If-expressions with side effects: `_ = if condition do ... end`
- Critical operations: Added error logging with case statements

All 3625 tests passing. No dialyzer warnings remaining in lib/towerops or lib/towerops_web.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-24 17:34:37 -06:00
d0946c3cd0
refactor: simplify job architecture from Oban coordinators to direct workers
Removes unnecessary two-layer architecture (Oban Coordinator → GenServer)
in favor of direct Oban workers that perform the actual work.

Changes:
- Replace DevicePollerCoordinator + PollerWorker with DevicePollerWorker
- Replace DeviceMonitorCoordinator + DeviceMonitor with DeviceMonitorWorker
- Simplify Monitoring.Supervisor (removed Registries, DynamicSupervisors)
- Remove all Exq dependencies (workers, supervisor, mix deps)
- Convert DiscoveryWorker from Exq to Oban pattern
- Update Devices context to auto-start/stop monitoring and polling
- Update all LiveView callers to use new Oban enqueue pattern
- Fix all tests to use Oban.Job struct instead of raw IDs

Benefits:
- Simpler codebase (~850 lines removed)
- Better reliability (Oban handles retries, failures)
- Lower memory (no persistent GenServers)
- Better observability (work visible in Oban dashboard)
- Cluster-wide coordination via PostgreSQL
- Extensive PubSub usage for real-time events

Files deleted:
- lib/towerops/workers/device_monitor_coordinator.ex
- lib/towerops/workers/device_poller_coordinator.ex
- lib/towerops/snmp/poller_worker.ex
- lib/towerops/monitoring/device_monitor.ex
- lib/towerops/workers/monitor_worker.ex
- lib/towerops/workers/poll_worker.ex
- lib/towerops/exq_supervisor.ex
- All related test files

Files created:
- lib/towerops/workers/device_poller_worker.ex
- lib/towerops/workers/device_monitor_worker.ex

All 3,686 tests passing.
2026-01-24 16:36:57 -06:00
67614cb93f
improve cloud poller display 2026-01-24 13:33:01 -06:00
e6054129b2
remote agent/cloud improvements 2026-01-24 09:16:41 -06:00
f084e09ea1
add multiple cloud agents 2026-01-23 18:04:01 -06:00
518b49318c
routeros fix 2026-01-23 13:16:02 -06:00
a4335a047a
allow nonroutable for me 2026-01-23 13:10:12 -06:00
a0ba9285dd
bring in snmpkit 2026-01-23 12:52:17 -06:00
80d1864700
mac discovery 2026-01-23 09:22:08 -06:00
7bd3b1f9ec
arp 2026-01-23 08:40:57 -06:00
f402dcb7af
fix mikrotik sensors 2026-01-22 18:07:20 -06:00
639ffd4a2c
better discovery 2026-01-22 17:40:58 -06:00
96fc488023
sanitize snmp data and fix some cpu things 2026-01-22 16:53:01 -06:00
d401e0b036
mikrotik improvements 2026-01-22 13:05:28 -06:00
0a4482f974
feat: add 5 new vendor modules and fix dialyzer issues
Vendor modules added:
- Aviat (WTM microwave radios)
- Aruba (wireless controllers and APs)
- CiscoWLC (Cisco wireless LAN controllers)
- Teltonika (RUTOS LTE routers)
- Sub10 (mmWave backhaul radios)

Dialyzer fixes:
- Fix unknown type Devices.t/0 in alert.ex and device.ex
- Fix unmatched_return warnings across multiple files
- Add :exq to PLT for Exq function detection
- Remove dead code in base.ex, dynamic.ex, vendor.ex
- Fix Device.t() type spec to allow nil name field

Tests: 1437 tests, 0 failures
Dialyzer: 0 errors
Credo: no issues
2026-01-22 09:34:50 -06:00
605f8c09ec
feat: add discovered sensors table to debug tab
Display discovered sensors in a parsed table format showing type,
description, OID, value with unit, and state description for state
sensors.
2026-01-21 17:18:44 -06:00
c26e379dd7
fix device update handler 2026-01-21 14:42:55 -06:00