diff --git a/capsulflask/console.py b/capsulflask/console.py index d827b4f..16e0d0e 100644 --- a/capsulflask/console.py +++ b/capsulflask/console.py @@ -208,7 +208,7 @@ def create(): @account_required def ssh_public_keys(): errors = list() - + if request.method == "POST": method = request.form["method"] content = None @@ -223,7 +223,7 @@ def ssh_public_keys(): name = parts[0] else: errors.append("Name is required") - elif not re.match(r"^[0-9A-Za-z_@. -]+$", name): + if not re.match(r"^[0-9A-Za-z_@\. -]+$", name): errors.append("Name must match \"^[0-9A-Za-z_@. -]+$\"") if method == "POST": @@ -232,7 +232,7 @@ def ssh_public_keys(): errors.append("Content is required") else: content = content.replace("\r", "").replace("\n", "") - if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$", content): + if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@\. -]+$", content): errors.append("Content must match \"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$\"") if get_model().ssh_public_key_name_exists(session["account"], name): @@ -342,4 +342,4 @@ def account_balance(): )), has_payments=len(payments)>0, account_balance=format(balance_now, '.2f') - ) \ No newline at end of file + ) diff --git a/capsulflask/schema_migrations/03_down_openbsd67.sql b/capsulflask/schema_migrations/03_down_openbsd67.sql new file mode 100644 index 0000000..b447d4e --- /dev/null +++ b/capsulflask/schema_migrations/03_down_openbsd67.sql @@ -0,0 +1,3 @@ +UPDATE os_images SET id = 'openbsd66' WHERE id = 'openbsd67' +UPDATE os_images SET template_image_file_name = 'openbsd-cloud-2020-05.qcow2' WHERE id = 'openbsd66' +UPDATE os_images SET description = 'OpenBSD 6.6' WHERE id = 'openbsd66' diff --git a/capsulflask/schema_migrations/03_up_openbsd67.sql b/capsulflask/schema_migrations/03_up_openbsd67.sql new file mode 100644 index 0000000..078dd5b --- /dev/null +++ b/capsulflask/schema_migrations/03_up_openbsd67.sql @@ -0,0 +1,3 @@ +UPDATE os_images SET id = 'openbsd67' WHERE id = 'openbsd66' +UPDATE os_images SET template_image_file_name = 'openbsd-6.7-x86_64.qcow2' WHERE id = 'openbsd67' +UPDATE os_images SET description = 'OpenBSD 6.7' WHERE id = 'openbsd67'