mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
reset admin keys cli command
This commit is contained in:
parent
abed85a1e3
commit
ee806ba06c
1 changed files with 9 additions and 0 deletions
|
@ -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():
|
||||
|
|
Loading…
Reference in a new issue