| 1 | import { RefRows, withCodeSpans } from "@/components/code-spans"; |
| 2 | import { getChrome, getDocsTrust } from "@/lib/i18n/dictionaries"; |
| 3 | import { buildPageMetadata, SITE_SECURITY_EMAIL } from "@/lib/page-meta"; |
| 4 | |
| 5 | /** Code-owned literals from docs/SANDBOX.md and docs/TELEMETRY.md. Not copy. */ |
| 6 | const SPANS: Record<string, string> = { |
| 7 | seatbelt: "macos-seatbelt", |
| 8 | preferBwrap: "prefer_bwrap = true", |
| 9 | bwrap: "linux-bwrap", |
| 10 | none: "none", |
| 11 | opensandbox: 'sandbox_backend = "opensandbox"', |
| 12 | endpoint: "https://telemetry.codewhale.net/v1/telemetry", |
| 13 | dryRun: 'telemetry_endpoint = ""', |
| 14 | dryRunFile: "$CODEWHALE_HOME/telemetry/dryrun.jsonl", |
| 15 | configOff: "codewhale config set telemetry false", |
| 16 | envOff: "CODEWHALE_TELEMETRY=0", |
| 17 | auditLog: "$CODEWHALE_HOME/audit.log", |
| 18 | }; |
| 19 | |
| 20 | /** The one security contact the spine publishes (lib/page-meta.ts). */ |
| 21 | const SECURITY_MAILTO = `mailto:${SITE_SECURITY_EMAIL}`; |
| 22 | |
| 23 | export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) { |
| 24 | const { locale } = await params; |
| 25 | const t = getDocsTrust(locale); |
| 26 | return buildPageMetadata({ |
| 27 | path: "/docs/trust", |
| 28 | locale, |
| 29 | title: t.metaTitle, |
| 30 | description: t.metaDescription, |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | export default async function TrustPage({ params }: { params: Promise<{ locale: string }> }) { |
| 35 | const { locale } = await params; |
| 36 | const t = getDocsTrust(locale); |
| 37 | const chrome = getChrome(locale); |
| 38 | |
| 39 | return ( |
| 40 | <section className="space-y-10"> |
| 41 | <section id="overview" className="scroll-mt-32"> |
| 42 | <h1 className="font-display text-3xl mb-1">{t.overviewTitle}</h1> |
| 43 | <p className={`${t.bodyClassName} mt-3`}>{t.overviewLead}</p> |
| 44 | </section> |
| 45 | |
| 46 | <section id="boundary" className="scroll-mt-32"> |
| 47 | <h2 className="font-display text-2xl mb-4">{t.boundaryTitle}</h2> |
| 48 | <RefRows rows={t.boundaries} /> |
| 49 | </section> |
| 50 | |
| 51 | <section id="approvals" className="scroll-mt-32"> |
| 52 | <h2 className="font-display text-2xl mb-1">{t.approvalTitle}</h2> |
| 53 | <p className={`${t.bodyClassName} mt-3`}>{t.approvalLead}</p> |
| 54 | </section> |
| 55 | |
| 56 | <section id="sandbox" className="scroll-mt-32"> |
| 57 | <h2 className="font-display text-2xl mb-1">{t.sandboxTitle}</h2> |
| 58 | <p className={`${t.bodyClassName} mt-3 mb-4`}>{t.sandboxLead}</p> |
| 59 | <RefRows rows={t.sandboxes} spans={SPANS} /> |
| 60 | <p className={`${t.bodyClassName} mt-4 text-sm`}>{t.sandboxNote}</p> |
| 61 | </section> |
| 62 | |
| 63 | <section id="telemetry" className="scroll-mt-32"> |
| 64 | <h2 className="font-display text-2xl mb-1">{t.telemetryTitle}</h2> |
| 65 | <p className={`${t.bodyClassName} mt-3 mb-4`}>{t.telemetryLead}</p> |
| 66 | <RefRows rows={t.telemetry} spans={SPANS} /> |
| 67 | </section> |
| 68 | |
| 69 | <section id="audit" className="scroll-mt-32"> |
| 70 | <h2 className="font-display text-2xl mb-1">{t.auditTitle}</h2> |
| 71 | <p className={`${t.bodyClassName} mt-3`}>{withCodeSpans(t.auditLead, SPANS)}</p> |
| 72 | </section> |
| 73 | |
| 74 | <section id="report" className="scroll-mt-32"> |
| 75 | <h2 className="font-display text-2xl mb-1">{t.reportTitle}</h2> |
| 76 | <p className={`${t.bodyClassName} mt-3`}>{t.reportLead}</p> |
| 77 | <div className="portal-actions"> |
| 78 | <a className="portal-button portal-button-primary" href={SECURITY_MAILTO}> |
| 79 | {t.reportCta} · {chrome.footerSecurity} |
| 80 | </a> |
| 81 | </div> |
| 82 | </section> |
| 83 | |
| 84 | <section id="source" className="hairline-t pt-8"> |
| 85 | <p className="text-sm text-ink-mute">{t.sourceNote}</p> |
| 86 | </section> |
| 87 | </section> |
| 88 | ); |
| 89 | } |
| 90 |