diff --git a/app/imprint/page.tsx b/app/imprint/page.tsx index df43140..900f8cd 100644 --- a/app/imprint/page.tsx +++ b/app/imprint/page.tsx @@ -6,7 +6,11 @@ export const dynamic = 'force-dynamic' 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 004ff52..f1eab47 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://s.msk-scripts.de'), title: { - default: 'MSK Shortener – URL-Shortener', + default: 'MSK Shortener: URL shortener with QR codes', template: '%s | MSK Shortener', }, description: diff --git a/app/page.tsx b/app/page.tsx index 709e680..4756f01 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' @@ -17,6 +18,9 @@ export const dynamic = 'force-dynamic' const FACTS = ['codes', 'stats', 'qr', 'protect'] 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 7871c66..bbda64e 100644 --- a/app/privacy/page.tsx +++ b/app/privacy/page.tsx @@ -9,6 +9,7 @@ export async function generateMetadata() { return { title: t('metaTitle'), description: t('metaDescription'), + alternates: { canonical: '/privacy' }, } } diff --git a/app/stats/page.tsx b/app/stats/page.tsx index 581aa72..4e666bf 100644 --- a/app/stats/page.tsx +++ b/app/stats/page.tsx @@ -13,6 +13,7 @@ export async function generateMetadata() { return { title: t('metaTitle'), description: t('metaDescription'), + alternates: { canonical: '/stats' }, } } diff --git a/messages/de.json b/messages/de.json index 8d60d2a..681d125 100644 --- a/messages/de.json +++ b/messages/de.json @@ -48,6 +48,8 @@ "privacy": "Datenschutz" }, "imprintPage": { + "metaTitle": "Impressum und Kontakt", + "metaDescription": "Impressum von MSK Shortener, einem Dienst von MSK Scripts: Anbieter nach § 5 DDG, Anschrift und Kontakt.", "title": "Impressum", "section1Title": "Angaben gemäß § 5 DDG", "addressName": "Moritz Kohm", @@ -169,7 +171,7 @@ }, "globalStats": { "metaTitle": "Globale Statistiken", - "metaDescription": "Öffentliche, anonymisierte Statistiken aller verkürzten Links.", + "metaDescription": "Öffentliche, anonymisierte Statistiken aller verkürzten Links: Links und Klicks gesamt, heute und in den letzten 7 Tagen, dazu die häufigsten Browser.", "headerLabel": "Öffentliche Statistiken", "title": "Alle Zahlen auf einen Blick", "subtitle": "Anonymisierte Gesamtdaten dieser Instanz. Einzelne Links, URLs und IP-Adressen werden nicht angezeigt.", @@ -189,7 +191,7 @@ }, "privacy": { "metaTitle": "Datenschutzerklärung", - "metaDescription": "Datenschutzerklärung für MSK Shortener.", + "metaDescription": "Wie MSK Shortener mit Daten umgeht: Ziel-URL und Kurz-Code werden gespeichert, IP-Adressen nur als gesalzener Hash. Dazu deine Rechte nach der DSGVO.", "title": "Datenschutzerklärung", "lastUpdated": "Stand: Oktober 2026", "intro": "Wir nehmen den Schutz deiner persönlichen Daten sehr ernst. Diese Datenschutzerklärung informiert dich über Art, Umfang und Zweck der Verarbeitung personenbezogener Daten bei der Nutzung von MSK Shortener.", @@ -271,12 +273,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 2aff52e..607d23a 100644 --- a/messages/en.json +++ b/messages/en.json @@ -48,6 +48,8 @@ "privacy": "Privacy" }, "imprintPage": { + "metaTitle": "Imprint and contact", + "metaDescription": "Legal notice of MSK Shortener, 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", @@ -169,7 +171,7 @@ }, "globalStats": { "metaTitle": "Global statistics", - "metaDescription": "Public, anonymized statistics for all shortened links.", + "metaDescription": "Public, anonymized statistics of all shortened links: links and clicks in total, today and over the last 7 days, plus the most common browsers.", "headerLabel": "Public statistics", "title": "All numbers at a glance", "subtitle": "Anonymized aggregate data for this instance. Individual links, URLs and IP addresses are not shown.", @@ -189,7 +191,7 @@ }, "privacy": { "metaTitle": "Privacy Policy", - "metaDescription": "Privacy policy for MSK Shortener.", + "metaDescription": "How MSK Shortener handles data: the target URL and short code are stored, IP addresses only as a salted hash. Plus your rights under the GDPR.", "title": "Privacy Policy", "lastUpdated": "As of October 2026", "intro": "We take the protection of your personal data very seriously. This privacy policy informs you about the nature, scope and purpose of processing personal data when using MSK Shortener.", @@ -271,12 +273,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 0fc1dab..47757cc 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/shortener' }, + { label: t('documentation'), href: 'https://docu.msk-scripts.de/ecosystem/msk-shortener/' }, { label: t('github'), href: 'https://github.com/MSK-Scripts/msk-shortener' }, ], }, @@ -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 e08b986..9a2063a 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 6e5246c..c6d08b2 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',