56 Commits
Author SHA1 Message Date
MrAlders0n a2b81b8c09 fix(polling): accept claims and readings signed in the v2 formats
Poll firmware from 2026-12-03 signs corescope-reading/v2 and corescope-claim/v2, which add poll_key, access and key, and sends requested as false for an own target. Those were all dropped. v1 still verifies, for a message with none of the new fields. reply_hops may now be left out.
2026-12-03 20:37:56 -05:00
MrAlders0n a62c652e05 feat(polling): store what a signed reading says of requested
The poller view returns it as latestReadingRequested, null when the reading does not say.
2026-12-02 14:07:38 -05:00
MrAlders0n 41ede6cc73 fix(polling): accept readings signed with the requested part 2026-12-02 11:56:33 -05:00
MrAlders0n a7c36e8e76 feat(polling): decode sensor channels from LPP and serve them with node telemetry
Humidity, pressure, gas and power monitor channels are decoded when a reading is stored. Positions and altitude are never decoded. Fixes the humidity size, which is one byte on the wire.
2026-11-29 21:09:23 -05:00
MrAlders0n 623fda1562 fix(polling): signed messages take lowercase keys only 2026-11-28 23:17:45 -05:00
MrAlders0n 0c71c2cba0 fix(polling): a signed message cannot repeat a key in another case 2026-11-28 23:16:13 -05:00
MrAlders0n 6bc7877a05 feat(polling): check signed readings and store the reply rssi
A reading that carries a signature is dropped when it does not verify. Unsigned readings are handled as before. Signed claims and readings with a repeated key are refused.
2026-11-28 23:13:28 -05:00
MrAlders0n 260421ea88 fix(polling): a signed claim's state must be a plain word
The signature covers each target as id:state:misses:requested, joined
with commas. A state that could hold those separators let a relay fold
a second target into the first one's state without breaking it.
2026-11-28 21:05:18 -05:00
MrAlders0n f9a204e35e fix(polling): close the gaps review found in foreign claims
Whether a claim may replace what an observer has stored, own or
foreign, is now decided in one place under the observer's seat lock: an
older claim never undoes a newer one, the claim spacing holds across
both kinds, and an unsigned claim is refused while a signed one is
live. An observer that turns foreign loses every assignment in the same
transaction, requested ones its claim does not name included.

A server that starts checking drops the claims that were not placed
under its current host and broker list. A foreign reading never counts
as a repeater's newest; one from an observer this server assigned the
target stays its own; with authority approved it needs approval to be
trusted. A null sig or poll_url is refused. A packet's broker set only
grows. The foreign reading lookups get a partial index (093), the
MQTT 5 connected flag follows the current connection only, and queued
messages are charged for their source.
2026-11-28 20:49:32 -05:00
MrAlders0n ff8637b4ab feat(polling): tell this server's observers from foreign ones
polling.foreign_claims: check takes a claim as this server's own only
when its signed poll_url names DOMAIN, or, for firmware that sends
none, when a rebroadcaster says it arrived on one of polling.mqtt_hosts.
Any other claim is foreign, and one that can be placed neither way is
dropped. The default, off, treats every claim as its own, as before.

A foreign observer is kept out of polling_claims, so it is never a
poller or standby, gets no owners answer and takes no request. Its
readings are stored, marked foreign and trusted on the same advert
evidence. A reading with no claim behind it is kept as foreign too.

Claims that carry a signature are verified with the observer's key in
every mode; a wrong one is dropped. Asking for telemetry on a repeater
a foreign observer already checks needs acknowledgeForeign.
2026-11-28 20:32:20 -05:00
MrAlders0n 2ae10ca1a5 revert: foreign polling claims, until the design is settled 2026-11-28 16:54:58 -05:00
MrAlders0n 306128a4bd feat(polling): rank observers that follow another server behind our own
A claim can reach a server its observer does not ask for policy. Tell
them apart by the claim's poll_url, or by whether the observer asked
this server lately, and keep such observers out of requests.
2026-11-28 16:26:43 -05:00
MrAlders0n 54ea8bdfdf feat(polling): store a claim's max_slots and poll_interval
The slot limit now follows the claim instead of a fixed 8 (default 8, ceiling 32), in the poller view and in the seat math. The poller view also reports pollIntervalMinutes.
2026-11-28 11:08:50 -05:00
MrAlders0n 24da3c187d fix(api): count a poller's free seats honestly and read it in one statement
slots.free is 0 when the claim is expired or takes no requests, and no longer
counts seats already handed to the observer that its claim does not name yet.

