20 Commits
Author SHA1 Message Date
rzuastiandClaude Opus 4.8 be2a8fce58 Make [notifications.pushover] optional for non-pushover methods
The pushover config section is now only required when notifications.method
is "pushover". Validation at startup rejects the missing-section case so a
misconfiguration fails fast instead of erroring on every notification.

Updates the sample TOML, README and nix module for consistency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 17:45:02 -04:00
rzuastiandClaude Opus 4.8 0393378d24 Default log.level to "warn"
Make the [log] section and its level field optional, falling back to
"warn" when omitted. Update the sample TOML, Nix module and README to
reflect the new default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 18:05:59 -04:00
rzuastiandClaude Opus 4.8 dd089a9cbc Deduplicate device_events within a time window
When the same scanner sees the same device (same MAC and IPv4) again within
a configurable window (default 1 minute), only one device_events row is
recorded, keeping the events table from filling with near-identical rows.
Device last_seen updates and notifications are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 16:11:27 -04:00
rzuastiandClaude Opus 4.8 b283699b3c Set SNMP scanner default timings to 10m/5s
A typical router keeps active devices' ARP entries fresh continuously,
so a 10-minute poll interval stays well within common ARP cache TTLs
while keeping device-event churn modest (each poll records a DeviceSeen
event per device). A 5s per-request timeout adds margin for a busy
agent or large ARP table at no cost on the happy path.

Updates the default in settings.rs and the sample TOML, README and
NixOS module. TODO timing-review item narrowed to the ARP scanner.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 08:23:20 -04:00
rzuastiandClaude Opus 4.8 2987f66363 Add SNMP scanner that polls a gateway's ARP table
Introduce a sixth scanner that periodically queries an SNMP agent
(typically the router/firewall) for its ARP/neighbour cache via
SNMPv2c and feeds discovered devices into the shared devices, events
and notifications pipeline. Unlike the ARP scanner it generates no
traffic on the local segment and can surface devices across all
subnets the agent routes.

Scope is intentionally minimal: SNMPv2c only, a single target, and the
ipNetToMediaTable (ARP) only. SNMPv3 and switch MAC/forwarding-table
polling are left as follow-ups in TODO.md.

- backend: csnmp dependency; SnmpScanner config (opt-in, off unless a
  [snmp_scanner] section is present); DeviceEventScanner::Snmp;
  scanners/snmp/{finder,scanner,status}; main.rs wiring; status API
  endpoint wired into OpenAPI
- frontend: SNMP scanner status model, card, API method, status screen
  and summary card rows, and device-event label
- docs/config: sample TOML, README options, NixOS module option, and
  setup notes for enabling SNMP on pfSense/OPNsense

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 08:03:20 -04:00
rzuastiandClaude Opus 4.8 20c51faaea Build front-end via Nix and harden Docker/Nix image generation
- Build the Flutter web app at release time (nix/frontend.nix) and bundle
  it next to the binary at $out/share/oott/web; resolve it at runtime
  relative to the executable. Remove the prebuilt backend/web from git.
- Add web_server.{ip_address,port,api_key} options to the NixOS module so
  the generated config deserializes (was missing, causing a startup panic).
- Docker image: set SSL_CERT_FILE for outbound TLS, drop the heavy
  nixos/nix base image, trim contents to [oott cacert], and ensure /tmp
  exists.
- Remove the unused "nix" flake input and commit flake.lock.
- Provide Swagger UI to utoipa-swagger-ui offline via a pinned fetchurl so
  the package builds in the Nix sandbox; skip the redundant check phase
  (tests run via backend/run_tests.sh).
- sample_oott.toml: set database.path to /db/oott.db for the Docker image.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 21:43:08 -04:00
rzuastiandClaude Opus 4.8 08ee4fc0ea Add per-scanner enable/disable configuration
Each scanner (ARP, mDNS, SSDP/UPnP, DHCP) can now be turned off via an
`enabled` flag in its config section, defaulting to true so existing
deployments are unchanged. A disabled scanner's entry function returns
early and never starts.

Documented in the README options table (also fixing the stale `timings.*`
key names to the actual `arp_scanner.*` keys), and added to the TOML
samples and the NixOS module.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 19:00:56 -04:00
rzuastiandClaude Opus 4.8 3f60eec311 Add SSDP scanner config to sample TOML and Nix module
Expose the ssdp_scanner.probe_timeout option (default 2s, mirroring the
mDNS scanner) in the sample config and the NixOS service module.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 17:58:13 -04:00
rzuastiandClaude Opus 4.7 ca83009944 Add passive mDNS/Bonjour discovery scanner
Introduce a second discovery module that passively listens for mDNS
multicast announcements (224.0.0.251:5353) and feeds discovered devices
into the existing devices/events/notifications pipeline, running in its
own task alongside the ARP scanner.

Since mDNS carries an IP and hostname but no MAC (the device key), the
module resolves IP->MAC via the OS ARP cache with a targeted ARP-probe
fallback. The advertised hostname is stored in a new optional `name`
column on devices (blank for ARP-only devices); the single `update`
writes `name` only when set so ARP rescans never clobber it. Device
names are included in event/notification messages.

Adds a GET /api/mdns_scanner/status endpoint (is_listening, devices_seen,
last_device_seen_seconds_ago) wired into OpenAPI, an optional
[mdns_scanner] config section, and the corresponding Nix module option.
Also aligns the Nix module's stale `timings` section with the current
`arp_scanner` schema.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 09:37:33 -04:00
rzuastiandClaude Sonnet 4.6 08f2dc8340 Auto-detect network interface when not configured
If no interface is set in the config, the ARP scanner now picks the
first non-loopback, up, IPv4-enabled interface automatically. The
setting is optional in the TOML config, sample config, and Nix module.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 07:35:25 -04:00
rzuastiandClaude Sonnet 4.6 22d30a146c Document retention.window parameter and add storage sizing guidance
Adds the retention.window option to the NixOS module and documents it
in the README alongside a new Storage considerations section covering
per-network-size estimates and guidance on tuning scan timings and the
retention window to meet storage requirements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 09:18:46 -04:00
rzuasti b1184d16ee Added all configuration parameters to nix flake 2026-01-27 13:13:02 -05:00
rzuasti f7513c329e Update oott-service.nix 2026-01-27 08:38:40 -05:00
rzuasti d64d8eb898 Update oott-service.nix 2026-01-26 11:39:27 -05:00
rzuasti 335807e0f3 Changed config file generation in the nix flake to YAML 2026-01-26 11:02:39 -05:00
rzuasti 3b776462b0 trying generation of config file (oott.toml) 2026-01-26 10:41:00 -05:00
rzuasti 04b6e1553a Update oott-service.nix 2026-01-25 11:42:39 -05:00
rzuasti 4abd754695 trying 2026-01-25 11:35:31 -05:00
rzuasti ab11cdaadb Fixed module name 2026-01-25 11:30:51 -05:00
rzuasti a4e4ee6a50 grouped nix config in a folder 2026-01-25 11:01:11 -05:00