[web] Licence: the Built on Domi credit (CPAL Exhibit B) on every screen and in About
This commit is contained in:
+11
-4
@@ -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). -->
|
||||
<script lang="ts">
|
||||
// The shell (handoff §2.16): sidebar on desktop, top and bottom bars on phone, the routes,
|
||||
// the banners every screen starts with, toasts and the signed-out dialog (§10).
|
||||
@@ -12,6 +12,7 @@
|
||||
import TopBanners from "./components/TopBanners.svelte";
|
||||
import { app, navigate, refresh, startPolling } from "./lib/app.svelte";
|
||||
import { remembered } from "./lib/applies";
|
||||
import { CREDIT } from "./lib/credit";
|
||||
import Certificates from "./views/Certificates.svelte";
|
||||
import History from "./views/History.svelte";
|
||||
import Hosts from "./views/Hosts.svelte";
|
||||
@@ -104,6 +105,7 @@
|
||||
<p>{viewer?.via === "authelia" ? `Signed in as ${viewer.name} through Authelia` : viewer ? `Using the API token "${viewer.name}"` : "Signed in through Authelia"}</p>
|
||||
<p>Control on 127.0.0.1 only</p>
|
||||
{#if app.overview?.site?.auth_logout_url}<a class="domi-btn link" href={app.overview.site.auth_logout_url}>Sign out</a>{/if}
|
||||
<p class="credit"><a href={CREDIT.url} rel="noreferrer">{CREDIT.phrase}</a> · {CREDIT.notice}</p>
|
||||
</div>
|
||||
</nav>
|
||||
<header class="topbar"><span class="ia-wordmark">IANITOR DOMI</span>{#if app.phone}<EngineChip />{/if}</header>
|
||||
@@ -120,6 +122,7 @@
|
||||
{:else if route.view === "settings"}
|
||||
<Settings tab={route.tab} />
|
||||
{/if}
|
||||
<p class="credit phone-credit ia-muted"><a href={CREDIT.url} rel="noreferrer">{CREDIT.phrase}</a> · {CREDIT.notice}</p>
|
||||
</main>
|
||||
<nav class="bottombar" aria-label="Main">
|
||||
{#each NAV as n (n.href)}
|
||||
@@ -160,10 +163,14 @@
|
||||
.nav[aria-current="page"] :global(svg) { color: var(--accent); }
|
||||
.foot { margin-top: auto; font-size: 0.82rem; display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
|
||||
main { padding: var(--main-pad); display: flex; flex-direction: column; gap: 18px; min-width: 0; outline: none; }
|
||||
.topbar, .bottombar { display: none; }
|
||||
.topbar, .bottombar, .phone-credit { display: none; }
|
||||
/* LICENSE, Exhibit B (CPAL §14): on every screen, in the sidebar or, on a phone, at the foot of the page. */
|
||||
.credit { margin-top: 6px; font-size: 0.78rem; }
|
||||
.credit a { color: var(--accent); }
|
||||
@media (max-width: 719.98px) {
|
||||
.shell { grid-template-columns: minmax(0, 1fr); }
|
||||
.sidebar { display: none; }
|
||||
.phone-credit { display: block; margin-top: auto; text-align: center; }
|
||||
.topbar { display: flex; align-items: center; justify-content: space-between; background: var(--colonnade); border-bottom: 1px solid var(--hairline); padding: 10px 16px; }
|
||||
.topbar .ia-wordmark { font-size: 12px; letter-spacing: 0.26em; }
|
||||
main { padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); gap: 14px; }
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// 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 attribution of LICENSE, Exhibit B. CPAL §14 asks for it on the interface a user reaches the code through,
|
||||
* and §15 counts use over a network: every screen of the web UI shows it (the sidebar, or the page foot on a phone),
|
||||
* and Settings, About shows it in full.
|
||||
*/
|
||||
export const CREDIT = {
|
||||
phrase: "Built on Domi",
|
||||
notice: "Copyright (c) 2026 Marek Novák",
|
||||
url: "https://aula.marek-novak.cz",
|
||||
} as const;
|
||||
@@ -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). -->
|
||||
<script lang="ts">
|
||||
// Handoff §8.3: Settings with General, API (⚙ → API → New token = 3 clicks, Copy token the
|
||||
// accepted 4th), Share links and About.
|
||||
@@ -9,6 +9,7 @@
|
||||
import { ApiError, call, del, get, newKey, patch, post, sentence } from "../lib/api";
|
||||
import { app, navigate, toast } from "../lib/app.svelte";
|
||||
import { longDate, shortDate, whenInline } from "../lib/format";
|
||||
import { CREDIT } from "../lib/credit";
|
||||
import type { CreatedToken, ShareLink, TokenRow } from "../lib/types";
|
||||
|
||||
let { tab }: { tab: string } = $props();
|
||||
@@ -234,7 +235,8 @@
|
||||
{/if}
|
||||
{:else}
|
||||
<p>Ianitor Domi 0.1.0</p>
|
||||
<p>MPL-2.0</p>
|
||||
<p>CPAL-1.0 (Common Public Attribution License 1.0). Ianitor 0.2.0 and earlier stay MPL-2.0.</p>
|
||||
<p><a class="domi-btn link" href={CREDIT.url} rel="noreferrer">{CREDIT.phrase}</a> · {CREDIT.notice}</p>
|
||||
<p>Built, tested and signed by Fabrica Domi</p>
|
||||
<p><a class="domi-btn link" href="https://gitea.marek-novak.cz/mnovak/Ianitor" rel="noreferrer">Source on Gitea</a></p>
|
||||
{/if}
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user