APIs for links and references in the ATmosphere

add acme contact

idk if this helps rate-limiting, prob not

Changed files
+11 -1
slingshot
+6
slingshot/src/main.rs
··· 31 31 /// - TODO: a rate-limiter will be installed 32 32 #[arg(long)] 33 33 host: Option<String>, 34 + /// email address for letsencrypt contact 35 + /// 36 + /// recommended in production, i guess? 37 + #[arg(long)] 38 + acme_contact: Option<String>, 34 39 /// a location to cache acme https certs 35 40 /// 36 41 /// only used if --host is specified. omitting requires re-requesting certs ··· 99 104 identity, 100 105 repo, 101 106 args.host, 107 + args.acme_contact, 102 108 args.certs, 103 109 server_shutdown, 104 110 )
+5 -1
slingshot/src/server.rs
··· 336 336 identity: Identity, 337 337 repo: Repo, 338 338 host: Option<String>, 339 + acme_contact: Option<String>, 339 340 certs: Option<PathBuf>, 340 341 _shutdown: CancellationToken, 341 342 ) -> Result<(), ServerError> { ··· 371 372 let mut auto_cert = AutoCert::builder() 372 373 .directory_url(LETS_ENCRYPT_PRODUCTION) 373 374 .domain(&host); 375 + if let Some(contact) = acme_contact { 376 + auto_cert = auto_cert.contact(contact); 377 + } 374 378 if let Some(certs) = certs { 375 - auto_cert = auto_cert.cache_path(certs) 379 + auto_cert = auto_cert.cache_path(certs); 376 380 } 377 381 let auto_cert = auto_cert.build().map_err(ServerError::AcmeBuildError)?; 378 382