docs(selfhost): close first-run onboarding gaps for admin access and GitHub App setup#2625
Conversation
…GitHub App setup Closes #2542. Three first-run operator experience gaps, surfaced during a portability review: - ADMIN_GITHUB_LOGINS (the env var that grants control-panel access) was documented nowhere. It fails closed by design -- unset means nobody gets access, not even the operator who just finished setup -- but with no explanation anywhere, that reads as a bug rather than the intended first-run step. Documented in .env.example and a new "Control-panel access" section on the self-hosting security doc, framed explicitly as fail-closed-by-design. - The self-host already ships a working one-click GitHub App setup wizard (GET /setup, POSTs a manifest to GitHub's own App-creation flow), but the docs never mentioned it -- only manual App creation was documented, and its recommended permission set ("Contents: read, add write only if the self-host should merge") didn't match what the manifest actually requests (contents: write, unconditionally, since it's needed for update_branch too, not just merge). An operator following the manual doc as written could create an App that silently breaks auto-merge with no error surfaced anywhere. Documented the one-click flow as the recommended path and corrected the manual instructions to match the manifest exactly, so the two can't drift apart silently again. - Added .env.example entries for GITHUB_WEBHOOK_MAX_BODY_BYTES (webhook body-size guard), BROWSER_WS_ENDPOINT (visual-review browser endpoint), MCP_READ_REPO_ALLOWLIST / MCP_ACTUATION_REPO_ALLOWLIST (MCP read/write repo scoping), and AI_DAILY_NEURON_BUDGET (AI spend-budget control) -- each genuinely read at runtime but previously undiscoverable without reading source.
…ainer Caught by rendering the page in-browser: the multi-line inline comments on PUBLIC_API_ORIGIN/SELFHOST_SETUP_TOKEN ran past the CodeBlock's right edge instead of wrapping or scrolling. Shortened to one line each.
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-02 20:36:39 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 37f66b2 | Commit Preview URL Branch Preview URL |
Jul 02 2026, 09:39 PM |
…forced The self-hosting-github-app doc claimed its manual permission list "is generated from the identical source" as the setup wizard's manifest, but nothing backed that — the list was hand-authored JSX with no shared source or check. Add a unit test that reads buildManifest's real default_permissions/default_events and asserts the docs page still names every one of them at the right level, so an edit to one without the other now fails CI instead of shipping silently wrong setup instructions. Reword the claim to match what's actually true (kept in sync + CI-checked, not generated). Also correct .env.example's GITHUB_WEBHOOK_MAX_BODY_BYTES comment: GitHub webhooks carry PR/commit metadata, not diffs, so "very large PR diffs" was a misleading example of what could trip the size cap.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2625 +/- ##
=======================================
Coverage 96.05% 96.05%
=======================================
Files 234 234
Lines 26228 26228
Branches 9517 9517
=======================================
Hits 25192 25192
Misses 425 425
Partials 611 611 🚀 New features to boost your workflow:
|
Summary
Closes #2542.
Three first-run operator experience gaps, distinct from the broader image-first onboarding work tracked in #1938:
ADMIN_GITHUB_LOGINS(the env var that grants control-panel access) was undocumented anywhere. It fails closed by design (isAuthorizedGitHubSessionLogininsrc/auth/security.tsreturnsfalsewhen the allowlist is empty) — a first-time operator signs into their own dashboard and gets silently zero privileges, which reads as a bug rather than the intended next step.GET /setupinsrc/selfhost/setup-wizard.ts, POSTs a manifest to GitHub's own App-creation flow) but wasn't mentioned in the docs at all. The manually-documented permission set had also drifted from what the manifest actually requests: docs saidContents: read, add write only if the self-host should merge; the manifest unconditionally requestscontents: write(needed forupdate_branch, not just merge). An operator who created their App manually per the old docs could unknowingly break auto-merge with no error surfaced anywhere.GITHUB_WEBHOOK_MAX_BODY_BYTES,BROWSER_WS_ENDPOINT,MCP_READ_REPO_ALLOWLIST,MCP_ACTUATION_REPO_ALLOWLIST,AI_DAILY_NEURON_BUDGET) were absent from.env.example, discoverable only by grepping source.What changed
.env.example: addedADMIN_GITHUB_LOGINS(with its fail-closed behavior spelled out) right after the setup-wizard vars,MCP_READ_REPO_ALLOWLIST/MCP_ACTUATION_REPO_ALLOWLISTalongside it,GITHUB_WEBHOOK_MAX_BODY_BYTESandBROWSER_WS_ENDPOINTin the self-host runtime section, andAI_DAILY_NEURON_BUDGETin the AI review backend section.docs.self-hosting-security.tsx: new "Control-panel access" section documentingADMIN_GITHUB_LOGINS, framed explicitly as fail-closed-by-design (not a bug), right after the existing "put an auth layer in front of dashboards" bullet — the app already has its own built-in gate for this.docs.self-hosting-github-app.tsx: new "One-click App creation (recommended for a Direct App)" section documenting the/setupwizard as the primary path, with a note that manual creation is still fully supported. Corrected "Direct App permissions" to stateContents: write(matchingbuildManifestinsetup-wizard.tsexactly) with an explanation of why read is insufficient, instead of the old, now-inaccurate "read, add write only if merging" guidance.Verification
Ran both changed doc pages through the local dev server (
vite dev) at both viewport sizes used elsewhere in this doc set, and caught + fixed one real visual bug in the process: my first draft of the new "One-click App creation".envcode block had a multi-line inline comment that overflowed theCodeBlockcomponent's right edge instead of wrapping (overflow-x: visibleon the underlying<code>element) — shortened both comments to one line each in a follow-up commit, confirmed the fix visually. I'm not able to attach the actual screenshot images to this PR body from this environment (no browser session to drag-drop into, and the preview tool doesn't expose a file path for the captured images) — happy to attach them via a follow-up comment if that's needed for review, or you're welcome to runnpm --workspace @jsonbored/gittensory-ui run devand load/docs/self-hosting-securityand/docs/self-hosting-github-appdirectly.Both changed pages are documentation prose (new headings/paragraphs/lists) plus
CodeBlock/Calloutusages that are pre-existing, unmodified, already-used-elsewhere-in-this-doc-set components — no new visual components, styling, or layout were introduced.Validation
npm run ui:typechecknpm run ui:lint(0 errors; only pre-existing, unrelated warnings)npm run ui:buildnpm run ui:testnpm run test:ci(the full local gate, exit 0 — nosrc/**files changed, this PR is scoped to docs/env-example)git diff --check.env.exampleconfirmed none of the 6 newly-added vars collide with an existing entryScope
site/,CNAME,**/lovable/**, orCHANGELOG.mdSafety
.env.example— every new entry is a name + placeholder/description, consistent with the file's existing convention