[web] Licence: the Built on Domi credit (CPAL Exhibit B) on every screen and in About

This commit is contained in:
2026-11-23 00:19:22 +01:00
parent 7e59a76ee3
commit b20b2a69e5
5 changed files with 48 additions and 16 deletions
+9 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The release's screenshots (docs/release.md): every shot's screen is drawn from the demo control
// plane alone (each click and wait selector found, no call unanswered), and nothing the demo
@@ -54,6 +54,12 @@ describe("realLooking", () => {
expect(realLooking("gitea.example.cz and Mark's phone")).toEqual(["gitea.example.cz", "mark"]);
expect(realLooking("flowers.stage")).toEqual(["flowers.stage", "flowers"]);
});
it("leaves out only the licence's credit, exactly as written", () => {
expect(realLooking("Built on Domi · Copyright (c) 2026 Marek Novák https://aula.marek-novak.cz")).toEqual([]);
expect(realLooking("Marek's server at https://aula.marek-novak.cz/hosts")).toContain("marek");
expect(realLooking("files.marek-novak.cz")).toEqual(["files.marek-novak.cz", "marek", "novak"]);
});
});
describe("the release's screenshots from the demo control plane", () => {
+8 -5
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The demo control plane for the release's screenshots (docs/release.md): control's answers
// (docs/api.md) for a small invented home server, built on the click smoke test's stand-in
@@ -10,6 +10,7 @@
// on any other name or address.
import { apply, host, mockRoutes, newMock, nowMs, respond, type Route } from "./mockApi";
import { CREDIT } from "../src/lib/credit";
/** One screenshot: the page, the selectors clicked in order, and the selector that means "drawn". */
export interface Shot {
@@ -277,9 +278,11 @@ const ALLOWED_TLDS = new Set(["test", "example", "invalid"]);
const DOC_NETS = ["192.0.2.", "198.51.100.", "203.0.113."];
const FORBIDDEN = ["mark", "marek", "novak", "flowers", "esp32", "hyperv"];
/** What in a text could be real: addresses outside the documentation ranges, names outside .test. */
export function realLooking(text: string): string[] {
/** What in a text could be real: addresses outside the documentation ranges, names outside .test. The licence's
* credit (src/lib/credit.ts, LICENSE Exhibit B) is real on purpose and is the only text left out. */
export function realLooking(shown: string): string[] {
const found: string[] = [];
const text = [CREDIT.url, CREDIT.notice].reduce((t, c) => t.split(c).join(" "), shown);
for (const m of text.matchAll(/(?<![\w.])\d{1,3}(?:\.\d{1,3}){3}(?![\w.])/g)) {
if (m[0] !== "127.0.0.1" && !DOC_NETS.some((n) => m[0].startsWith(n))) found.push(m[0]);
}