diff --git a/conf/config.json b/conf/config.json index fb0a558..d2432a8 100644 --- a/conf/config.json +++ b/conf/config.json @@ -1,13 +1,53 @@ { - "default_hs_url": "https://__DEFAULT_HOME_SERVER__", - "default_is_url": "https://vector.im", + "default_server_config": { + "m.homeserver": { + "base_url": "https://__DEFAULT_HOME_SERVER__", + "server_name": "matrix.org" + }, + "m.identity_server": { + "base_url": "https://vector.im" + } + }, + "disable_custom_urls": false, + "disable_guests": false, + "disable_login_language_selector": false, + "disable_3pid_login": false, "brand": "Element", "integrations_ui_url": "https://scalar.vector.im/", "integrations_rest_url": "https://scalar.vector.im/api", - "enableLabs": true, + "integrations_widgets_urls": [ + "https://scalar.vector.im/_matrix/integrations/v1", + "https://scalar.vector.im/api", + "https://scalar-staging.vector.im/_matrix/integrations/v1", + "https://scalar-staging.vector.im/api", + "https://scalar-staging.riot.im/scalar/api" + ], + "bug_report_endpoint_url": "https://element.io/bugreports/submit", + "defaultCountryCode": "GB", + "showLabsSettings": false, + "features": { }, + "default_federate": true, + "default_theme": "light", "roomDirectory": { "servers": [ "matrix.org" ] + }, + "piwik": { + "url": "https://piwik.riot.im/", + "whitelistedHSUrls": ["https://matrix.org"], + "whitelistedISUrls": ["https://vector.im", "https://matrix.org"], + "siteId": 1 + }, + "enable_presence_by_hs_url": { + "https://matrix.org": false, + "https://matrix-client.matrix.org": false + }, + "settingDefaults": { + "breadcrumbs": true + }, + "jitsi": { + "preferredDomain": "jitsi.riot.im" } } + diff --git a/config_panel.toml b/config_panel.toml index d1c115d..fffcf66 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -4,10 +4,21 @@ version = "1.0" name = "Element configuration" [main.config] - name = "Home server Configuration" + name = "Server Configuration" [main.config.default_home_server] ask = "Choose a default home server" type = "string" default = "matrix.org" - bind = "default_hs_url:__FINALPATH__/config.json" + bind = "base_url:__FINALPATH__/config.json" + + [main.config.enable_labs] + ask = "Enable labs settings" + type = "boolean" + bind = "showLabsSettings:__FINALPATH__/config.json" + + [main.config.default_theme] + ask = "Choose a theme" + type = "select" + choices = ["light", "dark"] + bind = "default_theme:__FINALPATH__/config.json" diff --git a/scripts/install b/scripts/install index 39c9aec..bd1e692 100644 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,9 @@ default_home_server=$YNH_APP_ARG_DEFAULT_HOME_SERVER app=$YNH_APP_INSTANCE_NAME +enable_labs="true" +default_theme="light" + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -47,6 +50,8 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=default_home_server --value=$default_home_server +ynh_app_setting_set --app=$app --key=enable_labs --value=$enable_labs +ynh_app_setting_set --app=$app --key=default_theme --value=$default_theme #================================================= # CREATE DEDICATED USER diff --git a/scripts/upgrade b/scripts/upgrade index e6e1c85..20355a8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,8 @@ 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) +enable_labs=$(ynh_app_setting_get --app=$app --key=enable_labs) +default_theme=$(ynh_app_setting_get --app=$app --key=default_theme) #================================================= # CHECK VERSION @@ -41,6 +43,30 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 + +# If enable_labs doesn't exist, create it +if [ -z "$enable_labs" ]; then + enable_labs="true" + ynh_app_setting_set --app=$app --key=enable_labs --value=$enable_labs +fi + +# If default_theme doesn't exist, create it +if [ -z "$default_theme" ]; then + default_theme="light" + ynh_app_setting_set --app=$app --key=default_theme --value=$default_theme +fi + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # CREATE DEDICATED USER #=================================================