Revert "Add a jupyter server extension to render desktop/"
Removes the server extension, so the HTML for the interface
*is* served by websockify itself. This is a fix for
https://github.com/yuvipanda/jupyter-desktop-server/issues/10
This reverts commit 18d7fb7b2a
.
|
@ -1,3 +1 @@
|
||||||
graft jupyter_desktop_server/share
|
graft jupyter_desktop/share
|
||||||
graft jupyter_desktop_server/etc
|
|
||||||
graft jupyter_desktop_server/templates
|
|
|
@ -1,20 +1,17 @@
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import tempfile
|
import tempfile
|
||||||
from notebook.utils import url_path_join as ujoin
|
|
||||||
from tornado.web import StaticFileHandler
|
|
||||||
from .handlers import DesktopHandler
|
|
||||||
|
|
||||||
|
|
||||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
def setup_vnc():
|
def setup_desktop():
|
||||||
# make a secure temporary directory for sockets
|
# make a secure temporary directory for sockets
|
||||||
# This is only readable, writeable & searchable by our uid
|
# This is only readable, writeable & searchable by our uid
|
||||||
sockets_dir = tempfile.mkdtemp()
|
sockets_dir = tempfile.mkdtemp()
|
||||||
sockets_path = os.path.join(sockets_dir, 'vnc-socket')
|
sockets_path = os.path.join(sockets_dir, 'vnc-socket')
|
||||||
|
|
||||||
vnc_command = [
|
vnc_command = ' '.join((shlex.quote(p) for p in [
|
||||||
os.path.join(HERE, 'share/tigervnc/bin/vncserver'),
|
os.path.join(HERE, 'share/tigervnc/bin/vncserver'),
|
||||||
'-verbose',
|
'-verbose',
|
||||||
'-xstartup', os.path.join(HERE, 'share/xstartup'),
|
'-xstartup', os.path.join(HERE, 'share/xstartup'),
|
||||||
|
@ -23,7 +20,7 @@ def setup_vnc():
|
||||||
'-rfbunixpath', sockets_path,
|
'-rfbunixpath', sockets_path,
|
||||||
'-fg',
|
'-fg',
|
||||||
':1',
|
':1',
|
||||||
]
|
]))
|
||||||
return {
|
return {
|
||||||
'command': [
|
'command': [
|
||||||
'websockify', '-v',
|
'websockify', '-v',
|
||||||
|
@ -32,18 +29,10 @@ def setup_vnc():
|
||||||
'5901',
|
'5901',
|
||||||
'--unix-target', sockets_path,
|
'--unix-target', sockets_path,
|
||||||
'--',
|
'--',
|
||||||
] + vnc_command,
|
'/bin/sh', '-c',
|
||||||
|
f'cd {os.getcwd()} && {vnc_command}'
|
||||||
|
],
|
||||||
'port': 5901,
|
'port': 5901,
|
||||||
'timeout': 30,
|
'timeout': 30,
|
||||||
|
'mappath': {'/': '/vnc_lite.html'},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def load_jupyter_server_extension(nbapp):
|
|
||||||
# Set up handlers picked up via config
|
|
||||||
base_url = nbapp.web_app.settings['base_url']
|
|
||||||
|
|
||||||
web_path = os.path.join(HERE, 'share/web')
|
|
||||||
nbapp.web_app.add_handlers('.*', [
|
|
||||||
(ujoin(base_url, 'desktop-server/static/(.*)'), StaticFileHandler, {'path': web_path}),
|
|
||||||
(ujoin(base_url, 'desktop'), DesktopHandler)
|
|
||||||
])
|
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 675 B After Width: | Height: | Size: 675 B |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 1000 B After Width: | Height: | Size: 1000 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |