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
claude/adoring-hopper-5x74bqclaude/affectionate-feynman-ykrf1hclaude/architecture-audit-design-wxprenclaude/build-status-update-3MXsfclaude/charming-meitner-mllb5rclaude/compare-gate-gluecron-s4mFQclaude/confident-faraday-tikcwbclaude/continue-work-XMTlIclaude/crontech-gluecron-deploy-7MIECclaude/crontech-platform-setup-SeKfwclaude/design-2026claude/ecstatic-ptolemy-jMdigclaude/enhance-github-integration-QNHdGclaude/fix-aa-loop-issue-PonMQclaude/fix-actions-and-processclaude/fix-desktop-errors-XqoW8claude/fix-red-workflowsclaude/fix-website-access-6FKJNclaude/gatetest-integration-hardeningclaude/github-audit-improvements-bDFr9claude/gluecron-launch-status-FoMRlclaude/hopeful-lamport-olfCTclaude/issue-to-pr-and-protectionsclaude/jolly-heisenberg-2sg1Qclaude/launch-preparation-QmTb6claude/new-session-xk1l7claude/plan-platform-architecture-kkN4yclaude/platform-analysis-roadmap-1nUGLclaude/platform-launch-assessment-8dWV8claude/polish-platform-release-AeDrUclaude/resume-previous-work-KzyLwclaude/review-crontech-handoff-qYEVqclaude/review-project-completeness-lHhS2claude/review-readme-docs-ulqPKclaude/serene-edison-rj87weclaude/setup-multi-repo-dev-BCwNQclaude/ship-fixes-and-tests-Jvz1cclaude/site-audit-competitive-pctlwgclaude/site-migration-vercel-XstpKclaude/standalone-product-repos-XHFTDcopilot/feat-smart-empty-states-keyboard-first-enhancementcopilot/feat-smart-morning-digest-review-context-restorecopilot/fix-and-process-workflowscopilot/update-ai-powered-code-reviewfeat/debt-mapfeat/push-policy-codeowners-hardeningfeat/smart-digest-contextfeat/stage-impactfeat/t1-secret-migrationfeat/u-polishfeat/w-self-hostfeat/w2-claude-configfix/agent-journey-orphan-sweepgatetest/auto-fix-1776586424172gatetest/auto-fix-1776586534814gatetest/auto-fix-1776590685143gatetest/auto-fix-1776590808199mainops/redeploy-retriggerstyle/dxt-cta-themeworktree-agent-a3377aad30d55da26worktree-agent-a7ef607b7ee1d6c74
site-crawl.ts12.1 KB · 378 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
#!/usr/bin/env bun
/**
 * One-shot site crawler.
 *
 * Hits every known public + admin route and reports any URL that:
 *   - returned 4xx or 5xx
 *   - took > SLOW_MS to respond
 *   - bounced an admin route to /login (auth not seen)
 *
 * Public routes are crawled anonymously. Admin/settings/billing routes
 * are only crawled if you pass GLUECRON_SESSION=<sid cookie value>.
 *
 * Usage (from the box, or anywhere with internet):
 *
 *   GLUECRON_HOST=https://gluecron.com \
 *   GLUECRON_SESSION=$(psql "$DATABASE_URL" -tAc \
 *     "select token from sessions \
 *      where user_id=(select id from users where username='admin') \
 *        and expires_at > now() and requires_2fa = false \
 *      order by created_at desc limit 1" | tr -d ' ') \
 *   bun scripts/site-crawl.ts
 *
 * If you skip GLUECRON_SESSION the script still runs — it will just mark
 * every admin route as "auth-required (skipped)".
 *
 * Output: a single markdown table sorted FAIL → SLOW → OK, plus a
 * one-line summary at the bottom you can paste back.
 */

