Commit 32024e90 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 5f065e54
...@@ -19,7 +19,7 @@ md5sum = b6204319cca4264b3c351d4dd1f2b5d0 ...@@ -19,7 +19,7 @@ md5sum = b6204319cca4264b3c351d4dd1f2b5d0
[template-kvm] [template-kvm]
filename = instance-kvm.cfg.jinja2 filename = instance-kvm.cfg.jinja2
md5sum = 14a8433ca9f0038bb6cc4b68ef7ea8e5 md5sum = 4ae98a072354efbdd7440d800cc675c8
[template-kvm-cluster] [template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in filename = instance-kvm-cluster.cfg.jinja2.in
......
...@@ -397,7 +397,7 @@ python-path = {{ python_executable }} ...@@ -397,7 +397,7 @@ python-path = {{ python_executable }}
ipv4 = ${slap-network-information:local-ipv4} ipv4 = ${slap-network-information:local-ipv4}
ipv6 = ${slap-network-information:global-ipv6} ipv6 = ${slap-network-information:global-ipv6}
vnc-ip = ${:ipv4} vnc-ip = ${:ipv4}
vnc-port = 5901 vnc-websocket-port = 5701
default-cdrom-iso = {{ debian_amd64_netinst_location }} default-cdrom-iso = {{ debian_amd64_netinst_location }}
{% if virtual_hard_drive_url_enabled %} {% if virtual_hard_drive_url_enabled %}
...@@ -586,7 +586,7 @@ command-line = ${kvm-controller:output} ...@@ -586,7 +586,7 @@ command-line = ${kvm-controller:output}
promise = check_socket_listening promise = check_socket_listening
name = vnc_promise.py name = vnc_promise.py
config-host = ${kvm-parameter-dict:vnc-ip} 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] [kvm-disk-image-corruption-bin]
recipe = collective.recipe.template recipe = collective.recipe.template
...@@ -675,7 +675,7 @@ path-access-log = ${directory:log}/nginx-access.log ...@@ -675,7 +675,7 @@ path-access-log = ${directory:log}/nginx-access.log
ip = ${slap-network-information:global-ipv6} ip = ${slap-network-information:global-ipv6}
port = 6080 port = 6080
websocket-ip = ${kvm-parameter-dict:vnc-ip} 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 websocket-path = websockify
nb-workers = 2 nb-workers = 2
...@@ -782,6 +782,15 @@ promise = check_url_available ...@@ -782,6 +782,15 @@ promise = check_url_available
name = frontend_promise.py name = frontend_promise.py
config-url = ${request-slave-frontend:connection-secure_access}/vnc.html 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 %} {% if additional_frontend %}
[request-slave-frontend-additional] [request-slave-frontend-additional]
<= request-slave-frontend-base <= request-slave-frontend-base
...@@ -1268,6 +1277,7 @@ parts = ...@@ -1268,6 +1277,7 @@ parts =
cron-service cron-service
cron-entry-logrotate cron-entry-logrotate
frontend-promise frontend-promise
frontend-websocket-promise
{% if virtual_hard_drive_url_enabled %} {% if virtual_hard_drive_url_enabled %}
virtual-hard-drive-url-download-wrapper virtual-hard-drive-url-download-wrapper
virtual-hard-drive-url-config-state-promise virtual-hard-drive-url-config-state-promise
......
...@@ -302,7 +302,7 @@ slapos.rebootstrap = 4.5 ...@@ -302,7 +302,7 @@ slapos.rebootstrap = 4.5
slapos.recipe.build = 0.56 slapos.recipe.build = 0.56
slapos.recipe.cmmi = 0.19 slapos.recipe.cmmi = 0.19
slapos.recipe.template = 5.1 slapos.recipe.template = 5.1
slapos.toolbox = 0.130 slapos.toolbox = 0.132
smmap = 5.0.0 smmap = 5.0.0
sniffio = 1.3.0 sniffio = 1.3.0
sortedcontainers = 2.4.0 sortedcontainers = 2.4.0
...@@ -325,6 +325,8 @@ uritemplate = 3.0.0 ...@@ -325,6 +325,8 @@ uritemplate = 3.0.0
urllib3 = 1.26.12 urllib3 = 1.26.12
wcwidth = 0.2.5 wcwidth = 0.2.5
webencodings = 0.5.1 webencodings = 0.5.1
websockets = 10.4
websocket-client = 1.5.1
Werkzeug = 2.0.2 Werkzeug = 2.0.2
wheel = 0.38.4:whl wheel = 0.38.4:whl
widgetsnbextension = 2.0.0 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