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.tsBlame51 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";
52ad8b1Claude7import { ensureDemoActivity } from "./lib/demo-activity-seed";
2d985e5Claude8import { ensureEnvSiteAdmin } from "./lib/admin-bootstrap";
fc1817aClaude9
10// Ensure repos directory exists
11await mkdir(config.gitReposPath, { recursive: true });
12
eafe8c6Claude13// Start the Actions-equivalent workflow worker (Block C1). Polls
14// workflow_runs for queued rows and executes them sequentially.
15startWorker();
16
2b821b7Claude17// Autopilot: periodic mirror sync, merge-queue progress, weekly digests,
18// advisory rescans. No-op when AUTOPILOT_DISABLED=1.
19startAutopilot();
20
2d985e5Claude21// Site-admin bootstrap from env (SITE_ADMIN_USERNAME). Idempotent — if the
22// user exists, they get a row in site_admins; if not, logged and retried
23// on next boot. Background-fired so a slow DB doesn't block startup.
24void ensureEnvSiteAdmin().catch(() => {});
25
988380aClaude26// Opt-in demo content seed on boot (DEMO_SEED_ON_BOOT=1). Idempotent, never
52ad8b1Claude27// throws — safe to run on every start. Block L3 layers extra activity (more
28// issues, an open + merged PR on todo-api, AI-review comment, auto-merge
29// audit row) so the live /demo page has content out of the box.
988380aClaude30if (process.env.DEMO_SEED_ON_BOOT === "1") {
52ad8b1Claude31 void (async () => {
32 try {
33 await ensureDemoContent();
34 await ensureDemoActivity();
35 } catch {
36 /* never throw out of boot */
37 }
38 })();
988380aClaude39}
40
fc1817aClaude41console.log(`
42 gluecron v0.1.0
43 ──────────────────────
44 http://localhost:${config.port}
45 repos: ${config.gitReposPath}
46`);
47
48export default {
49 port: config.port,
50 fetch: app.fetch,
51};