Commit graph

32 commits

Author SHA1 Message Date
Graham McInitre
24eaccd7a8 chore: track .envrc, gitignore .envrc.local for secrets
.envrc contains shared direnv/Nix setup (no secrets). Local overrides
and secrets belong in .envrc.local, which is now gitignored.
2026-07-22 08:37:17 -05:00
Graham McInitre
ee853db0b5 ignore local env 2026-07-16 09:20:03 -05:00
Graham McInitre
e6fba0c5a3 fix: register NIF compiler, add Nix shell NIF build, make NIF optional at boot
- Register :towerops_nif compiler in mix.exs so mix compile/test builds the C NIF
- Add 'make -C c_src' to nix devShell shellHook so NIF is pre-built
- Extract init_mib_resolution/0 from Application.start/2 (reduces CC)
- Wrap NIF calls in try/rescue ErlangError for graceful fallback
- Wrap test_helper.exs NIF calls in try/rescue ErlangError
- Add .nix-postgres-version to .gitignore
2026-07-16 09:15:53 -05:00
8f9dc201af feat(monitoring): alert when backhaul radios lose connected clients
Backhaul radios (ePMP, AirOS, PMP, Cambium, MikroTik, RouterOS) now
monitor their connected client count with a low threshold of 1. When
the count drops to 0 the SnmpSensorExecutor marks it CRITICAL, which
triggers an alert through the existing check → alert pipeline.

- Adds  field to sensor_def type in Vendor behaviour
- Sets  on all clients-type wireless sensors in
  backhaul-capable vendor profiles
- Adds default executor handling: any clients sensor at 0 → status 2
- 3 new tests for clients sensor behavior
2026-06-02 12:27:44 -05:00
32c9575952 chore(k8s): unify secrets template into one k8s/secrets.example.yaml
Replace the single-secret towerops-llm template with one
multi-document YAML covering every Secret the Deployment references:
towerops-secrets, towerops-db, towerops-aws, towerops-redis,
towerops-billing, towerops-llm.

Workflow: copy k8s/secrets.example.yaml to k8s/secrets.yaml (which is
gitignored), fill in real values, kubectl apply. Real values never land
in git.
2026-05-09 18:01:09 -05:00
91f23416e4 feat(insights): SectorOverload + CpeRealign recommendation rules
Two new multi-source rules using data we already collect, both wired
into the existing hourly RecommendationsRunWorker.

SectorOverload — fires when a Preseem-monitored AP has <25% free
airtime AND active subscribers. Critical urgency when free airtime
drops below 15%, OR when free airtime <25% AND QoE <50. Reuses the
airtime/subscriber/QoE data already pulled by PreseemSyncWorker so
no new collection is needed. UI: orange evidence card with free
airtime, subscriber count, QoE score, and AP model.

CpeRealign — fires when a wireless client has BOTH signal_strength
<=-78 dBm AND SNR <=18 dB seen in the last 2 hours. This is the
classic alignment / obstruction signature, distinct from the
existing single-metric wireless_signal_weak / wireless_snr_low
alerts produced by WirelessInsightWorker. One insight per (AP, CPE)
pair via a metadata.dedup_key. Critical when signal <=-88 OR SNR
<=10. UI: rose evidence card with signal, SNR, TX/RX rate, distance,
hostname.

Insights.insert_insight_if_new/1 dedup logic now prefers a
metadata.dedup_key over device_id when explicitly set, allowing
per-CPE insights without collapsing multiple CPEs on the same AP
into a single insight. Existing rules without dedup_key are
unaffected.

Insight.@valid_types extended with sector_overload and cpe_realign.

LLM enrichment automatically applies to both new types via the
existing Phase 1 worker — no extra wiring.

