diff --git a/conf/config.json b/conf/config.json index b196d88..5b895ab 100644 --- a/conf/config.json +++ b/conf/config.json @@ -33,6 +33,9 @@ "matrix.org" ] }, + "branding": { + "welcome_background_url": "--WELCOME_BACKGROUND_URL__", + }, "piwik": { "url": "https://piwik.riot.im/", "whitelistedHSUrls": ["https://matrix.org"], diff --git a/config_panel.toml b/config_panel.toml index 32553dc..d720e69 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -12,3 +12,10 @@ name = "Element configuration" default = "https://matrix-client.matrix.org" pattern.regexp = '^https://' bind = "base_url:__FINALPATH__/config.json" + + [main.config.welcome_background_url] + ask = "Welcome background URL" + type = "file" + accept = ".png, .jpg" + help = "When a string, the URL for the full-page image background of the login, registration, and welcome pages. This property can additionally be an array to have the app choose an image at random from the selections." + bind = "welcome_background_url:__FINALPATH__/config.json" diff --git a/scripts/install b/scripts/install index 39c9aec..b5020d3 100644 --- a/scripts/install +++ b/scripts/install @@ -25,6 +25,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC default_home_server=$YNH_APP_ARG_DEFAULT_HOME_SERVER +welcome_background_url=$"" app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/upgrade b/scripts/upgrade index ba4ec4c..05991b5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) default_home_server=$(ynh_app_setting_get --app=$app --key=default_home_server) +welcome_background_url=$(ynh_app_setting_get --app=$app --key=welcome_background_url) #================================================= # CHECK VERSION @@ -52,6 +53,12 @@ if [ -z "$default_home_server" ]; then ynh_app_setting_set --app=$app --key=default_home_server --value=$default_home_server fi +# If welcome_background_url doesn't exist, create it +if [ -z "$welcome_background_url" ]; then + welcome_background_url="https://matrix-client.matrix.org" + ynh_app_setting_set --app=$app --key=welcome_background_url --value=$welcome_background_url +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all