mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -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(private_key)
|
||||||
print(public_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")
|
@app.cli.command("init-db")
|
||||||
def init_db():
|
def init_db():
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
|
|
Loading…
Add table
Reference in a new issue