Branding and templates: per-domain, tenant and server logos, /logo, operator calendar email templates and RSVP page (BT-1 to BT-26)
Logos resolve domain, then tenant, then server-wide, then the built-in, with subdomains finding their domain. GET /logo serves a data-URL image, redirects to a URL logo without fetching it, sandboxes SVG, and answers 404 when no custom logo applies. Emails embed the first PNG, JPEG or GIF logo. Logo and template writes are checked; stored templates are read at send time, always escaped, and fall back to the built-in with a build warning when they don't parse. The RSVP page is served byte for byte with a CSP and no-referrer. The sign-in and RSVP pages load the logo through an image element. MT-22's session logo follows the chain to the server-wide logo. Acceptance tests 1 to 17; test 18 written as the ignored branding_compat.
This commit is contained in:
@@ -18,6 +18,7 @@ use store::{BlobStore, InMemoryStore, RegistryStore, SearchStore, Store};
|
||||
|
||||
pub mod archive;
|
||||
pub mod blob;
|
||||
pub mod branding; // inbuxa: branding BT-1, BT-2
|
||||
pub mod dav;
|
||||
pub mod document;
|
||||
pub mod encryption;
|
||||
@@ -95,11 +96,27 @@ impl Server {
|
||||
self.registry().count_object(ObjectType::Domain).await
|
||||
}
|
||||
|
||||
// inbuxa: BT-9: the first logo mail can carry inline; none leaves the
|
||||
// built-in INBUXA logo
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
pub async fn logo_resource(
|
||||
&self,
|
||||
_: &str,
|
||||
domain: &str,
|
||||
) -> trc::Result<Option<crate::manager::application::Resource<Vec<u8>>>> {
|
||||
Ok(None)
|
||||
Ok(self
|
||||
.logos_for(domain)
|
||||
.await?
|
||||
.into_iter()
|
||||
.find(|logo| logo.is_embeddable())
|
||||
.and_then(|logo| match logo {
|
||||
inbuxa_features::branding::logo::Logo::Image {
|
||||
content_type,
|
||||
bytes,
|
||||
} => Some(crate::manager::application::Resource::new(
|
||||
content_type,
|
||||
bytes,
|
||||
)),
|
||||
inbuxa_features::branding::logo::Logo::Url(_) => None,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user