Repository navigation
fleet aggregate: serve /frames with TLS on public listeners - #1266
Conversation
An https page cannot open ws://, so a region stream a browser reads must
be served with TLS. `fcvm fleet aggregate --tls-listen <addr:port>`
(repeatable, with `--tls-file`) serves GET /frames and GET /healthz with
TLS on that address. POST/GET /layout and /stats stay on --listen only,
so a public address never accepts a layout.
- src/fleet/aggregate/tls.rs: the certificate is the agent's renderer
file (tls.json, {"cert", "key"} PEM). It is read again every 2 s and a
new version is used for the connections that follow; a version that
does not load is logged and the previous one kept. The listener
accepts and runs each handshake on its own task with a 10 s deadline
(at most 256 at once), so a stalled client delays no other.
- public_router: /frames and /healthz only.
- Cargo.toml: rustls and tokio-rustls as direct dependencies (ring, no
aws-lc-rs; both were already in the lock through reqwest and
tokio-tungstenite).
- fleet/PROTOCOL.md: the two flags.
Tests: the_public_listener_serves_frames_with_tls_and_no_control_routes
(tests/test_fleet_aggregate.rs) reads the region header and a frame over
wss, gets 404 for /layout and /stats over TLS, and after a renewal sees
the new certificate on the next connection while a client trusting only
the old one is refused. With public_router returning the full router it
fails at the 404 assertion. a_file_without_a_usable_identity_is_refused
covers missing key, empty cert, bad key and a mismatched key.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
NOT-A-DEFECT: the CodeRabbit comment is a review-limit notice, not a finding. |
# Conflicts: # src/fleet/aggregate/mod.rs
|
@codex review |
|
NOT-A-DEFECT: the CodeRabbit comment is a review-limit notice, not a finding. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
First of three stacked PRs for #1232 (aggregated streams reachable from the https page). This one serves an aggregator's region stream with TLS; the next two name it in DNS.
Stack: this PR (base
main) → #1267 (host aggregator names) → #1268 (EC2 aggregator names).What changed
fcvm fleet aggregate --tls-listen <addr:port>(repeatable, with--tls-file <path>) also servesGET /framesandGET /healthzwith TLS on that address.POST/GET /layoutand/statsstay on--listenonly, so a public address never accepts a layout.src/fleet/aggregate/tls.rs: the certificate is the agent's renderer file (tls.json,{"cert", "key"}PEM). It is read again every 2 s and a new version is used for the connections that follow; a version that does not load is logged and the previous one kept. Each handshake runs on its own task with a 10 s deadline (at most 256 at once), so a stalled client delays no other.public_router:/framesand/healthzonly.Cargo.toml:rustlsandtokio-rustlsas direct dependencies (ring, no aws-lc-rs). Both were already in the lock through reqwest and tokio-tungstenite.fleet/PROTOCOL.md: the two flags.Nothing runs it yet: no agent or coordinator passes
--tls-listenin this PR.Contract and evidence
Downstream impact: none until a caller passes
--tls-listen. Minimum evidence: the test below, the aggregator suite, lint.the_public_listener_serves_frames_with_tls_and_no_control_routes(tests/test_fleet_aggregate.rs) reads the region header and a frame over wss, gets 404 for/layout(GET and POST) and/statsover TLS, and after a renewal sees the new certificate on the next connection while a client trusting only the old one is refused; a file that does not load keeps the version in use, and a stream opened before the renewal keeps going. Withpublic_routerreturning the full router it fails at the 404 assertion.a_file_without_a_usable_identity_is_refused: missing key, empty cert, bad key, mismatched key.curl https://<name>:<tls port>/healthz→ok,/layoutover TLS →404,/layouton--listen→200.Part of #1232.