Skip to content

Sync: one-way links — receive only (send nothing) or send only - #120

Merged
phornstein merged 3 commits into
mainfrom
feat/sync-direction
Nov 2, 2026
Merged

phornstein merged 3 commits into
mainfrom
feat/sync-direction

Conversation

@phornstein

Copy link
Copy Markdown
Collaborator

Stacked on #117 (it reuses #117's Nodes-panel key display and fingerprint check). Merge #117 first, then retarget this to main.

Why

"Receive only" meant "accept no track management from this node's users". It never changed what the node sends: with sync on, a node always published its reports, decisions and summaries. So the setting promised the one thing it didn't do.

What

Direction (sync.direction: both | receive | send), enforced by the link whatever the transport carries:

  • Receive only publishes nothing.
    • It never takes over reporting a track. Its sensors may see the track better, but the peer keeps reporting it and the peer's reports keep applying here.
    • Track management done here isn't logged for others, and neither are profile changes.
    • Ask peers to fill gaps (sync.repair) allows only summary and want.
  • Send only takes nothing in. It answers trusted nodes' wants.

The old toggle is renamed "Accept no track management here" (sync.no_local_management). Saved settings and config exports that use receive_only still load, through a serde alias.

The Nodes panel:

  • a one-line summary of what the node does ("OTT receives tracks and decisions from ZZZ and sends nothing")
  • notes on combinations that may surprise
  • a Taken in column for each trusted node
  • Add a node: site code and key in one dialog; it pins the key and shows the fingerprint to compare before adding the node
  • the sending budget is hidden on a receive-only node
  • counts of what the direction held back

The header badge shows a one-way node's direction: site OTK · receive only.

opentrack bridge takes ;send=off and ;send=repair per node.

Docs: the admin guide gets a "One-way links" section with a two-node example. multi-node.md, sync-icd.md, reference.md and the CHANGELOG are updated.

Tests

  • link:
    • a receive-only node sends no decisions, no summary, no snapshot request, and no answers to wants
    • with repair on, it sends only summaries and wants
    • a send-only node takes in nothing but answers wants
  • engine (Redis): two nodes see the same object, and the receive-only one sees it better.
    • The receive-only node sends 0 messages, holds the peer's track with reported_by set to the peer, and never reports.
    • The peer gets nothing from it.
    • Its own pair decision isn't logged for others.
  • settings: old receive_only documents load and are written back under the new name.
  • bridge: send= parsing and which kinds are carried.
  • UI: syncDirection summary, badge, warnings and acceptance.
  • Gates: ot-server 233 passed; clippy -D warnings clean; fmt clean. UI: tsc, lint (0 errors), vitest 75, build.

Checked on the 8091 test instance

  • Headless browser:

    • the summary line and notes appear; the Direction control works; the repair toggle appears and the budget is hidden
    • Add a node blocks a pasted fingerprint, pins a real key and shows the matching fingerprint
    • saving persists direction: "receive"; the header reads site OTT · receive only
  • On its NATS (ot.sync.out.>, 14 s each):

    Direction Messages
    Receive only 0
    Receive only, with repair 3 (summaries)
    Send and receive 199

Settings were restored afterwards.

🤖 Generated with Claude Code

phornstein and others added 2 commits November 2, 2026 10:42
Copy public key used the Clipboard API, which exists only on HTTPS or
localhost: on a node reached by its address it threw and did nothing,
and the page showed only the fingerprint, so the fingerprint was pasted
as DUG's key and refused (422) three times. The page now shows the whole
public key to select; copying falls back to a selection where the API is
missing (the API token's Copy too); the pin dialog says so when a
fingerprint is pasted.

change_refused audit records carry the reason the caller was told.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd only

Settings → Nodes gets a Direction (send and receive, receive only, send
only), enforced by the link whatever the transport carries. A node that
receives only publishes nothing, never takes over reporting a track, and
keeps its own track management and profile changes; "Ask peers to fill
gaps" lets it send only summaries and wants. A node that sends only takes
nothing in but answers trusted nodes' wants.

The old Receive only toggle is renamed Accept no track management here
(sync.no_local_management; receive_only still loads). The panel opens with
a one-line summary of what the node does, notes on surprising
combinations, a Taken in column, and an Add a node dialog that pins the
key and shows the fingerprint to compare. The header badge shows a one-way
node's direction. opentrack bridge takes ;send=off and ;send=repair per
node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from fix/sync-key-copy to main November 2, 2026 19:27
# Conflicts:
#	CHANGELOG.md
#	ui/src/index.css
#	ui/src/pages/settings/NodesPanel.tsx
@phornstein
phornstein merged commit 8abec6b into main Nov 2, 2026
3 checks passed
@phornstein
phornstein deleted the feat/sync-direction branch November 2, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant