|
|
|
@ -124,17 +124,17 @@ pub struct ManagedDomain { |
|
|
|
|
pub trait Manager: Sync + Send { |
|
|
|
|
fn get_settings(&self, domain: &domain::Name) -> Result<GetSettingsResult, GetSettingsError>; |
|
|
|
|
|
|
|
|
|
fn get_file<'store>( |
|
|
|
|
&'store self, |
|
|
|
|
fn get_file( |
|
|
|
|
&self, |
|
|
|
|
domain: &domain::Name, |
|
|
|
|
path: &str, |
|
|
|
|
) -> Result<util::BoxByteStream, GetFileError>; |
|
|
|
|
|
|
|
|
|
fn sync_with_settings<'mgr>( |
|
|
|
|
&'mgr self, |
|
|
|
|
fn sync_with_settings( |
|
|
|
|
&self, |
|
|
|
|
domain: domain::Name, |
|
|
|
|
settings: domain::Settings, |
|
|
|
|
) -> util::BoxFuture<'mgr, Result<(), SyncWithSettingsError>>; |
|
|
|
|
) -> util::BoxFuture<'_, Result<(), SyncWithSettingsError>>; |
|
|
|
|
|
|
|
|
|
fn get_acme_http01_challenge_key( |
|
|
|
|
&self, |
|
|
|
@ -206,7 +206,11 @@ impl ManagerImpl { |
|
|
|
|
fn sync_domain_gemini_cert(&self, domain: &domain::Name) -> unexpected::Result<()> { |
|
|
|
|
if let Some(ref gemini_store) = self.gemini_store { |
|
|
|
|
log::info!("Syncing gemini certificate for domain {domain}"); |
|
|
|
|
if let Some(_) = gemini_store.get_certificate(domain).or_unexpected()? { |
|
|
|
|
if gemini_store |
|
|
|
|
.get_certificate(domain) |
|
|
|
|
.or_unexpected()? |
|
|
|
|
.is_some() |
|
|
|
|
{ |
|
|
|
|
return Ok(()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -332,8 +336,8 @@ impl Manager for ManagerImpl { |
|
|
|
|
Ok(GetSettingsResult::Stored(self.domain_store.get(domain)?)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fn get_file<'store>( |
|
|
|
|
&'store self, |
|
|
|
|
fn get_file( |
|
|
|
|
&self, |
|
|
|
|
domain: &domain::Name, |
|
|
|
|
path: &str, |
|
|
|
|
) -> Result<util::BoxByteStream, GetFileError> { |
|
|
|
@ -364,11 +368,11 @@ impl Manager for ManagerImpl { |
|
|
|
|
Ok(f) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fn sync_with_settings<'mgr>( |
|
|
|
|
&'mgr self, |
|
|
|
|
fn sync_with_settings( |
|
|
|
|
&self, |
|
|
|
|
domain: domain::Name, |
|
|
|
|
settings: domain::Settings, |
|
|
|
|
) -> util::BoxFuture<'mgr, Result<(), SyncWithSettingsError>> { |
|
|
|
|
) -> util::BoxFuture<'_, Result<(), SyncWithSettingsError>> { |
|
|
|
|
Box::pin(async move { |
|
|
|
|
let is_interface = Some(&domain) == self.config.interface_domain.as_ref(); |
|
|
|
|
let is_builtin = self.config.builtin_domains.contains_key(&domain); |
|
|
|
@ -440,8 +444,8 @@ impl Manager for ManagerImpl { |
|
|
|
|
|
|
|
|
|
self.config |
|
|
|
|
.proxied_domains |
|
|
|
|
.iter() |
|
|
|
|
.map(|(domain, _)| ManagedDomain { |
|
|
|
|
.keys() |
|
|
|
|
.map(|domain| ManagedDomain { |
|
|
|
|
domain: domain.clone(), |
|
|
|
|
public: false, |
|
|
|
|
}) |
|
|
|
@ -456,8 +460,8 @@ impl Manager for ManagerImpl { |
|
|
|
|
|
|
|
|
|
self.config |
|
|
|
|
.external_domains |
|
|
|
|
.iter() |
|
|
|
|
.map(|(domain, _)| ManagedDomain { |
|
|
|
|
.keys() |
|
|
|
|
.map(|domain| ManagedDomain { |
|
|
|
|
domain: domain.clone(), |
|
|
|
|
public: false, |
|
|
|
|
}) |
|
|
|
|