import { useLocation } from "react-router"; import { AuthLayout } from "../components/auth-layout"; import { PRIMARY_BUTTON_CLASS } from "../components/ui"; const firstTimeSteps = [ { title: "Open a terminal on the server host", body: (
Run{" "}
fabro install on the same
host that runs the Fabro server.
The CLI opens GitHub, exchanges the manifest code, and writes the required settings and secrets locally.
), }, { title: "Restart the server, then return to sign in", body: (Once the server comes back up, you can authenticate from the browser.
), }, ]; const githubInstallReturnSteps = [ { title: "Return to Fabro", body: (The GitHub App is installed for the selected account or repositories. No local reinstall is needed.
), }, { title: "Retry the run", body: (Start the run or preflight again so Fabro can clone the repository and push checkpoint branches with the new installation.
), }, ]; export function setupContentForSearch(search: string) { const params = new URLSearchParams(search); if (params.has("installation_id") || params.get("setup_action") === "install") { return { footer: "GitHub redirected here after installing the app. Fabro is already configured locally.", title: "GitHub App installed", description: "GitHub finished installing the app. Fabro can now request repository-scoped tokens for runs that use that installation.", steps: githubInstallReturnSteps, cta: "Continue to sign in", }; } return { footer: "GitHub App setup is managed from the terminal, not the browser.", title: "Set up Fabro", description: "Run the installer on the server host to register a GitHub App and write local configuration.", steps: firstTimeSteps, cta: "Continue to sign in", }; } export default function Setup() { const { search } = useLocation(); const content = setupContentForSearch(search); return ({content.description}
{step.title}