const HOST = (process.env.GLUECRON_HOST || "https://gluecron.com").replace(
  /\/$/,
  ""
);
const SESSION = process.env.GLUECRON_SESSION || "";
const CONCURRENCY = Number(process.env.CRAWL_CONCURRENCY || 6);
const TIMEOUT_MS = Number(process.env.CRAWL_TIMEOUT_MS || 8000);
const SLOW_MS = Number(process.env.CRAWL_SLOW_MS || 2000);

// ─── Route inventory ─────────────────────────────────────────────────
//
// Curated subset of the 307 routes: every static page, plus parameterised
// pages instantiated with `ccantynz/Gluecron.com` (the canonical self-
// hosted repo) and `admin` (the bootstrap operator). Anything that needs
// real session state (issue numbers, gist slugs, etc.) is skipped.
//
// `auth` = "anon" public; "admin" needs site-admin cookie; "user" needs
// any logged-in cookie. The crawler treats both admin+user as "skip if
// no session cookie is set".

type AuthLevel = "anon" | "user" | "admin";
type Route = { path: string; auth: AuthLevel; method?: "GET" | "POST" };

const ROUTES: Route[] = [
  // Public landing + marketing
  { path: "/", auth: "anon" },
  { path: "/about", auth: "anon" },
  { path: "/features", auth: "anon" },
  { path: "/pricing", auth: "anon" },
  { path: "/explore", auth: "anon" },
  { path: "/demo", auth: "anon" },
  { path: "/help", auth: "anon" },
  { path: "/getting-started", auth: "anon" },
  { path: "/install", auth: "anon" },
  { path: "/vs-github", auth: "anon" },
  { path: "/marketplace", auth: "anon" },
  { path: "/shortcuts", auth: "anon" },
  { path: "/sleep-mode", auth: "anon" },
  { path: "/setup", auth: "anon" },

  // Legal
  { path: "/terms", auth: "anon" },
  { path: "/privacy", auth: "anon" },
  { path: "/acceptable-use", auth: "anon" },
  { path: "/legal/terms", auth: "anon" },
  { path: "/legal/privacy", auth: "anon" },
  { path: "/legal/acceptable-use", auth: "anon" },
  { path: "/legal/dmca", auth: "anon" },

  // Auth flows (anon GET should render the form)
  { path: "/login", auth: "anon" },
  { path: "/register", auth: "anon" },
  { path: "/forgot-password", auth: "anon" },
  { path: "/reset-password", auth: "anon" },
  { path: "/login/magic", auth: "anon" },
  { path: "/verify-email", auth: "anon" },
  { path: "/play", auth: "anon" },

  // Health + version + manifests
  { path: "/health", auth: "anon" },
  { path: "/healthz", auth: "anon" },
  { path: "/readyz", auth: "anon" },
  { path: "/version", auth: "anon" },
  { path: "/api/version", auth: "anon" },
  { path: "/api/docs", auth: "anon" },
  { path: "/status", auth: "anon" },
  { path: "/status.svg", auth: "anon" },
  { path: "/robots.txt", auth: "anon" },
  { path: "/sitemap.xml", auth: "anon" },
  { path: "/manifest.webmanifest", auth: "anon" },
  { path: "/icon.svg", auth: "anon" },
  { path: "/sw.js", auth: "anon" },
  { path: "/sw-push.js", auth: "anon" },
  { path: "/pwa/vapid-public-key", auth: "anon" },
  { path: "/gluecron.dxt", auth: "anon" },

  // Public repo browsing (canonical self-host repo)
  { path: "/ccantynz", auth: "anon" },
  { path: "/ccantynz/Gluecron.com", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/commits", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/branches", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/contributors", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/issues", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/pulls", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/releases", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/wiki", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/discussions", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/security", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/security/advisories", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/actions", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/deployments", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/dependencies", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/contributors", auth: "anon" },
  { path: "/ccantynz/Gluecron.com/traffic", auth: "anon" },

  // Authed user pages
  { path: "/dashboard", auth: "user" },
  { path: "/feed", auth: "user" },
  { path: "/notifications", auth: "user" },
  { path: "/me/ai-savings", auth: "user" },
  { path: "/new", auth: "user" },
  { path: "/import", auth: "user" },
  { path: "/gists", auth: "user" },
  { path: "/gists/new", auth: "user" },
  { path: "/todos", auth: "user" },
  { path: "/ask", auth: "user" },
  { path: "/billing/manage", auth: "user" },

  // User settings
  { path: "/settings", auth: "user" },
  { path: "/settings/profile", auth: "user" },
  { path: "/settings/notifications", auth: "user" },
  { path: "/settings/billing", auth: "user" },
  { path: "/settings/keys", auth: "user" },
  { path: "/settings/tokens", auth: "user" },
  { path: "/settings/passkeys", auth: "user" },
  { path: "/settings/2fa", auth: "user" },
  { path: "/settings/applications", auth: "user" },
  { path: "/settings/authorizations", auth: "user" },
  { path: "/settings/audit", auth: "user" },
  { path: "/settings/delete-account", auth: "user" },
  { path: "/settings/signing-keys", auth: "user" },
  { path: "/settings/replies", auth: "user" },
  { path: "/settings/sponsors", auth: "user" },
  { path: "/settings/apps", auth: "user" },

  // Admin
  { path: "/admin", auth: "admin" },
  { path: "/admin/ops", auth: "admin" },
  { path: "/admin/autopilot", auth: "admin" },
  { path: "/admin/billing", auth: "admin" },
  { path: "/admin/deploys", auth: "admin" },
  { path: "/admin/deploys/latest.json", auth: "admin" },
  { path: "/admin/digests", auth: "admin" },
  { path: "/admin/flags", auth: "admin" },
  { path: "/admin/github-oauth", auth: "admin" },
  { path: "/admin/repos", auth: "admin" },
  { path: "/admin/self-host", auth: "admin" },
  { path: "/admin/sso", auth: "admin" },
  { path: "/admin/status", auth: "admin" },
  { path: "/admin/users", auth: "admin" },
];

