Skip to content

Document control plane placement for Cloudflare installations - #287

Draft
tnkuehne wants to merge 2 commits into
mainfrom
docs-control-plane-placement
Draft

tnkuehne wants to merge 2 commits into
mainfrom
docs-control-plane-placement

Conversation

@tnkuehne

Copy link
Copy Markdown
Contributor

Documents placementRegion from #286 in the configuration reference, next to the other installation profile settings for Cloudflare installations.

Blocked by: #286 and a release that includes it. Base: worker-placement-and-session-jwt, so the diff shows only documentation.

Checked: oxfmt --check on the changed page.

…eader

Every control-plane request runs several database queries in a row. From
the Cloudflare location nearest the visitor, each one costs 20 to 30 ms.
A hosted installation can now name its database's cloud region with
placementRegion, so the control plane runs next to the database.

The JWT plugin also signed a session JWT for the set-auth-jwt header on
every session lookup and read the signing keys from the database each
time. Nothing reads that header. The OAuth provider still signs its tokens
with the plugin's keys.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs 1714e9a Nov 22 2026, 12:10 PM

tnkuehne added a commit that referenced this pull request Nov 22, 2026
…eader (#286)

Each control-plane request runs several database queries in a row. On a
Cloudflare installation the Worker runs in the location nearest the
visitor, so every query crosses the distance to the database:
Cloudflare's Hyperdrive docs give 20–30 ms per query without placement
and 1–3 ms with it. A remote query such as `getApps` makes 7 queries:
session, user, signing keys, membership, then the app list in a
transaction. Its server time on a hosted installation is about 230 ms.

## Changes

- **Placement:** the hosted installation profile accepts
`placementRegion`, for example `aws:eu-central-1`. The control plane is
then deployed with `placement: { region }` and runs next to the
database. Static assets are still served from the location nearest the
visitor. App runtime, builder and documenter Workers are unchanged.
- **Session JWT header:** the JWT plugin signed a JWT for the
`set-auth-jwt` header on every session lookup, which read the signing
keys from the database each time. Nothing reads that header, so
`disableSettingJwtHeader` turns it off. The OAuth provider for the CLI
and MCP clients still signs its tokens with the plugin's keys.

## Validation

- `pnpm check`
- `hosted-installation.test.ts`, including a new test for
`placementRegion`
- `mcp-login-runtime.test.ts`, `auth.integration.test.ts`,
`auth-cli.integration.test.ts`
- Browser tests: 93 passed, 1 skipped. The CLI login suite did not run
locally because the CLI binary was not built.

Documentation: #287 (draft until a release includes this change).


<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=115718112&amp;sig=ccca66ccf9a3742afb09c45e062d6d08efdf86760756b4187b5f9155588a2516"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a><a
href="https://app.greptile.com/-/switch-tenant?tenant=mendra&amp;next=%2Fwidefleet%2Fwidefleet%2Fpull%2F286&amp;utm_source=greptile_review&amp;utm_medium=github&amp;utm_campaign=view_in_greptile"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img
alt="View in Greptile"
src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5 <sup><img alt="Tier:
plus" title="Review tier: plus"
src="https://greptile-static-assets.s3.amazonaws.com/badges/effort-plus.svg?v=3"
height="12"></sup></h2>

<!-- greptile-impact-verdict --> The PR appears safe to merge; no
actionable issues were found.

<details open><summary><h3>Summary</h3></summary>

Adds optional `placementRegion` to hosted installations and disables the
unused session JWT response header.
- Hosted control planes can run in their database’s cloud region.
- Session lookups stop adding an unused JWT header.
</details>

<!-- greptile_confidence_score:5 -->

<sub>Reviews (1) · Last reviewed commit: ["Run the control plane next to
its
databa..."](0a9d3d4)
· [Reviewed by
Greptile](https://www.greptile.com/?utm_source=greptile_review&utm_medium=github&utm_campaign=review_public&utm_content=widefleet/widefleet)</sub>

<!-- /greptile_comment -->
Base automatically changed from worker-placement-and-session-jwt to main November 22, 2026 12:11
@jonathanlaib jonathanlaib added the documentation Improvements or additions to documentation label Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants