Chrome stays a full browser. The managed policy only removes the things a volunteer should never be asked about — the first-run tour, the default-browser prompt, sync and sign-in promos, the profile picker — and pins the Home button to Wonder Ink so there is always one obvious way back. Startup URL is a recommended policy rather than a managed one, so a teacher can still change it. Nothing restricts where they browse, and the profile is untouched, so YouTube and other logins survive reboots and updates. Notifications were still stock mako, which looked nothing like the rest of the shell. Give them the dock's palette: the same dark slate, the same hairline white border, rounded, white text, top right. Kept a little more opaque than the dock so text stays readable over video, and on the overlay layer so a parent-call alert can still reach someone watching a fullscreen DVD. mako was only ever reaching the session through D-Bus activation. Start it from the sway config so it is running before anything needs it. classroom-notify-test sends a sample so the styling can be checked without waiting for a real event. Co-Authored-By: Claude Opus 5 <[email protected]>
167 lines
4.4 KiB
Bash
Executable File
167 lines
4.4 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
if [[ $# -ne 1 ]]; then
|
|
echo "Usage: $0 VERSION"
|
|
exit 1
|
|
fi
|
|
|
|
VERSION="$1"
|
|
|
|
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "Invalid version: $VERSION"
|
|
echo "Expected MAJOR.MINOR.PATCH, for example 0.1.6"
|
|
exit 1
|
|
fi
|
|
|
|
STAGE="$ROOT/packaging/root"
|
|
OUTPUT="$ROOT/dist/ekklesia-classroom_${VERSION}_amd64.deb"
|
|
|
|
# Syntax check everything the package ships, by shebang, so this cannot
|
|
# drift out of date as classroom commands are added.
|
|
echo "Validating sources"
|
|
|
|
for script in "$ROOT/packaging/debian/postinst" "$ROOT"/scripts/*; do
|
|
[[ -f "$script" ]] || continue
|
|
|
|
case "$(head -n 1 "$script")" in
|
|
*python3*)
|
|
python3 -m py_compile "$script"
|
|
;;
|
|
*bash*|*bin/sh*)
|
|
bash -n "$script"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
for module in "$ROOT"/lib/*.py; do
|
|
[[ -f "$module" ]] || continue
|
|
|
|
python3 -m py_compile "$module"
|
|
done
|
|
|
|
for policy in "$ROOT"/config/chrome/policies/*/*.json; do
|
|
[[ -f "$policy" ]] || continue
|
|
|
|
python3 -c 'import json, sys; json.load(open(sys.argv[1]))' "$policy"
|
|
done
|
|
|
|
find "$ROOT/scripts" "$ROOT/lib" \
|
|
-name '__pycache__' -type d -prune -exec rm -rf {} + 2>/dev/null || true
|
|
|
|
echo "Building Ekklesia Classroom ${VERSION}"
|
|
|
|
# Always construct the package from clean canonical sources.
|
|
rm -rf "$STAGE"
|
|
mkdir -p "$STAGE/DEBIAN" "$ROOT/dist"
|
|
|
|
# Debian package metadata.
|
|
sed \
|
|
"s/^Version: @VERSION@$/Version: ${VERSION}/" \
|
|
"$ROOT/packaging/debian/control.template" \
|
|
> "$STAGE/DEBIAN/control"
|
|
|
|
install -m755 \
|
|
"$ROOT/packaging/debian/postinst" \
|
|
"$STAGE/DEBIAN/postinst"
|
|
|
|
# Classroom UI configuration.
|
|
install -Dm644 \
|
|
"$ROOT/config/sway/config" \
|
|
"$STAGE/etc/ekklesia-classroom/sway/config"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/waybar/config.jsonc" \
|
|
"$STAGE/etc/ekklesia-classroom/waybar/config.jsonc"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/waybar/style.css" \
|
|
"$STAGE/etc/ekklesia-classroom/waybar/style.css"
|
|
|
|
# Classroom commands.
|
|
install -Dm755 \
|
|
"$ROOT/scripts/classroom-browser" \
|
|
"$STAGE/usr/local/bin/classroom-browser"
|
|
|
|
install -Dm755 \
|
|
"$ROOT/scripts/classroom-window" \
|
|
"$STAGE/usr/local/bin/classroom-window"
|
|
|
|
install -Dm755 \
|
|
"$ROOT/scripts/classroom-notify-test" \
|
|
"$STAGE/usr/local/bin/classroom-notify-test"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/wallpapers/classroom-default.png" \
|
|
"$STAGE/usr/share/backgrounds/ekklesia/classroom-default.png"
|
|
|
|
install -Dm755 \
|
|
"$ROOT/scripts/classroom-dock" \
|
|
"$STAGE/usr/local/bin/classroom-dock"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/dock/style.css" \
|
|
"$STAGE/etc/ekklesia-classroom/dock/style.css"
|
|
|
|
# Notification styling, matched to the dock.
|
|
install -Dm644 \
|
|
"$ROOT/config/mako/config" \
|
|
"$STAGE/etc/xdg/mako/config"
|
|
|
|
# Chrome enterprise policy: suppress first-run and sign-in nags, and pin
|
|
# Home to Wonder Ink. Nothing here restricts where teachers can browse.
|
|
install -Dm644 \
|
|
"$ROOT/config/chrome/policies/managed/ekklesia-classroom.json" \
|
|
"$STAGE/etc/opt/chrome/policies/managed/ekklesia-classroom.json"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/chrome/policies/recommended/ekklesia-classroom.json" \
|
|
"$STAGE/etc/opt/chrome/policies/recommended/ekklesia-classroom.json"
|
|
|
|
install -Dm755 \
|
|
"$ROOT/scripts/ekklesia-classroom-update" \
|
|
"$STAGE/usr/local/bin/ekklesia-classroom-update"
|
|
|
|
# System configuration.
|
|
install -Dm644 \
|
|
"$ROOT/systemd/autologin/autologin.conf" \
|
|
"$STAGE/etc/systemd/system/[email protected]/autologin.conf"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/systemd/updater/ekklesia-classroom-update.service" \
|
|
"$STAGE/etc/systemd/system/ekklesia-classroom-update.service"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/systemd/updater/ekklesia-classroom-update.timer" \
|
|
"$STAGE/etc/systemd/system/ekklesia-classroom-update.timer"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/icons/dvd.svg" \
|
|
"$STAGE/etc/ekklesia-classroom/icons/dvd.svg"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/icons/live.svg" \
|
|
"$STAGE/etc/ekklesia-classroom/icons/live.svg"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/icons/live-off.svg" \
|
|
"$STAGE/etc/ekklesia-classroom/icons/live-off.svg"
|
|
|
|
install -Dm644 \
|
|
"$ROOT/config/icons/browser.svg" \
|
|
"$STAGE/etc/ekklesia-classroom/icons/browser.svg"
|
|
|
|
printf '%s\n' "$VERSION" > "$ROOT/VERSION"
|
|
|
|
dpkg-deb \
|
|
--root-owner-group \
|
|
--build "$STAGE" "$OUTPUT"
|
|
|
|
echo
|
|
echo "Built:"
|
|
echo "$OUTPUT"
|
|
sha256sum "$OUTPUT"
|