novnc / noVNC

VNC client web application
https://novnc.com
Other
11.69k stars 2.32k forks source link

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

Closed arjitc closed 1 month ago

arjitc commented 6 years ago

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!

samhed commented 6 years ago

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

CendioOssman commented 6 years ago

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>
arjitc commented 6 years ago

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.

juanjoDiaz commented 5 years ago

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?

arjitc commented 5 years ago

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.

CendioOssman commented 5 years ago

Not easily right now, no.

arjitc commented 5 years ago

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 commented 4 years ago

@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? :)

CendioOssman commented 4 years ago

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 commented 4 years ago

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.

samhed commented 4 years ago

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

It will be a glorious day