retspen / webvirtcloud

WebVirtCloud is virtualization web interface for admins and users
1.68k stars 371 forks source link

Hardcoded websocket path when using noVNC full version #440

Closed wongsyrone closed 3 years ago

wongsyrone commented 3 years ago

I have to change ws_path everytime when I want to use noVNC full variant.

Hardcoded here: https://github.com/retspen/webvirtcloud/blob/a20fa8e8d76a442ea4225c469d7666aab5b15e8d/console/templates/console-vnc-full.html#L221-L222

The lite version works because: https://github.com/retspen/webvirtcloud/blob/a20fa8e8d76a442ea4225c469d7666aab5b15e8d/console/templates/console-vnc-lite.html#L177-L178

get data from:

https://github.com/retspen/webvirtcloud/blob/a20fa8e8d76a442ea4225c469d7666aab5b15e8d/console/views.py#L74-L87

wongsyrone commented 3 years ago

The issue is caused by https://github.com/retspen/webvirtcloud/commit/43f1461e299fecb72fe05958d37c33702c3dbe94

wongsyrone commented 3 years ago

@catborise @retspen The template got removed from the commit above. Is it intentional?

catborise commented 3 years ago

I dont think it is intentional change, may be it is missed. We could change it, if it is useful.

wongsyrone commented 3 years ago

I think it's useful as it's more convenient.

wongsyrone commented 3 years ago

@catborise Any update on this?

catborise commented 3 years ago

@wongsyrone it is initiated at different place. changing "websockify" does not affect. i think it is set in UI.js which is not reach ws_path value.

wongsyrone commented 3 years ago

@catborise

Nope. I fixed it on my side by reverting partial changes (console-vnc-full.html) of https://github.com/retspen/webvirtcloud/commit/43f1461e299fecb72fe05958d37c33702c3dbe94

catborise commented 3 years ago

@wongsyrone i change it. but i cannot test it(my test shows no effect). if it is working fine...

wongsyrone commented 3 years ago

https://github.com/retspen/webvirtcloud/commit/24cd3f70ddefe529b97e019fa46c54180c64b725 looks good to me.

MisterBlueBear commented 1 year ago

I don't think this fix works at all. If I view the HTML source, I do see the correct HTML code, but in the console settings, it is still set to "websockify".

May I suggest just adding the location conf for "websockify" to /etc/nginx/conf.d/webvirtcloud.conf as a workaround. This fixes the issue.

    location /websockify {
        proxy_pass http://wssocketiod;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }