The app grew a python-backend/ and a web/ frontend, so pi_musicmouse no longer matches it. Rework the role: - Install a pinned uv and build the venv with Python 3.13; Raspbian Bookworm's python3 is 3.11 and the backend uses PEP 695 syntax. - pip install python-backend/ instead of a requirements.txt, and take the systemd unit straight from the checkout so it can't drift. - Build web/ on the control machine (no npm on the Pi) and rsync web/dist over. Chain the checkout -> install -> build -> sync -> restart steps through handlers so a run with no repo change does nothing. - Per-host config files (config-<host>.yml); the schema now differs between a host with a real mouse and a display-only one. - Version to deploy is per host (musicmouse_version), no default. Add pi_kiosk: autologin user running startx with Firefox in kiosk mode and no window manager, for a Pi with a monitor attached. Enabled by mediapi_has_monitor, defaulting off. Turn musicdolphin into a display-only instance: serial and audio simulated, driven entirely through the kiosk page. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pi_musicmouse
Deploys the MusicMouse backend (python-backend/) and its built web frontend.
- Checks out
musicmouse_version(a tag or branch - set per host inhost_vars, no default) frommusicmouse_repoto/opt/musicmouse. - Installs a pinned
uvrelease and uses it to create/opt/musicmouse/.venvwith Pythonpi_musicmouse_python_version(the backend needs 3.12+ for PEP 695 syntax; Raspbian Bookworm's apt python3 is only 3.11) andpip installthe backend into it. - Builds the frontend (
web/) on the control machine (delegated tolocalhost, not the Pi - no Node/npm is installed on the Pi) and syncsweb/distover. - Installs
/media/musicmouse/config.ymlfromfiles/config-<inventory_hostname>.yml(one file per host - the schema differs between a host with a real mouse attached and a display-only one; see those files' own comments) and the systemd unit copied straight from the checked-out repo'spython-backend/musicmouse.service, so it can never drift from what's actually in the app repo. - Sets up a Samba share of
/media/musicmousefor copying music onto the device.
Manual steps after a first deploy: set the Samba password with smbpasswd, and copy
music into /media/musicmouse (or via the Samba share).