generate .super_user file on startup if adminui is enabled (#1651)

* generate .super_user file on startup if adminui is enabled
* only save super_user id instead of url
This commit is contained in:
dni ⚡ 2023-04-25 10:25:50 +02:00 committed by GitHub
parent 5c119e903d
commit 667de4d1f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
.gitignore vendored
View File

@ -23,6 +23,7 @@ tests/data/*.sqlite3
*.pyc
*.env
.env
.super_user
data
*.sqlite3

View File

@ -447,6 +447,10 @@ async def check_admin_settings():
admin_url = f"{settings.lnbits_baseurl}wallet?usr={settings.super_user}"
logger.success(f"✔️ Access super user account at: {admin_url}")
# saving it to .super_user file
with open(".super_user", "w") as file:
file.write(settings.super_user)
# callback for saas
if (
settings.lnbits_saas_callback