1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

Merge remote-tracking branch 'retspen/master'

This commit is contained in:
Ing. Jan KRCMAR 2018-06-13 11:03:04 +02:00
commit 5f24d5d222
9 changed files with 40 additions and 16 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
.vagrant .vagrant
venv venv
.vscode
.idea .idea
.DS_* .DS_*
*.pyc *.pyc

View file

@ -1,6 +1,5 @@
Django==1.8.11 Django==1.8.11
websockify==0.8.0 websockify==0.8.0
gunicorn==19.3.0 gunicorn==19.3.0
libvirt-python==1.3.2 libvirt-python==3.10
#http://github.com/retspen/retspen.github.io/raw/master/libxml2-python-2.9.1.tar.gz libxml2-python3==2.9.5
http://git.gnome.org/browse/libxml2/snapshot/libxml2-2.9.1.tar.gz#egg=libxml2-python&subdirectory=python

View file

@ -121,6 +121,9 @@
function log_info(msg) { function log_info(msg) {
log_message(msg,'info'); log_message(msg,'info');
} }
{% if console_error %}
log_error('{{ console_error|escapejs }}');
{% endif %}
</script> </script>
{% block foot %}{% endblock %} {% block foot %}{% endblock %}

View file

@ -16,6 +16,7 @@ def console(request):
:param request: :param request:
:return: :return:
""" """
console_error = None
if request.method == 'GET': if request.method == 'GET':
token = request.GET.get('token', '') token = request.GET.get('token', '')
@ -49,7 +50,8 @@ def console(request):
elif console_type == 'spice': elif console_type == 'spice':
response = render(request, 'console-spice.html', locals()) response = render(request, 'console-spice.html', locals())
else: else:
response = "Console type %s no support" % console_type console_error = "Console type: %s no support" % console_type
response = render(request, 'console-vnc.html', locals())
response.set_cookie('token', token) response.set_cookie('token', token)
return response return response

View file

@ -375,7 +375,7 @@ __check_end_of_life_versions
# #
install_centos() { install_centos() {
if [ $DISTRO_MAJOR_VERSION -ge 6 ]; then if [ $DISTRO_MAJOR_VERSION -ge 6 ]; then
yum -y install qemu-kvm libvirt bridge-utils python-libguestfs supervisor || return 1 yum -y install qemu-kvm libvirt bridge-utils python-libguestfs supervisor cyrus-sasl-md5 || return 1
fi fi
return 0 return 0
} }
@ -401,6 +401,13 @@ install_centos_post() {
echoerror "/etc/libvirt/qemu.conf not found. Exiting..." echoerror "/etc/libvirt/qemu.conf not found. Exiting..."
exit 1 exit 1
fi fi
if [ -f /etc/sasl2/libvirt.conf ]; then
sed -i 's/: gssapi/: digest-md5/g' /etc/sasl2/libvirt.conf
sed -i 's/#sasldb_path/sasldb_path/g' /etc/sasl2/libvirt.conf
else
echoerror "/etc/sasl2/libvirt.conf not found. Exiting..."
exit 1
fi
if [ $DISTRO_MAJOR_VERSION -lt 7 ]; then if [ $DISTRO_MAJOR_VERSION -lt 7 ]; then
if [ -f /etc/supervisord.conf ]; then if [ -f /etc/supervisord.conf ]; then
curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd > /usr/local/bin/gstfsd curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd > /usr/local/bin/gstfsd

View file

@ -66,7 +66,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{% trans "Name" %}</label> <label class="col-sm-3 control-label">{% trans "Name" %}</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control" name="name" placeholder="default" maxlength="20" required pattern="[a-zA-Z0-9\.\-\_]+"> <input type="text" class="form-control" name="name" placeholder="default" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -217,7 +217,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{% trans "Path" %}</label> <label class="col-sm-3 control-label">{% trans "Path" %}</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control" name="target" value="/var/www/webvirtmgr/images" required pattern="[a-zA-Z0-9\/\-\_]+"> <input type="text" class="form-control" name="target" value="/var/www/webvirtmgr/images" required pattern="[a-zA-Z0-9\/\-_]+">
</div> </div>
</div> </div>
</div> </div>
@ -235,4 +235,4 @@
</div> <!-- /.modal-content --> </div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog --> </div> <!-- /.modal-dialog -->
</div> <!-- /.modal --> </div> <!-- /.modal -->
{% endif %} {% endif %}

View file

@ -8,9 +8,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = '' SECRET_KEY = ''
DEBUG = True DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
@ -45,7 +43,7 @@ MIDDLEWARE_CLASSES = (
) )
AUTHENTICATION_BACKENDS = ( AUTHENTICATION_BACKENDS = (
#'django.contrib.auth.backends.RemoteUserBackend', 'django.contrib.auth.backends.ModelBackend',
#'accounts.backends.MyRemoteUserBackend', #'accounts.backends.MyRemoteUserBackend',
) )

View file

@ -7,10 +7,7 @@ For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
""" """
execfile('/srv/webvirtcloud/venv/bin/activate_this.py', dict(__file__='/srv/webvirtcloud/venv/bin/activate_this.py')) import os
import os, sys
sys.path.append('/srv/webvirtcloud')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webvirtcloud.settings") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webvirtcloud.settings")
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application

View file

@ -0,0 +1,17 @@
"""
WSGI config for webvirtcloud project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
execfile('/srv/webvirtcloud/venv/bin/activate_this.py', dict(__file__='/srv/webvirtcloud/venv/bin/activate_this.py'))
import os, sys
sys.path.append('/srv/webvirtcloud')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webvirtcloud.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()