Commit Graph
24 Commits
Author SHA1 Message Date
efiten eab6eb5fc1 android: turn on R8 and send its mapping file to Play
Play Console flagged the bundle: DEX optimisation low, obfuscation 1%, no deobfuscation
file, no native debug symbols. Release builds now run R8 with resource shrinking and put
the native symbol table in the bundle; play-upload.mjs --mapping uploads mapping.txt.
Release APK 6.45 MB -> 3.35 MB. Capacitor's consumer rules keep every plugin class: the
seven plugins, MainActivity and AlwaysVisibleWebView keep their names in mapping.txt.
2026-11-11 21:58:27 +01:00
efiten 158120ec06 scripts: upload a signed bundle to a Play test track as a draft
Uses a service account key outside the repo and node:crypto for the OAuth JWT, so no new
dependency. The draft keeps the track's live release (tracks.update replaces the whole
list) and replaces an older draft. Release notes are the summary line of
docs/releases/vX.Y.Z.md, checked against Play's 500-character limit. An edit that is not
committed is deleted so it cannot block the next run.

Verified against Play: 'tracks' lists alpha with 12403 (1.24.3) completed. Not yet
verified: an actual upload, which needs a new versionCode.
2026-11-11 19:55:55 +01:00
efiten 65de1920f9 feat(native): choose the deployment at runtime instead of baking config.json into the APK
The APK carried the config.json that happened to be in public/ at build time, so
every APK belonged to one deployment, and a real one would have put the broker
login inside the file.

The native app now asks for the URL of a CoreDrive RX web deployment under
Settings and reads that deployment's config.json through CapacitorHttp, outside
the WebView, so the deployment needs no CORS header for it. A new URL is checked
before it replaces the old one. The last good config of the same deployment is
kept in localStorage and used when a start has no network; a different
deployment drops it. android:sync removes config.json from the APK assets.

- src/deployment.js: URL normalization (https only), fetch + validate + cache
- src/config.js: setConfigSource and parseConfigText, fetch path unchanged
- test/deployment.test.mjs: 11 tests (460 total pass)
- web build checked headless: appver filled, Deployment card hidden

Not tested on a device yet.
2026-11-10 09:04:56 +01:00
efitenandClaude Opus 5.5 9c30eef3ac build(android): Capacitor Android project and build notes
npx cap add android with appId eu.on8ar.coredriverx and
android.useLegacyBridge (the background-geolocation README: without it
updates stop after 5 minutes in the background). Manifest adds location,
POST_NOTIFICATIONS and Bluetooth permissions, BLUETOOTH_SCAN declared
neverForLocation. Copied web assets (including config.json) stay out of
git via the generated android/.gitignore. `npm run android:sync` builds
and copies dist/ into the project; README has the steps.

