progmaweb
The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.
Clonegit clone https://git.progmasoft.com/progmaweb
Hand catch3.uk to its own site
- Commit
289bd7665435dabba53f7923791bccabfb8d63d4- Author
- Leitwolf11 ·
- Parents
477625cd75db
Changes
apps/web/app/catch3/layout.tsx | 11 -- apps/web/app/catch3/page.tsx | 106 ------------------ apps/web/app/robots.ts | 3 +- apps/web/app/sitemap.ts | 5 - apps/web/e2e/pages.ts | 1 - apps/web/lib/product-sites.ts | 242 ----------------------------------------- apps/web/lib/sites.ts | 5 - apps/web/proxy.ts | 10 +- apps/web/tests/sites.test.mjs | 9 +- ops/README.md | 5 +- ops/nginx/progmaweb.conf | 67 ------------ 11 files changed, 8 insertions(+), 456 deletions(-) diff --git a/apps/web/app/catch3/layout.tsx b/apps/web/app/catch3/layout.tsx deleted file mode 100644 index 9b19285..0000000 --- a/apps/web/app/catch3/layout.tsx +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { ReactNode } from "react"; -import "../site.css"; - -export default function Catch3Layout({ - children, -}: Readonly<{ children: ReactNode }>) { - return children; -} diff --git a/apps/web/app/catch3/page.tsx b/apps/web/app/catch3/page.tsx deleted file mode 100644 index c32593f..0000000 --- a/apps/web/app/catch3/page.tsx +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Metadata } from "next"; -import { Footer } from "@/components/Footer"; -import { SiteHeader } from "@/components/SiteHeader"; -import { getLocale } from "@/lib/locale.server"; -import { products } from "@/lib/products"; -import { getSitesMessages } from "@/lib/product-sites"; - -export async function generateMetadata(): Promise<Metadata> { - const { catch3 } = getSitesMessages(await getLocale()); - return { - title: `Catch3 · ${catch3.tagline}`, - description: catch3.description, - alternates: { canonical: "https://catch3.uk/" }, - }; -} - -// The example of the Catch3 documentation (docs/progmasoft-properties.md). -const example = `#include <Progmasoft/Catch3.hpp> - -using namespace Progmasoft::Catch3; - -TEST_CASE( "reversing twice gives the original", "[property]" ) { - CATCH3_CHECK_FOR_ALL( - Gen::Vectors( Gen::Integers<int>() ), - []( const std::vector<int>& values ) { - auto copy = values; - std::reverse( copy.begin(), copy.end() ); - std::reverse( copy.begin(), copy.end() ); - return copy == values; - } ); -}`; - -/** catch3.uk: the site of Catch3. */ -export default async function Catch3Page() { - const locale = await getLocale(); - const { catch3, common } = getSitesMessages(locale); - return ( - <div className="pm-page"> - <SiteHeader locale={locale} /> - <main> - <section className="pm-hero"> - <div className="pm-shell pm-hero-inner"> - <div> - <p className="eyebrow">{catch3.eyebrow}</p> - <h1> - Catch3 <span>{catch3.tagline}</span> - </h1> - <p className="pm-lede">{catch3.description}</p> - <div className="pm-actions"> - <a className="button" href={products.catch3.source}> - {common.source} - </a> - <a - className="button button-secondary" - href="https://product.progmasoft.com/catch3" - > - {common.productPage} - </a> - </div> - <p className="pm-note">{catch3.disclaimer}</p> - </div> - <div> - <p className="eyebrow">{catch3.exampleTitle}</p> - <pre className="pm-code pm-code-light" dir="ltr"> - <code>{example}</code> - </pre> - </div> - </div> - </section> - - <section className="pm-section"> - <div className="pm-shell"> - <div className="pm-heading"> - <h2>{catch3.featuresTitle}</h2> - </div> - <div className="pm-bento"> - {catch3.features.map(([title, description]) => ( - <article className="pm-card" key={title}> - <h3>{title}</h3> - <p>{description}</p> - </article> - ))} - </div> - </div> - </section> - - <section className="pm-section pm-section-muted"> - <div className="pm-shell"> - <div className="pm-heading"> - <h2>{catch3.roadmapTitle}</h2> - </div> - <ul className="pm-features pm-roadmap"> - {catch3.roadmap.map((item) => ( - <li key={item}>{item}</li> - ))} - </ul> - </div> - </section> - </main> - <Footer locale={locale} /> - </div> - ); -} diff --git a/apps/web/app/robots.ts b/apps/web/app/robots.ts index 1bc1a5f..a82b6dc 100644 --- a/apps/web/app/robots.ts +++ b/apps/web/app/robots.ts @@ -21,8 +21,7 @@ export default async function robots(): Promise<MetadataRoute.Robots> { // Each host with pages of its own names its own sitemap. const sitemap = canonicalHost === "viget.progmasoft.com" || - canonicalHost === "product.progmasoft.com" || - canonicalHost === "catch3.uk" + canonicalHost === "product.progmasoft.com" ? `https://${canonicalHost}/sitemap.xml` : "https://progmasoft.com/sitemap.xml"; return { diff --git a/apps/web/app/sitemap.ts b/apps/web/app/sitemap.ts index 3c89ce8..20565a1 100644 --- a/apps/web/app/sitemap.ts +++ b/apps/web/app/sitemap.ts @@ -33,11 +33,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> { }, ]; } - if (host === "catch3.uk") { - return [ - { url: "https://catch3.uk/", changeFrequency: "weekly", priority: 1 }, - ]; - } if (host === "product.progmasoft.com") { return [ { diff --git a/apps/web/e2e/pages.ts b/apps/web/e2e/pages.ts index 6d95f77..31bb45d 100644 --- a/apps/web/e2e/pages.ts +++ b/apps/web/e2e/pages.ts @@ -19,7 +19,6 @@ export const layoutPages = [ "product.progmasoft.com/tazel", "product.progmasoft.com/catch3", "console.progmasoft.com/", - "catch3.uk/", ] as const; /** Every host name of the pages above. */ diff --git a/apps/web/lib/product-sites.ts b/apps/web/lib/product-sites.ts deleted file mode 100644 index e689d1e..0000000 --- a/apps/web/lib/product-sites.ts +++ /dev/null @@ -1,242 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Locale } from "./localization"; - -/** - * The text of the product site Progmaweb serves itself, catch3.uk. - * The facts follow the READMEs and documentation of the product repositories. - */ -interface SitesMessages { - common: { - source: string; - productPage: string; - status: string; - }; - catch3: { - eyebrow: string; - tagline: string; - description: string; - disclaimer: string; - exampleTitle: string; - featuresTitle: string; - features: [title: string, description: string][]; - roadmapTitle: string; - roadmap: string[]; - }; -} - -export const sitesMessages: Record<Locale, SitesMessages> = { - "en-US": { - common: { - source: "Source code", - productPage: "Product page", - status: "Status", - }, - catch3: { - eyebrow: "Progmasoft Catch3", - tagline: "C++ testing beyond assertions.", - description: - "Catch3 keeps the expressive test-writing model of Catch2 and adds a C++17 library of its own: native property testing, snapshots and structured results.", - disclaimer: - "Catch3 is independently maintained. It is not an official Catch2 release and is not endorsed by Catch2's maintainers.", - exampleTitle: "A first property", - featuresTitle: "What Catch3 adds", - features: [ - [ - "Familiar tests", - "Assertions, sections, reporters, benchmarks and the command line keep working through the Catch2-compatible surface.", - ], - [ - "Shrinking that always holds", - "Inputs shrink through their recorded choices, so a smaller counterexample still satisfies every filter and dependency.", - ], - [ - "Failures that come back", - "An example database replays failures first on the next run, on every machine that shares it, until they are fixed.", - ], - [ - "Oracles without expected values", - "Equivalent, Metamorphic, RoundTrip and Idempotent check properties that need no expected result, and state machines test stateful code.", - ], - [ - "Search and coverage", - "Target scores guide the search towards rare inputs, and Cover fails a property that reaches an interesting case too rarely.", - ], - [ - "Snapshots and results", - "Text snapshots with explicit files, and a structured result model written as JUnit-style XML.", - ], - ], - roadmapTitle: "On the roadmap", - roadmap: [ - "An independent test runner", - "Mocking", - "Coverage per test", - "Change-impact test selection and prioritization", - "Mutation testing", - "Coverage- and mutation-guided test generation", - ], - }, - }, - "de-DE": { - common: { - source: "Quellcode", - productPage: "Produktseite", - status: "Status", - }, - catch3: { - eyebrow: "Progmasoft Catch3", - tagline: "C++-Tests jenseits von Assertions.", - description: - "Catch3 behält das ausdrucksstarke Testmodell von Catch2 und ergänzt eine eigene C++17-Bibliothek: native Eigenschaftstests, Snapshots und strukturierte Ergebnisse.", - disclaimer: - "Catch3 wird unabhängig gepflegt. Es ist keine offizielle Catch2-Version und wird von den Catch2-Maintainern nicht unterstützt.", - exampleTitle: "Eine erste Eigenschaft", - featuresTitle: "Was Catch3 ergänzt", - features: [ - [ - "Vertraute Tests", - "Assertions, Sections, Reporter, Benchmarks und die Kommandozeile funktionieren weiter über die Catch2-kompatible Oberfläche.", - ], - [ - "Verkleinerung, die immer gilt", - "Eingaben werden über ihre aufgezeichneten Entscheidungen verkleinert; ein kleineres Gegenbeispiel erfüllt weiterhin alle Filter und Abhängigkeiten.", - ], - [ - "Fehler, die wiederkommen", - "Eine Beispieldatenbank spielt Fehler im nächsten Lauf zuerst ab, auf jedem Rechner, der sie teilt, bis sie behoben sind.", - ], - [ - "Orakel ohne erwartete Werte", - "Equivalent, Metamorphic, RoundTrip und Idempotent prüfen Eigenschaften ohne erwartetes Ergebnis; Zustandsmaschinen testen zustandsbehafteten Code.", - ], - [ - "Suche und Abdeckung", - "Target-Werte lenken die Suche zu seltenen Eingaben, und Cover lässt eine Eigenschaft scheitern, die einen interessanten Fall zu selten erreicht.", - ], - [ - "Snapshots und Ergebnisse", - "Text-Snapshots mit expliziten Dateien und ein strukturiertes Ergebnismodell als XML im JUnit-Stil.", - ], - ], - roadmapTitle: "Auf dem Fahrplan", - roadmap: [ - "Ein eigener Test-Runner", - "Mocking", - "Abdeckung pro Test", - "Testauswahl und Priorisierung nach Änderungsauswirkung", - "Mutationstests", - "Abdeckungs- und mutationsgesteuerte Testerzeugung", - ], - }, - }, - "ru-RU": { - common: { - source: "Исходный код", - productPage: "Страница продукта", - status: "Статус", - }, - catch3: { - eyebrow: "Progmasoft Catch3", - tagline: "Тестирование C++ за пределами утверждений.", - description: - "Catch3 сохраняет выразительную модель тестов Catch2 и добавляет собственную библиотеку на C++17: тестирование на основе свойств, снимки и структурированные результаты.", - disclaimer: - "Catch3 развивается независимо. Это не официальный выпуск Catch2, и сопровождающие Catch2 его не поддерживают.", - exampleTitle: "Первое свойство", - featuresTitle: "Что добавляет Catch3", - features: [ - [ - "Привычные тесты", - "Утверждения, секции, отчёты, бенчмарки и командная строка работают через совместимый с Catch2 интерфейс.", - ], - [ - "Упрощение, которое не ломается", - "Входные данные упрощаются через записанные выборы, поэтому меньший контрпример по-прежнему проходит все фильтры и зависимости.", - ], - [ - "Ошибки, которые возвращаются", - "База примеров первым делом повторяет найденные ошибки при следующем запуске на каждой машине, где она общая, пока их не исправят.", - ], - [ - "Оракулы без ожидаемых значений", - "Equivalent, Metamorphic, RoundTrip и Idempotent проверяют свойства без ожидаемого результата, а конечные автоматы тестируют код с состоянием.", - ], - [ - "Поиск и покрытие", - "Оценки Target ведут поиск к редким входам, а Cover проваливает свойство, которое слишком редко доходит до интересного случая.", - ], - [ - "Снимки и результаты", - "Текстовые снимки с явными файлами и структурированная модель результатов в XML в стиле JUnit.", - ], - ], - roadmapTitle: "В планах", - roadmap: [ - "Собственный запускатель тестов", - "Моки", - "Покрытие по каждому тесту", - "Выбор и приоритизация тестов по влиянию изменений", - "Мутационное тестирование", - "Генерация тестов под управлением покрытия и мутаций", - ], - }, - }, - "he-IL": { - common: { - source: "קוד מקור", - productPage: "דף המוצר", - status: "מצב", - }, - catch3: { - eyebrow: "Progmasoft Catch3", - tagline: "בדיקות C++ מעבר לטענות.", - description: - "Catch3 שומרת על מודל כתיבת הבדיקות של Catch2 ומוסיפה ספריית C++17 משלה: בדיקות מבוססות תכונות, תמונות מצב ותוצאות מובנות.", - disclaimer: - "Catch3 מתוחזקת באופן עצמאי. היא אינה גרסה רשמית של Catch2 ואינה נתמכת על ידי המתחזקים של Catch2.", - exampleTitle: "תכונה ראשונה", - featuresTitle: "מה Catch3 מוסיפה", - features: [ - [ - "בדיקות מוכרות", - "טענות, סעיפים, מדווחים, מדדי ביצועים ושורת הפקודה ממשיכים לעבוד דרך הממשק התואם ל־Catch2.", - ], - [ - "צמצום שתמיד תקף", - "הקלטים מצטמצמים דרך הבחירות שנרשמו, כך שדוגמה נגדית קטנה יותר עדיין עומדת בכל המסננים והתלויות.", - ], - [ - "כשלים שחוזרים", - "מסד דוגמאות מריץ קודם את הכשלים בהרצה הבאה, בכל מחשב שחולק אותו, עד שהם מתוקנים.", - ], - [ - "אורקלים בלי ערכים צפויים", - "Equivalent, Metamorphic, RoundTrip ו־Idempotent בודקים תכונות שלא צריכות תוצאה צפויה, ומכונות מצבים בודקות קוד עם מצב.", - ], - [ - "חיפוש וכיסוי", - "ציוני Target מכוונים את החיפוש לקלטים נדירים, ו־Cover מכשיל תכונה שמגיעה למקרה מעניין לעיתים רחוקות מדי.", - ], - [ - "תמונות מצב ותוצאות", - "תמונות מצב טקסטואליות עם קבצים מפורשים, ומודל תוצאות מובנה שנכתב כ־XML בסגנון JUnit.", - ], - ], - roadmapTitle: "בתוכנית", - roadmap: [ - "מריץ בדיקות עצמאי", - "אובייקטים מדומים", - "כיסוי לכל בדיקה", - "בחירת בדיקות ותעדוף לפי השפעת השינוי", - "בדיקות מוטציה", - "יצירת בדיקות מונחית כיסוי ומוטציות", - ], - }, - }, -}; - -export function getSitesMessages(locale: Locale): SitesMessages { - return sitesMessages[locale]; -} diff --git a/apps/web/lib/sites.ts b/apps/web/lib/sites.ts index 5204339..7eff43b 100644 --- a/apps/web/lib/sites.ts +++ b/apps/web/lib/sites.ts @@ -22,8 +22,3 @@ export function productRoute(pathname: string): string | null { ? `/products${path}` : null; } - -/** The public page of catch3.uk. */ -export function catch3Route(pathname: string): string | null { - return trimmed(pathname) === "/" ? "/catch3" : null; -} diff --git a/apps/web/proxy.ts b/apps/web/proxy.ts index 4bf1163..f482240 100644 --- a/apps/web/proxy.ts +++ b/apps/web/proxy.ts @@ -10,7 +10,7 @@ import { requestHost, } from "@/lib/localization"; import { authorizeRoute, consoleRoute, issuerRoute } from "@/lib/credentials"; -import { catch3Route, productRoute } from "@/lib/sites"; +import { productRoute } from "@/lib/sites"; import { contentSecurityPolicy, createNonce, @@ -57,14 +57,6 @@ const ownSites: OwnSite[] = [ route: productRoute, api: false, }, - // Catch3's site has a domain of its own; catch3.progmasoft.com sends a 308 - // there from nginx. - { - hosts: new Set(["catch3.uk", "catch3.localhost"]), - root: "/catch3", - route: catch3Route, - api: false, - }, ]; export function proxy(request: NextRequest) { diff --git a/apps/web/tests/sites.test.mjs b/apps/web/tests/sites.test.mjs index 77c89d4..fac8fa3 100644 --- a/apps/web/tests/sites.test.mjs +++ b/apps/web/tests/sites.test.mjs @@ -5,14 +5,13 @@ import assert from "node:assert/strict"; import { test } from "node:test"; import { homeMessages } from "../lib/home-messages.ts"; import { supportedLocales } from "../lib/localization.ts"; -import { sitesMessages } from "../lib/product-sites.ts"; import { catalogMessages, isProductSlug, productSlugs, products, } from "../lib/products.ts"; -import { catch3Route, productRoute } from "../lib/sites.ts"; +import { productRoute } from "../lib/sites.ts"; function shape(value) { if (Array.isArray(value)) { @@ -28,8 +27,8 @@ function shape(value) { ); } -test("every language has the same home, catalog and product-site text", () => { - for (const messages of [homeMessages, catalogMessages, sitesMessages]) { +test("every language has the same home and catalog text", () => { + for (const messages of [homeMessages, catalogMessages]) { const english = shape(messages["en-US"]); for (const locale of supportedLocales) { assert.deepEqual(shape(messages[locale]), english, locale); @@ -79,6 +78,4 @@ test("the product hosts map to their internal routes", () => { assert.equal(productRoute("/catch3/"), "/products/catch3"); assert.equal(productRoute("/tazel/extra"), null); assert.equal(productRoute("/../x"), null); - assert.equal(catch3Route("/"), "/catch3"); - assert.equal(catch3Route("/docs"), null); }); diff --git a/ops/README.md b/ops/README.md index 252bfb0..581e07d 100644 --- a/ops/README.md +++ b/ops/README.md @@ -192,8 +192,9 @@ token, so every application has to ask again. Back up both files with the databa The certificate of `progmasoft.com` must name `credentials.progmasoft.com`, `authorize.progmasoft.com`, `console.progmasoft.com`, `product.progmasoft.com` and `catch3.progmasoft.com` as well; expand it with certbot's webroot plugin before the vhosts are enabled, then check `/.well-known/openid-configuration`, the sign-in page and the console from outside. `catch3.progmasoft.com` only -sends a 308 to `catch3.uk`, the site of Catch3, which has a certificate of its own for `catch3.uk` and -`www.catch3.uk` (`certbot certonly --webroot -w /var/lib/letsencrypt -d catch3.uk -d www.catch3.uk --key-type +sends a 308 to `catch3.uk`, the site of Catch3. That site is not Progmaweb's: it is the static output of +Progmasoft/catch3.uk, served by its own nginx file (`catch3-uk.conf`), with a certificate of its own for `catch3.uk` +and `www.catch3.uk` (`certbot certonly --webroot -w /var/lib/letsencrypt -d catch3.uk -d www.catch3.uk --key-type ecdsa`). ## Reserved accounts diff --git a/ops/nginx/progmaweb.conf b/ops/nginx/progmaweb.conf index 59dee68..20839c8 100644 --- a/ops/nginx/progmaweb.conf +++ b/ops/nginx/progmaweb.conf @@ -497,73 +497,6 @@ server { } } -# catch3.uk: the site of Catch3, pages of the Next.js site only. www goes to -# the bare name. -server { - listen 80; - listen [::]:80; - server_name catch3.uk www.catch3.uk; - server_tokens off; - - location ^~ /.well-known/acme-challenge/ { - root /var/lib/letsencrypt; - default_type text/plain; - } - - location / { - return 308 https://catch3.uk$request_uri; - } -} - -server { - listen 443 ssl; - listen [::]:443 ssl; - http2 on; - server_name www.catch3.uk; - server_tokens off; - - ssl_certificate /etc/letsencrypt/live/catch3.uk/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/catch3.uk/privkey.pem; - include /etc/letsencrypt/options-ssl-nginx.conf; - - add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; - - location / { - return 308 https://catch3.uk$request_uri; - } -} - -server { - listen 443 ssl; - listen [::]:443 ssl; - http2 on; - server_name catch3.uk; - server_tokens off; - - ssl_certificate /etc/letsencrypt/live/catch3.uk/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/catch3.uk/privkey.pem; - include /etc/letsencrypt/options-ssl-nginx.conf; - - client_max_body_size 1m; - - add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; - add_header X-Content-Type-Options "nosniff" always; - add_header X-Frame-Options "DENY" always; - add_header Referrer-Policy "strict-origin-when-cross-origin" always; - add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always; - - location / { - proxy_pass http://127.0.0.1:3010; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 60s; - } -} - # The Maven repository of Progmasoft: /tazel holds com.progmasoft.tazel:tazel-api, # which plugins of Tazel compile against. Static files only, copied from the # Gradle staging repository of a release; see ops/README.md.