Commit 5ce854a8 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

software/kvm: fix noVNC access

Since f48a06ec noVNC is broken: the
default port for websocket is 5700 + display (and not 5900 + display).

Fix this error and add a promise to test websocket.
parent 4174b6f7
Pipeline #27052 failed with stage
......@@ -19,7 +19,7 @@ md5sum = b6204319cca4264b3c351d4dd1f2b5d0
[template-kvm]
filename = instance-kvm.cfg.jinja2
md5sum = 14a8433ca9f0038bb6cc4b68ef7ea8e5
md5sum = 4ae98a072354efbdd7440d800cc675c8
[template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in
......
......@@ -397,7 +397,7 @@ python-path = {{ python_executable }}
ipv4 = ${slap-network-information:local-ipv4}
ipv6 = ${slap-network-information:global-ipv6}
vnc-ip = ${:ipv4}
vnc-port = 5901
vnc-websocket-port = 5701
default-cdrom-iso = {{ debian_amd64_netinst_location }}
{% if virtual_hard_drive_url_enabled %}
......@@ -586,7 +586,7 @@ command-line = ${kvm-controller:output}
promise = check_socket_listening
name = vnc_promise.py
config-host = ${kvm-parameter-dict:vnc-ip}
config-port = ${kvm-parameter-dict:vnc-port}
config-port = ${kvm-parameter-dict:vnc-websocket-port}
[kvm-disk-image-corruption-bin]
recipe = collective.recipe.template
......@@ -675,7 +675,7 @@ path-access-log = ${directory:log}/nginx-access.log
ip = ${slap-network-information:global-ipv6}
port = 6080
websocket-ip = ${kvm-parameter-dict:vnc-ip}
websocket-port = ${kvm-parameter-dict:vnc-port}
websocket-port = ${kvm-parameter-dict:vnc-websocket-port}
websocket-path = websockify
nb-workers = 2
......@@ -782,6 +782,15 @@ promise = check_url_available
name = frontend_promise.py
config-url = ${request-slave-frontend:connection-secure_access}/vnc.html
[frontend-websocket-promise]
<= monitor-promise-base
promise = check_websocket_available
name = frontend_websocket_promise.py
config-url = wss://${request-slave-frontend:connection-domain}/websockify
config-content-to-send = RFB 003.008
# Jinja cannot parse byte literal so use encode()
config-content-to-receive = {{ dumps('RFB 003.008\n'.encode()) }}
{% if additional_frontend %}
[request-slave-frontend-additional]
<= request-slave-frontend-base
......@@ -1268,6 +1277,7 @@ parts =
cron-service
cron-entry-logrotate
frontend-promise
frontend-websocket-promise
{% if virtual_hard_drive_url_enabled %}
virtual-hard-drive-url-download-wrapper
virtual-hard-drive-url-config-state-promise
......
......@@ -302,7 +302,7 @@ slapos.rebootstrap = 4.5
slapos.recipe.build = 0.56
slapos.recipe.cmmi = 0.19
slapos.recipe.template = 5.1
slapos.toolbox = 0.130
slapos.toolbox = 0.132
smmap = 5.0.0
sniffio = 1.3.0
sortedcontainers = 2.4.0
......@@ -325,6 +325,8 @@ uritemplate = 3.0.0
urllib3 = 1.26.12
wcwidth = 0.2.5
webencodings = 0.5.1
websockets = 10.4
websocket-client = 1.5.1
Werkzeug = 2.0.2
wheel = 0.38.4:whl
widgetsnbextension = 2.0.0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment