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.
This commit is contained in:
YuviPanda 2019-11-19 16:58:28 -08:00
parent 18d7fb7b2a
commit b6dee24cff
245 changed files with 14 additions and 62 deletions

View File

@ -1,3 +1 @@
graft jupyter_desktop_server/share
graft jupyter_desktop_server/etc
graft jupyter_desktop_server/templates
graft jupyter_desktop/share

View File

@ -1,20 +1,17 @@
import os
import shlex
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__))
def setup_vnc():
def setup_desktop():
# make a secure temporary directory for sockets
# This is only readable, writeable & searchable by our uid
sockets_dir = tempfile.mkdtemp()
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'),
'-verbose',
'-xstartup', os.path.join(HERE, 'share/xstartup'),
@ -23,7 +20,7 @@ def setup_vnc():
'-rfbunixpath', sockets_path,
'-fg',
':1',
]
]))
return {
'command': [
'websockify', '-v',
@ -32,18 +29,10 @@ def setup_vnc():
'5901',
'--unix-target', sockets_path,
'--',
] + vnc_command,
'/bin/sh', '-c',
f'cd {os.getcwd()} && {vnc_command}'
],
'port': 5901,
'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)
])

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Some files were not shown because too many files have changed in this diff Show More