fix installation scripts
This commit is contained in:
parent
84fdc64070
commit
320b9242d5
@ -310,8 +310,8 @@
|
|||||||
"enum_operating_system_redhat": "RedHat",
|
"enum_operating_system_redhat": "RedHat",
|
||||||
"enum_operating_system_centos": "CentOS",
|
"enum_operating_system_centos": "CentOS",
|
||||||
"enum_operating_system_other": "Other",
|
"enum_operating_system_other": "Other",
|
||||||
"sysinfo_rpi_model": "Raspberry Pi Model",
|
"sysinfo_device_model": "Device model",
|
||||||
"sysinfo_rpi_model_unknown": "Not a Raspberry Pi or model information not available",
|
"sysinfo_device_model_unknown": "Unknown model",
|
||||||
"sysinfo_storage_free_space": "Storage Free Space",
|
"sysinfo_storage_free_space": "Storage Free Space",
|
||||||
"sysinfo_memory_usage": "Memory Usage",
|
"sysinfo_memory_usage": "Memory Usage",
|
||||||
"sysinfo_os_version": "OS Version",
|
"sysinfo_os_version": "OS Version",
|
||||||
|
|||||||
@ -311,8 +311,8 @@
|
|||||||
"enum_operating_system_redhat": "RedHat",
|
"enum_operating_system_redhat": "RedHat",
|
||||||
"enum_operating_system_centos": "CentOS",
|
"enum_operating_system_centos": "CentOS",
|
||||||
"enum_operating_system_other": "Otro",
|
"enum_operating_system_other": "Otro",
|
||||||
"sysinfo_rpi_model": "Modelo de Raspberry Pi",
|
"sysinfo_device_model": "Modelo del dispositivo",
|
||||||
"sysinfo_rpi_model_unknown": "No es una Raspberry Pi o la información del modelo no está disponible",
|
"sysinfo_device_model_unknown": "Modelo desconocido",
|
||||||
"sysinfo_storage_free_space": "Espacio de almacenamiento libre",
|
"sysinfo_storage_free_space": "Espacio de almacenamiento libre",
|
||||||
"sysinfo_memory_usage": "Uso de memoria",
|
"sysinfo_memory_usage": "Uso de memoria",
|
||||||
"sysinfo_os_version": "Versión del SO",
|
"sysinfo_os_version": "Versión del SO",
|
||||||
|
|||||||
@ -312,8 +312,8 @@
|
|||||||
"enum_operating_system_redhat": "RedHat",
|
"enum_operating_system_redhat": "RedHat",
|
||||||
"enum_operating_system_centos": "CentOS",
|
"enum_operating_system_centos": "CentOS",
|
||||||
"enum_operating_system_other": "Autre",
|
"enum_operating_system_other": "Autre",
|
||||||
"sysinfo_rpi_model": "Modèle du Raspberry Pi",
|
"sysinfo_device_model": "Modèle de l'appareil",
|
||||||
"sysinfo_rpi_model_unknown": "Le modèle n'est pas un Raspberry Pi",
|
"sysinfo_device_model_unknown": "Modèle inconnu",
|
||||||
"sysinfo_storage_free_space": "Stockage Disponible",
|
"sysinfo_storage_free_space": "Stockage Disponible",
|
||||||
"sysinfo_memory_usage": "Utilisation Mémoire",
|
"sysinfo_memory_usage": "Utilisation Mémoire",
|
||||||
"sysinfo_os_version": "Version SE",
|
"sysinfo_os_version": "Version SE",
|
||||||
|
|||||||
@ -311,8 +311,8 @@
|
|||||||
"enum_operating_system_redhat": "RedHat",
|
"enum_operating_system_redhat": "RedHat",
|
||||||
"enum_operating_system_centos": "CentOS",
|
"enum_operating_system_centos": "CentOS",
|
||||||
"enum_operating_system_other": "Altro",
|
"enum_operating_system_other": "Altro",
|
||||||
"sysinfo_rpi_model": "Raspberry Pi Model",
|
"sysinfo_device_model": "Modello del dispositivo",
|
||||||
"sysinfo_rpi_model_unknown": "Informazioni Raspberry Pi non disponibili",
|
"sysinfo_device_model_unknown": "Modello sconosciuto",
|
||||||
"sysinfo_storage_free_space": "Spazio libero",
|
"sysinfo_storage_free_space": "Spazio libero",
|
||||||
"sysinfo_memory_usage": "Memoria usata",
|
"sysinfo_memory_usage": "Memoria usata",
|
||||||
"sysinfo_os_version": "OS Version",
|
"sysinfo_os_version": "OS Version",
|
||||||
|
|||||||
@ -55,7 +55,8 @@ class PlaylistController(ObController):
|
|||||||
playlist = Playlist(
|
playlist = Playlist(
|
||||||
name=request.form['name'],
|
name=request.form['name'],
|
||||||
enabled=True,
|
enabled=True,
|
||||||
time_sync=False
|
time_sync=False,
|
||||||
|
fallback=self._model_store.playlist().count_fallbacks() == 0
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -186,7 +186,7 @@ GROUP BY playlist_id;
|
|||||||
self.post_update(id)
|
self.post_update(id)
|
||||||
|
|
||||||
def check_and_set_fallback(self):
|
def check_and_set_fallback(self):
|
||||||
if len(self.get_by("fallback = 1")) == 0:
|
if self.count_fallbacks() == 0:
|
||||||
self.set_fallback()
|
self.set_fallback()
|
||||||
|
|
||||||
def set_fallback(self, playlist_id: Optional[int] = 0) -> None:
|
def set_fallback(self, playlist_id: Optional[int] = 0) -> None:
|
||||||
@ -226,3 +226,8 @@ GROUP BY playlist_id;
|
|||||||
def to_dict(self, playlists: List[Playlist]) -> List[Dict]:
|
def to_dict(self, playlists: List[Playlist]) -> List[Dict]:
|
||||||
return [playlist.to_dict() for playlist in playlists]
|
return [playlist.to_dict() for playlist in playlists]
|
||||||
|
|
||||||
|
def count_all(self):
|
||||||
|
return len(self.get_all())
|
||||||
|
|
||||||
|
def count_fallbacks(self):
|
||||||
|
return len(self.get_by("fallback = 1"))
|
||||||
|
|||||||
@ -118,7 +118,7 @@ def get_network_ipaddr():
|
|||||||
def get_all_sysinfo():
|
def get_all_sysinfo():
|
||||||
rpi_model = get_rpi_model()
|
rpi_model = get_rpi_model()
|
||||||
infos = {
|
infos = {
|
||||||
"sysinfo_rpi_model": rpi_model if rpi_model else 'sysinfo_rpi_model_unknown',
|
"sysinfo_device_model": rpi_model if rpi_model else 'sysinfo_device_model_unknown',
|
||||||
"sysinfo_storage_free_space": get_free_space(),
|
"sysinfo_storage_free_space": get_free_space(),
|
||||||
"sysinfo_memory_usage": "{}{}".format(get_memory_usage()['percent'], "%"),
|
"sysinfo_memory_usage": "{}{}".format(get_memory_usage()['percent'], "%"),
|
||||||
"sysinfo_os_version": get_os_version(),
|
"sysinfo_os_version": get_os_version(),
|
||||||
|
|||||||
@ -29,6 +29,8 @@ chromium-browser \
|
|||||||
--noerrdialogs \
|
--noerrdialogs \
|
||||||
--kiosk \
|
--kiosk \
|
||||||
--incognito \
|
--incognito \
|
||||||
|
--user-data-dir=/home/pi/.config/chromium \
|
||||||
|
--no-sandbox
|
||||||
--window-position=0,0 \
|
--window-position=0,0 \
|
||||||
--window-size=${WIDTH},${HEIGHT} \
|
--window-size=${WIDTH},${HEIGHT} \
|
||||||
--display=:0 \
|
--display=:0 \
|
||||||
|
|||||||
@ -52,14 +52,40 @@ fi
|
|||||||
# Installation
|
# Installation
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "# Waiting 3 seconds before installation..."
|
echo "# Waiting 3 seconds before installation..."
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
# Update and install necessary packages
|
# Update and install necessary packages
|
||||||
apt update
|
apt update
|
||||||
apt install -y xinit xserver-xorg chromium-browser unclutter pulseaudio
|
|
||||||
|
# ------------------
|
||||||
|
# Chromium package
|
||||||
|
# ------------------
|
||||||
|
CHROMIUM=""
|
||||||
|
|
||||||
|
# Attempt to install chromium-browser
|
||||||
|
if sudo apt-get install -y chromium-browser; then
|
||||||
|
CHROMIUM="chromium-browser"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if sudo apt-get install -y chromium; then
|
||||||
|
CHROMIUM="chromium"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$CHROMIUM" ]; then
|
||||||
|
echo "Error: Chromium could not be installed." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ------------------
|
||||||
|
# Remaining packages
|
||||||
|
# ------------------
|
||||||
|
apt install -y xinit xserver-xorg x11-xserver-utils unclutter pulseaudio
|
||||||
|
|
||||||
|
# ------------------
|
||||||
|
# Configuration
|
||||||
|
# ------------------
|
||||||
|
|
||||||
# Add user to tty, video groups
|
# Add user to tty, video groups
|
||||||
usermod -aG tty,video $OWNER
|
usermod -aG tty,video $OWNER
|
||||||
@ -82,7 +108,7 @@ systemctl set-default graphical.target
|
|||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
mkdir -p "$WORKING_DIR/obscreen/var/run"
|
mkdir -p "$WORKING_DIR/obscreen/var/run"
|
||||||
curl https://raw.githubusercontent.com/jr-k/obscreen/master/system/autostart-browser-x11.sh | sed "s#/home/pi#$WORKING_DIR#g" | sed "s#=pi#=$OWNER#g" | sed "s#http://localhost:5000#$obscreen_studio_url#g" | tee "$WORKING_DIR/obscreen/var/run/play"
|
curl https://raw.githubusercontent.com/jr-k/obscreen/master/system/autostart-browser-x11.sh | sed "s#/home/pi#$WORKING_DIR#g" | sed "s#=pi#=$OWNER#g" | sed "s#chromium-browser#$CHROMIUM#g" | sed "s#http://localhost:5000#$obscreen_studio_url#g" | tee "$WORKING_DIR/obscreen/var/run/play"
|
||||||
chmod +x "$WORKING_DIR/obscreen/var/run/play"
|
chmod +x "$WORKING_DIR/obscreen/var/run/play"
|
||||||
chown -R $OWNER:$OWNER "$WORKING_DIR/obscreen"
|
chown -R $OWNER:$OWNER "$WORKING_DIR/obscreen"
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ sleep 3
|
|||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y git python3-pip python3-venv libsqlite3-dev ntfs-3g ffmpeg
|
apt-get install -y git build-essential gcc python3-dev python3-pip python3-venv libsqlite3-dev ntfs-3g ffmpeg
|
||||||
|
|
||||||
# Get files
|
# Get files
|
||||||
cd $WORKING_DIR
|
cd $WORKING_DIR
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user