Enhance admin bootstrap process with reset functionality

- Update .env.example and README.md to include new ADMIN_BOOTSTRAP_RESET option for resetting admin credentials on startup.
- Modify main.py to implement logic for resetting the admin's password, role, and status if ADMIN_BOOTSTRAP_RESET is set to true.
- Adjust config.py to define the new setting, ensuring proper configuration management.
This commit is contained in:
smueller
2026-07-07 15:09:44 +02:00
parent 8b029ade77
commit 55ec4e653b
4 changed files with 26 additions and 0 deletions

View File

@@ -13,6 +13,9 @@ class Settings(BaseSettings):
cookie_secure: bool = False
admin_bootstrap_email: str = "admin@internal.local"
admin_bootstrap_password: str = "ChangeMe123!"
# Wenn true: setzt Passwort/Rolle/Status des Bootstrap-Admins beim Start
# auf die .env-Werte zurück (auch wenn der User bereits existiert).
admin_bootstrap_reset: bool = False
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")