Compare commits

..

No commits in common. "49dca12719464e450c84a3ae24e43070a7c4c433" and "0d9d51c7804cc67d1fcd3193718615ddd2b0e2f5" have entirely different histories.

8 changed files with 8 additions and 13 deletions

View File

@ -236,7 +236,7 @@ def _create(vm_sizes, operating_systems, public_keys_for_account, server_data):
""")
if len(errors) == 0:
id = make_capsul_id()
id = makeCapsulId()
get_model().create_vm(
email=session["account"],
id=id,

View File

@ -43,7 +43,7 @@ def init_app(app, is_running_server):
hasSchemaVersionTable = False
actionWasTaken = False
schemaVersion = 0
desiredSchemaVersion = 17
desiredSchemaVersion = 16
cursor = connection.cursor()

View File

@ -183,8 +183,8 @@ class DBModel:
def create_vm(self, email, id, size, os, ssh_authorized_keys):
self.cursor.execute("""
INSERT INTO vms (email, id, size, os, network_name, host)
VALUES (%s, %s, %s, %s, 'virbr1', 'baikal')
INSERT INTO vms (email, id, size, os)
VALUES (%s, %s, %s, %s)
""",
(email, id, size, os)
)

View File

@ -10,7 +10,7 @@ from nanoid import generate
from capsulflask.auth import account_required
from capsulflask.db import get_model
bp = Blueprint("publicapi", __name__, url_prefix="/api")
bp = Blueprint("webapi", __name__, url_prefix="/api")
@bp.route("/capsul/create", methods=["POST"])
@account_required
@ -25,8 +25,6 @@ def capsul_create():
account_balance = get_account_balance(get_vms(), get_payments(), datetime.datetime.utcnow())
capacity_avaliable = current_app.config["HUB_MODEL"].capacity_avaliable(512*1024*1024)
request.json['ssh_authorized_key_count'] = 1
id, errors = _create(
vm_sizes,
operating_systems,

View File

@ -0,0 +1,2 @@
DROP TABLE api_keys;
UPDATE schemaversion SET version = 15;

View File

@ -6,4 +6,4 @@ CREATE TABLE api_tokens (
token TEXT NOT NULL
);
UPDATE schemaversion SET version = 17;
UPDATE schemaversion SET version = 16;

View File

@ -1,2 +0,0 @@
DROP TABLE api_keys;
UPDATE schemaversion SET version = 16;

View File

@ -13,9 +13,6 @@ services:
- "5000:5000"
environment:
- "POSTGRES_CONNECTION_PARAMETERS=host=db port=5432 user=capsul password=capsul dbname=capsul"
# The image uses gunicorn by default, let's override it with Flask's
# built-in development server
command: ["flask", "run", "-h", "0.0.0.0", "-p", "5000"]
db:
image: "postgres:9.6.5"
volumes: