Step 1: the settings page, read-only, live on NA Ingest at port 8020
Overview (problems in the room with the hold action, the live deck, one line per computer), Keys (both pages, what each key will say and what holding does), Computers (map with the keys that turn red, cards with a light per thing that runs there from the watchdog's snapshot and a read-only probe, Gear, Setup), Logs, History (the installer's copies for now), Help (four cards, the generated key guide, cheat sheet and Where things are, glossary, Companion facts), Site setup and Fixes read-only. The editing code is checked (with a lockout) but nothing can change yet. Also: faults are attributed to the computers their check is about; the installer refuses while a HyperDeck is recording (--now overrides); the Lighting PC's MIDI session is listed; the probes read sudo's answer correctly and expand $HOME outside the quotes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+18
-5
@@ -39,10 +39,17 @@ WIN_PROBE = (
|
||||
)
|
||||
|
||||
|
||||
def shell_path(path):
|
||||
"""A path for a shell line: quoted, except that a leading ~ becomes $HOME outside the quotes."""
|
||||
if path.startswith("~/"):
|
||||
return '"$HOME"' + shlex.quote(path[1:])
|
||||
return shlex.quote(path)
|
||||
|
||||
|
||||
def quoted_paths(cfg):
|
||||
site = cfg.get("site", {})
|
||||
return {"helper": shlex.quote(site.get("dvs_helper", "/usr/local/sbin/status-panel-dvs-start")),
|
||||
"solo": shlex.quote(site.get("solo_dir", "~/Library/Application Support/status-panel").replace("~", "$HOME"))}
|
||||
return {"helper": shell_path(site.get("dvs_helper", "/usr/local/sbin/status-panel-dvs-start")),
|
||||
"solo": shell_path(site.get("solo_dir", "~/Library/Application Support/status-panel"))}
|
||||
|
||||
|
||||
def run_ssh(cfg, alias, command, timeout=TIMEOUT):
|
||||
@@ -146,11 +153,17 @@ def mac_items(host, parsed, cfg):
|
||||
label = run.get("label", "")
|
||||
item.update(light(label not in agents, "loaded - it must not run here"))
|
||||
elif kind == "daemon":
|
||||
proc = run.get("process", "")
|
||||
item.update(light(any(proc in p for p in procs), "not running"))
|
||||
want = run.get("process", "").lower().replace(" ", "")
|
||||
running = any(want in p.lower().replace(" ", "") for p in procs) or any(want in a.lower() for a in agents) \
|
||||
or (want.startswith("dantevirtual") and any("dvsd" in p for p in procs))
|
||||
item.update(light(running, "not running"))
|
||||
elif kind == "helper_dvs":
|
||||
# `sudo -n -l <helper>` answers with the command itself when it is allowed without a password.
|
||||
lines = [l for l in helper.splitlines() if l.strip()]
|
||||
installed = "No such file" not in helper and "-rwx" in helper
|
||||
allowed = "NOPASSWD" in helper or "(root)" in helper or "may run" in helper.lower()
|
||||
last = lines[-1] if lines else ""
|
||||
allowed = installed and "status-panel-dvs-start" in last and "not allowed" not in last.lower() and "may not" not in last.lower() \
|
||||
and "password" not in last.lower()
|
||||
item.update(light(installed and allowed, "not installed" if not installed else "sudo rule missing"))
|
||||
elif kind == "helper_solo":
|
||||
label = run.get("label", "org.waterschurch.status-panel.solo-mode")
|
||||
|
||||
Reference in New Issue
Block a user