novnc is present in all supported Linux distributions (RHEL6.5,
RHEL7, Fedora20, Ubuntu 14.04 and openSUSE 13.1) so instead of importing
its code into Kimchi source source structure we must add its package as
a Kimchi dependency and use it as is.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
contrib/DEBIAN/control.in | 1 +
contrib/kimchi.spec.fedora.in | 1 +
contrib/kimchi.spec.suse.in | 1 +
docs/README.md | 7 ++++---
src/kimchi/Makefile.am | 1 +
src/kimchi/config.py.in | 5 ++++-
tests/Makefile.am | 1 +
tests/test_config.py.in | 5 ++++-
ui/js/src/kimchi.api.js | 3 ++-
ui/pages/websockify/console.html | 2 +-
10 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/contrib/DEBIAN/control.in b/contrib/DEBIAN/control.in
index 2c6a819..7372a58 100644
--- a/contrib/DEBIAN/control.in
+++ b/contrib/DEBIAN/control.in
@@ -7,6 +7,7 @@ Depends: python-cherrypy3 (>= 3.2.0),
python-cheetah,
python-imaging,
websockify,
+ novnc,
python-jsonschema (>= 1.3.0),
python-libvirt,
gettext,
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index f2888b8..b56cd62 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -13,6 +13,7 @@ Requires: libvirt-python
Requires: python-cherrypy >= 3.2.0
Requires: python-cheetah
Requires: python-websockify
+Requires: novnc
Requires: m2crypto
Requires: python-imaging
Requires: libxml2-python
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index 8af9147..d812f04 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -13,6 +13,7 @@ Requires: libvirt-python
Requires: python-CherryPy >= 3.2.0
Requires: python-Cheetah
Requires: python-websockify
+Requires: novnc
Requires: python-imaging
Requires: python-M2Crypto
Requires: python-libxml2
diff --git a/docs/README.md b/docs/README.md
index 02c264f..7703037 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -55,7 +55,8 @@ Install Dependencies
python-ipaddr python-lxml nfs-utils \
iscsi-initiator-utils libxslt pyparted nginx \
policycoreutils-python python-libguestfs \
- libguestfs-tools python-requests python-websockify
+ libguestfs-tools python-requests python-websockify \
+ novnc
# If using RHEL6, install the following additional packages:
$ sudo yum install python-unittest2 python-ordereddict
# Restart libvirt to allow configuration changes to take effect
@@ -79,7 +80,7 @@ for more information on how to configure your system to access this
repository.
sosreport python-ipaddr python-lxml nfs-common \
open-iscsi lvm2 xsltproc python-parted nginx \
firewalld python-guestfs libguestfs-tools \
- python-requests websockify
+ python-requests websockify novnc
Packages version requirement:
python-jsonschema >= 1.3.0
@@ -95,7 +96,7 @@ for more information on how to configure your system to access this
repository.
python-ipaddr python-lxml nfs-client open-iscsi \
libxslt-tools python-xml python-parted nginx \
python-libguestfs guestfs-tools python-requests \
- python-websockify
+ python-websockify novnc
Packages version requirement:
python-psutil >= 0.6.0
diff --git a/src/kimchi/Makefile.am b/src/kimchi/Makefile.am
index e2b5bea..e2b5de8 100644
--- a/src/kimchi/Makefile.am
+++ b/src/kimchi/Makefile.am
@@ -38,6 +38,7 @@ uninstall-local:
do_substitution = \
sed -e 's,[@]prefix[@],$(prefix),g' \
+ -e 's,[@]datadir[@],$(datadir),g' \
-e 's,[@]sysconfdir[@],$(sysconfdir),g' \
-e 's,[@]localstatedir[@],$(localstatedir),g' \
-e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
diff --git a/src/kimchi/config.py.in b/src/kimchi/config.py.in
index 91e5f48..fcbfa3d 100644
--- a/src/kimchi/config.py.in
+++ b/src/kimchi/config.py.in
@@ -185,7 +185,10 @@ class KimchiConfig(dict):
'tools.sessions.timeout': SESSIONSTIMEOUT,
'tools.kimchiauth.on': False
},
- '/vnc_auto.html': {
+ '/novnc': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '@datadir@/novnc',
+ 'tools.nocache.on': True,
'tools.kimchiauth.on': True
},
'/spice.html': {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7f5294e..09dce6c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,6 +29,7 @@ noinst_SCRIPTS = run_tests.sh
do_substitution = \
sed -e 's,[@]HAVE_PYMOD_UNITTEST[@],$(HAVE_PYMOD_UNITTEST),g' \
-e 's,[@]prefix[@],$(prefix),g' \
+ -e 's,[@]datadir[@],$(datadir),g' \
-e 's,[@]PYTHON_VERSION[@],$(PYTHON_VERSION),g' \
-e 's,[@]kimchidir[@],$(pythondir)/kimchi,g' \
-e 's,[@]pkgdatadir[@],$(pkgdatadir),g'
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index f5bbd39..af7adc1 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -106,7 +106,10 @@ class ConfigTests(unittest.TestCase):
'tools.sessions.timeout': SESSIONSTIMEOUT,
'tools.kimchiauth.on': False
},
- '/vnc_auto.html': {
+ '/novnc': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '@datadir@/novnc',
+ 'tools.nocache.on': True,
'tools.kimchiauth.on': True
},
'/spice.html': {
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 3398bd4..f0506fa 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -353,7 +353,8 @@ var kimchi = {
dataType : "json"
}).done(function() {
url = 'https://' + location.hostname + ':' + proxy_port;
- url += "/console.html?url=vnc_auto.html&port=" +
proxy_port;
+ url += "/console.html?url=" +
encodeURIComponent("novnc/vnc_auto.html");
+ url += "&port=" + proxy_port;
/*
* From python documentation base64.urlsafe_b64encode(s)
* substitutes - instead of + and _ instead of / in the
diff --git a/ui/pages/websockify/console.html b/ui/pages/websockify/console.html
index a536e38..3be317f 100644
--- a/ui/pages/websockify/console.html
+++ b/ui/pages/websockify/console.html
@@ -14,7 +14,7 @@
query = query.replace("kimchi=" + kimchi_port, "")
var url = "https://" + location.hostname + ":" + kimchi_port
+ "/";
- url += path + query
+ url += decodeURIComponent(path) + query
window.location.replace(url)
}
--
1.9.3