Not built: this machine has JDK 8 and no Android SDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:46:22 +01:00
efitenandClaude Opus 5.5 ada73093a0 docs: user guide for people driving with the app
The README is written for sysops hosting the app. Users asked whether it is a
mapper, whether they can still chat, and whether there is a wiki. The guide
answers those: what is recorded, what the app transmits (discover, region
asks, uplink ping), the one-BLE-connection limit, the screens, the
stationary pause, and a short troubleshooting table. README links to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:16:58 +01:00
efitenandClaude Opus 5.5 cfce8fc7eb docs(readme): ACL allows meshcore/client/${clientid}/#
The README listed /packets, /rf and /regions only. The app also
publishes /names (nodeNames) and /uplink (uplinkPing). The section now
recommends the /# rule and lists all five subtopics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NEgJ9U9V5WmHyRjL96MaDz
2026-10-23 09:19:50 +02:00
efitenandClaude Opus 5.5 5a4319736e fix(account): a linked companion no longer goes to My nodes
CoreScope stopped adding linked companions to My nodes (a companion is
not a node to monitor), and its link answer has no myNodes field any
more. The card and the log no longer mention My nodes, and an answer
from an earlier server build that still carries the field is ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:39:53 +02:00
efitenandClaude Opus 5.5 270b63dc0b release: v1.19.0, CoreScope login and companion linking
Minor: the MQTT payload contract is unchanged. SW cache v54. Optional
corescopeUrl. Release notes in docs/releases/v1.19.0.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:12:27 +02:00
efitenandClaude Opus 5 d2e2573375 feat: verify advert signatures before an identity reaches CoreScope (closes #11)
An Advert's Ed25519 signature is the only cryptographic proof of identity MeshCore
offers. Everything else is plaintext and attacker-chosen: pubkey, name and self-reported
position are whatever the sender wrote, and hop counts, paths and prefixes carry no MAC.
The capture rule in this repo covers provenance, not authenticity, so a 0-hop advert can
be genuinely heard direct and still name a node that does not exist. Adverts captured
here are published to CoreScope, the registry the name resolvers read from, so one
forgery heard by one driver becomes a named node on someone else's screen.

parsePacket now returns advertSig: the pubkey, the signature and the exact message the
firmware signs, which is pubkey(32) || timestamp(4, LE) || app_data with app_data
truncated to MAX_ADVERT_DATA_SIZE (meshcore-firmware src/Mesh.cpp:271-280 verifies what
:404-437 signed, cap at src/MeshCore.h:12). The timestamp goes in as the raw wire bytes,
not the parsed advertTs, so no re-encoding can disagree with what was received. Getting
the 32-byte cap wrong would make every long advert look forged, so the fixture test
covers it, and the real captured advert already in the fixtures verifies against its own
signature, which is what proves the construction rather than asserting it.

src/advertsig.js does the crypto and nothing else. Verification is async: @noble/ed25519
needs a hash and only the async path has one without extra wiring. The capture handler
was already async. A forged advert can carry a pubkey or signature that is not a valid
curve point, which noble rejects by throwing, so that is caught and read as a failed
verification rather than taking the capture path down.

A failed check drops the identity and keeps the reception. The SNR and RSSI measured at
that position are real whoever wrote the advert; only the name attached to them is
worthless, and discarding the row would lose genuine coverage. This is deliberately
narrower than core-hunter, which refuses the whole reception (efiten/core-hunter#356),
because that repo is about identity and this one is about coverage. As a side effect the
node stops being a region-discovery candidate, so the app never sends an anonymous
request to an address somebody invented.

verifyAdverts is off unless config.json says otherwise, and is listed false in
FEATURE_DEFAULTS as well as NO_CONFIG_DEFAULTS. It is the only flag that makes the app
record less than it heard, and inheriting that silently would look like adverts going
missing. The exported log header reports it next to the other three, because "no advert
in the capture" and "advert rejected" are otherwise the same silence.

Not done: no Settings UI for the flag, config.json only, matching the other three. The
gate is not exercised against a forged advert on real hardware, only against fixtures
and a signed synthetic advert.

New dependency: @noble/ed25519 3.2.0. Bundle 435.17 kB -> 442.78 kB (gzip 136.22 ->
139.71).

Tests: 255 pass (+16). SW cache v39 -> v40.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Manrn3qdrTJFz3C4o9PPFL
2026-09-09 17:55:29 +02:00
Erwin FitenandClaude Opus 5 75e1145fae docs: the EMQX ACL section only ever allowed /packets
The setup instructions told sysops to allow publish on
meshcore/client/${clientid}/packets and deny everything else, while the flag
documentation further down says /rf and /regions each need their own ACL entry.
Anyone following section 2 ends up with two of the three topics denied - and since
v1.11.0 the flags default to on, the client will try regardless.

That matters more than a dropped message: with EMQX's default
authorization.deny_action=ignore the publish is silently discarded and still
PUBACKed, so the app logs "published N record(s)" while the server stores nothing.
With deny_action=disconnect the broker kicks the client instead, giving an endless
connect->drop->reconnect loop and a queue that never drains.

All three subtopics are now listed in the setup step, with a note on what a denied
publish actually does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 08:52:35 +02:00
Erwin FitenandClaude Opus 5 8d6254f8ce feat(config): regionDiscovery defaults ON in an existing config, OFF with none
Completes the default-on change. The transmitting feature's default now depends on
WHERE the silence comes from, which is the distinction that makes it safe:

- an absent key in a config.json that EXISTS -> on. That file is a deployment whose
  operator owns the repeaters being asked, and this is exactly the case that bit us:
  a config predating the key silently reported the feature off.
- no config loaded at all -> off. The app then knows nothing about whose mesh it is
  on, and repeaters rate-limit anonymous requests to 4 per 180s shared across every
  requester and type, so one client asking once a minute claims most of that budget.
  Collecting on an assumption spends our own bandwidth; transmitting on one spends a
  stranger's airtime.

FEATURE_DEFAULTS / NO_CONFIG_DEFAULTS make that split explicit, and every
regionDiscovery gate in app.js now goes through featureEnabled() so "which default
applies" has exactly one answer, in config.js. Those gates read
`!cfg || !cfg.regionDiscovery`, which happened to be equivalent for a normalized
config but restated the policy in five places.

Tests: 220 pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 09:53:19 +02:00
Erwin FitenandClaude Opus 5 89565ff1f9 feat(config): the two logging flags default ON; collect even with no config
Goal: never lose a window of coverage data to a config problem. Data that was
never collected is gone for good; data collected and discarded server-side costs
only bandwidth.

Two separate changes, because they cover two different failures:

- normalizeConfig: an ABSENT fullRfLog/rfSampler key now means on. A config.json
  written before those keys existed reported both off while the served file said
  on - indistinguishable from the features being broken. An explicit `false`
  still wins.
- featureEnabled(cfg, name): resolves a flag when there is NO config at all. Every
  gate read `!cfg || !cfg.X`, i.e. "we do not know yet" == "off", so a failed
  config fetch stopped data collection on top of stopping uploads. The app now
  keeps capturing on defaults and the queue publishes once config arrives.

regionDiscovery deliberately still defaults to false. It is the only feature that
transmits, against third-party repeaters that rate-limit anonymous requests to 4
per 180s shared across every requester and type - one client asking once a minute
already claims most of that budget. Spending someone else's airtime on an
assumption is not a default.

The exported log header now names the defaults in force when no config loaded, so
a reader can tell what is in the queued records without guessing.

Documented in the README together with the two standing warnings that make this a
real trade: fullRfLog multiplies upload volume and is discarded unless the
ingestor has clientRxObservations.enabled, and an rfSampler publish denied by the
broker ACL is still PUBACKed, so it looks healthy while the server stores nothing.
config.example.json updated to match the new defaults.

Tests: 220 pass (+3).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 09:49:51 +02:00
Erwin FitenandClaude Opus 5 229bbf656c fix: a failed config fetch no longer silently disables the whole session
Two field logs traced to one root cause: config.json is fetched exactly once at
DOMContentLoaded and never retried, so a single transient failure at startup left
getConfig() returning null (or a stale cached copy) for the rest of the session.

Log A: no config at all. connectAll took its else branch, never built a Publisher,
and then reported "All connected - capturing" anyway. An hour of receptions queued
and nothing published. The Push button answered "nothing pending / not connected"
because drain() returns 0 for a null publisher exactly as it does for an empty
queue - and its reconnect branch was guarded on `publisher && !connected()`, which
skipped the one case needing recovery. The only message naming the cause went to
els('status'), which the next connect cleared with log('').

Log B: a config.json cached before rfSampler/regionDiscovery existed. Absent flags
normalize to false, so both features were dead while the served config said on -
publishing worked, everything looked green, and nothing reported it. A stale config
is worse than none: none is detectable, stale is not.

- sw.js: config.json bypasses the cache in both directions, and the
  caches.match('/') fallback is limited to navigations. Serving index.html for a
  JSON request is what turned an offline start into "invalid JSON: Unexpected
  token '<'".
- config.js: loadConfig dedupes concurrent attempts, caches only on success so a
  retry actually re-fetches, and names an HTML body instead of leaking a parse error.
- uplink.js (new, pure): uplinkState / uplinkWarning / pushOutcome /
  regionInertReason / buildLogHeader.
- app.js: retries the config on every connect, on `online`, and once a minute while
  missing; startPublisher() split out so a late config brings uploading up without
  reconnecting; a red Home banner while receptions are buffered but not uploaded;
  the progress list no longer claims an uplink it does not have; pushNow reports
  queue depth independently of link health and picks the matching repair.
- Region discovery names which of its four gates is holding it, once, in the log -
  "no regions lines" was consistent with all four and distinguished none. Its
  re-entry throttle is now stamped before the gates instead of after.
- Every exported log carries a header with app version, EFFECTIVE config flags,
  firmware version, region-discovery status, uplink state and queue depth. Both
  field logs arrived unattributable to a version; the header is built at share time
  so it cannot roll out of the 200-line ring buffer the way a startup line does.

Tests: 217 pass (+41). sw.js is driven in a node:vm ServiceWorkerGlobalScope so the
shipped file is tested, not a copy of its logic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 09:45:09 +02:00
efitenandClaude Opus 5 3657a5b87f fix: final review pass on region-discovery (repo A side)
- Truncation threshold was 160 bytes, missing any dropped name longer
  than 9 chars (be-antwerpen, be-limburg are real names on this
  network). Derived the correct floor from RegionMap.cpp/MyMesh.cpp:
  the delivered CSV can be as short as 139 bytes while still hiding a
  dropped 30-char name, once the trailing-comma trim is accounted for.
- A DEVICE_INFO failure on connect left "Region discovery: on" showing
  while state.regions.supported stayed false — now the catch path
  writes an honest "off — could not read firmware version" line.
- onRegionsFrame's queue.add() was a fire-and-forget promise in a sync
  BLE listener; added the same .catch() pattern used elsewhere.
- maybeQueryRegions committed scheduler state (cursor/demoted/pending)
  before building the request frame, so a throw from
  buildRegionsRequest would leave the scheduler out of sync with what
  was actually sent. Build the frame first.
- Documented regionDiscovery in the README config sample (was only in
  config.example.json), matching the fullRfLog/rfSampler warning shape.
- Bumped the sw.js cache version for the frontend changes above.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 16:49:12 +02:00
efiten 770bffdab1 cleanup: dedupe RESP_CODE_STATS, fix stale publisher.js header, document rfSampler
frames.js declared its own copy of RESP_CODE_STATS = 24, but nothing
imports it — rfstats.js has the copy parseStats actually uses. Delete
the dead one so there is exactly one definition of this wire constant.

publisher.js's header named only the /packets topic, understating the
module's contract now that it also publishes RF samples on /rf.

README's config.json section never documented rfSampler at all (it
exists in public/config.example.json and config.js). Add it alongside
fullRfLog, and warn that mqtt.js negotiates MQTT 3.1.1 — whose PUBACK
carries no reason code — so a broker ACL denying the /rf subtopic
still lets the app log "published N record(s)" while the server
receives zero rows.
2026-08-18 12:43:00 +02:00
efiten 67f548c858 fix: pass computed fullRfLog flag, correct comment, document flag + cross-repo cost
buildRfLogRecord was called with the literal fullRfLog: true even though
the call is only reached when the computed `logged` is true. That made
the gate's correctness depend on the early `if (!logged) return` three
lines above rather than on the value itself — a future edit moving the
call would silently turn the opt-in into a no-op. Pass `logged` instead,
and hoist the doubled getConfig() call into a local.

The comment above claimed the unattributable-packet path "must move NO
coverage state", but it does assign state.motion and call setPaused() —
intentionally, since updateMotion is a pure function of the latest GPS
fix and applying the idle gate here is the point. Reworded to say the
motion/idle-gate state is deliberately shared, and only the counters,
SNR meter, recently-heard list, beeper and map hexes must not move.

README's config.json example was missing fullRfLog (public/config.example.json
already had it). Documents the flag and that enabling it while the
ingestor's clientRxObservations.enabled is false wastes mobile data on
packets the server decodes and discards with no row and no warning —
mirrored in CoreScope's docs/client-rx-coverage.md.