// ─── Crawl machinery ─────────────────────────────────────────────────

type Result = {
  path: string;
  auth: AuthLevel;
  status: number;
  ms: number;
  verdict: "OK" | "FAIL" | "SLOW" | "SKIP" | "REDIR";
  note: string;
};

async function check(route: Route): Promise<Result> {
  const url = `${HOST}${route.path}`;
  const needsAuth = route.auth !== "anon";

  if (needsAuth && !SESSION) {
    return {
      path: route.path,
      auth: route.auth,
      status: 0,
      ms: 0,
      verdict: "SKIP",
      note: "no session cookie",
    };
  }

  const ctrl = new AbortController();
  const timer = setTimeout(() => ctrl.abort(), TIMEOUT_MS);
  const headers: Record<string, string> = {
    "user-agent": "gluecron-site-crawl/1.0",
    accept: "text/html,application/json,*/*",
  };
  if (needsAuth) headers["cookie"] = `session=${SESSION}`;

  const t0 = performance.now();
  let res: Response | null = null;
  let err: unknown = null;
  try {
    res = await fetch(url, {
      method: route.method || "GET",
      headers,
      signal: ctrl.signal,
      redirect: "manual",
    });
  } catch (e) {
    err = e;
  } finally {
    clearTimeout(timer);
  }
  const ms = Math.round(performance.now() - t0);

  if (err || !res) {
    return {
      path: route.path,
      auth: route.auth,
      status: 0,
      ms,
      verdict: "FAIL",
      note: (err as Error)?.message?.slice(0, 60) || "network error",
    };
  }

  const status = res.status;

  // 3xx → look at Location. If admin/user route bounced to /login, flag.
  if (status >= 300 && status < 400) {
    const loc = res.headers.get("location") || "";
    if (needsAuth && /\/login(\?|$)/.test(loc)) {
      return {
        path: route.path,
        auth: route.auth,
        status,
        ms,
        verdict: "FAIL",
        note: "redirected to /login (session invalid?)",
      };
    }
    return {
      path: route.path,
      auth: route.auth,
      status,
      ms,
      verdict: "REDIR",
      note: `→ ${loc.replace(HOST, "")}`.slice(0, 60),
    };
  }

  if (status >= 400) {
    return {
      path: route.path,
      auth: route.auth,
      status,
      ms,
      verdict: "FAIL",
      note: status >= 500 ? "server error" : "client error",
    };
  }

  if (ms > SLOW_MS) {
    return {
      path: route.path,
      auth: route.auth,
      status,
      ms,
      verdict: "SLOW",
      note: `> ${SLOW_MS}ms`,
    };
  }

  return {
    path: route.path,
    auth: route.auth,
    status,
    ms,
    verdict: "OK",
    note: "",
  };
}

