Refactor email configuration in Terraform files for improved clarity and consistency
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
locals {
|
locals {
|
||||||
|
|
||||||
|
# general
|
||||||
domain_name = "alexpires.me"
|
domain_name = "alexpires.me"
|
||||||
|
|
||||||
|
# storage
|
||||||
|
persistent_folder = "/mnt/microk8s_persistent"
|
||||||
|
database_folder = "/var/lib"
|
||||||
|
|
||||||
# apps
|
# apps
|
||||||
wordpress_version = "6.7.2"
|
wordpress_version = "6.7.2"
|
||||||
wordpress_fqdns = ["blog.${local.domain_name}", "www.${local.domain_name}", "${local.domain_name}"]
|
wordpress_fqdns = ["blog.${local.domain_name}", "www.${local.domain_name}", "${local.domain_name}"]
|
||||||
@@ -48,18 +53,33 @@ locals {
|
|||||||
local_backup_retention_days = 2
|
local_backup_retention_days = 2
|
||||||
cloud_backup_retention_days = 3
|
cloud_backup_retention_days = 3
|
||||||
|
|
||||||
# notification
|
|
||||||
scaleway_smtp_host = "smtp.tem.scw.cloud"
|
|
||||||
scaleway_smtp_port = 587
|
|
||||||
|
|
||||||
# mail settings
|
# mail settings
|
||||||
getmail_version = "v0.0.1-6.19.07"
|
getmail_version = "v0.0.1-6.19.07"
|
||||||
fetch_emails_schedule = "*/2 * * * *"
|
fetch_emails_schedule = "*/2 * * * *"
|
||||||
mail_files_backup_cron_schedule = "0 3 * * *"
|
mail_files_backup_cron_schedule = "0 3 * * *"
|
||||||
|
|
||||||
# storage
|
# email settings
|
||||||
persistent_folder = "/mnt/microk8s_persistent"
|
scaleway_smtp_host = "smtp.tem.scw.cloud"
|
||||||
database_folder = "/var/lib"
|
scaleway_smtp_port = 587
|
||||||
|
email_accounts = [
|
||||||
|
{
|
||||||
|
domain = "alexpires.me"
|
||||||
|
recipient = "c.alexandre.pires"
|
||||||
|
receive = {
|
||||||
|
type = "imap"
|
||||||
|
server = "mail-pt.securemail.pro"
|
||||||
|
port = 993
|
||||||
|
}
|
||||||
|
send = {
|
||||||
|
server = "smtp-pt.securemail.pro"
|
||||||
|
port = 465
|
||||||
|
}
|
||||||
|
username = var.alexpires_me_email_username
|
||||||
|
password = var.alexpires_me_email_password
|
||||||
|
mailboxes = ["INBOX", "Sent", "Drafts", "Trash", "Spam"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data "scaleway_account_project" "default" {
|
data "scaleway_account_project" "default" {
|
||||||
|
|||||||
@@ -1,29 +1,9 @@
|
|||||||
locals {
|
locals {
|
||||||
mail_path = "${local.persistent_folder}/mail"
|
mail_path = "${local.persistent_folder}/mail"
|
||||||
mailboxes_path = "${local.mail_path}/mailboxes"
|
mailboxes_path = "${local.mail_path}/mailboxes"
|
||||||
getmail_path = "${local.mail_path}/getmail"
|
getmail_path = "${local.mail_path}/getmail"
|
||||||
postfix_path = "${local.mail_path}/postfix"
|
postfix_path = "${local.mail_path}/postfix"
|
||||||
mail_backup_path = "${local.persistent_folder}/backup.mail"
|
mail_backup_path = "${local.persistent_folder}/backup.mail"
|
||||||
email_domain_name = "alexpires.me"
|
|
||||||
|
|
||||||
email_accounts = [
|
|
||||||
{
|
|
||||||
domain = "alexpires.me"
|
|
||||||
recipient = "c.alexandre.pires"
|
|
||||||
receive = {
|
|
||||||
type = "imap"
|
|
||||||
server = "mail-pt.securemail.pro"
|
|
||||||
port = 993
|
|
||||||
}
|
|
||||||
send = {
|
|
||||||
server = "smtp-pt.securemail.pro"
|
|
||||||
port = 465
|
|
||||||
}
|
|
||||||
username = var.alexpires_me_email_username
|
|
||||||
password = var.alexpires_me_email_password
|
|
||||||
mailboxes = ["INBOX", "Sent", "Drafts", "Trash", "Spam"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
getmail_jobs = flatten([
|
getmail_jobs = flatten([
|
||||||
for account in local.email_accounts : [
|
for account in local.email_accounts : [
|
||||||
@@ -45,10 +25,10 @@ locals {
|
|||||||
# Email configuration
|
# Email configuration
|
||||||
SMTP_HOST = local.scaleway_smtp_host
|
SMTP_HOST = local.scaleway_smtp_host
|
||||||
SMTP_PORT = 465
|
SMTP_PORT = 465
|
||||||
MY_PRIMARY_DOMAIN = local.email_domain_name
|
MY_PRIMARY_DOMAIN = local.domain_name
|
||||||
MY_DESTINATION = join(",", [for account in local.email_accounts : account.domain])
|
MY_DESTINATION = join(",", [for account in local.email_accounts : account.domain])
|
||||||
MY_NETWORKS = "127.0.0.0/8"
|
MY_NETWORKS = "127.0.0.0/8"
|
||||||
MAILNAME = "smtp.alexpires.me"
|
MAILNAME = "smtp.${local.domain_name}"
|
||||||
DOVECOT_AUTH_ADDRESS = "dovecot-auth.mail.svc.cluster.local"
|
DOVECOT_AUTH_ADDRESS = "dovecot-auth.mail.svc.cluster.local"
|
||||||
DOVECOT_AUTH_PORT = 31000
|
DOVECOT_AUTH_PORT = 31000
|
||||||
DOVECOT_LMTP_ADDRESS = "dovecot-lmtp.mail.svc.cluster.local"
|
DOVECOT_LMTP_ADDRESS = "dovecot-lmtp.mail.svc.cluster.local"
|
||||||
|
|||||||
Reference in New Issue
Block a user