The claim and its targets were three statements, so a claim replaced between
them gave one claim's slots with the other's targets. They are one statement
now, as the Atlas read is.
2026-11-27 20:05:21 -05:00
MrAlders0n 47e6783ce7 feat(polling): trust self-configured readings without adverts, evidence_window setting
Readings of a repeater an observer polls on its own were hidden unless it heard a zero-hop advert in the last 24h. They are now trusted while no assignee of that repeater has advert evidence. The window is polling.evidence_window, default 7d.
2026-11-27 08:02:29 -05:00
MrAlders0n 098a86f59d fix: only count observers with recent status 2026-11-22 22:12:16 -05:00
MrAlders0n 50850f5314 feat: refuse telemetry requests on observers 2026-11-22 21:48:23 -05:00
MrAlders0n ca236b528c fix(polling): keep a reading that rounds to the largest stored float 2026-11-19 09:49:03 -05:00
n30nex f36cc85834 fix(polling): drop readings that do not fit the stored float (#322) 2026-11-19 09:29:35 -05:00
n30nex a3a175e345 fix(polling): clear an optional integer when a repeated field is null or out of range (#313) 2026-11-19 09:29:33 -05:00
MrAlders0n 87ea88337a Keep the request observer gate closed unless set to all 2026-11-15 21:06:34 -05:00
MrAlders0n 283d639f3e Let any observer with evidence take telemetry requests by default 2026-11-15 21:06:34 -05:00
MrAlders0n cf9b690e03 Report the poller's own state on a telemetry request 2026-11-15 17:21:44 -05:00
MrAlders0n a1528a51d8 Keep readings as long as the working-poll check needs them 2026-11-15 11:54:02 -05:00
MrAlders0n a39c947668 Trust a working poll over a stale login failure 2026-11-15 11:07:10 -05:00
MrAlders0n 941eae24f1 Build the owners answer from one snapshot 2026-11-15 10:58:58 -05:00
MrAlders0n 3c12bdc87e Say what an owners answer promises 2026-11-15 10:15:20 -05:00
MrAlders0n 7cf737ae49 Do not offer a seat to a target nobody requests any more 2026-11-15 10:07:57 -05:00
MrAlders0n 4562d45ff9 Keep failed and admin-stopped requests through the offline sweep 2026-11-15 09:45:31 -05:00
MrAlders0n 580f0d1065 Offer a replacement in the seat a withdrawn target frees 2026-11-15 09:39:45 -05:00
MrAlders0n 4c84c37903 Fail the owners answer when approval cannot be read 2026-11-15 09:33:01 -05:00
MrAlders0n 9a61f689a0 Renumber and update requests when cleanup drops assignments 2026-11-15 09:27:13 -05:00
MrAlders0n 2048a0e3f9 Store a claim and its reports in one transaction 2026-11-15 09:15:01 -05:00
MrAlders0n 8d7c84406f Answer 503 when the owners answer cannot be recorded 2026-11-15 07:58:51 -05:00
MrAlders0n f67f7ed456 Tie an admin stop to the password it was given 2026-11-15 02:59:15 -05:00
MrAlders0n 94d7cf410a Reserve observer seats for requests in order 2026-11-15 02:54:23 -05:00
MrAlders0n ab6c4e6686 Give telemetry request reasons a stable code 2026-11-15 01:34:40 -05:00
MrAlders0n 77cde9f66d Tighten who can take and stop a telemetry request 2026-11-15 01:04:42 -05:00
MrAlders0n c34a20f2a5 Assign requested repeaters to observers 2026-11-15 00:56:28 -05:00
MrAlders0n 1c51a6b77d Add telemetry request storage and routes 2026-11-15 00:41:16 -05:00
MrAlders0n c961acafd4 Add password sealing and the observer envelope 2026-11-14 23:56:57 -05:00
MrAlders0n 630f63cfb5 Refuse polling exclusions that do not fit with config and show config in admin 2026-11-14 14:55:38 -05:00
MrAlders0n 96f29f407e Make polling rate limits atomic, budget readings per observer and lock cleanup per target 2026-11-14 14:54:44 -05:00
MrAlders0n 8d3dc24a22 Rank polling evidence before health and add approved authority 2026-11-14 14:47:15 -05:00
MrAlders0n 9ee27f29be Validate polling min_client_version and tidy polling tests and comments 2026-11-14 14:26:27 -05:00
MrAlders0n b886a40b6e Answer 503 when polling state cannot be read 2026-11-14 14:17:16 -05:00
MrAlders0n 4bec5669ee Rate limit polling claims and readings and cap message sizes 2026-11-14 14:16:00 -05:00
MrAlders0n 5437a708a2 Serialize polling elections per target and trust only assigned pollers' readings 2026-11-14 14:11:10 -05:00
MrAlders0n ea6c00bc78 Key repeater readings by observer key and index polling observer columns 2026-11-14 14:04:30 -05:00
MrAlders0n 70cc93ee7e Drop polling messages from blocked observers 2026-11-14 13:26:06 -05:00