7
7
HERE = os .path .dirname (os .path .abspath (__file__ ))
8
8
9
9
10
- def _xprahtml5_mappath ( path ):
10
+ def _xprahtml5_urlparams ( ):
11
11
from getpass import getuser
12
12
13
- uri_parms = '?' + '&' .join ([
13
+ url_params = '?' + '&' .join ([
14
14
'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' ,
19
19
])
20
20
21
+ return url_params
22
+
23
+
24
+ def _xprahtml5_mappath (path ):
25
+
26
+ # always pass the url parameter
21
27
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
24
30
25
31
return path
26
32
@@ -72,6 +78,9 @@ def _get_random_alphanumeric_string(length):
72
78
logger .error ("Encryption key generation in temp file FAILED" )
73
79
raise FileNotFoundError ("Encryption key generation in temp file FAILED" )
74
80
81
+ # launchers url file including url parameters
82
+ urlfile = 'index.html' + _xprahtml5_urlparams ()
83
+
75
84
# create command
76
85
cmd = [
77
86
os .path .join (HERE , 'share/launch_xpra.sh' ),
@@ -81,19 +90,21 @@ def _get_random_alphanumeric_string(length):
81
90
# '--socket-dir="' + socket_path + '/"', # fixme: socket_dir not recognized
82
91
# '--server-idle-timeout=86400', # stop server after 24h with no client connection
83
92
# '--exit-with-client=yes', # stop Xpra when the browser disconnects
84
- '--start=xterm' ,
93
+ '--start=xterm -fa Monospace ' ,
85
94
# '--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 ,
89
98
'--clipboard-direction=both' ,
99
+ '--no-mdns' , # do not advertise the xpra session on the local network
90
100
'--no-bell' ,
91
101
'--no-speaker' ,
92
102
'--no-printing' ,
93
103
'--no-microphone' ,
94
104
'--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
97
108
'--no-daemon' , # mandatory
98
109
]
99
110
logger .info ('Xpra command: ' + ' ' .join (cmd ))
@@ -105,11 +116,12 @@ def _get_random_alphanumeric_string(length):
105
116
'command' : cmd ,
106
117
'mappath' : _xprahtml5_mappath ,
107
118
'absolute_url' : False ,
108
- 'timeout' : 60 ,
119
+ 'timeout' : 90 ,
109
120
'new_browser_tab' : True ,
110
121
'launcher_entry' : {
111
122
'enabled' : True ,
112
123
'icon_path' : os .path .join (HERE , 'share/xpra-logo.svg' ),
113
124
'title' : 'Xpra Desktop' ,
125
+ 'urlfile' : urlfile ,
114
126
},
115
127
}
0 commit comments