Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 24, 2023
1 parent 9e3daca commit 9aced4c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 28 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
graft jupyter_remote_desktop_proxy/share
graft jupyter_remote_desktop_proxy/share
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Jupyter Remote Desktop Proxy

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterhub/jupyter-remote-desktop-proxy/HEAD?urlpath=desktop)

Run XFCE (or other desktop environments) on Jupyter.
Expand Down
55 changes: 32 additions & 23 deletions jupyter_remote_desktop_proxy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os
import shlex
from shutil import which
import tempfile

from shutil import which

HERE = os.path.dirname(os.path.abspath(__file__))


def setup_desktop():
# make a secure temporary directory for sockets
# This is only readable, writeable & searchable by our uid
Expand All @@ -22,33 +22,42 @@ def setup_desktop():
# Use bundled tigervnc
vnc_args = [
os.path.join(HERE, 'share/tigervnc/bin/vncserver'),
'-rfbunixpath', sockets_path,
]
socket_args = [
'--unix-target', sockets_path
'-rfbunixpath',
sockets_path,
]
socket_args = ['--unix-target', sockets_path]

vnc_command = ' '.join(shlex.quote(p) for p in (vnc_args + [
'-verbose',
'-xstartup', os.path.join(HERE, 'share/xstartup'),
'-geometry', '1680x1050',
'-SecurityTypes', 'None',
'-fg',
':1',
]))
vnc_command = ' '.join(
shlex.quote(p)
for p in (
vnc_args
+ [
'-verbose',
'-xstartup',
os.path.join(HERE, 'share/xstartup'),
'-geometry',
'1680x1050',
'-SecurityTypes',
'None',
'-fg',
':1',
]
)
)
return {
'command': [
'websockify', '-v',
'--web', os.path.join(HERE, 'share/web/noVNC-1.2.0'),
'--heartbeat', '30',
'websockify',
'-v',
'--web',
os.path.join(HERE, 'share/web/noVNC-1.2.0'),
'--heartbeat',
'30',
'5901',
] + socket_args + [
'--',
'/bin/sh', '-c',
f'cd {os.getcwd()} && {vnc_command}'
],
]
+ socket_args
+ ['--', '/bin/sh', '-c', f'cd {os.getcwd()} && {vnc_command}'],
'port': 5901,
'timeout': 30,
'mappath': {'/': '/vnc_lite.html'},
'new_browser_window': True
'new_browser_window': True,
}
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from setuptools import setup, find_packages

from setuptools import find_packages, setup

with open("README.md") as f:
readme = f.read()
Expand Down Expand Up @@ -40,5 +39,5 @@
},
python_requires=">=3.6",
url="https://jupyter.org",
zip_safe=False
zip_safe=False,
)

0 comments on commit 9aced4c

Please sign in to comment.