From 035a219f9f7e2117611bf0f906dc8e00005b40ed Mon Sep 17 00:00:00 2001 From: Brett Keller Date: Mon, 11 Jan 2021 06:35:54 -0600 Subject: [PATCH] Add support for LE expiration notification e-mails on API cert (#227) --- README.md | 2 ++ config.cfg | 2 ++ main.go | 1 + types.go | 1 + 4 files changed, 6 insertions(+) diff --git a/README.md b/README.md index f6c88ff..c3d954d 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,8 @@ tls_cert_privkey = "/etc/tls/example.org/privkey.pem" tls_cert_fullchain = "/etc/tls/example.org/fullchain.pem" # only used if tls = "letsencrypt" acme_cache_dir = "api-certs" +# optional e-mail address to which Let's Encrypt will send expiration notices for the API's cert +notification_email = "" # CORS AllowOrigins, wildcards can be used corsorigins = [ "*" diff --git a/config.cfg b/config.cfg index 9a13fbe..5fc05cf 100644 --- a/config.cfg +++ b/config.cfg @@ -43,6 +43,8 @@ tls_cert_privkey = "/etc/tls/example.org/privkey.pem" tls_cert_fullchain = "/etc/tls/example.org/fullchain.pem" # only used if tls = "letsencrypt" acme_cache_dir = "api-certs" +# optional e-mail address to which Let's Encrypt will send expiration notices for the API's cert +notification_email = "" # CORS AllowOrigins, wildcards can be used corsorigins = [ "*" diff --git a/main.go b/main.go index e9ca6e2..e93f465 100644 --- a/main.go +++ b/main.go @@ -149,6 +149,7 @@ func startHTTPAPI(errChan chan error, config DNSConfig, dnsservers []*DNSServer) DNSProvider: &provider, DNSChallengeOption: dnsopts, DefaultServerName: Config.General.Domain, + Email: Config.API.NotificationEmail, Storage: &storage, } diff --git a/types.go b/types.go index 7ad522c..235b72a 100644 --- a/types.go +++ b/types.go @@ -51,6 +51,7 @@ type httpapi struct { TLSCertPrivkey string `toml:"tls_cert_privkey"` TLSCertFullchain string `toml:"tls_cert_fullchain"` ACMECacheDir string `toml:"acme_cache_dir"` + NotificationEmail string `toml:"notification_email"` CorsOrigins []string UseHeader bool `toml:"use_header"` HeaderName string `toml:"header_name"`