Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cc16eeade6 | |||
| b20b2a69e5 | |||
| 7e59a76ee3 | |||
| 8b4570ca1a | |||
| d9871ae1b7 | |||
| aca9bd8d9f | |||
| 8efea92c01 | |||
| b0e92ff262 | |||
| a626c2559f | |||
| 7aa8b0ea62 | |||
| 805b4b8db5 | |||
| ec4a0086b9 | |||
| 6c11acdc6d | |||
| 82339f098f | |||
| 76a56311cf | |||
| a212d5d421 |
+8
-4
@@ -1,10 +1,14 @@
|
|||||||
# Ianitor Domi declares itself to Fabrica (Fabrica core docs/FORMATS.md, "Fabrica: the app"): a server part only,
|
# Ianitor Domi declares itself to Fabrica (Fabrica core docs/FORMATS.md, "Fabrica: the app"; docs/fabrica.md): a server
|
||||||
# the reverse proxy with its control plane and web UI, deployed by .fabrica/artifex/deploy.yaml through the server's
|
# part only, the reverse proxy with its control plane and web UI, deployed by .fabrica/artifex/deploy.yaml through the
|
||||||
# fabrica-deploy@ianitor. Fabrica's Apps screen shows one card for it: Deploy, then the Custos card. The colour is
|
# server's fabrica-deploy@ianitor, which is also how it updates. Its Aula page comes from the release of a `v*` tag
|
||||||
# the murex accent (packages/ui/src/tokens.css, --accent).
|
# (.fabrica/artifex/release.yaml), started on the hub for the pushed tag: no desktop part, as Ianitor has no installer
|
||||||
|
# to bump and tag. Fabrica's Apps screen shows one card: Deploy, then the Custos card. The colour is the murex accent
|
||||||
|
# (packages/ui/src/tokens.css, --accent).
|
||||||
name: Ianitor
|
name: Ianitor
|
||||||
icon: globe
|
icon: globe
|
||||||
color: "#e0a3dc"
|
color: "#e0a3dc"
|
||||||
|
aula: true
|
||||||
|
tagPrefix: v
|
||||||
parts:
|
parts:
|
||||||
server:
|
server:
|
||||||
pipeline: deploy
|
pipeline: deploy
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Ianitor Domi: the web UI's e2e suite on Fabrica's e2e runner (docs/fabrica.md part 6; Fabrica docs/20_tests.md,
|
||||||
|
# docs/31_runners_here.md): the built UI against the demo control plane, Playwright headless in the installed Edge,
|
||||||
|
# the records, traces and videos kept with the run. Manual: no push webhook reaches the hub yet. The e2e runner's
|
||||||
|
# runner.json sets PLAYWRIGHT_BROWSERS_PATH (Playwright's ffmpeg for the videos; on D: or F:, never C:).
|
||||||
|
name: e2e
|
||||||
|
on:
|
||||||
|
manual: true
|
||||||
|
runner: windows-e2e
|
||||||
|
steps:
|
||||||
|
- id: install
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- id: web
|
||||||
|
needs: [install]
|
||||||
|
run: fabrica tests run --target web
|
||||||
|
artifacts: [".fabrica/runs/tests/**"]
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
# Ianitor Domi: the Gitea release of a v* tag (docs/release.md). Ianitor ships no binary (the server builds it with
|
# Ianitor Domi: the Gitea release of a v* tag (docs/release.md, docs/fabrica.md). Ianitor ships no binary (the server
|
||||||
# Nix and the deploy pipeline switches it in), so a release is its notes and screenshots of the web UI, published under
|
# builds it with Nix and the deploy pipeline switches it in), so a release is the source archive of the tag, its notes,
|
||||||
# a SHA256SUMS signed by domi-release through Custos; release-notes.md is also the release's text on Gitea.
|
# the screenshots of the web UI, the Aula page and the Nix pin, all under a SHA256SUMS signed by domi-release through
|
||||||
|
# Custos; release-notes.md is also the release's text on Gitea.
|
||||||
# The Windows runner (the Fabrica app on Mark's PC) runs it: `fabrica`, node and pnpm are on every step's PATH.
|
# The Windows runner (the Fabrica app on Mark's PC) runs it: `fabrica`, node and pnpm are on every step's PATH.
|
||||||
# No Gitea webhook to the hub yet: a pushed tag is started on demand (the hub's POST /api/runs, ref v<version>).
|
# No Gitea webhook to the hub yet: a pushed tag is started on demand (the hub's POST /api/runs, ref v<version>).
|
||||||
# `notes` is Fabrica's release notes since the previous v* tag (Fabrica docs/12_release_kit.md); `shots` takes the
|
# The web UI's e2e suite (apps/web/playwright.config.ts) runs the main flows and takes the pictures in the installed
|
||||||
# same files as `fabrica aula shots` (core docs/FORMATS.md, "Fabrica: the Aula page") from the built web UI against
|
# Edge against the demo control plane with invented data, at a fixed instant; `fabrica aula shots` checks and copies
|
||||||
# the demo control plane with invented data, in headless Edge. No landing page while app.yaml has no `aula: true`.
|
# them (.fabrica/aula.yaml, `file:` shots) and `fabrica aula page` builds the landing page from them and the brief.
|
||||||
|
# Playwright's ffmpeg (the flows' videos) is in PLAYWRIGHT_BROWSERS_PATH, set here so the step does not depend on the
|
||||||
|
# runner's environment: F:\ms-playwright on Mark's PC, never C:. Nothing is downloaded during a release; a runner
|
||||||
|
# without it fails the e2e step with Playwright's "Executable doesn't exist" naming the path.
|
||||||
# `pin` publishes the Nix build's NAR hashes (.fabrica/nix/pin.json, written by scripts/nix-pin.sh on Linux at a
|
# `pin` publishes the Nix build's NAR hashes (.fabrica/nix/pin.json, written by scripts/nix-pin.sh on Linux at a
|
||||||
# clean commit and committed before the tag) as ianitor-nix.json, and refuses a pin made from other code than the
|
# clean commit and committed before the tag) as ianitor-nix.json, and refuses a pin made from other code than the
|
||||||
# tag's (its recorded source tree must be the tag's); that check is the gate, since pipelines cannot depend on one
|
# tag's (its recorded source tree must be the tag's); that check is the gate, since pipelines cannot depend on one
|
||||||
@@ -15,6 +19,8 @@ on:
|
|||||||
tag: "v*"
|
tag: "v*"
|
||||||
manual: true
|
manual: true
|
||||||
runner: windows
|
runner: windows
|
||||||
|
env:
|
||||||
|
PLAYWRIGHT_BROWSERS_PATH: 'F:\ms-playwright'
|
||||||
steps:
|
steps:
|
||||||
- id: version
|
- id: version
|
||||||
run: node scripts/check-version.mjs ${{ version }}
|
run: node scripts/check-version.mjs ${{ version }}
|
||||||
@@ -26,13 +32,27 @@ steps:
|
|||||||
- id: test
|
- id: test
|
||||||
needs: [install]
|
needs: [install]
|
||||||
run: pnpm --filter web test
|
run: pnpm --filter web test
|
||||||
|
- id: e2e
|
||||||
|
needs: [check, test]
|
||||||
|
run: pnpm --filter web test:e2e
|
||||||
|
- id: pictures
|
||||||
|
needs: [e2e]
|
||||||
|
run: pnpm --filter web aula:shots
|
||||||
|
- id: source
|
||||||
|
needs: [version]
|
||||||
|
run: node scripts/pack-source.mjs ${{ version }}
|
||||||
|
artifacts: ["target/release/ianitor-*-src.tar.gz"]
|
||||||
- id: notes
|
- id: notes
|
||||||
run: fabrica notes
|
run: fabrica notes
|
||||||
artifacts: ["target/notes/release-notes.md", "target/notes/release-notes.json"]
|
artifacts: ["target/notes/release-notes.md", "target/notes/release-notes.json"]
|
||||||
- id: shots
|
- id: shots
|
||||||
needs: [check, test]
|
needs: [pictures]
|
||||||
run: node apps/web/scripts/shots.mjs
|
run: fabrica aula shots
|
||||||
artifacts: ["target/aula/aula-*.png", "target/aula/aula.json"]
|
artifacts: ["target/aula/aula-*.png", "target/aula/aula.json"]
|
||||||
|
- id: page
|
||||||
|
needs: [notes, shots]
|
||||||
|
run: fabrica aula page
|
||||||
|
artifacts: ["target/aula/aula-page.json", "target/aula/aula-page.html"]
|
||||||
- id: pin-test
|
- id: pin-test
|
||||||
run: node --test scripts/release-pin.test.mjs
|
run: node --test scripts/release-pin.test.mjs
|
||||||
- id: pin
|
- id: pin
|
||||||
@@ -40,16 +60,18 @@ steps:
|
|||||||
run: node scripts/release-pin.mjs ${{ version }} ${{ tag }} ${{ commit }}
|
run: node scripts/release-pin.mjs ${{ version }} ${{ tag }} ${{ commit }}
|
||||||
artifacts: ["target/nix/ianitor-nix.json"]
|
artifacts: ["target/nix/ianitor-nix.json"]
|
||||||
- id: approve
|
- id: approve
|
||||||
needs: [version, notes, shots, pin]
|
needs: [source, page, pin]
|
||||||
approve: "Publish Ianitor ${{ tag }}: its notes and screenshots?"
|
approve: "Publish Ianitor ${{ tag }}: its source, notes, screenshots and Nix pin?"
|
||||||
- id: publish
|
- id: publish
|
||||||
needs: [approve]
|
needs: [approve]
|
||||||
publish:
|
publish:
|
||||||
gitea-release: true
|
gitea-release: true
|
||||||
files:
|
files:
|
||||||
|
- "**/ianitor-*-src.tar.gz"
|
||||||
- "**/release-notes.md"
|
- "**/release-notes.md"
|
||||||
- "**/release-notes.json"
|
- "**/release-notes.json"
|
||||||
- "**/aula-*.png"
|
- "**/aula-*.png"
|
||||||
- "**/aula.json"
|
- "**/aula.json"
|
||||||
|
- "**/aula-page.json"
|
||||||
- "**/ianitor-nix.json"
|
- "**/ianitor-nix.json"
|
||||||
sums: domi-release
|
sums: domi-release
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Ianitor Domi's Aula page (docs/fabrica.md part 2, part 5; Fabrica docs/09_aula_pages.md, docs/19_web_shots.md).
|
||||||
|
# Every picture is taken by the web UI's own e2e suite (`pnpm --filter web aula:shots`, apps/web/e2e/specs/aula.spec.ts):
|
||||||
|
# the built UI in Edge against the demo control plane (apps/web/tests/demo.ts: hostnames under .test, addresses in the
|
||||||
|
# documentation ranges, people ada and felix), 1440 x 900, at a fixed instant in Europe/Prague. `fabrica aula shots`
|
||||||
|
# checks each file and publishes it as aula-<name>.png with aula.json; it starts no browser of its own.
|
||||||
|
shots:
|
||||||
|
- name: hosts
|
||||||
|
title: Every host, its health and where it sends traffic
|
||||||
|
section: Hosts
|
||||||
|
file: target/e2e/aula/hosts.png
|
||||||
|
- name: host
|
||||||
|
title: Editing a host
|
||||||
|
section: Hosts
|
||||||
|
file: target/e2e/aula/host.png
|
||||||
|
- name: engine
|
||||||
|
title: Pingora serving, Caddy ready as the fallback
|
||||||
|
section: Engines
|
||||||
|
file: target/e2e/aula/engine.png
|
||||||
|
- name: history
|
||||||
|
title: "History: going back to a kept version"
|
||||||
|
section: Changes
|
||||||
|
file: target/e2e/aula/history.png
|
||||||
|
- name: certificates
|
||||||
|
title: The Domi CA and the device certificates
|
||||||
|
section: Certificates
|
||||||
|
file: target/e2e/aula/certificates.png
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
A reverse proxy for a home server where every change is tried, watched and undone if it fails.
|
||||||
|
|
||||||
|
Each host says in plain words where its traffic goes, which certificate it uses and whether visitors sign in first. A change is checked, tried and watched for a minute, and goes back on its own if a host stops answering. Pingora serves, Caddy stands by built from the same routes, and a small Domi certificate authority issues the certificates for home-only hosts and devices.
|
||||||
|
|
||||||
|
- hosts: Every host with its health, its certificate and where it sends traffic.
|
||||||
|
- host: A host in plain words: upstreams, certificate, sign-in and health check.
|
||||||
|
- engine: Pingora serving, with Caddy built from the same routes and compared host by host.
|
||||||
|
- history: Every kept version in history, and exactly what restoring one would change.
|
||||||
|
- certificates: The Domi intermediate and the device certificates for phones, laptops and apps.
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
Ianitor 0.2.0 gives Ianitor its own page on Aula.
|
||||||
|
|
||||||
|
- **The Domi CA from the shared crate domi-pki.** Ianitor's certificate authority is now the shared crate domi-pki
|
||||||
|
1.0.0, which Fabrica also uses. It keeps the same certificates, messages and key format.
|
||||||
|
- **A page on Aula** with a short description, five captioned screenshots, these notes, and the source of the version
|
||||||
|
as its download. All of them are under a `SHA256SUMS` signed by domi-release.
|
||||||
|
- **Screenshots and videos from the tests.** The web UI's flows run in a real browser against an invented home
|
||||||
|
server at a fixed time: add a host, undo, restore, share a link, switch the engine and issue a device certificate.
|
||||||
|
Each flow is recorded. The same run takes the screenshots, so they are the same in every release.
|
||||||
|
- **Tested in Fabrica.** The flows are Fabrica's `web` test target and its `e2e` pipeline.
|
||||||
|
|
||||||
|
Updates stay a deploy. Fabrica's Deploy moves the server to the new commit and switches back if the health check
|
||||||
|
does not answer.
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
id: j4yav1
|
||||||
|
title: Turn on the visual gate against v0.2.0
|
||||||
|
status: todo
|
||||||
|
priority: normal
|
||||||
|
labels: [fabrica, release]
|
||||||
|
created: 2026-11-19T01:25:43+01:00
|
||||||
|
updated: 2026-11-19T01:25:43+01:00
|
||||||
|
doc: docs/fabrica.md
|
||||||
|
---
|
||||||
|
Add Fabrica's visual step (docs/28_visual.md part 6) to .fabrica/artifex/release.yaml after shots: fabrica visual compare --shots target/aula --out target/visual --before ${{ tag }} --forge https://gitea.marek-novak.cz/mnovak/ianitor, custos: [gitea-token], and approve needs visual. Waits one release because v0.1.0's shots were taken at a moving clock, so every shot would differ (docs/fabrica.md part 5).
|
||||||
|
|
||||||
|
## Log
|
||||||
|
|
||||||
|
- 2026-11-19T01:25:43+01:00 mnovak: created
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
id: jd3x1h
|
||||||
|
title: Publish the showcase videos on Aula
|
||||||
|
status: todo
|
||||||
|
priority: normal
|
||||||
|
labels: [fabrica, aula]
|
||||||
|
created: 2026-11-19T01:25:17+01:00
|
||||||
|
updated: 2026-11-19T01:25:17+01:00
|
||||||
|
doc: docs/fabrica.md
|
||||||
|
---
|
||||||
|
The e2e suite records each main flow as target/e2e/videos/<flow>.webm (docs/fabrica.md part 5). Once Fabrica's docs/37 (aula.yaml `videos:`) is on Fabrica main, list them in .fabrica/aula.yaml, add **/aula-*.webm to the release's publish files and to Aula's entry if needed, and check the limits (WebM, at most 8 MiB and 60 s each, at most 6).
|
||||||
|
|
||||||
|
## Log
|
||||||
|
|
||||||
|
- 2026-11-19T01:25:17+01:00 mnovak: created
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Ianitor Domi's Playwright tests (docs/fabrica.md part 6; Fabrica docs/20_tests.md): the web UI's main flows on the
|
||||||
|
# built UI and the demo control plane (apps/web/playwright.config.ts, project `web`), each recorded as a video.
|
||||||
|
# `fabrica tests run`, or Tests in the Fabrica app; the e2e pipeline (.fabrica/artifex/e2e.yaml) runs the same target
|
||||||
|
# on the e2e runner. No android target: Ianitor has no Android build. The Rust suites run in WSL2 and the Nix build.
|
||||||
|
dir: apps/web
|
||||||
|
gate: [web]
|
||||||
|
targets:
|
||||||
|
- name: web
|
||||||
|
kind: web
|
||||||
|
title: The web UI's main flows
|
||||||
|
project: web
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: MPL-2.0
|
# SPDX-License-Identifier: CPAL-1.0
|
||||||
#
|
#
|
||||||
# Ianitor pre-commit hook. Rejects staged files that must never be in git:
|
# Ianitor pre-commit hook. Rejects staged files that must never be in git:
|
||||||
# - binaries: any NUL byte anywhere in the staged blob (git attributes do not matter)
|
# - binaries: any NUL byte anywhere in the staged blob (git attributes do not matter)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: MPL-2.0
|
# SPDX-License-Identifier: CPAL-1.0
|
||||||
#
|
#
|
||||||
# Self-test for .githooks/pre-commit. Creates a throw-away repository, points it at the
|
# Self-test for .githooks/pre-commit. Creates a throw-away repository, points it at the
|
||||||
# hook and checks that every forbidden case is rejected and normal files are accepted.
|
# hook and checks that every forbidden case is rejected and normal files are accepted.
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# Ianitor Domi
|
||||||
|
|
||||||
|
*Ianitor* (Latin: the doorkeeper) is the reverse proxy of a home server. It decides which name goes to which
|
||||||
|
service, with which certificate, and who has to sign in first. Every change is tried before it stays.
|
||||||
|
|
||||||
|
- **Hosts in plain words.** Add a host, say where its traffic goes, and pick a Domi or Let's Encrypt certificate.
|
||||||
|
Choose whether visitors sign in first (Authelia forward-auth). Each host is checked for health and shows as
|
||||||
|
healthy, degraded or down.
|
||||||
|
- **Changes that undo themselves.** Every change is compiled, tried, and watched for 60 seconds. If a host stops
|
||||||
|
answering, the change is reverted on its own. Routes live in a git repository, one file per host, with Undo and a
|
||||||
|
history you can restore any kept version from.
|
||||||
|
- **Two engines.** Cloudflare's Pingora serves. Caddy is built from the same routes, compared with Pingora host by
|
||||||
|
host, and can take over at runtime in about two seconds.
|
||||||
|
- **The Domi certificate authority.** It issues certificates for hosts reached only from home, and device
|
||||||
|
certificates (mTLS) for phones, computers and Domi apps. They come from an intermediate whose root stays offline.
|
||||||
|
- **Share links**, signed and time-limited, for a single host.
|
||||||
|
- **Every action in three clicks or fewer**, in a dark web UI that only the signed-in owner reaches.
|
||||||
|
|
||||||
|
## For whom
|
||||||
|
|
||||||
|
For someone who runs services at home (a wiki, photos, music, cameras) and wants each one to have a name, a
|
||||||
|
certificate and a sign-in, without editing a proxy's config by hand and without a change that breaks the house.
|
||||||
|
|
||||||
|
## Installing
|
||||||
|
|
||||||
|
Ianitor runs on NixOS. There is nothing to download and run: the server builds it from source with Nix.
|
||||||
|
|
||||||
|
1. Add the flake `git+https://gitea.marek-novak.cz/mnovak/Ianitor.git` as an input of the server's flake, and
|
||||||
|
import its module `nixosModules.ianitor`.
|
||||||
|
2. Set `services.ianitor`: `enable`, the edge's listen addresses, the routes repository, the share-link key file
|
||||||
|
and, for the Domi CA, `pki`. Keys and passwords come from files the system provides (sops, systemd
|
||||||
|
credentials), never from the Nix store. Then rebuild.
|
||||||
|
3. Open the UI's name in a browser and sign in through Authelia.
|
||||||
|
|
||||||
|
Ianitor can run beside an existing Caddy first, taking over one host at a time. Updates are a deploy: the server's
|
||||||
|
flake input moves to the new commit and the system switches, and switches back if the health check does not answer.
|
||||||
|
|
||||||
|
## System requirements
|
||||||
|
|
||||||
|
- NixOS on x86_64 Linux, with ports 80 and 443 for the edge.
|
||||||
|
- Authelia for sign-in to the UI and to the hosts that ask for it.
|
||||||
|
- A git server for the routes repository (any that takes a push over HTTPS).
|
||||||
|
|
||||||
|
## The files on this page
|
||||||
|
|
||||||
|
`ianitor-<version>-src.tar.gz` is the source of this version: every file in the repository at its tag. The
|
||||||
|
server's Nix build is made from the same tree. It is listed in `SHA256SUMS`, which verifies with domi-release.
|
||||||
|
The screenshots show invented hosts on an invented home server.
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
# CLAUDE.md — Ianitor Domi
|
# CLAUDE.md — Ianitor Domi
|
||||||
|
|
||||||
Ianitor is a reverse proxy built on Cloudflare's Pingora, with a small Domi CA, a web UI and an API.
|
Ianitor is a reverse proxy built on Cloudflare's Pingora, with a small Domi CA, a web UI and an API.
|
||||||
NixOS-native, with Caddy as a tested fallback. MPL-2.0. Plan, decisions and status: docs/ROADMAP.md — read it first.
|
NixOS-native, with Caddy as a tested fallback. CPAL-1.0 (from 2026-11-23; 0.2.0 and earlier MPL-2.0); the web UI shows the
|
||||||
|
Exhibit B credit (apps/web/src/lib/credit.ts). Plan, decisions and status: docs/ROADMAP.md — read it first.
|
||||||
|
|
||||||
## Layout
|
## Layout
|
||||||
crates/core config model, schema, compilers (Pingora runtime + Caddy JSON), CA (Ianitor's view of the shared
|
crates/core config model, schema, compilers (Pingora runtime + Caddy JSON), CA (Ianitor's view of the shared
|
||||||
@@ -21,7 +22,8 @@ bench layer 5 results as data (CSV/JSON), layer 2 outputs.
|
|||||||
cargo test --workspace # quote test counts per crate; an exit code alone is not green
|
cargo test --workspace # quote test counts per crate; an exit code alone is not green
|
||||||
cargo run -p ianitor-control -- --dev
|
cargo run -p ianitor-control -- --dev
|
||||||
pnpm --filter web dev # 127.0.0.1 only, never --host
|
pnpm --filter web dev # 127.0.0.1 only, never --host
|
||||||
node apps/web/scripts/shots.mjs # the release's screenshots (demo data, headless Edge) -> target/aula (docs/release.md)
|
pnpm --filter web test:e2e # the web UI's flows in Edge on demo data, recorded -> target/e2e/videos (docs/fabrica.md)
|
||||||
|
pnpm --filter web aula:shots # the Aula screenshots from the same suite -> target/e2e/aula; then `fabrica aula shots`
|
||||||
node scripts/check-version.mjs X.Y.Z # Cargo.toml and both package.json carry the version
|
node scripts/check-version.mjs X.Y.Z # Cargo.toml and both package.json carry the version
|
||||||
scripts/conformance.sh # layer 2: h2spec + testssl.sh, Ianitor vs Caddy (nix develop .#ci)
|
scripts/conformance.sh # layer 2: h2spec + testssl.sh, Ianitor vs Caddy (nix develop .#ci)
|
||||||
tests/fuzz/run.sh 60 # layer 3: cargo-fuzz, 60 s a target; crashes become regressions
|
tests/fuzz/run.sh 60 # layer 3: cargo-fuzz, 60 s a target; crashes become regressions
|
||||||
|
|||||||
Generated
+6
-6
@@ -1304,7 +1304,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ianitor-control"
|
name = "ianitor-control"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
@@ -1331,7 +1331,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ianitor-core"
|
name = "ianitor-core"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"domi-pki",
|
"domi-pki",
|
||||||
@@ -1348,7 +1348,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ianitor-diff"
|
name = "ianitor-diff"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
@@ -1366,7 +1366,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ianitor-edge"
|
name = "ianitor-edge"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -1394,7 +1394,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ianitor-fuzz"
|
name = "ianitor-fuzz"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ianitor-core",
|
"ianitor-core",
|
||||||
"ianitor-edge",
|
"ianitor-edge",
|
||||||
@@ -1403,7 +1403,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ianitor-testkit"
|
name = "ianitor-testkit"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
|||||||
+2
-2
@@ -12,10 +12,10 @@ members = [
|
|||||||
exclude = ["tests/fuzz/fuzz"]
|
exclude = ["tests/fuzz/fuzz"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.89"
|
rust-version = "1.89"
|
||||||
license = "MPL-2.0"
|
license = "CPAL-1.0"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
|||||||
@@ -1,373 +1,168 @@
|
|||||||
Mozilla Public License Version 2.0
|
Common Public Attribution License Version 1.0 (CPAL)
|
||||||
==================================
|
|
||||||
|
|
||||||
1. Definitions
|
1. “Definitions”
|
||||||
--------------
|
|
||||||
|
|
||||||
1.1. "Contributor"
|
1.0.1 “Commercial Use” means distribution or otherwise making the Covered Code available to a third party.
|
||||||
means each individual or legal entity that creates, contributes to
|
|
||||||
the creation of, or owns Covered Software.
|
|
||||||
|
|
||||||
1.2. "Contributor Version"
|
1.1 “Contributor” means each entity that creates or contributes to the creation of Modifications.
|
||||||
means the combination of the Contributions of others (if any) used
|
|
||||||
by a Contributor and that particular Contributor's Contribution.
|
|
||||||
|
|
||||||
1.3. "Contribution"
|
1.2 “Contributor Version” means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
|
||||||
means Covered Software of a particular Contributor.
|
|
||||||
|
|
||||||
1.4. "Covered Software"
|
1.3 “Covered Code” means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
|
||||||
means Source Code Form to which the initial Contributor has attached
|
|
||||||
the notice in Exhibit A, the Executable Form of such Source Code
|
|
||||||
Form, and Modifications of such Source Code Form, in each case
|
|
||||||
including portions thereof.
|
|
||||||
|
|
||||||
1.5. "Incompatible With Secondary Licenses"
|
1.4 “Electronic Distribution Mechanism” means a mechanism generally accepted in the software development community for the electronic transfer of data.
|
||||||
means
|
|
||||||
|
|
||||||
(a) that the initial Contributor has attached the notice described
|
1.5 “Executable” means Covered Code in any form other than Source Code.
|
||||||
in Exhibit B to the Covered Software; or
|
|
||||||
|
|
||||||
(b) that the Covered Software was made available under the terms of
|
1.6 “Initial Developer” means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
|
||||||
version 1.1 or earlier of the License, but not also under the
|
|
||||||
terms of a Secondary License.
|
|
||||||
|
|
||||||
1.6. "Executable Form"
|
1.7 “Larger Work” means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
|
||||||
means any form of the work other than Source Code Form.
|
|
||||||
|
|
||||||
1.7. "Larger Work"
|
1.8 “License” means this document.
|
||||||
means a work that combines Covered Software with other material, in
|
|
||||||
a separate file or files, that is not Covered Software.
|
|
||||||
|
|
||||||
1.8. "License"
|
1.8.1 “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
|
||||||
means this document.
|
|
||||||
|
|
||||||
1.9. "Licensable"
|
1.9 “Modifications” means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
|
||||||
means having the right to grant, to the maximum extent possible,
|
|
||||||
whether at the time of the initial grant or subsequently, any and
|
|
||||||
all of the rights conveyed by this License.
|
|
||||||
|
|
||||||
1.10. "Modifications"
|
A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
|
||||||
means any of the following:
|
|
||||||
|
|
||||||
(a) any file in Source Code Form that results from an addition to,
|
B. Any new file that contains any part of the Original Code or previous Modifications.
|
||||||
deletion from, or modification of the contents of Covered
|
|
||||||
Software; or
|
|
||||||
|
|
||||||
(b) any new file in Source Code Form that contains any Covered
|
1.10 “Original Code” means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
|
||||||
Software.
|
|
||||||
|
|
||||||
1.11. "Patent Claims" of a Contributor
|
1.10.1 “Patent Claims” means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
|
||||||
means any patent claim(s), including without limitation, method,
|
|
||||||
process, and apparatus claims, in any patent Licensable by such
|
|
||||||
Contributor that would be infringed, but for the grant of the
|
|
||||||
License, by the making, using, selling, offering for sale, having
|
|
||||||
made, import, or transfer of either its Contributions or its
|
|
||||||
Contributor Version.
|
|
||||||
|
|
||||||
1.12. "Secondary License"
|
1.11 “Source Code” means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor’s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
|
||||||
means either the GNU General Public License, Version 2.0, the GNU
|
|
||||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
|
||||||
Public License, Version 3.0, or any later versions of those
|
|
||||||
licenses.
|
|
||||||
|
|
||||||
1.13. "Source Code Form"
|
1.12 “You” (or “Your”) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, “You” includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
|
||||||
means the form of the work preferred for making modifications.
|
|
||||||
|
|
||||||
1.14. "You" (or "Your")
|
2. Source Code License.
|
||||||
means an individual or a legal entity exercising rights under this
|
|
||||||
License. For legal entities, "You" includes any entity that
|
|
||||||
controls, is controlled by, or is under common control with You. For
|
|
||||||
purposes of this definition, "control" means (a) the power, direct
|
|
||||||
or indirect, to cause the direction or management of such entity,
|
|
||||||
whether by contract or otherwise, or (b) ownership of more than
|
|
||||||
fifty percent (50%) of the outstanding shares or beneficial
|
|
||||||
ownership of such entity.
|
|
||||||
|
|
||||||
2. License Grants and Conditions
|
2.1 The Initial Developer Grant.
|
||||||
--------------------------------
|
The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
|
||||||
|
|
||||||
2.1. Grants
|
(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
|
||||||
|
|
||||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
|
||||||
non-exclusive license:
|
|
||||||
|
|
||||||
(a) under intellectual property rights (other than patent or trademark)
|
(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
|
||||||
Licensable by such Contributor to use, reproduce, make available,
|
|
||||||
modify, display, perform, distribute, and otherwise exploit its
|
|
||||||
Contributions, either on an unmodified basis, with Modifications, or
|
|
||||||
as part of a Larger Work; and
|
|
||||||
|
|
||||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
|
||||||
for sale, have made, import, and otherwise transfer either its
|
|
||||||
Contributions or its Contributor Version.
|
|
||||||
|
|
||||||
2.2. Effective Date
|
2.2 Contributor Grant.
|
||||||
|
Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
|
||||||
|
|
||||||
The licenses granted in Section 2.1 with respect to any Contribution
|
(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
|
||||||
become effective for each Contribution on the date the Contributor first
|
|
||||||
distributes such Contribution.
|
|
||||||
|
|
||||||
2.3. Limitations on Grant Scope
|
(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
|
||||||
|
|
||||||
The licenses granted in this Section 2 are the only rights granted under
|
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
|
||||||
this License. No additional rights or licenses will be implied from the
|
|
||||||
distribution or licensing of Covered Software under this License.
|
(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
|
||||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
|
||||||
Contributor:
|
3. Distribution Obligations.
|
||||||
|
|
||||||
(a) for any code that a Contributor has removed from Covered Software;
|
3.1 Application of License.
|
||||||
or
|
The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients’ rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
|
||||||
|
|
||||||
(b) for infringements caused by: (i) Your and any other third party's
|
3.2 Availability of Source Code.
|
||||||
modifications of Covered Software, or (ii) the combination of its
|
Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
|
||||||
Contributions with other software (except as part of its Contributor
|
|
||||||
Version); or
|
3.3 Description of Modifications.
|
||||||
|
You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
|
||||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
|
||||||
its Contributions.
|
3.4 Intellectual Property Matters
|
||||||
|
|
||||||
This License does not grant any rights in the trademarks, service marks,
|
(a) Third Party Claims. If Contributor has knowledge that a license under a third party’s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled “LEGAL” which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
|
||||||
or logos of any Contributor (except as may be necessary to comply with
|
|
||||||
the notice requirements in Section 3.4).
|
(b) Contributor APIs. If Contributor’s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
|
||||||
|
|
||||||
2.4. Subsequent Licenses
|
(c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor’s Modifications are Contributor’s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
|
||||||
|
|
||||||
No Contributor makes additional grants as a result of Your choice to
|
3.5 Required Notices.
|
||||||
distribute the Covered Software under a subsequent version of this
|
You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients’ rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
|
||||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
|
||||||
permitted under the terms of Section 3.3).
|
3.6 Distribution of Executable Versions.
|
||||||
|
You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients’ rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient’s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer, Original Developer or any Contributor. You hereby agree to indemnify the Initial Developer, Original Developer and every Contributor for any liability incurred by the Initial Developer, Original Developer or such Contributor as a result of any such terms You offer.
|
||||||
2.5. Representation
|
|
||||||
|
3.7 Larger Works.
|
||||||
Each Contributor represents that the Contributor believes its
|
You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
|
||||||
Contributions are its original creation(s) or it has sufficient rights
|
|
||||||
to grant the rights to its Contributions conveyed by this License.
|
4. Inability to Comply Due to Statute or Regulation.
|
||||||
|
If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
|
||||||
2.6. Fair Use
|
|
||||||
|
5. Application of this License.
|
||||||
This License is not intended to limit any rights You have under
|
This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
|
||||||
applicable copyright doctrines of fair use, fair dealing, or other
|
|
||||||
equivalents.
|
6. Versions of the License.
|
||||||
|
|
||||||
2.7. Conditions
|
6.1 New Versions.
|
||||||
|
Socialtext, Inc. (“Socialtext”) may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
|
||||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
|
||||||
in Section 2.1.
|
6.2 Effect of New Versions.
|
||||||
|
Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Socialtext. No one other than Socialtext has the right to modify the terms applicable to Covered Code created under this License.
|
||||||
3. Responsibilities
|
|
||||||
-------------------
|
6.3 Derivative Works.
|
||||||
|
If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases “Socialtext”, “CPAL” or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the CPAL. (Filling in the name of the Initial Developer, Original Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
|
||||||
3.1. Distribution of Source Form
|
|
||||||
|
7. DISCLAIMER OF WARRANTY.
|
||||||
All distribution of Covered Software in Source Code Form, including any
|
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN “AS IS” BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER, ORIGINAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||||
Modifications that You create or to which You contribute, must be under
|
|
||||||
the terms of this License. You must inform recipients that the Source
|
8. TERMINATION.
|
||||||
Code Form of the Covered Software is governed by the terms of this
|
|
||||||
License, and how they can obtain a copy of this License. You may not
|
8.1 This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
|
||||||
attempt to alter or restrict the recipients' rights in the Source Code
|
|
||||||
Form.
|
8.2 If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer, Original Developer or a Contributor (the Initial Developer, Original Developer or Contributor against whom You file such action is referred to as “Participant”) alleging that:
|
||||||
|
|
||||||
3.2. Distribution of Executable Form
|
(a) such Participant’s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
|
||||||
|
|
||||||
If You distribute Covered Software in Executable Form then:
|
(b) any software, hardware, or device, other than such Participant’s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
|
||||||
|
|
||||||
(a) such Covered Software must also be made available in Source Code
|
8.3 If You assert a patent infringement claim against Participant alleging that such Participant’s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
|
||||||
Form, as described in Section 3.1, and You must inform recipients of
|
|
||||||
the Executable Form how they can obtain a copy of such Source Code
|
8.4 In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
|
||||||
Form by reasonable means in a timely manner, at a charge no more
|
|
||||||
than the cost of distribution to the recipient; and
|
9. LIMITATION OF LIABILITY.
|
||||||
|
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ORIGINAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY’S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||||
(b) You may distribute such Executable Form under the terms of this
|
|
||||||
License, or sublicense it under different terms, provided that the
|
10. U.S. GOVERNMENT END USERS.
|
||||||
license for the Executable Form does not attempt to limit or alter
|
The Covered Code is a “commercial item,” as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of “commercial computer software” and “commercial computer software documentation,” as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
|
||||||
the recipients' rights in the Source Code Form under this License.
|
|
||||||
|
11. MISCELLANEOUS.
|
||||||
3.3. Distribution of a Larger Work
|
This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys’ fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
|
||||||
|
|
||||||
You may create and distribute a Larger Work under terms of Your choice,
|
12. RESPONSIBILITY FOR CLAIMS.
|
||||||
provided that You also comply with the requirements of this License for
|
As between Initial Developer, Original Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer, Original Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
|
||||||
the Covered Software. If the Larger Work is a combination of Covered
|
|
||||||
Software with a work governed by one or more Secondary Licenses, and the
|
13. MULTIPLE-LICENSED CODE.
|
||||||
Covered Software is not Incompatible With Secondary Licenses, this
|
Initial Developer may designate portions of the Covered Code as Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the CPAL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
|
||||||
License permits You to additionally distribute such Covered Software
|
|
||||||
under the terms of such Secondary License(s), so that the recipient of
|
14. ADDITIONAL TERM: ATTRIBUTION
|
||||||
the Larger Work may, at their option, further distribute the Covered
|
|
||||||
Software under the terms of either this License or such Secondary
|
(a) As a modest attribution to the organizer of the development of the Original Code (“Original Developer”), in the hope that its promotional value may help justify the time, money and effort invested in writing the Original Code, the Original Developer may include in Exhibit B (“Attribution Information”) a requirement that each time an Executable and Source Code or a Larger Work is launched or initially run (which includes initiating a session), a prominent display of the Original Developer’s Attribution Information (as defined below) must occur on the graphic user interface employed by the end user to access such Covered Code (which may include display on a splash screen), if any. The size of the graphic image should be consistent with the size of the other elements of the Attribution Information. If the access by the end user to the Executable and Source Code does not create a graphic user interface for access to the Covered Code, this obligation shall not apply. If the Original Code displays such Attribution Information in a particular form (such as in the form of a splash screen, notice at login, an “about” display, or dedicated attribution area on user interface screens), continued use of such form for that Attribution Information is one way of meeting this requirement for notice.
|
||||||
License(s).
|
|
||||||
|
(b) Attribution information may only include a copyright notice, a brief phrase, graphic image and a URL (“Attribution Information”) and is subject to the Attribution Limits as defined below. For these purposes, prominent shall mean display for sufficient duration to give reasonable notice to the user of the identity of the Original Developer and that if You include Attribution Information or similar information for other parties, You must ensure that the Attribution Information for the Original Developer shall be no less prominent than such Attribution Information or similar information for the other party. For greater certainty, the Original Developer may choose to specify in Exhibit B below that the above attribution requirement only applies to an Executable and Source Code resulting from the Original Code or any Modification, but not a Larger Work. The intent is to provide for reasonably modest attribution, therefore the Original Developer cannot require that You display, at any time, more than the following information as Attribution Information: (a) a copyright notice including the name of the Original Developer; (b) a word or one phrase (not exceeding 10 words); (c) one graphic image provided by the Original Developer; and (d) a URL (collectively, the “Attribution Limits”).
|
||||||
3.4. Notices
|
|
||||||
|
(c) If Exhibit B does not include any Attribution Information, then there are no requirements for You to display any Attribution Information of the Original Developer.
|
||||||
You may not remove or alter the substance of any license notices
|
|
||||||
(including copyright notices, patent notices, disclaimers of warranty,
|
(d) You acknowledge that all trademarks, service marks and/or trade names contained within the Attribution Information distributed with the Covered Code are the exclusive property of their owners and may only be used with the permission of their owners, or under circumstances otherwise permitted by law or as expressly set out in this License.
|
||||||
or limitations of liability) contained within the Source Code Form of
|
|
||||||
the Covered Software, except that You may alter any license notices to
|
15. ADDITIONAL TERM: NETWORK USE.
|
||||||
the extent required to remedy known factual inaccuracies.
|
The term “External Deployment” means the use, distribution, or communication of the Original Code or Modifications in any way such that the Original Code or Modifications may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Code or Modifications as a distribution under section 3.1 and make Source Code available under Section 3.2.
|
||||||
|
|
||||||
3.5. Application of Additional Terms
|
EXHIBIT A. Common Public Attribution License Version 1.0.
|
||||||
|
|
||||||
You may choose to offer, and to charge a fee for, warranty, support,
|
"The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://opensource.org/license/cpal_1-0. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
||||||
indemnity or liability obligations to one or more recipients of Covered
|
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
||||||
Software. However, You may do so only on Your own behalf, and not on
|
The Original Code is Ianitor.
|
||||||
behalf of any Contributor. You must make it absolutely clear that any
|
The Original Developer is the Initial Developer.
|
||||||
such warranty, support, indemnity, or liability obligation is offered by
|
The Initial Developer of the Original Code is Marek Novák. All portions of the code written by Marek Novák are Copyright (c) 2026. All Rights Reserved.
|
||||||
You alone, and You hereby agree to indemnify every Contributor for any
|
Contributor: none."
|
||||||
liability incurred by such Contributor as a result of warranty, support,
|
|
||||||
indemnity or liability terms You offer. You may include additional
|
EXHIBIT B. Attribution Information
|
||||||
disclaimers of warranty and limitations of liability specific to any
|
|
||||||
jurisdiction.
|
Attribution Copyright Notice: Copyright (c) 2026 Marek Novák
|
||||||
|
Attribution Phrase (not exceeding 10 words): Built on Domi
|
||||||
4. Inability to Comply Due to Statute or Regulation
|
Attribution URL: https://aula.marek-novak.cz
|
||||||
---------------------------------------------------
|
Graphic Image as provided in the Covered Code, if any: none.
|
||||||
|
Display of Attribution Information is required in Larger Works which are defined in the CPAL as a work which combines Covered Code or portions thereof with code not governed by the terms of the CPAL.
|
||||||
If it is impossible for You to comply with any of the terms of this
|
|
||||||
License with respect to some or all of the Covered Software due to
|
|
||||||
statute, judicial order, or regulation then You must: (a) comply with
|
|
||||||
the terms of this License to the maximum extent possible; and (b)
|
|
||||||
describe the limitations and the code they affect. Such description must
|
|
||||||
be placed in a text file included with all distributions of the Covered
|
|
||||||
Software under this License. Except to the extent prohibited by statute
|
|
||||||
or regulation, such description must be sufficiently detailed for a
|
|
||||||
recipient of ordinary skill to be able to understand it.
|
|
||||||
|
|
||||||
5. Termination
|
|
||||||
--------------
|
|
||||||
|
|
||||||
5.1. The rights granted under this License will terminate automatically
|
|
||||||
if You fail to comply with any of its terms. However, if You become
|
|
||||||
compliant, then the rights granted under this License from a particular
|
|
||||||
Contributor are reinstated (a) provisionally, unless and until such
|
|
||||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
|
||||||
ongoing basis, if such Contributor fails to notify You of the
|
|
||||||
non-compliance by some reasonable means prior to 60 days after You have
|
|
||||||
come back into compliance. Moreover, Your grants from a particular
|
|
||||||
Contributor are reinstated on an ongoing basis if such Contributor
|
|
||||||
notifies You of the non-compliance by some reasonable means, this is the
|
|
||||||
first time You have received notice of non-compliance with this License
|
|
||||||
from such Contributor, and You become compliant prior to 30 days after
|
|
||||||
Your receipt of the notice.
|
|
||||||
|
|
||||||
5.2. If You initiate litigation against any entity by asserting a patent
|
|
||||||
infringement claim (excluding declaratory judgment actions,
|
|
||||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
|
||||||
directly or indirectly infringes any patent, then the rights granted to
|
|
||||||
You by any and all Contributors for the Covered Software under Section
|
|
||||||
2.1 of this License shall terminate.
|
|
||||||
|
|
||||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
|
||||||
end user license agreements (excluding distributors and resellers) which
|
|
||||||
have been validly granted by You or Your distributors under this License
|
|
||||||
prior to termination shall survive termination.
|
|
||||||
|
|
||||||
************************************************************************
|
|
||||||
* *
|
|
||||||
* 6. Disclaimer of Warranty *
|
|
||||||
* ------------------------- *
|
|
||||||
* *
|
|
||||||
* Covered Software is provided under this License on an "as is" *
|
|
||||||
* basis, without warranty of any kind, either expressed, implied, or *
|
|
||||||
* statutory, including, without limitation, warranties that the *
|
|
||||||
* Covered Software is free of defects, merchantable, fit for a *
|
|
||||||
* particular purpose or non-infringing. The entire risk as to the *
|
|
||||||
* quality and performance of the Covered Software is with You. *
|
|
||||||
* Should any Covered Software prove defective in any respect, You *
|
|
||||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
|
||||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
|
||||||
* essential part of this License. No use of any Covered Software is *
|
|
||||||
* authorized under this License except under this disclaimer. *
|
|
||||||
* *
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
************************************************************************
|
|
||||||
* *
|
|
||||||
* 7. Limitation of Liability *
|
|
||||||
* -------------------------- *
|
|
||||||
* *
|
|
||||||
* Under no circumstances and under no legal theory, whether tort *
|
|
||||||
* (including negligence), contract, or otherwise, shall any *
|
|
||||||
* Contributor, or anyone who distributes Covered Software as *
|
|
||||||
* permitted above, be liable to You for any direct, indirect, *
|
|
||||||
* special, incidental, or consequential damages of any character *
|
|
||||||
* including, without limitation, damages for lost profits, loss of *
|
|
||||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
|
||||||
* and all other commercial damages or losses, even if such party *
|
|
||||||
* shall have been informed of the possibility of such damages. This *
|
|
||||||
* limitation of liability shall not apply to liability for death or *
|
|
||||||
* personal injury resulting from such party's negligence to the *
|
|
||||||
* extent applicable law prohibits such limitation. Some *
|
|
||||||
* jurisdictions do not allow the exclusion or limitation of *
|
|
||||||
* incidental or consequential damages, so this exclusion and *
|
|
||||||
* limitation may not apply to You. *
|
|
||||||
* *
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
8. Litigation
|
|
||||||
-------------
|
|
||||||
|
|
||||||
Any litigation relating to this License may be brought only in the
|
|
||||||
courts of a jurisdiction where the defendant maintains its principal
|
|
||||||
place of business and such litigation shall be governed by laws of that
|
|
||||||
jurisdiction, without reference to its conflict-of-law provisions.
|
|
||||||
Nothing in this Section shall prevent a party's ability to bring
|
|
||||||
cross-claims or counter-claims.
|
|
||||||
|
|
||||||
9. Miscellaneous
|
|
||||||
----------------
|
|
||||||
|
|
||||||
This License represents the complete agreement concerning the subject
|
|
||||||
matter hereof. If any provision of this License is held to be
|
|
||||||
unenforceable, such provision shall be reformed only to the extent
|
|
||||||
necessary to make it enforceable. Any law or regulation which provides
|
|
||||||
that the language of a contract shall be construed against the drafter
|
|
||||||
shall not be used to construe this License against a Contributor.
|
|
||||||
|
|
||||||
10. Versions of the License
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
10.1. New Versions
|
|
||||||
|
|
||||||
Mozilla Foundation is the license steward. Except as provided in Section
|
|
||||||
10.3, no one other than the license steward has the right to modify or
|
|
||||||
publish new versions of this License. Each version will be given a
|
|
||||||
distinguishing version number.
|
|
||||||
|
|
||||||
10.2. Effect of New Versions
|
|
||||||
|
|
||||||
You may distribute the Covered Software under the terms of the version
|
|
||||||
of the License under which You originally received the Covered Software,
|
|
||||||
or under the terms of any subsequent version published by the license
|
|
||||||
steward.
|
|
||||||
|
|
||||||
10.3. Modified Versions
|
|
||||||
|
|
||||||
If you create software not governed by this License, and you want to
|
|
||||||
create a new license for such software, you may create and use a
|
|
||||||
modified version of this License if you rename the license and remove
|
|
||||||
any references to the name of the license steward (except to note that
|
|
||||||
such modified license differs from this License).
|
|
||||||
|
|
||||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
|
||||||
Licenses
|
|
||||||
|
|
||||||
If You choose to distribute Source Code Form that is Incompatible With
|
|
||||||
Secondary Licenses under the terms of this version of the License, the
|
|
||||||
notice described in Exhibit B of this License must be attached.
|
|
||||||
|
|
||||||
Exhibit A - Source Code Form License Notice
|
|
||||||
-------------------------------------------
|
|
||||||
|
|
||||||
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/.
|
|
||||||
|
|
||||||
If it is not possible or desirable to put the notice in a particular
|
|
||||||
file, then You may include the notice in a location (such as a LICENSE
|
|
||||||
file in a relevant directory) where a recipient would be likely to look
|
|
||||||
for such a notice.
|
|
||||||
|
|
||||||
You may add additional accurate notices of copyright ownership.
|
|
||||||
|
|
||||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
|
||||||
---------------------------------------------------------
|
|
||||||
|
|
||||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
|
||||||
defined by the Mozilla Public License, v. 2.0.
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
*Ianitor* is Latin for the doorkeeper: it decides who comes through the door (routing, TLS) and checks
|
*Ianitor* is Latin for the doorkeeper: it decides who comes through the door (routing, TLS) and checks
|
||||||
credentials (certificates). Ianitor Domi is a reverse proxy for a home server, built on Cloudflare's
|
credentials (certificates). Ianitor Domi is a reverse proxy for a home server, built on Cloudflare's
|
||||||
[Pingora](https://github.com/cloudflare/pingora), with a small certificate authority for your own devices, a web
|
[Pingora](https://github.com/cloudflare/pingora), with a small certificate authority for your own devices, a web
|
||||||
UI, an API, and a NixOS module. MPL-2.0.
|
UI, an API, and a NixOS module. CPAL-1.0.
|
||||||
|
|
||||||
- **Routes in git.** One TOML file per host in a repository (`hosts/wiki.example.toml`), schema-checked. Every
|
- **Routes in git.** One TOML file per host in a repository (`hosts/wiki.example.toml`), schema-checked. Every
|
||||||
change is a commit, applied live without `nixos-rebuild`, watched for 60 seconds, and reverted by itself if the
|
change is a commit, applied live without `nixos-rebuild`, watched for 60 seconds, and reverted by itself if the
|
||||||
@@ -92,4 +92,13 @@ receipt published. How it works and where it stands: [docs/support.md](docs/supp
|
|||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
[MPL-2.0](LICENSE). Pingora is Apache-2.0; Caddy, used only as a separate fallback process, Apache-2.0.
|
[CPAL-1.0](LICENSE), the Common Public Attribution License 1.0, from 2026-11-23. Ianitor 0.2.0 and earlier stay
|
||||||
|
available under MPL-2.0 to those who received them; from this change on, the code is under CPAL-1.0.
|
||||||
|
|
||||||
|
CPAL-1.0 is MPL 1.1 with an attribution clause and a network clause. Whoever runs Ianitor, or a work built on it,
|
||||||
|
for users (over a network too) shows the credit of LICENSE Exhibit B where those users reach it:
|
||||||
|
|
||||||
|
> **Built on Domi** · Copyright (c) 2026 Marek Novák · https://aula.marek-novak.cz
|
||||||
|
|
||||||
|
Ianitor's web UI shows it on every screen (in the sidebar, or at the foot of the page on a phone) and in Settings,
|
||||||
|
About. Pingora is Apache-2.0; Caddy, used only as a separate fallback process, Apache-2.0.
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
// 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 suite's instant: the demo's answers and the page's Date both read it (a Monday morning in Prague). */
|
||||||
|
export const CLOCK = "2026-11-16T09:30:00+01:00";
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
// 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).
|
||||||
|
|
||||||
|
// What every e2e test gets: the demo started over, the page's clock at the suite's instant, `open`
|
||||||
|
// for a page of the UI, and afterwards a check that nothing the page showed looks real
|
||||||
|
// (tests/demo.ts realLooking: names outside .test, addresses outside the documentation ranges).
|
||||||
|
// A test with a `video` annotation has its recording kept as target/e2e/videos/<name>.webm.
|
||||||
|
|
||||||
|
import { mkdirSync } from "node:fs";
|
||||||
|
import { join, resolve } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { test as base, expect, type Page } from "@playwright/test";
|
||||||
|
import { realLooking } from "../tests/demo";
|
||||||
|
import { CLOCK } from "./clock";
|
||||||
|
|
||||||
|
export const REPO = resolve(fileURLToPath(new URL(".", import.meta.url)), "../../..");
|
||||||
|
export const TARGET = join(REPO, "target", "e2e");
|
||||||
|
|
||||||
|
function url(): string {
|
||||||
|
const u = process.env.IANITOR_E2E_URL;
|
||||||
|
if (!u) throw new Error("IANITOR_E2E_URL is not set: run the suite through playwright.config.ts (its global setup serves the demo)");
|
||||||
|
return u;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Every text, field value and link the page shows (the body: the head's links are the build's own files). */
|
||||||
|
async function shown(page: Page): Promise<string[]> {
|
||||||
|
return page.evaluate(() => {
|
||||||
|
const out: string[] = [];
|
||||||
|
const walk = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
||||||
|
for (let n = walk.nextNode(); n; n = walk.nextNode()) if (n.textContent?.trim()) out.push(n.textContent);
|
||||||
|
document.body.querySelectorAll<HTMLInputElement | HTMLTextAreaElement>("input, textarea").forEach((i) => out.push(i.value));
|
||||||
|
document.body.querySelectorAll("[href]").forEach((a) => out.push(a.getAttribute("href") ?? ""));
|
||||||
|
return out;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export const test = base.extend<{ open: (path: string) => Promise<void> }>({
|
||||||
|
open: async ({ page, request }, use) => {
|
||||||
|
const res = await request.post(`${url()}/__demo/reset`);
|
||||||
|
expect(res.status()).toBe(204);
|
||||||
|
await page.clock.setFixedTime(new Date(CLOCK));
|
||||||
|
await use(async (path: string) => {
|
||||||
|
await page.goto(url() + path);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
test.afterEach(async ({ page }, info) => {
|
||||||
|
const video = info.annotations.find((a) => a.type === "video")?.description;
|
||||||
|
if (!page.isClosed()) {
|
||||||
|
const seen = (await shown(page)).flatMap(realLooking);
|
||||||
|
expect(seen, "the page showed something that looks real").toEqual([]);
|
||||||
|
}
|
||||||
|
const rec = page.video();
|
||||||
|
if (video && rec && info.status === info.expectedStatus) {
|
||||||
|
await page.close();
|
||||||
|
const dir = join(TARGET, "videos");
|
||||||
|
mkdirSync(dir, { recursive: true });
|
||||||
|
await rec.saveAs(join(dir, `${video}.webm`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export { expect };
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
// 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 e2e suite's server (Playwright's global setup): builds the web UI (Vite, production) into a
|
||||||
|
// fresh temporary folder and serves it on 127.0.0.1 at a free port, with /api/v1 answered by the
|
||||||
|
// demo control plane (tests/demo.ts) at the suite's fixed instant. Any other path falls back to
|
||||||
|
// index.html, as in production. POST /__demo/reset starts the demo over (each test starts from the
|
||||||
|
// same invented server). The address reaches the tests as IANITOR_E2E_URL. Nothing here listens on
|
||||||
|
// anything but loopback, and the temporary folder is removed when the run ends.
|
||||||
|
|
||||||
|
import { existsSync, mkdtempSync, readFileSync, rmSync, statSync } from "node:fs";
|
||||||
|
import { createServer, type IncomingMessage, type Server } from "node:http";
|
||||||
|
import { tmpdir } from "node:os";
|
||||||
|
import { extname, join, normalize, resolve, sep } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { build } from "vite";
|
||||||
|
import { demoApi } from "../tests/demo";
|
||||||
|
import { clock } from "../tests/mockApi";
|
||||||
|
import { CLOCK } from "./clock";
|
||||||
|
|
||||||
|
const web = resolve(fileURLToPath(new URL(".", import.meta.url)), "..");
|
||||||
|
|
||||||
|
const TYPES: Record<string, string> = {
|
||||||
|
".html": "text/html; charset=utf-8",
|
||||||
|
".js": "text/javascript; charset=utf-8",
|
||||||
|
".css": "text/css; charset=utf-8",
|
||||||
|
".json": "application/json",
|
||||||
|
".svg": "image/svg+xml",
|
||||||
|
".png": "image/png",
|
||||||
|
".ico": "image/x-icon",
|
||||||
|
".woff": "font/woff",
|
||||||
|
".woff2": "font/woff2",
|
||||||
|
".txt": "text/plain; charset=utf-8",
|
||||||
|
};
|
||||||
|
|
||||||
|
function body(req: IncomingMessage): Promise<Record<string, unknown>> {
|
||||||
|
return new Promise((ok) => {
|
||||||
|
const chunks: Buffer[] = [];
|
||||||
|
req.on("data", (c: Buffer) => chunks.push(c));
|
||||||
|
req.on("end", () => {
|
||||||
|
try {
|
||||||
|
ok(chunks.length ? (JSON.parse(Buffer.concat(chunks).toString("utf8")) as Record<string, unknown>) : {});
|
||||||
|
} catch {
|
||||||
|
ok({});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function serve(dist: string): Promise<Server> {
|
||||||
|
const index = readFileSync(join(dist, "index.html"));
|
||||||
|
let api = demoApi();
|
||||||
|
const server = createServer((req, res) => {
|
||||||
|
const url = new URL(req.url ?? "/", "http://127.0.0.1");
|
||||||
|
if (url.pathname === "/__demo/reset" && req.method === "POST") {
|
||||||
|
api = demoApi();
|
||||||
|
res.writeHead(204).end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (url.pathname === "/api/v1" || url.pathname.startsWith("/api/v1/")) {
|
||||||
|
void body(req).then((b) => {
|
||||||
|
const a = api(req.method ?? "GET", url.pathname.slice("/api/v1".length) + url.search, b);
|
||||||
|
res.writeHead(a.status, { "Content-Type": "application/json", "Cache-Control": "no-store" });
|
||||||
|
res.end(a.text ?? undefined);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let path: string;
|
||||||
|
try {
|
||||||
|
path = decodeURIComponent(url.pathname);
|
||||||
|
} catch {
|
||||||
|
res.writeHead(400).end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const file = normalize(join(dist, path));
|
||||||
|
if (file.startsWith(dist + sep) && existsSync(file) && statSync(file).isFile()) {
|
||||||
|
res.writeHead(200, { "Content-Type": TYPES[extname(file)] ?? "application/octet-stream" });
|
||||||
|
res.end(readFileSync(file));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
res.writeHead(200, { "Content-Type": TYPES[".html"], "Cache-Control": "no-store" });
|
||||||
|
res.end(index);
|
||||||
|
});
|
||||||
|
return new Promise((ok, fail) => {
|
||||||
|
server.once("error", fail);
|
||||||
|
server.listen(0, "127.0.0.1", () => ok(server));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function setup(): Promise<() => Promise<void>> {
|
||||||
|
clock.fixed = Date.parse(CLOCK);
|
||||||
|
const tmp = mkdtempSync(join(tmpdir(), "ianitor-e2e-"));
|
||||||
|
const remove = () => rmSync(tmp, { recursive: true, force: true, maxRetries: 10, retryDelay: 200 });
|
||||||
|
let server: Server;
|
||||||
|
try {
|
||||||
|
const dist = join(tmp, "dist");
|
||||||
|
await build({ root: web, logLevel: "warn", build: { outDir: dist, emptyOutDir: true } });
|
||||||
|
server = await serve(dist);
|
||||||
|
} catch (e) {
|
||||||
|
remove();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
const addr = server.address();
|
||||||
|
if (!addr || typeof addr === "string") throw new Error("the demo server has no port");
|
||||||
|
process.env.IANITOR_E2E_URL = `http://127.0.0.1:${addr.port}`;
|
||||||
|
console.log(`e2e: the built UI and the demo control plane on ${process.env.IANITOR_E2E_URL}`);
|
||||||
|
return async () => {
|
||||||
|
server.closeAllConnections();
|
||||||
|
await new Promise<void>((r) => server.close(() => r()));
|
||||||
|
remove();
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// 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): each shot of tests/demo.ts SHOTS, 1440 × 900 at
|
||||||
|
// scale 1, saved as target/e2e/aula/<name>.png. .fabrica/aula.yaml lists the same files, which
|
||||||
|
// `fabrica aula shots` checks and publishes as aula-<name>.png with aula.json.
|
||||||
|
|
||||||
|
import { mkdirSync } from "node:fs";
|
||||||
|
import { join } from "node:path";
|
||||||
|
import { SHOTS } from "../../tests/demo";
|
||||||
|
import { TARGET, expect, test } from "../fixtures";
|
||||||
|
|
||||||
|
const dir = join(TARGET, "aula");
|
||||||
|
|
||||||
|
for (const shot of SHOTS) {
|
||||||
|
test(`aula: ${shot.name}`, async ({ page, open }) => {
|
||||||
|
await open(shot.path);
|
||||||
|
for (const sel of shot.click ?? []) await page.locator(sel).first().click();
|
||||||
|
await expect(page.locator(shot.wait).first()).toBeAttached();
|
||||||
|
// Nothing still loading, the fonts in, two frames drawn and transitions over.
|
||||||
|
await expect(page.locator("[aria-busy=true]")).toHaveCount(0);
|
||||||
|
await page.evaluate(() => document.fonts.ready.then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)))));
|
||||||
|
await page.waitForTimeout(400);
|
||||||
|
mkdirSync(dir, { recursive: true });
|
||||||
|
await page.screenshot({ path: join(dir, `${shot.name}.png`), animations: "disabled", caret: "hide" });
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
// 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 main flows of ROADMAP §4 in a real browser, on the built UI and the demo control plane, with
|
||||||
|
// the clicks counted as in the smoke test (tests/flows.test.ts). Each is recorded: the showcase
|
||||||
|
// videos (docs/fabrica.md part 5) are target/e2e/videos/<name>.webm.
|
||||||
|
|
||||||
|
import type { Locator, Page } from "@playwright/test";
|
||||||
|
import { expect, test } from "../fixtures";
|
||||||
|
|
||||||
|
function counter() {
|
||||||
|
let n = 0;
|
||||||
|
return {
|
||||||
|
click: async (l: Locator) => {
|
||||||
|
n++;
|
||||||
|
await l.click();
|
||||||
|
},
|
||||||
|
get count() {
|
||||||
|
return n;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A beat for the viewer of the video, so a screen is seen before the next click. */
|
||||||
|
const beat = (page: Page) => page.waitForTimeout(700);
|
||||||
|
const nav = (page: Page) => page.getByRole("navigation", { name: "Main" }).first();
|
||||||
|
|
||||||
|
test("Add a host: + Host → fill → Apply = 2 clicks, kept", { annotation: { type: "video", description: "add-host" } }, async ({ page, open }) => {
|
||||||
|
const c = counter();
|
||||||
|
await open("/");
|
||||||
|
await expect(page.getByRole("button", { name: "More for wiki.home.test" })).toBeVisible();
|
||||||
|
await beat(page);
|
||||||
|
await c.click(page.getByRole("button", { name: "Add a host" }));
|
||||||
|
await page.getByLabel("Hostname").pressSequentially("notes.home.test");
|
||||||
|
await page.getByLabel("Send traffic to").fill("http://192.0.2.60:8080");
|
||||||
|
await beat(page);
|
||||||
|
await c.click(page.getByRole("button", { name: "Apply" }));
|
||||||
|
await expect(page.locator("dialog.ia-panel")).toHaveCount(0, { timeout: 10_000 });
|
||||||
|
await expect(page.getByRole("button", { name: "More for notes.home.test" })).toBeVisible();
|
||||||
|
await beat(page);
|
||||||
|
expect(c.count).toBe(2);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Undo the last change = 1 click", { annotation: { type: "video", description: "undo" } }, async ({ page, open }) => {
|
||||||
|
const c = counter();
|
||||||
|
await open("/");
|
||||||
|
const undo = page.getByRole("button", { name: /^Undo: Added recipes\.home\.test/ });
|
||||||
|
await expect(undo).toBeVisible();
|
||||||
|
await beat(page);
|
||||||
|
const sent = page.waitForRequest((r) => r.method() === "POST" && r.url().endsWith("/api/v1/undo"));
|
||||||
|
await c.click(undo);
|
||||||
|
expect((await sent).postDataJSON()).toMatchObject({ target_change_id: "ch_0008" });
|
||||||
|
await beat(page);
|
||||||
|
expect(c.count).toBe(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Restore: History → pick → Restore = 3 clicks", { annotation: { type: "video", description: "restore" } }, async ({ page, open }) => {
|
||||||
|
const c = counter();
|
||||||
|
await open("/");
|
||||||
|
await expect(page.getByRole("button", { name: "Add a host" })).toBeVisible();
|
||||||
|
await c.click(nav(page).getByRole("link", { name: "History" }));
|
||||||
|
await beat(page);
|
||||||
|
await c.click(page.getByRole("button", { name: /Turned share links on for wiki\.home\.test/ }));
|
||||||
|
await expect(page.getByRole("button", { name: "Restore this version" })).toBeVisible();
|
||||||
|
await beat(page);
|
||||||
|
const sent = page.waitForRequest((r) => r.method() === "POST" && r.url().endsWith("/api/v1/restore"));
|
||||||
|
await c.click(page.getByRole("button", { name: "Restore this version" }));
|
||||||
|
await sent;
|
||||||
|
await beat(page);
|
||||||
|
expect(c.count).toBe(3);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Share link: ⋯ → Share link → Copy = 3 clicks, 7 days", { annotation: { type: "video", description: "share-link" } }, async ({ page, context, open }) => {
|
||||||
|
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
|
||||||
|
const c = counter();
|
||||||
|
await open("/");
|
||||||
|
await c.click(page.getByRole("button", { name: "More for wiki.home.test" }));
|
||||||
|
const minted = page.waitForRequest((r) => r.method() === "POST" && r.url().endsWith("/share-links"));
|
||||||
|
await c.click(page.getByRole("menuitem", { name: /Share link/ }));
|
||||||
|
expect((await minted).postDataJSON()).toMatchObject({ expires_in_s: 604800 });
|
||||||
|
const copy = page.getByRole("button", { name: "Copy link" });
|
||||||
|
await expect(copy).not.toHaveAttribute("aria-disabled", /.*/);
|
||||||
|
await beat(page);
|
||||||
|
await c.click(copy);
|
||||||
|
await expect(page.getByText("Copied")).toBeVisible();
|
||||||
|
await beat(page);
|
||||||
|
expect(c.count).toBe(3);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Switch engine: engine chip → Switch to Caddy = 2 clicks", { annotation: { type: "video", description: "engine" } }, async ({ page, open }) => {
|
||||||
|
const c = counter();
|
||||||
|
await open("/");
|
||||||
|
await c.click(page.getByRole("button", { name: /^Engine: Pingora/ }));
|
||||||
|
await expect(page.getByRole("button", { name: "Switch to Caddy" })).toBeVisible();
|
||||||
|
await beat(page);
|
||||||
|
await c.click(page.getByRole("button", { name: "Switch to Caddy" }));
|
||||||
|
await expect(page.getByText("Now serving with Caddy.")).toBeVisible({ timeout: 10_000 });
|
||||||
|
await beat(page);
|
||||||
|
expect(c.count).toBe(2);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Device certificate: Certificates → + Device → Issue = 3 clicks", { annotation: { type: "video", description: "device-certificate" } }, async ({ page, open }) => {
|
||||||
|
const c = counter();
|
||||||
|
await open("/");
|
||||||
|
await expect(page.getByRole("button", { name: "Add a host" })).toBeVisible();
|
||||||
|
await c.click(nav(page).getByRole("link", { name: "Certificates" }));
|
||||||
|
await beat(page);
|
||||||
|
await c.click(page.getByRole("button", { name: "Add a device certificate" }));
|
||||||
|
await page.getByLabel("Device name").fill("felix's tablet");
|
||||||
|
await c.click(page.getByRole("button", { name: "Issue" }));
|
||||||
|
await expect(page.getByLabel("Match code 47 19 83")).toBeVisible();
|
||||||
|
expect(c.count).toBe(3);
|
||||||
|
await expect(page.getByRole("button", { name: "Show QR code" })).toBeVisible({ timeout: 10_000 });
|
||||||
|
await beat(page);
|
||||||
|
});
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"types": ["node"],
|
||||||
|
"noEmit": true,
|
||||||
|
"allowImportingTsExtensions": false
|
||||||
|
},
|
||||||
|
"include": ["./**/*.ts", "../playwright.config.ts", "../tests/demo.ts", "../tests/mockApi.ts"]
|
||||||
|
}
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
|||||||
@@ -1,25 +1,28 @@
|
|||||||
{
|
{
|
||||||
"name": "web",
|
"name": "web",
|
||||||
"version": "0.1.0",
|
"version": "0.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "MPL-2.0",
|
"license": "CPAL-1.0",
|
||||||
"description": "Ianitor Domi web UI (Svelte 5, runes, TypeScript strict). A pure client of the control API.",
|
"description": "Ianitor Domi web UI (Svelte 5, runes, TypeScript strict). A pure client of the control API.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings",
|
"check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings && tsc -p e2e/tsconfig.json",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"shots": "node scripts/shots.mjs"
|
"test:e2e": "playwright test --project=web",
|
||||||
|
"aula:shots": "playwright test --project=aula"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ianitor/ui": "workspace:*"
|
"@ianitor/ui": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@playwright/test": "1.56.1",
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||||
"@testing-library/svelte": "^5.2.6",
|
"@testing-library/svelte": "^5.2.6",
|
||||||
"@testing-library/user-event": "^14.6.1",
|
"@testing-library/user-event": "^14.6.1",
|
||||||
"@tsconfig/svelte": "^5.0.4",
|
"@tsconfig/svelte": "^5.0.4",
|
||||||
|
"@types/node": "^22.20.5",
|
||||||
"jsdom": "^26.0.0",
|
"jsdom": "^26.0.0",
|
||||||
"svelte": "^5.20.0",
|
"svelte": "^5.20.0",
|
||||||
"svelte-check": "^4.1.4",
|
"svelte-check": "^4.1.4",
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
// 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 web UI's end-to-end suite (docs/fabrica.md, part 5): the built UI in a real browser against
|
||||||
|
// the demo control plane (tests/demo.ts, invented data only), served on 127.0.0.1 by e2e/serve.ts.
|
||||||
|
// Two projects:
|
||||||
|
// web the main flows of ROADMAP §4, each recorded as a video (target/e2e/videos/<flow>.webm);
|
||||||
|
// Fabrica's `web` target (.fabrica/tests.yaml) and its e2e pipeline run this one.
|
||||||
|
// aula the release's screenshots (target/e2e/aula/<name>.png), which `fabrica aula shots` checks
|
||||||
|
// and publishes (.fabrica/aula.yaml, `file:` shots).
|
||||||
|
// Every page is drawn at a fixed instant in a fixed zone, so two takes of a screen are the same.
|
||||||
|
// On Windows the browser is the installed Edge (PW_CHANNEL names another, e.g. chrome): nothing is
|
||||||
|
// downloaded. Elsewhere it is Playwright's own Chromium. Videos need Playwright's ffmpeg, which lives
|
||||||
|
// in PLAYWRIGHT_BROWSERS_PATH (on F: on Mark's PC, never C:).
|
||||||
|
|
||||||
|
import { defineConfig, devices } from "@playwright/test";
|
||||||
|
|
||||||
|
const channel = process.env.PW_CHANNEL ?? (process.platform === "win32" ? "msedge" : undefined);
|
||||||
|
// Fabrica's live view (Fabrica docs/20_tests.md part 3): the port its Tests page watches.
|
||||||
|
const devtools = process.env.FABRICA_TESTS_DEVTOOLS ? [`--remote-debugging-port=${process.env.FABRICA_TESTS_DEVTOOLS}`] : [];
|
||||||
|
|
||||||
|
const desktop = {
|
||||||
|
...devices["Desktop Chrome"],
|
||||||
|
...(channel ? { channel } : {}),
|
||||||
|
viewport: { width: 1440, height: 900 },
|
||||||
|
deviceScaleFactor: 1,
|
||||||
|
locale: "en-GB",
|
||||||
|
timezoneId: "Europe/Prague",
|
||||||
|
launchOptions: { args: ["--lang=en-GB", ...devtools] },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
testDir: "e2e/specs",
|
||||||
|
outputDir: "../../target/e2e/results",
|
||||||
|
globalSetup: "./e2e/serve.ts",
|
||||||
|
fullyParallel: false,
|
||||||
|
workers: 1,
|
||||||
|
retries: 0,
|
||||||
|
forbidOnly: !!process.env.CI,
|
||||||
|
// Generous: the release PC runs several apps' suites at once, and a loaded PC types and draws slowly
|
||||||
|
// (one Edge start took 45 s there, one flow 72 s). A real hang still ends.
|
||||||
|
timeout: 180_000,
|
||||||
|
expect: { timeout: 15_000 },
|
||||||
|
reporter: [["list"]],
|
||||||
|
use: { trace: "retain-on-failure" },
|
||||||
|
projects: [
|
||||||
|
{ name: "web", testMatch: "flows.spec.ts", use: { ...desktop, video: { mode: "on", size: { width: 1440, height: 900 } } } },
|
||||||
|
{ name: "aula", testMatch: "aula.spec.ts", use: desktop },
|
||||||
|
],
|
||||||
|
});
|
||||||
@@ -1,418 +0,0 @@
|
|||||||
// 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/.
|
|
||||||
|
|
||||||
// The release's screenshots of the web UI (docs/release.md):
|
|
||||||
// node apps/web/scripts/shots.mjs [--out <dir>] (default: <repo>/target/aula)
|
|
||||||
// Builds the UI, serves it on 127.0.0.1 with /api/v1 answered by the demo control plane
|
|
||||||
// (tests/demo.ts: invented data only), photographs each shot of demo.ts's SHOTS in headless Edge
|
|
||||||
// or Chrome over DevTools, and writes aula-<name>.png and aula.json in the format of Fabrica's
|
|
||||||
// core docs/FORMATS.md ("Fabrica: the Aula page"). On every way out the browser's process tree
|
|
||||||
// and the server are stopped and the temporary folder is removed.
|
|
||||||
// Exit codes: 0 done, 1 a problem, 130 cancelled.
|
|
||||||
|
|
||||||
import { spawn, spawnSync } from "node:child_process";
|
|
||||||
import { createHash } from "node:crypto";
|
|
||||||
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
||||||
import { createServer as createHttpServer } from "node:http";
|
|
||||||
import { tmpdir } from "node:os";
|
|
||||||
import { basename, delimiter, dirname, extname, join, normalize, resolve, sep } from "node:path";
|
|
||||||
import { fileURLToPath } from "node:url";
|
|
||||||
import { build, createServer as createViteServer } from "vite";
|
|
||||||
|
|
||||||
const web = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
||||||
const repo = resolve(web, "../..");
|
|
||||||
const WAIT_MS = 20_000;
|
|
||||||
|
|
||||||
function usage(msg) {
|
|
||||||
console.error(`shots: ${msg}\nusage: node apps/web/scripts/shots.mjs [--out <dir>]`);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
let out = join(repo, "target", "aula");
|
|
||||||
for (let i = 2; i < process.argv.length; i++) {
|
|
||||||
const a = process.argv[i];
|
|
||||||
if (a === "--out" && process.argv[i + 1]) out = resolve(process.argv[++i]);
|
|
||||||
else usage(`unknown argument ${a}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const log = (m) => console.log(`shots: ${m}`);
|
|
||||||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
||||||
|
|
||||||
// ---------- cleanup on every way out ----------
|
|
||||||
|
|
||||||
const cleanups = [];
|
|
||||||
let cleaning = false;
|
|
||||||
async function cleanup() {
|
|
||||||
if (cleaning) return;
|
|
||||||
cleaning = true;
|
|
||||||
for (const f of cleanups.reverse()) {
|
|
||||||
try {
|
|
||||||
await f();
|
|
||||||
} catch (e) {
|
|
||||||
console.error(`shots: cleanup: ${e?.message ?? e}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
process.on("SIGINT", () => void cleanup().then(() => process.exit(130)));
|
|
||||||
process.on("SIGTERM", () => void cleanup().then(() => process.exit(130)));
|
|
||||||
|
|
||||||
// ---------- the output folder ----------
|
|
||||||
|
|
||||||
function clearOutput() {
|
|
||||||
mkdirSync(out, { recursive: true });
|
|
||||||
for (const n of readdirSync(out)) {
|
|
||||||
if (n === "aula.json" || (n.startsWith("aula-") && n.endsWith(".png"))) rmSync(join(out, n), { force: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Width and height from the PNG's IHDR, not assumed. */
|
|
||||||
function pngSize(png) {
|
|
||||||
const sig = "89504e470d0a1a0a";
|
|
||||||
if (png.length < 24 || png.subarray(0, 8).toString("hex") !== sig || png.subarray(12, 16).toString("latin1") !== "IHDR") {
|
|
||||||
throw new Error("the browser's capture is not a PNG");
|
|
||||||
}
|
|
||||||
return { width: png.readUInt32BE(16), height: png.readUInt32BE(20) };
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- the demo control plane and the built UI on 127.0.0.1 ----------
|
|
||||||
|
|
||||||
const TYPES = {
|
|
||||||
".html": "text/html; charset=utf-8",
|
|
||||||
".js": "text/javascript; charset=utf-8",
|
|
||||||
".css": "text/css; charset=utf-8",
|
|
||||||
".json": "application/json",
|
|
||||||
".svg": "image/svg+xml",
|
|
||||||
".png": "image/png",
|
|
||||||
".ico": "image/x-icon",
|
|
||||||
".woff": "font/woff",
|
|
||||||
".woff2": "font/woff2",
|
|
||||||
".txt": "text/plain; charset=utf-8",
|
|
||||||
};
|
|
||||||
|
|
||||||
function serve(dist, api) {
|
|
||||||
const index = readFileSync(join(dist, "index.html"));
|
|
||||||
const server = createHttpServer((req, res) => {
|
|
||||||
const url = new URL(req.url ?? "/", "http://127.0.0.1");
|
|
||||||
if (url.pathname.startsWith("/api/v1/") || url.pathname === "/api/v1") {
|
|
||||||
const chunks = [];
|
|
||||||
req.on("data", (c) => chunks.push(c));
|
|
||||||
req.on("end", () => {
|
|
||||||
let body = {};
|
|
||||||
try {
|
|
||||||
body = chunks.length ? JSON.parse(Buffer.concat(chunks).toString("utf8")) : {};
|
|
||||||
} catch {
|
|
||||||
body = {};
|
|
||||||
}
|
|
||||||
const a = api(req.method ?? "GET", url.pathname.slice("/api/v1".length) + url.search, body);
|
|
||||||
res.writeHead(a.status, { "Content-Type": "application/json", "Cache-Control": "no-store" });
|
|
||||||
res.end(a.text ?? undefined);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// The built files; any other path is the app's own route, answered with index.html.
|
|
||||||
const file = normalize(join(dist, decodeURIComponent(url.pathname)));
|
|
||||||
if (file.startsWith(dist + sep) && existsSync(file) && statSync(file).isFile()) {
|
|
||||||
res.writeHead(200, { "Content-Type": TYPES[extname(file)] ?? "application/octet-stream" });
|
|
||||||
res.end(readFileSync(file));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
res.writeHead(200, { "Content-Type": TYPES[".html"], "Cache-Control": "no-store" });
|
|
||||||
res.end(index);
|
|
||||||
});
|
|
||||||
return new Promise((ok, fail) => {
|
|
||||||
server.once("error", fail);
|
|
||||||
server.listen(0, "127.0.0.1", () => ok(server));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- the browser ----------
|
|
||||||
|
|
||||||
function findBrowser() {
|
|
||||||
const named = process.env.IANITOR_SHOTS_BROWSER;
|
|
||||||
if (named) {
|
|
||||||
if (!existsSync(named)) throw new Error(`IANITOR_SHOTS_BROWSER: ${named} does not exist`);
|
|
||||||
return named;
|
|
||||||
}
|
|
||||||
const candidates = [];
|
|
||||||
if (process.platform === "win32") {
|
|
||||||
for (const base of [process.env["ProgramFiles(x86)"], process.env.ProgramFiles, process.env.LOCALAPPDATA].filter(Boolean)) {
|
|
||||||
candidates.push(join(base, "Microsoft", "Edge", "Application", "msedge.exe"), join(base, "Google", "Chrome", "Application", "chrome.exe"));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (const dir of (process.env.PATH ?? "").split(delimiter).filter(Boolean)) {
|
|
||||||
for (const n of ["chromium", "chromium-browser", "google-chrome", "google-chrome-stable", "microsoft-edge"]) candidates.push(join(dir, n));
|
|
||||||
}
|
|
||||||
candidates.push("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome");
|
|
||||||
}
|
|
||||||
const found = candidates.find((c) => existsSync(c));
|
|
||||||
if (!found) throw new Error("no Microsoft Edge or Chrome found; set IANITOR_SHOTS_BROWSER to a Chromium browser");
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Only what a program needs to run, the user folders in the temporary folder, nothing of the runner's. */
|
|
||||||
function cleanEnv(home) {
|
|
||||||
const keep = /^(SystemRoot|SystemDrive|windir|ComSpec|PATH|PATHEXT|OS|PROCESSOR_.*|NUMBER_OF_PROCESSORS|ProgramFiles.*|ProgramW6432|CommonProgramFiles.*|CommonProgramW6432|ProgramData|ALLUSERSPROFILE|PUBLIC|LANG|TZ)$/i;
|
|
||||||
const env = {};
|
|
||||||
for (const [k, v] of Object.entries(process.env)) if (keep.test(k) && v !== undefined) env[k] = v;
|
|
||||||
for (const d of ["home", "appdata", "local", "temp"]) mkdirSync(join(home, d), { recursive: true });
|
|
||||||
Object.assign(env, {
|
|
||||||
HOME: join(home, "home"),
|
|
||||||
USERPROFILE: join(home, "home"),
|
|
||||||
APPDATA: join(home, "appdata"),
|
|
||||||
LOCALAPPDATA: join(home, "local"),
|
|
||||||
TEMP: join(home, "temp"),
|
|
||||||
TMP: join(home, "temp"),
|
|
||||||
TMPDIR: join(home, "temp"),
|
|
||||||
});
|
|
||||||
return env;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Edge may start its browser again as a new process, outside the tree: on Windows, anything still
|
|
||||||
* running with a profile in the temporary folder is stopped by its command line. */
|
|
||||||
function sweep(exe, tmp) {
|
|
||||||
if (process.platform !== "win32") return;
|
|
||||||
const script = "Get-CimInstance Win32_Process -Filter \"Name='$env:SHOTS_EXE'\" | Where-Object { $_.CommandLine -and $_.CommandLine.Contains($env:SHOTS_TMP) } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }";
|
|
||||||
spawnSync("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], {
|
|
||||||
stdio: "ignore",
|
|
||||||
windowsHide: true,
|
|
||||||
env: { ...cleanEnv(join(tmp, "sweep")), SHOTS_EXE: basename(exe), SHOTS_TMP: tmp },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function killTree(child) {
|
|
||||||
if (!child.pid || child.exitCode !== null) return;
|
|
||||||
if (process.platform === "win32") {
|
|
||||||
spawnSync("taskkill", ["/pid", String(child.pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
process.kill(-child.pid, "SIGKILL");
|
|
||||||
} catch {
|
|
||||||
child.kill("SIGKILL");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Starts the browser; one that has not opened DevTools after 20 s is killed and started again, twice. */
|
|
||||||
async function startBrowser(exe, tmp, size) {
|
|
||||||
for (let attempt = 1; ; attempt++) {
|
|
||||||
try {
|
|
||||||
return await launch(exe, join(tmp, `profile-${attempt}`), join(tmp, `user-${attempt}`), size);
|
|
||||||
} catch (e) {
|
|
||||||
if (attempt === 3 || e.fatal) throw e;
|
|
||||||
log(`${e.message}; starting it again`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function launch(exe, profile, user, size) {
|
|
||||||
mkdirSync(profile, { recursive: true });
|
|
||||||
const args = [
|
|
||||||
"--headless=new",
|
|
||||||
"--remote-debugging-port=0",
|
|
||||||
"--remote-debugging-address=127.0.0.1",
|
|
||||||
`--user-data-dir=${profile}`,
|
|
||||||
"--no-first-run",
|
|
||||||
"--no-default-browser-check",
|
|
||||||
"--disable-extensions",
|
|
||||||
"--disable-sync",
|
|
||||||
"--disable-background-networking",
|
|
||||||
"--disable-component-update",
|
|
||||||
"--disable-default-apps",
|
|
||||||
"--disable-features=Translate,OptimizationHints,MediaRouter,msSmartScreenProtection",
|
|
||||||
"--hide-scrollbars",
|
|
||||||
"--mute-audio",
|
|
||||||
"--force-color-profile=srgb",
|
|
||||||
"--force-device-scale-factor=1",
|
|
||||||
`--window-size=${size.width},${size.height}`,
|
|
||||||
"about:blank",
|
|
||||||
];
|
|
||||||
const child = spawn(exe, args, { env: cleanEnv(user), stdio: ["ignore", "ignore", "pipe"], windowsHide: true, detached: process.platform !== "win32" });
|
|
||||||
const stop = async () => {
|
|
||||||
killTree(child);
|
|
||||||
for (let i = 0; i < 50 && child.exitCode === null && child.signalCode === null; i++) await sleep(100);
|
|
||||||
};
|
|
||||||
cleanups.push(stop);
|
|
||||||
let stderr = "";
|
|
||||||
child.stderr.on("data", (d) => (stderr = (stderr + d).slice(-2000)));
|
|
||||||
const fail = async (msg, fatal = false) => {
|
|
||||||
await stop();
|
|
||||||
const tail = stderr.trim().split(/\r?\n/).slice(-3).join(" | ");
|
|
||||||
throw Object.assign(new Error(`${msg}${tail ? `; it said: ${tail}` : ""}`), { fatal });
|
|
||||||
};
|
|
||||||
let exited = null;
|
|
||||||
child.on("exit", (code) => (exited = code ?? -1));
|
|
||||||
child.on("error", (e) => (exited = e.message));
|
|
||||||
|
|
||||||
const portFile = join(profile, "DevToolsActivePort");
|
|
||||||
const deadline = Date.now() + 20_000;
|
|
||||||
let seen = "no DevToolsActivePort yet";
|
|
||||||
for (;;) {
|
|
||||||
if (exited !== null) await fail(`the browser exited before it was ready (${exited})`, typeof exited === "string");
|
|
||||||
if (existsSync(portFile)) {
|
|
||||||
const port = Number(readFileSync(portFile, "utf8").split(/\r?\n/)[0]);
|
|
||||||
if (port > 0) {
|
|
||||||
try {
|
|
||||||
const list = await (await fetch(`http://127.0.0.1:${port}/json/list`)).json();
|
|
||||||
const page = list.find((t) => t.type === "page" && t.webSocketDebuggerUrl);
|
|
||||||
if (page) return page.webSocketDebuggerUrl;
|
|
||||||
seen = `no page among ${list.length} targets on port ${port}`;
|
|
||||||
await fetch(`http://127.0.0.1:${port}/json/new?about:blank`, { method: "PUT" }).catch(() => {});
|
|
||||||
} catch (e) {
|
|
||||||
seen = `port ${port}: ${e.cause?.message ?? e.message}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Date.now() > deadline) await fail(`the browser's DevTools did not answer within 20 s (${seen})`);
|
|
||||||
await sleep(200);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** A minimal DevTools client over Node's WebSocket. */
|
|
||||||
async function devtools(url) {
|
|
||||||
const ws = new WebSocket(url);
|
|
||||||
await new Promise((ok, fail) => {
|
|
||||||
ws.onopen = ok;
|
|
||||||
ws.onerror = () => fail(new Error("cannot open the browser's DevTools socket"));
|
|
||||||
});
|
|
||||||
let id = 0;
|
|
||||||
const pending = new Map();
|
|
||||||
ws.onmessage = (m) => {
|
|
||||||
const msg = JSON.parse(String(m.data));
|
|
||||||
const p = msg.id !== undefined && pending.get(msg.id);
|
|
||||||
if (!p) return;
|
|
||||||
pending.delete(msg.id);
|
|
||||||
if (msg.error) p.fail(new Error(`${p.method}: ${msg.error.message}`));
|
|
||||||
else p.ok(msg.result);
|
|
||||||
};
|
|
||||||
ws.onclose = () => {
|
|
||||||
for (const p of pending.values()) p.fail(new Error("the browser closed its DevTools socket"));
|
|
||||||
pending.clear();
|
|
||||||
};
|
|
||||||
cleanups.push(() => ws.close());
|
|
||||||
const send = (method, params = {}) =>
|
|
||||||
new Promise((ok, fail) => {
|
|
||||||
const n = ++id;
|
|
||||||
pending.set(n, { ok, fail, method });
|
|
||||||
ws.send(JSON.stringify({ id: n, method, params }));
|
|
||||||
});
|
|
||||||
/** The value of an expression in the page; a page being replaced answers again later. */
|
|
||||||
const evaluate = async (expression) => {
|
|
||||||
const r = await send("Runtime.evaluate", { expression, awaitPromise: true, returnByValue: true });
|
|
||||||
if (r.exceptionDetails) throw new Error(r.exceptionDetails.exception?.description ?? r.exceptionDetails.text);
|
|
||||||
return r.result.value;
|
|
||||||
};
|
|
||||||
return { send, evaluate };
|
|
||||||
}
|
|
||||||
|
|
||||||
async function until(what, test) {
|
|
||||||
const deadline = Date.now() + WAIT_MS;
|
|
||||||
let last = null;
|
|
||||||
while (Date.now() < deadline) {
|
|
||||||
try {
|
|
||||||
if (await test()) return;
|
|
||||||
} catch (e) {
|
|
||||||
last = e;
|
|
||||||
}
|
|
||||||
await sleep(100);
|
|
||||||
}
|
|
||||||
throw new Error(`waited ${WAIT_MS / 1000} s for ${what}${last ? ` (${last.message})` : ""}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- the shots ----------
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
clearOutput();
|
|
||||||
const tmp = mkdtempSync(join(tmpdir(), "ianitor-shots-"));
|
|
||||||
cleanups.push(async () => {
|
|
||||||
for (let i = 0; i < 20; i++) {
|
|
||||||
try {
|
|
||||||
rmSync(tmp, { recursive: true, force: true });
|
|
||||||
return;
|
|
||||||
} catch {
|
|
||||||
await sleep(250);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.error(`shots: could not remove ${tmp}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
// The demo's shots and answers, from the TypeScript the tests use.
|
|
||||||
const loader = await createViteServer({
|
|
||||||
root: web,
|
|
||||||
configFile: false,
|
|
||||||
logLevel: "error",
|
|
||||||
appType: "custom",
|
|
||||||
server: { middlewareMode: true, hmr: false, ws: false },
|
|
||||||
optimizeDeps: { noDiscovery: true, include: [] },
|
|
||||||
});
|
|
||||||
let demo;
|
|
||||||
try {
|
|
||||||
demo = await loader.ssrLoadModule("/tests/demo.ts");
|
|
||||||
} finally {
|
|
||||||
await loader.close();
|
|
||||||
}
|
|
||||||
const { SHOTS, SIZE, demoApi } = demo;
|
|
||||||
|
|
||||||
log("building the web UI");
|
|
||||||
const dist = join(tmp, "dist");
|
|
||||||
await build({ root: web, logLevel: "warn", build: { outDir: dist, emptyOutDir: true } });
|
|
||||||
|
|
||||||
const server = await serve(dist, demoApi());
|
|
||||||
cleanups.push(() => new Promise((r) => server.close(() => r())));
|
|
||||||
server.closeAllConnections && cleanups.push(() => server.closeAllConnections());
|
|
||||||
const base = `http://127.0.0.1:${server.address().port}`;
|
|
||||||
log(`demo control plane and UI on ${base}`);
|
|
||||||
|
|
||||||
const exe = findBrowser();
|
|
||||||
log(`browser: ${exe}`);
|
|
||||||
cleanups.push(() => sweep(exe, tmp));
|
|
||||||
const page = await devtools(await startBrowser(exe, tmp, SIZE));
|
|
||||||
await page.send("Page.enable");
|
|
||||||
await page.send("Emulation.setDeviceMetricsOverride", { width: SIZE.width, height: SIZE.height, deviceScaleFactor: 1, mobile: false });
|
|
||||||
|
|
||||||
const taken = [];
|
|
||||||
for (const shot of SHOTS) {
|
|
||||||
const url = base + shot.path;
|
|
||||||
try {
|
|
||||||
// A fresh load per shot: mark the old page, so a page that has not been replaced yet does not count.
|
|
||||||
await page.evaluate("window.__ianitorShotsOld = true").catch(() => {});
|
|
||||||
await page.send("Page.navigate", { url });
|
|
||||||
await until(`${url} to load`, () => page.evaluate("!window.__ianitorShotsOld && document.readyState === 'complete'"));
|
|
||||||
for (const sel of shot.click ?? []) {
|
|
||||||
const q = JSON.stringify(sel);
|
|
||||||
await until(`${sel} to click`, () => page.evaluate(`(() => { const e = document.querySelector(${q}); if (!e) return false; e.click(); return true; })()`));
|
|
||||||
}
|
|
||||||
const w = JSON.stringify(shot.wait);
|
|
||||||
await until(shot.wait, () => page.evaluate(`!!document.querySelector(${w})`));
|
|
||||||
await page.evaluate("document.fonts.ready.then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r(true)))))");
|
|
||||||
await sleep(400);
|
|
||||||
} catch (e) {
|
|
||||||
try {
|
|
||||||
const failed = await page.send("Page.captureScreenshot", { format: "png" });
|
|
||||||
writeFileSync(join(out, `aula-${shot.name}-failed.png`), Buffer.from(failed.data, "base64"));
|
|
||||||
} catch {
|
|
||||||
/* nothing to save */
|
|
||||||
}
|
|
||||||
throw new Error(`shot ${shot.name}: ${e.message}; the page was ${url}; what it showed is aula-${shot.name}-failed.png`);
|
|
||||||
}
|
|
||||||
const png = Buffer.from((await page.send("Page.captureScreenshot", { format: "png" })).data, "base64");
|
|
||||||
const { width, height } = pngSize(png);
|
|
||||||
const file = `aula-${shot.name}.png`;
|
|
||||||
writeFileSync(join(out, file), png);
|
|
||||||
taken.push({ name: shot.name, title: shot.title, file, width, height, sha256: createHash("sha256").update(png).digest("hex") });
|
|
||||||
log(`${file} ${width}x${height}`);
|
|
||||||
}
|
|
||||||
writeFileSync(join(out, "aula.json"), `${JSON.stringify({ v: 1, shots: taken })}\n`);
|
|
||||||
log(`${taken.length} shots and aula.json in ${out}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
let code = 0;
|
|
||||||
try {
|
|
||||||
await main();
|
|
||||||
} catch (e) {
|
|
||||||
console.error(`shots: ${e?.message ?? e}`);
|
|
||||||
code = 1;
|
|
||||||
} finally {
|
|
||||||
await cleanup();
|
|
||||||
}
|
|
||||||
process.exit(code);
|
|
||||||
+11
-4
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// The shell (handoff §2.16): sidebar on desktop, top and bottom bars on phone, the routes,
|
// 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).
|
// the banners every screen starts with, toasts and the signed-out dialog (§10).
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
import TopBanners from "./components/TopBanners.svelte";
|
import TopBanners from "./components/TopBanners.svelte";
|
||||||
import { app, navigate, refresh, startPolling } from "./lib/app.svelte";
|
import { app, navigate, refresh, startPolling } from "./lib/app.svelte";
|
||||||
import { remembered } from "./lib/applies";
|
import { remembered } from "./lib/applies";
|
||||||
|
import { CREDIT } from "./lib/credit";
|
||||||
import Certificates from "./views/Certificates.svelte";
|
import Certificates from "./views/Certificates.svelte";
|
||||||
import History from "./views/History.svelte";
|
import History from "./views/History.svelte";
|
||||||
import Hosts from "./views/Hosts.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>{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>
|
<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}
|
{#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>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<header class="topbar"><span class="ia-wordmark">IANITOR DOMI</span>{#if app.phone}<EngineChip />{/if}</header>
|
<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"}
|
{:else if route.view === "settings"}
|
||||||
<Settings tab={route.tab} />
|
<Settings tab={route.tab} />
|
||||||
{/if}
|
{/if}
|
||||||
|
<p class="credit phone-credit ia-muted"><a href={CREDIT.url} rel="noreferrer">{CREDIT.phrase}</a> · {CREDIT.notice}</p>
|
||||||
</main>
|
</main>
|
||||||
<nav class="bottombar" aria-label="Main">
|
<nav class="bottombar" aria-label="Main">
|
||||||
{#each NAV as n (n.href)}
|
{#each NAV as n (n.href)}
|
||||||
@@ -160,10 +163,14 @@
|
|||||||
.nav[aria-current="page"] :global(svg) { color: var(--accent); }
|
.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; }
|
.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; }
|
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) {
|
@media (max-width: 719.98px) {
|
||||||
.shell { grid-template-columns: minmax(0, 1fr); }
|
.shell { grid-template-columns: minmax(0, 1fr); }
|
||||||
.sidebar { display: none; }
|
.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 { 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; }
|
.topbar .ia-wordmark { font-size: 12px; letter-spacing: 0.26em; }
|
||||||
main { padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); gap: 14px; }
|
main { padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); gap: 14px; }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §7.1: the apply checklist, its countdown and the queued state.
|
// Handoff §7.1: the apply checklist, its countdown and the queued state.
|
||||||
import { Button, Icon, Progress } from "@ianitor/ui";
|
import { Button, Icon, Progress } from "@ianitor/ui";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §7.4 and §7.5: the last-change bar with Undo (1 click), and the reverted / not
|
// Handoff §7.4 and §7.5: the last-change bar with Undo (1 click), and the reverted / not
|
||||||
// applied banner that stands in for its first line.
|
// applied banner that stands in for its first line.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §2.4: the engine chip (click 1 of the switch). On the main screen's header on a
|
// Handoff §2.4: the engine chip (click 1 of the switch). On the main screen's header on a
|
||||||
// desktop, in the top bar on a phone (§2.16).
|
// desktop, in the top bar on a phone (§2.16).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §9: the engine popover. Click 1 is the chip, click 2 "Switch to Caddy" (the popover
|
// Handoff §9: the engine popover. Click 1 is the chip, click 2 "Switch to Caddy" (the popover
|
||||||
// is the confirmation). The switch runs in control; this polls GET /engine until it ends.
|
// is the confirmation). The switch runs in control; this polls GET /engine until it ends.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §2.5 and §5.1: the host list, sorted down, degraded, pending, unknown, healthy.
|
// Handoff §2.5 and §5.1: the host list, sorted down, degraded, pending, unknown, healthy.
|
||||||
import { Status } from "@ianitor/ui";
|
import { Status } from "@ianitor/ui";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts" module>
|
<script lang="ts" module>
|
||||||
import type { IconName } from "@ianitor/ui";
|
import type { IconName } from "@ianitor/ui";
|
||||||
export interface Item {
|
export interface Item {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §6 and §7: the add/edit panel, its validation on blur, Apply, and the progress and
|
// Handoff §6 and §7: the add/edit panel, its validation on blur, Apply, and the progress and
|
||||||
// outcome of the apply it starts. Every decision comes from control; the form only carries it.
|
// outcome of the apply it starts. Every decision comes from control; the form only carries it.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §13.5: the intermediate banner. Renew is 1 click; the banner then shows the match
|
// Handoff §13.5: the intermediate banner. Renew is 1 click; the banner then shows the match
|
||||||
// code. Until Custos can sign (docs/custos-ticket.md) the request is signed by hand offline,
|
// code. Until Custos can sign (docs/custos-ticket.md) the request is signed by hand offline,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §8.2: mint on open (click 2), Copy link (click 3). Changing an option re-mints with
|
// Handoff §8.2: mint on open (click 2), Copy link (click 3). Changing an option re-mints with
|
||||||
// `replaces`, so one link from this dialog is valid at a time; closing without copying stops it.
|
// `replaces`, so one link from this dialog is valid at a time; closing without copying stops it.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §2.8 order: paused / needs attention, lost contact, health unavailable, the Caddy
|
// Handoff §2.8 order: paused / needs attention, lost contact, health unavailable, the Caddy
|
||||||
// notice, then (on Hosts) the intermediate banner. First on every screen.
|
// notice, then (on Hosts) the intermediate banner. First on every screen.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
// The one typed API client (handoff §0, §10, §11). It owns the base path, the UI header (CSRF),
|
// The one typed API client (handoff §0, §10, §11). It owns the base path, the UI header (CSRF),
|
||||||
// redirect: "manual" (sign-out detection), Idempotency-Keys, the error envelope, the server
|
// redirect: "manual" (sign-out detection), Idempotency-Keys, the error envelope, the server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
// Shared UI state: the overview (polled, handoff §3), the route, contact and sign-in state,
|
// Shared UI state: the overview (polled, handoff §3), the route, contact and sign-in state,
|
||||||
// the server clock offset and toasts. No business logic: everything shown comes from control.
|
// the server clock offset and toasts. No business logic: everything shown comes from control.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
// Following an apply (handoff §2.2 of ui-api, §3 here): GET /applies/{id} every second while it
|
// Following an apply (handoff §2.2 of ui-api, §3 here): GET /applies/{id} every second while it
|
||||||
// runs; quiet retries while edge reloads; the id kept in sessionStorage so a reload resumes it.
|
// runs; quiet retries while edge reloads; the id kept in sessionStorage so a reload resumes it.
|
||||||
|
|||||||
@@ -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
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
// Formatting only (handoff §3): times in the browser's zone, 24-hour clock, counts sentences.
|
// Formatting only (handoff §3): times in the browser's zone, 24-hour clock, counts sentences.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
// The shapes the UI reads from control (docs/api.md, docs/ui-api.md, GET /api/v1/openapi.json).
|
// The shapes the UI reads from control (docs/api.md, docs/ui-api.md, GET /api/v1/openapi.json).
|
||||||
// Only the fields the UI uses are typed.
|
// Only the fields the UI uses are typed.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
import "@ianitor/ui/tokens.css";
|
import "@ianitor/ui/tokens.css";
|
||||||
import "@ianitor/ui/components.css";
|
import "@ianitor/ui/components.css";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §13: Certificates → + Device → Issue (3 clicks), approval with the match code, then
|
// Handoff §13: Certificates → + Device → Issue (3 clicks), approval with the match code, then
|
||||||
// the install (the accepted 4th click). Until Custos can approve, approval is the server
|
// the install (the accepted 4th click). Until Custos can approve, approval is the server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §8.1: History → pick → Restore this version (3 clicks with the nav click).
|
// Handoff §8.1: History → pick → Restore this version (3 clicks with the nav click).
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §5: the main screen.
|
// Handoff §5: the main screen.
|
||||||
import { tick } from "svelte";
|
import { tick } from "svelte";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §13.6: signing the intermediate by hand on the offline computer (the temporary step
|
// Handoff §13.6: signing the intermediate by hand on the offline computer (the temporary step
|
||||||
// until Custos can sign, docs/pki.md). The root key never comes to this server.
|
// until Custos can sign, docs/pki.md). The root key never comes to this server.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §8.3: Settings with General, API (⚙ → API → New token = 3 clicks, Copy token the
|
// Handoff §8.3: Settings with General, API (⚙ → API → New token = 3 clicks, Copy token the
|
||||||
// accepted 4th), Share links and About.
|
// accepted 4th), Share links and About.
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
import { ApiError, call, del, get, newKey, patch, post, sentence } from "../lib/api";
|
import { ApiError, call, del, get, newKey, patch, post, sentence } from "../lib/api";
|
||||||
import { app, navigate, toast } from "../lib/app.svelte";
|
import { app, navigate, toast } from "../lib/app.svelte";
|
||||||
import { longDate, shortDate, whenInline } from "../lib/format";
|
import { longDate, shortDate, whenInline } from "../lib/format";
|
||||||
|
import { CREDIT } from "../lib/credit";
|
||||||
import type { CreatedToken, ShareLink, TokenRow } from "../lib/types";
|
import type { CreatedToken, ShareLink, TokenRow } from "../lib/types";
|
||||||
|
|
||||||
let { tab }: { tab: string } = $props();
|
let { tab }: { tab: string } = $props();
|
||||||
@@ -234,7 +235,8 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<p>Ianitor Domi 0.1.0</p>
|
<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>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>
|
<p><a class="domi-btn link" href="https://gitea.marek-novak.cz/mnovak/Ianitor" rel="noreferrer">Source on Gitea</a></p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- SPDX-License-Identifier: CPAL-1.0
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
|
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// Handoff §10.2: Authelia sends the sign-in tab back here; it tells the first tab and closes.
|
// Handoff §10.2: Authelia sends the sign-in tab back here; it tells the first tab and closes.
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||||||
|
|
||||||
|
|||||||
+10
-21
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// 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
|
// 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
|
// plane alone (each click and wait selector found, no call unanswered), and nothing the demo
|
||||||
@@ -10,24 +10,7 @@ import { cleanup, render, waitFor } from "@testing-library/svelte";
|
|||||||
import { afterEach, describe, expect, it } from "vitest";
|
import { afterEach, describe, expect, it } from "vitest";
|
||||||
import App from "../src/App.svelte";
|
import App from "../src/App.svelte";
|
||||||
import { app } from "../src/lib/app.svelte";
|
import { app } from "../src/lib/app.svelte";
|
||||||
import { SHOTS, demoApi } from "./demo";
|
import { SHOTS, demoApi, realLooking } from "./demo";
|
||||||
|
|
||||||
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. */
|
|
||||||
function realLooking(text: string): string[] {
|
|
||||||
const found: string[] = [];
|
|
||||||
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]);
|
|
||||||
}
|
|
||||||
for (const m of text.matchAll(/(?<![\w.-])(?:[a-z0-9-]+\.)+([a-z][a-z0-9-]*)(?![\w-])/gi)) {
|
|
||||||
if (!ALLOWED_TLDS.has(m[1].toLowerCase())) found.push(m[0]);
|
|
||||||
}
|
|
||||||
for (const w of FORBIDDEN) if (new RegExp(`\\b${w}\\b`, "i").test(text)) found.push(w);
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
let served: { status: number; path: string; text: string | null }[] = [];
|
let served: { status: number; path: string; text: string | null }[] = [];
|
||||||
|
|
||||||
@@ -71,6 +54,12 @@ describe("realLooking", () => {
|
|||||||
expect(realLooking("gitea.example.cz and Mark's phone")).toEqual(["gitea.example.cz", "mark"]);
|
expect(realLooking("gitea.example.cz and Mark's phone")).toEqual(["gitea.example.cz", "mark"]);
|
||||||
expect(realLooking("flowers.stage")).toEqual(["flowers.stage", "flowers"]);
|
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", () => {
|
describe("the release's screenshots from the demo control plane", () => {
|
||||||
|
|||||||
+68
-10
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// 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
|
// 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
|
// (docs/api.md) for a small invented home server, built on the click smoke test's stand-in
|
||||||
@@ -9,7 +9,8 @@
|
|||||||
// and felix, made-up commits and fingerprints. demo.test.ts renders every shot from it and fails
|
// and felix, made-up commits and fingerprints. demo.test.ts renders every shot from it and fails
|
||||||
// on any other name or address.
|
// on any other name or address.
|
||||||
|
|
||||||
import { apply, host, mockRoutes, newMock, respond, type Route } from "./mockApi";
|
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". */
|
/** One screenshot: the page, the selectors clicked in order, and the selector that means "drawn". */
|
||||||
export interface Shot {
|
export interface Shot {
|
||||||
@@ -34,7 +35,7 @@ export const SHOTS: Shot[] = [
|
|||||||
type Json = Record<string, unknown>;
|
type Json = Record<string, unknown>;
|
||||||
|
|
||||||
const DAY = 86_400;
|
const DAY = 86_400;
|
||||||
const at = (s: number) => new Date(Date.now() + s * 1000).toISOString();
|
const at = (s: number) => new Date(nowMs() + s * 1000).toISOString();
|
||||||
|
|
||||||
interface Health {
|
interface Health {
|
||||||
state: string;
|
state: string;
|
||||||
@@ -97,8 +98,8 @@ function intermediate(): Json {
|
|||||||
return { state: "ok", subject: "Demo Intermediate CA", not_after: at(212 * DAY), days_left: 212, renewal: null, banner: null };
|
return { state: "ok", subject: "Demo Intermediate CA", not_after: at(212 * DAY), days_left: 212, renewal: null, banner: null };
|
||||||
}
|
}
|
||||||
|
|
||||||
function overview(): Json {
|
function overview(added: Json[] = []): Json {
|
||||||
const list = hosts();
|
const list = [...hosts(), ...added];
|
||||||
const count = (s: string) => list.filter((h) => (h.health as Json).state === s).length;
|
const count = (s: string) => list.filter((h) => (h.health as Json).state === s).length;
|
||||||
return {
|
return {
|
||||||
counts: { hosts: list.length, healthy: count("healthy"), degraded: count("degraded"), down: count("down"), unknown: count("unknown") },
|
counts: { hosts: list.length, healthy: count("healthy"), degraded: count("degraded"), down: count("down"), unknown: count("unknown") },
|
||||||
@@ -213,10 +214,47 @@ function certs(): Json {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The demo's own answers, first; the smoke test's stand-in answers the rest. */
|
/** The demo's own answers, first; the smoke test's stand-in answers the rest. A host added in the
|
||||||
|
* demo (the e2e suite's Add host flow) is listed from then on, healthy, with the upstream it was
|
||||||
|
* given; a device certificate request carries the name it was asked with. */
|
||||||
export function demoRoutes(): Route[] {
|
export function demoRoutes(): Route[] {
|
||||||
|
const m = newMock();
|
||||||
|
const added: Json[] = [];
|
||||||
|
let device = "";
|
||||||
|
const request = (state: "waiting" | "approved"): Json => ({
|
||||||
|
request_id: "pr_dev",
|
||||||
|
kind: "device",
|
||||||
|
state,
|
||||||
|
match_code: "47 19 83",
|
||||||
|
created_at: at(-5),
|
||||||
|
expires_at: at(600),
|
||||||
|
approved_at: state === "approved" ? at(0) : null,
|
||||||
|
device_id: state === "approved" ? "dv_1" : null,
|
||||||
|
name: device,
|
||||||
|
csr_pem: null,
|
||||||
|
not_after: state === "approved" ? at(365 * DAY) : null,
|
||||||
|
message_code: state === "approved" ? "pki.issued" : "pki.waiting.manual",
|
||||||
|
message: state === "approved" ? `${device} has a certificate.` : "Approve it on the server with the match code.",
|
||||||
|
approve_command: state === "approved" ? null : "ianitor-control pki approve 47 19 83",
|
||||||
|
problem: null,
|
||||||
|
});
|
||||||
return [
|
return [
|
||||||
["GET", /^\/overview$/, () => [200, overview()]],
|
["GET", /^\/overview$/, () => [200, overview(added)]],
|
||||||
|
["POST", /^\/hosts$/, (_, b) => {
|
||||||
|
const h = b.host as Json;
|
||||||
|
const name = String(h.hostname);
|
||||||
|
m.state.hostsAdded.push(name);
|
||||||
|
const ups = Array.isArray(h.upstreams) ? h.upstreams.map(String) : [];
|
||||||
|
added.push(demoHost(name, ups, { state: "healthy", latency: 11 }, { added_at: at(0) }));
|
||||||
|
return [202, { apply: apply("ch_new", "queued", `Added ${name}`, [name]) }];
|
||||||
|
}],
|
||||||
|
["POST", /^\/certs\/devices$/, (_, b) => {
|
||||||
|
device = String(b.name ?? "");
|
||||||
|
return [202, request("waiting")];
|
||||||
|
}],
|
||||||
|
["GET", /^\/pki-requests\/pr_dev$/, () => [200, request("approved")]],
|
||||||
|
// A share link whose token cannot be read as a name (the stand-in's `ish1.abc` would be).
|
||||||
|
["POST", /^\/hosts\/([^/]+)\/share-links$/, (mm) => [201, { id: "sl_demo", url: `https://${decodeURIComponent(mm[1])}/?share=ish1.4f9c2a7e1b0d`, expires_at: at(7 * DAY), path_prefix: "/", has_password: false, warning: null }]],
|
||||||
["GET", /^\/hosts\/([^/?]+)$/, (mm) => {
|
["GET", /^\/hosts\/([^/?]+)$/, (mm) => {
|
||||||
const s = spec(decodeURIComponent(mm[1]));
|
const s = spec(decodeURIComponent(mm[1]));
|
||||||
return s ? [200, { host: s, rev: "rev-demo-8" }] : [404, { error: { code: "host.not_found", message: "There is no such host.", field: null, params: {}, retry_after_s: null, detail: null }, errors: [], request_id: "demo" }];
|
return s ? [200, { host: s, rev: "rev-demo-8" }] : [404, { error: { code: "host.not_found", message: "There is no such host.", field: null, params: {}, retry_after_s: null, detail: null }, errors: [], request_id: "demo" }];
|
||||||
@@ -225,7 +263,7 @@ export function demoRoutes(): Route[] {
|
|||||||
["GET", /^\/history\/([^/]+)\/restore-preview$/, (mm) => [200, restorePreview(decodeURIComponent(mm[1]))]],
|
["GET", /^\/history\/([^/]+)\/restore-preview$/, (mm) => [200, restorePreview(decodeURIComponent(mm[1]))]],
|
||||||
["GET", /^\/certs$/, () => [200, certs()]],
|
["GET", /^\/certs$/, () => [200, certs()]],
|
||||||
["GET", /^\/settings$/, () => [200, { repo: { name: "home-routes", last_push_at: at(-2 * 3600) }, watch_seconds: 60 }]],
|
["GET", /^\/settings$/, () => [200, { repo: { name: "home-routes", last_push_at: at(-2 * 3600) }, watch_seconds: 60 }]],
|
||||||
...mockRoutes(newMock()),
|
...mockRoutes(m),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,3 +272,23 @@ export function demoApi(): (method: string, path: string, body: Json) => { statu
|
|||||||
const routes = demoRoutes();
|
const routes = demoRoutes();
|
||||||
return (method, path, body) => respond(routes, method.toUpperCase(), path, body);
|
return (method, path, body) => respond(routes, method.toUpperCase(), path, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// What the demo may show (demo.test.ts, and the e2e suite on every page it visits).
|
||||||
|
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. 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]);
|
||||||
|
}
|
||||||
|
for (const m of text.matchAll(/(?<![\w.-])(?:[a-z0-9-]+\.)+([a-z][a-z0-9-]*)(?![\w-])/gi)) {
|
||||||
|
if (!ALLOWED_TLDS.has(m[1].toLowerCase())) found.push(m[0]);
|
||||||
|
}
|
||||||
|
for (const w of FORBIDDEN) if (new RegExp(`\\b${w}\\b`, "i").test(text)) found.push(w);
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
// The smoke test of every ROADMAP §4 flow with its clicks counted (handoff §4, §15): the real
|
// The smoke test of every ROADMAP §4 flow with its clicks counted (handoff §4, §15): the real
|
||||||
// app against a stand-in for control's API. Typing, focus and waiting are not clicks.
|
// app against a stand-in for control's API. Typing, focus and waiting are not clicks.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
// A stateful stand-in for control's API, shaped like the real answers (docs/api.md), so the
|
// A stateful stand-in for control's API, shaped like the real answers (docs/api.md), so the
|
||||||
// smoke tests can walk every §4 flow and count its clicks. Its builders and routes are also the
|
// smoke tests can walk every §4 flow and count its clicks. Its builders and routes are also the
|
||||||
@@ -20,8 +20,11 @@ export interface Mock {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const now = () => new Date().toISOString();
|
/** The stand-in's clock: the real one, or a fixed instant (the e2e suite's, so two takes of a screen match). */
|
||||||
const later = (s: number) => new Date(Date.now() + s * 1000).toISOString();
|
export const clock: { fixed: number | null } = { fixed: null };
|
||||||
|
export const nowMs = () => clock.fixed ?? Date.now();
|
||||||
|
const now = () => new Date(nowMs()).toISOString();
|
||||||
|
const later = (s: number) => new Date(nowMs() + s * 1000).toISOString();
|
||||||
|
|
||||||
export function host(hostname: string, share: boolean) {
|
export function host(hostname: string, share: boolean) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
// jsdom lacks a few browser features the UI uses.
|
// jsdom lacks a few browser features the UI uses.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||||
import { defineConfig } from "vitest/config";
|
import { defineConfig } from "vitest/config";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The handlers, each annotated for the OpenAPI document.
|
//! The handlers, each annotated for the OpenAPI document.
|
||||||
|
|
||||||
@@ -1375,7 +1375,7 @@ impl Modify for Bearer {
|
|||||||
description = "REST + JSON on loopback. Every call needs `Authorization: Bearer <API token>`. \
|
description = "REST + JSON on loopback. Every call needs `Authorization: Bearer <API token>`. \
|
||||||
Errors are `{error: {code, message, field, params, retry_after_s, detail}, errors: [...], request_id}`. \
|
Errors are `{error: {code, message, field, params, retry_after_s, detail}, errors: [...], request_id}`. \
|
||||||
Every JSON object answer carries `server_time`. See docs/api.md and docs/ui-api.md.",
|
Every JSON object answer carries `server_time`. See docs/api.md and docs/ui-api.md.",
|
||||||
license(name = "MPL-2.0")
|
license(name = "CPAL-1.0", identifier = "CPAL-1.0")
|
||||||
),
|
),
|
||||||
paths(
|
paths(
|
||||||
overview, list_hosts, get_host, validate_host, create_host, update_host, patch_host, delete_host,
|
overview, list_hosts, get_host, validate_host, create_host, update_host, patch_host, delete_host,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The REST + JSON API on loopback (`/api/v1`), with its OpenAPI document generated from the
|
//! The REST + JSON API on loopback (`/api/v1`), with its OpenAPI document generated from the
|
||||||
//! handlers (utoipa).
|
//! handlers (utoipa).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Certificates (docs/ui-api.md §1.7, §1.8, §3.6) and the engine switch (§1.9).
|
//! Certificates (docs/ui-api.md §1.7, §1.8, §3.6) and the engine switch (§1.9).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! In front of the API guard: the built web UI (`[ui] static_dir`) and the one-time device
|
//! In front of the API guard: the built web UI (`[ui] static_dir`) and the one-time device
|
||||||
//! downloads. The UI's files hold no data (it reads everything from the API, which the guard
|
//! downloads. The UI's files hold no data (it reads everything from the API, which the guard
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Response shapes (docs/ui-api.md §1, §2), built from control's state. Times are RFC 3339
|
//! Response shapes (docs/ui-api.md §1, §2), built from control's state. Times are RFC 3339
|
||||||
//! UTC; every JSON object answer also gets `server_time` from the API layer.
|
//! UTC; every JSON object answer also gets `server_time` from the API layer.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The deadline of a trial under Caddy (QC round 2, B2; the Phase 2 guarantee that an
|
//! The deadline of a trial under Caddy (QC round 2, B2; the Phase 2 guarantee that an
|
||||||
//! unconfirmed change never outlives control). Edge drops a trial by itself when control does
|
//! unconfirmed change never outlives control). Edge drops a trial by itself when control does
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Control's side of the Caddy fallback while it serves (Mark, 2026-11-08: changes keep
|
//! Control's side of the Caddy fallback while it serves (Mark, 2026-11-08: changes keep
|
||||||
//! working under Caddy): loading a config through Caddy's admin API on its Unix socket
|
//! working under Caddy): loading a config through Caddy's admin API on its Unix socket
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! `control.toml`: where control keeps its state, the routes repository, the files it writes
|
//! `control.toml`: where control keeps its state, the routes repository, the files it writes
|
||||||
//! for edge and Caddy, and the deployment facts both compilers need. Written by the NixOS
|
//! for edge and Caddy, and the deployment facts both compilers need. Written by the NixOS
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Crash points for the crash-safety tests: with `IANITOR_TEST_CRASH_AT=<stage>` in its
|
//! Crash points for the crash-safety tests: with `IANITOR_TEST_CRASH_AT=<stage>` in its
|
||||||
//! environment, control exits at once with status 134 (no cleanup in Ianitor's code, like a
|
//! environment, control exits at once with status 134 (no cleanup in Ianitor's code, like a
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! `ianitor-control --dev`: everything temporary, on 127.0.0.1. A fresh routes repository, a
|
//! `ianitor-control --dev`: everything temporary, on 127.0.0.1. A fresh routes repository, a
|
||||||
//! state directory, a share-link key and one API token printed once. If an `ianitor-edge`
|
//! state directory, a share-link key and one API token printed once. If an `ianitor-edge`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Control's side of edge's admin socket (see `ianitor_edge::admin`).
|
//! Control's side of edge's admin socket (see `ianitor_edge::admin`).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The apply pipeline (ROADMAP §3): validate → compile both outputs → commit → write the
|
//! The apply pipeline (ROADMAP §3): validate → compile both outputs → commit → write the
|
||||||
//! trial files → edge loads the trial → watch the touched hosts → confirm and promote ("kept"),
|
//! trial files → edge loads the trial → watch the touched hosts → confirm and promote ("kept"),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Applies while Caddy serves (Mark, 2026-11-08: changes keep working under Caddy). The same
|
//! Applies while Caddy serves (Mark, 2026-11-08: changes keep working under Caddy). The same
|
||||||
//! pipeline and journal as with edge; only the trial, the watch and the revert differ:
|
//! pipeline and journal as with edge; only the trial, the watch and the revert differ:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The host body of the API. It mirrors the host TOML file field for field (docs/ui-api.md
|
//! The host body of the API. It mirrors the host TOML file field for field (docs/ui-api.md
|
||||||
//! §1.2), so control writes exactly what Mark would write by hand. Core validates the TOML
|
//! §1.2), so control writes exactly what Mark would write by hand. Core validates the TOML
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Ianitor control: the routes repository, apply with automatic rollback, share links, API
|
//! Ianitor control: the routes repository, apply with automatic rollback, share links, API
|
||||||
//! tokens and the REST API, on loopback only. It never serves public traffic; if it stops,
|
//! tokens and the REST API, on loopback only. It never serves public traffic; if it stops,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Error log on stderr (journald under systemd). Control never logs request headers, bodies,
|
//! Error log on stderr (journald under systemd). Control never logs request headers, bodies,
|
||||||
//! query strings, tokens, passwords or share links: request lines are logged as method and
|
//! query strings, tokens, passwords or share links: request lines are logged as method and
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! ```text
|
//! ```text
|
||||||
//! ianitor-control --config <control.toml> run the control plane
|
//! ianitor-control --config <control.toml> run the control plane
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Every user-facing message, by code, in the words of docs/ui-api.md §3. `{x}` is filled from
|
//! Every user-facing message, by code, in the words of docs/ui-api.md §3. `{x}` is filled from
|
||||||
//! the params; a missing param leaves a plain gap rather than a placeholder.
|
//! the params; a missing param leaves a plain gap rather than a placeholder.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The Domi CA on the server (ROADMAP §1.2, §3): the intermediate, the server certificates
|
//! The Domi CA on the server (ROADMAP §1.2, §3): the intermediate, the server certificates
|
||||||
//! of `tls = "domi"` hosts, device certificates and their install files, and the requests
|
//! of `tls = "domi"` hosts, device certificates and their install files, and the requests
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Control's side of the Domi CA: certificates for the hosts of every tree that is applied,
|
//! Control's side of the Domi CA: certificates for the hosts of every tree that is applied,
|
||||||
//! the device files both engines read, and what happens after an approval, a renewal or a
|
//! the device files both engines read, and what happens after an approval, a renewal or a
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Apply records (one per user action: the history the UI shows, docs/ui-api.md §2.1) and the
|
//! Apply records (one per user action: the history the UI shows, docs/ui-api.md §2.1) and the
|
||||||
//! apply journal (what a crash interrupted).
|
//! apply journal (what a crash interrupted).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The routes repository: a bare git repository driven through the `git` binary.
|
//! The routes repository: a bare git repository driven through the `git` binary.
|
||||||
//!
|
//!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Share links on control's side: minting, the list, stopping.
|
//! Share links on control's side: minting, the list, stopping.
|
||||||
//!
|
//!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Switching the engine at runtime (ROADMAP §1.6 as corrected 2026-11-07, §3, §4).
|
//! Switching the engine at runtime (ROADMAP §1.6 as corrected 2026-11-07, §3, §4).
|
||||||
//!
|
//!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! API tokens. A token is `ian_<id>_<secret>`: a 16-hex-digit id (for listing and lookup)
|
//! API tokens. A token is `ian_<id>_<secret>`: a 16-hex-digit id (for listing and lookup)
|
||||||
//! and 32 random bytes. Control stores only SHA-256 of the whole token, in `tokens.json`
|
//! and 32 random bytes. Control stores only SHA-256 of the whole token, in `tokens.json`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Small shared helpers: time, randomness, hashing, atomic file writes.
|
//! Small shared helpers: time, randomness, hashing, atomic file writes.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The API's edges (ROADMAP §6 phase 2, tests first): requests without a valid token are
|
//! The API's edges (ROADMAP §6 phase 2, tests first): requests without a valid token are
|
||||||
//! rejected on every route and tokens never reach a log, an error or a state file; request
|
//! rejected on every route and tokens never reach a log, an error or a state file; request
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The apply pipeline (ROADMAP §6 phase 2, tests first): a failed health check reverts the
|
//! The apply pipeline (ROADMAP §6 phase 2, tests first): a failed health check reverts the
|
||||||
//! commit and restores the previous edge config; a control crash at any stage leaves edge on
|
//! commit and restores the previous edge config; a control crash at any stage leaves edge on
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! A control-plane test environment on 127.0.0.1: an edge running in this process (with its
|
//! A control-plane test environment on 127.0.0.1: an edge running in this process (with its
|
||||||
//! admin socket), the real `ianitor-control` binary as a child process (so a test can kill it
|
//! admin socket), the real `ianitor-control` binary as a child process (so a test can kill it
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Switching the engine at runtime (ROADMAP §3, §4; G18) with a fake `systemctl`: the engine
|
//! Switching the engine at runtime (ROADMAP §3, §4; G18) with a fake `systemctl`: the engine
|
||||||
//! file is written first, the old unit stopped and the new one started; while Caddy serves,
|
//! file is written first, the old unit stopped and the new one started; while Caddy serves,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The Domi CA through control (ROADMAP §6 phase 3, tests first): the first intermediate is
|
//! The Domi CA through control (ROADMAP §6 phase 3, tests first): the first intermediate is
|
||||||
//! signed offline from control's CSR and installed; `tls = "domi"` hosts then get server
|
//! signed offline from control's CSR and installed; `tls = "domi"` hosts then get server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Token and share-link stores (QC fix round 1, M2 and M4): a CLI revoke is never lost to the
|
//! Token and share-link stores (QC fix round 1, M2 and M4): a CLI revoke is never lost to the
|
||||||
//! server recording token use at the same time, and losing `share-links.json` never revives a
|
//! server recording token use at the same time, and losing `share-links.json` never revives a
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Sign-in for the web UI (G14, tests first). The UI reaches control through edge on the
|
//! Sign-in for the web UI (G14, tests first). The UI reaches control through edge on the
|
||||||
//! admin host, behind Authelia; edge adds a per-boot secret header (`X-Ianitor-Proof`, from a
|
//! admin host, behind Authelia; edge adds a per-boot secret header (`X-Ianitor-Proof`, from a
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Model → Caddy JSON (Caddy v2 native config) for the caddy-fallback unit.
|
//! Model → Caddy JSON (Caddy v2 native config) for the caddy-fallback unit.
|
||||||
//!
|
//!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Model → [`EdgeConfig`] for the Pingora data plane.
|
//! Model → [`EdgeConfig`] for the Pingora data plane.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Compilers from the validated [`Model`] to the two engines. Both are pure and deterministic:
|
//! Compilers from the validated [`Model`] to the two engines. Both are pure and deterministic:
|
||||||
//! the same model and options always give byte-identical output (no hash maps, hosts sorted,
|
//! the same model and options always give byte-identical output (no hash maps, hosts sorted,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The compiled runtime config read by ianitor-edge. Produced only by [`crate::compile::edge`].
|
//! The compiled runtime config read by ianitor-edge. Produced only by [`crate::compile::edge`].
|
||||||
//! Edge never decides policy: everything it does is spelled out here. Secret values are never
|
//! Edge never decides policy: everything it does is spelled out here. Secret values are never
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Typed validation errors. Every message names the file and says what is wrong in plain English.
|
//! Typed validation errors. Every message names the file and says what is wrong in plain English.
|
||||||
//!
|
//!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! Ianitor core: host-file model, validation and compilers. Pure: no I/O, no network.
|
//! Ianitor core: host-file model, validation and compilers. Pure: no I/O, no network.
|
||||||
//!
|
//!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The validated model. Values of these types only come out of [`crate::load`], so every
|
//! The validated model. Values of these types only come out of [`crate::load`], so every
|
||||||
//! compiler can rely on them being valid: the structs are `#[non_exhaustive]` and cannot be
|
//! compiler can rely on them being valid: the structs are `#[non_exhaustive]` and cannot be
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The Domi CA (ROADMAP §1.1, §1.2, §1.8, §3), as Ianitor uses it. The CA itself lives in the
|
//! The Domi CA (ROADMAP §1.1, §1.2, §1.8, §3), as Ianitor uses it. The CA itself lives in the
|
||||||
//! shared crate `domi-pki` (Fabrica `docs/32_coherence.md`, T3a); this module is Ianitor's view of
|
//! shared crate `domi-pki` (Fabrica `docs/32_coherence.md`, T3a); this module is Ianitor's view of
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// SPDX-License-Identifier: CPAL-1.0
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
|
||||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
|
||||||
|
|
||||||
//! The shape of the routes repository: exactly `ianitor.toml` and `hosts/<hostname>.toml`,
|
//! The shape of the routes repository: exactly `ianitor.toml` and `hosts/<hostname>.toml`,
|
||||||
//! regular files only. Anything else (other names, folders inside `hosts/`, symbolic links,
|
//! regular files only. Anything else (other names, folders inside `hosts/`, symbolic links,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user