This commit is contained in:
Daniel Berteaud 2024-01-31 16:19:36 +01:00
parent 7719485f0d
commit 47162a8d09
5 changed files with 19 additions and 6 deletions

View File

@ -1,4 +1,4 @@
FROM danielberteaud/alpine:24.1-2 FROM danielberteaud/alpine:24.1-8
MAINTAINER Daniel Berteaud <dbd@ehtrace.com> MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
# Taken from https://github.com/devture/exim-relay # Taken from https://github.com/devture/exim-relay

View File

@ -28,6 +28,18 @@ job "smtp-relay" {
sidecar_service { sidecar_service {
} }
sidecar_task { sidecar_task {
config {
args = [
"-c",
"${NOMAD_SECRETS_DIR}/envoy_bootstrap.json",
"-l",
"${meta.connect.log_level}",
"--concurrency",
"${meta.connect.proxy_concurrency}",
"--disable-hot-restart"
]
}
resources { resources {
cpu = 50 cpu = 50
memory = 64 memory = 64
@ -64,7 +76,7 @@ job "smtp-relay" {
data = <<_EOF data = <<_EOF
# SMTP Auth # SMTP Auth
SMTP_USERNAME=smtp@example.org SMTP_USERNAME=smtp@example.org
SMTP_PASSWORD={{ with secret "kv/service/smtp-relay" }}{{ .Data.data.pwd }}{{ end }} SMTP_PASSWORD={{ with secret "/kv/service/smtp-relay" }}{{ .Data.data.pwd }}{{ end }}
_EOF _EOF
destination = "secrets/env" destination = "secrets/env"
uid = 100000 uid = 100000
@ -78,6 +90,7 @@ _EOF
destination = "/var/spool/exim" destination = "/var/spool/exim"
} }
resources { resources {
cpu = 10 cpu = 10
memory = 20 memory = 20

View File

@ -1,3 +1,3 @@
path "kv/data/service/smtp-relay" { path "/kv/data/service/smtp-relay" {
capabilities = ["read"] capabilities = ["read"]
} }

View File

@ -11,7 +11,7 @@ mail:
# Number of instances to run # Number of instances to run
count: 1 count: 1
# Resources to allocation # Resources to allocate
resources: resources:
cpu: 10 cpu: 10
memory: 20 memory: 20
@ -24,7 +24,7 @@ mail:
port: 587 port: 587
tls: True tls: True
user: smtp@example.org user: smtp@example.org
password: '{{ with secret "[[ .vault.prefix ]]kv/service/[[ .instance ]]" }}{{ .Data.data.pwd }}{{ end }}' password: '{{ with secret "[[ .vault.root ]]kv/service/[[ .instance ]]" }}{{ .Data.data.pwd }}{{ end }}'
# The volume to use for /var/spool/postfix # The volume to use for /var/spool/postfix
volume: volume:

View File

@ -1,3 +1,3 @@
path "[[ .vault.prefix ]]kv/data/service/smtp-relay" { path "[[ .vault.root ]]kv/data/service/[[ .instance ]]" {
capabilities = ["read"] capabilities = ["read"]
} }