Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
6fb9c651e8 | |||
a7bc0c6c01 | |||
0574d58a7c | |||
b3c655bc47 | |||
a9a4c4448c | |||
a040301bbb | |||
f3ea3d330d | |||
d9dc3f3049 | |||
d1c95cd113 | |||
174532b7fe | |||
02c6352f11 | |||
171c3252e4 |
11
.env.sample
Normal file
11
.env.sample
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Optional, default `mock`
|
||||||
|
#SPOKE_MODEL=shell-scripts
|
||||||
|
# Optional, default `0`
|
||||||
|
#FLASK_DEBUG=0
|
||||||
|
# Optional, default `http://localhost:5000`
|
||||||
|
#BASE_URL=http://localhost:5000
|
||||||
|
# Optional, default `qemu:///system` if you're root, otherwise `qemu:///session`
|
||||||
|
#VIRSH_DEFAULT_CONNECT_URI=qemu:///system
|
||||||
|
#ADMIN_PANEL_ALLOW_EMAIL_ADDRESSES=3wc.capsul@doesthisthing.work
|
||||||
|
# Optional, default no theme
|
||||||
|
#THEME=yolocolo
|
@ -59,6 +59,7 @@ def create_app(http_client_factory):
|
|||||||
LOG_LEVEL=config.get("LOG_LEVEL", "INFO"),
|
LOG_LEVEL=config.get("LOG_LEVEL", "INFO"),
|
||||||
SPOKE_HOST_ID=config.get("SPOKE_HOST_ID", "baikal"),
|
SPOKE_HOST_ID=config.get("SPOKE_HOST_ID", "baikal"),
|
||||||
SPOKE_HOST_TOKEN=config.get("SPOKE_HOST_TOKEN", "changeme"),
|
SPOKE_HOST_TOKEN=config.get("SPOKE_HOST_TOKEN", "changeme"),
|
||||||
|
SSH_USERNAME=os.environ.get("SSH_USERNAME", default="cyberian"),
|
||||||
HUB_TOKEN=config.get("HUB_TOKEN", "changeme"),
|
HUB_TOKEN=config.get("HUB_TOKEN", "changeme"),
|
||||||
|
|
||||||
# https://www.postgresql.org/docs/9.1/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS
|
# https://www.postgresql.org/docs/9.1/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS
|
||||||
|
@ -62,6 +62,18 @@ def sql_script(f, c):
|
|||||||
|
|
||||||
model.connection.commit()
|
model.connection.commit()
|
||||||
|
|
||||||
|
@bp.cli.command('account-balance')
|
||||||
|
@click.option('-u', help='users email address')
|
||||||
|
@with_appcontext
|
||||||
|
def account_balance(u):
|
||||||
|
vms = get_model().list_vms_for_account(u)
|
||||||
|
payments = get_model().list_payments_for_account(u)
|
||||||
|
click.echo(".")
|
||||||
|
click.echo(".")
|
||||||
|
click.echo(get_account_balance(vms, payments, datetime.utcnow()))
|
||||||
|
click.echo(".")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@bp.cli.command('cron-task')
|
@bp.cli.command('cron-task')
|
||||||
@with_appcontext
|
@with_appcontext
|
||||||
|
@ -43,7 +43,7 @@ def init_app(app, is_running_server):
|
|||||||
hasSchemaVersionTable = False
|
hasSchemaVersionTable = False
|
||||||
actionWasTaken = False
|
actionWasTaken = False
|
||||||
schemaVersion = 0
|
schemaVersion = 0
|
||||||
desiredSchemaVersion = 18
|
desiredSchemaVersion = 19
|
||||||
|
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
|
|
||||||
|
8
capsulflask/schema_migrations/19_down_os_updates.sql
Normal file
8
capsulflask/schema_migrations/19_down_os_updates.sql
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
DELETE FROM os_images WHERE id = 'guixsystem130';
|
||||||
|
DELETE FROM os_images WHERE id = 'archlinux';
|
||||||
|
UPDATE os_images SET deprecated = FALSE WHERE id = 'guixsystem120';
|
||||||
|
UPDATE os_images SET deprecated = FALSE WHERE id = 'centos7';
|
||||||
|
UPDATE os_images SET deprecated = FALSE WHERE id = 'centos8';
|
||||||
|
UPDATE os_images SET description = 'Ubuntu 20.04 LTS (Fossa)' WHERE id = 'ubuntu20';
|
||||||
|
|
||||||
|
UPDATE schemaversion SET version = 18;
|
12
capsulflask/schema_migrations/19_up_os_updates.sql
Normal file
12
capsulflask/schema_migrations/19_up_os_updates.sql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
INSERT INTO os_images (id, template_image_file_name, description, deprecated)
|
||||||
|
VALUES ('guixsystem130', 'guixsystem/1.3.0/root.img.qcow2', 'Guix System 1.3.0', FALSE);
|
||||||
|
INSERT INTO os_images (id, template_image_file_name, description, deprecated)
|
||||||
|
VALUES ('archlinux', 'archlinux/root.img.qcow2', 'Arch Linux', FALSE);
|
||||||
|
|
||||||
|
UPDATE os_images SET deprecated = TRUE WHERE id = 'guixsystem120';
|
||||||
|
UPDATE os_images SET deprecated = TRUE WHERE id = 'centos7';
|
||||||
|
UPDATE os_images SET deprecated = TRUE WHERE id = 'centos8';
|
||||||
|
UPDATE os_images SET description = 'Ubuntu 20.04 (Focal)' WHERE id = 'ubuntu20';
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE schemaversion SET version = 19;
|
@ -7,18 +7,11 @@
|
|||||||
<h1>SUPPORT</h1>
|
<h1>SUPPORT</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="row half-margin">
|
<div class="row half-margin">
|
||||||
<a href="mailto:support@cyberia.club?subject=Please%20help!">support@cyberia.club</a>
|
<a href="mailto:support@cyberia.club?subject=capsul%20support%20request">support@cyberia.club</a>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block subcontent %}
|
{% block subcontent %}
|
||||||
<p>
|
|
||||||
Note: We maintain a searchable archive of all support emails at
|
|
||||||
<a href="https://lists.cyberia.club/~cyberia/support">https://lists.cyberia.club/~cyberia/support</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
If you do not want your mail to appear in a public archive, email <a href="mailto:capsul@cyberia.club?subject=Please%20help!">capsul@cyberia.club</a> instead.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
Please describe your problem or feature request, and we will do our best to get back to you promptly. Thank you very much.
|
Please describe your problem or feature request, and we will do our best to get back to you promptly. Thank you very much.
|
||||||
</p>
|
</p>
|
||||||
|
@ -12,8 +12,6 @@ class LoginTests(BaseTestCase):
|
|||||||
response = client.get(url_for("auth.login"))
|
response = client.get(url_for("auth.login"))
|
||||||
self.assert_200(response)
|
self.assert_200(response)
|
||||||
|
|
||||||
# FIXME test generated login link
|
|
||||||
|
|
||||||
def test_login_magiclink(self):
|
def test_login_magiclink(self):
|
||||||
token, ignoreCaseMatches = get_model().login('test@example.com')
|
token, ignoreCaseMatches = get_model().login('test@example.com')
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ class ConsoleTests(BaseTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
|
|
||||||
|
|
||||||
get_model().cursor.execute("DELETE FROM host_operation")
|
get_model().cursor.execute("DELETE FROM host_operation")
|
||||||
get_model().cursor.execute("DELETE FROM operations")
|
get_model().cursor.execute("DELETE FROM operations")
|
||||||
get_model().cursor.execute("DELETE FROM vm_ssh_host_key")
|
get_model().cursor.execute("DELETE FROM vm_ssh_host_key")
|
||||||
@ -48,8 +47,6 @@ class ConsoleTests(BaseTestCase):
|
|||||||
for host_id in host_ids:
|
for host_id in host_ids:
|
||||||
get_model().host_heartbeat(host_id)
|
get_model().host_heartbeat(host_id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_index(self):
|
def test_index(self):
|
||||||
self._login('test@example.com')
|
self._login('test@example.com')
|
||||||
with self.client as client:
|
with self.client as client:
|
||||||
@ -80,7 +77,6 @@ class ConsoleTests(BaseTestCase):
|
|||||||
0
|
0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_create_fails_capacity(self):
|
def test_create_fails_capacity(self):
|
||||||
with self.client as client:
|
with self.client as client:
|
||||||
|
|
||||||
@ -162,7 +158,6 @@ class ConsoleTests(BaseTestCase):
|
|||||||
url_for("console.index") + f'?created={vm_id}'
|
url_for("console.index") + f'?created={vm_id}'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_keys_loads(self):
|
def test_keys_loads(self):
|
||||||
self._login('test@example.com')
|
self._login('test@example.com')
|
||||||
with self.client as client:
|
with self.client as client:
|
||||||
@ -215,5 +210,3 @@ class ConsoleTests(BaseTestCase):
|
|||||||
'A key with that name already exists',
|
'A key with that name already exists',
|
||||||
category='message'
|
category='message'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ services:
|
|||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
environment:
|
environment:
|
||||||
- "POSTGRES_CONNECTION_PARAMETERS=host=db port=5432 user=capsul password=capsul dbname=capsul"
|
- "POSTGRES_CONNECTION_PARAMETERS=host=db port=5432 user=capsul password=capsul dbname=capsul"
|
||||||
- SPOKE_MODEL=shell-scripts
|
- SPOKE_MODEL
|
||||||
#- FLASK_DEBUG=1
|
- FLASK_DEBUG
|
||||||
- BASE_URL=http://localhost:5000
|
- BASE_URL=http://localhost:5000
|
||||||
- ADMIN_PANEL_ALLOW_EMAIL_ADDRESSES=3wc.capsul@doesthisthing.work
|
- ADMIN_PANEL_ALLOW_EMAIL_ADDRESSES=3wc.capsul@doesthisthing.work
|
||||||
- VIRSH_DEFAULT_CONNECT_URI=qemu:///system
|
- VIRSH_DEFAULT_CONNECT_URI=qemu:///system
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
Create a `.env` file to set up the application configuration:
|
Create a `.env` file to set up the application configuration:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
cp .env.sample .env
|
||||||
nano .env
|
nano .env
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user