mirror of
https://github.com/sassanix/Warracker.git
synced 2026-05-07 17:10:06 -05:00
Support reading secrets from files
This makes it easier to integrate Warracker with modern secret management workflows like Docker secrets and Systemd service credentials.
This commit is contained in:
@@ -750,6 +750,8 @@ def send_password_reset_email(recipient_email, reset_link):
|
||||
smtp_port = int(os.environ.get('SMTP_PORT', 1025))
|
||||
smtp_username = os.environ.get('SMTP_USERNAME')
|
||||
smtp_password = os.environ.get('SMTP_PASSWORD')
|
||||
if os.environ.get('SMTP_PASSWORD_FILE'):
|
||||
smtp_password = open(os.environ.get('SMTP_PASSWORD_FILE'), 'r').read().strip()
|
||||
smtp_use_tls = os.environ.get('SMTP_USE_TLS', 'true').lower() == 'true'
|
||||
smtp_use_ssl = os.environ.get('SMTP_USE_SSL', 'false').lower() == 'true'
|
||||
sender_email = os.environ.get('SMTP_SENDER_EMAIL', 'noreply@warracker.com')
|
||||
|
||||
@@ -299,6 +299,8 @@ def process_email_notifications(all_warranties, eligible_user_ids, is_manual, ge
|
||||
smtp_port = int(os.environ.get('SMTP_PORT', '1025'))
|
||||
smtp_username = os.environ.get('SMTP_USERNAME', 'notifications@warracker.com')
|
||||
smtp_password = os.environ.get('SMTP_PASSWORD', '')
|
||||
if os.environ.get('SMTP_PASSWORD_FILE'):
|
||||
smtp_password = open(os.environ.get('SMTP_PASSWORD_FILE'), 'r').read().strip()
|
||||
smtp_use_tls_env = os.environ.get('SMTP_USE_TLS', 'not_set').lower()
|
||||
|
||||
# For manual triggers, check email preferences
|
||||
|
||||
@@ -63,6 +63,8 @@ def init_oidc_client(current_app_instance, db_conn_func, db_release_func):
|
||||
provider_name = os.environ.get('OIDC_PROVIDER_NAME', oidc_db_settings.get('oidc_provider_name', 'oidc'))
|
||||
client_id = os.environ.get('OIDC_CLIENT_ID', oidc_db_settings.get('oidc_client_id', ''))
|
||||
client_secret = os.environ.get('OIDC_CLIENT_SECRET', oidc_db_settings.get('oidc_client_secret', ''))
|
||||
if os.environ.get('OIDC_CLIENT_SECRET_FILE'):
|
||||
client_secret = open(os.environ.get('OIDC_CLIENT_SECRET_FILE'), 'r').read().strip()
|
||||
issuer_url = os.environ.get('OIDC_ISSUER_URL', oidc_db_settings.get('oidc_issuer_url', ''))
|
||||
scope = os.environ.get('OIDC_SCOPE', oidc_db_settings.get('oidc_scope', 'openid email profile'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user