View | Details | Raw Unified | Return to bug 50494
Collapse All | Expand All

(-)virtualization/univention-novnc/univention-novnc (-41 lines)
 Lines 1-41    Link Here 
1
#!/bin/sh
2
#
3
# univention-novnc
4
# wrapper script to execute websockify
5
#
6
# Copyright 2019 Univention GmbH
7
#
8
# https://www.univention.de/
9
#
10
# All rights reserved.
11
#
12
# The source code of this program is made available
13
# under the terms of the GNU Affero General Public License version 3
14
# (GNU AGPL V3) as published by the Free Software Foundation.
15
#
16
# Binary versions of this program provided by Univention to you as
17
# well as other copyrighted, protected or trademarked materials like
18
# Logos, graphics, fonts, specific documentations and configurations,
19
# cryptographic keys etc. are subject to a license agreement between
20
# you and Univention and not subject to the GNU AGPL V3.
21
#
22
# In the case you use this program under the terms of the GNU AGPL V3,
23
# the program is provided in the hope that it will be useful,
24
# but WITHOUT ANY WARRANTY; without even the implied warranty of
25
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
# GNU Affero General Public License for more details.
27
#
28
# You should have received a copy of the GNU Affero General Public
29
# License with the Debian GNU/Linux or Univention distribution in file
30
# /usr/share/common-licenses/AGPL-3; if not, see
31
# <https://www.gnu.org/licenses/>.
32
33
DAEMON_ARGS=""
34
HOSTNAME="$(hostname)"
35
if [ -r "/etc/univention/ssl/$HOSTNAME/cert.pem" ] && [ -r "/etc/univention/ssl/$HOSTNAME/private.key" ]
36
then
37
	DAEMON_ARGS="$DAEMON_ARGS --cert /etc/univention/ssl/$HOSTNAME/cert.pem"
38
	DAEMON_ARGS="$DAEMON_ARGS --key /etc/univention/ssl/$HOSTNAME/private.key"
39
fi
40
41
exec /usr/bin/python3-websockify $DAEMON_ARGS "$@"
(-)virtualization/univention-novnc/univention-novnc.conf (-7 / +1 lines)
 Lines 1-7    Link Here 
1
<IfModule alias_module>
1
Alias /novnc /usr/share/novnc
2
	RewriteEngine On
3
	RewriteCond %{HTTPS} !=on
4
	RewriteRule ^/univention-novnc/?(.*) http://%{SERVER_NAME}:6080/$1 [R,L]
5
	RewriteCond %{HTTPS} =on
6
	RewriteRule ^/univention-novnc/?(.*) https://%{SERVER_NAME}:6080/$1 [R,L]
7
</IfModule>
(-)virtualization/univention-virtual-machine-manager-daemon/umc/js/uvmm.js (-4 / +1 lines)
 Lines 452-462   define([ Link Here 
452
452
453
		vncLink: function( ids, items ) {
453
		vncLink: function( ids, items ) {
454
			array.forEach(items, function(item) {
454
			array.forEach(items, function(item) {
455
				var id = item.id;
456
				var uuid = encodeURIComponent(id.slice(id.indexOf('#') + 1));
457
				var port = window.location.port ? ':' + window.location.port : '';
458
				var title = encodeURIComponent(item.label + '@' + item.nodeName);
455
				var title = encodeURIComponent(item.label + '@' + item.nodeName);
459
				var url = window.location.protocol + '//' + window.location.host + port + '/univention-novnc/vnc_auto.html?port=6080&path=?token=' + uuid + '&title=' + title;
456
				var url = '/novnc/vnc_auto.html?port=' + encodeURIComponent(item.websocket_port) + '&host=' + encodeURIComponent(item.websocket_host) + '&title=' + title;
460
				window.open(url, '_blank');
457
				window.open(url, '_blank');
461
			});
458
			});
462
		},
459
		},

Return to bug 50494