Browse Source

update email settings

xcad 3 months ago
parent
commit
6d1e38bb1c
3 changed files with 11 additions and 15 deletions
  1. 1 0
      CHANGELOG.md
  2. 5 13
      cli/core/schema/compose/v1.2.json
  3. 5 2
      library/compose/netbox/compose.yaml.j2

+ 1 - 0
CHANGELOG.md

@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Compose Schema 1.2: `resources` section for CPU and memory limits
 - Compose Schema 1.2: `traefik_domain` variable for base domain configuration (#1362) - Set once, use across all services
 - Compose Schema 1.2: `database_host` now requires `database_external=true`
+- Compose Schema 1.2: `email_encryption` replaces `email_tls` and `email_ssl` with options: none, ssl, tls
 - Markdown formatting support for template descriptions and next steps (#1471)
 - Output directory flag `--output`/`-o` for `generate` command (#1534) - Replaces positional directory argument
 - Variable property `autogenerated_length` to specify custom length for auto-generated values (default: 32 characters)

+ 5 - 13
cli/core/schema/compose/v1.2.json

@@ -451,7 +451,7 @@
         "name": "email_port",
         "description": "SMTP server port",
         "type": "int",
-        "default": 587,
+        "default": 25,
         "required": true
       },
       {
@@ -474,18 +474,10 @@
         "required": true
       },
       {
-        "name": "email_use_tls",
-        "description": "Use TLS encryption",
-        "type": "bool",
-        "default": true,
-        "required": true
-      },
-      {
-        "name": "email_use_ssl",
-        "description": "Use SSL encryption",
-        "type": "bool",
-        "default": false,
-        "required": true
+        "name": "email_encryption",
+        "description": "Email encryption method to use",
+        "type": "enum",
+        "options": ["none", "starttls", "ssl"]
       }
     ]
   },

+ 5 - 2
library/compose/netbox/compose.yaml.j2

@@ -45,8 +45,11 @@ services:
       - EMAIL_FROM={{ email_from }}
       - EMAIL_USERNAME={{ email_username }}
       - EMAIL_PASSWORD=${EMAIL_PASSWORD}
-      - EMAIL_USE_SSL={{ email_use_ssl }}
-      - EMAIL_USE_TLS={{ email_use_tls }}
+      {% if email_encryption == "ssl" %}
+      - EMAIL_USE_SSL=True
+      {% elif email_encryption == "starttls" %}
+      - EMAIL_USE_TLS=True
+      {% endif %}
       {% endif %}
     networks:
       {% if traefik_enabled %}