Browse Source

Création des utilisateurs 'edk' par défaut
Management du plugin "User-Agent Switcher for Chrome" (création de la configuration pour les DRM)

jld 11 months ago
parent
commit
823da6c6d1
35 changed files with 108 additions and 34 deletions
  1. 0 0
      alluserhome/.anydesk/user.conf
  2. 0 0
      alluserhome/.config/autostart/autostart
  3. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/content-script.js
  4. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/images/chevron.png
  5. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_home_blanche.png
  6. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_home_orange.png
  7. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_off_blanc.png
  8. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_off_orange.png
  9. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_setting_blanc.png
  10. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_setting_orange.png
  11. 0 0
      alluserhome/.config/chromium/ExtensionsIo/totemhome/manifest.json
  12. 0 0
      alluserhome/.config/lxsession/LXDE-pi/autostart.defaut
  13. 6 0
      alluserhome/.config/lxsession/LXDE-pi/autostart.kiosk
  14. 0 0
      alluserhome/.kioskfiles/ukplugs/__init__.py
  15. 0 0
      alluserhome/.scripts/kiosk.sh
  16. 2 2
      pi/Desktop/Kiosque.desktop
  17. 0 0
      alluserhome/images/k-icon.png
  18. 0 0
      alluserhome/images/logoEDKbleu.jpg
  19. 0 0
      alluserhome/images/logoEDKbleu.png
  20. 0 0
      alluserscripts/iomanage.py
  21. 0 0
      alluserscripts/logmanage.py
  22. 8 0
      alluserscripts/openkiosk.sh
  23. 3 0
      chromium/policies/customize_browser.json
  24. 0 0
      chromium/policies/extensions.json
  25. 33 0
      chromium/policies/user_agent_switcher_conf.json
  26. 56 32
      deploy.sh
  27. 0 0
      usersshare/images/k-icon.png
  28. 0 0
      usersshare/images/splash.png
  29. 0 0
      usersshare/raspberrypi-artwork/launch.png
  30. 0 0
      usersshare/raspberrypi-artwork/magpi.png
  31. 0 0
      usersshare/raspberrypi-artwork/raspberry-pi-logo-small.png
  32. 0 0
      usersshare/raspberrypi-artwork/raspberry-pi-logo.png
  33. 0 0
      usersshare/raspberrypi-artwork/raspberry-pi-logo.svg
  34. 0 0
      usersshare/raspberrypi-artwork/raspirt.png
  35. 0 0
      usersshare/rpd-wallpaper/temple.jpg

pi/.anydesk/user.conf → alluserhome/.anydesk/user.conf


pi/.config/autostart/autostart → alluserhome/.config/autostart/autostart


pi/.config/chromium/ExtensionsIo/totemhome/content-script.js → alluserhome/.config/chromium/ExtensionsIo/totemhome/content-script.js


pi/.config/chromium/ExtensionsIo/totemhome/images/chevron.png → alluserhome/.config/chromium/ExtensionsIo/totemhome/images/chevron.png


pi/.config/chromium/ExtensionsIo/totemhome/images/icone_home_blanche.png → alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_home_blanche.png


pi/.config/chromium/ExtensionsIo/totemhome/images/icone_home_orange.png → alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_home_orange.png


pi/.config/chromium/ExtensionsIo/totemhome/images/icone_off_blanc.png → alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_off_blanc.png


pi/.config/chromium/ExtensionsIo/totemhome/images/icone_off_orange.png → alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_off_orange.png


pi/.config/chromium/ExtensionsIo/totemhome/images/icone_setting_blanc.png → alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_setting_blanc.png


pi/.config/chromium/ExtensionsIo/totemhome/images/icone_setting_orange.png → alluserhome/.config/chromium/ExtensionsIo/totemhome/images/icone_setting_orange.png


pi/.config/chromium/ExtensionsIo/totemhome/manifest.json → alluserhome/.config/chromium/ExtensionsIo/totemhome/manifest.json


pi/.config/lxsession/LXDE-pi/autostart.defaut → alluserhome/.config/lxsession/LXDE-pi/autostart.defaut


+ 6 - 0
alluserhome/.config/lxsession/LXDE-pi/autostart.kiosk

@@ -0,0 +1,6 @@
+@xset s off
+@xset -dpms
+@xset s noblank
+
+@chromium-browser -noerrdialogs --load-extension=~/.config/chromium/ExtensionsIo/totemhome -kiosk http://127.0.0.1:8080
+

pi/.kioskfiles/ukplugs/__init__.py → alluserhome/.kioskfiles/ukplugs/__init__.py


