feat: add autonomous fiscal control panel
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"""Create a human panel administrator without ever printing the password."""
|
||||
|
||||
import getpass
|
||||
|
||||
from central.app.db import SessionLocal
|
||||
from central.app.human_auth import create_admin
|
||||
|
||||
|
||||
def main():
|
||||
username = input("Admin username: ").strip()
|
||||
password = getpass.getpass("Admin password (12+ chars): ")
|
||||
confirmation = getpass.getpass("Confirm password: ")
|
||||
if password != confirmation:
|
||||
raise SystemExit("passwords do not match")
|
||||
with SessionLocal() as session:
|
||||
admin = create_admin(session, username, password)
|
||||
print(f"created admin {admin.username}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user