Commit graph

1637 commits

Author SHA1 Message Date
FluxCD
5c70ce49ef chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771257711-5b786aa [skip ci] 2026-02-16 16:05:47 +00:00
5b786aac08 Add maintenance windows and weather overlay (backend)
Maintenance Windows:
- maintenance_windows table with org/site/device scoping
- Full CRUD context (Towerops.Maintenance)
- device_in_maintenance?/1 checks device → site → org hierarchy
- Alert suppression in DeviceMonitorWorker (skips alerts during maintenance)
- maintenance_badge/1 helper for UI display

Weather Overlay:
- weather_observations + weather_alerts tables
- OpenWeatherMap free API client (lat/lon based)
- WeatherSyncWorker (Oban, 15min interval, respects rate limits)
- Observation parsing from OWM response format
- Correlation helpers: severe_weather_near?/2, weather_at/2
- Severity classification tuned for WISP ops (wind, rain, ice thresholds)
- Per-org latest observations query for dashboard
- 30-day automatic cleanup

Both features are backend-only — no UI yet.
2026-02-16 10:01:19 -06:00
FluxCD
33f4b5dc16 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771252516-541b418 [skip ci] 2026-02-16 14:39:41 +00:00
541b418d57 Group billing providers on settings integrations tab
Add 'Billing & Subscriber Management' section header with 'Choose one'
badge and 'Other Integrations' divider on the settings page integrations
tab. Reorder providers: billing first (Gaiia, Sonar, Splynx, VISP),
then QoE/incidents/infrastructure.
2026-02-16 08:34:46 -06:00
FluxCD
6331bc9400 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771251798-9194694 [skip ci] 2026-02-16 14:27:50 +00:00
91946946a6 Make billing integration exclusivity more obvious
Add 'Choose one' badge with indigo border to billing category,
clarify that only one billing platform can be active at a time.
2026-02-16 08:22:47 -06:00
FluxCD
7e819d62cf chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771199171-47b364a [skip ci] 2026-02-15 23:50:49 +00:00
FluxCD
76c84c2a03 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771198882-b4c0407 [skip ci] 2026-02-15 23:45:50 +00:00
47b364a112
Fix Gaiia inventory matching, mapping UX, and logo link
- Fetch MAC address from Gaiia custom fields during inventory sync
- Remove name-based device matching (model names caused false matches)
- Keep IP-only matching for device suggestions
- Make unmapped rows clickable in the Gaiia mapping table
- Point authenticated logo link to /dashboard instead of /orgs
- Fix flaky monitor test teardown race condition
2026-02-15 17:41:43 -06:00
b4c0407ee0 Add granular org roles: executive, technician
New role system:
- owner: full access + financials
- admin: full access + financials (except org deletion)
- executive: read-only + full financial visibility (MRR, revenue)
- technician: field ops (devices, sites, alerts) without financials
- member: legacy alias for technician (migrated)
- viewer: read-only, no financials

Financial data (MRR, revenue, billing) gated behind can_view_financials
assign in all LiveView templates: dashboard, alerts, trace, site show.

Includes migration to rename existing member roles to technician.
2026-02-15 17:40:53 -06:00
FluxCD
bc22abb452 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771198073-d32ba58 [skip ci] 2026-02-15 23:31:43 +00:00
FluxCD
d859757a17 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771197773-866715f [skip ci] 2026-02-15 23:26:42 +00:00
d32ba58b75 Hide config backup and config change features from UI
Temporarily hide config change tracking, config timeline links,
and config backup references across dashboard, site show, trace,
and home page. Code preserved with hidden class / HTML comments.
2026-02-15 17:26:10 -06:00
866715fdcc Hide MikroTik API/SSH features from UI
Temporarily disable all MikroTik-related UI elements using false guards.
Code is preserved and can be re-enabled by removing the guards.

