Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/api-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Adverts with a bad signature are not decoded and have no `parsedPayload`.
| `GET /nodes/{nodeId}/polling` | Which observer polls the node and when it last got a trusted reading. See [Node polling](#node-polling). |
| `GET /nodes/{nodeId}/poller` | For a node that is a poller: how many of its slots are used and the repeaters it polls. See [Node poller](#node-poller). |

`/nodes` params: `type` (1 companion, 2 repeater, 3 room server, 4 sensor) or `typeName`, the location filters, `name` (partial, case-insensitive), `scope`, `pubkey` (exact hex), `pubkeyPrefix`, `supportsMultibytePaths`, `supportsMultibyteTraces`, `poller` (`true` keeps only nodes with a stored polling claim, the server's own or a [foreign](#foreign-observers) one, `false` drops them, omit for no filter; a value that is not a boolean answers `400`), `neighbors` (adds `neighborIds`), `sort`, `order`, `cursor`, `pageCursor`, `limit`. Summaries include `lastSeen` (when the node was last heard, epoch ms; list rows carry it from 2.1.1, node detail always has), `stale` (not seen within `nodes.stale_threshold`), `isPoller` (`true` when the node's public key has a stored polling claim, so it is an observer running polling firmware, assigned to a repeater or not; see [repeater polling](repeater-polling.md#seeing-the-readings)), `isForeignPoller` (`true` when that claim is a [foreign](#foreign-observers) one; from 2.3.1, treat a missing field as `false`), `defaultScope` (the transport scope last matched from the node's adverts, omitted when none; list rows carry it from 2.1.0, node detail always has) and, when `nodes.mark_foreign` is on, `possiblyForeign`. To list one scope's nodes, send `scope` rather than filtering rows: a server before 2.1.0 leaves `defaultScope` off list rows.
`/nodes` params: `type` (1 companion, 2 repeater, 3 room server, 4 sensor) or `typeName`, the location filters, `name` (partial, case-insensitive), `scope`, `pubkey` (exact hex), `pubkeyPrefix`, `supportsMultibytePaths`, `supportsMultibyteTraces`, `poller` (`true` keeps only nodes with a stored polling claim, the server's own or a [foreign](#foreign-observers) one, and from 2.3.3 observers that sent readings and no claim in the last 24 hours, `false` drops them, omit for no filter; a value that is not a boolean answers `400`), `neighbors` (adds `neighborIds`), `sort`, `order`, `cursor`, `pageCursor`, `limit`. Summaries include `lastSeen` (when the node was last heard, epoch ms; list rows carry it from 2.1.1, node detail always has), `stale` (not seen within `nodes.stale_threshold`), `isPoller` (`true` when the node's public key has a stored polling claim, so it is an observer running polling firmware, assigned to a repeater or not; see [repeater polling](repeater-polling.md#seeing-the-readings)), `isForeignPoller` (`true` when that claim is a [foreign](#foreign-observers) one; from 2.3.1, treat a missing field as `false`), `defaultScope` (the transport scope last matched from the node's adverts, omitted when none; list rows carry it from 2.1.0, node detail always has) and, when `nodes.mark_foreign` is on, `possiblyForeign`. To list one scope's nodes, send `scope` rather than filtering rows: a server before 2.1.0 leaves `defaultScope` off list rows.

Sorted node lists (2.1.0): `sort` is `lastSeen` (the default), `name`, `type` or `neighbors`, and `order` is `asc` (the default) or `desc`. `lastSeen` defaults to `desc`, the newest-first list; from 2.1.1 it also takes `asc`, oldest heard first, which is a sorted list like the others (a server before 2.1.1 answers it with a `400`). Every page says which order it is in with `sort` and `order` (`lastSeen` and `desc` by default). The orders match what the web's node table shows:

Expand Down Expand Up @@ -612,6 +612,7 @@ The other side of [Node polling](#node-polling): what an observer that polls say
| `claim.slots` | `max` is the most repeaters this observer holds: the claim's `max_slots`, or 8 when its firmware does not report one (always 8 before 2.3.1). `used` is how many the claim lists, split into `own` (set up by the observer's owner) and `requested`. `free` is how many more requested repeaters Beacon could hand it now: the free seats the claim reported, never more than `max` minus `used`, less any seats Beacon has handed out that the claim does not list yet. It is `0` when the claim is not live or does not accept requests. `used` plus `free` can be less than `max`. |
| `readings24h` | Readings Beacon received from this observer in the last 24 hours, trusted or not. |
| `foreignReadings24h` | How many of those were stored as foreign. An observer that sends readings and no claim, as one in the firmware's local mode does, has these and a `null` `claim`. From 2.3.1. |
| `targets` with a `null` `claim` | From 2.3.3. An observer with no claim that sent foreign readings in the last 24 hours (a local poller, `isLocalPoller` on its node) lists the repeaters those readings were for, newest reading first, at most 32. Each has only `publicKey`, `nodeId`, `name` and the latest reading fields, with `role` `unassigned`. Before 2.3.3 the array is empty. |
| `targets` | One entry for each repeater in the claim. Assigned ones first in rank order, then the rest; within a tie by name, with unnamed ones last. An empty array when there are none. |

Each target:
Expand Down Expand Up @@ -1963,8 +1964,13 @@ A foreign observer:
- is never a poller or a standby, gets an empty owners answer, and is never given a requested
repeater. Nothing its claim reports (state, misses, admin stop) is acted on.
- is still tagged a poller: its node has `isPoller` `true` and, from 2.3.1, `isForeignPoller` `true`,
and the `poller` filter of `/nodes` keeps it. An observer that sends readings and no claim has
neither. A client must treat a missing `isForeignPoller`, as sent by an older server, as `false`.
and the `poller` filter of `/nodes` keeps it. A client must treat a missing `isForeignPoller`, as
sent by an older server, as `false`.
- that sends readings and no claim, as the firmware's local mode does, is a local poller from 2.3.3:
its node has `isPoller` `true` and `isLocalPoller` `true` while it has no stored claim of either
kind and a foreign reading from it arrived in the last 24 hours. `isForeignPoller` is `false` for
it. A claim, once one arrives, makes it this server's own or foreign instead. Before 2.3.3 such an
observer has neither flag. A missing `isLocalPoller` is `false`.
- has its readings stored and marked foreign. Each is trusted, and so shown, when Beacon has heard
that observer receive the repeater's zero-hop adverts within `polling.evidence_window`: the same
evidence an election counts. With `polling.authority: approved` the observer must also be
Expand Down
2 changes: 2 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ broker that observers publish to directly; nothing about that connection changes
- With it set, Beacon connects to that broker with MQTT 5, the only version that carries the tags.
A broker that refuses MQTT 5 is logged as an error and retried. Beacon does not fall back to the
older protocol, because it would then lose the source of every message without saying so.
- Over `ws://` or `wss://` this needs server 2.3.2 or later. Server 2.3.1 connects and is then
dropped by mosquitto 2.1 on subscribe, every 5 seconds, and ingests nothing.
- The rebroadcaster must leave topic and payload unchanged and set two MQTT 5 user properties on
every message it forwards:

Expand Down
7 changes: 7 additions & 0 deletions docs/repeater-polling.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ readings it left out. See the [API contract](api-contract.md#node-telemetry).

A Poller tag means a stored claim exists for that observer, whether or not it is assigned a repeater. The hourly cleanup removes a claim about a day after the last one received, and the tag goes with it. Claims from a blocked observer are not stored. An observer blocked after claiming keeps the tag until its claim is cleaned up. With polling off no new claims are stored, so existing tags clear within about a day. The API carries it as `isPoller` on nodes, and `GET /nodes` takes `poller=true|false`.

An observer that sends readings and no claim, as the firmware's local mode does, has the Poller tag
marked Local (`isLocalPoller` in the API, from server 2.3.3). It keeps the tag while one of its
readings arrived in the last 24 hours, and its Poller view lists the repeaters those readings were
for. It has no slots or login state to show, because those come from a claim. When a claim arrives
from it, it becomes one of your own pollers or a foreign one instead. This needs
`polling.foreign_claims: check`, since a reading with no claim behind it is only stored then.

An observer whose claim is foreign has the Poller tag marked Foreign (`isForeignPoller` in the API). A
repeater's telemetry is labelled as a foreign source when all of its readings came from foreign
observers, and as including foreign readings when some did.
Expand Down
18 changes: 18 additions & 0 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,24 @@ shows how to check it. If you enforce the [fail2ban jails](../app_config/fail2ba
add `protocol="tcp,udp"` to the ban action as shown there: the default bans TCP only, so a
banned address could still reach the site over HTTP/3.

## Upgrading to 2.3.3 from 2.3.2

Server 2.3.3 pairs with Beacon Web 2.3.2. There are no config changes. Migration 095 runs on start
and adds one small index on `repeater_readings`; it only covers readings stored as foreign, so it is
empty on a server without `polling.foreign_claims: check`.

It adds local pollers: an observer that sends readings and no claim, as the firmware's local mode
does, is tagged a poller marked Local and lists the repeaters it reports. See
[Repeater polling](repeater-polling.md). Older web and app builds keep working and show such an
observer as a plain poller.

## Upgrading to 2.3.2 from 2.3.1

Server only: Beacon Web and BEACON Mobile stay on 2.3.1. There are no migrations and no config
changes. It fixes `MQTT_BROKER_n_REBROADCAST=true` over `ws://` and `wss://`, where mosquitto 2.1 closed
the connection on subscribe and nothing was ingested. A server that does not set that variable behaves
the same as 2.3.1.

## Upgrading to 2.3.1 from 2.3.0

**`accounts.public_url` is removed.** The server now builds its public address from the environment:
Expand Down