feat: give every room the broker, one scale, and its own panel back
Little Waders took the Plasma build and reported what a container cannot. A disc player on a machine with no optical drive, a clock nobody at the back of the room could read, a browser at half the size of the panel around it, and Parent Call with no broker to call. The broker is the same for every classroom, so it is a default now and not something to fill in room by room. classroom-migrate brings an existing room to the same place without touching its name, its username or its password, and Parent Call distinguishes a broker it cannot reach from one that was never set up: those send somebody to look at completely different things. The disc player's detection was right and ran too late — alongside the session rather than before it, and the panel is built from the layout the moment a session starts. It runs before the display manager now, and again from udev when a drive is plugged in. UI_SCALE had a ceiling of 1.5, which cannot express a 4K television; a clock pinned at 15 points, which is the same size at every scale; and a browser that was never told the number at all. All three are fixed and the room doubles together at 200%. This also brings 0.1.47's work into the repository, where it had only ever existed in a build directory under /tmp: the hidden display dialog, its authenticated writer, the polkit action, and the church's own wallpaper. One piece of it is deliberately left out. The custom volume display needed a shell package of our own, and with one selected plasmashell builds no panel at all — measured twice, with that build's own files, on a classroom that deletes its panel configuration at every login by design. The lab connected to the real church broker the moment the package defaulted to it. Nothing was left behind, which was checked, but the guard that should have stopped it had never worked: it used iptables, which the lab image does not have, and probed with /dev/tcp under dash, where that always fails. Both reported success. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
926668dc9b
commit
34fd02e08f
@@ -167,16 +167,32 @@ rmdir --ignore-fail-on-non-empty \
|
||||
# CHANNEL decides which manifest the updater fetches. A machine left on the
|
||||
# hyprland channel would be handed the Hyprland experiment again by the
|
||||
# next release published there, undoing the upgrade it just took.
|
||||
#
|
||||
# The broker is the same for every classroom, so a room that was set up
|
||||
# before there was one — blank address, switched off — is given the
|
||||
# address rather than left with Parent Call saying there is no church
|
||||
# network. A room already pointed somewhere else is left pointed there:
|
||||
# that is a decision somebody made. The username and the password are
|
||||
# never read, never written and never printed.
|
||||
if [[ -f "$DEVICE_CONFIG" ]]; then
|
||||
python3 - "$DEVICE_CONFIG" <<'PY'
|
||||
import re
|
||||
import sys
|
||||
|
||||
OBSOLETE_KEYS = ("COMPOSITOR", "HYPR_APPEARANCE")
|
||||
# Channels that served a desktop this package replaces.
|
||||
OBSOLETE_CHANNELS = {"hyprland"}
|
||||
# Every channel that serves a desktop this package replaces. A machine
|
||||
# that has just installed the Plasma classroom must not be left pointed at
|
||||
# a line that will hand it the sway build back at the next release: stable
|
||||
# and canary both would. A room already on the v2 channel, or on one
|
||||
# somebody named deliberately, is left where it is.
|
||||
OBSOLETE_CHANNELS = {"stable", "canary", "hyprland"}
|
||||
CHANNEL = "classroom-v2"
|
||||
|
||||
# The church broker. One address for every room.
|
||||
BROKER_HOST = "10.40.0.2"
|
||||
BROKER_PORT = "1883"
|
||||
TRUTHY = {"1", "true", "yes", "on", "enabled"}
|
||||
|
||||
path = sys.argv[1]
|
||||
|
||||
with open(path, "r", encoding="utf-8") as handle:
|
||||
@@ -184,6 +200,12 @@ with open(path, "r", encoding="utf-8") as handle:
|
||||
|
||||
out = []
|
||||
changed = []
|
||||
seen = set()
|
||||
|
||||
|
||||
def value_of(line):
|
||||
return line.split("=", 1)[1].strip()
|
||||
|
||||
|
||||
for line in lines:
|
||||
key = line.split("=", 1)[0].strip() if "=" in line else ""
|
||||
@@ -192,15 +214,43 @@ for line in lines:
|
||||
changed.append(f"dropped {key}")
|
||||
continue
|
||||
|
||||
if key:
|
||||
seen.add(key)
|
||||
|
||||
if key == "CHANNEL":
|
||||
value = line.split("=", 1)[1].strip()
|
||||
value = value_of(line)
|
||||
|
||||
if value.lower() in OBSOLETE_CHANNELS:
|
||||
changed.append(f"moved off the {value} channel onto {CHANNEL}")
|
||||
line = f"CHANNEL={CHANNEL}\n"
|
||||
|
||||
elif key == "MQTT_ENABLED":
|
||||
if value_of(line).lower() not in TRUTHY:
|
||||
changed.append("switched the broker on")
|
||||
line = "MQTT_ENABLED=true\n"
|
||||
|
||||
elif key == "MQTT_HOST":
|
||||
if not value_of(line):
|
||||
changed.append(f"filled in the broker address {BROKER_HOST}")
|
||||
line = f"MQTT_HOST={BROKER_HOST}\n"
|
||||
|
||||
elif key == "MQTT_PORT":
|
||||
if not value_of(line):
|
||||
changed.append(f"filled in the broker port {BROKER_PORT}")
|
||||
line = f"MQTT_PORT={BROKER_PORT}\n"
|
||||
|
||||
out.append(line)
|
||||
|
||||
# A room old enough to predate a setting has no line to correct.
|
||||
for key, value in (
|
||||
("MQTT_ENABLED", "true"),
|
||||
("MQTT_HOST", BROKER_HOST),
|
||||
("MQTT_PORT", BROKER_PORT),
|
||||
):
|
||||
if key not in seen:
|
||||
changed.append(f"added {key}")
|
||||
out.append(f"{key}={value}\n")
|
||||
|
||||
if changed:
|
||||
with open(path, "w", encoding="utf-8") as handle:
|
||||
handle.writelines(out)
|
||||
|
||||
Reference in New Issue
Block a user