async function crawl(): Promise<Result[]> {
  const results: Result[] = [];
  const queue = [...ROUTES];
  const workers = new Array(Math.min(CONCURRENCY, queue.length))
    .fill(0)
    .map(async () => {
      while (queue.length) {
        const route = queue.shift();
        if (!route) break;
        const r = await check(route);
        results.push(r);
        const tag =
          r.verdict === "OK"
            ? "·"
            : r.verdict === "SLOW"
              ? "~"
              : r.verdict === "REDIR"
                ? ">"
                : r.verdict === "SKIP"
                  ? "?"
                  : "X";
        process.stderr.write(`${tag} ${r.status || "---"} ${r.path}\n`);
      }
    });
  await Promise.all(workers);
  return results;
}

function pad(s: string, n: number): string {
  return s.length >= n ? s.slice(0, n) : s + " ".repeat(n - s.length);
}

function formatTable(rows: Result[]): string {
  const rank: Record<Result["verdict"], number> = {
    FAIL: 0,
    SLOW: 1,
    REDIR: 2,
    SKIP: 3,
    OK: 4,
  };
  rows.sort((a, b) => {
    if (rank[a.verdict] !== rank[b.verdict]) return rank[a.verdict] - rank[b.verdict];
    return a.path.localeCompare(b.path);
  });
  const lines = [
    `| verdict | status |  ms  | auth  | path                                                     | note`,
    `| ------- | ------ | ---- | ----- | -------------------------------------------------------- | ----`,
  ];
  for (const r of rows) {
    lines.push(
      `| ${pad(r.verdict, 7)} | ${pad(String(r.status || "---"), 6)} | ${pad(String(r.ms), 4)} | ${pad(r.auth, 5)} | ${pad(r.path, 56)} | ${r.note}`
    );
  }
  return lines.join("\n");
}

async function main() {
  console.error(`[crawl] target: ${HOST}`);
  console.error(`[crawl] session: ${SESSION ? "yes" : "no (admin routes will skip)"}`);
  console.error(`[crawl] routes:  ${ROUTES.length}`);
  console.error("");

  const results = await crawl();

  const counts = {
    FAIL: results.filter((r) => r.verdict === "FAIL").length,
    SLOW: results.filter((r) => r.verdict === "SLOW").length,
    REDIR: results.filter((r) => r.verdict === "REDIR").length,
    SKIP: results.filter((r) => r.verdict === "SKIP").length,
    OK: results.filter((r) => r.verdict === "OK").length,
  };

  console.log("");
  console.log(formatTable(results));
  console.log("");
  console.log(
    `[crawl] ${counts.OK} ok · ${counts.FAIL} fail · ${counts.SLOW} slow · ${counts.REDIR} redir · ${counts.SKIP} skip (no cookie)`
  );

  if (counts.FAIL > 0) process.exit(1);
  process.exit(0);
}

main().catch((err) => {
  console.error("[crawl] crashed:", err);
  process.exit(2);
});