]> git.proxmox.com Git - proxmox-backup.git/commit
api2/nodes: add termproxy and vncwebsocket api calls
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 21 Jul 2020 09:10:38 +0000 (11:10 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 23 Jul 2020 10:06:38 +0000 (12:06 +0200)
commit1c2f842a98533afa33c69ea462f72bcdfdd10d06
tree1f587068a7f3b5ecd530373e85a5a4338678dbc3
parenta4d1675513118c3549ba0267485cb38595e30e36
api2/nodes: add termproxy and vncwebsocket api calls

Even though it has nothing to do with vnc, we keep the name of the api
call for compatibility with our xtermjs client.

termproxy:
verifies that the user is allowed to open a console and starts
termproxy with the correct parameters

starts a TcpListener on "localhost:0" so that the kernel decides the
port (instead of trying to rerserving like in pve). Then it
leaves the fd open for termproxy and gives the number as port
and tells it via '--port-as-fd' that it should interpret this
as an open fd

the vncwebsocket api call checks the 'vncticket' (name for compatibility)
and connects the remote side (after an Upgrade) with a local TcpStream
connecting to the port given via WebSocket from the proxmox crate

to make sure that only the client can connect that called termproxy and
no one can connect to an arbitrary port on the host we have to include
the port in the ticket data

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Cargo.toml
src/api2/node.rs
src/config/acl.rs