1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 16:36:06 +00:00

fix(console): a serial console token works only in its user's session

socketiod refused a request without a signed-in session, but took a
token from anyone's session: a token read from a log or a URL opened
another user's serial console for 120 s. As novncd does, the session
must be the token's user's; the refusal is the page's "not allowed".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-08 17:55:31 +03:00
parent b6752f6370
commit fe553a2d65
3 changed files with 34 additions and 12 deletions

View file

@ -484,7 +484,7 @@ A VM without graphics (no `<graphics>` device, a `<console type='pty'>`) opens a
- The VM page's Settings → Console switches a shut-off VM between VNC and serial (Console type). A new VNC console takes the form's other fields; on a TCP or TLS compute it needs Listen on: All interfaces (SSH and socket computes reach a localhost console).
- The guest must use its serial port: a login prompt needs `systemctl enable --now serial-getty@ttyS0`, boot messages need the kernel parameter `console=ttyS0,115200`. The console shows only what the guest writes after it opens; press Enter for a new prompt.
- socketiod listens on 127.0.0.1:6081; the page reaches it through nginx's `/socket.io/` location on the panel's own address.
- It accepts the console page's signed token, which expires after 120 s, from a signed-in session (noVNC wants the session of the token's user). An open console closes within 10 s once its user loses access to the VM.
- It accepts the console page's signed token, which expires after 120 s, only from the session of the user it was given to, as noVNC does. An open console closes within 10 s once its user loses access to the VM.
- One console per VM, at most 20 at a time; a second one is refused with the reason, except a superuser's, which takes the console over.
- novncd and socketiod log to the journal (`journalctl -u webvirt-novncd -u webvirt-socketiod`) or, in Docker, to `docker logs`: a console that was refused or could not connect says why there.