Repository navigation
feat(docs): move the editor to the ViteHub Console's signed calls - #409
Merged
Merged
Conversation
The site no longer serves a Console, its sign-in, or its MCP. It serves one route, POST /_vitehub/rpc, for calls that console.vitehub.dev signs with the key in a VITEHUB_CONSOLE_KEY_<NAME> binding. console-authorize.ts lets in Console users whose email is in utils/team.ts, and CLI keys. - Pin every ViteHub package to vite-hub/vitehub main (869db474), Drizzle 1.0 RC, and Nuxt nightly 2611111405 with Nitro 3.0.261103, whose body buffering no longer drains the Console route's request. - Remove auth: "app", embed, mcp and consoleMcpOAuth(); set publicUrl. - Comments get their own team policy, and the team signs in at /sign-in. - Move server/content.ts to a default export and the Database to server/databases/default/, with migrations in the Drizzle Kit 1.0 layout. - Add migration 0004 for the request_id column of Comments threads. - Work around two @vite-hub/docs gaps: its theme chunk is not a Tailwind source, and DocsPage.vue names a layout the module does not register here.
|
This run was cancelled before it finished. |
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
comark-annotate
comark-badge
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The site still serves its own Console:
auth: "app",embed: true, a Console MCP andconsoleMcpOAuth(). Current ViteHub removed all of that, and a build with those options fails withVITE_HUB_B0020. Apps now serve one route,POST /_vitehub/rpc, and console.vitehub.dev signs every call with an Ed25519 key whose public half sits in aVITEHUB_CONSOLE_KEY_<NAME>Worker secret.This moves the docs to that model and pins every ViteHub package to the pkg.pr.new build of vite-hub/vitehub
main(869db474).console: { authorize }pluspublicUrl: "https://comark-ui.onmax.me".console-authorize.tslets in a Console caller whose email is inutils/team.ts, and the CLI, whose keys we make ourselves. The signed Console user is{ id, name, email }with an id of the Console's own, soinTeam()no longer looks people up by id: a site user (GitHub sign-in) counts bylogin, a Console user by email. The Console only signs for members of the team that linked the site and takes the email from GitHub verified, so a stranger needs both to get in.authorize(the Console no longer decides who comments), and the team signs in at/sign-in, since/_vitehubis gone.server/content.tsdefault-exports,documentscomes fromvite-hub/content/collections, the Database moved toserver/databases/default/with migrations in the Drizzle Kit 1.0 layout (vitehub database up, D1 keeps the same0000_init.sql… names, so nothing re-runs), andvite.envmoved intovitehub.env.0004_comments-request-id, one nullable column and an index that Comments now needs.2611111405with Nitro3.0.261103-rc. On the older nightly every signed call answered400 Malformed Console request: twonuxt/serverhandlers from modules each wrapped the request in a body-buffering proxy, the second one'srequest.bodycheck read the whole body, and the Console route found it already read. The site's ownassets.tsmiddleware now uses Nitro'sdefineHandlerfor the same reason.@vite-hub/docsat this build, each with a removal note: its Tailwind@sourcepoints atdist/theme.js, which only re-exports a hashed chunk, so the header lost its grid (modules/docs-theme-source.ts); andDocsPage.vuenames adocs-articlelayout this app never registers, which failsvue-tsc(app/types/vitehub-docs-layouts.d.ts).Local checks on the rebased branch:
pnpm build,pnpm docs:generate(416 pages, links),pnpm docs:links, the compat flag check,wrangler deploy --dry-runwith the worker budget (6.94 MiB gzip),pnpm check,pnpm run doctor, andpnpm test(oneremark-to-comarkCLI test timed out under load and passes alone).Against a local
wrangler devof the build with a local D1:content.list, team emailproject.get, stranger emailCONSOLE_ACCESS_DENIEDCONSOLE_SIGNATURE_MISSINGvitehub content list --urlwith a CLI keyIn Chromium, a team session on
/zoom?vitehubgets the Comments toolbar and its Realtime socket stays open. The text of nine main pages matches a local build ofmainapart from the star count. The shell is the newer@vite-hub/docsone: before/after on Drop.Not checked: the real Console against production (the link comes after deploy), a real GitHub sign-in at
/sign-in(I only saw it redirect to GitHub), and the Console preview link. The build now binds aKVnamespace without an id, which Wrangler creates on the first deploy. Thejwks/oauth_*tables stay in D1 unused so the previous Worker can still be rolled back to.Upstream:
vitehubCLI commands in this app fail withERR_SERVER_NOT_RUNNING(the@vite-hub/sourceclose hook closes its server twice); I ran them with a preload that makes the second close a no-op.Prepared with Claude Opus 5.5 in T3 Code.