Switch to unix socket

This commit is contained in:
Simon Li 2019-10-02 10:52:59 +01:00
parent ae6a7a7b65
commit 788c5e9a68
No known key found for this signature in database
GPG Key ID: F604A75EB0CBF584
2 changed files with 3 additions and 5 deletions

View File

@ -42,11 +42,6 @@ RUN /opt/conda/bin/pip install https://github.com/manics/jupyter-server-proxy/ar
RUN conda install -y -q -c manics websockify=0.9.0 RUN conda install -y -q -c manics websockify=0.9.0
ADD jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py ADD jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
# There may be a discrepency between the interface vncserver listens on
# (127.0.0.1) and the interface jupyter-server-proxy connects to (localhost)
# https://bugzilla.redhat.com/show_bug.cgi?id=895582
RUN sed -i.bak s/localhost/127.0.0.1/g /opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py
WORKDIR ${HOME} WORKDIR ${HOME}
# Both these should work: # Both these should work:

View File

@ -7,6 +7,7 @@ elif os.getenv('DESKTOP_PACKAGE') == 'xfce4':
else: else:
xstartup = 'xterm' xstartup = 'xterm'
vnc_socket = os.path.join(os.getenv('HOME'), '.vnc', 'socket')
c.ServerProxy.servers = { c.ServerProxy.servers = {
'desktop': { 'desktop': {
'command': [ 'command': [
@ -15,12 +16,14 @@ c.ServerProxy.servers = {
'--web', '/opt/noVNC-1.1.0', '--web', '/opt/noVNC-1.1.0',
'--heartbeat', '30', '--heartbeat', '30',
'5901', '5901',
'--unix-target', vnc_socket,
'--', '--',
'vncserver', 'vncserver',
'-verbose', '-verbose',
'-xstartup', xstartup, '-xstartup', xstartup,
'-geometry', '1024x768', '-geometry', '1024x768',
'-SecurityTypes', 'None', '-SecurityTypes', 'None',
'-rfbunixpath', vnc_socket,
'-fg', '-fg',
':1', ':1',
], ],