Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3d993ac
build(debian): add the debhelper 13 source package
Sep 25, 2026
eae8038
build(debian): move the maintainer scripts
Sep 25, 2026
fc7f394
build(packaging): remove build-deb.sh and packaging/debian
Sep 25, 2026
b0a9848
docs: the build is dpkg-buildpackage now
Sep 25, 2026
b15a200
fix(packaging): read the lockfiles the way pip does, fail the build o…
Sep 25, 2026
0ed8b57
test(packaging): keep the tampered-lockfile cases as a fast-tier regr…
Sep 25, 2026
bf0e98b
fix(postinst): no background git maintenance in the instance store, n…
Sep 25, 2026
9a1d34c
docs: pins and locks are raised by hand while Renovate is disabled
Sep 25, 2026
f7769d7
ci: build with dpkg-buildpackage, lint the .deb, gate the file tree
Sep 25, 2026
9ab1d75
ci(release): ship the source artefacts, gate on the file tree
Sep 25, 2026
e4b003a
ci(release): publish only a release that comes out immutable
Sep 25, 2026
14e2f46
chore(changelog): add the 7.3.4 entry
Sep 25, 2026
bd1a8d4
fix(packaging): verify both lockfiles before the venv is populated (K1)
Sep 25, 2026
077fe25
test(packaging): a lock wheel must not run before the gate (K1), catc…
Sep 25, 2026
88da905
ci: install uv hash-pinned, run make deb through the lock gate, gate …
Sep 25, 2026
a08f948
build(packaging): the source package holds only git-tracked files (K3)
Sep 25, 2026
26aeaaa
chore(changelog): correct the Python-upgrade note (K2), record the K1…
Sep 25, 2026
6394693
test(packaging): uv is pinned by its own hash-locked file, not a ci.y…
Sep 25, 2026
22338e2
fix(packaging): waive git's ownership guard in make-deb.sh so CI uses…
Sep 25, 2026
6d5c93f
fix(packaging): one lock gate, run first everywhere, blind to the cal…
Sep 25, 2026
3167633
build(packaging): make deb packs the tracked working tree, runs nothi…
Sep 25, 2026
98a8dcb
test(packaging): planted lock packages never run -- in the gate, the …
Sep 25, 2026
e66bca5
ci(upgrade-smoke): assert the exact upgrade in dpkg.log, never a down…
Sep 25, 2026
aa8d4b2
chore(changelog): say what the lock checks and apt really do (R5)
Sep 25, 2026
f97b690
fix(tests): nothing installs the checkout's lockfiles without the gat…
Sep 25, 2026
3e2c020
test: harness git calls use the same switches as make deb (S3/S5)
Sep 25, 2026
dbe99dd
docs: where the gate runs, and what of the caller's environment it ig…
Sep 25, 2026
738802f
chore(changelog): name what the checks ignore of the caller's environ…
Sep 25, 2026
083c8c8
test(lock_gates): say which parts of its environment the harness drop…
Sep 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/test/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ config). The `CRABBOX_PROXMOX_TOKEN_SECRET` lives **only** in the gitignored
from `deploy/e2e/dc` and `deploy/e2e/client` by compose, not pulled):
`crabbox run --id <slug> -- 'bash scripts/tests/crabbox_bootstrap.sh'`
3. **Run** the aggregator — one command, dependency-gated:
- `crabbox run --id <slug> -- 'bash scripts/tests/run.sh quick'` (ruff + mypy + pytest + shellcheck + reuse)
- `crabbox run --id <slug> -- 'bash scripts/tests/run.sh quick'` (lock gate first, stops if it fails; then ruff + mypy + pytest + shellcheck + reuse + lock regression test)
- `crabbox run --id <slug> -- 'LMNRADIUS_ALLOW_REAL=1 bash scripts/tests/run.sh e2e'` (docker-compose winbind/EAP E2E)
- `crabbox run --id <slug> -- 'LMNRADIUS_ALLOW_REAL=1 bash scripts/tests/run.sh all'` (quick + e2e)
4. **Inspect** on failure: `crabbox ssh --id <slug>` (live), or read the newest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# SPDX-FileCopyrightText: Kevin Stenzel
# SPDX-License-Identifier: GPL-3.0-or-later
# Build the data-plane FreeRADIUS image and push it to GHCR by tag + immutable digest.
# Renovate then pins that digest in the deployment; a human merges the bump.
# Every action is pinned by full commit SHA (`# vN` names the tag); Renovate bumps both.
# Pin that digest as DEFAULT_IMAGE (controlplane/lmnradius/models.py) in a reviewed PR; while
# Renovate is disabled (Kevin, 2026-09-25) that is done by hand.
# Every action is pinned by full commit SHA (`# vN` names the tag); raised by hand as well.
name: build-image

on:
Expand Down Expand Up @@ -49,4 +50,4 @@ jobs:
run: |
echo "Published ghcr.io/${{ github.repository_owner }}/linuxmuster-radius"
echo "Digest: ${{ steps.build.outputs.digest }}"
echo "Pin this digest via Renovate (docker:pinDigests)."
echo "Pin this digest as DEFAULT_IMAGE in controlplane/lmnradius/models.py (by hand while Renovate is disabled)."
270 changes: 237 additions & 33 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

223 changes: 207 additions & 16 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

# DISABLED (Kevin, 2026-09-25): this workflow is turned off in the repository settings until
# Renovate is re-enabled with a GitHub App; until then no Renovate PRs are opened and pins and
# locks are raised by hand. The rest of this header describes the workflow once re-enabled.
#
# Self-hosted Renovate — so digest bumps work without depending on the org-level
# Renovate/Mend GitHub App. Runs weekly and on demand. It opens PRs that bump the
# @sha256 pins (the data-plane image DEFAULT_IMAGE, every Dockerfile / docker-compose
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ dist/
build/

# --- Debian packaging build artifacts ---
# debhelper's working files; `make deb` (dpkg-buildpackage -tc) removes them again, and
# writes the .deb, .changes, .buildinfo, .dsc and source tarball one level above the tree.
debian/.debhelper/
debian/files
debian/*.substvars
debian/debhelper-build-stamp
debian/linuxmuster-radius/
*.deb
*.buildinfo
Expand Down
59 changes: 48 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ assumptions in [`docs/threat-model.md`](docs/threat-model.md), the decisions in
| CLI | `controlplane/lmnradius/cli.py` | Python · Typer · httpx (thin client of the REST API, **no direct Docker**) |
| EAP-CA / Cert manager | `controlplane/lmnradius/ca.py` | Private single-purpose EAP-CA (`ca init` / `cert issue` / `ca export`) |
| E2E / Deploy | `deploy/` | docker-compose (Samba AD DC + joined FreeRADIUS + `eapol_test`), instance YAML, client GPO/MDM templates |
| Packaging | `packaging/` (`make deb`), `debian/changelog` | `.deb` via `packaging/build-deb.sh` (hermetic venv under `/opt`, only from the hash-pinned lockfiles `controlplane/*.lock`), hardened systemd service (lmn73 layout) |
| Packaging | `debian/` (`make deb` = `dpkg-buildpackage`), `packaging/` | debhelper 13 package; `packaging/build-venv.sh` builds the hermetic venv (only from the hash-pinned lockfiles `controlplane/*.lock`) into the package tree, `debian/venv-relocate` makes it correct for `/opt/linuxmuster-radius/venv`; hardened systemd service (lmn73 layout) |
| Tests | `scripts/tests/` | `run.sh` aggregator; heavy tier on **crabbox** (`eapol_test` E2E) |

> **The stack is deliberately Python** (linuxmuster-api7/webui7 are likewise FastAPI/
Expand All @@ -40,22 +40,57 @@ This is one of Kevin's own linuxmuster.net packages. The development hub is
conventions are `../../docs/paket-konventionen.md` there. The rules that bite here:

- **Version:** the top entry of `debian/changelog` is the only hand-edited version
(`7.3.N`, distribution `lmn73`, no `-0` revision). `packaging/build-deb.sh`
(`dpkg-parsechangelog`), `controlplane/setup.py` (`pyproject.toml` is `dynamic`) and
(`7.3.N`, distribution `lmn73`, no `-0` revision). `dpkg-buildpackage` (the .deb),
`controlplane/setup.py` (`pyproject.toml` is `dynamic`) and
`GET /v1/version` (`importlib.metadata`) derive from it — never write a version
anywhere else (not in `docs/install.md` either). Never bump it outside a release:
Kevin sets it and tags `v7.3.N`; `release.yml` refuses a tag that does not match
the changelog.
- **Changelog:** one bullet in the top block of `debian/changelog` per user-visible change,
in the same PR, written for admins in English. There is no `CHANGELOG.md`.
- **Build:** `make deb` (wraps `packaging/build-deb.sh`; needs root, so run it in
`ghcr.io/linuxmuster/lmndev-runner:24.04` like CI does, pinned by digest — the command is
in the `Makefile`; never reference the image by tag alone).
- **Build:** `make deb` = `dpkg-buildpackage` (debhelper 13, `Rules-Requires-Root: no`). It
writes `../linuxmuster-radius_<version>_amd64.deb` plus `.changes`, `.buildinfo`, `.dsc` and
the source tarball **next to** the checkout. Build it in
`ghcr.io/linuxmuster/lmndev-runner:24.04` like CI does, pinned by digest — the command is in
the `Makefile` (it mounts the repository's common git directory too, so it works in a git
worktree); never reference the image by tag alone. `packaging/make-deb.sh` builds an export
of the **git-tracked files as they are in the working tree**: uncommitted edits and staged
new files ARE built, untracked files are NOT (`git add` a new module first), and every
difference from HEAD is printed as a WARNING before and after the build — the .deb still
carries the changelog's version, so never hand such a build around as the release. A `.git`
that git cannot use (a worktree without its repository, a checkout owned by someone else)
stops the build; nothing configured in `.git` runs (no fsmonitor, hooks or filters).
`debian/rules` keeps debhelper's
file-changing tools (strip, dwz, fixperms, ...) out of the venv, and
`debian/venv-relocate --verify` fails the build if any pip-installed file changed.
`debian/venv-relocate` is shared byte-for-byte with linuxmuster-squid and
linuxmuster-readonlydc (the hub keeps the reference); change it there, not here alone.
- **Python dependencies** are locked with hashes (ADR-016): `controlplane/requirements.lock`
(from `pyproject.toml`) and `controlplane/build-requirements.lock` (pip + setuptools).
After changing dependencies, re-run the command in the lockfile's header inside
`controlplane/` (needs `uv`) and check with `bash scripts/check-lockfiles.sh`. Never
hand-edit a lockfile; Renovate bumps them by PR.
`controlplane/uv-requirements.lock` pins the resolver `uv` (exactly the `uv==` of
`uv-requirements.in`, all PyPI hashes). After changing dependencies, re-run the command in
the lockfile's header inside `controlplane/` (needs `uv`) and check with
`bash scripts/check-lockfiles.sh`. Never hand-edit a lockfile.
`scripts/check-lockfiles.sh` is **the lock gate**, and every consumer runs it before
anything from a lockfile is installed: the CI fast tier and the CI job `lock-gates-build`
(first step each), the `lockfile` job of ci.yml and release.yml (nothing else in it),
`packaging/build-venv.sh` (so `make deb`, CI `package`, the release build) and
`scripts/tests/run.sh` (first; run.sh stops if it fails). `scripts/tests/lock_gates.sh`
stops if the committed locks fail it, and its counter-probes (install paths without the
gate) install fixture locks that pin only the test wheel, never the checkout's. It verifies
all three locks — grammar, every hash on PyPI, pin set == closure of the declared inputs
(uv re-resolves `pyproject.toml`/`build-requirements.in`) — and installs the uv it needs
itself, from the verified uv lock into an isolated venv, called by absolute path. The
gates run `/usr/bin/python3 -I`, set a fixed PATH and drop `VIRTUAL_ENV`, `PYTHON*`,
`UV_*` and `PIP_*` (and pip/uv config files), so an activated venv or a `.venv` in the
checkout takes no part. Not neutralized, a stated limit: `BASH_ENV`, exported shell
functions and proxy/CA variables (`HTTPS_PROXY`, `SSL_CERT_FILE`, `REQUESTS_CA_BUNDLE`, …)
— whoever sets those already runs code as the caller, or decides whom the gate trusts as PyPI.
Limit: pins are compared with the closure by name; another real release of a pinned
package (older or newer, a week old, genuine hashes) that satisfies the declared
requirements passes every gate — only the review of the lockfile diff catches it.
Renovate is disabled (Kevin, 2026-09-25), so locks, digests, action
SHAs and CI tool pins are raised by hand in a reviewed PR.
- **Maintainer string** everywhere: `Kevin Stenzel <mail@kevin-stenzel.de>`.

**Security pitfalls (from the threat model — do not violate):**
Expand Down Expand Up @@ -215,8 +250,10 @@ with **Docker**. **crabbox** leases an ephemeral Proxmox VM for this (provider i
`.claude/settings.json`, token only in the gitignored `.claude/settings.local.json`;
`crabbox doctor`). Rules/details: the `/test` skill (`.claude/skills/test/SKILL.md`).

- **One aggregate runner:** `bash scripts/tests/run.sh [lint|unit|quick|e2e|all]`
(created in P0/P1). `quick` (default) = lint + unit; `e2e`/`all` run the
- **One aggregate runner:** `bash scripts/tests/run.sh [gate|lint|unit|quick|locks|e2e|all]`
(created in P0/P1). Every mode but `e2e` runs the lock gate first (network needed); if it
fails, run.sh stops there and runs nothing else. `quick` (default) = gate + lint + unit +
the lock regression test; `e2e`/`all` run the
Docker suites and **refuse without `LMNRADIUS_ALLOW_REAL=1`**. Summary:
`N passed, M failed, K skipped` (exit ≠ 0 on failure); steps dep-gated.
- **Box lifecycle:** `crabbox warmup` → `crabbox run --id <slug> -- 'bash scripts/tests/crabbox_bootstrap.sh'`
Expand Down
33 changes: 22 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,31 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
# `make deb` is the uniform build entry point of Kevin's linuxmuster.net packages
# (linuxmusterDEV/docs/paket-konventionen.md). Until the debian/ conversion it wraps
# packaging/build-deb.sh, which needs root (the venv is built at its target path
# /opt/linuxmuster-radius/venv). Build like CI does, in the same digest-pinned
# lmndev-runner container (keep the digest equal to ci.yml; Renovate bumps both):
# docker run --rm -u root -v "$PWD":/src -w /src \
# (linuxmusterDEV/docs/paket-konventionen.md): dpkg-buildpackage, no root needed
# (Rules-Requires-Root: no; debian/rules builds the venv inside debian/linuxmuster-radius and
# relocates it to /opt/linuxmuster-radius/venv). packaging/make-deb.sh builds from an export of
# the git-tracked files as they are in the working tree: uncommitted edits and staged new files
# ARE built, untracked files are NOT (git add them), and every such difference from HEAD is
# printed as a WARNING -- the .deb still carries the changelog's version. An untracked or
# .gitignored file (a venv, caches, deploy/secrets, .env, a token under .claude/) never
# reaches the source tarball (K3). A .git that git cannot use stops the build. It writes the
# .deb, .changes, .buildinfo, .dsc and the source tarball one level ABOVE this tree.
# Build like CI does, in the same digest-pinned lmndev-runner container (keep the digest equal
# to ci.yml and release.yml; raised by hand while Renovate is disabled). Mount the checkout
# one level down, so the artefacts land in a writable parent (../out here), and the
# repository's common git directory at its own path, so git works in a git worktree too (in a
# plain clone that is the checkout's .git, mounted twice); the image's user `build`
# (uid 1000) builds, root only installs the build dependencies:
# C="$(git rev-parse --path-format=absolute --git-common-dir)"
# mkdir -p ../out && docker run --rm -u root -v "$(realpath ../out)":/b -v "$PWD":/b/src \
# -v "$C":"$C" -w /b/src \
# ghcr.io/linuxmuster/lmndev-runner:24.04@sha256:6b0c8ac994cf1d2da44b0b36ebd7b3b125094886e78293e04b9db5e515b8209e \
# bash -c 'apt-get update -qq && apt-get install -y -qq python3-venv && make deb'
# The version comes from debian/changelog (dpkg-parsechangelog); VERSION=<x> overrides it.

# bash -c 'apt-get update -qq && apt-get build-dep -y -qq . && runuser -u build -- make deb'
# git's ownership guard stays on: the checkout must belong to uid 1000 (the image's `build`).
.PHONY: deb clean

deb:
bash packaging/build-deb.sh
/bin/bash packaging/make-deb.sh

clean:
rm -f linuxmuster-radius_*.deb
rm -rf controlplane/build controlplane/*.egg-info
debian/rules clean
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ git-versioniert verwaltet über **REST-API + Typer-CLI**.
| Control Plane (REST-API) | `controlplane/lmnradius/` | Python 3.11+ · FastAPI · uvicorn · **docker-py** (Container-Lifecycle) · pydantic v2 |
| CLI | `controlplane/lmnradius/cli.py` | Python · Typer · httpx (Thin Client der REST-API) |
| E2E / Deploy | `deploy/` | docker-compose (Samba AD DC + gejointer FreeRADIUS + `eapol_test`), Instanz-Definitionen |
| Packaging | `packaging/` (`make deb`), `debian/changelog` | `.deb` via `packaging/build-deb.sh` (hermetisches venv unter `/opt`, nur aus Hash-gepinnten Lockfiles `controlplane/*.lock`), gehärteter systemd-Dienst |
| Packaging | `debian/` (`make deb` = `dpkg-buildpackage`), `packaging/` | debhelper-13-Paket; `packaging/build-venv.sh` baut das hermetische venv (nur aus Hash-gepinnten Lockfiles `controlplane/*.lock`) in den Paketbaum, `debian/venv-relocate` macht es passend für `/opt/linuxmuster-radius/venv`; gehärteter systemd-Dienst |
| Tests | `scripts/tests/` | `run.sh`-Aggregator; Heavy-Tier auf **crabbox** |

Details: [`docs/architecture.md`](docs/architecture.md).
Expand Down
2 changes: 1 addition & 1 deletion controlplane/build-requirements.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Kevin Stenzel
# SPDX-License-Identifier: GPL-3.0-or-later
#
# The tooling packaging/build-deb.sh installs into the venv before the runtime
# The tooling packaging/build-venv.sh installs into the venv before the runtime
# dependencies: pip itself (replacing the one ensurepip bootstrapped) and the build
# backend of the control plane, so `pip install ./controlplane` runs without build
# isolation and fetches nothing unhashed. Locked in build-requirements.lock.
Expand Down
4 changes: 2 additions & 2 deletions controlplane/lmnradius/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def is_ldaps(url: str) -> bool:
# Default data-plane image for new/updated instances, so callers need not pass
# --image. Pinned to an immutable ``@sha256:<digest>`` — the data-plane image built and
# published to GHCR by the build-image workflow (verified end-to-end against a real DC);
# Renovate keeps it current (same rationale as linuxmuster-squid). The image validator
# requires an explicit :tag or @sha256 and rejects a bare repo either way.
# raised by hand in a reviewed PR while Renovate is disabled (Kevin, 2026-09-25). The
# image validator requires an explicit :tag or @sha256 and rejects a bare repo either way.
DEFAULT_IMAGE = "ghcr.io/faircomp/linuxmuster-radius@sha256:7385d3a64c3d98afa33577473c6b065f2a6a2ef88fa7ff70117ab6262118a77a"


Expand Down
Loading
Loading