Skip to content

Launch prep: security headers, push rate limit, link previews, community files - #19

Merged
acesonic7 merged 1 commit into
mainfrom
chore/launch-prep
Oct 7, 2026
Merged

acesonic7 merged 1 commit into
mainfrom
chore/launch-prep

Conversation

@acesonic7

Copy link
Copy Markdown
Owner

Stacked on #18; merge that one first.

Summary

Security

  • Security headers on every response (next.config.mjs):
    • Content-Security-Policy: same-origin scripts, plus inline ones for Next's bootstrap and the theme script; https/data/blob images; frame-ancestors 'none', object-src 'none', base-uri and form-action set to self. Development also allows eval and websockets for hot reload.
    • X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, X-Frame-Options: DENY, Cross-Origin-Opener-Policy: same-origin and a restrictive Permissions-Policy.
    • X-Powered-By is dropped.
  • Push route rate limit (lib/rateLimit.ts): 20 attempts per 10 minutes per client, per serverless instance, answering 429 with Retry-After. Instances don't share memory, so this brakes bursts; a global limit belongs in the Vercel firewall.

Link previews

  • app/opengraph-image.tsx: a 1200×630 image (matrix-U logo, tagline, "Free and open source") rendered at build time in Bricolage Grotesque and Instrument Sans.
  • Open Graph and Twitter summary_large_image tags, a clearer title and description, keywords, and metadataBase.
  • robots.txt (with /api/ disallowed) and sitemap.xml.
  • The public address lives in lib/site.ts and can be overridden with NEXT_PUBLIC_SITE_URL when the app moves to its own domain.

Repo

  • SECURITY.md, which points to GitHub private vulnerability reporting; CONTRIBUTING.md, including the terminology rule; and CODE_OF_CONDUCT.md, adopting Contributor Covenant 2.1 by reference.
  • Issue templates for bugs and feature requests (the bug template asks for browser, version and project file), a security contact link, and a PR template.
  • out/ is no longer tracked: its files had the old eu-urban-commute names. The export and preview scripts now create the folder themselves.
  • The package is renamed from sp-designer to utilitylab.

Test plan

  • npx tsc --noEmit, npm test (1038 passed, 4 new), npm run build
  • Production build: all headers present; OG and Twitter tags resolve to the absolute image URL; the image renders correctly; robots.txt and the sitemap are served
  • No CSP violations in the browser (production and dev) across:
    • page load and the example;
    • design generation in the worker;
    • the Qualtrics preview iframe and the Studies dialog;
    • an external https image.
  • After deploying: check the preview with a link debugger (LinkedIn Post Inspector or opengraph.xyz)

🤖 Generated with Claude Code

… community files

Every response now carries a Content-Security-Policy, nosniff, a strict referrer
policy, frame denial, COOP and a restrictive Permissions-Policy, and drops
X-Powered-By. The LimeSurvey push route limits each client to 20 attempts per
10 minutes per instance. Link previews get Open Graph and Twitter tags, a
generated 1200x630 image in the app's own fonts, robots.txt and a sitemap, with
the address configurable through NEXT_PUBLIC_SITE_URL. Adds SECURITY.md,
CONTRIBUTING.md, a code of conduct and issue/PR templates, stops tracking the
old out/ script output, and renames the package to utilitylab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
utilitylab Ready Ready Preview Oct 7, 2026 2:13pm UTC

@acesonic7
acesonic7 changed the base branch from chore/security-upgrade to main October 7, 2026 14:13
@acesonic7
acesonic7 merged commit 1bd9541 into main Oct 7, 2026
3 checks passed
@acesonic7
acesonic7 deleted the chore/launch-prep branch October 7, 2026 14:15

This branch was successfully deployed

1 active deployment
Preview — c2d82c49 Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant