mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Add more tasks and tweak docs
This commit is contained in:
20
tasks.py
20
tasks.py
@ -327,3 +327,23 @@ def reset_password(ctx):
|
||||
print()
|
||||
print("Update data/profile.toml with:")
|
||||
print(f'admin_password = "{new_password}"')
|
||||
|
||||
|
||||
@task
|
||||
def check_config(ctx):
|
||||
# type: (Context) -> None
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from loguru import logger
|
||||
|
||||
logger.disable("app")
|
||||
|
||||
try:
|
||||
from app import config # noqa: F401
|
||||
except Exception as exc:
|
||||
print("Config error, please fix data/profile.toml:\n")
|
||||
print("".join(traceback.format_exception(exc)))
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("Config is OK")
|
||||
|
Reference in New Issue
Block a user