mirror of
https://github.com/deunix-educ/mediadeck.git
synced 2026-11-25 04:39:42 +01:00
5921b7c414
Media tab (needs at least one folder, hidden otherwise): - Folders from [media] roots in config.toml, default = the user's Music, Videos and Pictures (XDG, never $HOME); [] disables the tab - Icons per type, subfolders, breadcrumb, back, refresh, All/Sounds/Images/ Videos filter; a tap opens the file on the PC (WebSocket system/open_media) - Three special launchers (audio, image, video), editable on /admin: system default (gio open), installed application (gio launch) or a raw command (allow_custom_command); the file path is appended as the last argument - The client never sends an absolute path: (root, relative path) is resolved server side; refuses "..", hidden entries, symlinks leaving the root, and anything but known media extensions (a script renamed .mp3 is refused) - GET /api/media (Bearer token), listing runs in a thread, 1000 entries max Interface cache: pages are revalidated (Cache-Control: no-cache) and static files are served under /static/<version>/ (immutable cache), so a tablet can no longer keep an old interface after an update. Reproduced and verified: opening the same link serves the cached page, one refresh fixes it for good. Refactors: restapi.py (shared REST helpers), AppPicker (shared by the launcher and opener forms on /admin). Tests: 159 (library escapes, openers, admin API, config, cache headers). Also checked end to end with a real server (fake gio recording its arguments) and headless Chromium. Not tried on the real tablet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
81 lines
3.4 KiB
TOML
81 lines
3.4 KiB
TOML
# Configuration MediaDeck : copiée vers ~/.config/mediadeck/config.toml par `make config`.
|
|
# Ce fichier contient le jeton d'accès : il doit rester en mode 600.
|
|
|
|
[server]
|
|
# 0.0.0.0 = toutes les interfaces ; préférer l'IP LAN du PC si possible
|
|
host = "0.0.0.0"
|
|
port = 8765
|
|
# Adresse affichée dans l'URL et le QR code (`make url`) ; à renseigner si la détection
|
|
# automatique choisit une mauvaise interface (VPN, Docker…). Nom d'hôte ou IPv4.
|
|
# advertise_host = "192.168.1.104"
|
|
# HTTPS : `make cert` crée une CA locale + un certificat et renseigne ces trois lignes.
|
|
# La tablette doit installer la CA une fois (https://<ip>:<port>/ca.crt).
|
|
# tls_cert = "~/.config/mediadeck/tls/server.pem"
|
|
# tls_key = "~/.config/mediadeck/tls/server.key"
|
|
# tls_ca = "~/.config/mediadeck/tls/mediadeck-ca.crt"
|
|
# Choix sécurisé / non sécurisé : avec HTTPS, ce port HTTP en clair (jeton non chiffré, LAN de confiance
|
|
# uniquement) est ouvert EN PLUS de `port`. La tablette choisit : https://<ip>:8765 ou http://<ip>:8766.
|
|
# 0 = désactivé. Exige tls_cert/tls_key (sans eux, `port` sert déjà du HTTP). `make http-on` / `make http-off`
|
|
# écrivent ou retirent cette ligne.
|
|
# http_port = 8766
|
|
# Généré par `make config` / `make token` (32 octets aléatoires, URL-safe)
|
|
token = "CHANGE_ME"
|
|
|
|
[audio]
|
|
# Volume maximal autorisé depuis la tablette (1.0 = 100 %, jusqu'à 1.5)
|
|
max_volume = 1.0
|
|
|
|
[features]
|
|
# Clavier/souris virtuels via /dev/uinput (nécessite `make uinput`)
|
|
input = true
|
|
# Veille / redémarrage / extinction via logind
|
|
power = true
|
|
# Saisie de texte depuis la tablette (clavier virtuel, `make uinput` requis). Désactivée par défaut : c'est un
|
|
# clavier complet, donc un contrôle total du PC pour quiconque possède le jeton (ouvrir un terminal, taper...).
|
|
text_input = false
|
|
|
|
[admin]
|
|
# Page /admin (bouton « Gérer » de l'onglet Lanceurs) et API REST des lanceurs
|
|
enabled = true
|
|
# Autorise la création/modification de commandes brutes depuis /admin. Une commande s'exécute avec vos
|
|
# droits : tant que c'est false, /admin ne propose que des sites web et des applications installées.
|
|
allow_custom_command = false
|
|
|
|
[media]
|
|
# Dossiers parcourus par l'onglet Médias (fichiers son, image, vidéo ; chaque icône ouvre le fichier sur le PC).
|
|
# Absent : dossiers Musique, Vidéos et Images de l'utilisateur (~/.config/user-dirs.dirs). [] : onglet désactivé.
|
|
# Le jeton donne accès aux noms des fichiers de ces dossiers : n'y mettre que ce qui peut être vu depuis la tablette.
|
|
# Le lecteur de chaque type (son, image, vidéo) se choisit sur la page /admin.
|
|
# roots = ["~/Musique", "~/Vidéos", "~/Images"]
|
|
|
|
# Lanceurs : IMPORTÉS UNE SEULE FOIS dans la base (~/.local/share/mediadeck/launchers.db) au premier
|
|
# démarrage, puis gérés sur /admin ; cette section est ensuite ignorée et peut être supprimée.
|
|
# Commande en liste argv, jamais interprétée par un shell.
|
|
# Icônes disponibles : app, tv, film, globe, music, screen-off, speaker, lock, window
|
|
|
|
# Plein écran sans verrou : F11 (bouton de la télécommande) en sort. `firefox --kiosk` est à éviter,
|
|
# car le mode kiosque ignore F11.
|
|
[[launchers]]
|
|
id = "youtube"
|
|
label = "YouTube TV"
|
|
icon = "tv"
|
|
command = ["chromium", "--start-fullscreen", "https://www.youtube.com/tv"]
|
|
|
|
[[launchers]]
|
|
id = "vlc"
|
|
label = "VLC"
|
|
icon = "film"
|
|
command = ["vlc"]
|
|
|
|
[[launchers]]
|
|
id = "elisa"
|
|
label = "Elisa"
|
|
icon = "music"
|
|
command = ["elisa"]
|
|
|
|
[[launchers]]
|
|
id = "screen-off"
|
|
label = "Écran off"
|
|
icon = "screen-off"
|
|
command = ["kscreen-doctor", "--dpms", "off"]
|