diff --git a/src/sunstone/OpenNebulaVNC.rb b/src/sunstone/OpenNebulaVNC.rb index ecaac733b0..e2e3ac3fde 100644 --- a/src/sunstone/OpenNebulaVNC.rb +++ b/src/sunstone/OpenNebulaVNC.rb @@ -24,8 +24,7 @@ class OpenNebulaVNC @proxy_path = config[:vnc_proxy_path] @proxy_base_port = config[:vnc_proxy_base_port].to_i @wss = config[:vnc_proxy_support_wss] - $stderr.puts "wss #{@wss}" - @enable_wss = (@wss == "yes") || (@wss == "only") + @enable_wss = (@wss == "yes") || (@wss == "only") || (@wss == true) @cert = @enable_wss? config[:vnc_proxy_cert] : nil @key = @enable_wss? config[:vnc_proxy_key] : nil @options=opt diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 349fa484c1..bcc7e8225f 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -19,12 +19,14 @@ # base_port: base_port + vnc_port of the VM is the port where the # proxy will listen for VNC session connections to that VM. # vnc_proxy_path: path to the websockets proxy (set by install_novnc.sh) -# support_wss: "no", "yes", "only". For yes and only, provide path to -# cert and key. Note value must be a quoted string. -# (key is only necessary if not included in cert). +# support_wss: no | yes | only. For yes and only, provide path to +# cert and key. "yes" means both ws and wss connections will be +# supported. +# vnc_proxy_cert: Certificate to encrypt wss connections. +# vnc_proxy_key: Key for wss connections. Only necessary if not included in cert. :vnc_proxy_base_port: 29876 :vnc_proxy_path: -:vnc_proxy_support_wss: "no" +:vnc_proxy_support_wss: no :vnc_proxy_cert: :vnc_proxy_key: diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index 126c509fcd..f342e91665 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -80,6 +80,7 @@ function updateWss(){ }, }; OpenNebula.User.show(user_info_req); + $.post('config',JSON.stringify({wss : ($('#config_table #wss_checkbox').is(':checked') ? "yes" : "no")})); }; $(document).ready(function(){ diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 2e22b2aa3f..bb9bdeba03 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -130,9 +130,10 @@ helpers do if user['TEMPLATE/VNC_WSS'] session[:wss] = user['TEMPLATE/VNC_WSS'] else - session[:wss] = settings.config[:vnc_proxy_support_wss] + wss = settings.config[:vnc_proxy_support_wss] #limit to yes,no options - session[:wss] = (session[:wss] != "no" ? "yes" : "no") + session[:wss] = (wss == true || wss == "yes" || wss == "only" ? + "yes" : "no") end #end user options