Commit 5c76464c authored by Kostas Papadimitriou's avatar Kostas Papadimitriou

ui: Improve handling of ssh key injection in machine wizard

- Remove setting ``UI_SUPPORT_SSH_OS_LIST``
- Always allow ssh key injection unless image os family is included in
  ``UI_SSH_SUPPORT_OSFAMILY_EXCLUDE_LIST`` setting.
parent 76489844
......@@ -237,8 +237,9 @@ Cyclades UI
- Double escaping fix in machine create wizard images list and machine details
subview.
- Fix image ordering in machine create wizard.
- New setting ``UI_SUPPORT_SSH_OS_FAMILY_LIST``. A list of image OS families
for which ui will enable ssh key injection in machine wizard.
- New setting ``UI_SSH_SUPPORT_OSFAMILY_EXCLUDE_LIST``. A list of image OS
families for which ui will disable ssh key injection in machine wizard.
- Setting ``UI_SUPPORT_SSH_OS_LIST`` removed and no longer used.
Pithos
......
......@@ -127,10 +127,6 @@
## Whether UI should display error overlay for all Javascript exceptions
#UI_HANDLE_WINDOW_EXCEPTIONS = True
#
## A list of os names that support ssh public key assignment
#UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu',
# 'centos', 'archlinux']
#
## OS/username map to identify default user name for the specified os
#UI_OS_DEFAULT_USER_MAP = {
# 'debian':'root', 'fedora': 'root', 'okeanos': 'root',
......@@ -190,5 +186,5 @@
##will be loaded.
#UI_FONTS_BASE_URL = "//fonts.googleapis.com/"
#
## A list of os family names that support ssh public key assignment
#UI_SUPPORT_SSH_OS_FAMILY_LIST = ['linux', 'openbsd', 'freebsd', 'netbsd']
## A list of os family names which don't support ssh public key injection
#UI_SSH_SUPPORT_OSFAMILY_EXCLUDE_LIST = ['windows']
......@@ -552,20 +552,12 @@
},
_supports_ssh: function() {
var os_list = synnefo.config.support_ssh_os_list;
var osfamily_list = synnefo.config.support_ssh_os_family_list;
var exclude_list = synnefo.config.ssh_support_osfamily_exclude_list || [];
var os = this.get_os();
if (os_list.indexOf(os) > -1) {
return true;
}
var osfamily = this.get_meta("osfamily");
if (osfamily_list.indexOf(osfamily) > -1) {
return true
if (exclude_list.indexOf(os) > -1) {
return false;
}
return false;
return true;
},
supports: function(feature) {
......
......@@ -659,8 +659,7 @@
synnefo.config.machines_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/machines/';
synnefo.config.ui_console_url = '{% url ui_machines_console %}';
synnefo.config.ui_connect_url = '{% url ui_machines_connect %}';
synnefo.config.support_ssh_os_list = {{ support_ssh_os_list|safe }};
synnefo.config.support_ssh_os_family_list = {{ support_ssh_os_family_list|safe }};
synnefo.config.ssh_support_osfamily_exclude_list = {{ ssh_support_osfamily_exclude_list|safe }};
synnefo.config.unknown_os = {{ unknown_os|safe }};
synnefo.config.os_created_users = {{ os_created_users|safe }};
synnefo.config.feedback_post_url = {{ feedback_post_url|safe }};
......
......@@ -77,9 +77,9 @@ IMAGE_DELETED_TITLE = \
IMAGE_DELETED_SIZE_TITLE = \
getattr(settings, 'UI_IMAGE_DELETED_SIZE_TITLE', '(none)')
SUPPORT_SSH_OS_LIST = getattr(settings, "UI_SUPPORT_SSH_OS_LIST",)
SUPPORT_SSH_OS_FAMILY_LIST = getattr(settings, "UI_SUPPORT_SSH_OS_FAMILY_LIST",
['linux', 'openbsd', 'freebsd', 'netbsd'])
SSH_SUPPORT_OSFAMILY_EXCLUDE_LIST = getattr(
settings, "UI_SSH_SUPPORT_OSFAMILY_EXCLUDE_LIST", ['windows'])
OS_CREATED_USERS = getattr(settings, "UI_OS_DEFAULT_USER_MAP")
UNKNOWN_OS = getattr(settings, "UI_UNKNOWN_OS", "unknown")
......@@ -227,8 +227,7 @@ def home(request):
'skip_timeouts': json.dumps(SKIP_TIMEOUTS),
'vm_name_template': json.dumps(VM_NAME_TEMPLATE),
'flavors_disk_templates_info': json.dumps(FLAVORS_DISK_TEMPLATES_INFO),
'support_ssh_os_list': json.dumps(SUPPORT_SSH_OS_LIST),
'support_ssh_os_family_list': json.dumps(SUPPORT_SSH_OS_FAMILY_LIST),
'ssh_support_osfamily_exclude_list': json.dumps(SSH_SUPPORT_OSFAMILY_EXCLUDE_LIST),
'unknown_os': json.dumps(UNKNOWN_OS),
'os_created_users': json.dumps(OS_CREATED_USERS),
'userdata_keys_limit': json.dumps(MAX_SSH_KEYS_PER_USER),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment