Intégration station d'impression photo (photostation)

- Icône discrète coin bas-gauche, visible seulement si photostation installée
- Popup PIN (4 chiffres) avant lancement
- Backend : /api/photostation/disponible + /api/photostation/lancer
- kiosk-session.sh : Chromium attend le flag /tmp/photostation_running avant redémarrage
- Script install-photostation.sh pour déploiement sur la Surface

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 09:20:48 +02:00
parent fe71921d1a
commit babd89425c
6 changed files with 174 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Installe la photostation sur la Surface pour intégration photobooth
set -e
DEST="/opt/photostation"
REPO="https://git.copydev.fr/jules/photostation.git"
echo "=== Installation Photostation ==="
# Dépendances système
sudo apt-get install -y \
python3-pyqt6 python3-pyqt6.qtsvg \
python3-pillow python3-flask \
python3-qrcode python3-cups \
libgl1 libglib2.0-0 2>&1 | grep -E 'Install|Upgrade|already'
# Cloner ou mettre à jour
if [ -d "$DEST/.git" ]; then
echo "Mise à jour du repo..."
git -C "$DEST" pull
else
echo "Clonage du repo..."
sudo git clone "$REPO" "$DEST"
sudo chown -R jules:jules "$DEST"
fi
# Venv avec accès aux paquets système (PyQt6 est en paquet système)
if [ ! -d "$DEST/venv" ]; then
python3 -m venv --system-site-packages "$DEST/venv"
fi
# Dépendances Python supplémentaires
"$DEST/venv/bin/pip" install --quiet qrcode[pil] 2>/dev/null || true
echo ""
echo "=== Installation terminée ==="
echo "Test : DISPLAY=:0 bash -c 'source $DEST/venv/bin/activate && python $DEST/src/main.py'"

View File

@@ -22,7 +22,9 @@ for i in $(seq 1 15); do
done
# Chromium en boucle : redémarre automatiquement s'il plante ou se ferme
# Attend si la photostation est en cours d'exécution
while true; do
while [ -f /tmp/photostation_running ]; do sleep 1; done
chromium \
--kiosk \
--noerrdialogs \