diff --git a/api/config/settings/common.py b/api/config/settings/common.py index 1372f59e3ca362057f1e95d1cb1d4adf79598762..f88aa5dd549fe09afd1c41999180e481dd2f151a 100644 --- a/api/config/settings/common.py +++ b/api/config/settings/common.py @@ -172,6 +172,18 @@ FIXTURE_DIRS = ( # EMAIL CONFIGURATION # ------------------------------------------------------------------------------ + +# EMAIL +# ------------------------------------------------------------------------------ +DEFAULT_FROM_EMAIL = env( + 'DEFAULT_FROM_EMAIL', + default='Funkwhale <noreply@{}>'.format(FUNKWHALE_HOSTNAME)) + +EMAIL_SUBJECT_PREFIX = env( + "EMAIL_SUBJECT_PREFIX", default='[Funkwhale] ') +SERVER_EMAIL = env('SERVER_EMAIL', default=DEFAULT_FROM_EMAIL) + + EMAIL_CONFIG = env.email_url( 'EMAIL_CONFIG', default='consolemail://') diff --git a/api/config/settings/production.py b/api/config/settings/production.py index f238c2d20b9e2de5a2baf8136aa7eca1f6fe40d8..2866e91039a81e9446885437694437f1ef16e79f 100644 --- a/api/config/settings/production.py +++ b/api/config/settings/production.py @@ -68,16 +68,6 @@ DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' # ------------------------ STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' - -# EMAIL -# ------------------------------------------------------------------------------ -DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL', - default='funkwhale_api <noreply@funkwhale.io>') - -EMAIL_SUBJECT_PREFIX = env("DJANGO_EMAIL_SUBJECT_PREFIX", default='[funkwhale_api] ') -SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL) - - # TEMPLATE CONFIGURATION # ------------------------------------------------------------------------------ # See: diff --git a/deploy/env.prod.sample b/deploy/env.prod.sample index dfd17ff4d6c5702a9faf9e781c94f1fb622f2fb0..4b27595af62ae2975b5af853ce5acca406bae58a 100644 --- a/deploy/env.prod.sample +++ b/deploy/env.prod.sample @@ -6,7 +6,7 @@ # - DJANGO_SECRET_KEY # - DJANGO_ALLOWED_HOSTS # - FUNKWHALE_URL -# - EMAIL_CONFIG (if you plan to send emails) +# - EMAIL_CONFIG and DEFAULT_FROM_EMAIL if you plan to send emails) # On non-docker setup **only**, you'll also have to tweak/uncomment those variables: # - DATABASE_URL # - CACHE_URL @@ -52,6 +52,9 @@ FUNKWHALE_URL=https://yourdomain.funwhale # EMAIL_CONFIG=smtp+ssl://user@:password@youremail.host:465' # EMAIL_CONFIG=smtp+tls://user@:password@youremail.host:587' +# The email address to use to send systme emails. By default, we will +# DEFAULT_FROM_EMAIL=noreply@yourdomain + # Depending on the reverse proxy used in front of your funkwhale instance, # the API will use different kind of headers to serve audio files # Allowed values: nginx, apache2 diff --git a/docs/configuration.rst b/docs/configuration.rst index f498b9c87df898380df1c7db586531579165dc49..bbc658e087977e5eaa7c3f53598fdad99d68b4aa 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -56,6 +56,20 @@ Possible values: - ``smtp+ssl://user:password@youremail.host:465``: Send emails via SMTP via youremail.host on port 465, using SSL encryption, authenticating as user "user" with password "password" - ``smtp+tls://user:password@youremail.host:587``: Send emails via SMTP via youremail.host on port 587, using TLS encryption, authenticating as user "user" with password "password" +.. _setting-DEFAULT_FROM_EMAIL: + +``DEFAULT_FROM_EMAIL`` +^^^^^^^^^^^^^^^^^^^^^^ + +The email address to use to send email. + +Default: ``Funkwhale <noreply@yourdomain>`` + +.. note:: + + Both the forms ``Funkwhale <noreply@yourdomain>`` and + ``noreply@yourdomain`` work. + .. _setting-MUSIC_DIRECTORY_PATH: