Commit graph

620 commits

Author SHA1 Message Date
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
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
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
fbcf26656e
fix compile warning 2026-02-15 12:38:27 -06: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
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
172b830b6b ui: add org settings and user settings to mobile nav 2026-02-15 09:22:48 -06:00
34fe5d7e49 Security fixes: mask credentials in logs/API, fix cookie/CSP/LIKE injection/webhooks
CRITICAL fixes:
- Mask SNMP community string in agent channel logs (CRITICAL-1)
- Remove snmpv3 passwords from REST API responses, return _set booleans (CRITICAL-2)
- Replace snmp_community with snmp_community_set in GraphQL type (CRITICAL-3)

HIGH fixes:
- Fix cookie same_site from invalid 'Towerops' to 'Lax' (HIGH-4)
- Remove unsafe-eval from CSP script-src (HIGH-6)
- Block GraphQL introspection queries in production (HIGH-7)
- Sanitize LIKE wildcards in SNMP device name search (HIGH-8)
- Reject webhooks when no secret configured instead of accepting (HIGH-9)

MEDIUM fixes:
- Hash mobile session tokens (SHA-256) before DB storage (MEDIUM-10)
- Apply security headers in all environments, not just prod (MEDIUM-14)
- Add GraphQL query complexity limit (500) in production (MEDIUM-16)
- Fix X-Frame-Options to DENY to match frame-ancestors 'none' (MEDIUM-13)
2026-02-15 09:09:04 -06:00
555a09d34b ui: remove flash message on password generation 2026-02-15 08:48:36 -06:00
d857a38ca3 feat: group integrations by category with exclusive billing provider selection
Billing (Gaiia, Sonar, Splynx, VISP) - choose one
QoE Monitoring (Preseem)
Incident Management (PagerDuty)
Infrastructure & IPAM (NetBox)

Prevents enabling multiple billing providers simultaneously.
2026-02-15 08:27:27 -06:00
c3e04c833f marketing: update integration list with all new providers 2026-02-14 21:12:38 -06:00
e5796b3464 ui: polish device detail, site detail, and user settings 2026-02-14 21:11:33 -06:00
5041ac8e25 ui: polish auth pages, core components, and visual consistency 2026-02-14 21:11:33 -06:00
66bf61887f feat: add Sonar, Splynx, and VISP billing integrations 2026-02-14 20:18:57 -06:00
02474c529f ui: major redesign - NOC dashboard, consolidated nav, dense tables, flat alerts 2026-02-14 20:15:07 -06:00
968c5008ec api: expand format_site to return all fields including lat/lng 2026-02-14 17:46:28 -06:00
8752dfec49 fix: netbox url field type, gaiia ipRange→block, remove unknown webhook log 2026-02-14 17:44:01 -06:00
a3730db579 i18n: add Spanish locale with full translations, language selector, and locale hook 2026-02-14 17:44:01 -06:00
243b773e39 i18n: wrap all user-facing strings in gettext() 2026-02-14 17:44:01 -06:00
e954c7930a Fix Gaiia webhook timestamp: Gaiia sends millis, not seconds
The timestamp check was comparing millisecond timestamps against
System.system_time(:second), causing every webhook to be rejected
as 'expired'. Now normalizes timestamps >10 digits to seconds.
2026-02-14 17:15:25 -06:00
f59db9565c Gaiia webhook: clean rewrite per exact docs, detailed logging on failure 2026-02-14 16:57:55 -06:00
2c55ab5b77 Gaiia webhook: accept even when signature fails, log details for debugging 2026-02-14 16:52:25 -06:00
8f04a3f684 Fix credo: extract PagerDuty HMAC verification to reduce nesting 2026-02-14 16:31:54 -06:00
2709ab4674 Fix integration API key field: read from saved credentials like NetBox 2026-02-14 16:31:05 -06:00
b8a625005c Fix NetBox config: show saved URL/API token when opening Configure 2026-02-14 16:29:32 -06:00
be5fa8f4d7 Gaiia webhook: proper HMAC verification per docs, optional when no header 2026-02-14 16:28:35 -06:00
ba895b0ca2 Remove Gaiia webhook secret verification entirely — Gaiia has no signing mechanism 2026-02-14 16:25:56 -06:00
712174cc47 Fix NetBox test connection: read URL/token from form, not just saved state 2026-02-14 16:15:59 -06:00
d640fab660 Fix invite form alignment on members tab 2026-02-14 16:12:15 -06:00
b49d177b97 Fix trace page Access on Device struct, limit dashboard insights to 4 2026-02-14 16:10:52 -06:00
bcc93cc1b5 Limit dashboard insights to 4, unlock dokku 2026-02-14 16:10:52 -06:00
95d833874a Gaiia webhook: verify secret via query param instead of signature header 2026-02-14 16:08:27 -06:00
82dd75d2e9 Fix Gaiia webhook (no signature), sites page with table + insights 2026-02-14 16:07:26 -06:00
3049411337 Dashboard: timezone-aware timestamps, site health as table, remove dead code 2026-02-14 16:07:26 -06:00
2cbf6db8de Dashboard redesign: tighter layout, table alerts, less wasted space 2026-02-14 16:07:26 -06:00
05cdc79124 Fix Gaiia webhook: eventName field, payload extraction, add header logging 2026-02-14 15:40:06 -06:00
a91e5f9be5 Dashboard makeover: more breathing room, cleaner layout
- Stat cards: 4-column grid with larger text (text-4xl) and rounded-xl
- Split stats into primary (health/uptime/devices/alerts) and secondary rows
- Main content: 2/3 + 1/3 split instead of cramped 3/5 + 2/5
- Increased gaps throughout (gap-5, gap-10, mt-10 between sections)
- Cards use rounded-xl, p-5 for more padding
- Config changes + activity in proper list layout with dividers
- Quick actions moved to bottom with separator
- Filter pills use rounded-full with stronger active state
- Removed 'Command Center' header, cleaner org name + subtitle
- Better empty states with more whitespace
2026-02-14 15:01:49 -06:00
7b72ed3164 PagerDuty two-way sync: webhook receiver for resolve/acknowledge
- POST /api/v1/webhooks/pagerduty/:organization_id endpoint
- HMAC-SHA256 signature verification (optional, via webhook_secret)
- incident.resolved → resolve_alert_silent (no re-notify to PagerDuty)
- incident.acknowledged → acknowledge_alert_silent (no re-notify)
- Matches alerts via dedup_key format: towerops-alert-<uuid>
- Webhook secret configurable in org settings PagerDuty panel
- Setup instructions in UI for PagerDuty Generic Webhooks (v3)
2026-02-14 14:58:58 -06:00
06f9b7e60b Fix format_response_time crash on non-numeric input 2026-02-14 14:53:17 -06:00
61f803afe5 Add language user setting (default: English) 2026-02-14 14:53:17 -06:00
d1cd608ae9 feat: actionable insights with fix-it buttons, proper pluralization via gettext
- Gaiia 'not tracked' insight: Map to Gaiia inventory + View reconciliation buttons
- Gaiia 'ghost' insight: Clean up stale mappings button
- Gaiia 'mismatch' insight: Review mismatches button
- Fixed device(s) → proper ngettext pluralization
- Fixed Towerops → TowerOps capitalization
2026-02-14 14:46:19 -06:00
44e9d20d35 fix: NetBox sync direction cards now clickable via phx-click instead of hidden radio buttons 2026-02-14 14:41:30 -06:00
47f9ee703f fix: NetBox sync direction/checkboxes now reactive - track config in socket assigns instead of reading from saved credentials 2026-02-14 14:30:46 -06:00
3190f07ee5 ui: major integrations tab polish - accent bars, brand colors, better status display, cleaner configure panels 2026-02-14 14:25:53 -06:00
db40a3e5b7 feat: show human-readable sync status messages for integrations
- Added last_sync_message field to integrations schema
- Gaiia sync: shows item counts on success, friendly error on failure
- Preseem sync: shows AP/device counts on success, friendly error on failure
- Error messages translated from technical errors to user-friendly text
- Message displayed on integration card next to status badge
- Exposed in REST API response
2026-02-14 14:11:02 -06:00
5917190efe feat: add NetBox integration with sync direction, entity selection, and filtering
- Three sync modes: NetBox→TowerOps (pull), TowerOps→NetBox (push), Bidirectional
- Configurable entity sync: devices, sites, IP addresses, interfaces
- Optional filters by device role, site, and tag (comma-separated)
- NetBox client with test connection, CRUD operations
- Radio card UI for sync direction, checkbox cards for entity selection
- Credentials stored encrypted (URL, API token, sync config)
2026-02-14 14:09:01 -06:00
0f7e91af0c ui: remove Agents from top-level nav, accessible via org settings tab 2026-02-14 14:03:49 -06:00
a028695d3b
format 2026-02-14 13:57:25 -06:00
35fc993db0 ui: remove border above nav tabs on org and user settings 2026-02-14 13:57:03 -06:00
ea7d82a489 fix: make Configure button toggle - clicking again collapses the form 2026-02-14 13:48:22 -06:00