From 2896efa48e053d3fc59ad9f79f121ffbb9017991 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 29 Feb 2024 08:47:21 +0100 Subject: [PATCH] Fix TigerVNC detection for non-apt installations --- jupyter_remote_desktop_proxy/setup_websockify.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jupyter_remote_desktop_proxy/setup_websockify.py b/jupyter_remote_desktop_proxy/setup_websockify.py index 474c242f..1f5a5932 100644 --- a/jupyter_remote_desktop_proxy/setup_websockify.py +++ b/jupyter_remote_desktop_proxy/setup_websockify.py @@ -21,9 +21,17 @@ def setup_websockify(): # TigerVNC provides the option to connect a Unix socket. TurboVNC does not. # TurboVNC and TigerVNC share the same origin and both use a Perl script # as the executable vncserver. We can determine if vncserver is TigerVNC - # by searching TigerVNC string in the Perl script. + # by searching tigervnc string in the Perl script. + # + # The content of the vncserver executable can differ depending on how + # TigerVNC and TurboVNC has been distributed. Below are files known to be + # read in some situations: + # + # - https://github.com/TigerVNC/tigervnc/blob/v1.13.1/unix/vncserver/vncserver.in + # - https://github.com/TurboVNC/turbovnc/blob/3.1.1/unix/vncserver.in + # with open(vncserver) as vncserver_file: - is_tigervnc = "TigerVNC" in vncserver_file.read() + is_tigervnc = "tigervnc" in vncserver_file.read().casefold() if is_tigervnc: vnc_args = [vncserver, '-rfbunixpath', sockets_path]