Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

index.ts

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

index.tsBlame41 lines · 1 contributor
fc1817aClaude1import { mkdir } from "fs/promises";
2import app from "./app";
3import { config } from "./lib/config";
eafe8c6Claude4import { startWorker } from "./lib/workflow-runner";
2b821b7Claude5import { startAutopilot } from "./lib/autopilot";
988380aClaude6import { ensureDemoContent } from "./lib/demo-seed";
2d985e5Claude7import { ensureEnvSiteAdmin } from "./lib/admin-bootstrap";
fc1817aClaude8
9// Ensure repos directory exists
10await mkdir(config.gitReposPath, { recursive: true });
11
eafe8c6Claude12// Start the Actions-equivalent workflow worker (Block C1). Polls
13// workflow_runs for queued rows and executes them sequentially.
14startWorker();
15
2b821b7Claude16// Autopilot: periodic mirror sync, merge-queue progress, weekly digests,
17// advisory rescans. No-op when AUTOPILOT_DISABLED=1.
18startAutopilot();
19
2d985e5Claude20// Site-admin bootstrap from env (SITE_ADMIN_USERNAME). Idempotent — if the
21// user exists, they get a row in site_admins; if not, logged and retried
22// on next boot. Background-fired so a slow DB doesn't block startup.
23void ensureEnvSiteAdmin().catch(() => {});
24
988380aClaude25// Opt-in demo content seed on boot (DEMO_SEED_ON_BOOT=1). Idempotent, never
26// throws — safe to run on every start.
27if (process.env.DEMO_SEED_ON_BOOT === "1") {
28 void ensureDemoContent().catch(() => {});
29}
30
fc1817aClaude31console.log(`
32 gluecron v0.1.0
33 ──────────────────────
34 http://localhost:${config.port}
35 repos: ${config.gitReposPath}
36`);
37
38export default {
39 port: config.port,
40 fetch: app.fetch,
41};