From 7af6881be72fc23daeabf9fee5ab3b41df098fbf Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 05:54:39 -0500 Subject: [PATCH 01/13] docs: drop portal sign-in from the operator docs, name the -poll firmware tag --- README.md | 5 +- app_config/.env.example | 4 -- app_config/config.yaml.example | 9 +--- docs/accounts.md | 12 ++--- docs/alerts.md | 2 +- docs/api-contract.md | 4 +- docs/configuration.md | 15 +++--- docs/high-level-design.md | 5 +- docs/operations.md | 5 +- docs/portal-sign-in.md | 88 ---------------------------------- docs/repeater-polling.md | 4 +- docs/security.md | 19 +------- docs/telemetry-requests.md | 2 +- docs/upgrading.md | 7 +-- 14 files changed, 26 insertions(+), 155 deletions(-) delete mode 100644 docs/portal-sign-in.md diff --git a/README.md b/README.md index e341c46..90ecaf5 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,8 @@ Set every `CHANGE_*` value. The ones you cannot skip: Everything else in the file is optional and explained in [Configuration](docs/configuration.md): the admin API key, log settings, Redis, and the web app's map view, tabs, themes, name and banner. The features added in 2.3.0 each take a -secret here when you turn them on: `BEACON_SMTP_PASSWORD` (account mail), `BEACON_PORTAL_SECRET` -(portal sign-in), `BEACON_SECRET_KEY` (telemetry requests) and `BEACON_PUSH_SECRET` (push alerts). +secret here when you turn them on: `BEACON_SMTP_PASSWORD` (account mail), `BEACON_SECRET_KEY` +(telemetry requests) and `BEACON_PUSH_SECRET` (push alerts). If you enable MeshMapper imports, also set `MESHMAPPER_API_KEY`. Your local MeshMapper regional or grouped-region admin can generate a regional key or a key covering multiple @@ -148,7 +148,6 @@ gone private; see [Troubleshooting](docs/troubleshooting.md#docker-compose-up-fa - [Getting packets in](docs/getting-packets-in.md): brokers, the account Beacon needs, topics. - [Repeater polling](docs/repeater-polling.md): observers asking repeaters for telemetry, and how Beacon coordinates them. - [User accounts](docs/accounts.md): optional sign-in, SMTP, CORS for a split deployment, limits and the operator user routes. -- [Sign-in through the MeshMapper portal](docs/portal-sign-in.md): accounts through the portal instead of email and password. - [Requested telemetry](docs/telemetry-requests.md): users asking for a repeater to be polled, approving observers, guest passwords. - [Alerts](docs/alerts.md): rules on Atlas radios, email and push delivery. - [Configuration](docs/configuration.md): every environment variable and a map of `config.yaml`. diff --git a/app_config/.env.example b/app_config/.env.example index c63b255..a2ff255 100644 --- a/app_config/.env.example +++ b/app_config/.env.example @@ -31,10 +31,6 @@ LISTEN_ADDR=:8080 # Needed for accounts in local mode when the SMTP server wants a login. # BEACON_SMTP_PASSWORD= -# Client secret for sign-in through the MeshMapper portal. Needed when accounts.mode is portal; -# the portal gives it to you with your client id (accounts.portal.client_id). -# BEACON_PORTAL_SECRET= - # Push secret for alerts.push. Register this server at https://push.meshcorebeacon.ca/register to # get a Push ID (config.yaml alerts.push.id) and this secret. Never put it in the YAML. # BEACON_PUSH_SECRET= diff --git a/app_config/config.yaml.example b/app_config/config.yaml.example index beaa657..719a704 100644 --- a/app_config/config.yaml.example +++ b/app_config/config.yaml.example @@ -468,16 +468,11 @@ cache: # A web app on another origin than the API also needs cors.allowed_methods, cors.allowed_headers # (with X-Beacon-CSRF) and cors.allow_credentials; same origin needs nothing. #accounts: -# mode: off # off, local or portal +# mode: off # off or local # public_url: "" # https URL of the web app, no path; used in mailed links # registration: open # open or closed -# # mode: portal signs people in through the MeshMapper portal: no mail, no registration. -# # The client secret comes from BEACON_PORTAL_SECRET, never from here. -# portal: -# url: "" # https base address of the portal; required when mode is portal -# client_id: "" # required when mode is portal -# Alerts: tell users when a radio on their Atlas needs attention. Needs accounts (local or portal). Off by default. +# Alerts: tell users when a radio on their Atlas needs attention. Needs accounts. Off by default. # Each user picks which of the channels below reach them. #alerts: # email: diff --git a/docs/accounts.md b/docs/accounts.md index 220cb56..419b114 100644 --- a/docs/accounts.md +++ b/docs/accounts.md @@ -6,9 +6,7 @@ with code `accounts_disabled`, no cookie is ever set, `features.accounts` in [`/api/v1/info`](api-contract.md#server-info) is `"off"`, and both clients show no sign-in entry. Nothing that works signed out changes either way. Everything public stays public. -There are two ways to turn them on. `local` is this page: username, email and password, with mail. -`portal` lets people sign in with their MeshMapper portal account instead, see -[Sign-in through the MeshMapper portal](portal-sign-in.md). Signed-in users also get the synced +Accounts are username, email and password, with mail. Signed-in users also get the synced [Atlas](atlas.md), and, when the operator turns them on, [requested telemetry](telemetry-requests.md) and [alerts](alerts.md). @@ -45,8 +43,8 @@ In the Docker stacks that is the `.env` of the host that runs the server. Then r | Key | Default | What it does | |---|---|---| -| `mode` | `off` | `off`, `local` or `portal`. Anything else stops startup. The rest of the block is not checked while this is `off`. The rest of this page is about `local`; see [portal sign-in](portal-sign-in.md) for `portal`. | -| `public_url` | none | Required when `mode` is `local` or `portal`. The address people use for the web app: `http` or `https`, no path, query, fragment or credentials. Plain `http` is allowed only for `localhost` and `127.0.0.1`. Every link in a mail is built from it, never from a request header. | +| `mode` | `off` | `off` or `local`. Anything else stops startup. The rest of the block is not checked while this is `off`. | +| `public_url` | none | Required when `mode` is `local`. The address people use for the web app: `http` or `https`, no path, query, fragment or credentials. Plain `http` is allowed only for `localhost` and `127.0.0.1`. Every link in a mail is built from it, never from a request header. | | `registration` | `open` | `open` or `closed`. When closed, `POST /auth/register` answers `403 registration_closed` and `features.registration` is `false`. People who already have an account keep signing in. | | `mail.host` | none | Required. | | `mail.port` | `587` | 1 to 65535. | @@ -54,7 +52,7 @@ In the Docker stacks that is the `.env` of the host that runs the server. Then r | `mail.from` | none | Required, one address, for example `"Beacon "`. | | `mail.starttls` | `true` | When true the send fails if the server does not offer STARTTLS; Beacon never falls back to plain text. Set `false` only for a trusted local relay. | -In `local` mode `BEACON_SMTP_PASSWORD` is the only account secret that comes from the environment; `portal` mode reads `BEACON_PORTAL_SECRET` instead. A mistake in the +`BEACON_SMTP_PASSWORD` is the only account secret that comes from the environment. A mistake in the block stops startup with an error naming the key. An `smtp` block left under `accounts` stops startup too, with a message saying it moved to `mail`. Port 465 (implicit TLS) is not supported; use a submission port that offers STARTTLS. @@ -267,8 +265,6 @@ An hourly task (`users_cleanup`) deletes, once they are more than a week past th - sign-ups nobody confirmed: local users never verified, created more than a week ago, with no live verify link left. This frees the username and address. -In portal mode it also deletes portal sign-in states as soon as they expire, with no week's wait. - A live session or token is never touched by it. ## Disabling accounts again diff --git a/docs/alerts.md b/docs/alerts.md index 800ccf0..4301084 100644 --- a/docs/alerts.md +++ b/docs/alerts.md @@ -23,7 +23,7 @@ alerts: | Channel | What it needs | |---|---| -| `email.enabled` | `accounts.mode: local` with the [`mail` block](configuration.md#user-accounts) set. Any other mode stops startup; portal users have no address. | +| `email.enabled` | `accounts.mode: local` with the [`mail` block](configuration.md#user-accounts) set. Any other mode stops startup. | | `push.enabled` | A Push ID in `push.id` and the Push secret in `BEACON_PUSH_SECRET`, from registering the server with the push server. See [Push](#push). Without them Beacon does not start. | With both off (the default) every alert route answers `404 alerts_disabled`. With accounts off, diff --git a/docs/api-contract.md b/docs/api-contract.md index 62f7088..c2c28ee 100644 --- a/docs/api-contract.md +++ b/docs/api-contract.md @@ -1145,7 +1145,7 @@ Backup details are in [Backup and export](backup-export.md). ### User accounts -Off unless `accounts.mode` is `local` ([User accounts](accounts.md)) or `portal` ([portal sign-in](portal-sign-in.md)). With it off every route below, +Off unless `accounts.mode` is `local` ([User accounts](accounts.md)) or `portal` (the project's own MeshMapper instance only, see [Configuration](configuration.md#user-accounts)). With it off every route below, under `/api/v1/auth` and `/api/v1/me`, answers `404` with code `accounts_disabled`, and no cookie is set. These are separate from the operator records at `/admin/accounts`. @@ -1261,7 +1261,7 @@ Notes: `beacon_session` set, or to `/?view=signin&error=portal` on any failure including a cancel. Both answer `503 read_only` on a read-only server. In portal mode `register`, `verify`, `verify/resend`, `login`, `reset/request`, `reset/confirm`, `/me/password` and `/me/email` answer - `404 portal_managed`. See [Sign-in through the MeshMapper portal](portal-sign-in.md). + `404 portal_managed`. - **Mail.** Beacon mails the account address when a password is changed (by reset or from the profile), mails the old address when an email change is applied, and when an app signs in. - **Reset links** are bound to the address they were mailed to: after the address changes, an diff --git a/docs/configuration.md b/docs/configuration.md index 1e852f1..f0e461a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -25,7 +25,6 @@ to open). | `BEACON_API_KEY` | unset | Bearer key for `/api/v1/admin/*`. When set, even to an empty string, it replaces `auth.api_key` from the config file. See [Admin API key](#admin-api-key). | | `MESHMAPPER_API_KEY` | unset | Regional or grouped-region key for enabled MeshMapper imports. When set, even to an empty string, it replaces `meshmapper.api_key`. Missing keys leave imports unconfigured while Beacon keeps running. See [MeshMapper API key](#meshmapper-api-key). | | `BEACON_SECRET_KEY` | unset | 32 random bytes in base64. Seals the guest passwords of [telemetry requests](telemetry-requests.md). See [BEACON_SECRET_KEY](#beacon_secret_key). | -| `BEACON_PORTAL_SECRET` | unset | The client secret for sign-in through the MeshMapper portal. Required when `accounts.mode` is `portal`; has no YAML key. See [Sign-in through the MeshMapper portal](portal-sign-in.md). | | `BEACON_PUSH_SECRET` | unset | The Push secret from registering the server with the push server. Required when `alerts.push.enabled` is true; has no YAML key. See [Alerts](alerts.md#push). | | `BEACON_SMTP_PASSWORD` | unset | Password for `mail.username`. Read only when `accounts.mode` is `local`; it has no YAML key. See [User accounts](#user-accounts). | | `LOG_LEVEL` | `info` | `debug`, `info`, `warn` or `error`. Overrides `log.level`. Anything else stops startup. | @@ -85,7 +84,7 @@ which ones to read. | `telemetry` | How long observer telemetry snapshots are kept and how often one is stored. | Disk is tight. | | `polling` | Repeater polling: whether Beacon coordinates observers polling repeaters, which broker hosts they publish to, and how long readings are kept. Off by default. | You want [Repeater polling](repeater-polling.md). See [Repeater polling](#repeater-polling). | | `mail` | The outgoing SMTP server for account mail and email alerts. The password is `BEACON_SMTP_PASSWORD`. | You use `accounts.mode: local`. See [User accounts](#user-accounts). | -| `accounts` | User accounts: sign-in for Beacon Web and BEACON Mobile. Off by default; with it off no account route is served. `local` needs the `mail` block; `portal` signs in through the MeshMapper portal. | You want people to have accounts. See [User accounts](#user-accounts) and [User accounts](accounts.md). | +| `accounts` | User accounts: sign-in for Beacon Web and BEACON Mobile. Off by default; with it off no account route is served. `local` needs the `mail` block. | You want people to have accounts. See [User accounts](#user-accounts) and [User accounts](accounts.md). | | `alerts` | The alert channels: `email.enabled` and `push.enabled`, with `push.id`. Off by default. Needs accounts. | You want [Alerts](alerts.md). See [Alerts](#alerts). | | `display` | The units clients show: `temperature_unit` and `distance_unit`. | You want Fahrenheit or miles. See [Display units](#display-units). | | `atlas` | `limit`: how many cards one Atlas holds. Default 20. | You want larger or smaller Atlases. See [Atlas size](#atlas-size). | @@ -366,14 +365,12 @@ except a leftover `smtp` block, which always stops startup (it moved to the top- | Key | Default | What it does | |---|---|---| -| `mode` | `off` | `off`, `local` or `portal`. | -| `public_url` | none | Required with `local` and `portal`. The web app's address, `https` (plain `http` only for `localhost` and `127.0.0.1`), no path. Used for mailed links and the cookie's `Secure` flag. | +| `mode` | `off` | `off` or `local`. | +| `public_url` | none | Required with `local`. The web app's address, `https` (plain `http` only for `localhost` and `127.0.0.1`), no path. Used for mailed links and the cookie's `Secure` flag. | | `registration` | `open` | `open` or `closed`. | -| `portal.url` | none | Required with `portal`. The portal's `https` base address, with no credentials, query or fragment. | -| `portal.client_id` | none | Required with `portal`. The id the portal knows this instance by. | -With `portal`, the `mail` block is not used and registration is always closed. The client secret is -`BEACON_PORTAL_SECRET`, never in the file. See [Sign-in through the MeshMapper portal](portal-sign-in.md). +A third mode, `portal`, exists for the project's own MeshMapper instance. It is not supported for +other deployments. `local` sends its mail through the top-level `mail` block, which email alerts share. It is checked only when `accounts.mode` is `local`. An `smtp` block left under `accounts` stops startup with a message saying it @@ -411,7 +408,7 @@ The `alerts` block turns on [Alerts](alerts.md). It needs [User accounts](accoun | Key | Default | What it does | |---|---|---| | `email.enabled` | `false` | Send alerts by email. Needs `accounts.mode: local` and the `mail` block; any other mode stops startup. | -| `push.enabled` | `false` | Send alerts as push notifications to the Beacon app, through the push server. Needs `accounts.mode` `local` or `portal`, `push.id` and `BEACON_PUSH_SECRET`; startup fails without them. | +| `push.enabled` | `false` | Send alerts as push notifications to the Beacon app, through the push server. Needs accounts on, `push.id` and `BEACON_PUSH_SECRET`; startup fails without them. | | `push.id` | empty | Required with `push.enabled`. The Push ID from registering the server at `https://push.meshcorebeacon.ca/register`: at most 64 characters, with no dot, space or non-ASCII character. | | `push.server` | `https://push.meshcorebeacon.ca` | The push server. You must use the official one: the Beacon app only receives notifications sent through it. Only change it if the project announces a new address. Must be https with no path, query or credentials; any other server logs a warning. | diff --git a/docs/high-level-design.md b/docs/high-level-design.md index c627126..17e6f29 100644 --- a/docs/high-level-design.md +++ b/docs/high-level-design.md @@ -713,9 +713,7 @@ Out-of-range intervals fail startup. Added in 2.3.0, all off by default. Each has its own page; this is only how they fit together. - **[User accounts](accounts.md).** `accounts.mode: local` gives sign-up by email, sessions and - password reset. `accounts.mode: portal` signs users in through the MeshMapper portal instead - ([Sign-in through the MeshMapper portal](portal-sign-in.md)). Routes are under `/api/v1/auth` - and `/api/v1/me`. Account mail goes out through the `mail` block. + password reset. Routes are under `/api/v1/auth` and `/api/v1/me`. Account mail goes out through the `mail` block. - **Atlas sync.** A signed-in user's Atlas is stored on the server and follows the account ([Atlas](atlas.md#sync-to-an-account)). - **[Repeater polling](repeater-polling.md).** Observer firmware asks Beacon for its policy and @@ -763,7 +761,6 @@ BEACON_API_KEY=... # optional admin bearer key MESHMAPPER_API_KEY=... # optional, for MeshMapper imports BEACON_SECRET_KEY=... # optional, seals guest passwords for telemetry requests BEACON_SMTP_PASSWORD=... # optional, SMTP login for account and alert mail -BEACON_PORTAL_SECRET=... # optional, portal sign-in BEACON_PUSH_SECRET=... # optional, push alerts LOG_LEVEL=info # optional, overrides log.level LOG_FORMAT=text # optional, overrides log.format diff --git a/docs/operations.md b/docs/operations.md index 7987110..1ec018a 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -65,8 +65,8 @@ Everything persistent is under `data/` next to `docker-compose.yml`: the next start, which counts against Let's Encrypt rate limits. - `data/app/config.yaml` and `.env` are your configuration. Keep copies of both somewhere else; no backup below includes `.env`. With the optional features on, `.env` also holds - `BEACON_SECRET_KEY`, `BEACON_PUSH_SECRET`, `BEACON_SMTP_PASSWORD` and `BEACON_PORTAL_SECRET`, - which exist nowhere else. + `BEACON_SECRET_KEY`, `BEACON_PUSH_SECRET` and `BEACON_SMTP_PASSWORD`, which exist nowhere + else. ## Channel message backfill @@ -141,7 +141,6 @@ sign-ups never confirmed); see [Cleanup](accounts.md#cleanup). ## Accounts, polling, requests and alerts These features are off by default and each has its own page: [User accounts](accounts.md), -[Sign-in through the MeshMapper portal](portal-sign-in.md), [Repeater polling](repeater-polling.md), [Requested telemetry](telemetry-requests.md) and [Alerts](alerts.md). What they add to day-to-day running is a set of background jobs. Their names are the `job` label on `beacon_job_duration_seconds` and the `task` in a `task failed` diff --git a/docs/portal-sign-in.md b/docs/portal-sign-in.md deleted file mode 100644 index 023c950..0000000 --- a/docs/portal-sign-in.md +++ /dev/null @@ -1,88 +0,0 @@ -# Sign-in through the MeshMapper portal - -Instead of local accounts with an email and a password, a Beacon instance can let people sign in -with their MeshMapper portal account. Beacon is then a client of the portal. People never type a -password into Beacon, Beacon stores none, and it sends no mail. - -This is `accounts.mode: portal`. Everything else about accounts in [User accounts](accounts.md) -still applies: sessions, the app sign-in, Atlas sync, and the optional -[telemetry requests](telemetry-requests.md) and [alerts](alerts.md) (portal users have no email -address, so alerts can only use push). - -## What to set - -```yaml -accounts: - mode: portal - public_url: https://beacon.example.org - portal: - url: https://portal.example.org - client_id: beacon-example -``` - -``` -BEACON_PORTAL_SECRET=... -``` - -| Key | What it does | -|---|---| -| `accounts.mode` | `portal`. | -| `accounts.public_url` | Required. The web app's address, as for local mode. The callback address below is built from it. | -| `accounts.portal.url` | Required. The portal's base address: `https`, no credentials, query or fragment. | -| `accounts.portal.client_id` | Required. The identifier the portal knows this Beacon instance by. | -| `BEACON_PORTAL_SECRET` | Required in the environment, never in the file. The client secret the portal issued. Startup stops if it is missing. | - -Portal mode needs no mail server. The `mail` block is not used for sign-in and registration is always off -(`features.registration` is `false`). `features.accounts` in -[`/api/v1/info`](api-contract.md#server-info) is `"portal"` and `features.portalUrl` carries the -portal's address, so clients show a "Sign in with MeshMapper" button instead of a form. - -## What the portal operator must be told - -Give the MeshMapper portal operator: - -- the `client_id` you chose and the callback address Beacon sends people back to: - `/api/v1/auth/portal/callback`, which must be registered exactly; -- a client secret for you to put in `BEACON_PORTAL_SECRET`. - -Beacon expects the portal to provide two things, and nothing else is needed from it: - -1. An authorize page at `/portal.php`, opened with `beacon_authorize=1`, `client_id`, - `redirect_uri`, `state`, `code_challenge` and `code_challenge_method=S256`. After the person - agrees it sends the browser to the callback with `code` and `state`. If the person cancels it may - send `error=access_denied` and `state` with no code. -2. A token call, `POST /portal_beacon_api.php?action=token` with a JSON body of - `client_id`, `client_secret`, `code`, `code_verifier` and `redirect_uri`, answering `200` with - `{"user":{"id":...,"username":"...","display_name":"..."}}`. The id may be a string or digits. - Beacon keeps it exactly as the user's subject (digits compare as their decimal text). A subject - that is blank, longer than 128 bytes, not valid UTF-8 or holding a control character fails the - sign-in, like any other failure below. - -## How a sign-in goes - -1. The web app sends the browser to `GET /api/v1/auth/portal/start?return=`. Beacon stores a - one-time state and a PKCE verifier for 10 minutes, sets the `beacon_portal` cookie (HttpOnly, - `SameSite=Lax`, limited to `/api/v1/auth/portal`) and redirects to the portal. `return` must be - a path on the same site; anything else becomes `/`. -2. The portal sends the browser back to the callback. Beacon checks the state against the cookie, - uses it up whatever happens, and trades the code for the user at the portal with the client - secret. The call times out after 10 seconds, follows no redirect and reads at most 64 KiB. -3. Beacon finds the user by the portal's id or creates one, signs them in with a normal web - session cookie, and redirects to the return path. - -Any failure, including the person pressing Cancel, redirects to `/?view=signin&error=portal`. -Beacon logs a fixed reason and never the code, secret or portal answer. The state lives in the -database, so start and callback may reach different instances. - -A portal user's username and display name are refreshed from the portal at each sign-in. A username -already used by another user gets a number added. Usernames are cut to 30 characters and display names to 40. There is no -password and no email, so these local routes answer `404 portal_managed`: register, verify, resend, -login, reset request, reset confirm, change password and change email. Deleting an account takes -`{"confirmUsername": ""}` instead of a password. - -The app signs in as in local mode: on the web first, then a one-time code handed to the app. - -## Switching modes - -Users made in local mode and users made through the portal are separate records. Changing -`accounts.mode` does not link them. A portal user cannot use local sign-in and the reverse. diff --git a/docs/repeater-polling.md b/docs/repeater-polling.md index 1e0ec3b..9800c24 100644 --- a/docs/repeater-polling.md +++ b/docs/repeater-polling.md @@ -77,8 +77,8 @@ Caddy, see [RSA certificate for observers](reverse-proxy.md#rsa-certificate-for- The device must be an ESP32 board with PSRAM running the MeshCore repeater observer firmware with repeater polling, with the MQTT bridge on, publishing to a broker Beacon reads. The polling -firmware is in the [observer flasher](https://observer.gessaman.com) as a test build and is -still in testing. The room server firmware has no polling. On the device: +firmware is in the [observer flasher](https://observer.gessaman.com): pick the version tagged +`-poll` when you flash. It is a test build and is still in testing. The room server firmware has no polling. On the device: ```text set poll.url https://beacon.example.com diff --git a/docs/security.md b/docs/security.md index 597f1a9..ca43f7c 100644 --- a/docs/security.md +++ b/docs/security.md @@ -78,23 +78,6 @@ Accounts are off by default; see [User accounts](accounts.md). When they are on: does not discard a good token. - The SMTP password belongs in `BEACON_SMTP_PASSWORD`, not in `config.yaml`. -### Portal sign-in - -With `accounts.mode: portal` (see [Sign-in through the MeshMapper portal](portal-sign-in.md)): - -- The client secret belongs in `BEACON_PORTAL_SECRET`, not in `config.yaml`. Startup stops without - it. Beacon sends it only to the portal's token call. It is never logged, and neither are the - code, the PKCE verifier or the portal's answer; failures log a fixed reason. -- The sign-in uses PKCE (S256) and a state that is stored in the database for 10 minutes, tied to a - `beacon_portal` cookie, and used up on the first callback whatever its outcome. A callback without - the cookie, with the wrong state or with no code fails. -- The token call has a 10 second timeout, follows no redirect, accepts only a `200` and reads at - most 64 KiB. The portal's `https` address is checked at startup. -- The `return` path of a sign-in must be a relative path on the same site, so it cannot send people - to another host. -- Portal users have no password and no email in Beacon. The portal's username and display name are - stripped of control characters and cut to length before they are stored. - ## Guest passwords [Requested telemetry](telemetry-requests.md) lets a user give Beacon a guest password for a @@ -175,6 +158,6 @@ if you enable it, contains everything the database holds, so keep archives priva ## Secrets in files `.env` holds the database password, broker credentials, admin key, MeshMapper API key, and, when those -features are on, `BEACON_SECRET_KEY`, `BEACON_PORTAL_SECRET` and `BEACON_SMTP_PASSWORD`. It is gitignored in +features are on, `BEACON_SECRET_KEY` and `BEACON_SMTP_PASSWORD`. It is gitignored in the deployment folders; keep it that way, and keep its permissions tight on the host. `data/app/config.yaml` holds channel keys. Neither belongs in a public backup. diff --git a/docs/telemetry-requests.md b/docs/telemetry-requests.md index 03d80b0..35f0f32 100644 --- a/docs/telemetry-requests.md +++ b/docs/telemetry-requests.md @@ -17,7 +17,7 @@ Requests run only when all of these hold: - `polling.enabled` is `true`. - `polling.requests_per_user` is not `0`. -- User accounts are on, in `local` or `portal` mode. +- User accounts are on. - `BEACON_SECRET_KEY` is set and valid. It seals the guest passwords. See [Configuration](configuration.md#beacon_secret_key). diff --git a/docs/upgrading.md b/docs/upgrading.md index 69d509e..bb52610 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -154,10 +154,9 @@ 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 from 2.2.0: accounts, telemetry requests, alerts and portal sign-in +## Upgrading to 2.3.0 from 2.2.0 -This release adds migrations `064` to `087` (polling, user accounts, telemetry requests, the portal -sign-in state, alert rules, their channels and outbox, an Atlas telemetry view and the Atlas 7 day +This release adds migrations `064` to `087` (polling, user accounts, telemetry requests, alert rules, their channels and outbox, an Atlas telemetry view and the Atlas 7 day range). They run at startup and are quick: new tables, a few small columns, and four indexes built `CONCURRENTLY` (`066`, `080`, `081`, `082`) on tables this release creates, so they start empty. On the project's test server the @@ -177,7 +176,6 @@ Every new feature is off by default, so an upgrade with no config change behaves |---|---|---| | Repeater polling | `polling.enabled: true` and `polling.mqtt_hosts` | none | | Accounts | `accounts.mode: local` (needs `accounts.public_url` and `mail.host` and `mail.from`) | `BEACON_SMTP_PASSWORD` if the mail server wants a login | -| Portal sign-in | `accounts.mode: portal` (needs `accounts.public_url`, `accounts.portal.url` and `client_id`) | `BEACON_PORTAL_SECRET` | | Telemetry requests | polling and accounts on, and `polling.requests_per_user` not `0` (default `6`) | `BEACON_SECRET_KEY` | | Alerts | `alerts.email.enabled` and/or `alerts.push.enabled` with `alerts.push.id`, with accounts on (email needs `local` mode) | `BEACON_PUSH_SECRET` for push | @@ -187,7 +185,6 @@ for the repeater can receive one; set `polling.request_observers: approved` to c [`.env.example`](../app_config/.env.example). The full settings are in [Configuration](configuration.md), and each feature has its own page: [Repeater polling](repeater-polling.md), [User accounts](accounts.md), -[Sign-in through the MeshMapper portal](portal-sign-in.md), [Telemetry requests](telemetry-requests.md) and [Alerts](alerts.md). Both client floors rise to 2.3.0. Beacon Web builds older than 2.3.0 show a reload screen, because From 907d4dc325d53f2e02bd93262c2d1ecfe2fcbd3e Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 05:57:16 -0500 Subject: [PATCH 02/13] docs: say how requested guest passwords are protected --- docs/upgrading.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index bb52610..6ae3f7c 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -179,7 +179,10 @@ Every new feature is off by default, so an upgrade with no config change behaves | Telemetry requests | polling and accounts on, and `polling.requests_per_user` not `0` (default `6`) | `BEACON_SECRET_KEY` | | Alerts | `alerts.email.enabled` and/or `alerts.push.enabled` with `alerts.push.id`, with accounts on (email needs `local` mode) | `BEACON_PUSH_SECRET` for push | -Telemetry requests hand guest passwords to observers. By default any observer with advert evidence +Telemetry requests hand guest passwords to observers. Each password is encrypted for the one +observer assigned to that repeater, using that observer's public key, and is stored encrypted on the +server under `BEACON_SECRET_KEY`. The observer has to decrypt it to log in, so only guest passwords +are accepted. By default any observer with advert evidence for the repeater can receive one; set `polling.request_observers: approved` to choose who does (see [Approve observers](telemetry-requests.md#approve-observers)). Secrets go in `.env`; see [`.env.example`](../app_config/.env.example). The full settings are in From fecff8a22687246a729df46cfd9cefe72b4c4a1c Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 06:01:01 -0500 Subject: [PATCH 03/13] docs: say what each polling, mail and accounts setting does in the config example --- app_config/config.yaml.example | 60 ++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/app_config/config.yaml.example b/app_config/config.yaml.example index 719a704..3455dca 100644 --- a/app_config/config.yaml.example +++ b/app_config/config.yaml.example @@ -265,7 +265,8 @@ scopes: - name: "#west" region: western-canada -# Units clients show. Default: c and metric. Any other value stops startup. +# Units the web app, the mobile app and alert messages show, the same for every user. +# Default: c and metric. Any other value stops startup. display: temperature_unit: c # c or f distance_unit: metric # metric or imperial @@ -431,46 +432,49 @@ cache: # reconfirm: 1h # default: 1h # cleanup: 1h # default: 1h -# Repeater polling: Beacon coordinates which observer asks each repeater for -# telemetry, and stores the readings. Disabled by default. Bounds follow the -# observer firmware. Zero or omitted values use the defaults. +# Repeater polling: observers ask nearby repeaters for battery, temperature and counters, and +# Beacon picks which observer polls which repeater and stores the readings. Off by default. +# Zero or omitted values use the defaults. Ranges match what the observer firmware accepts. #polling: -# enabled: false -# mqtt_hosts: [] # up to 4 plain hostnames, no port; required when enabled -# direct_window: 1h # 30m to 24h; default: 1h -# grace: 30m # 10m to 2h; default: 30m -# max_requests: 2 # 1 to 3; default: 2 -# reading_retention: 744h # at least 1h; default: 744h (31 days) -# min_client_version: "" # X.Y.Z or empty; older observer firmware gets version_ok false -# excluded_nodes: [] # up to 16 public keys, 64 hex characters each -# paused: false -# authority: evidence # evidence or approved; approved elects only observers you approve -# # Telemetry requests also need accounts on and BEACON_SECRET_KEY (32 random bytes in base64, -# # from: openssl rand -base64 32). Losing or changing the key makes stored guest passwords unreadable. -# requests_per_user: 6 # 0 to 20; 0 turns requests off; default: 6 -# offline_disable_days: 7 # 1 to 365; days unheard before a repeater's requests are turned off; default: 7 -# request_observers: all # all (default) or approved. all: any observer with advert evidence for a requested -# # repeater can be handed it and its guest password. approved: only observers you -# # approve under /api/v1/admin/polling; advert evidence is required in both modes. +# enabled: false # turn repeater polling on; needs mqtt_hosts +# mqtt_hosts: [] # brokers your observers publish to: plain hostnames, no port, up to 4 +# direct_window: 1h # poll a repeater again once its newest reading is this old; 30m to 24h +# grace: 30m # extra wait for each standby before it steps in for the poller; 10m to 2h +# max_requests: 2 # poll attempts per repeater in each window; 1 to 3 +# reading_retention: 744h # how long readings are kept; at least 1h (default 31 days) +# min_client_version: "" # oldest observer firmware allowed to poll, as X.Y.Z; empty allows all +# excluded_nodes: [] # repeaters that are never polled; up to 16 public keys, 64 hex characters each +# paused: false # true tells every observer to stop polling, without turning the feature off +# authority: evidence # who can be chosen to poll. evidence: any observer, ranked by how well Beacon +# # has heard the repeater through it. approved: only observers you approve +# +# # Telemetry requests: signed-in users ask for a repeater to be polled. They also need accounts on +# # and BEACON_SECRET_KEY in .env (32 random bytes in base64, from: openssl rand -base64 32). +# # Losing or changing the key makes the stored guest passwords unreadable. +# requests_per_user: 6 # repeaters one user may ask to have polled; 0 to 20, 0 turns requests off +# offline_disable_days: 7 # days no observer hears a repeater before its requests are switched off; 1 to 365 +# request_observers: all # which observers may be handed a requested repeater and its guest password. +# # all: any observer Beacon has heard the repeater through. +# # approved: only observers you approve under /api/v1/admin/polling. # # Set approved if you want to vet observers before they receive guest passwords. # Outgoing mail: the SMTP server Beacon sends account mail (sign-up, password reset) and email alerts # through. Required when accounts.mode is local. The password comes from BEACON_SMTP_PASSWORD, never from here. #mail: -# host: "" # e.g. smtp.example.org -# port: 587 # default: 587 -# username: "" # empty means no auth -# from: "" # e.g. "Beacon " -# starttls: true # default: true; the send fails if the server lacks STARTTLS +# host: "" # your SMTP server, e.g. smtp.example.org +# port: 587 # SMTP port; default: 587 +# username: "" # SMTP login; empty sends without signing in +# from: "" # the sender people see, e.g. "Beacon " +# starttls: true # require an encrypted connection; the send fails if the server lacks STARTTLS # User accounts: sign-in for the web app and the mobile app. Off by default; with it off # no account route is served. Mode local sends mail through the mail block above. # A web app on another origin than the API also needs cors.allowed_methods, cors.allowed_headers # (with X-Beacon-CSRF) and cors.allow_credentials; same origin needs nothing. #accounts: -# mode: off # off or local +# mode: off # off, or local for sign-up with username, email and password # public_url: "" # https URL of the web app, no path; used in mailed links -# registration: open # open or closed +# registration: open # open: anyone can sign up. closed: no new sign-ups, existing users still sign in # Alerts: tell users when a radio on their Atlas needs attention. Needs accounts. Off by default. # Each user picks which of the channels below reach them. From 1da4b53b776823eb30fd9f2e8abae2f1313aa830 Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 06:01:39 -0500 Subject: [PATCH 04/13] docs: list the polling limits that have no setting --- docs/configuration.md | 3 +++ docs/repeater-polling.md | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index f0e461a..813ec95 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -340,6 +340,9 @@ the key. | `offline_disable_days` | `7` | 1 to 365 | Days no observer hears a repeater before its requests are turned off. | | `request_observers` | `all` | `all` or `approved` | Which observers may be handed a requested repeater and its guest password. `all`: any observer with advert evidence for the repeater. `approved`: only observers you approved. Advert evidence is required in both modes. Set `approved` if you want to vet observers first. See [Approve observers](telemetry-requests.md#approve-observers). | +The number of repeaters one observer polls is not a setting: the firmware holds 8. See +[Fixed limits](repeater-polling.md#fixed-limits). + Telemetry requests also need accounts on and `BEACON_SECRET_KEY`; see [Requested telemetry](telemetry-requests.md#turn-it-on). The gates are checked in this order: polling on, `requests_per_user` above `0`, accounts on, then the key. The first one that fails turns diff --git a/docs/repeater-polling.md b/docs/repeater-polling.md index 9800c24..99b495d 100644 --- a/docs/repeater-polling.md +++ b/docs/repeater-polling.md @@ -113,6 +113,26 @@ the target count and the clock. `get poll.status` has one line per target with i and `get poll.status ` the details of target n. `poll now ` sends one poll right away, at most once a minute per target. +## Fixed limits + +Some limits are built into the observer firmware and the server. They have no setting. + +| Limit | Value | +|---|---| +| Repeaters one observer polls | 8. This counts the repeaters its owner added and the ones Beacon hands it through [telemetry requests](telemetry-requests.md). | +| Observers assigned to one requested repeater | 3: one poller and two standbys. | +| Repeaters an operator can exclude | 16, across the config and the admin route. | + +There is no setting for how many repeaters Beacon gives one observer. A requested repeater is only +handed to an observer that reports a free seat, so an observer whose owner filled all 8 takes no +requests. To change how much polling happens, use these instead (see +[Configuration](configuration.md#repeater-polling)): + +- `direct_window` sets how often each repeater is polled. +- `max_requests` sets how many poll attempts a repeater gets in each window. +- `requests_per_user` sets how many repeaters one user may ask for. +- `request_observers: approved` limits which observers take requests at all. + ## What Beacon stores | Data | Kept for | From 94691c50f5837c58946cc44f9bccb8d7334aafb5 Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 06:50:31 -0500 Subject: [PATCH 05/13] docs: add the node poller read and the Poller view --- docs/api-contract.md | 64 ++++++++++++++++++++++++++++++++++++++++ docs/repeater-polling.md | 2 ++ 2 files changed, 66 insertions(+) diff --git a/docs/api-contract.md b/docs/api-contract.md index c2c28ee..f5713fe 100644 --- a/docs/api-contract.md +++ b/docs/api-contract.md @@ -362,6 +362,7 @@ Adverts with a bad signature are not decoded and have no `parsedPayload`. | `GET /nodes/{nodeId}/telemetry?range=168h&interval=6h` | Repeater readings of a polled node, bucketed for charts. See [Node telemetry](#node-telemetry). | | `GET /nodes/telemetry/latest` | The newest battery and temperature of every polled node, for map labels. See [Latest node telemetry](#latest-node-telemetry). | | `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, `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)), `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. @@ -547,6 +548,69 @@ Who polls this node right now. A `400` for a `nodeId` that is not a UUID and a ` `name` is the observer's display name, or the first 8 hex characters of its public key when it has none. +#### Node poller + +``` +GET /api/v1/nodes/{nodeId}/poller +``` + +The other side of [Node polling](#node-polling): what an observer that polls says it holds, read from its last stored [claim](#claim-message). A `400` for a `nodeId` that is not a UUID and a `404` for an unknown node. A node with no stored claim answers `{"claim":null,"readings24h":0,"targets":[]}`. With polling off the route still checks the node (an unknown node is a `404`) and then gives that same answer. Not cached. + +```json +{ + "claim": { + "receivedAt": 1795800000000, + "live": true, + "acceptsRequests": true, + "slots": { "max": 8, "used": 5, "own": 3, "requested": 2, "free": 3 } + }, + "readings24h": 212, + "targets": [ + { + "nodeId": "3d0a8a8e-1c55-4c0b-9f0e-6a1f0b7f2c11", + "publicKey": "5be1c07a...", + "name": "Hilltop R2", + "requested": false, + "role": "poller", + "rank": 0, + "state": "ok", + "misses": 0, + "lastAttempt": 1795799000000, + "lastOk": 1795799000000, + "claimedSnr": 9.5, + "evidenceSnr": 8.1, + "evidenceCount": 14, + "latestReadingAt": 1795799000000 + } + ] +} +``` + +| Field | Notes | +|---|---| +| `claim` | The observer's last stored claim, or `null` when it has none. | +| `claim.receivedAt` | When Beacon received it, epoch ms. | +| `claim.live` | True while the claim is within its 65 minutes. A claim is kept for about a day after that, so `false` means the observer has stopped claiming. `isPoller` on the node does not check this. | +| `claim.acceptsRequests` | The observer takes repeaters handed out by [telemetry requests](#telemetry-requests). | +| `claim.slots` | `max` is the most repeaters one observer holds (8). `used` is how many the claim lists, split into `own` (set up by the observer's owner) and `requested`. `free` is the free seats the claim reported, never more than `max` minus `used`. `used` plus `free` can be less than `max`. | +| `readings24h` | Readings Beacon received from this observer in the last 24 hours, trusted or not. | +| `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: + +| Field | Notes | +|---|---| +| `nodeId`, `name` | The repeater's node, when Beacon has one for the key. Otherwise both are `null`. `name` is also `null` for a node without a name. | +| `publicKey` | The repeater's key, 64 lowercase hex. | +| `requested` | True when the observer was given the repeater by a telemetry request, false when its owner set it up. | +| `role`, `rank` | From the last election: `poller` with rank `0`, `standby` with rank `1` and up, or `unassigned` with `rank` `null`. | +| `state` | As the observer reported it: `pending`, `ok`, `no_reply`, `login_failed`, `admin_stop` or `not_direct`. Empty from firmware without request support. A newer firmware may send other values. | +| `misses` | Failed polls in a row. | +| `lastAttempt`, `lastOk` | Epoch ms, or `null` when never. | +| `claimedSnr` | The SNR the observer reports for the repeater, or `null`. | +| `evidenceSnr`, `evidenceCount` | Zero-hop adverts of the repeater that Beacon saw through this observer in the day before the last election: their mean SNR and how many. `null` and `0` for an unassigned repeater or one with no such adverts. | +| `latestReadingAt` | `sampledAt` of the newest reading this observer delivered for the repeater, trusted or not. `null` when it has delivered none. | + #### MeshMapper repeater details With `meshmapper.repeaters.enabled`, node detail carries `meshmapper` when MeshMapper's repeater diff --git a/docs/repeater-polling.md b/docs/repeater-polling.md index 99b495d..8b6cfd4 100644 --- a/docs/repeater-polling.md +++ b/docs/repeater-polling.md @@ -182,6 +182,8 @@ 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 with the Poller tag also gets a Poller view on its node, beside Node and Observer, in Beacon Web and in the mobile app. It shows how many of its 8 slots are used (its owner's own repeaters and requested ones), how many are free, when Beacon last received its claim, and one row for each repeater it holds: whether it is the poller, a standby or not assigned, the state it reports, its last reply and SNR, and how many of the repeater's adverts Beacon heard through it. Anyone who can open the node can see this, including which repeaters are requested and a `login_failed` or `admin_stop` state. The API route is `GET /nodes/{nodeId}/poller`, see the [API contract](api-contract.md#node-poller). + A gap in a chart means there is no usable value for that series in that bucket. The cause can be the poll cadence (status values arrive every few hours), a field the repeater does not report, a counter that was inconsistent and was dropped, or a missed poll. It does not mean the repeater was down. ## Pause, exclude and block From 0bfe2693bca9b5cfa053daaffc47cd9dc1a1ddcd Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 07:20:42 -0500 Subject: [PATCH 06/13] config: telemetry resolution 15m, explain what it trades off --- app_config/config.yaml.example | 8 +++++++- docker-deployment-type1/data/app/config.yaml | 8 +++++++- docker-deployment-type2/server/data/app/config.yaml | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app_config/config.yaml.example b/app_config/config.yaml.example index 3455dca..7919f83 100644 --- a/app_config/config.yaml.example +++ b/app_config/config.yaml.example @@ -277,7 +277,13 @@ atlas: telemetry: retention: 744h # 31 days - resolution: 1h # store one snapshot per observer per hour + # How often an observer's status is stored as a snapshot (default 15m). Observers report + # every 5 minutes by default; reports inside one window are dropped, except the first after + # a reboot. Observer alerts and charts read these snapshots: + # - battery and noise alerts need two snapshots in a row, so they react after about two windows + # - a shorter window stores more rows (5m is about 3x the rows of 15m, 1h about a quarter) + # - below the observers' report interval nothing more is stored + resolution: 15m # Optional authenticated database/config downloads. Disabled unless explicitly enabled. # Requires auth.api_key, a supported PostgreSQL URL and a compatible pg_dump client. diff --git a/docker-deployment-type1/data/app/config.yaml b/docker-deployment-type1/data/app/config.yaml index 33c856d..eed7ec0 100644 --- a/docker-deployment-type1/data/app/config.yaml +++ b/docker-deployment-type1/data/app/config.yaml @@ -252,7 +252,13 @@ scopes: telemetry: retention: 744h # 31 days - resolution: 1h # store one snapshot per observer per hour + # How often an observer's status is stored as a snapshot (default 15m). Observers report + # every 5 minutes by default; reports inside one window are dropped, except the first after + # a reboot. Observer alerts and charts read these snapshots: + # - battery and noise alerts need two snapshots in a row, so they react after about two windows + # - a shorter window stores more rows (5m is about 3x the rows of 15m, 1h about a quarter) + # - below the observers' report interval nothing more is stored + resolution: 15m # Optional authenticated database/config downloads. Disabled unless explicitly enabled. # Requires auth.api_key, a supported PostgreSQL URL and a compatible pg_dump client. diff --git a/docker-deployment-type2/server/data/app/config.yaml b/docker-deployment-type2/server/data/app/config.yaml index 33c856d..eed7ec0 100644 --- a/docker-deployment-type2/server/data/app/config.yaml +++ b/docker-deployment-type2/server/data/app/config.yaml @@ -252,7 +252,13 @@ scopes: telemetry: retention: 744h # 31 days - resolution: 1h # store one snapshot per observer per hour + # How often an observer's status is stored as a snapshot (default 15m). Observers report + # every 5 minutes by default; reports inside one window are dropped, except the first after + # a reboot. Observer alerts and charts read these snapshots: + # - battery and noise alerts need two snapshots in a row, so they react after about two windows + # - a shorter window stores more rows (5m is about 3x the rows of 15m, 1h about a quarter) + # - below the observers' report interval nothing more is stored + resolution: 15m # Optional authenticated database/config downloads. Disabled unless explicitly enabled. # Requires auth.api_key, a supported PostgreSQL URL and a compatible pg_dump client. From d04fe8c04c58bc553f7e6bc0e3c250fc08e491e6 Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 08:02:50 -0500 Subject: [PATCH 07/13] docs(polling): evidence_window and trust for self-configured targets --- app_config/config.yaml.example | 2 ++ docs/api-contract.md | 4 ++-- docs/configuration.md | 1 + docs/repeater-polling.md | 26 +++++++++++++++++--------- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/app_config/config.yaml.example b/app_config/config.yaml.example index 7919f83..c5df153 100644 --- a/app_config/config.yaml.example +++ b/app_config/config.yaml.example @@ -453,6 +453,8 @@ cache: # paused: false # true tells every observer to stop polling, without turning the feature off # authority: evidence # who can be chosen to poll. evidence: any observer, ranked by how well Beacon # # has heard the repeater through it. approved: only observers you approve +# evidence_window: 168h # how far back a repeater's zero-hop adverts count as proof an observer hears +# # it; 24h to 720h. Adverts older than packets.retention are gone either way # # # Telemetry requests: signed-in users ask for a repeater to be polled. They also need accounts on # # and BEACON_SECRET_KEY in .env (32 random bytes in base64, from: openssl rand -base64 32). diff --git a/docs/api-contract.md b/docs/api-contract.md index f5713fe..b5cc0e5 100644 --- a/docs/api-contract.md +++ b/docs/api-contract.md @@ -1105,7 +1105,7 @@ All under `/api/v1/admin/`, bearer key required (see [Auth](#auth)). | `GET /admin/users`, `PUT /admin/users/{id}`, `DELETE /admin/users/{id}` | Manage [user accounts](#operator-user-routes). `503` while accounts are off or the server is read-only. | | `GET /admin/accounts`, `POST /admin/accounts` | List or create operator account records (name only; not logins). | | `GET /admin/accounts/{id}`, `DELETE /admin/accounts/{id}` | Fetch or deactivate one. | -| `GET /admin/polling` | Repeater polling settings: `paused`, `pausedUntil` (epoch ms or `null`), `configPaused`, `excludedNodes` (64 hex each), `configExcludedNodes`, `authority` and `observers`, each `{publicKey, blocked, approved, note}`. `paused` is the stored pause and reads `false` once `pausedUntil` has passed; `configPaused` is `polling.paused` from config, which pauses every observer whatever the stored state says. `configExcludedNodes` is `polling.excluded_nodes`; the policy excludes the union of both lists. `authority` is `polling.authority`, `evidence` or `approved`. `noPasswordBlocked` is a list of repeater keys (64 hex) that gave admin access to a blank login, and `adminStops` lists `{targetPublicKey, observerPublicKey, reportedAt}`. `503` unless `polling.enabled` is true and the server is not read-only. | +| `GET /admin/polling` | Repeater polling settings: `paused`, `pausedUntil` (epoch ms or `null`), `configPaused`, `excludedNodes` (64 hex each), `configExcludedNodes`, `authority`, `evidenceWindowSeconds` and `observers`, each `{publicKey, blocked, approved, note}`. `paused` is the stored pause and reads `false` once `pausedUntil` has passed; `configPaused` is `polling.paused` from config, which pauses every observer whatever the stored state says. `configExcludedNodes` is `polling.excluded_nodes`; the policy excludes the union of both lists. `authority` is `polling.authority`, `evidence` or `approved`. `evidenceWindowSeconds` is `polling.evidence_window`. `noPasswordBlocked` is a list of repeater keys (64 hex) that gave admin access to a blank login, and `adminStops` lists `{targetPublicKey, observerPublicKey, reportedAt}`. `503` unless `polling.enabled` is true and the server is not read-only. | | `GET /admin/polling/targets` | Who polls what. `{targets: [...]}`, at most 500 repeaters with a live claim or an assignment, newest claim first. Each is `{publicKey, latestTrustedReading, latestReading, candidates}`; the two times are epoch ms or `null`, `latestTrustedReading` follows the same rule as `latest_ts` in [Owners](#owners) and `latestReading` counts every observer. Each candidate is `{observerPublicKey, rank, evidenceSnr, evidenceCount, keyMode, state, misses, lastOk, approved}`: `rank` is `0` for the poller, `1` and up for standbys and `null` when unassigned; `evidenceSnr` and `evidenceCount` come from the last election; `keyMode`, `state`, `misses` and `lastOk` come from the observer's live claim and are empty, `0` or `null` when it has none; `lastOk` is epoch ms or `null`; `approved` is the operator's flag for the observer. Each target also has `requested` (a telemetry request is in use for it) and `requests` (how many requests name it). Same `503` rule as above. | | `PUT /admin/polling/targets/{target}` | `{"noPasswordBlocked": false}` lifts the block on passwordless [telemetry requests](#telemetry-requests) for one repeater (64 hex characters in the path). Only `false` is accepted (`400` otherwise). Returns the body, or `404` for a repeater Beacon has no record of. Body up to 4 KiB. | | `DELETE /admin/polling/admin-stops/{target}/{observer}` | Clears one admin stop so the observer can be offered the requested repeater again. `204`, or `404`. Both keys are 64 hex characters. | @@ -1810,7 +1810,7 @@ Every answer carries every field. | `owner_hops` | int | `0`. | | `requested` | bool | Present and `true` only for a repeater given to this observer by a [telemetry request](telemetry-requests.md). | | `pw` | object | Only on a requested entry that has a guest password in use: `{"epk","ct","tag","ver"}`, lower hex, `ver` an integer. The password sealed to this observer's public key. Sent fresh on every answer; `ver` changes when the password in use changes. An entry whose password cannot be sealed is left out of the answer. | -| `latest_ts` | string or `null` | `sampled_at` of the newest trusted reading for the repeater. A reading is trusted when its observer is ranked for the repeater (poller or standby) and Beacon saw it hear the repeater's own adverts directly (zero hops) in the day before the last election. Other readings, including a poller's without that evidence, are stored but do not count here, so claiming a repeater alone does not hold anyone back. Advert evidence comes from the observer's own packet uplink, so it is not proof; with `polling.authority: approved` only approved observers are ranked. | +| `latest_ts` | string or `null` | `sampled_at` of the newest trusted reading for the repeater. A reading is trusted when its observer is ranked for the repeater (poller or standby) and Beacon saw it hear the repeater's own adverts directly (zero hops) within `polling.evidence_window` (7 days by default) before the last election. When no ranked observer has that evidence, readings from observers that hold the repeater as their own target count too. Other readings, including a poller's without evidence beside a standby that has it, are stored but do not count here, so claiming a repeater alone does not hold anyone back. Advert evidence comes from the observer's own packet uplink, so it is not proof; with `polling.authority: approved` only approved observers are ranked. | ### Claim message diff --git a/docs/configuration.md b/docs/configuration.md index 813ec95..29e4eae 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -336,6 +336,7 @@ the key. | `excluded_nodes` | none | up to 16 | Repeater public keys, 64 hex characters each, that are never polled. | | `paused` | `false` | | Tells every observer to stop. Overrides the admin route. | | `authority` | `evidence` | `evidence` or `approved` | Who can be elected to poll. `evidence`: any observer, ranked on the advert evidence it reports. `approved`: only observers approved through the admin route. See [Trust](repeater-polling.md#trust). | +| `evidence_window` | `168h` | `24h` to `720h` | How far back a repeater's zero-hop adverts count as advert evidence that an observer hears it. Adverts older than `packets.retention` are gone, so a longer window adds nothing. Raise both if your repeaters advert less than weekly and you use telemetry requests. | | `requests_per_user` | `6` | 0 to 20 | How many [telemetry requests](telemetry-requests.md) one user may hold. `0` turns requests off. | | `offline_disable_days` | `7` | 1 to 365 | Days no observer hears a repeater before its requests are turned off. | | `request_observers` | `all` | `all` or `approved` | Which observers may be handed a requested repeater and its guest password. `all`: any observer with advert evidence for the repeater. `approved`: only observers you approved. Advert evidence is required in both modes. Set `approved` if you want to vet observers first. See [Approve observers](telemetry-requests.md#approve-observers). | diff --git a/docs/repeater-polling.md b/docs/repeater-polling.md index 8b6cfd4..1ab1e22 100644 --- a/docs/repeater-polling.md +++ b/docs/repeater-polling.md @@ -19,7 +19,8 @@ for where the readings show up. 3. The observer publishes a claim to the MQTT broker, listing its targets and how its last polls went. 4. Every minute Beacon ranks the observers that claimed each repeater. Observers it saw hear the - repeater's zero-hop adverts in the last 24 hours (advert evidence) come first, by mean SNR, + repeater's zero-hop adverts in the last 7 days (advert evidence, `polling.evidence_window`) + come first, by mean SNR, then by number of adverts. Observers without evidence come after, by the signal they claim. One observer is the poller. The others are standbys. With `polling.authority: approved` only observers you approved take part (see [Trust](#trust)). @@ -27,9 +28,12 @@ for where the readings show up. newest reading is older than the poll window. A standby waits the window plus one grace period for each rank, so it only polls if the poller has not. 6. The poller publishes the reading to the broker. Beacon stores it. The next owners answer - carries the new reading time, which tells every observer the repeater is fresh. Only readings - from a ranked observer with advert evidence, poller or standby, move that time. A poller - without evidence still polls, but its readings do not hold the standbys back. + carries the new reading time, which tells every observer the repeater is fresh. Only trusted + readings move that time: those from a ranked observer with advert evidence, poller or + standby. When no ranked observer has evidence for the repeater, readings from any of them + count, so a repeater that rarely or never adverts is still polled and charted. A poller + without evidence, next to a standby that has it, still polls, but its readings do not hold + the standbys back. Evidence comes before health. An observer with advert evidence always ranks above one without, even when it reports misses. Within each group, an observer that reports 3 or more misses in a row @@ -175,7 +179,10 @@ and shows readings for room servers too, but the current polling firmware polls Only trusted readings are charted. A reading is trusted when its observer was assigned to the repeater and Beacon had itself heard the repeater directly through that observer when the reading -was stored. Readings from any other observer are kept but left out of the charts. To see them, +was stored. If Beacon had heard the repeater through none of its assigned observers, readings +from observers whose owner set the repeater as a target are trusted too; a repeater polled +through a [telemetry request](telemetry-requests.md) always needs the evidence. Readings from +any other observer are kept but left out of the charts. To see them, call the API with `include=untrusted`, for example `/api/v1/nodes/{nodeId}/telemetry?range=168h&include=untrusted`. The answer also says how many readings it left out. See the [API contract](api-contract.md#node-telemetry). @@ -265,7 +272,8 @@ approved are. See In both modes: - An observer without advert evidence never outranks one with it, and its readings never stand - anyone down. + down or get charted beside an observer that has it. They only count while no ranked observer + has evidence for the repeater. - Claims and readings are rate limited and capped in size per observer, including an hourly limit on readings across all its repeaters. - Each reading records how many other observers heard the repeater's reply. It is not checked @@ -288,8 +296,8 @@ are then dropped, and the election moves its repeaters to other observers. chain can use nearly all of that on an ESP32. See [An RSA certificate for the devices](#an-rsa-certificate-for-the-devices). - **The device polls but the charts stay empty.** Only trusted readings are charted, and a - reading is trusted only when its observer was assigned to the repeater and Beacon had advert - evidence for the pair when the reading was stored. `GET /api/v1/admin/polling/targets` shows + reading is trusted only when its observer was assigned to the repeater and either Beacon had + advert evidence for the pair when the reading was stored, or no assigned observer had any. `GET /api/v1/admin/polling/targets` shows each observer's rank and evidence. Add `include=untrusted` to the node telemetry request to see the readings that were left out. - **A repeater is never polled after a login.** It answered the device with admin access, so @@ -306,7 +314,7 @@ are then dropped, and the election moves its repeaters to other observers. lists the repeater. Check the observer sent a claim after its last `poll add`, and that it is not blocked. - **Standbys poll a repeater the poller already polls.** The poller has no advert evidence for - it, so its readings do not count as fresh for the others. Once Beacon sees it hear the + it and a standby does, so its readings do not count as fresh for the others. Once Beacon sees it hear the repeater's adverts directly, they do. In `approved` mode, check the poller is approved. - **Everything is paused.** Check `polling.paused`, then `GET /api/v1/admin/polling`. - **An old firmware is refused.** If `polling.min_client_version` is set, the policy tells From 9d9a64a85ca2cc21779e7cb157d5b41fb7b88adf Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 08:13:46 -0500 Subject: [PATCH 08/13] docs: upgrade notes for the 15m telemetry default and migration 088 --- docs/upgrading.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index 6ae3f7c..97d6f46 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -156,11 +156,11 @@ banned address could still reach the site over HTTP/3. ## Upgrading to 2.3.0 from 2.2.0 -This release adds migrations `064` to `087` (polling, user accounts, telemetry requests, alert rules, their channels and outbox, an Atlas telemetry view and the Atlas 7 day +This release adds migrations `064` to `088` (polling, user accounts, telemetry requests, alert rules, their channels and outbox, an Atlas telemetry view and the Atlas 7 day range). They run at startup and are quick: new tables, a few small columns, and four indexes built `CONCURRENTLY` (`066`, `080`, `081`, `082`) on tables this release creates, so they start empty. On the project's test server the -whole set took seconds. The only data migrations are `065`, which marks readings of the empty +whole set took seconds. The only data migrations are `065` and `088`, which mark readings of the still empty `repeater_readings` table, `073`, which removes duplicate rows from the still empty `user_devices` table, `078`, which copies one drift row per node into a new table, and `084` and `085`, which touch only alert tables that are still empty on a 2.2.0 database. @@ -170,7 +170,15 @@ only alert tables that are still empty on a 2.2.0 database. seconds on a test table of 4 million packets and added about a quarter of the table's size; allow more time and disk on a larger database. -Every new feature is off by default, so an upgrade with no config change behaves as before: +One default changes for everyone: observer telemetry is now stored every 15 minutes instead of +hourly, so battery and noise alerts react in about half an hour and the 24 hour charts are finer. +A `config.yaml` copied from an older template still says `resolution: 1h` under `telemetry`, and +that value wins. Change it to `15m`, or remove the line, to get the new behaviour. It stores about +four times as many observer snapshots as hourly; see +[`config.yaml.example`](../app_config/config.yaml.example) for the trade-off. + +Every new feature is off by default, so apart from that an upgrade with no config change behaves +as before: | Feature | Turn it on with | Secret | |---|---|---| @@ -214,6 +222,9 @@ before the release starts: shared columns. A notice queued before it keeps its attempts and retry time for push, and its mail, if not sent yet, starts with no attempts and is tried at once. A build from before `085` cannot read the outbox after it, so going back to one is not supported. +- **Readings.** Nothing to do. Migration `088` marks stored readings of a repeater an observer polls + on its own as trusted where no assigned observer has advert evidence for it, so charts that were + empty can fill in after the upgrade. See [Trust](repeater-polling.md#trust). ## Upgrading to 2.1 From e0bee627333cc8f926f66482cfb751670e4b4070 Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 10:06:09 -0500 Subject: [PATCH 09/13] docs(polling): readings need advert evidence again --- docs/api-contract.md | 2 +- docs/configuration.md | 2 +- docs/repeater-polling.md | 23 ++++++++--------------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/docs/api-contract.md b/docs/api-contract.md index b5cc0e5..cc4568b 100644 --- a/docs/api-contract.md +++ b/docs/api-contract.md @@ -1810,7 +1810,7 @@ Every answer carries every field. | `owner_hops` | int | `0`. | | `requested` | bool | Present and `true` only for a repeater given to this observer by a [telemetry request](telemetry-requests.md). | | `pw` | object | Only on a requested entry that has a guest password in use: `{"epk","ct","tag","ver"}`, lower hex, `ver` an integer. The password sealed to this observer's public key. Sent fresh on every answer; `ver` changes when the password in use changes. An entry whose password cannot be sealed is left out of the answer. | -| `latest_ts` | string or `null` | `sampled_at` of the newest trusted reading for the repeater. A reading is trusted when its observer is ranked for the repeater (poller or standby) and Beacon saw it hear the repeater's own adverts directly (zero hops) within `polling.evidence_window` (7 days by default) before the last election. When no ranked observer has that evidence, readings from observers that hold the repeater as their own target count too. Other readings, including a poller's without evidence beside a standby that has it, are stored but do not count here, so claiming a repeater alone does not hold anyone back. Advert evidence comes from the observer's own packet uplink, so it is not proof; with `polling.authority: approved` only approved observers are ranked. | +| `latest_ts` | string or `null` | `sampled_at` of the newest trusted reading for the repeater. A reading is trusted when its observer is ranked for the repeater (poller or standby) and Beacon saw it hear the repeater's own adverts directly (zero hops) within `polling.evidence_window` (7 days by default) before the last election. Other readings, including a poller's without that evidence, are stored but do not count here, so claiming a repeater alone does not hold anyone back. Advert evidence comes from the observer's own packet uplink, so it is not proof; with `polling.authority: approved` only approved observers are ranked. | ### Claim message diff --git a/docs/configuration.md b/docs/configuration.md index 29e4eae..edcfdcb 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -336,7 +336,7 @@ the key. | `excluded_nodes` | none | up to 16 | Repeater public keys, 64 hex characters each, that are never polled. | | `paused` | `false` | | Tells every observer to stop. Overrides the admin route. | | `authority` | `evidence` | `evidence` or `approved` | Who can be elected to poll. `evidence`: any observer, ranked on the advert evidence it reports. `approved`: only observers approved through the admin route. See [Trust](repeater-polling.md#trust). | -| `evidence_window` | `168h` | `24h` to `720h` | How far back a repeater's zero-hop adverts count as advert evidence that an observer hears it. Adverts older than `packets.retention` are gone, so a longer window adds nothing. Raise both if your repeaters advert less than weekly and you use telemetry requests. | +| `evidence_window` | `168h` | `24h` to `720h` | How far back a repeater's zero-hop adverts count as advert evidence that an observer hears it. Adverts older than `packets.retention` are gone, so a longer window adds nothing. Raise both if your repeaters advert less than weekly. | | `requests_per_user` | `6` | 0 to 20 | How many [telemetry requests](telemetry-requests.md) one user may hold. `0` turns requests off. | | `offline_disable_days` | `7` | 1 to 365 | Days no observer hears a repeater before its requests are turned off. | | `request_observers` | `all` | `all` or `approved` | Which observers may be handed a requested repeater and its guest password. `all`: any observer with advert evidence for the repeater. `approved`: only observers you approved. Advert evidence is required in both modes. Set `approved` if you want to vet observers first. See [Approve observers](telemetry-requests.md#approve-observers). | diff --git a/docs/repeater-polling.md b/docs/repeater-polling.md index 1ab1e22..9486397 100644 --- a/docs/repeater-polling.md +++ b/docs/repeater-polling.md @@ -28,12 +28,9 @@ for where the readings show up. newest reading is older than the poll window. A standby waits the window plus one grace period for each rank, so it only polls if the poller has not. 6. The poller publishes the reading to the broker. Beacon stores it. The next owners answer - carries the new reading time, which tells every observer the repeater is fresh. Only trusted - readings move that time: those from a ranked observer with advert evidence, poller or - standby. When no ranked observer has evidence for the repeater, readings from any of them - count, so a repeater that rarely or never adverts is still polled and charted. A poller - without evidence, next to a standby that has it, still polls, but its readings do not hold - the standbys back. + carries the new reading time, which tells every observer the repeater is fresh. Only readings + from a ranked observer with advert evidence, poller or standby, move that time. A poller + without evidence still polls, but its readings do not hold the standbys back. Evidence comes before health. An observer with advert evidence always ranks above one without, even when it reports misses. Within each group, an observer that reports 3 or more misses in a row @@ -179,10 +176,7 @@ and shows readings for room servers too, but the current polling firmware polls Only trusted readings are charted. A reading is trusted when its observer was assigned to the repeater and Beacon had itself heard the repeater directly through that observer when the reading -was stored. If Beacon had heard the repeater through none of its assigned observers, readings -from observers whose owner set the repeater as a target are trusted too; a repeater polled -through a [telemetry request](telemetry-requests.md) always needs the evidence. Readings from -any other observer are kept but left out of the charts. To see them, +was stored. Readings from any other observer are kept but left out of the charts. To see them, call the API with `include=untrusted`, for example `/api/v1/nodes/{nodeId}/telemetry?range=168h&include=untrusted`. The answer also says how many readings it left out. See the [API contract](api-contract.md#node-telemetry). @@ -272,8 +266,7 @@ approved are. See In both modes: - An observer without advert evidence never outranks one with it, and its readings never stand - down or get charted beside an observer that has it. They only count while no ranked observer - has evidence for the repeater. + anyone down. - Claims and readings are rate limited and capped in size per observer, including an hourly limit on readings across all its repeaters. - Each reading records how many other observers heard the repeater's reply. It is not checked @@ -296,8 +289,8 @@ are then dropped, and the election moves its repeaters to other observers. chain can use nearly all of that on an ESP32. See [An RSA certificate for the devices](#an-rsa-certificate-for-the-devices). - **The device polls but the charts stay empty.** Only trusted readings are charted, and a - reading is trusted only when its observer was assigned to the repeater and either Beacon had - advert evidence for the pair when the reading was stored, or no assigned observer had any. `GET /api/v1/admin/polling/targets` shows + reading is trusted only when its observer was assigned to the repeater and Beacon had advert + evidence for the pair when the reading was stored. `GET /api/v1/admin/polling/targets` shows each observer's rank and evidence. Add `include=untrusted` to the node telemetry request to see the readings that were left out. - **A repeater is never polled after a login.** It answered the device with admin access, so @@ -314,7 +307,7 @@ are then dropped, and the election moves its repeaters to other observers. lists the repeater. Check the observer sent a claim after its last `poll add`, and that it is not blocked. - **Standbys poll a repeater the poller already polls.** The poller has no advert evidence for - it and a standby does, so its readings do not count as fresh for the others. Once Beacon sees it hear the + it, so its readings do not count as fresh for the others. Once Beacon sees it hear the repeater's adverts directly, they do. In `approved` mode, check the poller is approved. - **Everything is paused.** Check `polling.paused`, then `GET /api/v1/admin/polling`. - **An old firmware is refused.** If `polling.min_client_version` is set, the policy tells From 37ce25b624ad0294b3c7ffaccfa5963d9230e99c Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 10:16:07 -0500 Subject: [PATCH 10/13] docs: Atlas card tags, icon tabs and the Poller tab --- docs/api-contract.md | 7 ++++--- docs/atlas.md | 32 ++++++++++++++++++++++++-------- docs/repeater-polling.md | 2 +- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/docs/api-contract.md b/docs/api-contract.md index cc4568b..b03a8e0 100644 --- a/docs/api-contract.md +++ b/docs/api-contract.md @@ -1020,7 +1020,7 @@ Public, no key. Counts against the normal rate limit and is sent with `Cache-Con ```json { "minAppVersion": "2.3.0", "minWebVersion": "2.3.0", "serverVersion": "2.3.0", - "features": { "polling": true, "accounts": "off", "registration": false, "telemetryRequests": false, "alerts": false, "alertChannels": { "email": false, "push": false }, "atlasTelemetry": true, "atlas7d": true, "mapTelemetry": true, "appDeviceLabel": true }, + "features": { "polling": true, "accounts": "off", "registration": false, "telemetryRequests": false, "alerts": false, "alertChannels": { "email": false, "push": false }, "atlasTelemetry": true, "atlasPoller": true, "atlas7d": true, "mapTelemetry": true, "appDeviceLabel": true }, "display": { "temperatureUnit": "c", "distanceUnit": "metric" }, "limits": { "atlas": 20 } } @@ -1048,6 +1048,7 @@ Swagger shows. Servers older than this endpoint return `404`. See | `alertChannels` | `{"email": bool, "push": bool}`: the channels this server sends alerts by. Always present. | | `push` | `{"server": "https://push.meshcorebeacon.ca", "pushId": "inst_…"}`: the push server the app gets a device handle from, and this server's Push ID there. Present only while `alertChannels.push` is true. See [Push delivery](#push-delivery). | | `atlasTelemetry` | True when the server accepts the `telemetry` Atlas view and `telemetryTiles` on node pins, and the `72h` [node telemetry](#node-telemetry) range. Always true on servers that have it. | +| `atlasPoller` | True when the server accepts the `poller` Atlas view on node pins. Always true on servers that have it. | | `atlas7d` | True when the server accepts the `7d` range on [`/me/atlas`](#atlas-sync). Always true on servers that have it. | | `mapTelemetry` | True when the server has [latest node telemetry](#latest-node-telemetry). Always true on servers that have it. It stays true when polling is off. A client shows its map telemetry toggle only when both `mapTelemetry` and `polling` are true. | | `appDeviceLabel` | True when `POST /auth/app/token` takes a `deviceLabel`. Always true on servers that have it. The app sends one only when this is true: an older server refuses the unknown field. | @@ -1067,7 +1068,7 @@ Swagger shows. Servers older than this endpoint return `404`. See The API itself stays in Celsius and metric whatever `display` says. Alert temperature limits are still stored and sent as tenths of a degree C. Clients convert for display. -A client must treat a missing `features`, as sent by an older server, as all off, a missing `registration` as `false`, and a missing `portalUrl` or `push` as none, a missing `alertChannels` as both off, a missing `atlasTelemetry` as `false`, a missing `atlas7d` as `false` (do not offer `7d` or send it; a saved `7d` Atlas shows and sends `3d`), a missing `mapTelemetry` as `false` (hide the toggle), a missing `appDeviceLabel` as `false`, a missing `display` as `c` and `metric`, and a missing `limits.atlas` as 12, the cap before it was configurable. A client that does not know an `accounts` value other than `"off"` and `"local"` should treat it as `"off"`. +A client must treat a missing `features`, as sent by an older server, as all off, a missing `registration` as `false`, and a missing `portalUrl` or `push` as none, a missing `alertChannels` as both off, a missing `atlasTelemetry` as `false`, a missing `atlasPoller` as `false` (keep a `poller` view local and do not send it), a missing `atlas7d` as `false` (do not offer `7d` or send it; a saved `7d` Atlas shows and sends `3d`), a missing `mapTelemetry` as `false` (hide the toggle), a missing `appDeviceLabel` as `false`, a missing `display` as `c` and `metric`, and a missing `limits.atlas` as 12, the cap before it was configurable. A client that does not know an `accounts` value other than `"off"` and `"local"` should treat it as `"off"`. Beacon Web calls `/info` on load and again when the tab regains focus (at most once a minute). When its own version is lower than `minWebVersion` it shows a full-screen "reload" screen instead of the @@ -1402,7 +1403,7 @@ client reads `168h` in hourly buckets: `/nodes/{id}/activity?range=168h`, and `/observers/{id}/activity`, `/observers/{id}/telemetry` and `/nodes/{id}/telemetry` with `range=168h&interval=1h`. A node pin has `publicKey` and `id`; an observer pin has `observerPublicKey`. `observerId` is the observer record with that key, or `null`. `tiles` (exactly -four distinct metric ids, see [Atlas](atlas.md#choosing-the-observer-tiles)) and `view` (`heard`, `observer` or `telemetry`, node pins only) are left out when not set. +four distinct metric ids, see [Atlas](atlas.md#choosing-the-observer-tiles)) and `view` (`heard`, `observer`, `telemetry` or `poller`, node pins only) are left out when not set. `telemetryTiles` (node pins only) is exactly four distinct ids from `battery`, `noise`, `uptime`, `airtime`, `temperature`, `packets`, `signal` and `errors`; it holds the Telemetry view's tiles, apart from `tiles`, which stay the Observer view's. It is left out when the default applies. A client diff --git a/docs/atlas.md b/docs/atlas.md index aab4fcf..c7e0374 100644 --- a/docs/atlas.md +++ b/docs/atlas.md @@ -12,7 +12,7 @@ card's kind, ID, last known name, card order and the activity window (24h, 3d or keeps the node's full public key and, when the node is also an observer, that observer's ID. A card whose Observer view tiles were changed also keeps its four tiles (see [Choosing the Observer tiles](#choosing-the-observer-tiles)), and a node card pinned to open on -**Heard by**, **Observer** or **Telemetry** keeps that tab (see +**Heard by**, **Observer**, **Telemetry** or **Poller** keeps that tab (see [The tab a card opens on](#the-tab-a-card-opens-on)). A node card whose Telemetry tiles were changed keeps those four tiles too. @@ -45,10 +45,15 @@ An observer saved on its own becomes a node card by itself once its radio starts ## Reading a card -A card's header is its name and badges, with icon buttons at the top right: the pin (on cards -with more than one view), an x that removes the card, and the drag grip. On a card with more -than one view, the Analytics / Heard by / Observer / Telemetry switch spans the card below the -header, showing only the views that card has. +A card's header is a status dot and its name, with icon buttons at the top right: the pin (on cards +with more than one view), an x that removes the card, and the drag grip. A node card has a tag for +its type, and Poller and Observer tags when the node has those roles. One tag sits beside the name; +two or more get a row of their own under it, so a long name is shortened rather than wrapped. + +On a card with more than one view, a row of tabs spans the card below the header, showing only the +views that card has: Analytics, Heard by, Observer, Telemetry and Poller. Every tab is an icon and +only the open one also shows its name, so the row fits a phone in any language. Hover or long-press +an icon for its name. The Analytics and Observer views end in a one-line footer. It never wraps: text that does not fit is cut short, and the info tip at its end lists every fact in full, with absolute times, followed @@ -75,8 +80,9 @@ that node over the selected window: - **Active hours**: hours in the window with at least one reception. - The footer has when the node was last seen on the left, and **Mean hops** (the average hop count of those receptions) and the node's neighbor count on the right. -- The **Recent** / **Stale** badge is the server's `stale` verdict; the client does not infer - online or offline. +- The dot before the name is green for recent and amber for stale. It is the server's `stale` + verdict; the client does not infer online or offline. On an observer card it is online or + offline. **Heard by** swaps the tiles for the observers of the node's most recently heard packet, with when it was heard and a link to open that packet in the analyzer. It is not lifetime reach. The card @@ -138,6 +144,16 @@ view's tiles. A new card shows battery, noise floor, uptime and airtime. Both th tiles are saved with the card as `view: "telemetry"` and `telemetryTiles`. A card pinned to Telemetry that loses the tab opens on Analytics. +A card for a node that is a poller (it has the Poller tag) gets a **Poller** tab on a server with +polling on, once the server has a polling claim for it. Its four tiles are fixed: **Slots** (how +many of its slots are used, split into its owner's own repeaters and requested ones, with a seat +meter), **Answering** (how many of the repeaters it holds report `ok`, with a dot for each), +**Readings** (readings Beacon received from it in the last 24 hours) and **Last claim** (when +Beacon last received its claim and whether it accepts requests). The footer says how many repeaters +it is the elected poller for and links to the node's Poller view. The tab is saved as +`view: "poller"`, only to a server that reports `features.atlasPoller`; on another server the +choice stays in the browser or app. A card pinned to Poller that loses the tab opens on Analytics. + A card with more than one view has a pin button in its header. The pin is pressed while the card shows the tab it opens on. Pressing it on another tab makes that the tab the card opens on, and the choice is saved with the card. @@ -187,7 +203,7 @@ picker ignores the field. different IDs, in tile order, from `battery`, `noise`, `uptime`, `airtime`, `temperature`, `packets`, `signal` and `errors`, left out for the default layout. -`view` is optional on a node card: `heard`, `observer` or `telemetry`, the tab the card opens +`view` is optional on a node card: `heard`, `observer`, `telemetry` or `poller`, the tab the card opens on, left out when that is Analytics. Any other value is dropped on import and the card is kept, opening on Analytics. A build from before the pin ignores the field. diff --git a/docs/repeater-polling.md b/docs/repeater-polling.md index 9486397..45b7bc8 100644 --- a/docs/repeater-polling.md +++ b/docs/repeater-polling.md @@ -183,7 +183,7 @@ 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 with the Poller tag also gets a Poller view on its node, beside Node and Observer, in Beacon Web and in the mobile app. It shows how many of its 8 slots are used (its owner's own repeaters and requested ones), how many are free, when Beacon last received its claim, and one row for each repeater it holds: whether it is the poller, a standby or not assigned, the state it reports, its last reply and SNR, and how many of the repeater's adverts Beacon heard through it. Anyone who can open the node can see this, including which repeaters are requested and a `login_failed` or `admin_stop` state. The API route is `GET /nodes/{nodeId}/poller`, see the [API contract](api-contract.md#node-poller). +An observer with the Poller tag also gets a Poller view on its node, beside Node and Observer, in Beacon Web and in the mobile app. It shows how many of its 8 slots are used (its owner's own repeaters and requested ones), how many are free, when Beacon last received its claim, and one row for each repeater it holds: whether it is the poller, a standby or not assigned, the state it reports, its last reply and SNR, and how many of the repeater's adverts Beacon heard through it. Anyone who can open the node can see this, including which repeaters are requested and a `login_failed` or `admin_stop` state. The observer's dashboard on the web shows the same under its summary, and an Atlas card for the node has a Poller tab, see [Atlas](atlas.md#the-tab-a-card-opens-on). The API route is `GET /nodes/{nodeId}/poller`, see the [API contract](api-contract.md#node-poller). A gap in a chart means there is no usable value for that series in that bucket. The cause can be the poll cadence (status values arrive every few hours), a field the repeater does not report, a counter that was inconsistent and was dropped, or a missed poll. It does not mean the repeater was down. From 5f1705da5c67d904fd930e7283de7ed75bb807a5 Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 10:39:48 -0500 Subject: [PATCH 11/13] docs: upgrade notes follow the withdrawn migration 088 and add 089 --- docs/upgrading.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index 97d6f46..255e55d 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -156,11 +156,11 @@ banned address could still reach the site over HTTP/3. ## Upgrading to 2.3.0 from 2.2.0 -This release adds migrations `064` to `088` (polling, user accounts, telemetry requests, alert rules, their channels and outbox, an Atlas telemetry view and the Atlas 7 day -range). They run at startup and +This release adds migrations `064` to `087` and `089` (polling, user accounts, telemetry requests, alert rules, their channels and outbox, an Atlas telemetry view, the Atlas 7 day +range and the Atlas poller view). There is no `088`. They run at startup and are quick: new tables, a few small columns, and four indexes built `CONCURRENTLY` (`066`, `080`, `081`, `082`) on tables this release creates, so they start empty. On the project's test server the -whole set took seconds. The only data migrations are `065` and `088`, which mark readings of the still empty +whole set took seconds. The only data migrations are `065`, which marks readings of the empty `repeater_readings` table, `073`, which removes duplicate rows from the still empty `user_devices` table, `078`, which copies one drift row per node into a new table, and `084` and `085`, which touch only alert tables that are still empty on a 2.2.0 database. @@ -222,9 +222,6 @@ before the release starts: shared columns. A notice queued before it keeps its attempts and retry time for push, and its mail, if not sent yet, starts with no attempts and is tried at once. A build from before `085` cannot read the outbox after it, so going back to one is not supported. -- **Readings.** Nothing to do. Migration `088` marks stored readings of a repeater an observer polls - on its own as trusted where no assigned observer has advert evidence for it, so charts that were - empty can fill in after the upgrade. See [Trust](repeater-polling.md#trust). ## Upgrading to 2.1 From a21604efd15b6d2bbb113454e0c07a39aec185cf Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 17:55:42 -0500 Subject: [PATCH 12/13] docs: Atlas edit mode, evidence window in the contract, plainer polling and upgrade wording --- app_config/config.yaml.example | 2 +- docs/accounts.md | 2 +- docs/api-contract.md | 4 ++-- docs/atlas.md | 35 ++++++++++++++++++---------------- docs/repeater-polling.md | 28 +++++++++++++++++++-------- docs/security.md | 2 +- docs/upgrading.md | 20 +++++++++---------- 7 files changed, 54 insertions(+), 39 deletions(-) diff --git a/app_config/config.yaml.example b/app_config/config.yaml.example index c5df153..6456c75 100644 --- a/app_config/config.yaml.example +++ b/app_config/config.yaml.example @@ -453,7 +453,7 @@ cache: # paused: false # true tells every observer to stop polling, without turning the feature off # authority: evidence # who can be chosen to poll. evidence: any observer, ranked by how well Beacon # # has heard the repeater through it. approved: only observers you approve -# evidence_window: 168h # how far back a repeater's zero-hop adverts count as proof an observer hears +# evidence_window: 168h # how far back a repeater's zero-hop adverts count as evidence that an observer hears # # it; 24h to 720h. Adverts older than packets.retention are gone either way # # # Telemetry requests: signed-in users ask for a repeater to be polled. They also need accounts on diff --git a/docs/accounts.md b/docs/accounts.md index 419b114..d36087d 100644 --- a/docs/accounts.md +++ b/docs/accounts.md @@ -43,7 +43,7 @@ In the Docker stacks that is the `.env` of the host that runs the server. Then r | Key | Default | What it does | |---|---|---| -| `mode` | `off` | `off` or `local`. Anything else stops startup. The rest of the block is not checked while this is `off`. | +| `mode` | `off` | `off` or `local` (`portal` is for the project's own instance, see [Configuration](configuration.md#user-accounts)). Anything else stops startup. The rest of the block is not checked while this is `off`. | | `public_url` | none | Required when `mode` is `local`. The address people use for the web app: `http` or `https`, no path, query, fragment or credentials. Plain `http` is allowed only for `localhost` and `127.0.0.1`. Every link in a mail is built from it, never from a request header. | | `registration` | `open` | `open` or `closed`. When closed, `POST /auth/register` answers `403 registration_closed` and `features.registration` is `false`. People who already have an account keep signing in. | | `mail.host` | none | Required. | diff --git a/docs/api-contract.md b/docs/api-contract.md index b03a8e0..dc4e845 100644 --- a/docs/api-contract.md +++ b/docs/api-contract.md @@ -590,7 +590,7 @@ The other side of [Node polling](#node-polling): what an observer that polls say |---|---| | `claim` | The observer's last stored claim, or `null` when it has none. | | `claim.receivedAt` | When Beacon received it, epoch ms. | -| `claim.live` | True while the claim is within its 65 minutes. A claim is kept for about a day after that, so `false` means the observer has stopped claiming. `isPoller` on the node does not check this. | +| `claim.live` | True while the claim is under 65 minutes old. A claim is kept for about a day after that, so `false` means the observer has stopped claiming. `isPoller` on the node does not check this. | | `claim.acceptsRequests` | The observer takes repeaters handed out by [telemetry requests](#telemetry-requests). | | `claim.slots` | `max` is the most repeaters one observer holds (8). `used` is how many the claim lists, split into `own` (set up by the observer's owner) and `requested`. `free` is the free seats the claim reported, never more than `max` minus `used`. `used` plus `free` can be less than `max`. | | `readings24h` | Readings Beacon received from this observer in the last 24 hours, trusted or not. | @@ -608,7 +608,7 @@ Each target: | `misses` | Failed polls in a row. | | `lastAttempt`, `lastOk` | Epoch ms, or `null` when never. | | `claimedSnr` | The SNR the observer reports for the repeater, or `null`. | -| `evidenceSnr`, `evidenceCount` | Zero-hop adverts of the repeater that Beacon saw through this observer in the day before the last election: their mean SNR and how many. `null` and `0` for an unassigned repeater or one with no such adverts. | +| `evidenceSnr`, `evidenceCount` | Zero-hop adverts of the repeater that Beacon saw through this observer within `polling.evidence_window` (7 days by default) before the last election: their mean SNR and how many. `null` and `0` for an unassigned repeater or one with no such adverts. | | `latestReadingAt` | `sampledAt` of the newest reading this observer delivered for the repeater, trusted or not. `null` when it has delivered none. | #### MeshMapper repeater details diff --git a/docs/atlas.md b/docs/atlas.md index c7e0374..411e85c 100644 --- a/docs/atlas.md +++ b/docs/atlas.md @@ -45,13 +45,16 @@ An observer saved on its own becomes a node card by itself once its radio starts ## Reading a card -A card's header is a status dot and its name, with icon buttons at the top right: the pin (on cards -with more than one view), an x that removes the card, and the drag grip. A node card has a tag for -its type, and Poller and Observer tags when the node has those roles. One tag sits beside the name; -two or more get a row of their own under it, so a long name is shortened rather than wrapped. - -On a card with more than one view, a row of tabs spans the card below the header, showing only the -views that card has: Analytics, Heard by, Observer, Telemetry and Poller. Every tab is an icon and +A card's header is a status dot and its name, with icon buttons at the top right: one that opens +the node on the tab the card is showing, and the alert bell on a server with alerts. Press **Edit +cards** in the toolbar and those are replaced by the pin (on cards with more than one tab), the drag +grip and an x that removes the card, and the cards get a dashed border until you press Done. A node +card has a tag for its type, and Poller and Observer tags when the node has those roles. One tag +sits beside the name; two or more, or one on a narrow card, get a row of their own under it, so a +long name is shortened rather than wrapped. + +On a card with more than one tab, a row of tabs spans the card below the header, showing only the +tabs that card has: Analytics, Heard by, Observer, Telemetry and Poller. Every tab is an icon and only the open one also shows its name, so the row fits a phone in any language. Hover or long-press an icon for its name. @@ -144,30 +147,30 @@ view's tiles. A new card shows battery, noise floor, uptime and airtime. Both th tiles are saved with the card as `view: "telemetry"` and `telemetryTiles`. A card pinned to Telemetry that loses the tab opens on Analytics. -A card for a node that is a poller (it has the Poller tag) gets a **Poller** tab on a server with -polling on, once the server has a polling claim for it. Its four tiles are fixed: **Slots** (how +On a server with polling on, a card for a node with the Poller tag gets a **Poller** tab, once the +node is linked to its observer. Its four tiles are fixed: **Slots** (how many of its slots are used, split into its owner's own repeaters and requested ones, with a seat meter), **Answering** (how many of the repeaters it holds report `ok`, with a dot for each), **Readings** (readings Beacon received from it in the last 24 hours) and **Last claim** (when Beacon last received its claim and whether it accepts requests). The footer says how many repeaters -it is the elected poller for and links to the node's Poller view. The tab is saved as +it is the elected poller for. The card's open button opens the node on its Poller view. The tab is +saved as `view: "poller"`, only to a server that reports `features.atlasPoller`; on another server the choice stays in the browser or app. A card pinned to Poller that loses the tab opens on Analytics. -A card with more than one view has a pin button in its header. The pin is pressed while the card -shows the tab it opens on. Pressing it on another tab -makes that the tab the card opens on, and the choice is saved with the card. +In edit mode a card with more than one tab shows a pin. It is lit on the tab the card opens on. +Press it on another tab to make the card open there; the choice is saved with the card. Switching tabs without pressing the pin is temporary: only one card at a time is away from the tab it opens on, so switching a tab on another card sends the first one back. A card pinned to Observer whose node has no observer link opens on Analytics; the pin is kept -and applies again once the link is there. An observer card has one view and no pin. When an +and applies again once the link is there. An observer card has one tab and no pin. When an observer card becomes a node card, it keeps opening on Observer. ## Arranging cards -Drag the grip at the top right of a card to another slot (mouse or touch). With the grip focused, +In edit mode, drag the grip at the top right of a card to another slot (mouse or touch). With the grip focused, the arrow keys move it one slot; Up and Down work too, since a phone shows one column. The order is saved with the rest of the collection. @@ -238,7 +241,7 @@ mobile app show the same cards. Signed out, nothing changes and the local copy i The routes are in the [API contract](api-contract.md#atlas-sync). -## Polling +## Refresh Cards refresh once a minute while the tab is open and the browser tab is visible. A node card's observer data loads only while its **Observer** view is open. Polling pauses while the server is diff --git a/docs/repeater-polling.md b/docs/repeater-polling.md index 45b7bc8..53ad20e 100644 --- a/docs/repeater-polling.md +++ b/docs/repeater-polling.md @@ -18,10 +18,9 @@ for where the readings show up. answer (`GET /api/guest-polling/owners`). Until it has a policy it neither polls nor reports. 3. The observer publishes a claim to the MQTT broker, listing its targets and how its last polls went. -4. Every minute Beacon ranks the observers that claimed each repeater. Observers it saw hear the - repeater's zero-hop adverts in the last 7 days (advert evidence, `polling.evidence_window`) - come first, by mean SNR, - then by number of adverts. Observers without evidence come after, by the signal they claim. +4. Every minute Beacon ranks the observers that claimed each repeater. Observers that Beacon saw hear + the repeater's zero-hop adverts come first, by mean SNR and then by number of adverts. This is + advert evidence. It counts adverts from the last 7 days (`polling.evidence_window`). Observers without evidence come after, by the signal they claim. One observer is the poller. The others are standbys. With `polling.authority: approved` only observers you approved take part (see [Trust](#trust)). 5. The observer reads its role from the owners answer. The poller asks the repeater when the @@ -79,7 +78,8 @@ Caddy, see [RSA certificate for observers](reverse-proxy.md#rsa-certificate-for- The device must be an ESP32 board with PSRAM running the MeshCore repeater observer firmware with repeater polling, with the MQTT bridge on, publishing to a broker Beacon reads. The polling firmware is in the [observer flasher](https://observer.gessaman.com): pick the version tagged -`-poll` when you flash. It is a test build and is still in testing. The room server firmware has no polling. On the device: +`-poll` when you flash. It is still a test build. +The room server firmware has no polling. On the device: ```text set poll.url https://beacon.example.com @@ -124,7 +124,7 @@ Some limits are built into the observer firmware and the server. They have no se | Observers assigned to one requested repeater | 3: one poller and two standbys. | | Repeaters an operator can exclude | 16, across the config and the admin route. | -There is no setting for how many repeaters Beacon gives one observer. A requested repeater is only +A requested repeater is only handed to an observer that reports a free seat, so an observer whose owner filled all 8 takes no requests. To change how much polling happens, use these instead (see [Configuration](configuration.md#repeater-polling)): @@ -183,7 +183,19 @@ 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 with the Poller tag also gets a Poller view on its node, beside Node and Observer, in Beacon Web and in the mobile app. It shows how many of its 8 slots are used (its owner's own repeaters and requested ones), how many are free, when Beacon last received its claim, and one row for each repeater it holds: whether it is the poller, a standby or not assigned, the state it reports, its last reply and SNR, and how many of the repeater's adverts Beacon heard through it. Anyone who can open the node can see this, including which repeaters are requested and a `login_failed` or `admin_stop` state. The observer's dashboard on the web shows the same under its summary, and an Atlas card for the node has a Poller tab, see [Atlas](atlas.md#the-tab-a-card-opens-on). The API route is `GET /nodes/{nodeId}/poller`, see the [API contract](api-contract.md#node-poller). +An observer with the Poller tag also has a Poller view on its node, beside Node and Observer, in +Beacon Web and the mobile app. It shows: + +- how many of its 8 slots are used, split into its owner's repeaters and requested ones, and how + many are free +- when Beacon last received its claim +- one row for each repeater: poller, standby or not assigned, the state it reports, its last reply + and SNR, and how many of the repeater's adverts Beacon heard through it + +Anyone who can open the node sees this, including which repeaters are requested and a +`login_failed` or `admin_stop` state. On the web the observer's dashboard shows the same, and an +Atlas card for the node has a Poller tab, see [Atlas](atlas.md#the-tab-a-card-opens-on). The route +is `GET /nodes/{nodeId}/poller`, see the [API contract](api-contract.md#node-poller). A gap in a chart means there is no usable value for that series in that bucket. The cause can be the poll cadence (status values arrive every few hours), a field the repeater does not report, a counter that was inconsistent and was dropped, or a missed poll. It does not mean the repeater was down. @@ -195,7 +207,7 @@ Otherwise they answer `503`. The same shapes are in the [API contract](api-contr | Route | What it does | |---|---| -| `GET /api/v1/admin/polling` | Returns the pause state, the excluded repeaters and every observer with a flag set. `paused` turns `false` once `pausedUntil` has passed. `configPaused`, `configExcludedNodes` and `authority` show `polling.paused`, `polling.excluded_nodes` and `polling.authority` from the config. | +| `GET /api/v1/admin/polling` | Returns the pause state, the excluded repeaters and every observer with a flag set. `paused` turns `false` once `pausedUntil` has passed. `configPaused`, `configExcludedNodes` and `authority` show `polling.paused`, `polling.excluded_nodes` and `polling.authority` from the config, and `evidenceWindowSeconds` shows `polling.evidence_window`. | | `GET /api/v1/admin/polling/targets` | Lists up to 500 repeaters, newest claim first, with every observer that claims each one, its rank (`null` when it has none), its advert evidence, whether you approved it, its state and misses, and the newest trusted and newest overall reading times. Use it to see who polls what. | | `PUT /api/v1/admin/polling/state` | Replaces the pause state and the excluded repeaters. | | `PUT /api/v1/admin/polling/observers/{publicKey}` | Replaces one observer's `blocked`, `approved` and `note`. | diff --git a/docs/security.md b/docs/security.md index ca43f7c..cf530ce 100644 --- a/docs/security.md +++ b/docs/security.md @@ -158,6 +158,6 @@ if you enable it, contains everything the database holds, so keep archives priva ## Secrets in files `.env` holds the database password, broker credentials, admin key, MeshMapper API key, and, when those -features are on, `BEACON_SECRET_KEY` and `BEACON_SMTP_PASSWORD`. It is gitignored in +features are on, `BEACON_SECRET_KEY`, `BEACON_PUSH_SECRET` and `BEACON_SMTP_PASSWORD`. It is gitignored in the deployment folders; keep it that way, and keep its permissions tight on the host. `data/app/config.yaml` holds channel keys. Neither belongs in a public backup. diff --git a/docs/upgrading.md b/docs/upgrading.md index 255e55d..d1dff7d 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -156,9 +156,9 @@ banned address could still reach the site over HTTP/3. ## Upgrading to 2.3.0 from 2.2.0 -This release adds migrations `064` to `087` and `089` (polling, user accounts, telemetry requests, alert rules, their channels and outbox, an Atlas telemetry view, the Atlas 7 day -range and the Atlas poller view). There is no `088`. They run at startup and -are quick: new tables, a few small columns, and four indexes built `CONCURRENTLY` (`066`, `080`, +This release adds migrations `064` to `087` and `089`; there is no `088`. They cover polling, user +accounts, telemetry requests, alerts and three Atlas additions (the telemetry view, the 7 day range +and the poller view). They run at startup and are quick: new tables, a few small columns, and four indexes built `CONCURRENTLY` (`066`, `080`, `081`, `082`) on tables this release creates, so they start empty. On the project's test server the whole set took seconds. The only data migrations are `065`, which marks readings of the empty `repeater_readings` table, `073`, which removes duplicate rows from the still empty `user_devices` @@ -173,8 +173,8 @@ more time and disk on a larger database. One default changes for everyone: observer telemetry is now stored every 15 minutes instead of hourly, so battery and noise alerts react in about half an hour and the 24 hour charts are finer. A `config.yaml` copied from an older template still says `resolution: 1h` under `telemetry`, and -that value wins. Change it to `15m`, or remove the line, to get the new behaviour. It stores about -four times as many observer snapshots as hourly; see +that value wins. Change it to `15m` or remove the line to get the new default. 15 minutes stores about +four times as many observer snapshots as `1h`; see [`config.yaml.example`](../app_config/config.yaml.example) for the trade-off. Every new feature is off by default, so apart from that an upgrade with no config change behaves @@ -187,16 +187,16 @@ as before: | Telemetry requests | polling and accounts on, and `polling.requests_per_user` not `0` (default `6`) | `BEACON_SECRET_KEY` | | Alerts | `alerts.email.enabled` and/or `alerts.push.enabled` with `alerts.push.id`, with accounts on (email needs `local` mode) | `BEACON_PUSH_SECRET` for push | -Telemetry requests hand guest passwords to observers. Each password is encrypted for the one -observer assigned to that repeater, using that observer's public key, and is stored encrypted on the -server under `BEACON_SECRET_KEY`. The observer has to decrypt it to log in, so only guest passwords -are accepted. By default any observer with advert evidence +Telemetry requests hand guest passwords to observers. Each password is sealed separately for each +observer assigned to the repeater (at most three), with that observer's public key, and is stored +encrypted on the server under `BEACON_SECRET_KEY`. The observer has to open it to log in, so users +must enter guest passwords only. By default any observer with advert evidence for the repeater can receive one; set `polling.request_observers: approved` to choose who does (see [Approve observers](telemetry-requests.md#approve-observers)). Secrets go in `.env`; see [`.env.example`](../app_config/.env.example). The full settings are in [Configuration](configuration.md), and each feature has its own page: [Repeater polling](repeater-polling.md), [User accounts](accounts.md), -[Telemetry requests](telemetry-requests.md) and [Alerts](alerts.md). +[Requested telemetry](telemetry-requests.md) and [Alerts](alerts.md). Both client floors rise to 2.3.0. Beacon Web builds older than 2.3.0 show a reload screen, because they lack the alert channel switches. BEACON Mobile builds older than 2.3.0 show an update screen, From 02ce72c4993615b27cc562481df4ec4732c6e90c Mon Sep 17 00:00:00 2001 From: MrAlders0n Date: Fri, 27 Nov 2026 20:10:20 -0500 Subject: [PATCH 13/13] docs: free seats, reboot rows and raw telemetry points as the server now has them --- app_config/config.yaml.example | 2 +- docker-deployment-type1/data/app/config.yaml | 2 +- docker-deployment-type2/server/data/app/config.yaml | 2 +- docs/alerts.md | 2 +- docs/api-contract.md | 9 ++++++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app_config/config.yaml.example b/app_config/config.yaml.example index 6456c75..693ec18 100644 --- a/app_config/config.yaml.example +++ b/app_config/config.yaml.example @@ -279,7 +279,7 @@ telemetry: retention: 744h # 31 days # How often an observer's status is stored as a snapshot (default 15m). Observers report # every 5 minutes by default; reports inside one window are dropped, except the first after - # a reboot. Observer alerts and charts read these snapshots: + # a reboot (one per window). Observer alerts and charts read these snapshots: # - battery and noise alerts need two snapshots in a row, so they react after about two windows # - a shorter window stores more rows (5m is about 3x the rows of 15m, 1h about a quarter) # - below the observers' report interval nothing more is stored diff --git a/docker-deployment-type1/data/app/config.yaml b/docker-deployment-type1/data/app/config.yaml index eed7ec0..86862cc 100644 --- a/docker-deployment-type1/data/app/config.yaml +++ b/docker-deployment-type1/data/app/config.yaml @@ -254,7 +254,7 @@ telemetry: retention: 744h # 31 days # How often an observer's status is stored as a snapshot (default 15m). Observers report # every 5 minutes by default; reports inside one window are dropped, except the first after - # a reboot. Observer alerts and charts read these snapshots: + # a reboot (one per window). Observer alerts and charts read these snapshots: # - battery and noise alerts need two snapshots in a row, so they react after about two windows # - a shorter window stores more rows (5m is about 3x the rows of 15m, 1h about a quarter) # - below the observers' report interval nothing more is stored diff --git a/docker-deployment-type2/server/data/app/config.yaml b/docker-deployment-type2/server/data/app/config.yaml index eed7ec0..86862cc 100644 --- a/docker-deployment-type2/server/data/app/config.yaml +++ b/docker-deployment-type2/server/data/app/config.yaml @@ -254,7 +254,7 @@ telemetry: retention: 744h # 31 days # How often an observer's status is stored as a snapshot (default 15m). Observers report # every 5 minutes by default; reports inside one window are dropped, except the first after - # a reboot. Observer alerts and charts read these snapshots: + # a reboot (one per window). Observer alerts and charts read these snapshots: # - battery and noise alerts need two snapshots in a row, so they react after about two windows # - a shorter window stores more rows (5m is about 3x the rows of 15m, 1h about a quarter) # - below the observers' report interval nothing more is stored diff --git a/docs/alerts.md b/docs/alerts.md index 4301084..6bcee52 100644 --- a/docs/alerts.md +++ b/docs/alerts.md @@ -52,7 +52,7 @@ assignment right now; the user is told to request telemetry for it first (see | `clock` | repeaters, room servers | Seconds of drift: 300, 3600 or 86400. Fires after two adverts in a row beyond it. Beacon keeps the drift of each repeater's last 16 adverts, so a breach that came and went between two passes still fires once. | | `battery_low` | with a battery reading | Millivolts, 2500 to 5000. | | `battery_falling` | with a battery reading | Millivolts per day: 100, 200 or 300. | -| `rebooted` | with an uptime reading | None. Notifies on each new reboot seen. Every reading since the rule's last pass is examined, not only the newest few. | +| `rebooted` | with an uptime reading | None. Notifies on each new reboot seen. Every reading since the rule's last pass is examined, not only the newest few. An observer's reboot is stored as soon as it reports, at most once per `telemetry.resolution` window, so a radio in a boot loop notifies about once per window, not once per boot. | | `temperature` | with a temperature reading | Tenths of a degree C, -500 to 1500. A low limit (`threshold`), a high limit (`thresholdHigh`) or both; low must be below high. With both set on a rule that is on, the high limit must be at least 20 tenths (2.0 degrees C) above the low one, or the change is refused with `422 invalid_threshold`; a rule being turned off is not held to it. | | `noise_high` | with a noise floor reading | dBm, -130 to -50. | | `observer_offline` | observers | Minutes without a status report: 30, 60, 180 or 360. | diff --git a/docs/api-contract.md b/docs/api-contract.md index dc4e845..b29497f 100644 --- a/docs/api-contract.md +++ b/docs/api-contract.md @@ -592,7 +592,7 @@ The other side of [Node polling](#node-polling): what an observer that polls say | `claim.receivedAt` | When Beacon received it, epoch ms. | | `claim.live` | True while the claim is under 65 minutes old. A claim is kept for about a day after that, so `false` means the observer has stopped claiming. `isPoller` on the node does not check this. | | `claim.acceptsRequests` | The observer takes repeaters handed out by [telemetry requests](#telemetry-requests). | -| `claim.slots` | `max` is the most repeaters one observer holds (8). `used` is how many the claim lists, split into `own` (set up by the observer's owner) and `requested`. `free` is the free seats the claim reported, never more than `max` minus `used`. `used` plus `free` can be less than `max`. | +| `claim.slots` | `max` is the most repeaters one observer holds (8). `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. | | `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. | @@ -687,9 +687,12 @@ Before, it came from the last status message and was missing when the last row h walk by `cursor` skipped most observers. Paging by `cursor` alone can still skip observers that share a millisecond (presence updates often stamp many at once); `pageCursor` reaches all of them. -Telemetry response is a time-bucketed array suitable for direct chart consumption. `airtimeTxSecs` and +The telemetry response is an array ordered by time. `interval=1h` returns the stored snapshots as they +are: one per `telemetry.resolution` window (15 minutes by default), plus one stored at once when the +observer reboots, so points are not evenly spaced. `6h` and `24h` return buckets. `airtimeTxSecs` and `airtimeRxSecs` are seconds of radio time as reported by the observer: cumulative since boot on -`interval=1h` points, and the per-bucket delta on `6h`/`24h`. Divide by the bucket length for a percentage. +`interval=1h` points, and the per-bucket delta on `6h`/`24h`. For a percentage, divide by the time +between two points on `1h`, or by the bucket length on `6h`/`24h`. Fields the observer did not report are omitted. ```json