1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-04-05 21:15:25 +00:00

Compare commits

...

8 commits

Author SHA1 Message Date
catborise
9977c650db
Merge pull request #484 from catborise/master
updates & fixes 1
2022-01-12 13:41:10 +03:00
catborise
3d4c0aa5ef remove nl locales 2022-01-12 13:38:58 +03:00
catborise
79aeb3e23f update requirements 2022-01-12 12:32:17 +03:00
catborise
e0767f4145 update IPy.py to handle python3.10 and update readme 2022-01-12 12:29:49 +03:00
catborise
9e832c2612 add ldap3 explanations for errors 2021-12-23 12:32:36 +03:00
catborise
13f332c9a5 fix migrate logs to show source and destination hosts correctly 2021-12-22 11:27:32 +03:00
catborise
e6f7588593 update locale tr, fix commit errors 2021-12-20 11:00:02 +03:00
catborise
6c3d716b5a update docker ubuntu base image 2021-12-20 09:52:19 +03:00
20 changed files with 15412 additions and 15050 deletions

View file

@ -1,4 +1,4 @@
FROM phusion/baseimage:focal-1.0.0
FROM phusion/baseimage:focal-1.1.0
EXPOSE 80
EXPOSE 6080

View file

@ -32,7 +32,7 @@ WebVirtCloud is a virtualization web interface for admins and users. It can dele
## Quick Install with Installer (Beta)
Install an OS and run specified commands. Installer supported OSes: Ubuntu 18.04, Debian 10, Centos/OEL/RHEL 8.
Install an OS and run specified commands. Installer supported OSes: Ubuntu 18.04/20.04, Debian 10/11, Centos/OEL/RHEL 8.
It can be installed on a virtual machine, physical host or on a KVM host.
```bash

View file

@ -1,4 +1,4 @@
Django==3.2.10
Django==3.2.11
django_bootstrap5==21.2
django-icons==21.1
django-login-required-middleware==0.7

View file

@ -4,4 +4,4 @@ django-debug-toolbar==3.2.4
pycodestyle==2.8.0
pyflakes==2.4.0
pylint==2.12.2
yapf==0.31.0
yapf==0.32.0

View file

@ -342,15 +342,17 @@ def migrate(request, pk):
compress = request.POST.get("compress", False)
postcopy = request.POST.get("postcopy", False)
new_compute = Compute.objects.get(id=compute_id)
current_host = instance.compute.hostname
target_host = Compute.objects.get(id=compute_id)
try:
utils.migrate_instance(new_compute, instance, request.user, live, unsafe, xml_del, offline)
utils.migrate_instance(target_host, instance, request.user, live, unsafe, xml_del, offline)
except libvirtError as err:
messages.error(request, err)
msg = _("Instance is migrated to %(hostname)s") % {"hostname": new_compute.hostname}
addlogmsg(request.user.username, instance.compute.hostname, instance.name, msg)
migration_method = "live" if live is True else "offline"
msg = _("Instance is migrated(%(method)s) to %(hostname)s") % {"hostname": target_host.hostname, "method": migration_method}
addlogmsg(request.user.username, current_host, instance.name, msg)
return redirect(request.META.get("HTTP_REFERER"))

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -12,14 +12,13 @@ try:
class LdapAuthenticationBackend(ModelBackend):
def get_LDAP_user(self, username, password, filterString):
print('get_LDAP_user')
print('get_LDAP_user {}'.format(username))
try:
server = Server(settings.LDAP_URL, port=settings.LDAP_PORT,
use_ssl=settings.USE_SSL,get_info=ALL)
connection = Connection(server,
settings.LDAP_MASTER_DN,
settings.LDAP_MASTER_PW, auto_bind=True)
connection.search(settings.LDAP_ROOT_DN,
'(&({attr}={login})({filter}))'.format(
attr=settings.LDAP_USER_UID_PREFIX,
@ -31,11 +30,10 @@ try:
return None
specificUser = connection.response[0]
userDn = str(specificUser.get('raw_dn'),'utf-8')
with Connection(server,
userDn,
password) as con:
with Connection(server, userDn, password) as con:
return username
except:
except Exception as e:
print("LDAP Exception: {}".format(e))
return None
return None
@ -50,6 +48,7 @@ try:
if self.get_LDAP_user(username, password, settings.LDAP_SEARCH_GROUP_FILTER_ADMINS) is None:
if self.get_LDAP_user(username, password, settings.LDAP_SEARCH_GROUP_FILTER_STAFF) is None:
if self.get_LDAP_user(username, password, settings.LDAP_SEARCH_GROUP_FILTER_USERS) is None:
print("User does not belong to any search group. Check LDAP_SEARCH_GROUP_FILTER in settings.")
return None
else:
isStaff = True
@ -62,7 +61,7 @@ try:
attributes = UserAttributes.objects.get(user=user)
# TODO VERIFY
except User.DoesNotExist:
print("authenticate-create new user")
print("authenticate-create new user: {}".format(username))
user = User(username=username)
user.is_active = True
user.is_staff = isStaff

View file

@ -268,6 +268,7 @@ LDAP_MASTER_PW = ''
LDAP_ROOT_DN = ''
## Queries to identify the users, i use groupOfUniqueNames on openldap
### PLEASE BE SURE memberOf overlay is activated on slapd
## e.g. memberOf=cn=admins,cn=staff,cn=webvirtcloud,ou=groups,dc=kendar,dc=org
LDAP_SEARCH_GROUP_FILTER_ADMINS = ''
## e.g. memberOf=cn=staff,cn=webvirtcloud,ou=groups,dc=kendar,dc=org