Skip to content

Open source alternative to Semrush and Ahrefs

Reports cleanup: drop the share kill switch, SAM copy, sidebar order (#624)

Ben Senescu4f582745c2b9
diff --git a/alchemy.run.ts b/alchemy.run.ts
index 1b107d6a..9ae6192d 100644
--- a/alchemy.run.ts
+++ b/alchemy.run.ts
@@ -276,7 +276,6 @@ const dataEnv = {
AUTUMN_WEBHOOK_SECRET: optionalSecret("AUTUMN_WEBHOOK_SECRET"),
DUB_API_KEY: optionalSecret("DUB_API_KEY"),
GDPR_ERASURE_SECRET: optionalSecret("GDPR_ERASURE_SECRET"),
- SHARES_ENABLED: optionalVar("SHARES_ENABLED"),
LOOPS_API_KEY: optionalSecret("LOOPS_API_KEY"),
LOOPS_TRANSACTIONAL_VERIFY_EMAIL_ID: optionalVar(
"LOOPS_TRANSACTIONAL_VERIFY_EMAIL_ID",
diff --git a/specs/0014-public-share-links.md b/specs/0014-public-share-links.md
index 2afca930..46bc34bd 100644
--- a/specs/0014-public-share-links.md
+++ b/specs/0014-public-share-links.md
@@ -23,7 +23,7 @@ Accepted. Shipped in PR #616 on top of reports (`specs/0012-dynamic-reports.md`)
**States.** Unknown, unshared or deleted: one "not shared" page with a 404 status, so tokens cannot be probed. Archived project: 404 with the archived message; restoring the project brings the link back.
-**One gate.** The mint, the public page and the raw endpoint ask the same question — hosted, and not switched off — so they cannot disagree. The kill switch is one environment variable that turns every public link off without a deploy; it fails open, so sharing is on unless the value is exactly "false", because an unset or misspelled value must not silently break every live link. A refusal is an ordinary validation error: the operator flipped the switch, and the reader does not need a bespoke code for it.
+**One gate.** The mint, the public page and the raw endpoint ask the same question — is this a hosted deployment — so they cannot disagree. A self-hosted deployment is behind Cloudflare Access or has no auth at all, and neither can serve a link to a reader who is not signed in, so there sharing is refused with an ordinary validation error and every share path answers as if the link never existed.
**Sandbox facts**, checked in the three major engines: meta refresh, `javascript:` and `data:` navigations, form submission and a `<meta>` policy that adds scripts are all refused, and the origin is opaque. A clicked link only replaces the frame's content; links that open a new tab do so with the opener severed.
diff --git a/src/client/features/reports/ReportsList.tsx b/src/client/features/reports/ReportsList.tsx
index 8f68a1e5..05f26728 100644
--- a/src/client/features/reports/ReportsList.tsx
+++ b/src/client/features/reports/ReportsList.tsx
@@ -18,8 +18,8 @@ export function ReportsList({
if (reports.length === 0) {
return (
<p className="rounded-lg border border-dashed border-base-300 px-4 py-6 text-sm text-base-content/60">
- No reports yet. Run an OpenSEO skill such as seo-audit from Claude Code,
- Codex, or SAM and the report will appear here.
+ No reports yet. Run an OpenSEO skill such as seo-audit from Claude Code
+ or Codex and the report will appear here.
</p>
);
}
diff --git a/src/client/navigation/items.ts b/src/client/navigation/items.ts
index 221e78ba..666438f7 100644
--- a/src/client/navigation/items.ts
+++ b/src/client/navigation/items.ts
@@ -118,14 +118,6 @@ export function getProjectNavGroups(projectId: string) {
label: "Overview",
items: [byPath("/p/$projectId")],
},
- {
- label: "AI",
- items: [
- byPath("/p/$projectId/reports"),
- byPath("/p/$projectId/context"),
- aiNavItem,
- ],
- },
{
label: "Research",
items: [
@@ -145,6 +137,14 @@ export function getProjectNavGroups(projectId: string) {
byPath("/p/$projectId/audit"),
],
},
+ {
+ label: "AI",
+ items: [
+ byPath("/p/$projectId/reports"),
+ byPath("/p/$projectId/context"),
+ aiNavItem,
+ ],
+ },
];
}
diff --git a/src/env.d.ts b/src/env.d.ts
index c2a630c3..8816c0bf 100644
--- a/src/env.d.ts
+++ b/src/env.d.ts
@@ -47,13 +47,6 @@ declare namespace Cloudflare {
// HMAC secret for the operator-only GDPR storage-erasure endpoint.
GDPR_ERASURE_SECRET?: string;
- // Kill switch for public report share links. Sharing is on unless this is
- // exactly "false", which turns off every live /s/<token> link and refuses
- // new ones — an incident lever that needs no code change. Alchemy
- // reconciles worker vars on every deploy, so a lasting value belongs in
- // the env file; a dashboard edit holds until the next deploy.
- SHARES_ENABLED?: string;
-
// Cloudflare Turnstile — signup captcha (hosted only). Secret verifies
// tokens server-side; site key is public and inlined into the client build.
TURNSTILE_SECRET_KEY?: string;
diff --git a/src/server/features/reports/services/ReportService.test.ts b/src/server/features/reports/services/ReportService.test.ts
index 3717e5b4..18710836 100644
--- a/src/server/features/reports/services/ReportService.test.ts
+++ b/src/server/features/reports/services/ReportService.test.ts
@@ -1,8 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
-import {
- getOptionalEnvValue,
- isHostedServerAuthMode,
-} from "@/server/lib/runtime-env";
+import { isHostedServerAuthMode } from "@/server/lib/runtime-env";
import { formatCount } from "@/shared/format";
import {
REPORT_MAX_BYTES_PER_ORG,
@@ -32,7 +29,6 @@ vi.mock("@/server/features/reports/repositories/ReportRepository", () => ({
}));
vi.mock("@/server/lib/posthog", () => ({ captureServerEvent: vi.fn() }));
vi.mock("@/server/lib/runtime-env", () => ({
- getOptionalEnvValue: vi.fn(),
isHostedServerAuthMode: vi.fn(),
}));
@@ -222,7 +218,6 @@ describe("sharing", () => {
beforeEach(() => {
vi.mocked(isHostedServerAuthMode).mockResolvedValue(true);
- vi.mocked(getOptionalEnvValue).mockResolvedValue(undefined);
mocks.getReport.mockResolvedValue(storedReport);
});
@@ -274,23 +269,13 @@ describe("sharing", () => {
expect(mocks.setShareToken).not.toHaveBeenCalled();
});
- // A self-hosted deployment cannot serve the link, and the kill switch turns
- // the public routes off, so in either case a minted token is a link that
- // silently does nothing. Refused before the report is even read.
- it.each([
- [
- "the deployment is not hosted",
- () => vi.mocked(isHostedServerAuthMode).mockResolvedValue(false),
- ],
- [
- "the kill switch is off",
- () => vi.mocked(getOptionalEnvValue).mockResolvedValue("false"),
- ],
- ])("refuses to mint when %s", async (_case, arrange) => {
- arrange();
+ // A self-hosted deployment cannot serve the link, so a minted token would be
+ // a link that silently does nothing. Refused before the report is even read.
+ it("refuses to mint when the deployment is not hosted", async () => {
+ vi.mocked(isHostedServerAuthMode).mockResolvedValue(false);
await expect(share()).rejects.toThrow(
- "Sharing is switched off on this deployment.",
+ "Sharing is only available on hosted OpenSEO.",
);
expect(mocks.setShareToken).not.toHaveBeenCalled();
expect(mocks.getReport).not.toHaveBeenCalled();
diff --git a/src/server/features/reports/services/ReportService.ts b/src/server/features/reports/services/ReportService.ts
index 2a7bcb94..a98b7068 100644
--- a/src/server/features/reports/services/ReportService.ts
+++ b/src/server/features/reports/services/ReportService.ts
@@ -248,12 +248,12 @@ type ShareParams = {
*/
async function shareReport(params: ShareParams): Promise<ReportMetadata> {
// Refused here rather than only hidden in the UI: the server is the trust
- // boundary. A token minted while sharing is off is a link that silently does
- // nothing, and the user would have copied it believing otherwise.
+ // boundary. A token minted on a self-hosted deployment is a link that
+ // silently does nothing, and the user would have copied it believing otherwise.
if (!(await sharesEnabled())) {
throw new AppError(
"VALIDATION_ERROR",
- "Sharing is switched off on this deployment.",
+ "Sharing is only available on hosted OpenSEO.",
);
}
diff --git a/src/server/features/reports/shareAccess.ts b/src/server/features/reports/shareAccess.ts
index f37ddf9f..5a546fda 100644
--- a/src/server/features/reports/shareAccess.ts
+++ b/src/server/features/reports/shareAccess.ts
@@ -1,7 +1,4 @@
-import {
- getOptionalEnvValue,
- isHostedServerAuthMode,
-} from "@/server/lib/runtime-env";
+import { isHostedServerAuthMode } from "@/server/lib/runtime-env";
// The two server-side gates every share path runs: is sharing on at all, and
// does this path segment even look like a token. Server-only, so reading the
@@ -9,20 +6,13 @@ import {
// client half of sharing is `sharePath` in @/shared/report-share.
/**
- * Hosted, and not switched off. One predicate rather than two, so the mint,
- * the share page and the raw endpoint cannot disagree about either half.
- *
* Sharing is a hosted-only feature: a self-hosted deployment is behind
* Cloudflare Access or has no auth at all, and neither can serve a link to a
- * reader who is not signed in. The `SHARES_ENABLED` kill switch is the
- * operator lever on top of that: sharing is on unless the var is exactly
- * "false", because an unset or misspelled value must not silently break every
- * live link, and the switch exists to be flipped in the dashboard without a
- * deploy.
+ * reader who is not signed in. One predicate, so the mint, the share page and
+ * the raw endpoint cannot disagree.
*/
-export async function sharesEnabled(): Promise<boolean> {
- if (!(await isHostedServerAuthMode())) return false;
- return (await getOptionalEnvValue("SHARES_ENABLED")) !== "false";
+export function sharesEnabled(): Promise<boolean> {
+ return isHostedServerAuthMode();
}
/**
diff --git a/src/server/features/reports/sharePage.test.ts b/src/server/features/reports/sharePage.test.ts
index f77825e0..14a19f5a 100644
--- a/src/server/features/reports/sharePage.test.ts
+++ b/src/server/features/reports/sharePage.test.ts
@@ -4,7 +4,6 @@ import { loadSharePage } from "./sharePage";
const mocks = vi.hoisted(() => ({
env: {
AUTH_MODE: "hosted" as string | undefined,
- SHARES_ENABLED: undefined as string | undefined,
},
getSharedReportByToken: vi.fn(),
setResponseStatus: vi.fn(),
@@ -33,7 +32,6 @@ const SHARED_REPORT = {
beforeEach(() => {
mocks.env.AUTH_MODE = "hosted";
- mocks.env.SHARES_ENABLED = undefined;
mocks.getSharedReportByToken.mockResolvedValue(SHARED_REPORT);
});
@@ -71,12 +69,6 @@ describe("loadSharePage", () => {
"an unknown or revoked token",
() => mocks.getSharedReportByToken.mockResolvedValue(null),
],
- [
- "the kill switch turned off",
- () => {
- mocks.env.SHARES_ENABLED = "false";
- },
- ],
// Sharing is hosted-only: a self-hosted deployment answers as if the
// link had never existed.
[
diff --git a/src/server/features/reports/shareRawRoute.test.ts b/src/server/features/reports/shareRawRoute.test.ts
index d79925a0..9399b0f2 100644
--- a/src/server/features/reports/shareRawRoute.test.ts
+++ b/src/server/features/reports/shareRawRoute.test.ts
@@ -8,7 +8,6 @@ import { REPORT_CSP } from "@/shared/report-sandbox";
const mocks = vi.hoisted(() => ({
env: {
AUTH_MODE: "hosted" as string | undefined,
- SHARES_ENABLED: undefined as string | undefined,
},
getSharedReportByToken: vi.fn(),
getReportHtml: vi.fn(),
@@ -63,7 +62,6 @@ const SHARED_REPORT = {
beforeEach(() => {
mocks.env.AUTH_MODE = "hosted";
- mocks.env.SHARES_ENABLED = undefined;
mocks.getSharedReportByToken.mockResolvedValue(SHARED_REPORT);
mocks.getReportHtml.mockResolvedValue(HTML);
});
@@ -131,12 +129,6 @@ describe("handleSharedReportRequest", () => {
archived: true,
}),
],
- [
- "the kill switch turned off",
- () => {
- mocks.env.SHARES_ENABLED = "false";
- },
- ],
// Sharing is hosted-only.
[
"a deployment that is not hosted",
diff --git a/src/server/features/sam/openseo-fact-sheet.md b/src/server/features/sam/openseo-fact-sheet.md
index 41e3958a..f20657ee 100644
--- a/src/server/features/sam/openseo-fact-sheet.md
+++ b/src/server/features/sam/openseo-fact-sheet.md
@@ -131,7 +131,7 @@ OpenSEO's app includes these practical workflows:
- Rank tracking: track keyword positions over time.
- Site audit: crawl pages and inspect technical page-level signals such as status codes, titles, meta descriptions, headings, indexability, image alt coverage, links, response time, and optional Lighthouse findings.
- Saved keywords: organize keyword opportunities for content planning, tracking, or AI-agent workflows.
-- Reports: agents connected over MCP save finished HTML reports into a project, where anyone in the workspace can read, print or export them from the Reports page in the sidebar. You cannot save reports yourself. Reports use no credits, and each project holds up to 100.
+- Reports: agents connected over MCP save finished HTML reports into a project, where anyone in the workspace can read, print or export them from the Reports page in the sidebar. You cannot save reports yourself. Reports use no credits, and each project holds up to 10,000.
- AI and MCP setup: connect OpenSEO to agents and install OpenSEO skills.
## What users can do after subscribing