1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/element_ynh.git synced 2024-09-03 18:36:08 +02:00
This commit is contained in:
ericgaspar 2022-01-13 15:35:11 +01:00
parent e6c17a10ff
commit c9154f9799
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 87 additions and 5 deletions

View file

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

View file

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

View file

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

View file

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