Bumps sw.js CACHE (v13 -> v14) for the src/app.js change.
2026-08-18 10:50:46 +02:00
efitenandClaude Opus 4.8 bbf91c2afc feat: move Connect to Settings, open on Settings until connected, name last reception (v1.3.1)
- Connect/Disconnect (+ progress + status) moves from Home to the Settings tab, so
  the recently-heard list moves up — Home stays a pure monitor.
- The app opens on Settings (where Connect lives) until a companion is connected,
  then jumps to Home; the live monitor is shown only when there's something to watch.
- Last reception shows the resolved node name when available, upgrading from the raw
  ID once names.js resolves it (label derived live each tick).

SW cache v8→v9.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 15:57:37 +02:00
efitenandClaude Opus 4.8 d65b923c10 feat: auto-discover + Settings tab + Home monitor, fix stuck-uploads drain (v1.3.0)
Home becomes a pure monitor and a new Settings tab holds config/diagnostics.

- Discover now runs automatically while connected with a 15 s traffic backoff
  (an overheard 2-byte forwarder/advert means a busy channel — don't poll on top
  of it); standstill still suspends it. The Flood probe is removed entirely.
- New Settings tab: CoreScope broker status + "Push pending now", companion info,
  diagnostics (verbose, debug log, share/mail the log via Web Share API).