Also adds k8s/secrets.yaml to .gitignore so operators can drop a
local Secret manifest with real values, kubectl apply manually, and
never accidentally commit it. Documented in k8s/README.md.
2026-05-09 17:07:15 -05:00
44a80cd5eb remove-gleam (#218)
Reviewed-on: graham/towerops-web#218
2026-03-29 11:03:20 -05:00
6859525a1b Integrate Gleam into the build pipeline and rewrite three pure-function modules (#98)
Set up mix_gleam archive, gleam_stdlib, and gleeunit deps. Add Gleam
compiler to all Dockerfiles, CI workflows, nix shell, and .tool-versions.

Rewrite Numeric, QueryHelpers, and URLValidator from Elixir to Gleam with
full ExUnit test coverage. Update all callers to use the Gleam modules
directly via :towerops@module syntax. Remove duplicate sanitize_like/1
private functions in snmp.ex and trace.ex.

Reviewed-on: graham/towerops-web#98
2026-03-21 07:30:36 -05:00
0fa1fa800b fix/suppress-health-check-logs (#47)
Reviewed-on: graham/towerops-web#47
2026-03-16 15:22:12 -05:00
e026930f25
logging fix and some other codex fixes 2026-03-10 15:04:28 -05:00
998bdf39b8
update 2026-02-18 10:19:56 -06:00
af9537939b
fix: complete Nix Docker image build and untrack .claude/settings.local.json
Nix build fixes:
- Override beamPackages.elixir to use 1.19.5 instead of default 1.18.4
- Add explicit buildPhase to compile dependencies before application
- Remove postInstall phase (Mix automatically includes priv/ in release)
- Set HEX_OFFLINE=false to allow dependency fetching in Nix sandbox

Docker image build now succeeds (~507 MB compressed).

Also remove .claude/settings.local.json from git tracking (keep local).
File remains in working directory but is now properly ignored.
2026-02-07 14:14:26 -06:00
8fa79caccc
chore: Add Nix development state to gitignore
Ignore local Nix development directories and files:
- .nix-mix/ - Mix cache
- .nix-hex/ - Hex cache
- .nix-postgres/ - PostgreSQL data directory
- .nix-redis/ - Redis data directory
- .nix-services-started - Service flag file

These are created by the Nix dev shell and should not be
committed to the repository.
2026-02-07 12:40:18 -06:00
5e98431aaa
update gitignore 2026-02-07 12:21:39 -06:00
906afe48fa
chore: ignore .worktrees directory for development worktrees 2026-02-06 19:00:06 -06:00
ded236771b
add skills 2026-02-06 18:43:18 -06:00
38eeb1c7b8
fix: improve agent polling and SNMP testing
Changes:
- Fix traffic graph to handle nil interface octets gracefully
- Add comprehensive tests for nil octets scenarios
- Fix agent polling query to support devices assigned directly to org (left join on sites)
- Fix test SNMP connection to inherit credentials from site/org
- Refactor agent_channel process_polling_result to reduce nesting (Credo)
- Add alias for JobCleanupTask in application.ex (Credo)

This fixes crashes when interface stats have nil octets and ensures
devices without a site assignment can be polled by agents.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 12:34:28 -06:00
dff9c26905
fix TOTP enrollment with recovery codes 2026-01-31 14:54:44 -06:00
95d8633ce5 discovery worker timeout 2026-01-30 13:49:04 -06:00
b663d484cf nif ci fix complie in ci 2026-01-30 12:47:18 -06:00
d1fd1d4a62 remove Mix.env and support ip database import 2026-01-28 13:08:06 -06:00
c3e26a44d6
add state sensor schema, migration, and discovery 2026-01-21 10:25:01 -06:00
b4f8b40b7f
Include MIB files in Docker image instead of using PVC
- Remove PVC volume mount from k8s/deployment.yaml
- Delete k8s/mib-pvc.yaml (no longer needed)
- Update .gitignore to commit MIB files to git
- Add mix import_mibs task to copy MIBs from LibreNMS
- Add all MIB files from priv/mibs/ to git

This fixes the multi-attach volume error in Kubernetes where new pods
couldn't start because the RWO (ReadWriteOnce) PVC was attached to the
old pod. MIBs are now part of the Docker image and can be used by all
pods simultaneously.
2026-01-19 14:01:03 -06:00
49bc320a89
better mib handling 2026-01-19 09:01:56 -06:00
50d8b27447
handle mib uploading 2026-01-18 16:29:24 -06:00
3e797ae715
chore: add Elixir tooling directories to gitignore 2026-01-18 13:01:35 -06:00
9b613f7a40
feat: update UI to Tailwind Plus design system and fix auth redirects
- Update user settings page to use Tailwind Plus 3-column grid layout
- Add API token management section to user settings
- Implement organization name display in navigation menu
- Update table component to use Tailwind Plus styling across all tables
- Update flash notifications with Tailwind Plus design
- Update dropdown menus and select inputs with custom chevron styling
- Fix authentication redirect to return to original page after login
- Preserve user_return_to session key across session renewal
- Add store_return_to_for_liveview plug to browser pipeline
- Add profiles.json to gitignore
2026-01-18 09:56:49 -06:00
5398ff65bc
chore: add TODOS.md to gitignore
Remove TODOS.md from version control as it contains personal task tracking notes
2026-01-17 16:12:35 -06:00
d4f963750b
update gitignore 2026-01-09 13:17:43 -06:00
80cc5e937e
add sendgrid 2026-01-03 15:26:48 -06:00
287fd8064a
Add Dialyzer for static type analysis
- Added dialyxir dependency for static analysis
- Configured PLT file location and analysis flags
- Added priv/plts/ to .gitignore
- Enabled unmatched_returns, error_handling, and unknown type checks
2026-01-03 12:39:02 -06:00
ba463dc5a2
init 2025-12-21 11:10:43 -06:00