"""The checklist for one computer: steps (text + how) and scripts (name + how + text)."""
host=cfg["hosts"][alias]
runs=host.get("runs")or[]
kinds={r.get("kind")forrinruns}
site=cfg.get("site")or{}
ingest=site.get("ingest_name")or"the Ingest Mac"
steps,scripts=[],[]
ifhost.get("self"):
steps=[
("Command Line Tools / python 3.9-3.12","Terminal: xcode-select --install. The watchdog runs on the Mac's own python3."),
("the watchdog and the settings page are loaded","Copy the folder to ~/status-panel-install and run install.sh once; both LaunchAgents are written by it."),
("Companion's custom variables and blink clock exist","In Companion: Variables > Custom: %s; a trigger every second that adds 1 to flash_tick (Companion only allows this in its own UI)."
%", ".join((cfg.get("variables")or{}).values())),
("the login key pair exists","install.sh makes ~/.ssh/id_status_panel; the other computers get its public half through the scripts below."),
("the Netgear login is in the keychain","Terminal: security add-generic-password -s netgear-status-panel -a <user> -w (it asks for the password; only needed with Dante switches)."),
("the Spotify permission was allowed once","Hold the SPOTIFY key once while sitting at this Mac and click Allow on the Automation prompt."),
("the DVS helper and its sudo rule","Run the DVS helper script below on this Mac too (as root, through ARD or sudo)."),
("Google Drive is signed in (saved switcher files)","Finder: Google Drive is mounted and the switcher folder on Site setup > ATEM exists."),
("the panel's key is accepted on this Mac too","macOS keeps background programs out of cloud folders; the page reads the saved switcher files through this Mac's own Remote Login instead. Run the authorise line below here (Terminal, or ARD as root)."),
scripts.append({"name":"Authorise the panel's login on this Mac (run as root)","how":"Terminal on this Mac with sudo, or ARD > Send UNIX Command as root.","text":mac_authorize(cfg)})
scripts.append({"name":"DVS helper (run as root)","how":"Apple Remote Desktop > Send UNIX Command as root, or sudo zsh in Terminal here.","text":mac_dvs_helper(cfg)})
elifhost.get("os")=="windows":
steps=[
("the SSH service runs and starts with Windows","The set-up script below installs and starts OpenSSH Server."),
("the firewall lets this Mac in","The script opens port 22 for %s's addresses only."%ingest),
("the panel's login key is accepted","The script writes %s's key into the administrators' and the user's authorized_keys."%ingest),
("a \\StatusPanel\\ task per program","The script creates one scheduled task per program listed under 'What runs here' (Make a PC program startable adds one)."),
]
if"service"inkinds:
steps.append(("the services restart by themselves","The script sets each listed service to restart when it stops."))
steps+=[
("wake-on-LAN is on in Windows and in the BIOS","The script turns it on for the wired adapter; the BIOS setting (Wake on LAN / Power On By PCI-E) is yours to set once."),
("the network profile is Public where rtpMIDI runs","Settings > Network > the adapter > Public (rtpMIDI's Bonjour rules only allow Public)."),
("Wi-Fi power saving is off","Device Manager > the Wi-Fi adapter > Power Management > untick 'allow the computer to turn off this device'; Ethernet is better."),
]
try:
text=windows_setup(cfg,alias)
exceptValueErrorase:
text="# cannot generate: %s"%e
scripts.append({"name":"Set-up script (PowerShell, as administrator)","how":"Save it as windows-setup.ps1, run PowerShell as administrator, Set-ExecutionPolicy RemoteSigned -Scope CurrentUser, then run the file. Paste the RESULT block below.","text":text})
else:
steps=[
("Remote Login is on","System Settings > General > Sharing > Remote Login on, for the user that is logged in."),
("the panel's login key is accepted","Paste the authorise line below through Apple Remote Desktop (Send UNIX Command as root) or run it in Terminal on that Mac."),
("python3 is present (for MIDI reads)","Terminal on that Mac: python3 --version (Command Line Tools install it)."),
]
if"helper_dvs"inkinds:
steps.append(("the DVS helper and its sudo rule","Paste the DVS helper script below as root (ARD)."))
if"midi_session"inkinds:
steps.append(("Audio MIDI Setup sessions named as the keys expect","Audio MIDI Setup > Window > Show MIDI Studio > Network: the session names on this computer's card."))
if"helper_solo"inkinds:
steps.append(("the Pro Tools helper runs and Accessibility is allowed","Run the solo-mode install below from %s, then allow solo-mode-agent under Accessibility on that Mac."%ingest))
scripts.append({"name":"Authorise %s's login (run as root)"%ingest,"how":"ARD > Send UNIX Command > as root, or Terminal there with sudo.","text":mac_authorize(cfg)})
if"helper_dvs"inkinds:
scripts.append({"name":"DVS helper (run as root)","how":"ARD > Send UNIX Command > as root.","text":mac_dvs_helper(cfg)})
if"helper_solo"inkinds:
scripts.append({"name":"Pro Tools solo-mode helper","how":"Two lines from %s's Terminal; then one click under Accessibility on that Mac."%ingest,"text":solo_install(cfg,alias)})