diff --git a/slingshot/src/main.rs b/slingshot/src/main.rs index c14862c..4cbd0a7 100644 --- a/slingshot/src/main.rs +++ b/slingshot/src/main.rs @@ -31,6 +31,11 @@ struct Args { /// - TODO: a rate-limiter will be installed #[arg(long)] host: Option, + /// email address for letsencrypt contact + /// + /// recommended in production, i guess? + #[arg(long)] + acme_contact: Option, /// a location to cache acme https certs /// /// only used if --host is specified. omitting requires re-requesting certs @@ -99,6 +104,7 @@ async fn main() -> Result<(), String> { identity, repo, args.host, + args.acme_contact, args.certs, server_shutdown, ) diff --git a/slingshot/src/server.rs b/slingshot/src/server.rs index ae22afd..9fa723e 100644 --- a/slingshot/src/server.rs +++ b/slingshot/src/server.rs @@ -336,6 +336,7 @@ pub async fn serve( identity: Identity, repo: Repo, host: Option, + acme_contact: Option, certs: Option, _shutdown: CancellationToken, ) -> Result<(), ServerError> { @@ -371,8 +372,11 @@ pub async fn serve( let mut auto_cert = AutoCert::builder() .directory_url(LETS_ENCRYPT_PRODUCTION) .domain(&host); + if let Some(contact) = acme_contact { + auto_cert = auto_cert.contact(contact); + } if let Some(certs) = certs { - auto_cert = auto_cert.cache_path(certs) + auto_cert = auto_cert.cache_path(certs); } let auto_cert = auto_cert.build().map_err(ServerError::AcmeBuildError)?;