- Home enriched: nodes/hex/rx counters, status strip (GPS accuracy, pending,
  upload health + last-upload age, capture rate), last-reception SNR peak-hold
  meter, discover status line.
- Fix the +60-pending-on-WiFi bug: publish() now times out instead of hanging on
  a dead socket, drainLoop re-arms in finally so it can never die, MQTT keepalive
  lowered, and a drain is kicked on broker reconnect / window online.

Pure logic in src/monitor.js + src/sharelog.js with tests. SW cache v7→v8.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 15:20:35 +02:00
efitenandClaude Opus 4.8 e5b4abc7f2 docs(readme): document iOS needs the Bluefy browser; supported browsers + wake lock
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 09:27:02 +02:00
Erwin FitenandClaude Opus 4.8 61f0ab911a chore: rename corescope-rx -> coredrive-rx (CoreDrive RX)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 11:10:18 +02:00
efiten 6923686a61 feat(deploy): deploy-release.sh — install from a prebuilt release over SSH (no build) 2026-06-14 00:20:52 +02:00
efiten 1b430b7247 docs: generic README with sysop self-host howto 2026-06-13 21:54:57 +02:00
efiten 06b68f1c34 chore: deploy to rx.on8ar.eu (npm run deploy) + docs
Static build served by nginx on the reverse proxy (root@94.130.105.135,
/var/www/rx.on8ar.eu, TLS via certbot). Content updates = npm run deploy.
2026-06-09 18:28:36 +02:00
efitenandClaude Opus 4.8 db83810878 feat: scaffold corescope-rx capture app (BLE companion → MQTT coverage)
Protocol core implemented + unit-tested (meshpacket: path[last]/advert pubkey,
direct-only rule; frames: 0x88 snr/rssi/raw). Working skeleton for transport
(Web Bluetooth NUS), GPS, IndexedDB queue, MQTT.js publisher and field UI.
Remaining work in docs/plan.md (spikes + harden + verify).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 16:47:30 +02:00