From a0f783a489149d233b0f8b5aad359779bf63c3b2 Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Wed, 25 Nov 2026 12:06:06 +0100 Subject: [PATCH] Fix the findings of an OpenSpider crawl Crawl of paste.msk-scripts.de on 25.11.2026, 46 URLs. - The header logo had an empty alt text. It now carries the link's name, the written name next to it is aria-hidden. - No page had a canonical. Home, stats, imprint and privacy name their own path. - The footer linked docu.msk-scripts.de/paste, which answers 404. It now points at /ecosystem/msk-paste/. musiker15.de is linked in the page language instead of through its 307. - The shop menu no longer links the paid catalogue and the all-access subscription, which redirect since the scripts went free on 05.11.2026. Their four message keys are gone. - Privacy and stats had no metadata of their own and showed the home page's title and description, the imprint shared the description too and had a title under 30 characters. All three have their own now, and the default title names what the tool does. - htmlLimitedBots matches every user agent, so metadata is never streamed after . - Build assets under /_next/static and /_next/image get the security headers the proxy sets for documents. --- app/imprint/page.tsx | 6 +++- app/layout.tsx | 2 +- app/page.tsx | 4 +++ app/privacy/page.tsx | 9 ++++++ app/stats/page.tsx | 9 ++++++ messages/de.json | 10 ++++--- messages/en.json | 10 ++++--- next.config.ts | 24 ++++++++++++++++ src/components/site/HeaderBar.tsx | 12 +++++--- src/components/site/SiteFooter.tsx | 4 +-- src/components/site/SiteHeader.tsx | 4 +-- src/components/site/navigation.test.ts | 39 ++++++++++++++++++++++++++ src/components/site/navigation.ts | 11 +++----- src/lib/shopUrl.ts | 2 -- 14 files changed, 119 insertions(+), 27 deletions(-) create mode 100644 src/components/site/navigation.test.ts diff --git a/app/imprint/page.tsx b/app/imprint/page.tsx index 064d70a..234ac1a 100644 --- a/app/imprint/page.tsx +++ b/app/imprint/page.tsx @@ -4,7 +4,11 @@ import { SiteFrame } from '@/components/site/SiteFrame' export async function generateMetadata() { const t = await getTranslations('imprintPage') - return { title: t('title') } + return { + title: t('metaTitle'), + description: t('metaDescription'), + alternates: { canonical: '/imprint' }, + } } export default async function ImprintPage() { diff --git a/app/layout.tsx b/app/layout.tsx index f68812c..68586f4 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -15,7 +15,7 @@ import { ThemeProvider } from '@/components/theme/ThemeProvider' export const metadata: Metadata = { metadataBase: new URL(process.env.NEXT_PUBLIC_BASE_URL ?? 'https://paste.msk-scripts.de'), title: { - default: 'MSK Paste – Self-hosted Pastebin', + default: 'MSK Paste: pastebin with syntax highlighting', template: '%s | MSK Paste', }, description: diff --git a/app/page.tsx b/app/page.tsx index d0c3551..d1e9bd1 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,3 +1,4 @@ +import type { Metadata } from 'next' import Link from 'next/link' import Script from 'next/script' import { headers } from 'next/headers' @@ -16,6 +17,9 @@ export const dynamic = 'force-dynamic' const FACTS = ['highlight', 'expiry', 'protect', 'raw'] as const +// The home page names itself; metadataBase in the root layout makes it absolute. +export const metadata: Metadata = { alternates: { canonical: '/' } } + export default async function HomePage() { const t = await getTranslations('home') const nonce = (await headers()).get('x-nonce') ?? undefined diff --git a/app/privacy/page.tsx b/app/privacy/page.tsx index 0b429b7..e081f63 100644 --- a/app/privacy/page.tsx +++ b/app/privacy/page.tsx @@ -20,6 +20,15 @@ const SECTIONS = [ 'contact', ] as const +export async function generateMetadata() { + const t = await getTranslations('privacy') + return { + title: t('metaTitle'), + description: t('metaDescription'), + alternates: { canonical: '/privacy' }, + } +} + export default async function PrivacyPage() { const t = await getTranslations('privacy') diff --git a/app/stats/page.tsx b/app/stats/page.tsx index 08bbae4..d03b419 100644 --- a/app/stats/page.tsx +++ b/app/stats/page.tsx @@ -7,6 +7,15 @@ import { getGlobalStats } from '@/lib/stats' // Always fetch the latest numbers — caching happens in the API layer. export const dynamic = 'force-dynamic' +export async function generateMetadata() { + const t = await getTranslations('stats') + return { + title: t('metaTitle'), + description: t('metaDescription'), + alternates: { canonical: '/stats' }, + } +} + export default async function StatsPage() { const t = await getTranslations('stats') diff --git a/messages/de.json b/messages/de.json index b22aa25..886e980 100644 --- a/messages/de.json +++ b/messages/de.json @@ -14,6 +14,8 @@ "optional": "optional" }, "imprintPage": { + "metaTitle": "Impressum und Kontakt", + "metaDescription": "Impressum von MSK Paste, einem Dienst von MSK Scripts: Anbieter nach § 5 DDG, Anschrift und Kontakt.", "title": "Impressum", "section1Title": "Angaben gemäß § 5 DDG", "addressName": "Moritz Kohm", @@ -155,6 +157,8 @@ "backHome": "Zurück zur Startseite" }, "stats": { + "metaTitle": "Statistik aller Pastes", + "metaDescription": "Globale Auswertung über alle Pastes von MSK Paste: Pastes insgesamt, heute und in dieser Woche, dazu die meistgenutzten Programmiersprachen.", "title": "Statistik", "subtitle": "Globale Auswertung über alle Pastes.", "totalPastes": "Pastes insgesamt", @@ -164,6 +168,8 @@ "noData": "Noch keine Daten verfügbar" }, "privacy": { + "metaTitle": "Datenschutzerklärung", + "metaDescription": "Wie MSK Paste mit Daten umgeht: was beim Erstellen einer Paste gespeichert wird, wann es gelöscht wird, kein Tracking, und deine Rechte nach der DSGVO.", "title": "Datenschutzerklärung", "lastUpdated": "Stand: {date}", "intro": { @@ -278,12 +284,8 @@ "submenu": "Mehr unter {name}", "newTab": "(öffnet in neuem Tab)", "fivem": "FiveM-Scripts", - "fivemPaid": "Bezahl-Scripts", - "fivemPaidDesc": "Jedes Script als Encrypted oder Source", "fivemFree": "Kostenlose Scripts", "fivemFreeDesc": "Open Source auf GitHub, samt msk_core", - "fivemAllAccess": "Alle Scripts im Abo", - "fivemAllAccessDesc": "Zugriff auf sämtliche Ressourcen, monatlich kündbar", "fivemStats": "Serverstatistiken", "fivemStatsDesc": "Live-Serverzahlen je Script", "discord": "Discord-Bots", diff --git a/messages/en.json b/messages/en.json index f894d1d..47c6911 100644 --- a/messages/en.json +++ b/messages/en.json @@ -14,6 +14,8 @@ "optional": "optional" }, "imprintPage": { + "metaTitle": "Imprint and contact", + "metaDescription": "Legal notice of MSK Paste, a service by MSK Scripts: provider under § 5 DDG, postal address and contact details.", "title": "Legal Notice", "section1Title": "Information according to § 5 DDG", "addressName": "Moritz Kohm", @@ -155,6 +157,8 @@ "backHome": "Back to home" }, "stats": { + "metaTitle": "Statistics of all pastes", + "metaDescription": "Global figures across all pastes on MSK Paste: pastes in total, today and this week, plus the most used programming languages.", "title": "Statistics", "subtitle": "Global overview across all pastes.", "totalPastes": "Total pastes", @@ -164,6 +168,8 @@ "noData": "No data available yet" }, "privacy": { + "metaTitle": "Privacy Policy", + "metaDescription": "How MSK Paste handles data: what is stored when you create a paste, when it is deleted, no tracking, and your rights under the GDPR.", "title": "Privacy policy", "lastUpdated": "Last updated: {date}", "intro": { @@ -278,12 +284,8 @@ "submenu": "More in {name}", "newTab": "(opens in a new tab)", "fivem": "FiveM scripts", - "fivemPaid": "Paid scripts", - "fivemPaidDesc": "Every script as Encrypted or Source", "fivemFree": "Free scripts", "fivemFreeDesc": "Open source on GitHub, msk_core included", - "fivemAllAccess": "All-access subscription", - "fivemAllAccessDesc": "Access to every resource, cancel monthly", "fivemStats": "Server statistics", "fivemStatsDesc": "Live server counts per script", "discord": "Discord bots", diff --git a/next.config.ts b/next.config.ts index aa96929..fdb991f 100644 --- a/next.config.ts +++ b/next.config.ts @@ -12,6 +12,30 @@ const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts') const nextConfig: NextConfig = { reactStrictMode: true, poweredByHeader: false, + // Metadata is resolved before the head is sent, for every user agent. Next + // streams it for anything outside its own bot list, and a canonical that + // resolves after the shell lands after . One regex for all turns + // streaming off. + htmlLimitedBots: /.*/, + // The proxy sets the security headers for documents but does not run for + // build assets (see its matcher). These static headers are no duplicate of + // it: the paths below never reach the proxy. Static files get a CSP that + // allows nothing, since they are no documents. + async headers() { + const base = [ + { key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' }, + { key: 'X-Content-Type-Options', value: 'nosniff' }, + { key: 'X-Frame-Options', value: 'DENY' }, + { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' }, + ] + return [ + { + source: '/_next/static/:path*', + headers: [...base, { key: 'Content-Security-Policy', value: "default-src 'none'; frame-ancestors 'none'" }], + }, + { source: '/_next/image', headers: base }, + ] + }, } export default withNextIntl(nextConfig) diff --git a/src/components/site/HeaderBar.tsx b/src/components/site/HeaderBar.tsx index 62d0b3e..27c8b9c 100644 --- a/src/components/site/HeaderBar.tsx +++ b/src/components/site/HeaderBar.tsx @@ -195,10 +195,14 @@ export function HeaderBar({
- - {/* Below 360 px the name gives way to the buttons; it stays the - link's name for a screen reader. */} - + {TOOL.name} + {/* The logo carries the link's name, so a screen reader hears it + once and it stays there below 360 px, where the written name + gives way to the buttons. */} + diff --git a/src/components/site/SiteFooter.tsx b/src/components/site/SiteFooter.tsx index a9c20a7..ca3f648 100644 --- a/src/components/site/SiteFooter.tsx +++ b/src/components/site/SiteFooter.tsx @@ -37,7 +37,7 @@ export async function SiteFooter() { title: t('footerProduct'), links: [ { label: t('stats'), href: '/stats' }, - { label: t('documentation'), href: 'https://docu.msk-scripts.de/paste' }, + { label: t('documentation'), href: 'https://docu.msk-scripts.de/ecosystem/msk-paste/' }, { label: t('github'), href: 'https://github.com/MSK-Scripts/msk-paste' }, ], }, @@ -118,7 +118,7 @@ export async function SiteFooter() { {t('builtBy')}{' '} for user agents outside + * Next's bot list, the build assets had none of the security headers, and the + * shop menu linked two addresses that only redirect since the scripts went free. + */ +describe('next.config', () => { + it('blocks on metadata for every user agent', () => { + const bots = nextConfig.htmlLimitedBots as RegExp + for (const ua of ['Mozilla/5.0 Chrome/142.0', 'OpenSpider/1.0', '']) expect(bots.test(ua)).toBe(true) + }) + + it('sends the security headers with static files and optimised images', async () => { + const rules = await nextConfig.headers!() + for (const source of ['/_next/static/:path*', '/_next/image']) { + const keys = rules.find(r => r.source === source)?.headers.map(h => h.key) ?? [] + expect(keys, source).toEqual(expect.arrayContaining([ + 'Strict-Transport-Security', 'X-Content-Type-Options', 'X-Frame-Options', 'Referrer-Policy', + ])) + } + }) +}) + +describe('shop navigation', () => { + it('links no shop address that only redirects', () => { + for (const [locale, messages] of [['en', en], ['de', de]] as const) { + const fivem = productLines(messages.site as unknown as SiteCopy, locale).find(l => l.id === 'fivem')! + const hrefs = [fivem.href, ...fivem.links.map(l => l.href)] + expect(hrefs.some(h => /\/fivem$|all-access|alle-scripts/.test(h)), hrefs.join(' ')).toBe(false) + } + }) +}) diff --git a/src/components/site/navigation.ts b/src/components/site/navigation.ts index c351fbd..8e823d1 100644 --- a/src/components/site/navigation.ts +++ b/src/components/site/navigation.ts @@ -39,12 +39,8 @@ export interface SiteCopy { menu: string language: string fivem: string - fivemPaid: string - fivemPaidDesc: string fivemFree: string fivemFreeDesc: string - fivemAllAccess: string - fivemAllAccessDesc: string fivemStats: string fivemStatsDesc: string discord: string @@ -64,13 +60,14 @@ export function productLines(t: SiteCopy, locale: string): ProductLine[] { return [ { id: 'fivem', - href: shopUrl(locale, '/fivem'), + // Since 05.11.2026 every FiveM script is free on GitHub. The shop's menu + // has the free scripts and the statistics; the paid catalogue and the + // all-access subscription only redirect there. + href: shopUrl(locale, '/fivem/free'), label: t.fivem, current: false, links: [ - { href: shopUrl(locale, '/fivem'), label: t.fivemPaid, description: t.fivemPaidDesc }, { href: shopUrl(locale, '/fivem/free'), label: t.fivemFree, description: t.fivemFreeDesc }, - { href: shopUrl(locale, '/fivem/all-access'), label: t.fivemAllAccess, description: t.fivemAllAccessDesc }, { href: shopUrl(locale, '/stats'), label: t.fivemStats, description: t.fivemStatsDesc }, ], }, diff --git a/src/lib/shopUrl.ts b/src/lib/shopUrl.ts index 74a3fd5..14145c1 100644 --- a/src/lib/shopUrl.ts +++ b/src/lib/shopUrl.ts @@ -11,9 +11,7 @@ export const SHOP_ORIGIN = 'https://www.msk-scripts.de' /** Internal path on the shop, with its German public form. */ const SHOP_ROUTES = { '/': '/', - '/fivem': '/fivem', '/fivem/free': '/fivem/kostenlos', - '/fivem/all-access': '/fivem/alle-scripts', '/stats': '/statistiken', '/discord': '/discord', '/discord/ticket-bot': '/discord/ticket-bot',