Skip to content

docs+feat: Fly.io Agent Gateway docs, and gate internal sections behind auth - #48

Merged
bryanfawcett merged 2 commits into
mainfrom
claude/docker-deployment-setup-thgk8o
Jul 31, 2026
Merged

docs+feat: Fly.io Agent Gateway docs, and gate internal sections behind auth#48
bryanfawcett merged 2 commits into
mainfrom
claude/docker-deployment-setup-thgk8o

Conversation

@bryanfawcett

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite deployment/agentgateway.mdx and the deployment/overview.mdx cross-link for the actual current state: nyuchi/agentgateway moved from Vercel to Fly.io (fundi.nyuchi.com, single-port fly.toml, dedicated IPs, the config.yaml --chown fix, the ephemeral-filesystem and new-port caveats). Previously merged content here (docs(deployment): document agentgateway's Docker deploy on Vercel #45/docs(deployment): explicitly disable agentgateway's admin UI #46/docs(deployment): document the OIDC admin UI and OIDC_COOKIE_SECRET #47) still described the Vercel phase.
  • Mark deployment/*, mzizi-tools/*, and tools/* visibility: internal in frontmatter (site/src/content.config.ts extends docsSchema). site/scripts/generate-internal-paths.mjs scans that frontmatter at build time into a manifest both surfaces below consume.
  • site: adds a main worker (src/worker/gate.ts) in front of the existing Workers Static Assets binding. Internal pages redirect to a WorkOS OIDC login (PKCE; the session cookie is the WorkOS ID token itself, re-verified via JWKS on each request); public pages are untouched — same assets-only behavior as before.
  • nyuchi-docs-mcp-worker: verifies each MCP caller's own bearer token (src/auth.ts) before deciding whether to surface internal content. read_page denies internal paths outright for unauthenticated callers, and forwards a shared INTERNAL_FETCH_KEY on the internal fetch for authorized ones so that read skips the browser OIDC flow. search_docs/ask_docs filter internal URLs out of citations for unauthenticated callers as a defensive backstop.

Known limitation, not solved here: the AI Search index backing search_docs/ask_docs is built from a public crawl, so it shouldn't contain internal content regardless of caller auth — if the crawler is ever allowlisted past the site gate, its ingestion would need to respect visibility too, not just the MCP-side filter.

Secrets needed post-merge (not committed): WORKOS_CLIENT_ID/WORKOS_CLIENT_SECRET for a new "Nyuchi Docs" WorkOS Connect app (redirect URI https://docs.nyuchi.com/oauth/callback) on the site worker, plus a shared INTERNAL_FETCH_KEY set on both workers via wrangler secret put.

Test plan

  • pnpm -r build — all packages build clean, including the new site worker (wrangler deploy --dry-run) and nyuchi-docs-mcp-worker (tsc --noEmit + dry-run)
  • pnpm -r test — 35 existing tests pass unchanged
  • Set the secrets above post-merge, then confirm the OIDC login round-trip on a real deploy (same manual-login verification pattern used for fundi.nyuchi.com)
  • Confirm nyuchi-docs-mcp-worker's bearer-auth path against a real WorkOS token once the "Nyuchi Docs" Connect app exists

Generated by Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 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 Preview URL Updated (UTC)
✅ Deployment successful!
View logs
shamwari-docs-ai 552dd4b Commit Preview URL

Branch Preview URL
Jul 31 2026, 04:18 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 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 Preview URL Updated (UTC)
✅ Deployment successful!
View logs
nyuchi-docs-mcp 552dd4b Commit Preview URL

Branch Preview URL
Jul 31 2026, 04:19 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 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 Preview URL Updated (UTC)
✅ Deployment successful!
View logs
nyuchi-docs 552dd4b Commit Preview URL

Branch Preview URL
Jul 31 2026, 04:19 PM

claude added 2 commits July 31, 2026 16:16
Rewrite in full - the page still described the Vercel phase (domain,
build files, port model, deploy commands) after the gateway moved to
Fly.io. Covers fundi.nyuchi.com, the single-port fly.toml, the
config.yaml chown fix and its durability caveat, dedicated IPs, and a
History section. Adds a Fly.io subsection to the deployment overview
stub and moves the cross-link there from Vercel.
Marks deployment/* and mzizi-tools/*, tools/* as `visibility: internal`
in frontmatter (site/src/content.config.ts extends docsSchema with the
field). scripts/generate-internal-paths.mjs scans that frontmatter at
build time and emits the manifest both surfaces below read.

- site: adds a `main` worker (src/worker/gate.ts) in front of the
  Workers Static Assets binding — internal pages redirect to a WorkOS
  OIDC login (PKCE, session cookie is the WorkOS ID token itself,
  re-verified on each request via JWKS) and fall through to assets on
  success; public pages are untouched.
- nyuchi-docs-mcp-worker: verifies each MCP caller's own bearer token
  (src/auth.ts) before deciding whether to surface internal content.
  read_page denies internal paths outright for unauthenticated callers,
  and forwards a shared INTERNAL_FETCH_KEY on the internal fetch for
  authorized ones so that read skips the browser OIDC flow.
  search_docs/ask_docs filter internal URLs out of citations for
  unauthenticated callers as a defensive backstop — the AI Search index
  is built from a public crawl, so it shouldn't contain internal
  content in the first place.

Known limitation, not solved here: if the AI Search crawler is ever
allowlisted past the site gate, search_docs/ask_docs would need the
crawler's ingestion to respect visibility too, not just this filter.

Secrets needed post-merge (not committed): WORKOS_CLIENT_ID/SECRET +
WORKOS_ISSUER for a new "Nyuchi Docs" WorkOS Connect app (redirect URI
https://docs.nyuchi.com/oauth/callback) on the site worker, and a
shared INTERNAL_FETCH_KEY on both workers.
@bryanfawcett
bryanfawcett force-pushed the claude/docker-deployment-setup-thgk8o branch from 47587b7 to 552dd4b Compare July 31, 2026 16:18
@bryanfawcett
bryanfawcett marked this pull request as ready for review July 31, 2026 16:18
@bryanfawcett
bryanfawcett merged commit cf90f1b into main Jul 31, 2026
7 checks passed
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.

2 participants