59 Commits
Author SHA1 Message Date
MrAlders0n 23fcdadf2e feat(routes): crossings between two groups of areas and repeater reach, as endpoints and MCP tools 2026-12-04 14:19:57 -05:00
MrAlders0n ec1984dda3 feat(routes): relays that carry traffic between two areas, as an endpoint and an MCP tool 2026-12-03 06:23:49 -05:00
MrAlders0n f360fbe8db feat(ingest): read source brokers from a rebroadcaster over MQTT 5
MQTT_BROKER_n_REBROADCAST=true marks a broker that forwards from other
brokers and names each message's source in the source-broker and
source-host user properties. The worker then connects with MQTT 5 and
records packets, observations and observer brokers under the source
name. Without it the connection is 3.1.1 as before.

Each packet keeps the set of brokers it arrived through (brokers on
packet detail). Observer broker lists and the broker filter cover the
last 30 days, and GET /brokers/sources lists the names for the filter.
2026-11-28 20:15:44 -05:00
MrAlders0n 5295b59440 feat(api): add the poller read for a node 2026-11-27 06:49:07 -05:00
MrAlders0n 564e904c3d feat(api): flag pollers on nodes and filter by them 2026-11-24 23:02:03 -05:00
n30nex a4b1eb97f9 fix(cache): recheck the cache inside a shared fetch so a late miss does not read the database again (#298) 2026-11-19 09:32:13 -05:00
n30nex 9fb6126f3e fix(cache): let a cancelled request stop waiting for the analytics revision (#328) 2026-11-19 09:29:58 -05:00
n30nex b882d47c87 fix(cache): keep a blank IATA filter apart from the global latest readings (#336) 2026-11-19 09:29:11 -05:00
MrAlders0n eb913d6cce Add a route for the latest reading of every polled node 2026-11-15 20:15:58 -05:00
MrAlders0n 87009f395a Add node polling endpoint and feature flags to info 2026-11-14 21:56:23 -05:00
MrAlders0n c4024f2d3a Add node telemetry endpoint 2026-11-14 21:50:50 -05:00
MrAlders0n 7ede937a77 feat(api): hourly node activity from a rollup 2026-11-10 09:59:47 -05:00
MrAlders0n a6f7131821 feat(api): filter /routes by several IATAs
GET /routes takes iatas (comma list, at most 100) alongside the single
iata. Each listed IATA's page is read from its region keyset and the
pages are merged, so a region costs at most its IATA count times the
page and pages exactly like one IATA's list. Clients no longer have to
scan every IATA's routes and filter a region themselves.
2026-10-27 15:48:21 -04:00
MrAlders0n 4dee65ff62 feat(api): sort /nodes by name, type or neighbour count
GET /nodes takes sort=name|type|neighbors and order=asc|desc, paged with
pageCursor, so a client can page a sorted node list instead of loading
every node to sort it. Names sort in the web table's order (ICU root with
numeric digit runs, migration 061), unnamed nodes last; ties go newest
first. Pages echo sort and order so clients can tell the server sorted.
2026-10-27 15:47:20 -04:00
MrAlders0n 5fcc4962ba perf(stats): keep the all-regions default Analytics views warm
All-regions stats take seconds on a large deployment and their cache
keys change with every roll and as the windows move, while few visitors
ask for them, so nearly every visit recomputed a week of rollups. A
background task now re-requests the web's default views for all regions
through the stats handler as soon as one's key changes, so visitors hit
the cache. Results are the same; it only computes them earlier.
2026-10-27 15:10:48 -04:00
MrAlders0n 646c69fc96 feat(api): list regions with their member IATAs and detail
Each /regions item now carries what GET /regions/{id} returns, so a
client resolves every region in one call instead of one per region (41
calls per page load on a 40-region deployment). Additive: old clients
ignore the new fields. The list's cache key is renamed so a cached
summary-only list is never served.
2026-10-26 13:59:04 -04:00
MrAlders0n 41baee9197 Packets: one statement per filter shape, exact pageCursor on packets, nodes and observers (2.1.0) (#241)
* feat(db): packet type domains, row-cursor indexes and the inverted-heard index

* feat(api): exact page cursors for packets, nodes and observers

* feat(db): normalise packet list filters before choosing a statement

* feat(db): one packets statement per filter shape with an exact row cursor

* fix(db): let the window statements decide since after until

* feat(db): exact keyset cursors for nodes and observers; observers page by last_seen

* feat(api): pageCursor on packets, nodes and observers; it wins over cursor

* test(planguard): packets statements and node/observer keysets leave pending; diff and storediff cases

* chore: bump version to 2.1.0

* test(db): turn off JIT in the keyset cursor tests
2026-10-19 15:59:55 -04:00
MrAlders0n 632b83c4b9 feat(api): search packets by hash prefix (#227) 2026-10-14 17:04:22 -04:00
MrAlders0n 7297215555 feat(meshmapper): import repeater site details for node detail (#221) 2026-10-11 14:18:26 -04:00
MrAlders0n d788e82ab4 feat(stats): rank top advertisers by flood or direct (#218)
Top advertisers ranked by flood + direct, so chatty companions with few flood adverts topped the list. sort=flood|direct is now required and applied before the limit; client floors raised to app 1.0.0 / web 2.0.4.
2026-10-10 09:38:36 -04:00
MrAlders0n 9bbf8efee5 release: v2.0.4 (#217)
* perf(routes): batch cross-IATA and hash route search (#216)

One search fired a /routes/cross request per IATA pair (138k on 2026-10-08). Route search now takes an optional iatas list and runs a fixed number of index-backed queries. /info advertises built-in minimum client versions.

* chore: bump version to 2.0.4
2026-10-09 22:17:23 -04:00
MrAlders0n 041d9c1f45 release: v2.0.2
Release the changes on `dev` as v2.0.2: authenticated MeshMapper imports and the traffic-sorted observer directory, including rolling seven-day counts from available history. Bump the API version and regenerate Swagger.

MeshMapper integration requires an API key. Regional admins’ existing per-region or grouped-region coverage keys also work for these APIs. Deployments should set `MESHMAPPER_API_KEY` and restart Beacon.

Validation: `go build ./...`, `gofmt -l .` (empty), `go vet ./...`, `go test ./...`, `govulncheck ./...`, and race tests for MeshMapper and scopestore passed in a clean checkout. PostgreSQL integration tests require CI because Docker is unavailable locally.
2026-10-05 18:35:41 -04:00
MrAlders0n 4ad869d711 fix(db): page known routes by (last_seen, id)
The cursor was the last row's last_seen in ms, so routes sharing that
millisecond (common within one upsert batch) never came back. GET /routes
takes an optional cursorId, backed by keyset indexes; cursor alone keeps
working as before.
2026-10-02 19:03:46 -04:00
MrAlders0n 2f4f92e31e fix(db): tie-safe trace paging, atomic migrations and honest stats windows
GET /traces takes an optional cursorTag so tags sharing a millisecond survive
paging. Migrations run under an advisory lock and record each file in the
same implicit transaction, so a crash can't strand a fresh database.
Overview windowHours counts the hours it covers, hourly observer activity
fills unrolled hours from raw rows, and integration fixtures are UTC.
2026-10-02 16:53:32 -04:00
MrAlders0n 5ccb1a2ce3 fix(api): warn on untrusted proxies and tighten config validation
Warn at startup when limits are on without trusted_proxies, and once when a
request carries forwarding headers Beacon ignores. Reject short or whitespace
admin keys and negative durations. Key default-window stats by hour, return
500 for scope lookup failures, and validate IATA path params.
2026-10-02 16:53:32 -04:00
MrAlders0n 2042c1617f feat(stats): roll hourly scope observers and advertising nodes 2026-10-02 15:24:33 -04:00
MrAlders0n 53d9f86dd4 feat(stats): split /stats/scopes packet counts by hour 2026-10-02 13:57:54 -04:00
MrAlders0n 98006a9364 feat(stats): serve historical stats from hourly rollups
Stats endpoints read hourly rollup tables filled once per closed hour by one
advisory-locked task, instead of materialized views that re-scanned every
observation on each refresh. IATA-set tables give exact distinct counts for any
IATA set or region. Cleanup holds raw rows for unrolled hours (up to 24h).

Adds /stats/series; ingest keeps packet observation counts, observer last IATA,
channel message counts and trace tag summaries. 001_baseline.sql is rewritten,
so pre-release 2.0 databases must be recreated. See docs/historical-stats.md.
2026-10-02 07:43:56 -04:00
MrAlders0n 119be44c0d feat(channels): filter channel list by keyKnown
Also seed the cursor integration test with MeshMapper membership; it still
used channel_iatas after channel lists moved to region scoping.
2026-10-01 09:06:50 -04:00
MrAlders0n 7392fdd2d6 fix(meshmapper): create group member IATAs and import zone names and centers 2026-09-30 23:21:44 -04:00
MrAlders0n a970484b00 feat(meshmapper): import zone groups as regions 2026-09-30 22:56:10 -04:00
MrAlders0n 2f49ffb3a3 feat(api): filter scope lists by region and catalogue membership
Region-filtered /scopes and /stats/scopes now list manual scopes configured
for the region and imported scopes whose MeshMapper catalogue includes the
IATA, instead of inferring membership from observed traffic. Filtered
/scopes returns string[] like the unfiltered call.

Manual scopes now require a region in config.
2026-09-30 22:05:04 -04:00
MrAlders0n 0e242574fb feat(meshmapper): import region boundaries from the Zones API
Imported boundaries override borderFile on the border map and for foreign marking, falling back to the manual border when MeshMapper has none.
2026-09-30 12:38:36 -04:00
MrAlders0n 9ce4e8d10c fix(cache): invalidate derived scope keys on catalogue import 2026-09-30 10:31:08 -04:00
n30nex c18e059e0d feat(scopes): import cached regional MeshMapper catalogues 2026-09-30 07:19:03 -04:00
n30nex 85c9123e9a fix: address maintainer review for #172 2026-09-30 07:19:03 -04:00
n30nex c448a04ea0 feat(routes): add bounded retained observation evidence 2026-09-30 07:19:03 -04:00
n30nex d3c330e8fb fix: address maintainer review for #169 2026-09-30 07:19:02 -04:00
n30nex 5fbba24a4a fix(observers): separate packet metrics from presence updates 2026-09-30 07:19:02 -04:00
n30nex 8a3fa7e6bf feat(stats): add bounded path and hash-width analytics (#159) 2026-09-23 20:18:41 -04:00
n30nex 6107578c25 feat(stats): add bounded reception signal analytics (#157) 2026-09-23 20:16:22 -04:00
n30nex cf5ff7a974 feat(stats): compare flood packets reported by two observers (#152)
* feat(stats): compare distinct flood packets across observers

* test(stats): use the migrated observation deduplication key
2026-09-19 10:36:39 -04:00
n30nex 0067e51357 feat(cache): add payload-free debug cache diagnostics (#145) 2026-09-18 06:18:42 -04:00
n30nex bcdea76c26 feat(stats): filter scope counts by IATA and region (#142)
* feat(stats): filter scope counts by IATA and region

* perf(stats): aggregate region observations before counting scopes
2026-09-18 06:18:06 -04:00
MrAlders0n b66573b3b7 feat(observers): per-observer activity endpoint (#135) 2026-09-10 06:53:00 -04:00
n30nex f390086058 fix(channels): preserve timestamp ties in page cursors (#132) 2026-09-09 20:25:07 -04:00
Enot (ded) Skelly 336b734a42 feat: add stats api for new clock drift tracking
closes: #91
2026-07-24 14:01:12 -07:00
Enot (ded) Skelly 572f14b94b fix: formatting in cache test file 2026-07-24 13:18:14 -07:00
Enot (ded) Skelly 3f2506fc8b feat: add geojson for iatas
closes #66
2026-07-24 12:59:48 -07:00
MrAlders0n dff9c6cf00 perf(channels): track channel activity per IATA in its own table
The IATA filter ran a correlated EXISTS over packets/observations with
ILIKE, which skipped the iata index and took ~7s live. Keep a small
channel_iatas table at ingest (like node_iatas) and filter against it.
Also honor the iatas= param so multi-site regions stop getting the
global list. Filter now ages out with packet retention rather than
matching any retained packet.
2026-07-24 12:07:05 -07:00