272 lines · 12.7 KB
import handler from "@tanstack/react-start/server-entry";
import { retryHiddenRefCleanups, sweepClosedPullRefs } from "./server/git/pull-bridge";
import { sweepOrphanedLfsBlobs } from "./server/lfs/objects";
import { sweepStuckProvisioning } from "./server/provisioning-sweep";
import { sweepOrphanedArtifacts } from "./server/git/artifacts-sweep";
import { pruneIdleActionArchives } from "./server/ci/actions/archive";
import { handleGitRequest, matchGitRoute } from "./server/git/proxy";
import { handleJobApi, handleRunnerApi, reapStaleRunnerJobs } from "./server/ci/runner-api";
import { handleQueueBatch } from "./server/events/consumer";
import type { QueueMessage } from "./server/events/emit";
import { HttpError } from "./server/errors";
import { finishGithubLogin, startGithubLogin } from "./server/github-oauth";
import { handleRawRoutes } from "./server/raw";
import { handleLfsRequest, matchLfsRoute } from "./server/lfs/api";
import { handlePagesRequest } from "./server/pages/serve";
import { handleSitesRequest } from "./server/sites/dispatch";
import { handleSitesForgeRoutes } from "./server/sites/forge";
import { sweepScratchSites } from "./server/sites/scratch";
import { reconcileSites } from "./server/sites/sync";
import { runMeteringCron } from "./server/metering/cron";
import { handleSecurityApi } from "./server/security/api";
import { handleSecurityBatch, SECURITY_QUEUE } from "./server/security/queue";
import { handleAttachmentRoutes, sweepOrphanedAttachments } from "./server/attachments";
import { pruneExpiredOrgInvitations } from "./server/accounts";
import { handleCamoRoutes } from "./server/camo";
import { handleUserContentOrigin, redirectToUserContent } from "./server/usercontent";
import { userContentOriginFor } from "./server/usercontent-origin";
import { handleProjectRoutes } from "./server/projects";
import { handleAvatarRoutes } from "./server/avatars";
import { purgeExpiredAuthTokens } from "./server/auth-tokens";
import { hasSessionCookie, purgeExpiredSessions } from "./server/auth";
import { sweepUnverifiedAccounts } from "./server/accounts";
import { sweepStaleOAuthClients } from "./server/mcp/oauth-clients";
import { handleActionsRoutes } from "./server/ci/http";
import { runActionsCron } from "./server/ci/maintenance";
import { API_V1_PREFIX, handleApiV1 } from "./server/api/router";
import { handleEditorRoutes } from "./server/editor/api";
import { handleEditorOrigin } from "./server/editor/host";
import { handleIntegrationRoutes, INBOUND_HOOK_PREFIX } from "./server/integrations/http";
import {