Hidden: org settings tab/panel, device form config section,
device show backups/timeline tabs, site form config section,
help page nav item.
2026-02-15 17:18:55 -06:00
6d678b6d17 Merge pull request 'gaiia' (#1) from gaiia into main
Reviewed-on: graham/towerops-web#1
2026-02-15 15:17:27 -08:00
f7dc546bcf
Merge remote-tracking branch 'origin/main' into gaiia 2026-02-15 17:17:10 -06:00
719ac1eb0f
Fix Mix.env() runtime crash in releases
Capture Mix.env() at compile time via module attribute since Mix is
not available at runtime in production releases.
2026-02-15 17:16:48 -06:00
8b51b02d45
Compute per-site subscriber counts from IP block matching
After Gaiia sync, match inventory item IPs against network site CIDR
blocks to populate account_count and total_mrr on each site. This
enables the Site Health table to show subscriber and MRR data per site.
2026-02-15 17:11:23 -06:00
de075ea8d9
Store billing subscriber/MRR data on integrations for dashboard
Each billing sync (Gaiia, Splynx, VISP, Sonar) already computes
subscriber counts and MRR but only stored them in sync messages.
Now persists them on the integrations table so the dashboard can
aggregate across all billing providers instead of only querying
Gaiia network sites (which were never populated).

Also fixes SnmpKit Config environment detection to use Mix.env()
as fallback when MIX_ENV env var is not set.
2026-02-15 16:51:33 -06:00
FluxCD
b3d9bdae1a chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771194965-074c55c [skip ci] 2026-02-15 22:40:17 +00:00
074c55cd7d Sort Gaiia entity mapping: items with suggestions shown first
Both network sites and inventory items tabs now sort entries
with match suggestions to the top of the list.
2026-02-15 16:35:36 -06:00
FluxCD
f4442c3a43 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771194050-c6baeb9 [skip ci] 2026-02-15 22:23:17 +00:00
c6baeb9f47 Add Splynx client + sync tests, enhance Gaiia client tests
Splynx tests (20 new):
- Client: auth flow (api_key + admin fallback), test_connection,
  list_customers, list_routers, list_customer_services, pagination,
  auth header format verification, error handling
- Sync: full sync, MRR calculation, zero MRR, nil/numeric MRR,
  auth failure, rate limiting
- All response fixtures captured from real demo.splynx.com API

Gaiia tests (4 new):
- Client: unexpected status codes, header verification,
  create_ticket mutation, create_note mutation

Uses Req.Test stubs with realistic response shapes — no network
traffic during test runs. 7374 tests, 0 failures.
2026-02-15 16:20:22 -06:00
FluxCD
6f48171e55 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771190642-e6665ec [skip ci] 2026-02-15 21:28:09 +00:00
e6665ece0f Improve dashboard status bar mobile layout
- Use 2-column grid on mobile, flex-wrap on sm+
- Hide pipe separators on mobile (they break when items wrap)
- Stats now flow cleanly in a grid on small screens
2026-02-15 15:23:33 -06:00
FluxCD
b291c3a93f chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771190344-3cb18a4 [skip ci] 2026-02-15 21:23:08 +00:00
3cb18a47fc Fix Credo nesting in Splynx MRR calculation
Extract parse_mrr/1 helper to reduce nesting depth in calculate_total_mrr.
Credo --strict: 0 issues. Dialyzer: pass (no new warnings).
2026-02-15 15:18:36 -06:00
FluxCD
345d163108 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771189953-ca4840b [skip ci] 2026-02-15 21:17:05 +00:00
FluxCD
c247d9722f chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771189653-635d89d [skip ci] 2026-02-15 21:12:03 +00:00
ca4840b512 Fix Preseem devices table for mobile
- Hide Preseem ID, Status, IP, and Linked Device columns on mobile
- Show Preseem ID and status badge inline under name on small screens
- Add overflow-x-auto to table container
2026-02-15 15:10:08 -06:00
FluxCD
d63adddc5b chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771189365-6be3910 [skip ci] 2026-02-15 21:07:03 +00:00
635d89d774 Fix mobile Gaiia entity mapping + redirect / to /dashboard
- Entity mapping table: hide Gaiia ID and Linked columns on mobile,
  show Gaiia ID inline under name on small screens
- Allow text wrapping in name column for long names
- Add overflow-x-auto to table container for safety
- Redirect authenticated users from / to /dashboard instead of /orgs
2026-02-15 15:05:20 -06:00
6be3910fc4 Fix Splynx integration: token-based auth, per-provider credential fields
- Splynx client: replace broken Basic Auth with proper token flow
  (POST /api/2.0/admin/auth/tokens → Splynx-EA bearer header)
- Support both api_key and admin login auth types with fallback
- Add MRR calculation to Splynx sync using mrr_total field
- Integrations UI: per-provider credential fields (instance_url,
  api_key, api_secret for Splynx; instance_url, api_token for Sonar)
- Wire up test_connection for Splynx, Sonar, and VISP providers
- Verified against live Splynx demo (demo.splynx.com):
  auth, customers, routers, services all working
- All 7350 tests passing
2026-02-15 15:02:17 -06:00
FluxCD
f62e2023c9 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771182038-8fe9067 [skip ci] 2026-02-15 19:04:46 +00:00
8fe90670b6 Redesign integrations page: billing providers as picker
Instead of showing all 4 billing providers as separate full-width cards,
the billing section now shows:

- When no billing connected: a compact 4-column grid picker to select
  your billing platform (Gaiia, Sonar, Splynx, VISP)
- When one is active: a single card showing the connected provider with
  status, sync info, and a note to disable before switching

This reduces visual clutter since users only ever use one billing system.
Non-exclusive categories (QoE, Incidents, Infrastructure) remain as
individual cards since multiple can be active simultaneously.
2026-02-15 13:00:10 -06:00
FluxCD
f307f39631 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771181710-9ecd01d [skip ci] 2026-02-15 18:59:43 +00:00
9ecd01dc8f Security hardening: remaining audit fixes
- Encrypt session cookies (add encryption_salt to endpoint)
- X-Frame-Options: SAMEORIGIN → DENY (match CSP frame-ancestors 'none')
- Remove unsafe-eval from CSP script-src
- Apply security headers in all environments (not just prod)
- Add GraphQL query complexity limit (max 500) via Absinthe.Plug
- GraphQL introspection already blocked in prod via plug

Closes audit items #6, #7, #12, #13, #14, #16
2026-02-15 12:54:38 -06:00
FluxCD
f9df9d5d97 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771180740-fbcf266 [skip ci] 2026-02-15 18:42:42 +00:00
fbcf26656e
fix compile warning 2026-02-15 12:38:27 -06:00
FluxCD
eb26f704a4 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771180511-cbf0fa7 [skip ci] 2026-02-15 18:37:40 +00:00
cbf0fa74ac
add insight worker cron jobs to dev config 2026-02-15 12:34:41 -06:00
FluxCD
1d7eff6afd chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771180131-91dd7ad [skip ci] 2026-02-15 18:32:38 +00:00
FluxCD
a8195038dc chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771179864-74332e2 [skip ci] 2026-02-15 18:28:38 +00:00
91dd7ad985
fix: allow site_id on device create regardless of use_sites setting
The API was silently stripping site_id when use_sites was false, causing
the Terraform provider to report inconsistent state after apply.
2026-02-15 12:28:06 -06:00
74332e2203
fix: Gaiia and Preseem sync bugs from API response mismatches
- Billing subscription and inventory item status fields are scalars, not objects
- IP blocks use "block" key, not "subnet"
- Strip nil variables from GraphQL pagination (Gaiia returns null for after:null)
- Handle nil root keys in paginated responses gracefully
- Handle empty string response from Preseem scores endpoint
2026-02-15 12:23:47 -06:00
FluxCD
c1b7ee7b6f chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771178187-c790794 [skip ci] 2026-02-15 18:00:35 +00:00
c790794191 Fix tests, credo issues, and Gaiia sync bugs
- Fix CLOAK_KEY placeholder in nix shell (invalid base64)
- Fix error HTML test assertion to match actual template
- Fix Gaiia sync: read 'subnet' field instead of 'block' for IP blocks
- Fix Gaiia sync: extract nested status name from subscription objects
- Fix security headers tests for environment detection
- Fix mobile auth tests to use raw_token
- Fix LiveView test assertions to match actual template content
- Fix SNMP config test expectations for test environment
- Refactor: resolve all Credo complexity/nesting issues
  - Extract helper functions in NetBox sync, VISP sync, Sonar sync
  - Flatten nested conditionals in settings, integrations, alerts
  - Use with/validate_present pattern for connection testing
2026-02-15 11:55:49 -06:00
FluxCD
3675952c5e chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771168999-172b830 [skip ci] 2026-02-15 15:27:11 +00:00
172b830b6b ui: add org settings and user settings to mobile nav 2026-02-15 09:22:48 -06:00
FluxCD
258e01af28 chore: update towerops image to git.mcintire.me/graham/towerops-web:main-1771168445-34fe5d7 [skip ci] 2026-02-15 15:18:09 +00:00