Skip to content

Commit b7987b7

Browse files
authored
Merge pull request #2 from FZJ-JSC/v0.3.0_devel
V0.3.0 devel
2 parents d3a6e90 + 513f9cb commit b7987b7

File tree

4 files changed

+32
-18
lines changed

4 files changed

+32
-18
lines changed

jupyter_xprahtml5_proxy/__init__.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,26 @@
77
HERE = os.path.dirname(os.path.abspath(__file__))
88

99

10-
def _xprahtml5_mappath(path):
10+
def _xprahtml5_urlparams():
1111
from getpass import getuser
1212

13-
uri_parms = '?' + '&'.join([
13+
url_params = '?' + '&'.join([
1414
'username=' + getuser(),
15-
# 'password=' + _xprahtml5_passwd,
16-
# 'encryption=AES',
17-
# 'key=' + _xprahtml5_aeskey,
18-
# 'sharing=true',
15+
'password=' + _xprahtml5_passwd,
16+
'encryption=AES',
17+
'key=' + _xprahtml5_aeskey,
18+
'sharing=true',
1919
])
2020

21+
return url_params
22+
23+
24+
def _xprahtml5_mappath(path):
25+
26+
# always pass the url parameter
2127
if path in ('/', '/index.html', ):
22-
path = '/index.html' + uri_parms
23-
logger.info('Xpra URI: ' + path)
28+
url_params = _xprahtml5_urlparams()
29+
path = '/index.html' + url_params
2430

2531
return path
2632

@@ -72,6 +78,9 @@ def _get_random_alphanumeric_string(length):
7278
logger.error("Encryption key generation in temp file FAILED")
7379
raise FileNotFoundError("Encryption key generation in temp file FAILED")
7480

81+
# launchers url file including url parameters
82+
urlfile = 'index.html' + _xprahtml5_urlparams()
83+
7584
# create command
7685
cmd = [
7786
os.path.join(HERE, 'share/launch_xpra.sh'),
@@ -81,19 +90,21 @@ def _get_random_alphanumeric_string(length):
8190
# '--socket-dir="' + socket_path + '/"', # fixme: socket_dir not recognized
8291
# '--server-idle-timeout=86400', # stop server after 24h with no client connection
8392
# '--exit-with-client=yes', # stop Xpra when the browser disconnects
84-
'--start=xterm',
93+
'--start=xterm -fa Monospace',
8594
# '--start-child=xterm', '--exit-with-children',
86-
# '--tcp-auth=file:filename=' + fpath_passwd,
87-
# '--tcp-encryption=AES',
88-
# '--tcp-encryption-keyfile=' + fpath_aeskey,
95+
'--tcp-auth=file:filename=' + fpath_passwd,
96+
'--tcp-encryption=AES',
97+
'--tcp-encryption-keyfile=' + fpath_aeskey,
8998
'--clipboard-direction=both',
99+
'--no-mdns', # do not advertise the xpra session on the local network
90100
'--no-bell',
91101
'--no-speaker',
92102
'--no-printing',
93103
'--no-microphone',
94104
'--no-notifications',
95-
# '--dpi=96',
96-
# '--sharing',
105+
'--no-systemd-run', # do not delegated start-cmd to the system wide proxy server instance
106+
# '--dpi=96', # only needed if Xserver does not support dynamic dpi change
107+
'--sharing', # this allows to open the desktop in multiple browsers at the same time
97108
'--no-daemon', # mandatory
98109
]
99110
logger.info('Xpra command: ' + ' '.join(cmd))
@@ -105,11 +116,12 @@ def _get_random_alphanumeric_string(length):
105116
'command': cmd,
106117
'mappath': _xprahtml5_mappath,
107118
'absolute_url': False,
108-
'timeout': 60,
119+
'timeout': 90,
109120
'new_browser_tab': True,
110121
'launcher_entry': {
111122
'enabled': True,
112123
'icon_path': os.path.join(HERE, 'share/xpra-logo.svg'),
113124
'title': 'Xpra Desktop',
125+
'urlfile': urlfile,
114126
},
115127
}

jupyter_xprahtml5_proxy/share/launch_xpra.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
# module load GCCcore/.9.3.0 > /dev/null
1212
# module load xpra/4.0.4-Python-3.8.5 > /dev/null
1313

14-
xpra $@
14+
xpra "$@"

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[metadata]
2+
description-file = README.md

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
with open(path.join(HERE, 'README.md'), 'r', encoding = 'utf-8') as fh:
66
long_description = fh.read()
77

8-
version='0.2.2'
8+
version='0.3.0'
99
setup(
1010
name = 'jupyter-xprahtml5-proxy',
1111
version = version,
@@ -34,7 +34,7 @@
3434
'xprahtml5 = jupyter_xprahtml5_proxy:setup_xprahtml5',
3535
]
3636
},
37-
install_requires = ['jupyter-server-proxy>=1.4.0'],
37+
install_requires = ['jupyter-server-proxy>=1.5.0'],
3838
include_package_data = True,
3939
zip_safe = False
4040
)

0 commit comments

Comments
 (0)