diff --git a/.githooks/pre-commit b/.githooks/pre-commit index ca40a21..6385f87 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: CPAL-1.0 # # Pre-commit hook (shared with Ianitor). Rejects staged files that must never be in git: # - binaries: any NUL byte anywhere in the staged blob (git attributes do not matter) diff --git a/.githooks/test-pre-commit.sh b/.githooks/test-pre-commit.sh index 771e14a..469d6ba 100644 --- a/.githooks/test-pre-commit.sh +++ b/.githooks/test-pre-commit.sh @@ -1,5 +1,5 @@ #!/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 # hook and checks that every forbidden case is rejected and normal files are accepted. diff --git a/crates/agent/src/client.rs b/crates/agent/src/client.rs index ecea18a..747784e 100644 --- a/crates/agent/src/client.rs +++ b/crates/agent/src/client.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The Fabrica server, as the agent talks to it (docs/02_protocol.md). diff --git a/crates/agent/src/http.rs b/crates/agent/src/http.rs index 7949b0f..06ad859 100644 --- a/crates/agent/src/http.rs +++ b/crates/agent/src/http.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! A small HTTP/1.1 client over rustls: one request per connection, bodies framed by //! `Content-Length` or chunked encoding, every size bounded. The server's answers are hostile. diff --git a/crates/agent/src/lib.rs b/crates/agent/src/lib.rs index be056a0..4258cfb 100644 --- a/crates/agent/src/lib.rs +++ b/crates/agent/src/lib.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Legatus, the Fabrica Domi agent (docs/01_legatus.md): enroll with a one-time code, then //! long-poll the Fabrica server over mTLS for jobs, and run them only when the release is signed diff --git a/crates/agent/src/main.rs b/crates/agent/src/main.rs index 4ec7457..135de91 100644 --- a/crates/agent/src/main.rs +++ b/crates/agent/src/main.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! `legatus`: enroll, run, status. diff --git a/crates/agent/src/pipeline.rs b/crates/agent/src/pipeline.rs index fa55da9..11f1f1f 100644 --- a/crates/agent/src/pipeline.rs +++ b/crates/agent/src/pipeline.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! One job, start to end: guard, role, signature and manifest, download, size and SHA-256, and //! only then the target. Every refusal is reported; nothing unsigned reaches a target. diff --git a/crates/agent/src/state.rs b/crates/agent/src/state.rs index 87306e9..41a09d0 100644 --- a/crates/agent/src/state.rs +++ b/crates/agent/src/state.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The agent's state dir: who it is, what it trusts, and the job ids it has seen. //! diff --git a/crates/agent/src/target.rs b/crates/agent/src/target.rs index 24cd794..4cdcf16 100644 --- a/crates/agent/src/target.rs +++ b/crates/agent/src/target.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The targets this machine offers: Linux (systemd) on Linux, none elsewhere in v0.1. diff --git a/crates/agent/src/tls.rs b/crates/agent/src/tls.rs index 434aba9..aec7eca 100644 --- a/crates/agent/src/tls.rs +++ b/crates/agent/src/tls.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! TLS to the Fabrica server: the server is accepted only when its chain ends at the pinned Domi //! root and its leaf is valid for the server's name; the agent presents its own certificate diff --git a/crates/agent/tests/common/mod.rs b/crates/agent/tests/common/mod.rs index 05efabe..30e39b9 100644 --- a/crates/agent/tests/common/mod.rs +++ b/crates/agent/tests/common/mod.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! A Domi CA in real time, team release keys, fake targets, and a mock Fabrica server that speaks //! protocol v1 over real TLS with the reference logic (EnrollmentBook, Registry). diff --git a/crates/agent/tests/e2e.rs b/crates/agent/tests/e2e.rs index c9142f0..d316d4b 100644 --- a/crates/agent/tests/e2e.rs +++ b/crates/agent/tests/e2e.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! End to end over real TLS against a mock Fabrica that uses the reference server logic //! (mandatory, tests first): the enrollment code is single use; expired, replayed and foreign diff --git a/crates/agent/tests/pipeline.rs b/crates/agent/tests/pipeline.rs index d54cd45..1bcb69b 100644 --- a/crates/agent/tests/pipeline.rs +++ b/crates/agent/tests/pipeline.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Nothing unsigned runs (mandatory, tests first): a tampered artifact, a wrong key, a missing or //! garbled signature, a release of something else: refused and reported, and the target is never diff --git a/crates/linux/examples/deploy.rs b/crates/linux/examples/deploy.rs index c91f10d..17a8914 100644 --- a/crates/linux/examples/deploy.rs +++ b/crates/linux/examples/deploy.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! TEST ONLY: drives the Linux backend with real systemd for tests/linux (the container test). //! It skips the signature check on purpose, so it is an example, never part of a release. diff --git a/crates/linux/src/lib.rs b/crates/linux/src/lib.rs index 7588e79..6214f75 100644 --- a/crates/linux/src/lib.rs +++ b/crates/linux/src/lib.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Legatus's Linux (systemd) target (docs/01_legatus.md): //! diff --git a/crates/linux/tests/common/mod.rs b/crates/linux/tests/common/mod.rs index 4c9d390..6b1faa2 100644 --- a/crates/linux/tests/common/mod.rs +++ b/crates/linux/tests/common/mod.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. #![allow(dead_code, clippy::unwrap_used, clippy::expect_used, clippy::panic)] diff --git a/crates/linux/tests/switch.rs b/crates/linux/tests/switch.rs index 08c3660..980a268 100644 --- a/crates/linux/tests/switch.rs +++ b/crates/linux/tests/switch.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The Linux target (mandatory, tests first): the atomic symlink switch, the restart, the health //! check, and auto rollback when the check fails. Real files and symlinks; systemd and the health diff --git a/crates/linux/tests/unpack.rs b/crates/linux/tests/unpack.rs index fedaec3..e551fcd 100644 --- a/crates/linux/tests/unpack.rs +++ b/crates/linux/tests/unpack.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Unpacking (tests first): a signed archive can still hold a mistake; nothing escapes the //! release dir, links and special files are refused, and a refused archive leaves nothing behind. diff --git a/crates/protocol/src/archive.rs b/crates/protocol/src/archive.rs index 5f79dfe..36788be 100644 --- a/crates/protocol/src/archive.rs +++ b/crates/protocol/src/archive.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Archive entries (hostile even when signed: a release key can sign a mistake): what may be //! unpacked, and where. diff --git a/crates/protocol/src/code.rs b/crates/protocol/src/code.rs index fd59260..592879a 100644 --- a/crates/protocol/src/code.rs +++ b/crates/protocol/src/code.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The enrollment code: `lgt1-` and base32 of version, root SHA-256, secret, server URL, checksum. diff --git a/crates/protocol/src/enroll.rs b/crates/protocol/src/enroll.rs index 2fe282f..1376645 100644 --- a/crates/protocol/src/enroll.rs +++ b/crates/protocol/src/enroll.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The server's side of enrollment codes: issue, and redeem exactly once. diff --git a/crates/protocol/src/guard.rs b/crates/protocol/src/guard.rs index 2822bcb..8ed3b35 100644 --- a/crates/protocol/src/guard.rs +++ b/crates/protocol/src/guard.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The agent's job guard: expired, future, too long-lived and replayed jobs are refused. diff --git a/crates/protocol/src/lib.rs b/crates/protocol/src/lib.rs index 91d5a61..7d2e2a2 100644 --- a/crates/protocol/src/lib.rs +++ b/crates/protocol/src/lib.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The Legatus protocol v1 (docs/02_protocol.md): what Legatus and the Fabrica server say to //! each other, and the checks both sides make. Pure: no files, no network, no clock; the caller diff --git a/crates/protocol/src/msg.rs b/crates/protocol/src/msg.rs index 9ddafb4..54bd47c 100644 --- a/crates/protocol/src/msg.rs +++ b/crates/protocol/src/msg.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The messages of protocol v1 (docs/02_protocol.md). Strict: unknown fields are refused, every //! body is bounded, every id and name is checked before anyone acts on it. diff --git a/crates/protocol/src/registry.rs b/crates/protocol/src/registry.rs index 0c7a726..7128415 100644 --- a/crates/protocol/src/registry.rs +++ b/crates/protocol/src/registry.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The server's agent registry: which certificate is each agent's current one. diff --git a/crates/protocol/src/release.rs b/crates/protocol/src/release.rs index be6e4ef..ecff7f5 100644 --- a/crates/protocol/src/release.rs +++ b/crates/protocol/src/release.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Nothing unsigned runs: the release manifest, its minisign signature by a pinned team release //! key, and the artifact's size and SHA-256. diff --git a/crates/protocol/tests/certificates.rs b/crates/protocol/tests/certificates.rs index 168d4a3..027d873 100644 --- a/crates/protocol/tests/certificates.rs +++ b/crates/protocol/tests/certificates.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Agent certificates at the server (mandatory, tests first): expired, replayed and foreign //! certificates are refused by `Registry::accept`, the check Fabrica runs on every request. diff --git a/crates/protocol/tests/common/mod.rs b/crates/protocol/tests/common/mod.rs index b0ed3b2..3df55d9 100644 --- a/crates/protocol/tests/common/mod.rs +++ b/crates/protocol/tests/common/mod.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. #![allow(dead_code, clippy::unwrap_used, clippy::expect_used, clippy::panic)] diff --git a/crates/protocol/tests/enrollment.rs b/crates/protocol/tests/enrollment.rs index fab2e44..cba1ad5 100644 --- a/crates/protocol/tests/enrollment.rs +++ b/crates/protocol/tests/enrollment.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The enrollment code (mandatory, tests first): it round-trips, typos are caught before anything //! is sent, and it is single use: a second redeem is refused, as are expired and unknown codes. diff --git a/crates/protocol/tests/jobs.rs b/crates/protocol/tests/jobs.rs index 993e399..09a1ba2 100644 --- a/crates/protocol/tests/jobs.rs +++ b/crates/protocol/tests/jobs.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Messages and jobs (tests first): strict parsing with limits, the replay guard, roles, safe //! archive paths, reports. diff --git a/crates/protocol/tests/release.rs b/crates/protocol/tests/release.rs index ee40297..4840cbd 100644 --- a/crates/protocol/tests/release.rs +++ b/crates/protocol/tests/release.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Nothing unsigned runs (mandatory, tests first): a missing or garbled signature, a wrong key, a //! manifest for another team, app or version, and a tampered artifact are all refused. diff --git a/install/install.sh b/install/install.sh index 2646106..70dfc24 100644 --- a/install/install.sh +++ b/install/install.sh @@ -1,5 +1,5 @@ #!/bin/sh -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: CPAL-1.0 # Legatus installer, served by the Fabrica server at /legatus/install.sh: # curl -fsSL https:///legatus/install.sh | sudo sh -s -- lgt1- # Downloads the Legatus binary for this machine from the same server, checks its SHA-256 against diff --git a/tests/linux/run.sh b/tests/linux/run.sh index d64a08a..1f1aa74 100644 --- a/tests/linux/run.sh +++ b/tests/linux/run.sh @@ -1,5 +1,5 @@ #!/bin/sh -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: CPAL-1.0 # The Linux target against real systemd, in a container (Docker or Podman). # tests/linux/run.sh # from anywhere in the repo # Builds the test-only `deploy` example and a Debian image with systemd as PID 1 (Containerfile, from diff --git a/tests/linux/scenario.sh b/tests/linux/scenario.sh index 931135b..ababa00 100644 --- a/tests/linux/scenario.sh +++ b/tests/linux/scenario.sh @@ -1,5 +1,5 @@ #!/bin/sh -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: CPAL-1.0 # Runs inside the systemd container: four releases of a small web app through the Linux target. # 1.0.0 healthy, 2.0.0 healthy, 3.0.0 crashes at start, 4.0.0 runs but its health URL fails. # Expected: 1 and 2 succeed; 3 and 4 are rolled back to 2.0.0, which keeps running.