Browse Source

__matrix_element: add more branding parameters

pull/13/head
fnux 6 months ago
parent
commit
723d7ed250
No known key found for this signature in database
GPG Key ID: 4502C902C00A1E12
  1. 10
      type/__matrix_element/files/config.json.sh
  2. 10
      type/__matrix_element/man.rst
  3. 19
      type/__matrix_element/manifest
  4. 1
      type/__matrix_element/parameter/default/branding_welcome_background_url
  5. 0
      type/__matrix_element/parameter/default/identity_server
  6. 1
      type/__matrix_element/parameter/optional

10
type/__matrix_element/files/config.json.sh

@ -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

10
type/__matrix_element/man.rst

@ -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.

19
type/__matrix_element/manifest

@ -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 \

1
type/__matrix_element/parameter/default/branding_welcome_background_url

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

0
type/__matrix_element/parameter/default/identity_server

1
type/__matrix_element/parameter/optional

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

Loading…
Cancel
Save