1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

config max_upload_size

This commit is contained in:
gredin67 2023-01-13 12:38:30 +01:00
parent 5e939bada8
commit 84eb157391
4 changed files with 18 additions and 5 deletions

View file

@ -978,7 +978,7 @@ media_storage_providers:
# your reverse proxy's config. Notably Nginx has a small max body size by default.
# See https://matrix-org.github.io/synapse/latest/reverse_proxy.html.
#
max_upload_size: 100M
max_upload_size: __MAX_UPLOAD_SIZE__
# Maximum number of pixels that will be thumbnailed
#

View file

@ -116,23 +116,29 @@ services = ["__APP__"]
[client.experience]
name = "User Experience"
[client.experience.max_upload_size]
ask = "Largest allowed media upload size in bytes."
type = "url"
help = "Defaults to: '10M' . If you are using a reverse proxy you may also need to set this value in your reverse proxy's config. Notably Nginx has a small max body size by default. See https://matrix-org.github.io/synapse/latest/reverse_proxy.html."
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[client.experience.web_client_location]
ask = "URL to the web client which / will redirect to."
type = "url"
help = "Basically Element instance the server should redirect to."
bind = "web_client_location:/etc/matrix-__APP__/homeserver.yaml"
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[client.experience.client_base_url]
ask = "URL for client links within the email notifications."
type = "url"
help = "Used to be called 'riot_base_url', still supported"
bind = "client_base_url:/etc/matrix-__APP__/homeserver.yaml"
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[client.experience.invite_client_location]
ask = "Web client location to direct users to during an invite."
type = "url"
help = "This is passed to the identity server as the org.matrix.web_client_location key. Defaults to unset, giving no guidance to the identity server."
bind = "invite_client_location:/etc/matrix-__APP__/homeserver.yaml"
bind = ":/etc/matrix-__APP__/homeserver.yaml"
[client.experience.enable_group_creation]
ask = "Allow non-server-admin Users to create Spaces?"

View file

@ -126,6 +126,7 @@ backup_before_upgrade="true"
server_statistics="false"
allow_public_rooms_without_auth="false"
allow_public_rooms_over_federation="false"
max_upload_size="10M"
disable_msisdn_registration="true"
registrations_require_3pid="email"
# here we need sed magic to transform $server_name
@ -147,6 +148,7 @@ 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
ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth
ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation
ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size
ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration
ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid
ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_3pids

View file

@ -67,6 +67,7 @@ client_base_url=$(ynh_app_setting_get --app=$app --key=client_base_url)
invite_client_location=$(ynh_app_setting_get --app=$app --key=invite_client_location)
allow_public_rooms_without_auth=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_without_auth)
allow_public_rooms_over_federation=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_over_federation)
max_upload_size=$(ynh_app_setting_get --app=$app --key=max_upload_size)
disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisdn_registration)
registrations_require_3pid=$(ynh_app_setting_get --app=$app --key=registrations_require_3pid)
allowed_local_3pids=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids)
@ -218,7 +219,6 @@ fi
# SET STANDARD SETTINGS FROM DEFAULT CONFIG
# Get app name of first Element Instance
yunohost --output-as plain domain list | grep -q "^$server_name"'$'
if [ -z "$web_client_location" ]
then
element_ynh_url="https://matrix.to/"
@ -253,6 +253,11 @@ then
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" ]
then
max_upload_size="10M"
ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size
fi
if [ -z "$disable_msisdn_registration" ]
then
disable_msisdn_registration="true"