Reviewed-By: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
On 09-02-2016 16:23, Jose Ricardo Ziviani wrote:
v2:
- applied code review
- updated the build system
This is the initial version of a web serial console for kimchi/libvirt
VMs.
When a VM is turned on, a new action is displayed named "Connect
Serial", this will open a new tab with an interface like the existing
novnc.
That interface opens a websocket to kimchi webserver (nginx), then
it is redirected to websockify. Websockify will proxy that connection to
a local unix socket server to finally communicate with the guest
console.
I chose to create one server per guest because that's the way websockify
was designed (it was born inside novnc), so I could reuse the token
security plugin implemented in websockify. In order to avoid wasting
resources I decided to user unix socket, a local/lightweight/reliable
socket if compared with internet sockets, this uses files instead of
ports to accept connections.
When a connection is established no one else can get that console (I'm
not multiplexing it but it's possible in future). The serial console
will be available again if the current user does one of:
- type ctrl+q
- close the tab
- 2 min. timeout
Thanks
Jose Ricardo Ziviani (8):
Rename vnc.py to websocket.py
Implement the web serial console server
Implement the backend to support web serial console
Implement the web serial console front-end
Import term.js to Kimchi project
Implement the Kimchi front-end for the web serial console
Update the build system to make the serial console
Add test case for the socket server
Makefile.am | 4 +-
config.py.in | 6 +-
configure.ac | 2 +
control/vms.py | 3 +-
i18n.py | 3 +
model/vms.py | 43 +-
root.py | 6 +-
serialconsole.py | 315 +++
tests/test_model.py | 28 +-
ui/Makefile.am | 2 +-
ui/js/src/kimchi.api.js | 27 +
ui/js/src/kimchi.guest_main.js | 14 +-
ui/pages/guest.html.tmpl | 3 +-
ui/serial/Makefile.am | 23 +
ui/serial/images/Makefile.am | 21 +
ui/serial/images/favicon.ico | Bin 0 -> 15086 bytes
ui/serial/serial.html | 99 +
ui/serial/term.js | 5973 ++++++++++++++++++++++++++++++++++++++++
vnc.py | 92 -
websocket.py | 122 +
20 files changed, 6677 insertions(+), 109 deletions(-)
create mode 100644 serialconsole.py
create mode 100644 ui/serial/Makefile.am
create mode 100644 ui/serial/images/Makefile.am
create mode 100644 ui/serial/images/favicon.ico
create mode 100644 ui/serial/serial.html
create mode 100644 ui/serial/term.js
delete mode 100644 vnc.py
create mode 100644 websocket.py
--
Lucio Correia
Software Engineer
IBM LTC Brazil