diff --git a/config_panel.toml b/config_panel.toml index 9c17b0c..e056b52 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -127,7 +127,6 @@ services = ["matrix-__APP__", "nginx"] ask = "Largest allowed media upload size in bytes." type = "string" help = "Defaults to: '10M' ." - bind = ":/etc/matrix-__APP__/homeserver.yaml" [advanced] name = "Advanced Settings" diff --git a/scripts/config b/scripts/config index 63fc111..d7acf11 100644 --- a/scripts/config +++ b/scripts/config @@ -19,7 +19,7 @@ get__max_upload_size() { set__max_upload_size() { ynh_write_var_in_file --file=/etc/matrix-$app/homeserver.yaml --key=max_upload_size --value="${max_upload_size}" - sed -i -r "s|client_max_body_size\s+[[:digit:]]+M;|client_max_body_size ${max_upload_size}M;|g" "/etc/nginx/conf.d/$domain.d/$app.conf + sed -i -r "s|client_max_body_size\s+[[:digit:]]+M;|client_max_body_size ${max_upload_size}M;|g" "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_add_nginx_conf } diff --git a/scripts/install b/scripts/install index c8e0c6d..c58a37a 100644 --- a/scripts/install +++ b/scripts/install @@ -118,10 +118,7 @@ if yunohost --output-as plain app list | grep -q "^$element_instance$"; then element_domain=$(ynh_app_setting_get --app $element_instance --key domain) element_path=$(ynh_app_setting_get --app $element_instance --key path) element_ynh_url="https://""$element_domain""$element_path" - #if [ -z "$element_domain" ]; then - # element_ynh_url="https://matrix.to/" fi - web_client_location=$element_ynh_url client_base_url=$element_ynh_url invite_client_location=$element_ynh_url diff --git a/scripts/upgrade b/scripts/upgrade index e4cc811..29f63c3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -229,24 +229,27 @@ fi # SET STANDARD SETTINGS FROM DEFAULT CONFIG # Get app name of first Element Instance +element_ynh_url="https://matrix.to/" +element_domain="" +element_path="" +web_client_location=$element_ynh_url +client_base_url=$element_ynh_url +invite_client_location=$element_ynh_url +element_instance="element" if [ -z "$web_client_location" ] then - element_ynh_url="https://matrix.to/" - element_instance="element" if yunohost --output-as plain app list | grep -q "^$element_instance"'$'; then element_domain=$(ynh_app_setting_get --app $element_instance --key domain) element_path=$(ynh_app_setting_get --app $element_instance --key path) - #if [ -z "$element_domain" ]; then - #else element_ynh_url="https://""$element_domain""$element_path" fi web_client_location=$element_ynh_url client_base_url=$element_ynh_url invite_client_location=$element_ynh_url + ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location + ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url + ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location fi -ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location -ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url -ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location if [ -z "$server_statistics" ] then @@ -255,12 +258,12 @@ then fi if [ -z "$allow_public_rooms_without_auth" ] then - allow_public_rooms_without_auth=allow_public_rooms + allow_public_rooms_without_auth=$allow_public_rooms ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth fi if [ -z "$allow_public_rooms_over_federation" ] then - allow_public_rooms_over_federation=allow_public_rooms + allow_public_rooms_over_federation=$allow_public_rooms ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation fi if [ -z "$max_upload_size" ]