[Unit] Description=Box-Konsole — ttyd web terminal wrapping a login shell (direkter Box-Zugriff) Documentation=https://github.com/tsl0922/ttyd After=network.target [Service] # Exponiert eine echte interaktive Login-Shell (bash -l) der Box als Web-Terminal — der # direkte, SSH-artige Zugriff, den das UI als „Konsole" einbettet (iframe). Schwester-Dienst # zum hermes-terminal (das die Agent-CLI zeigt); dieser hier zeigt die nackte Shell. # # SICHERHEIT: Bindet NUR an Loopback (lo/127.0.0.1) und läuft hinter dem MC2-Reverse-Proxy # (routers/console.py → same-origin /console/ auf dem offenen Port 9001). Port 7682 ist von # außen dicht → keine eigene Firewall-Regel nötig. Login-Schutz: ttyd startet die Shell über # `su - hitonabi` → fragt beim Öffnen das Box-Passwort ab (kein gespeichertes Passwort, PAM # prüft gegen das echte Konto). Trusted-Home-LAN, kein Internet-Exposure. Type=simple # --interface lo = nur Loopback. --base-path /console = ttyd bedient /console/* (Reverse-Proxy). # `su - hitonabi` = Passwort-Login (Box-Passwort) vor der Shell. -t = dunkles Theme. ExecStart=/usr/bin/ttyd --writable --interface lo --port 7682 --base-path /console --max-clients 2 --cwd %h -t 'theme={"background":"#0b0f1a"}' /bin/su - hitonabi Restart=always RestartSec=3 [Install] WantedBy=default.target