Files
ansible/roles/pi_musicmouse/README.md
Martin Bauer 9b1d01115b Deploy rearchitected MusicMouse backend + web frontend
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>
2026-09-19 17:58:51 +02:00

1.2 KiB

pi_musicmouse

Deploys the MusicMouse backend (python-backend/) and its built web frontend.

  • Checks out musicmouse_version (a tag or branch - set per host in host_vars, no default) from musicmouse_repo to /opt/musicmouse.
  • Installs a pinned uv release and uses it to create /opt/musicmouse/.venv with Python pi_musicmouse_python_version (the backend needs 3.12+ for PEP 695 syntax; Raspbian Bookworm's apt python3 is only 3.11) and pip install the backend into it.
  • Builds the frontend (web/) on the control machine (delegated to localhost, not the Pi - no Node/npm is installed on the Pi) and syncs web/dist over.
  • Installs /media/musicmouse/config.yml from files/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's python-backend/musicmouse.service, so it can never drift from what's actually in the app repo.
  • Sets up a Samba share of /media/musicmouse for 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).