[PATCH] Add apache configuration
by Cédric Bosdonnat
Provide an apache2 virtual host configuration in contrib. With this,
the user can choose to use either nginx or apache as a proxy.
The reason why the configuration has been added to contrib rather
than src/apache2 to mimic the nginx config, is that there is no distro
with the same apache2 config layout than others.
Also add Wants and After for apache2 in the systemd unit file.
Signed-off-by: Cédric Bosdonnat <cbosdonnat(a)suse.com>
---
contrib/wok.conf.apache | 34 ++++++++++++++++++++++++++++++++++
contrib/wokd.service.systemd | 2 ++
2 files changed, 36 insertions(+)
create mode 100644 contrib/wok.conf.apache
diff --git a/contrib/wok.conf.apache b/contrib/wok.conf.apache
new file mode 100644
index 00000000..c7e650ee
--- /dev/null
+++ b/contrib/wok.conf.apache
@@ -0,0 +1,34 @@
+Listen 8001
+Listen 8000
+
+<VirtualHost *:8001>
+ ErrorLog /var/log/apache2/error_log
+ TransferLog /var/log/apache2/access_log
+
+ Timeout 600
+ LimitRequestBody 4294967296
+
+ SSLEngine on
+ SSLCertificateFile /etc/wok/wok-cert.pem
+ SSLCertificateKeyFile /etc/wok/wok-key.pem
+ SSLOpenSSLConfCmd DHParameters /etc/wok/dhparams.pem
+ SSLSessionCacheTimeout 600
+
+ RewriteEngine On
+ RewriteCond %{HTTP:Upgrade} =websocket [NC]
+ RewriteRule /(.*) ws://localhost:64667/$1 [P,L]
+
+ ProxyPass /websockify http://127.0.0.1:64667/websockify
+ ProxyPassReverse /websockify http://127.0.0.1:64667/websockify
+
+ ProxyPass / http://127.0.0.1:8010/
+ ProxyPassReverse / http://127.0.0.1:8010/
+</VirtualHost>
+
+<VirtualHost *:8000>
+ ErrorLog /var/log/apache2/error_log
+ TransferLog /var/log/apache2/access_log
+
+ RewriteEngine On
+ RewriteRule ^/(.*)$ https://localhost:8001/$1 [R]
+</VirtualHost>
diff --git a/contrib/wokd.service.systemd b/contrib/wokd.service.systemd
index 621be601..eba80a9d 100644
--- a/contrib/wokd.service.systemd
+++ b/contrib/wokd.service.systemd
@@ -3,6 +3,8 @@ Description=Wok - Webserver Originated from Kimchi
Documentation=https://github.com/kimchi-project/wok/wiki
Wants=nginx.service
After=nginx.service
+Wants=apache2.service
+After=apache2.service
[Service]
Type=simple
--
2.12.0
7 years, 8 months
[PATCH] [Wok] python-mock not listed as dependency
by Ramon Medeiros
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
docs/fedora-deps.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/fedora-deps.md b/docs/fedora-deps.md
index 29b477f..484f409 100644
--- a/docs/fedora-deps.md
+++ b/docs/fedora-deps.md
@@ -42,7 +42,7 @@ Packages required for UI development
Packages required for tests
---------------------------
- $ sudo yum install pyflakes python-pep8 python-requests rpmlint
+ $ sudo yum install pyflakes python-pep8 python-requests rpmlint python-mock
# For RHEL systems, install the additional packages:
$ sudo yum install python-unittest2
--
2.9.3
7 years, 8 months
Wok 2.4 and Kimchi 2.4 are now released!
by Aline Manera
On behalf of everyone who has worked hard on this release, I am pleased
to announce the availability of *Wok 2.4* and *Kimchi 2.4*!
Kimchi 2.4 depends on *Wok 2.4* and *Ginger Base 2.3*! So make
sure to have both of them properly installed in your system.
Among many features,
Wok 2.4 release includes:
✔ Plugins management
✔ Block authentication request after too many failures
✔ Asynchronous UI notification using Websockets
✔ Bug fixes
Kimchi 2.4 release includes:
✔ Initial s390x systems support
✔ Guest CPU hot plug and unplug
✔ Live migration over RDMA
✔ Live snapshot support
✔ Bug fixes
We have worked hard to ensure that Wok and Kimchi run well on the most
popular Linux distributions including: Fedora 25, Ubuntu 16.10,
openSUSE LEAP 42.2, and CentOS 7. They use standard Linux interfaces so
it should run well on many other distributions too.
You can easily grab this release in tarball format or via git:
✔ https://github.com/kimchi-project/wok/archive/2.4.0.tar.gz
✔ https://github.com/kimchi-project/kimchi/archive/2.4.0.tar.gz
✔ git clone -b stable-2.4.x --recursivehttps://github.com/kimchi-project/wok.git
There are also some packages available for download at:
✔http://kimchi-project.github.io/wok/downloads/
✔http://kimchi-project.github.io/kimchi/downloads/
Go ahead! Give it a try and let us know what you think!
Regards,
Aline Manera
7 years, 8 months
[PATCH v2] [Wok] python-mock not listed as dependency
by Ramon Medeiros
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
Changes:
v2:
do it for all distros
docs/fedora-deps.md | 2 +-
docs/opensuse-deps.md | 1 +
docs/ubuntu-deps.md | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/docs/fedora-deps.md b/docs/fedora-deps.md
index 29b477f..484f409 100644
--- a/docs/fedora-deps.md
+++ b/docs/fedora-deps.md
@@ -42,7 +42,7 @@ Packages required for UI development
Packages required for tests
---------------------------
- $ sudo yum install pyflakes python-pep8 python-requests rpmlint
+ $ sudo yum install pyflakes python-pep8 python-requests rpmlint python-mock
# For RHEL systems, install the additional packages:
$ sudo yum install python-unittest2
diff --git a/docs/opensuse-deps.md b/docs/opensuse-deps.md
index a6086da..eee39f9 100644
--- a/docs/opensuse-deps.md
+++ b/docs/opensuse-deps.md
@@ -31,3 +31,4 @@ Packages required for tests
---------------------------
$ sudo zypper install python-pyflakes python-pep8 python-requests rpmlint
+ python-mock
diff --git a/docs/ubuntu-deps.md b/docs/ubuntu-deps.md
index cdffc59..3607998 100644
--- a/docs/ubuntu-deps.md
+++ b/docs/ubuntu-deps.md
@@ -30,4 +30,4 @@ Packages required for UI development
Packages required for tests
---------------------------
- $ sudo apt-get install pep8 pyflakes python-requests
+ $ sudo apt-get install pep8 pyflakes python-requests python-mock
--
2.9.3
7 years, 9 months
[PATCH] [WoK] Bug fix #205: adding 'user-log.dita' help page
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
Added a new help page 'user-log.dita' with User Log help information.
Changed 'settings.dita' to reflect the contents of the Settings tab.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
ui/pages/help/en_US/settings.dita | 10 ++++------
ui/pages/help/en_US/user-log.dita | 42 +++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 6 deletions(-)
create mode 100644 ui/pages/help/en_US/user-log.dita
diff --git a/ui/pages/help/en_US/settings.dita b/ui/pages/help/en_US/settings.dita
index bebac17..9144697 100644
--- a/ui/pages/help/en_US/settings.dita
+++ b/ui/pages/help/en_US/settings.dita
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Project Wok
-Copyright IBM Corp, 2016
+Copyright IBM Corp, 2017
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -30,11 +30,9 @@ https://w3.opensource.ibm.com/projects/dita-cshelp/-->
<title>Settings</title>
<csbody>
<dl><dlentry>
-<dt>User Activity Log</dt>
-<dd>This section displays user activity log of Wok and its plugins.</dd>
-<dd>To get any specific log result, please use the 'Advanced Search' option. You can specify a particular application (such as wok, ginger, gingerbase, gingers390x, kimchi), an user, request type or even date range.</dd>
-<dd>Select "Reset to Default" option to clear the search criteria.</dd>
-<dd>Download: Use this option to download user activity log.</dd>
+<dt>Plugins Management</dt>
+<dd>This section displays the current plug-in status of WoK..</dd>
+<dd>In the 'Status' column it is possible to enable or disable a specific plug-in. Enabling a plug-in will enable all its dependencies (example: enabling Kimchi will enable Gingerbase as well). Likewise, disabling a plug-in will disable all plug-ins that depends on the now disabled plug-in (example: disabling Gingerbase will disable Kimchi and Ginger).</dd>
</dlentry>
</dl><?Pub Caret 2101?>
</csbody>
diff --git a/ui/pages/help/en_US/user-log.dita b/ui/pages/help/en_US/user-log.dita
new file mode 100644
index 0000000..a06136b
--- /dev/null
+++ b/ui/pages/help/en_US/user-log.dita
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Project Wok
+Copyright IBM Corp, 2017
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+-->
+<!--Arbortext, Inc., 1988-2011, v.4002-->
+<!DOCTYPE cshelp PUBLIC "-//IBM//DTD DITA CSHelp//EN"
+ "..\dtd\cshelp.dtd">
+<?Pub Sty _display FontColor="red"?>
+<?Pub Inc?>
+<!--This DITA specialized document type is not supported by the Authoring Tools development team.
+Press the F1 key for online help on the tags and see the DITA XML Guide and Reference for how to use this document type.
+For support please see:
+https://w3.opensource.ibm.com/projects/dita-cshelp/-->
+<cshelp id="settings" xml:lang="en-us">
+<title>Activity Log</title>
+<csbody>
+<dl><dlentry>
+<dt>User Activity Log</dt>
+<dd>This section displays user activity log of Wok and its plugins.</dd>
+<dd>To get any specific log result, please use the 'Advanced Search' option. You can specify a particular application (such as wok, ginger, gingerbase, gingers390x, kimchi), an user, request type or even date range.</dd>
+<dd>Select "Reset to Default" option to clear the search criteria.</dd>
+<dd>Download: Use this option to download user activity log.</dd>
+</dlentry>
+</dl><?Pub Caret 2101?>
+</csbody>
+</cshelp>
+<?Pub *0000003732?>
--
2.9.3
7 years, 9 months
[PATCH] [Kimchi] Bug fix: Set original VLAN device to network parameters to be updated
by Aline Manera
It is part of the #1087 fix
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
model/networks.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/model/networks.py b/model/networks.py
index eb1590e..ce93bb1 100644
--- a/model/networks.py
+++ b/model/networks.py
@@ -532,6 +532,9 @@ class NetworkModel(object):
if params.get('vlan_id') or params.get('interfaces'):
raise InvalidParameter("KCHNET0032E")
+ # merge parameters
+ info.update(params)
+
# get target device if bridge was created by Kimchi
if connection == 'bridge':
iface = info['interfaces'][0]
@@ -544,18 +547,13 @@ class NetworkModel(object):
else:
info['interfaces'] = original['interfaces'] = [port]
- # merge parameters
- info.update(params)
-
# delete original network
self.delete(name)
try:
# create new network
- network = self.collection.create(info)
+ return self.collection.create(info)
except:
# restore original network
self.collection.create(original)
raise
-
- return network
--
2.9.3
7 years, 9 months
[PATCH] [Kimchi] Bug fix: Inform user there is no interface available when creating a network
by Aline Manera
When there is no interface available, the user will not be able to
create some networks so inform that to user using the existing drop down
menu instead of a label message fixed in the dialog (which was displayed
even though for network not requiring an interface).
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.network_add_main.js | 7 +++----
ui/pages/network-add.html.tmpl | 7 ++-----
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/ui/js/src/kimchi.network_add_main.js b/ui/js/src/kimchi.network_add_main.js
index e1fdf13..c990e89 100644
--- a/ui/js/src/kimchi.network_add_main.js
+++ b/ui/js/src/kimchi.network_add_main.js
@@ -1,7 +1,7 @@
/*
* Project Kimchi
*
- * Copyright IBM Corp, 2015-2016
+ * Copyright IBM Corp, 2015-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -79,9 +79,8 @@ kimchi.setDefaultNetworkType = function(isInterfaceAvail, bEdit) {
if (!bEdit) {
kimchi.enableBridgeOptions(false);
}
- $("#networkBriDisabledLabel").removeClass('hidden');
- } else {
- $("#networkBriDisabledLabel").remove();
+ $("#destinationList button").addClass("disabled");
+ $("#networkDestinationID").attr("title", "No interface available");
}
};
diff --git a/ui/pages/network-add.html.tmpl b/ui/pages/network-add.html.tmpl
index 14373ff..47be6f3 100644
--- a/ui/pages/network-add.html.tmpl
+++ b/ui/pages/network-add.html.tmpl
@@ -1,7 +1,7 @@
#*
* Project Kimchi
*
- * Copyright IBM Corp, 2015-2016
+ * Copyright IBM Corp, 2015-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,11 +46,8 @@
<option value="bridge">$_("Bridged: Virtual machines are connected through a network bridge")</option>
</select>
</div>
- <div id="networkBriDisabledLabel" class="form-group hidden">
- <p>$_("(No interfaces found)")</p>
- </div>
<div id="bridgedContent">
- <div class="form-group">
+ <div id="destinationList" class="form-group">
<label for="networkDestinationID">$_("Destination"): </label>
<select id="networkDestinationID" data-size="5" class="selectpicker col-md-12 col-lg-12 form-control" data-none-selected-text="$_('Select an Interface')">
</select>
--
2.9.3
7 years, 9 months
[PATCH] [Kimchi] Bug fix 1119: Proper check NetworkManager is running when creating new network
by Aline Manera
It was relying on Capabilities to verify NetworkManager was running or
not. But the Capabilities value is only updated on lookup() which was
leading on a wrong assumption.
To fix that, call FeatureTests function directly.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
model/networks.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/model/networks.py b/model/networks.py
index eb1590e..b653b23 100644
--- a/model/networks.py
+++ b/model/networks.py
@@ -33,7 +33,7 @@ from wok.plugins.gingerbase.netinfo import get_vlan_device, is_bridge, is_vlan
from wok.plugins.gingerbase.netinfo import ports
from wok.plugins.kimchi import network as knetwork
from wok.plugins.kimchi.config import kimchiPaths
-from wok.plugins.kimchi.model.config import CapabilitiesModel
+from wok.plugins.kimchi.model.featuretests import FeatureTests
from wok.plugins.kimchi.osinfo import defaults as tmpl_defaults
from wok.plugins.kimchi.xmlutils.interface import get_iface_xml
from wok.plugins.kimchi.xmlutils.network import create_linux_bridge_xml
@@ -52,8 +52,6 @@ class NetworksModel(object):
if self.conn.isQemuURI():
self._check_default_networks()
- self.caps = CapabilitiesModel(**kargs)
-
def _check_default_networks(self):
networks = list(set(tmpl_defaults.get('networks', [])))
@@ -228,7 +226,7 @@ class NetworksModel(object):
# connection == macvtap and iface is not bridge
elif netinfo.is_bare_nic(iface) or netinfo.is_bonding(iface):
# libvirt bridge creation will fail with NetworkManager enabled
- if self.caps.nm_running:
+ if FeatureTests.is_nm_running():
raise InvalidParameter('KCHNET0027E')
if 'vlan_id' in params:
--
2.9.3
7 years, 9 months
[PATCH] [WoK] Removing sessionStorage call in wok.main.js
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
sessionStorage was being used in early versions of the websocket
notifications implementation to avoid opening multiple connections,
before the current single permanent connection approach was
implemented. If the 'wokNotificationWebSocket' key existed in the
sessionStorage, we skipped the opening of a new websocket.
This patch removes the sessionStorage usage because it accomplishes
nothing in current code. No verification is made using the created
'wokNotificationWebSocket' session key in the code.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
ui/js/src/wok.main.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js
index 26dc723..411b05e 100644
--- a/ui/js/src/wok.main.js
+++ b/ui/js/src/wok.main.js
@@ -69,7 +69,6 @@ wok.startNotificationWebSocket = function () {
}
};
- sessionStorage.setItem('wokNotificationWebSocket', 'true');
var heartbeat = setInterval(function() {
wok.notificationsWebSocket.send(window.btoa('heartbeat'));
}, 30000);
--
2.9.3
7 years, 9 months
[PATCH] [WoK] Bug fix #189: Forcing download of user log file
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
The error in staticfile() happens when the browser tries to open
a recently created file in a separated tab/window but this file
isn't declared in the cherry-py config with tools.staticfile.on,
like '/favicon.ico' for example.
A suitable solution to avoid the error is to force the browser to
download the file instead of opening it. According to the Cherry-py
docs:
"Using "application/x-download" response content-type, you can
tell a browser that a resource should be downloaded onto the
user’s machine rather than displayed."
This patch set the application type of all '.txt' files created
under the /data/logs dir as 'application/x-download'.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
src/wok/config.py.in | 3 +++
tests/test_config.py.in | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index 677d0ed..c2bcc28 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -202,6 +202,9 @@ class WokConfig(dict):
'/data/logs': {
'tools.staticdir.on': True,
'tools.staticdir.dir': '%s/logs' % paths.state_dir,
+ 'tools.staticdir.content_types': {
+ 'txt': 'application/x-download'
+ },
'tools.nocache.on': False,
'tools.wokauth.on': True,
},
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index 9b8c851..a4d65bb 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -1,7 +1,7 @@
#
# Project Wok
#
-# Copyright IBM Corp, 2014-2016
+# Copyright IBM Corp, 2014-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -84,6 +84,9 @@ class ConfigTests(unittest.TestCase):
'/data/logs': {
'tools.staticdir.on': True,
'tools.staticdir.dir': '%s/logs' % paths.state_dir,
+ 'tools.staticdir.content_types': {
+ 'txt': 'application/x-download'
+ },
'tools.nocache.on': False,
'tools.wokauth.on': True,
},
--
2.9.3
7 years, 9 months