add auth
This commit is contained in:
22 files changed
+1034
-25
No files matched your search
@@ -83,6 +83,18 @@ def settings_from_env() -> AppSettings:
|
||||
settings.notifications.slack.enabled = True
|
||||
settings.notifications.slack.webhook_url = env.slack_webhook_url
|
||||
|
||||
auth = settings.auth
|
||||
if env.auth_password:
|
||||
from app.services import auth_service
|
||||
|
||||
auth.username = env.auth_username or auth.username
|
||||
auth.password_hash = auth_service.hash_password(env.auth_password)
|
||||
if env.telegram_owner_id:
|
||||
auth.telegram_owner_id = env.telegram_owner_id
|
||||
auth.telegram_login_enabled = True
|
||||
if env.telegram_bot_username:
|
||||
auth.telegram_bot_username = env.telegram_bot_username
|
||||
|
||||
return settings
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user