noVNC icon indicating copy to clipboard operation
noVNC copied to clipboard

make it easier to customize default host, password, port in the url via code

Open arjitc opened this issue 6 years ago • 12 comments

Is there anyway to pre-load / load the information (host, port, password) into the vnc.html page via PHP ?

This is possible with the vnc_light.html file but seems quite tricky with the vnc.html as it loads all the information from ui.js

Thanks!

arjitc avatar Oct 31 '18 17:10 arjitc

No, the only way is to either alter the javascript or to use fragment or query parameters.

samhed avatar Oct 31 '18 22:10 samhed

I think there might be ways we can make this easier and more obvious. We want people to be able to customise things after all.

E.g. instead of just having <script src="app/ui.js"> like we do now, we could do:

<script type="module">
import UI from "./app/ui.js";
// Change this to force specific settings
// UI.forceSetting('host', 'server.example.com');
UI.start();
</script>

CendioOssman avatar Nov 01 '18 15:11 CendioOssman

Hi, @CendioOssman -- yes, your example would be perfect!

The vnc_lite is very easy to implement but the features lack a lot, while vnc.html has a lot of features, better UI and more work put into it by the noVNC team as well! This would help to make the implementation into other projects very easy as well.

arjitc avatar Nov 05 '18 14:11 arjitc

You can already pass the host/port/etc can be set from the fragment or query string.

The password would be not-too-good security-wise to allow it to be picked from the fragment (although it would be trivial to implement). But it can be very easily set by simply adding UI.setPassword('<MY_PASSWORD>') right after UI.start();.

So what's actually missing here?

juanjoDiaz avatar Jul 19 '19 11:07 juanjoDiaz

So just to clarify -- would this be possible (it was possible in the old version),

host = WebUtil.getConfigVar('host', '<?php echo $vnc_host; ?>');
port = WebUtil.getConfigVar('port', '<?php echo $vnc_port; ?>');
password = WebUtil.getConfigVar('password', '<?php echo vnc_password; ?>');

In the old version, these 3 values were set via PHP on our end and it would just auto-connect upon the page loading.

arjitc avatar Jul 20 '19 22:07 arjitc

Not easily right now, no.

CendioOssman avatar Jul 22 '19 14:07 CendioOssman

Ah -- would be nice to have it that way, I think(?) currently, the parameters can be passed in the URL, but then that saves in the browser history etc which isn't ideal, the other way at least via PHP/Sessions, you can control / wipe the variable values if the user isn't authenticated etc.

arjitc avatar Jul 22 '19 15:07 arjitc

I also like a better way to configure noVNC. In the moment i modify the ui.js (for each node). Not nice but working.

        // const host = UI.getSetting('host');
        // const port = UI.getSetting('port');
        // const path = UI.getSetting('path');
        const host = 'novnc.myserver.com';
        const port = '443';
        const path = 'websockify?token=abc';

##

        // UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
        UI.rfb.resizeSession = 'remote';

pm-pm avatar Oct 29 '19 14:10 pm-pm

@CendioOssman -- Just saw the pull-request for this feature, thank you! :)

btw Internet Explorer is EOL in 2021, might be worth making this a optional feature/branch for now which can be enabled right away? :)

arjitc avatar Aug 25 '20 15:08 arjitc

Oh? That would be a welcome EOL. :)

Do you have any official reference from Microsoft that we can use?

Unfortunately I don't see a good way of making this optional, so we'll likely have to wait until we can ignore IE. :/

CendioOssman avatar Sep 04 '20 07:09 CendioOssman

So I found the announcement:

https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666

In short, Internet Explorer is not getting EOL:d anytime soon. However Microsoft will not be supporting it for new web pages, instead considering it a tool for legacy sites.

So I think that is good enough for us to move forward with dropping IE support.

CendioOssman avatar Sep 07 '20 07:09 CendioOssman

So I think that is good enough for us to move forward with dropping IE support.

It will be a glorious day

samhed avatar Sep 07 '20 10:09 samhed