diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85215bc..7b632f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,8 @@ jobs: pytest==9.1.1 \ pytest-asyncio types-PyYAML pip install --require-hashes --no-deps --only-binary :all: -r controlplane/requirements.lock + # the edulution plugin's image dependencies (paramiko, ldap3; PyYAML is the same pin) + pip install --require-hashes --no-deps --only-binary :all: -r edulution/requirements.lock pip install --no-deps ./controlplane pip check - name: ruff check @@ -110,6 +112,16 @@ jobs: # planes (lmnsquid app, fake Docker) on a TLS listener with a self-signed certificate. - name: pytest (WebUI plugin) run: pytest -q webui/tests + - name: mypy (edulution plugin) + run: mypy --config-file edulution/pyproject.toml edulution/lmnsquid_edu edulution/host/linuxmuster_squid_edulution.py edulution/build_app.py + # The edulution plugin's real HTTP server (identity, CSRF, roles, scope) against real + # control planes; apart from webui/tests, both import a package named lmn_squid. + - name: pytest (edulution plugin) + run: pytest -q edulution/tests + # The plugin's pages (React + @edulution-io/ui-kit): npm ci from the lock without install + # scripts, tsc, two builds in the pinned Node image of edulution/Dockerfile, identical. + - name: edulution plugin pages (build twice, reproducible) + run: bash scripts/tests/edulution_frontend.sh - name: shellcheck run: sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck && shellcheck --severity=warning $(git ls-files '*.sh') debian/*.preinst debian/*.postinst debian/*.prerm debian/*.postrm - name: reuse (license compliance) @@ -151,9 +163,11 @@ jobs: # dpkg-buildpackage writes one level above the source tree. mkdir -p output && mv ../*.deb ../*.changes ../*.buildinfo ../*.dsc ../*.tar.xz output/ # DEBIAN/md5sums must cover every shipped regular file, or `dpkg --verify` is a no-op. - # Two binary packages: linuxmuster-squid (amd64) and linuxmuster-squid-webui (all). - test "$(ls output/*.deb | wc -l)" = 2 - for deb in output/linuxmuster-squid_*_amd64.deb output/linuxmuster-squid-webui_*_all.deb; do + # Three binary packages: linuxmuster-squid (amd64), linuxmuster-squid-webui (all) and + # linuxmuster-squid-edulution (all). + test "$(ls output/*.deb | wc -l)" = 3 + for deb in output/linuxmuster-squid_*_amd64.deb output/linuxmuster-squid-webui_*_all.deb \ + output/linuxmuster-squid-edulution_*_all.deb; do dpkg-deb -I "$deb" dpkg-deb --ctrl-tarfile "$deb" | tar -tf - | grep -qx './md5sums' test "$(dpkg-deb -c "$deb" | grep -c '^-')" = "$(dpkg-deb --ctrl-tarfile "$deb" | tar -xOf - ./md5sums | wc -l)" @@ -362,6 +376,20 @@ jobs: # tested in the lab. - name: WebUI plugin package (without linuxmuster-webui7) run: sudo bash scripts/tests/webui_deb_smoke.sh packages/linuxmuster-squid-webui_*_all.deb + # The edulution plugin's image is built from the linuxmuster-squid .deb of this build + # (edulution/build-image.sh, like the lab) and saved as the tarball admins load + # (docs/operations.md); the package is installed next to an edulution stand-in: the + # container comes up healthy behind no published port, remove/purge clean up. edulution + # itself (login, forwardAuth, the pages) is scripts/tests/edulution_it.sh and the lab. + - name: edulution plugin package and image (without edulution) + run: | + set -eux + ver="$(dpkg-deb -f packages/linuxmuster-squid-edulution_*_all.deb Version)" + bash edulution/build-image.sh packages "linuxmuster-squid-edulution:$ver" + mkdir -p edulution-image + docker save "linuxmuster-squid-edulution:$ver" | gzip -n > "edulution-image/linuxmuster-squid-edulution-image_${ver}.tar.gz" + sudo bash scripts/tests/edulution_deb_smoke.sh packages/linuxmuster-squid-edulution_*_all.deb \ + "edulution-image/linuxmuster-squid-edulution-image_${ver}.tar.gz" # Kevin's rule: a release must still install cleanly ON TOP OF the version that is # already running on a school server. This job installs the newest published release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 564ba82..94c7921 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,9 +89,11 @@ jobs: # dpkg-buildpackage writes one level above the source tree. mkdir -p output && mv ../*.deb ../*.changes ../*.buildinfo ../*.dsc ../*.tar.xz output/ # DEBIAN/md5sums must cover every shipped regular file, or `dpkg --verify` is a no-op. - # Two binary packages: linuxmuster-squid (amd64) and linuxmuster-squid-webui (all). - test "$(ls output/*.deb | wc -l)" = 2 - for deb in output/linuxmuster-squid_*_amd64.deb output/linuxmuster-squid-webui_*_all.deb; do + # Three binary packages: linuxmuster-squid (amd64), linuxmuster-squid-webui (all) and + # linuxmuster-squid-edulution (all). + test "$(ls output/*.deb | wc -l)" = 3 + for deb in output/linuxmuster-squid_*_amd64.deb output/linuxmuster-squid-webui_*_all.deb \ + output/linuxmuster-squid-edulution_*_all.deb; do dpkg-deb -I "$deb" dpkg-deb --ctrl-tarfile "$deb" | tar -tf - | grep -qx './md5sums' test "$(dpkg-deb -c "$deb" | grep -c '^-')" = "$(dpkg-deb --ctrl-tarfile "$deb" | tar -xOf - ./md5sums | wc -l)" @@ -267,6 +269,25 @@ jobs: # tested in the lab. - name: WebUI plugin package (without linuxmuster-webui7) run: sudo bash scripts/tests/webui_deb_smoke.sh packages/linuxmuster-squid-webui_*_all.deb + # The edulution plugin's image is built from the linuxmuster-squid .deb of this build + # (edulution/build-image.sh, like the lab) and saved as the tarball admins load + # (docs/operations.md); the package is installed next to an edulution stand-in: the + # container comes up healthy behind no published port, remove/purge clean up. edulution + # itself (login, forwardAuth, the pages) is scripts/tests/edulution_it.sh and the lab. + - name: edulution plugin package and image (without edulution) + run: | + set -eux + ver="$(dpkg-deb -f packages/linuxmuster-squid-edulution_*_all.deb Version)" + bash edulution/build-image.sh packages "linuxmuster-squid-edulution:$ver" + mkdir -p edulution-image + docker save "linuxmuster-squid-edulution:$ver" | gzip -n > "edulution-image/linuxmuster-squid-edulution-image_${ver}.tar.gz" + sudo bash scripts/tests/edulution_deb_smoke.sh packages/linuxmuster-squid-edulution_*_all.deb \ + "edulution-image/linuxmuster-squid-edulution-image_${ver}.tar.gz" + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: edulution-image + path: edulution-image/ + if-no-files-found: error # Kevin's rule: a release must still install cleanly ON TOP OF the version that is # already running on a school server. This job installs the newest published release @@ -645,6 +666,11 @@ jobs: with: name: packages path: packages/ + # the edulution plugin's image tarball, built and smoked in install-smoke + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 + with: + name: edulution-image + path: packages/ # Draft -> assets -> digest check -> publish (why: see the header), all through the REST # API with the gh CLI that ships with the runner. The draft is addressed by the id its # create call returns, never by tag: right after a create the release list does not show @@ -662,9 +688,13 @@ jobs: set -euo pipefail shopt -s nullglob # The files this repo publishes: the .deb and what dpkg-buildpackage records about the - # build (.changes, .buildinfo) plus the source package it was built from (.dsc, .tar.xz). - assets=(packages/*.deb packages/*.changes packages/*.buildinfo packages/*.dsc packages/*.tar.xz) + # build (.changes, .buildinfo) plus the source package it was built from (.dsc, .tar.xz), + # and the edulution plugin's image tarball (docker load on the edulution host). + assets=(packages/*.deb packages/*.changes packages/*.buildinfo packages/*.dsc packages/*.tar.xz + packages/linuxmuster-squid-edulution-image_*.tar.gz) compgen -G 'packages/*.deb' > /dev/null || { echo "::error::no .deb to publish"; exit 1; } + compgen -G 'packages/linuxmuster-squid-edulution-image_*.tar.gz' > /dev/null \ + || { echo "::error::no edulution image tarball to publish"; exit 1; } # GitHub renames special characters in asset names (`~` becomes `.`, `+` stays), so # names are compared in this normalised form, in which no two assets may collide. norm() { local n=${1##*/}; printf '%s\n' "${n//[^A-Za-z0-9._-]/.}"; } diff --git a/.gitignore b/.gitignore index 9ed170a..270a9f5 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ debian/linuxmuster-squid-webui/ .vscode/ *.swp .DS_Store + +# edulution plugin frontend (npm ci / npm run build) +edulution/frontend/node_modules/ diff --git a/README.md b/README.md index f21129a..2b8a18a 100644 --- a/README.md +++ b/README.md @@ -165,3 +165,19 @@ administrators only. More: The project is [REUSE 3.3](https://reuse.software)-compliant: every file carries an SPDX header, license texts live in [`LICENSES/`](LICENSES/), and `reuse lint` is gated in CI. See [`docs/decisions.md`](docs/decisions.md) (ADR-000). © Kevin Stenzel. + +**The pages of the edulution plugin** (`edulution/frontend/`, shipped only inside the +container image of `linuxmuster-squid-edulution`) are built with edulution's component +library **`@edulution-io/ui-kit` 2.3.117 (AGPL-3.0-or-later)** and other npm packages under +permissive licences. The built pages are therefore a combined work under GPL-3.0-or-later and +AGPL-3.0-or-later (GPLv3 section 13 allows the combination): whoever runs them for users over a +network must offer those users the corresponding source. That source is this public repository +(`edulution/frontend/` with its `package-lock.json`) and, for the ui-kit, + / the `@edulution-io/ui-kit` package on npm. The +licence texts of every bundled npm package are served with the pages as +`/plugin/lmn-squid/static/THIRD-PARTY-LICENSES.txt` and are in the image under +`/opt/lmn-squid-edu/static/`. The ui-kit also carries branding conditions of Digitale Schule +Innovationsberatung GmbH for the name and logos of edulution (`LICENSE_EXCEPTIONS.md`, bundled +unmodified); how they meet this plugin is described, not decided, in ADR-024. See ADR-015 +(addendum) and ADR-024. Both apps link the source and the licence texts in their footer. + diff --git a/RELEASE.md b/RELEASE.md index 487e91c..9631f3a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,7 +41,10 @@ does not yet exist — every `lmnsquid create --image ghcr.io/…@sha256:.tar.gz`, built from that release's + linuxmuster-squid `.deb` in install-smoke and smoked there), the source package (`.dsc`, `.tar.xz`) and the `.changes`/`.buildinfo` are uploaded and their SHA-256 compared with the build, and only then is it published: GitHub's immutable releases freeze tag and assets at publication. The job fails unless the published release reports `immutable: true`. With the optional diff --git a/debian/changelog b/debian/changelog index 56bc389..2aba620 100644 --- a/debian/changelog +++ b/debian/changelog @@ -230,6 +230,19 @@ linuxmuster-squid (7.3.11) lmn73; urgency=medium log on receives no data. Quarantined spool files are moved beside the spool (also unreadable ones); a file collected completely is never quarantined. + * Setting up a proxy host again from the WebUI keeps the clients its TLS + listener already allows (tls_allowed_clients) and adds the school + server, instead of replacing the list. + * New package linuxmuster-squid-edulution (same version, from this + source) for the edulution host (2.3.117 or newer): the apps + "Squid-Proxy" (global administrators: everything the WebUI plugin's + management page does) and "Internetnutzung" (teachers, school and + global administrators, scope from the AD as in the WebUI) in a + container behind edulution's Traefik, with its own pinned connections + to the proxies and nothing new on the school server. Actions that need + the school server (precheck, keytab) ask for its SSH login each time. + The container image is loaded separately; then + "linuxmuster-squid-edulution up" and "register" (docs/operations.md). -- Kevin Stenzel Sat, 28 Nov 2026 03:59:40 +0100 linuxmuster-squid (7.3.10) lmn73; urgency=medium diff --git a/debian/control b/debian/control index 301e076..29ed3cc 100644 --- a/debian/control +++ b/debian/control @@ -39,3 +39,20 @@ Description: linuxmuster.net WebUI plugin for linuxmuster-squid proxy servers logs, blocklist and noauth list, updates) over their TLS listener with a pinned certificate. Global administrators only. Install linuxmuster-squid on the proxy host itself. + +Package: linuxmuster-squid-edulution +Architecture: all +Depends: ${misc:Depends}, + python3, + iproute2 +Recommends: docker-ce | docker.io, + docker-compose-plugin | docker-compose-v2 +Description: edulution plugin for linuxmuster-squid proxy servers + Two edulution apps on the edulution host: "Squid-Proxy" (global + administrators: proxy servers, instances, filter, lists, updates, logs, + setup of new proxy hosts, keytab) and "Internetnutzung" (teachers and + administrators, scope from the AD like the WebUI's view). A container + behind edulution's Traefik (forwardAuth edulution-keycloak-auth) with its + own pinned connections to the control planes. The container image is not + part of this package; load it with docker load, then run + linuxmuster-squid-edulution up and register. diff --git a/debian/copyright b/debian/copyright index 91c4554..760f350 100644 --- a/debian/copyright +++ b/debian/copyright @@ -13,6 +13,25 @@ Files: * Copyright: 2026 Kevin Stenzel License: GPL-3.0+ +Files: edulution/frontend/* +Copyright: 2026 Kevin Stenzel +License: GPL-3.0+ +Comment: The source of the edulution plugin's pages. They are not part of any binary + package of this source: they are built (npm, edulution/frontend/package-lock.json) + into the container image of linuxmuster-squid-edulution, together with + @edulution-io/ui-kit 2.3.117 (Copyright Digitale Schule Innovationsberatung GmbH, + AGPL-3.0-or-later) and permissively licensed npm packages. The built pages are a + combination under GPL-3.0-or-later and AGPL-3.0-or-later (GPLv3 section 13): users + of the pages over a network are offered the corresponding source, this repository + (https://github.com/faircomp/linuxmuster-squid, edulution/frontend/) and + https://github.com/edulution-io/ui-kit. The image serves the licence texts of every + bundled npm package as static/THIRD-PARTY-LICENSES.txt. + The ui-kit also ships LICENSE_EXCEPTIONS.md, branding conditions of + Digitale Schule Innovationsberatung GmbH for the name and logos of edulution + (keep the branding when redistributing it, no use of the name in unrelated + products without authorisation); it is bundled unmodified and its text is in + THIRD-PARTY-LICENSES.txt. Assessment in docs/decisions.md, ADR-024. + License: GPL-3.0+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/debian/linuxmuster-squid-edulution.install b/debian/linuxmuster-squid-edulution.install new file mode 100644 index 0000000..5a6e826 --- /dev/null +++ b/debian/linuxmuster-squid-edulution.install @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Kevin Stenzel +# SPDX-License-Identifier: GPL-3.0-or-later +# +# The edulution host's side of the plugin (ADR-024); the command itself is installed by +# debian/rules (execute_after_dh_install-indep) as /usr/sbin/linuxmuster-squid-edulution. +edulution/host/docker-compose.yml usr/share/linuxmuster-squid-edulution/ +edulution/host/tested-versions usr/share/linuxmuster-squid-edulution/ +edulution/host/traefik/plugin-lmn-squid.yml usr/share/linuxmuster-squid-edulution/traefik/ +edulution/host/icons/squidproxy.svg usr/share/linuxmuster-squid-edulution/icons/ +edulution/host/icons/internetnutzung.svg usr/share/linuxmuster-squid-edulution/icons/ diff --git a/debian/linuxmuster-squid-edulution.postinst b/debian/linuxmuster-squid-edulution.postinst new file mode 100755 index 0000000..e38b9a3 --- /dev/null +++ b/debian/linuxmuster-squid-edulution.postinst @@ -0,0 +1,27 @@ +#!/bin/sh +# SPDX-FileCopyrightText: Kevin Stenzel +# SPDX-License-Identifier: GPL-3.0-or-later +set -e + +# Start (or move to this version's image) the plugin container and its Traefik route when +# this is an edulution host and the image is loaded. The app tiles need a global +# administrator's login: `linuxmuster-squid-edulution register` (docs/operations.md). +if [ "$1" = configure ]; then + if command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then + rc=0 + linuxmuster-squid-edulution up || rc=$? + case "$rc" in + 0) ;; + 2) echo "linuxmuster-squid-edulution: load the image, then run: linuxmuster-squid-edulution up" ;; + *) echo "linuxmuster-squid-edulution: up failed ($rc); see the message above, then run: linuxmuster-squid-edulution up" ;; + esac + if [ ! -e /var/lib/linuxmuster-squid-edulution/registered ]; then + echo "linuxmuster-squid-edulution: create the app tiles with: linuxmuster-squid-edulution register --user " + fi + else + echo "linuxmuster-squid-edulution: Docker is not running; run linuxmuster-squid-edulution up later" + fi +fi + +#DEBHELPER# +exit 0 diff --git a/debian/linuxmuster-squid-edulution.postrm b/debian/linuxmuster-squid-edulution.postrm new file mode 100755 index 0000000..0fafaed --- /dev/null +++ b/debian/linuxmuster-squid-edulution.postrm @@ -0,0 +1,39 @@ +#!/bin/sh +# SPDX-FileCopyrightText: Kevin Stenzel +# SPDX-License-Identifier: GPL-3.0-or-later +set -e + +# purge: the plugin's data (connections with the proxies' tokens, the directory account) in +# the Docker volume, its images, the compose project and the command's own configuration and +# state (with the copy of the command kept for `unregister` after a remove). +if [ "$1" = purge ]; then + project=/srv/docker/edulution-plugin-lmn-squid + image="" + conf=/etc/linuxmuster-squid-edulution/plugin.conf + if [ -f "$conf" ]; then + found=$(sed -n 's/^PROJECT_DIR=//p' "$conf" | tail -n 1) + image=$(sed -n 's/^IMAGE=//p' "$conf" | tail -n 1) + if [ -n "$found" ]; then + # exactly edulution-plugin-lmn-squid below /srv/docker or /opt, no '..', no + # symlink (realpath must not change it): anything else is not deleted + canon=$(realpath -m -- "$found" 2>/dev/null || true) + if [ "$canon" = "$found" ] && printf '%s\n' "$found" \ + | grep -Eqx '/(srv/docker|opt)/edulution-plugin-lmn-squid'; then + project=$found + else + echo "linuxmuster-squid-edulution: PROJECT_DIR '$found' refused, $project used" >&2 + fi + fi + fi + if command -v docker >/dev/null 2>&1; then + docker rm -f edulution-plugin-lmn-squid >/dev/null 2>&1 || true + docker volume rm edulution-plugin-lmn-squid-data >/dev/null 2>&1 || true + for ref in $(docker image ls --format '{{.Repository}}:{{.Tag}}' linuxmuster-squid-edulution 2>/dev/null) $image; do + docker image rm "$ref" >/dev/null 2>&1 || true + done + fi + rm -rf "$project" /etc/linuxmuster-squid-edulution /var/lib/linuxmuster-squid-edulution +fi + +#DEBHELPER# +exit 0 diff --git a/debian/linuxmuster-squid-edulution.prerm b/debian/linuxmuster-squid-edulution.prerm new file mode 100755 index 0000000..7e3f68e --- /dev/null +++ b/debian/linuxmuster-squid-edulution.prerm @@ -0,0 +1,24 @@ +#!/bin/sh +# SPDX-FileCopyrightText: Kevin Stenzel +# SPDX-License-Identifier: GPL-3.0-or-later +set -e + +STATE=/var/lib/linuxmuster-squid-edulution + +# Removing the package removes the container and the Traefik route (the data volume stays +# until purge). An upgrade keeps both: the new postinst moves the container to its image. +# The app tiles need a global administrator's login to go: a copy of the command stays in the +# state directory until purge, so `unregister` still works after the remove (cold check G1). +if [ "$1" = remove ]; then + linuxmuster-squid-edulution down || true + mkdir -p "$STATE" + install -m 0755 /usr/sbin/linuxmuster-squid-edulution "$STATE/linuxmuster-squid-edulution" + if [ -e "$STATE/registered" ]; then + echo "linuxmuster-squid-edulution: the app tiles stay in edulution; remove them with" + echo " $STATE/linuxmuster-squid-edulution unregister --user " + echo " (or in edulution: Einstellungen -> Apps)" + fi +fi + +#DEBHELPER# +exit 0 diff --git a/debian/rules b/debian/rules index 3c8e742..4cf3447 100755 --- a/debian/rules +++ b/debian/rules @@ -41,6 +41,11 @@ override_dh_auto_install-arch: override_dh_auto_install-indep: /usr/bin/python3 -I webui/build_plugin.py webui/lmn_squid "$(WEBUI_PLUGIN)" +# The edulution plugin's host command (ADR-024): stdlib Python, as a command without suffix. +execute_after_dh_install-indep: + install -D -m 0755 edulution/host/linuxmuster_squid_edulution.py \ + "$(CURDIR)/debian/$(PKG)-edulution/usr/sbin/$(PKG)-edulution" + override_dh_auto_clean: rm -rf controlplane/build controlplane/*.egg-info find webui -name __pycache__ -prune -exec rm -rf {} + diff --git a/docs/architecture.md b/docs/architecture.md index cf9a1b4..1b56ba9 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -193,3 +193,23 @@ Status document. Keep it up to date with every substantive change (see 6. HTTPS (CONNECT, no decryption): `ssl_bump` peeks at the ClientHello (step 1) and at step 2 terminates a blocked SNI, and for a CONNECT to a noauth domain an SNI that is not on the noauth list or a missing SNI; everything else is spliced. + +## 7. edulution plugin (optional, ADR-024) + +`linuxmuster-squid-edulution` puts the WebUI plugin's two pages into edulution (2.3.117+) as the +apps *Squid-Proxy* and *Internetnutzung*: a container `edulution-plugin-lmn-squid` on the +edulution host, on `edulution-ui_default` without a published port, behind edulution's Traefik +route `/plugin/lmn-squid/` with the forwardAuth middleware `edulution-keycloak-auth`. + +``` +browser ──https──► Traefik ──forwardAuth──► edu-api /auth/verify (X-Auth-User, groups) + │ + └──► plugin container ──auth/verify (token = header?)──► edu-api + │ manage_core / activity_core / sshsetup (shared with webui/) + ├──pinned TLS + token──► control planes (own connections) + ├──LDAPS, pinned, read-only bind──► AD (scope, roles) + └──SSH, per action, admin login──► DC (precheck, keytab) +``` + +Nothing new runs on the school server; the WebUI plugin and the edulution plugin manage the same +proxies side by side (one token per control plane, both hosts in its TLS allowlist). diff --git a/docs/decisions.md b/docs/decisions.md index 8852a9c..c249943 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -232,6 +232,25 @@ rejects `--python-platform`, so the lock is compiled on linux/x86_64 (CI, Renova with `--python-version=3.12`; environment markers then evaluate as on the target. **Price:** dependency updates need a merged PR; the lock is regenerated, never hand-edited. +**Addendum (2026-11-26, Kevin: the edulution plugin's pages "im ui style", ADR-024):** npm +enters the build for exactly one output, the pages of the edulution plugin +(`edulution/frontend/`, React + `@edulution-io/ui-kit`), under these rules: +- one place: the first stage of `edulution/Dockerfile`, `node:22-slim` (Debian 12, Node + 22.23.2) pinned by digest `sha256:83f487e0…5e7e5`; nothing of Node reaches the image or a + package, the output is static files; +- dependencies only from `edulution/frontend/package-lock.json` (every package with its + `integrity` hash, direct dependencies pinned exactly in `package.json`), installed with + `npm ci --ignore-scripts` (no install script of any package runs); +- reproducible: `scripts/tests/edulution_frontend.sh` (CI fast tier and `run.sh e2e`) builds + twice from fresh copies in that image and requires byte-identical output, a clean type check, + no inline script or style element and no external URL in the output; +- the licence texts of every bundled package are generated into the output + (`THIRD-PARTY-LICENSES.txt`), the ui-kit version into `build-info.json` (`doctor` names it); +- `make deb` does not touch npm (the .debs hold no page); building the image needs the npm + registry as it needs the Ubuntu and PyPI mirrors. +The lock moves only in reviewed PRs, like the Python locks; a new ui-kit version follows the +edulution version the plugin is tested with (`tested-versions`, ANLEITUNG §8). + ### ADR-016 — Domains without proxy authentication, per instance, beside the blocklist **Status:** Proposed (2026-10-30, Kevin's request: Microsoft 365 through the proxy, without a login, no client-side bypass). **Decision:** each instance may list domains in @@ -936,6 +955,190 @@ access stays audited as before; no further allowlist (decision a). Why: a projec school-wide or voluntary and joined by any teacher; its members are not "the teacher's students" the way a class is. Supersedes the project rule of the scope paragraph above. +### ADR-024 — edulution plugin as a third binary package: container behind Traefik, own connections +**Status:** Proposed (2026-11-26, Kevin: task `work/tasks/squid-edulution.md`, decisions 1–3; +hub defaults 4–9). **Decision:** everything the WebUI plugin does is also offered in edulution +(2.3.117), as the binary package `linuxmuster-squid-edulution` (Architecture: all, same source, +same version) for the edulution host, plus a container image built like the squid image. +**Architecture:** one container `edulution-plugin-lmn-squid` (Ubuntu 24.04 by digest, Python +venv only from the hashed `edulution/requirements.lock`: paramiko, ldap3, PyYAML; user 10001, +read-only root, no capabilities, `no-new-privileges`, an init) in its own compose project +`/srv/docker/edulution-plugin-lmn-squid`, attached to `edulution-ui_default` as an external +network, **no `ports:`**. Traefik reaches it through the file +`data/traefik/config/plugin-lmn-squid.yml` (router `PathPrefix(/plugin/lmn-squid/)`, middlewares +`edulution-keycloak-auth@file` and a stripPrefix); the file name is no app name (edulution +deletes `.yml` when an app's proxy setting is empty). Two apps of type `frame` (`/edu-api/ +appconfig`, created and updated by `linuxmuster-squid-edulution register` with a global +administrator's login, removed by `unregister`): **Squid-Proxy** (`/plugin/lmn-squid/manage/`, +access group `role-globaladministrator`) and **Internetnutzung** (`…/activity/`, global and school +administrators, teachers). The tiles only decide who sees a tile; every request is checked on the +server. **Shared code instead of a copy:** the management routes moved from the WebUI's +`views.py` into `webui/lmn_squid/manage_core.py` (one route table, a test keeps the aj endpoints +and the table in step); the activity view is `activity_core.ActivityService` as in the WebUI's +bridge; setup and keytab are `sshsetup`'s steps with an injectable keytab maker and TLS client +list; jobs, connections and the pinned client are the same modules. `edulution/build_app.py` +copies exactly these modules (with an `__init__` of their own, without aj) into the image and +into the tests. **Data path:** the container has its **own** connections (pinned TLS, bearer +token) to the control planes, in its volume (`connections.yml`, `settings.json`, 0600, user +10001); nothing new on the DC. The control plane has one token (ADR-018): the WebUI and the +edulution plugin share it, each in its own file; the proxy's TLS allowlist names both hosts (the +setup from either side now keeps the clients already allowed, `sshsetup.tls_script`). Rotating +the token means updating both connections. +**Identity:** `X-Auth-User` from the forwardAuth middleware (Traefik overwrites a header the +browser sends); because other containers on `edulution-ui_default` could reach the plugin +directly with any header, the request must also carry the person's edulution token (cookie +`authToken` or `Authorization: Bearer`), which the plugin checks itself with the middleware's own +probe `GET http://edu-api:3000/edu-api/auth/verify` (cached 30 s by the token's hash); the user it +names must equal the header, else 401. That probe also gives the session's groups. `root` is +refused (the shared scope code treats `root` as the WebUI's superuser). +**Roles:** management = the session's group `role-globaladministrator` **and**, once the +directory is set up, `sophomorixRole` globaladministrator in the AD (the AD wins; the group alone +only lets a global administrator reach the settings to set the directory up). Activity view = +`sophomorixRole` from the AD in globaladministrator, schooladministrator, teacher (the WebUI's +permission `lm:squid:activity`), else 403 before any proxy is asked; scope refusals are 404 as in +the WebUI (m1). **Scope source: LDAPS to the AD, not `/edu-api/lmn-api`.** The scope is +`activity_scope.scope_for` unchanged, fed by `LdapsDirectory`, which reads the attributes +linuxmusterTools reads (person by `sAMAccountName`; users below `OU=,OU=SCHOOLS`; +classes and projects from `memberOf` by linuxmusterTools' `extract_schoolclasses`/ +`extract_projects` rules; a project's `sophomorixMemberGroups`/`sophomorixAdminGroups`). Teachers see +no projects (ADR-023 addendum 7); the rule lives in the shared `scope_for`, so edulution has it +too (tested on both sides). +Why not lmn-api with the user's token: it works only while edulution holds the person's +linuxmuster password (409 `LmnApiCredentialMissing` otherwise), `school-classes` lists the whole +school, there is no endpoint for "all users of a school with their classes" for a school +administrator, its answers are not versioned (ANLEITUNG §8), and the scope would be a second +implementation that could drift from the WebUI's. LDAPS gives the same code path and the same +answers. **Price:** a read-only directory account stored in the plugin's volume (write-only in the +API, never sent back). edulution already holds one (`edulutionui-binduser`); `global-binduser` +works too; no new kind of trust. The server certificate is pinned (SHA-256, shown and confirmed +by the global administrator in the settings; a new LDAP URL needs a new confirmation); the bind +is sent only after the certificate matched; plain `ldap://` is refused. +**DC access (task decision 7): per action over SSH, nothing stored.** Precheck of a new proxy +host, keytab and disabling a service account need the DC (devices.csv, sam.ldb, samba-tool, +provision-keytab.sh). For each of these actions the global administrator fetches the DC's SSH +host key, compares and confirms its fingerprint (15 minutes; a read-only precheck may be followed +by the setup, a changing action uses the confirmation up) and gives an SSH login (root or a sudo +user) for this action only. The plugin then connects with exactly that key (`RejectPolicy`, +password only, no agent, no key files, as ADR-021), copies `dc_agent.py`, the **unchanged** +WebUI modules `keytab`, `precheck`, `sitefacts`, `runtime`, `client`, `connections` and +`provision-keytab.sh` into a root-only directory, runs one fixed action with `sudo -S python3 -I` +(arguments as base64 JSON; nothing from the browser is executed), reads one JSON line (a keytab +as base64, into memory) and removes the directory, the upload and the sudo credential. So the DC +runs the same checked steps as with the WebUI plugin; the keytab travels DC → plugin over SSH +and plugin → proxy over the pinned TLS connection. Passwords exist only in memory: the request +body is scrubbed after use, jobs get them on stdin (`jobs.spawn`), the job's progress file is +scrubbed (`Reporter.scrub`). Why not linuxmuster-api: it has no keytab, no samba-tool and no +devices.csv precheck; why not a stored key or a service on the DC: a permanent root path from +the edulution host to the DC is exactly what decision 7 rules out. +**CSRF:** edulution's `authToken` cookie is `SameSite=None`; every state-changing request needs +`Content-Type: application/json` and an `Origin` (else `Referer`) equal to the origin the +request came in on (`X-Forwarded-Proto` + host), none at all is refused (m4). +**Frontend (revised 2026-11-26, Kevin: "ich will es im ui style"):** React + TypeScript with +edulution's own component library `@edulution-io/ui-kit` 2.3.117 (the version edulution 2.3.117 +ships, its Tailwind preset and theme, Lato bundled), built by the ADR-015 addendum's Node stage +into static files; same `data-test` hooks and API as the first, vanilla version, so the browser +walk is unchanged. CSP: `script-src 'self'`; `style-src 'self' 'nonce-…'` with a fresh nonce per +page answer, for the `