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>
This commit is contained in:
3
roles/pi_kiosk/templates/autologin.conf.j2
Normal file
3
roles/pi_kiosk/templates/autologin.conf.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --autologin {{ pi_kiosk_user }} --noclear %I $TERM
|
||||
8
roles/pi_kiosk/templates/bash_profile.j2
Normal file
8
roles/pi_kiosk/templates/bash_profile.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
# Managed by ansible (pi_kiosk role). Auto-starts the kiosk browser on the console
|
||||
# this account autologs into - not meant for interactive use.
|
||||
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||
while true; do
|
||||
startx -- -nocursor
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
15
roles/pi_kiosk/templates/xinitrc.j2
Normal file
15
roles/pi_kiosk/templates/xinitrc.j2
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# Managed by ansible (pi_kiosk role). No window manager on purpose - Firefox is the
|
||||
# only X client, launched full-screen in kiosk mode; the loop is what takes the place
|
||||
# of a WM's "keep something on screen" job if it crashes.
|
||||
|
||||
xset s off
|
||||
xset -dpms
|
||||
xset s noblank
|
||||
|
||||
unclutter -idle 0.5 -root &
|
||||
|
||||
while true; do
|
||||
firefox --kiosk "{{ pi_kiosk_url }}"
|
||||
sleep 2
|
||||
done
|
||||
Reference in New Issue
Block a user