pi/.scripts/kiosk.sh → alluserhome/.scripts/kiosk.sh


+ 2 - 2
pi/Desktop/Kiosque.desktop

@@ -3,8 +3,8 @@ Encoding=UTF-8
 Type=Application
 Name=Kiosk
 Comment=Lancer le kiosk
-Exec=sh -c $HOME/.scripts/kiosk.sh
-Icon=/home/pi/images/k-icon.png
+Exec=bash /usr/local/sbin/openkiosk.sh
+Icon=/usr/share/images/k-icon.png
 Categories=Application
 Terminal=false
 

divers/k-icon.png → alluserhome/images/k-icon.png


pi/images/logoEDKbleu.jpg → alluserhome/images/logoEDKbleu.jpg


pi/images/logoEDKbleu.png → alluserhome/images/logoEDKbleu.png


iomanage/iomanage.py → alluserscripts/iomanage.py


iomanage/logmanage.py → alluserscripts/logmanage.py


+ 8 - 0
alluserscripts/openkiosk.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Modification du fichier autostart
+cp $HOME/.config/lxsession/LXDE-pi/autostart{.kiosk,}
+
+# Redémarage de la session graphique
+sudo service lightdm restart
+

+ 3 - 0
chromium/policies/customize_browser.json

@@ -0,0 +1,3 @@
+{
+	"HomepageLocation": "http://127.0.0.1:8080"
+}

chromium/plugins/extensions.json → chromium/policies/extensions.json


+ 33 - 0
chromium/policies/user_agent_switcher_conf.json

@@ -0,0 +1,33 @@
+{
+  "3rdparty": {
+    "extensions": {
+      "djflhoibgkdhkhhcedjiklpkjnoahfmg":{
+	   "UserAgents":[
+	      {
+	         "badge":"",
+	         "title":"Default",
+	         "ua_string":"",
+	         "vendor":""
+	      },
+	      {
+	         "badge":"NFX",
+	         "title":"Netflix",
+	         "ua_string":"Mozilla/5.0 (X11; CrOS x86_64 11895.95.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+	         "vendor":""
+	      }
+	   ],
+	   "PermanentSpoofs":[
+	      {
+	         "domain":"https://www.netflix.com",
+	         "user_agent":{
+	            "badge":"NFX",
+	            "title":"Netflix",
+	            "ua_string":"Mozilla/5.0 (X11; CrOS x86_64 11895.95.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+	            "vendor":""
+	         }
+	      }
+	   ]
+	}
+    }
+  }
+}

+ 56 - 32
deploy.sh

@@ -5,12 +5,8 @@
 # Fichier de déploiement d'une interface Kiosk                   #
 # à partir d'une image Raspbian 10                               #
 #                                                                #
-#                                                                #
 ##################################################################
 
-VERSION="master"
-KUSER="pi"
-
 # parser les arguments
 while getopts v:c option; do
 	case "${option}"
@@ -20,16 +16,28 @@ while getopts v:c option; do
 	esac
 done
 
+VERSION="master"
+KUSER="edkuser"
+GRPSADMIN="adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,spi,i2c,gpio"
+GRPSREST="dialout,cdrom,audio,video,games,users,input,netdev,gpio"
+INFOS=$(curl http://deploy.ioconstellation.com/infos/infos.txt)
+eval $INFOS
+
+echo "Version = " $VERSION
+
 if [ -n $CLEAN ]; then
 	echo "Tout Nettoyer"
 fi
 
-echo "Version = " $VERSION
+############## PAQUETS, BIBLIOTEQUE, ETC, #####################
 
 # Mise à jour 
 apt update
 apt upgrade -y
 
+# Installation des paquest utiles
+apt install accountsservice unclutter matchbox thunderbird thunderbird-l10n-fr -y
+
 # Suppression des paquets inutiles
 apt remove geany geany-common -y
 
@@ -41,34 +49,56 @@ if ! dpkg -s anydesk >/dev/null 2>&1; then
     rm anydesk_5.1.1-1_armhf.deb
 fi
 
-# Installation des jeux
-apt install scummvm -y
 
-#enlever la souris de l'écran
-apt install unclutter -y
+########## SCRIPTS ET MODIFICATION SYSTEM (LOOK, ETC...)
 
-#installer un clavier
-apt install matchbox -y
+# Installation des scripts utilisateurs et système
+cp -f ./alluserscripts/* /usr/local/sbin
+
+# Copie des fichier partagés par ts les utilisateurs
+cp -Rf ./usersshare/* /usr/share
+
+
+########## CRÉATION ET CONFIGURATION DES UTILISATEURS ###########
+
+# Créations des utilisateurs
+if ! id edkuser > /dev/null 2>&1; then
+  echo "création de l'utilisateur edkuser"
+  useradd -d /home/edkuser -G $GRPSREST -m -p $(echo $EDKPW | openssl passwd -1 -stdin) edkuser
+fi
+if ! id edkstf > /dev/null 2>&1; then
+  echo "création de l'utilisateur edkstf"
+  useradd -d /home/edkstf -G $GRPSADMIN -m -p $(echo $EDKSPW | openssl passwd -1 -stdin) edkstf
+fi
+
+# Modifier les droits sudoer
+echo "edkstf ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/020_edkstf-nopasswd
+echo "edkuser ALL=(ALL) NOPASSWD: /sbin/reboot,/sbin/shutdown,/usr/sbin/service" > /etc/sudoers.d/02_edkuser-nopasswd
+
+# Changer l'utilisateur "par defaut"
+sudo sed -i "s/autologin-user=pi/autologin-user=edkuser/g" /etc/lightdm/lightdm.conf
+
+# Copier les fichiers/dossiers home par defaut des utilisateurs
+for luser in pi edkuser edkstf
+do 
+	cp -Rf ./alluserhome -T /home/$luser
+	chown -R $luser:$luser /home/$luser
+	#chmod +x /home/$luser/.script/*
+done
 
-#installtion de libwidevine binary and extract pour useragent
-cp ./chromium/libwidevinecdm.so /usr/lib/chromium-browser
 
-#Messagerie Thunderbird pour travailler en off line
-apt install thunderbird thunderbird-l10n-fr -y
+##################### CHROMIUM #######################
+
+#installtion de libwidevine pour lecture des drm
+cp ./chromium/libwidevinecdm.so /usr/lib/chromium-browser
 
 # Installation des plugins Chromium
-for f in ./chromium/plugins/*.json; do
+for f in ./chromium/policies/*.json; do
     # do some stuff here with "$f"
     echo 'Installation des plugins ' $f
     cp $f  /etc/chromium-browser/policies/managed
 done
 
-# Copier les fichiers/dossiers de /pi / dans /home/$KUSER
-cp -Rfv ./$KUSER /home
-chown -R $KUSER:$KUSER /home/$KUSER
-chmod +x /home/$KUSER/.script/*
-
-
 # Installation et configuration de supervisor
 apt install supervisor -y
 for f in ./supervisor/*.conf; do
@@ -76,25 +106,19 @@ for f in ./supervisor/*.conf; do
     cp $f  /etc/supervisor/conf.d/
 done
 
-# Installation de Iomanage
-cp -f ./iomanage/iomanage.py /usr/local/sbin/
-cp -f ./iomanage/logmanage.py /usr/local/sbin/
-
 # Installer Flaskinterface
 apt install python3-flask python3-flask-sqlalchemy -y
 git clone -b $VERSION http://deploy.ioconstellation.com/iostaff/flaskinterface.git
 rm -R flaskinterface/.git
-cp -Rfv flaskinterface /opt
+cp -Rf flaskinterface /opt
 chown -R $KUSER:$KUSER /opt/flaskinterface
 
-# Modification du look du bureau
-cp -Rfv ./raspberrypi-artwork /usr/share
-cp -fv ./divers/temple.jpg /usr/share/rpd-wallpaper/temple.jpg
+
 ### à faire: changer framboise ###########################
 
 # Copier les fichiers de boot et de splash
-cp -Rfv ./boot /
-cp -fv ./divers/splash.png /usr/share/plymouth/themes/pix/splash.png
+#cp -Rfv ./boot /
+#cp -fv ./divers/splash.png /usr/share/plymouth/themes/pix/splash.png
 
 
 # Nettoyer le cache apt

pi/images/k-icon.png → usersshare/images/k-icon.png


divers/splash.png → usersshare/images/splash.png


raspberrypi-artwork/launch.png → usersshare/raspberrypi-artwork/launch.png


raspberrypi-artwork/magpi.png → usersshare/raspberrypi-artwork/magpi.png


raspberrypi-artwork/raspberry-pi-logo-small.png → usersshare/raspberrypi-artwork/raspberry-pi-logo-small.png


raspberrypi-artwork/raspberry-pi-logo.png → usersshare/raspberrypi-artwork/raspberry-pi-logo.png


raspberrypi-artwork/raspberry-pi-logo.svg → usersshare/raspberrypi-artwork/raspberry-pi-logo.svg


raspberrypi-artwork/raspirt.png → usersshare/raspberrypi-artwork/raspirt.png


divers/temple.jpg → usersshare/rpd-wallpaper/temple.jpg