From ee806ba06c60a32f8c95e11d09edf72d97b16e3d Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Wed, 28 Feb 2024 19:54:05 +1300 Subject: [PATCH] reset admin keys cli command --- app/cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/cli.py b/app/cli.py index 4790af2a..4c828c8b 100644 --- a/app/cli.py +++ b/app/cli.py @@ -59,6 +59,15 @@ def register(app): print(private_key) print(public_key) + @app.cli.command("admin-keys") + def keys(): + private_key, public_key = RsaKeys.generate_keypair() + u: User = User.query.get(1) + u.private_key = private_key + u.public_key = public_key + db.session.commit() + print('Admin keys have been reset') + @app.cli.command("init-db") def init_db(): with app.app_context():