NA sees every campus; SSH from the admin laptop to every machine

Campuses set up from NA's install line tell NA where they are and learn nothing back (no campus
ever shows another). NA alone reads each campus's key states every two seconds and keeps two pages
in its Companion (added at the end, 98 and 99, since every other page is in use): CAMPUSES, a key
per campus (its ALL key, purple when it stops answering), and CAMPUS, the tapped campus's status
page drawn live in the same places, view only. Tried on NA with a test campus pointing at NA
itself, then removed.

tools/fleet.py: an Apple Remote Desktop command that turns on Remote Login, adds the laptop's key
and reports each Mac to NA, and the laptop SSH shortcuts made from those reports (tried on NA
Translation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 14:57:18 -04:00
co-authored by Claude Opus 5.5
parent 3976667bba
commit d7dc931bd4
6 changed files with 562 additions and 5 deletions
+9 -4
View File
@@ -153,9 +153,13 @@ def wait_applied(applier, limit=240):
return applier.status or {}
def setup(data_dir, cid, name=None, say=print):
def setup(data_dir, cid, name=None, say=print, home=None):
"""The first setup of a campus (or, when it is set up already, a look for what is new)."""
from settings import server
from settings import server, campuses
if home: # where it was installed from: the campus list lives there
data = campuses.load(data_dir)
data["home"] = home
campuses.save(data_dir, data)
site = server.Site(data_dir)
cfg = site.load()
if not is_fresh(cfg):
@@ -335,7 +339,7 @@ if [[ -n "$SUPPORT" ]]; then
fi
zsh install.sh --site %(cid)s
cd "$HOME/Library/Application Support/status-panel"
/usr/bin/python3 -m settings.campus setup --id %(cid)s --name %(qname)s
/usr/bin/python3 -m settings.campus setup --id %(cid)s --name %(qname)s --home "$SRC"
if ! /usr/bin/nc -z -G 2 127.0.0.1 22 >/dev/null 2>&1; then
echo
echo "One more thing: turn on Remote Login (System Settings > General > Sharing), so North Attleboro can help remotely."
@@ -411,9 +415,10 @@ def main(argv=None):
ap.add_argument("--id", default="new")
ap.add_argument("--name")
ap.add_argument("--data-dir", default=PARENT)
ap.add_argument("--home", help="the settings page this campus was installed from (the campus list lives there)")
a = ap.parse_args(argv)
if a.what == "setup":
setup(a.data_dir, a.id, a.name)
setup(a.data_dir, a.id, a.name, home=a.home)
elif a.what == "look":
cfg = sp.load_config(os.path.join(a.data_dir, "config.json"))
inv = discover.look(cfg, a.data_dir)