Updated SMTP related config values for Dash (#42)

This commit is contained in:
Rosch
2025-11-16 01:10:47 -06:00
committed by GitHub
parent 8a218d9068
commit 0488bd2ead
2 changed files with 86 additions and 15 deletions

67
.env
View File

@@ -69,14 +69,6 @@ POSTGRES_PASSWORD=postgres
# WEB_RECAPTCHA_SECRET
# --------------------
# Google reCAPTCHA v3 secret key.
#
# WEB_SENDGRID_KEY
# ----------------
# Sendgrid API key used for player activation.
#
# Leave blank to disable activation and have
# players be activated immediately upon
# registration.
##############################################
WEB_PORT=80
@@ -91,7 +83,64 @@ WEB_VANILLA_MEDIA=http://media.localhost
WEB_RECAPTCHA_SITE=
WEB_RECAPTCHA_SECRET=
WEB_SENDGRID_KEY=
##############################################
# Email
##############################################
#
# EMAIL_METHOD
# ------------
# This is the method that will be used for
# email. It accepts the following options:
# - SENDGRID
# - SMTP
#
# Leave blank to disable activation and have
# players be activated immediately upon
# registration.
#
# EMAIL_FROM_ADDRESS
# ---------------
# The mailbox you're sending the email from.
# This is typically the same as
# EMAIL_SMTP_PASS but may be another mailbox
# that user has access to.
#
# EMAIL_SENDGRID_KEY
# ---------------
# Sendgrid API key used for player activation.
#
# EMAIL_SMTP_HOST
# ---------------
# Email SMTP server hostname or address.
#
# EMAIL_SMTP_PORT
# ---------------
# Email SMTP server port.
#
# EMAIL_SMTP_USER
# ---------------
# Email SMTP server login username.
#
# EMAIL_SMTP_PASS
# ---------------
# Email SMTP server login password.
#
# EMAIL_SMTP_SSL
# ---------------
# Set to TRUE if your SMTP server uses SSL.
##############################################
EMAIL_METHOD=
EMAIL_FROM_ADDRESS=no-reply@ikea.fishing
EMAIL_SENDGRID_KEY=
EMAIL_SMTP_HOST=
EMAIL_SMTP_PORT=
EMAIL_SMTP_USER=
EMAIL_SMTP_PASS=
EMAIL_SMTP_SSL=TRUE
##############################################
# Game

View File

@@ -79,7 +79,7 @@ LEGACY_ACTIVATE_REDIRECT : str
VANILLA_ACTIVATE_REDIRECT : str
URL player is taken to for activation.
"""
ACTIVATE_PLAYER = {{ if not .Env.WEB_SENDGRID_KEY }}True{{ else }}False{{ end }}
ACTIVATE_PLAYER = {{ if or (eq .Env.EMAIL_METHOD "SENDGRID") (eq .Env.EMAIL_METHOD "SMTP") }}False{{ else }}True{{ end }}
LEGACY_ACTIVATE_REDIRECT = '{{ .Env.WEB_LEGACY_PLAY }}'
VANILLA_ACTIVATE_REDIRECT = '{{ .Env.WEB_VANILLA_PLAY }}'
@@ -87,13 +87,26 @@ VANILLA_ACTIVATE_REDIRECT = '{{ .Env.WEB_VANILLA_PLAY }}'
"""
Email
-----
EMAIL_METHOD : str
Options: SENDGRID, SMTP, <blank>
Choose a method to send emails.
SITE_NAME : str
The name of your site.
FROM_EMAIL : str
Will appear as the sender for emails sent via the SendGrid
API.
Will appear as the sender for emails.
SENDGRID_API_KEY : str
Required for sending emails via the SendGrid API.
SMTP_HOST : str
Required for sending emails via SMTP server.
SMTP_PORT : int
Required for sending emails via SMTP server.
SMTP_USER : str
Required for sending emails via SMTP server.
SMTP_PASS : str
Required for sending emails via SMTP server.
SMTP_SSL : bool
Required for sending emails via SMTP server.
Set to True to connect to the server with SSL.
EMAIL_WHITELIST : list
List of email domains to accept. If set to an empty list
or `None` then dash will assume all email domains are
@@ -104,13 +117,22 @@ MAX_ACCOUNT_EMAIL : int
.. SendGrid registration:
https://signup.sendgrid.com/
"""
EMAIL_METHOD = '{{ .Env.EMAIL_METHOD }}'.upper()
SITE_NAME = '{{ .Env.WEB_HOSTNAME }}'
FROM_EMAIL = 'noreply@{{ .Env.WEB_HOSTNAME }}'
SENDGRID_API_KEY = '{{ .Env.WEB_SENDGRID_KEY }}'
FROM_EMAIL = '{{ .Env.EMAIL_FROM_ADDRESS }}'
SENDGRID_API_KEY = '{{ .Env.EMAIL_SENDGRID_KEY }}'
SMTP_HOST = '{{ .Env.EMAIL_SMTP_HOST }}'
SMTP_PORT = int('{{ .Env.EMAIL_SMTP_PORT }}')
SMTP_USER = '{{ .Env.EMAIL_SMTP_USER }}'
SMTP_PASS = '{{ .Env.EMAIL_SMTP_PASS }}'
SMTP_SSL = {{ if eq .Env.EMAIL_SMTP_SSL "TRUE" }}True{{ else }}False{{ end }}
EMAIL_WHITELIST = []
MAX_ACCOUNT_EMAIL = 5
"""
Cryptography
------------