Skip to content

remote: an encrypted team may use any http:// address again, on every command - #2133

Merged
fujibee merged 4 commits into
mainfrom
fix/age-v1-http-exemption
Nov 30, 2026
Merged

fujibee merged 4 commits into
mainfrom
fix/age-v1-http-exemption

Conversation

@fujibee

@fujibee fujibee commented Nov 30, 2026

Copy link
Copy Markdown
Owner

What was wrong

1.9.3 (#2111) applied the plaintext-address rule to every team, encrypted or not. Every age-v1 team connected to an internet http:// address stopped syncing on upgrade. Its engine refused the binding on the first cycle and stayed down.

The rule should only bind plaintext teams. An age-v1 team seals message bodies before they leave the machine, and the bodies are what the rule protects. Before #2111, connect --e2ee and the sync engine exempted age-v1 for that reason (#1019).

Change

The rule now depends on what this machine knows about the team before any request:

  • connect --e2ee (scripts/remote.sh): any http:// address is accepted again.
  • Sync engine (connectedBinding, scripts/internal/remote-sync.mjs): an age-v1 binding is exempt again. A plaintext binding keeps the rule every cycle.
  • set-endpoint: decided by the team's own binding, read locally. An age-v1 team may move to any http:// address; a plaintext team keeps the rule.
  • pull --e2ee (new flag, the same one connect has): a team being pulled has no binding yet, so the flag says it is encrypted.
    • With --e2ee, the address rule is lifted. The pull stops right after the team snapshot, before any message is fetched, if the server declares the team anything other than age-v1.
    • Without --e2ee, an internet http:// address is refused before any request, as before. The refusal now names --e2ee.
  • install --update: an age-v1 team whose engine is not running is started again after the update, when its last fatal is exactly 1.9.3's refusal ("connected team endpoint is refused"). A user who was syncing does not have to type anything. An engine stopped for any other reason is left as it is.

Only the plaintext-address refusal is lifted for an age-v1 team. A malformed endpoint, userinfo, control characters, a zone id, a bad port or a non-http scheme are refused for every team.

Plaintext teams keep the rule unchanged, including the Tailscale addresses from #2112.

The refusal text again offers an encrypted team as a way to use an internet http:// address.

Docs:

  • docs/remote-setup.md covers pull --e2ee for machine B.
  • SKILL.md / skill-base.md list the flag.
  • connect's copy-paste pull line for the other machine says to add --e2ee for an encrypted team.

Interface: one new flag, pull --e2ee. No new environment variable. validate-endpoint.mjs --sealed is an internal argument that only remote.sh passes.

Process spawns:

  • connect, pull, set-endpoint and the engine cycle: unchanged (one validator node call where there was one).
  • install --update: before the update, one python3 and one remote.sh status per connected team whose engine is not running. That is once per update, never per cycle.

No new automatic stop. The change removes a stop, and the installer starts only engines that 1.9.3 stopped with that exact refusal.

Tests

  • tests/fixtures/endpoint-verdicts.jsonl: 37 deny rows gain "sealed": "allow". Every one is an http:// address refused only for being an internet or decoded-form address. The other deny rows (malformed, userinfo, zone, port, scheme) stay deny for age-v1.
  • tests/test_endpoint_table_node.bats: the table runs through connectedBinding as plain and as age-v1. Each row is checked against verdict and sealed (defaulting to verdict).
  • tests/test_endpoint_scheme.bats: the refusal names --e2ee again.
  • tests/test_remote.bats:
    • connect --e2ee to http://0.0.0.0:1 passes the check and fails at the network (fix(remote): connect --e2ee actually bypasses the plaintext-address check #1019 test restored).
    • One engine cycle on an internet address under --e2ee (fix(remote): connect --e2ee actually bypasses the plaintext-address check #1019 test restored).
    • set-endpoint: an age-v1 team may move to http://0.0.0.0:<port>; a plaintext team is still refused.
    • An age-v1 team left as 1.9.3 left it (engine down, the refusal as last fatal) runs again on sync start, without set-endpoint.
    • pull without --e2ee is refused before the first request, and the refusal names --e2ee.
    • pull --e2ee brings in an encrypted team from http://0.0.0.0:<port>, with an age-v1 binding.
    • pull --e2ee on a team the server declares plaintext stops after the snapshot, before any message.
  • tests/test_install.bats:
    • install --update starts the engine of an age-v1 team stopped with 1.9.3's refusal.
    • install --update leaves stopped an engine stopped for another reason.

On main, every test above for the restored behavior fails, while the two controls pass: the plaintext refusals, and "another reason stays stopped".

Passing locally (macOS):

  • test_remote 171/171
  • test_install 144/144
  • test_endpoint_table_node 2/2
  • test_endpoint_scheme 4/4
  • test_remote_engine_start_refusal 10/10
  • test_remote_sync 80/80
  • node --test tests/remote_sync_engine.test.mjs: 161 pass
  • .github/scripts/check-*.sh: all pass

Real machine (macOS, seat-sandbox, 0 real-machine differences on every step)

Setup:

  • Reference server on 127.0.0.1 with a throwaway Postgres.
  • http://0.0.0.0:18787 as the internet-style address: it reaches the server, and the plaintext rule refuses it.
  • 1.9.4 = this branch at 61a561cc.

Results:

  • 1.9.2 → 1.9.4, kept syncing: 1.9.2 from npm, an age-v1 team connected with --e2ee to that address, one message sent. After install --update to this branch, the engine runs on a new pid, and the message sent after the upgrade syncs.
  • 1.9.2 → 1.9.3 → 1.9.4, resumed with no command: after 1.9.3, the engine is stopped, and status shows last fatal: connected team endpoint is refused: ..., as users see. After install --update to this branch, it prints resuming the sync engine for 'teamB', the engine runs, and the message sent after the upgrade syncs.
  • A fresh 1.9.4 machine:
    • pull from the same address without --e2ee is refused with the reason, naming --e2ee.
    • pull --e2ee plus unlock brings both teams in.
    • Each team's history has both messages, the one sent on 1.9.2 and the one sent after the upgrade, so both reached the server.
  • Existing bindings never needed --e2ee.

… command

An age-v1 team seals message bodies before they leave the machine, so the
plaintext-address rule has nothing to protect for it. 1.9.3 applied the rule
to every team, which stopped the sync engine of every encrypted team connected
to an internet http:// address.

- connect --e2ee and the sync engine accept any http:// address for an age-v1
  team again; a malformed endpoint is still refused for every team.
- set-endpoint decides by the team's own binding, before any request.
- pull --e2ee: a team being pulled has no binding yet, so the flag says it is
  encrypted. The address rule is lifted for it, and the pull stops right after
  the team snapshot, before any message is fetched, when the server declares
  the team unencrypted. Without --e2ee the rule applies before any request.
- install --update starts again the engine of an age-v1 team whose last fatal
  is that refusal, so nobody has to type anything to resume.
- Plaintext teams keep the rule, including the Tailscale addresses.
… status that keeps writing cannot drop the team
…regression fails on an early-closing reader whether SIGPIPE kills it or EPIPE is returned
@fujibee
fujibee merged commit 65debee into main Nov 30, 2026
33 checks passed
fujibee added a commit that referenced this pull request Nov 30, 2026
Release 1.9.4: encrypted teams on http:// endpoints sync again, and pull --e2ee (#2133).
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