mirror of
https://github.com/joaovitoriasilva/endurain.git
synced 2026-01-09 15:57:59 -05:00
Support SMTP_PASSWORD as Docker secret
Updated the application to read SMTP_PASSWORD using the read_secret method, enabling support for Docker secrets via SMTP_PASSWORD_FILE. Documentation was updated to reflect this new option for configuring SMTP credentials.
This commit is contained in:
@@ -11,7 +11,7 @@ class AppriseService:
|
||||
self.smtp_host = os.getenv("SMTP_HOST")
|
||||
self.smtp_port = int(os.getenv("SMTP_PORT", "587"))
|
||||
self.smtp_username = os.getenv("SMTP_USERNAME")
|
||||
self.smtp_password = os.getenv("SMTP_PASSWORD")
|
||||
self.smtp_password = core_config.read_secret("SMTP_PASSWORD")
|
||||
self.smtp_secure = os.getenv("SMTP_SECURE", "true").lower()
|
||||
self.smtp_secure_type = os.getenv("SMTP_SECURE_TYPE", "starttls").lower()
|
||||
self.frontend_host = core_config.ENDURAIN_HOST
|
||||
|
||||
@@ -249,7 +249,8 @@ def check_required_env_vars():
|
||||
# Email is optional but warn if not configured
|
||||
email_vars = ["SMTP_HOST", "SMTP_USERNAME", "SMTP_PASSWORD"]
|
||||
for var in email_vars:
|
||||
if var not in os.environ:
|
||||
value = read_secret(var) if var == "SMTP_PASSWORD" else os.getenv(var)
|
||||
if not value:
|
||||
core_logger.print_to_log_and_console(
|
||||
f"Email not configured (missing: {var}). Password reset feature will not work.",
|
||||
"info",
|
||||
|
||||
@@ -50,7 +50,7 @@ Table below shows supported environment variables. Variables marked with optiona
|
||||
| SMTP_HOST | No default set | Yes | The SMTP host of your email provider. Example `smtp.protonmail.ch` |
|
||||
| SMTP_PORT | 587 | Yes | The SMTP port of your email provider. Default is 587 |
|
||||
| SMTP_USERNAME | No default set | Yes | The username of your SMTP email provider, probably your email address |
|
||||
| SMTP_PASSWORD | No default set | Yes | The password of your SMTP email provider. Some providers allow the use of your account password, others require the creation of an app password. Please refer to your provider documentation |
|
||||
| SMTP_PASSWORD | No default set | Yes | The password of your SMTP email provider. Some providers allow the use of your account password, others require the creation of an app password. Please refer to your provider documentation. Alternatively, use `SMTP_PASSWORD_FILE` for Docker secrets |
|
||||
| SMTP_SECURE | true | Yes | By default it uses secure communications. Accepted values are `true` and `false` |
|
||||
| SMTP_SECURE_TYPE | starttls | Yes | If SMTP_SECURE is set you can set the communication type. Accepted values are `starttls` and `ssl` |
|
||||
|
||||
@@ -77,6 +77,7 @@ Endurain supports [Docker secrets](https://docs.docker.com/compose/how-tos/use-s
|
||||
- `DB_PASSWORD` → `DB_PASSWORD_FILE`
|
||||
- `SECRET_KEY` → `SECRET_KEY_FILE`
|
||||
- `FERNET_KEY` → `FERNET_KEY_FILE`
|
||||
- `SMTP_PASSWORD` → `SMTP_PASSWORD_FILE`
|
||||
|
||||
### Using File-Based Secrets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user