CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
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 | /**
* SEO + agent-discovery routes: robots.txt, sitemap.xml, llms.txt.
*
* robots.txt — allow crawlers on public surfaces, disallow admin/settings
* and API write paths.
* sitemap.xml — lists the stable public URLs (landing, explore, status,
* marketplace, graphql explorer, shortcuts, terms). Public repo URLs are
* not enumerated here — those live behind /explore which crawlers follow.
* llms.txt — the llmstxt.org convention: a curated map of the platform for
* AI agents, pointing at the MCP endpoint, API docs, and OAuth discovery so
* any LLM/agent can orient itself and connect.
*/
import { Hono } from "hono";
import { config } from "../lib/config";
const seo = new Hono();
const ROBOTS = `User-agent: *
Allow: /
Disallow: /admin
Disallow: /settings
Disallow: /api/
Disallow: /login
Disallow: /register
Disallow: /logout
Disallow: /oauth/
Disallow: /*/settings
Disallow: /*.git/
Sitemap: /sitemap.xml
`;
// Note: /llms.txt is intentionally allowed (agent-facing map, public).
seo.get("/robots.txt", (c) => {
c.header("Content-Type", "text/plain; charset=utf-8");
c.header("Cache-Control", "public, max-age=3600");
return c.body(ROBOTS);
});
/**
* llms.txt (llmstxt.org) — a curated, agent-facing map of the platform.
* Served at both /llms.txt and /.well-known/llms.txt. Built from the live
* base URL so links are always absolute + correct for this deployment.
*/
function buildLlmsTxt(): string {
const b = config.appBaseUrl;
return `# Gluecron
> AI-native git hosting. Git over HTTPS + SSH, issues, pull requests with AI
> code review and gated auto-merge, CI workflows, package + container
> registries, and a Model Context Protocol (MCP) server so any LLM/agent can
> read and drive repositories directly. Self-hosted-friendly and MCP-native.
## For AI agents
- [MCP server](${b}/mcp): Model Context Protocol endpoint (JSON-RPC 2.0 over HTTP). GET for discovery, POST to call tools. Read tools work anonymously on public repos; write tools require an OAuth/PAT bearer token.
- [OAuth authorization server metadata](${b}/.well-known/oauth-authorization-server): RFC 8414 — how to authenticate (authorize/token endpoints, PKCE S256, scopes).
- [OAuth protected resource metadata](${b}/.well-known/oauth-protected-resource): RFC 9728 — which authorization server guards the MCP resource.
## API
- [REST + GraphQL API docs](${b}/api/docs): endpoints, authentication, and scopes for programmatic access.
- [GraphQL explorer](${b}/api/graphql): read queries over repos, users, issues, and search.
## Get started
- [Sign up](${b}/register): create an account.
- [Explore public repos](${b}/explore): browse what's hosted here.
- [Import from GitHub](${b}/import): mirror an existing repo in one step.
- [Install script](${b}/install): one-line setup for the CLI + Claude Desktop MCP config.
## Conventions
- Personal access tokens are prefixed \`glc_\`; OAuth access tokens \`glct_\`. Pass either as \`Authorization: Bearer <token>\`.
- Repos are addressed as \`${b}/<owner>/<repo>\`; clone over HTTPS at \`${b}/<owner>/<repo>.git\`.
`;
}
seo.get("/llms.txt", (c) => {
c.header("Content-Type", "text/plain; charset=utf-8");
c.header("Cache-Control", "public, max-age=3600");
return c.body(buildLlmsTxt());
});
seo.get("/.well-known/llms.txt", (c) => {
c.header("Content-Type", "text/plain; charset=utf-8");
c.header("Cache-Control", "public, max-age=3600");
return c.body(buildLlmsTxt());
});
const STATIC_PATHS = [
"/",
"/explore",
"/marketplace",
"/status",
"/help",
"/shortcuts",
"/api/graphql",
"/terms",
"/privacy",
"/acceptable-use",
];
seo.get("/sitemap.xml", (c) => {
const origin = new URL(c.req.url).origin;
const lastmod = new Date().toISOString().slice(0, 10);
const urls = STATIC_PATHS.map(
(p) =>
`<url><loc>${origin}${p}</loc><lastmod>${lastmod}</lastmod></url>`
).join("\n ");
const body = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${urls}
</urlset>
`;
c.header("Content-Type", "application/xml; charset=utf-8");
c.header("Cache-Control", "public, max-age=3600");
return c.body(body);
});
export default seo;
|