__matrix_element: add more branding parameters

This commit is contained in:
fnux 2022-01-16 14:14:42 +01:00
parent 974e42e20e
commit 723d7ed250
No known key found for this signature in database
GPG key ID: 4502C902C00A1E12
6 changed files with 34 additions and 7 deletions

View file

@ -34,12 +34,12 @@ EOF
if [ "$BRANDING_AUTH_FOOTER_LINKS" != "" ]; then
cat << EOF
"authFooterLinks": "$BRANDING_AUTH_FOOTER_LINKS",
"authFooterLinks": $BRANDING_AUTH_FOOTER_LINKS,
EOF
fi
cat << EOF
"welcomeBackgroundUrl": "themes/element/img/backgrounds/lake.jpg"
"welcomeBackgroundUrl": "$BRANDING_WELCOME_BACKGROUND_URL"
EOF
echo '},'
}
@ -85,6 +85,10 @@ cat << EOF
"url": "$COOKIE_POLICY_URL",
"text": "Cookie Policy"
}
]
],
"embeddedPages": {
"welcomeUrl": "$WELCOME_PAGE_URL",
"homeUrl": "$HOME_PAGE_URL"
}
}
EOF

View file

@ -39,6 +39,16 @@ owner
brand
Web UI branding, defaults to 'Element'.
branding_auth_header_logo_url
A logo image that is shown in the header during authentication flows.
branding_welcome_background_url
An image to use as a wallpaper outside the app during authentication flows. If an array is passed, an image is chosen randomly for each visit.
branding_auth_footer_links
a list of links to show in the authentication page footer: `[{"text": "Link
text", "url": "https://link.target"}, {"text": "Other link", ...}]`
default_country_code
ISO 3166 alpha2 country code to use when showing country selectors, such as
phone number inputs. Defaults to GB.

View file

@ -31,6 +31,7 @@ export DEFAULT_COUNTRY_CODE=$(cat "$__object/parameter/default_country_code")
export ROOM_DIRECTORY_SERVERS=$(cat "$__object/parameter/room_directory_servers")
export PRIVACY_POLICY_URL=$(cat "$__object/parameter/privacy_policy_url")
export COOKIE_POLICY_URL=$(cat "$__object/parameter/cookie_policy_url")
export BRANDING_WELCOME_BACKGROUND_URL=$(cat "$__object/parameter/branding_welcome_background_url")
if [ -f "$__object/parameter/jitsi_domain" ]; then
export JITSI_DOMAIN=$(cat "$__object/parameter/jitsi_domain")
@ -45,14 +46,24 @@ if [ -f "$__object/parameter/branding_auth_footer_links" ]; then
fi
if [ -f "$__object/parameter/homepage" ]; then
export EMBED_HOMEPAGE=1
homepage=$(cat "$__object/parameter/homepage")
if [ -f "$homepage" ]; then
upload_homepage=1
else
export HOME_PAGE_URL=$homepage
fi
fi
WELCOME_PAGE_URL="welcome.html"
if [ -f "$__object/parameter/welcomepage" ]; then
export EMBED_WELCOMEPAGE=1
welcomepage=$(cat "$__object/parameter/welcomepage")
if [ -f welcomepage ]; then
export UPLOAD_WELCOMEPAGE=1
else
WELCOME_PAGE_URL=$welcomepage
fi
fi
export WELCOME_PAGE_URL
if [ -f "$__object/parameter/custom_asset" ]; then
"$__object/parameter/custom_asset" | while IFS= read -r file; do
@ -92,14 +103,14 @@ require="__directory/$INSTALL_DIR/cdist" __file "$INSTALL_DIR/cdist/config.json"
--mode 0664 \
--state present
if [ $EMBED_HOMEPAGE ]; then
if [ $upload_homepage ]; then
require="__directory/$INSTALL_DIR/cdist" __file "$INSTALL_DIR/cdist/home.html" \
--source "$homepage" \
--mode 0664 \
--state present
fi
if [ $EMBED_WELCOMEPAGE ]; then
if [ $upload_welcomepage ]; then
require="__directory/$INSTALL_DIR/cdist" __file "$INSTALL_DIR/cdist/welcome.html" \
--source "$welcomepage" \
--mode 0664 \

View file

@ -0,0 +1 @@
themes/element/img/backgrounds/lake.jpg

View file

@ -12,3 +12,4 @@ welcomepage
jitsi_domain
branding_auth_header_logo_url
branding_auth_footer_links
branding_welcome_background_url