diff options
-rw-r--r-- | kvmd/apps/vnc/rfb/__init__.py | 14 | ||||
-rw-r--r-- | web/kvm/index.html | 3 | ||||
-rw-r--r-- | web/kvm/navbar-shortcuts.pug | 3 | ||||
-rw-r--r-- | web/share/site.webmanifest | 5 |
4 files changed, 16 insertions, 9 deletions
diff --git a/kvmd/apps/vnc/rfb/__init__.py b/kvmd/apps/vnc/rfb/__init__.py index d6cdf6d8..ac4e0354 100644 --- a/kvmd/apps/vnc/rfb/__init__.py +++ b/kvmd/apps/vnc/rfb/__init__.py @@ -255,17 +255,21 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute sec_types[1] = ("None", self.__handshake_security_none) elif self.__vnc_passwds: sec_types[2] = ("VNCAuth", self.__handshake_security_vnc_auth) + if not sec_types: msg = "The client uses a very old protocol 3.3 and VNCAuth or NoneAuth is disabled" await self._write_struct("refusing security type flag", "L", 0, drain=False) await self._write_reason("refusing security type reason", msg) raise RfbError(msg) - await self._write_struct("security types", "B" + "B" * len(sec_types), len(sec_types), *sec_types) # Keep dict priority - - sec_type = await self._read_number("selected security type", "B") - if sec_type not in sec_types: - raise RfbError(f"Invalid security type: {sec_type}") + if self.__rfb_version > 3: + await self._write_struct("security types", "B" + "B" * len(sec_types), len(sec_types), *sec_types) # Keep dict priority + sec_type = await self._read_number("selected security type", "B") + if sec_type not in sec_types: + raise RfbError(f"Invalid security type: {sec_type}") + else: + sec_type = list(sec_types.keys())[0] # First auth type from the list, None or VNCAuth + await self._write_struct("selected security type", "L", sec_type) (sec_name, handler) = sec_types[sec_type] get_logger(0).info("%s [main]: Using %s security type", self._remote, sec_name) diff --git a/web/kvm/index.html b/web/kvm/index.html index ef4a8a21..3ff0e76b 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -798,7 +798,8 @@ </div> <hr> <div class="buttons-row"> - <button data-force-hide-menu data-shortcut="ControlLeft AltLeft Delete">• Ctrl+Alt+Del</button> + <button class="row50" data-force-hide-menu data-shortcut="ControlLeft AltLeft Delete">• Ctrl+Alt+Del</button> + <button class="row50" data-force-hide-menu data-shortcut="Power">• Power</button> </div> </div> <hr> diff --git a/web/kvm/navbar-shortcuts.pug b/web/kvm/navbar-shortcuts.pug index 1a4ef7ad..378fdc09 100644 --- a/web/kvm/navbar-shortcuts.pug +++ b/web/kvm/navbar-shortcuts.pug @@ -33,7 +33,8 @@ li(id="shortcuts-dropdown" class="right") button(data-force-hide-menu data-shortcut="PrintScreen" class="row50") • Print Screen hr div(class="buttons-row") - button(data-force-hide-menu data-shortcut="ControlLeft AltLeft Delete") • Ctrl+Alt+Del + button(data-force-hide-menu data-shortcut="ControlLeft AltLeft Delete" class="row50") • Ctrl+Alt+Del + button(data-force-hide-menu data-shortcut="Power" class="row50") • Power hr div(class="text") | ↓ • Alt+SysRq+... <sup><i>linux magic diff --git a/web/share/site.webmanifest b/web/share/site.webmanifest index 849f6a89..a1f95a9a 100644 --- a/web/share/site.webmanifest +++ b/web/share/site.webmanifest @@ -1,6 +1,7 @@ { - "name": "", - "short_name": "", + "name": "PiKVM", + "short_name": "PiKVM", + "start_url": "/", "icons": [ { "src": "/share/android-chrome-192x192.png", |