Files
mediadeck/config.example.toml
T
Denis 27c8eeb37c Offer secure (HTTPS) and unsecured (HTTP) access side by side, add a QR codes page
Optional plain HTTP port next to HTTPS (server.http_port, off by default):
- open_sites()/serve() replace web.run_app: one AppRunner, two TCPSites, so the
  tablet picks https://<ip>:8765 or http://<ip>:8766 without a restart
- http_port requires TLS and must differ from port (validated in config.py)
- make http-on / http-off (--http-port N) write or remove the line, restoring
  the file if the result is invalid; make firewall accepts HTTP_PORT
- make url prints both addresses and QR codes

QR codes page (make qr, --qr):
- self-contained HTML written with mode 600 in $XDG_RUNTIME_DIR and opened as
  file://, never served: the codes contain the access token
- qrencode SVG with crispEdges (no seams between modules), fr/en from LANG
- cards for HTTPS, HTTP and the CA certificate, depending on the config

Tests: 107 (dual listeners with the local CA, set_http_port, QR page content
and file mode). Docs: README fr/en and CLAUDE.md updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 11:55:50 +01:00

74 lines
3.0 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
# 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"]