diff --git a/.gitignore b/.gitignore index 97ac9f2..65d6949 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ venv .vscode .idea .DS_* +.webvirtcloud *.pyc db.sqlite3* console/cert.pem* diff --git a/computes/forms.py b/computes/forms.py index ff8e9b9..5389708 100644 --- a/computes/forms.py +++ b/computes/forms.py @@ -6,7 +6,7 @@ from computes.models import Compute class ComputeAddTcpForm(forms.Form): name = forms.CharField(error_messages={'required': _('No hostname has been entered')}, - max_length=20) + max_length=64) hostname = forms.CharField(error_messages={'required': _('No IP / Domain name has been entered')}, max_length=100) login = forms.CharField(error_messages={'required': _('No login has been entered')}, @@ -45,7 +45,7 @@ class ComputeAddTcpForm(forms.Form): class ComputeAddSshForm(forms.Form): name = forms.CharField(error_messages={'required': _('No hostname has been entered')}, - max_length=20) + max_length=64) hostname = forms.CharField(error_messages={'required': _('No IP / Domain name has been entered')}, max_length=100) login = forms.CharField(error_messages={'required': _('No login has been entered')}, @@ -82,7 +82,7 @@ class ComputeAddSshForm(forms.Form): class ComputeAddTlsForm(forms.Form): name = forms.CharField(error_messages={'required': _('No hostname has been entered')}, - max_length=20) + max_length=64) hostname = forms.CharField(error_messages={'required': _('No IP / Domain name has been entered')}, max_length=100) login = forms.CharField(error_messages={'required': _('No login has been entered')}, @@ -122,7 +122,7 @@ class ComputeAddTlsForm(forms.Form): class ComputeEditHostForm(forms.Form): host_id = forms.CharField() name = forms.CharField(error_messages={'required': _('No hostname has been entered')}, - max_length=20) + max_length=64) hostname = forms.CharField(error_messages={'required': _('No IP / Domain name has been entered')}, max_length=100) login = forms.CharField(error_messages={'required': _('No login has been entered')}, @@ -152,7 +152,7 @@ class ComputeEditHostForm(forms.Form): class ComputeAddSocketForm(forms.Form): name = forms.CharField(error_messages={'required': _('No hostname has been entered')}, - max_length=20) + max_length=64) details = forms.CharField(error_messages={'required': _('No details has been entred')}, max_length=50) diff --git a/computes/models.py b/computes/models.py index daedcab..4ac22f3 100644 --- a/computes/models.py +++ b/computes/models.py @@ -2,8 +2,8 @@ from django.db import models class Compute(models.Model): - name = models.CharField(max_length=20) - hostname = models.CharField(max_length=20) + name = models.CharField(max_length=64) + hostname = models.CharField(max_length=64) login = models.CharField(max_length=20) password = models.CharField(max_length=14, blank=True, null=True) details = models.CharField(max_length=50, null=True, blank=True) diff --git a/console/views.py b/console/views.py index 9dfe54e..85b0a27 100644 --- a/console/views.py +++ b/console/views.py @@ -3,7 +3,7 @@ from django.shortcuts import render from django.contrib.auth.decorators import login_required from instances.models import Instance from vrtManager.instance import wvmInstance -from webvirtcloud.settings import WS_PORT +from webvirtcloud.settings import WS_PUBLIC_PORT from webvirtcloud.settings import WS_PUBLIC_HOST from libvirt import libvirtError @@ -38,7 +38,7 @@ def console(request): console_websocket_port = None console_passwd = None - ws_port = console_websocket_port if console_websocket_port else WS_PORT + ws_port = console_websocket_port if console_websocket_port else WS_PUBLIC_PORT ws_host = WS_PUBLIC_HOST if WS_PUBLIC_HOST else request.get_host() if ':' in ws_host: diff --git a/create/forms.py b/create/forms.py index 9be0888..18c0084 100644 --- a/create/forms.py +++ b/create/forms.py @@ -8,7 +8,7 @@ from webvirtcloud.settings import QEMU_CONSOLE_LISTEN_ADDRESSES class FlavorAddForm(forms.Form): label = forms.CharField(label="Name", error_messages={'required': _('No flavor name has been entered')}, - max_length=20) + max_length=64) vcpu = forms.IntegerField(label="VCPU", error_messages={'required': _('No VCPU has been entered')}, ) disk = forms.IntegerField(label="HDD", @@ -21,7 +21,7 @@ class FlavorAddForm(forms.Form): have_symbol = re.match('^[a-zA-Z0-9._-]+$', label) if not have_symbol: raise forms.ValidationError(_('The flavor name must not contain any special characters')) - elif len(label) > 20: + elif len(label) > 64: raise forms.ValidationError(_('The flavor name must not exceed 20 characters')) try: Flavor.objects.get(label=label) @@ -32,7 +32,7 @@ class FlavorAddForm(forms.Form): class NewVMForm(forms.Form): name = forms.CharField(error_messages={'required': _('No Virtual Machine name has been entered')}, - max_length=20) + max_length=64) vcpu = forms.IntegerField(error_messages={'required': _('No VCPU has been entered')}) host_model = forms.BooleanField(required=False) disk = forms.IntegerField(required=False) @@ -57,7 +57,7 @@ class NewVMForm(forms.Form): have_symbol = re.match('^[a-zA-Z0-9._-]+$', name) if not have_symbol: raise forms.ValidationError(_('The name of the virtual machine must not contain any special characters')) - elif len(name) > 20: + elif len(name) > 64: raise forms.ValidationError(_('The name of the virtual machine must not exceed 20 characters')) return name diff --git a/create/templates/create_instance.html b/create/templates/create_instance.html index 6580cd5..c77d4b4 100644 --- a/create/templates/create_instance.html +++ b/create/templates/create_instance.html @@ -105,7 +105,7 @@
@@ -183,7 +183,7 @@
- +
@@ -255,7 +255,7 @@
- +
@@ -368,7 +368,7 @@
- +
@@ -413,7 +413,7 @@
- +
@@ -527,7 +527,7 @@
- +
diff --git a/webvirtcloud/settings.py.template b/webvirtcloud/settings.py.template index 5e59e92..88078be 100644 --- a/webvirtcloud/settings.py.template +++ b/webvirtcloud/settings.py.template @@ -104,6 +104,9 @@ WS_PORT = 6080 WS_HOST = '0.0.0.0' # Websock public port +WS_PUBLIC_PORT = '443' + +# Websock public host WS_PUBLIC_HOST = None # Websock SSL connection