diff --git a/.env.dev.example b/.env.dev.example index 6d5d44d6..efc75a09 100644 --- a/.env.dev.example +++ b/.env.dev.example @@ -47,3 +47,8 @@ LOG_LEVEL=debug # LOGIN_IMPRINT_URL=https://example.com/imprint # LOGIN_PRIVACY_POLICY_URL=https://example.com/privacy # LOGIN_WEBSITE_URL=https://example.com + +# Per-domain branding overrides. Each entry must have "host" (exact or +# "*.subdomain" wildcard) plus any subset of branding fields to override. +# Unset fields fall through to the global values above. +# DOMAIN_BRANDING=[{"host":"localhost","loginCompanyName":"Local Dev"}] diff --git a/.env.example b/.env.example index 5f21140e..be1fec14 100644 --- a/.env.example +++ b/.env.example @@ -225,6 +225,29 @@ LOGIN_COMPANY_NAME=Bulwark Webmail # URL for the company website link on the login page. LOGIN_WEBSITE_URL=https://bulwarkmail.org +# --------------------------------------------------------------------------- +# Per-domain branding overrides (optional) +# --------------------------------------------------------------------------- +# +# When you serve the webmail on multiple hostnames, each hostname can override +# a subset of branding fields. Unset fields fall back to the global values +# above. Match is on the request's Host (or X-Forwarded-Host) header. +# +# Use the leftmost label "*." to match any subdomain (e.g. "*.example.com" +# matches mail.example.com and any deeper subdomain, but NOT example.com). +# Exact matches always win over wildcards; the longest wildcard suffix wins +# among multiple wildcard matches. +# +# Overridable keys: appName, appShortName, appDescription, faviconUrl, +# pwaIconUrl, pwaThemeColor, pwaBackgroundColor, appLogoLightUrl, +# appLogoDarkUrl, loginLogoLightUrl, loginLogoDarkUrl, loginCompanyName, +# loginImprintUrl, loginPrivacyPolicyUrl, loginWebsiteUrl. +# +# Prefer setting this from the admin dashboard (PATCH /api/admin/config). +# The env-var form is provided for stateless deployments. +# +# DOMAIN_BRANDING=[{"host":"maildomain1.com","loginCompanyName":"Company One","loginLogoLightUrl":"/branding/one-color.svg","loginLogoDarkUrl":"/branding/one-white.svg","loginWebsiteUrl":"https://one.example"},{"host":"maildomain2.com","loginCompanyName":"Company Two","faviconUrl":"/branding/two-favicon.svg"},{"host":"*.intranet.example.com","loginCompanyName":"Internal"}] + # ============================================================================= # Extension Directory / Marketplace # ============================================================================= diff --git a/README.md b/README.md index 4abe0f3d..9dcca13a 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,12 @@ LOGIN_COMPANY_NAME=My Company LOGIN_WEBSITE_URL=https://example.com LOGIN_IMPRINT_URL=https://example.com/imprint LOGIN_PRIVACY_POLICY_URL=https://example.com/privacy + +# Per-domain overrides (optional). When the webmail is served on multiple +# hostnames, each host can override any subset of the branding fields above. +# Match is on the request Host (or X-Forwarded-Host). Use "*.example.com" to +# match any subdomain. Unset fields fall back to the global values. +DOMAIN_BRANDING=[{"host":"maildomain1.com","loginCompanyName":"Company One","loginLogoLightUrl":"/branding/one.svg"},{"host":"maildomain2.com","loginCompanyName":"Company Two"}] ```