diff --git a/accounts/utils.py b/accounts/utils.py index 66717ed..4daa79d 100644 --- a/accounts/utils.py +++ b/accounts/utils.py @@ -47,7 +47,7 @@ def send_verification_email(request, challenge): email = challenge.owned_by.email - sender = settings.HOSTEA["EMAIL_SENDER_ADDRESS"] + sender = settings.DEFAULT_FROM_EMAIL send_mail( subject="[Hostea] Please confirm your email address", diff --git a/dashboard/local_settings.ci.py b/dashboard/local_settings.ci.py index b23604b..48fe216 100644 --- a/dashboard/local_settings.ci.py +++ b/dashboard/local_settings.ci.py @@ -56,7 +56,6 @@ PAYMENT_VARIANTS = { HOSTEA = { "SOURCE_CODE": "https://gitea.hostea.org/Hostea/dashboard", "INSTANCE_MAINTAINER_CONTACT": "contact@hostea.example.org", - "EMAIL_SENDER_ADDRESS": "no-reply@hostea.org", "ACCOUNTS": { "MAX_VERIFICATION_TOLERANCE_PERIOD": 60 * 60 * 24, # in seconds "SUDO_TTL": 60 * 5, @@ -86,6 +85,7 @@ HOSTEA = { # Please see EMAIL_* configuration options: # https://docs.djangoproject.com/en/4.1/ref/settings/#email-host EMAIL_CONFIG = env.email("EMAIL_URL", default="smtp://admin:password@localhost:10025") +DEFAULT_FROM_EMAIL = "no-reply@hostea.org" vars().update(EMAIL_CONFIG) diff --git a/dashboard/local_settings.example.py b/dashboard/local_settings.example.py index 3fbe4a6..3fc0a42 100644 --- a/dashboard/local_settings.example.py +++ b/dashboard/local_settings.example.py @@ -55,7 +55,6 @@ PAYMENT_VARIANTS = { HOSTEA = { "SOURCE_CODE": "https://gitea.hostea.org/Hostea/dashboard", "INSTANCE_MAINTAINER_CONTACT": "contact@hostea.example.org", - "EMAIL_SENDER_ADDRESS": "no-reply@hostea.org", "ACCOUNTS": { "MAX_VERIFICATION_TOLERANCE_PERIOD": 60 * 60 * 24, # in seconds "SUDO_TTL": 60 * 5, @@ -88,3 +87,4 @@ EMAIL_USE_SSL = False EMAIL_PORT = 10025 EMAIL_HOST_USER = "admin" EMAIL_HOST_PASSWORD = "password" +DEFAULT_FROM_EMAIL = "no-reply@hostea.org" diff --git a/dashboard/settings.py b/dashboard/settings.py index 0170cb9..943ce1b 100644 --- a/dashboard/settings.py +++ b/dashboard/settings.py @@ -170,7 +170,6 @@ PAYMENT_VARIANTS = { HOSTEA = { "SOURCE_CODE": "https://gitea.hostea.org/Hostea/dashboard", "RESTRICT_NEW_INTEGRATION_INSTALLATION": True, - "EMAIL_SENDER_ADDRESS": "no-reply@hostea.org", "INSTANCE_MAINTAINER_CONTACT": "contact@hostea.example.org", "ACCOUNTS": { "MAX_VERIFICATION_TOLERANCE_PERIOD": 60 * 60 * 24, # in seconds @@ -204,6 +203,7 @@ EMAIL_USE_SSL = False EMAIL_PORT = 10025 EMAIL_HOST_USER = "admin" EMAIL_HOST_PASSWORD = "password" +DEFAULT_FROM_EMAIL: "no-reply@hostea.org" try: from dashboard.local_settings import * diff --git a/infrastructure/utils.py b/infrastructure/utils.py index 707cbc6..c022f85 100644 --- a/infrastructure/utils.py +++ b/infrastructure/utils.py @@ -64,7 +64,7 @@ class Worker(Thread): context=ctx, ) - sender = settings.HOSTEA["EMAIL_SENDER_ADDRESS"] + sender = settings.DEFAULT_FROM_EMAIL send_mail( subject="[Hostea] Your Hostea instance is now online!", diff --git a/infrastructure/views.py b/infrastructure/views.py index a657676..20500d6 100644 --- a/infrastructure/views.py +++ b/infrastructure/views.py @@ -66,7 +66,7 @@ def create_instance(request, instance_name: str): context=ctx, ) - sender = settings.HOSTEA["EMAIL_SENDER_ADDRESS"] + sender = settings.DEFAULT_FROM_EMAIL send_mail( subject="[Hostea] Your Hostea instance is now online!",