1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gotosocial_ynh.git synced 2024-09-03 19:16:06 +02:00

config panel: accounts_custom_css_length

This commit is contained in:
OniriCorpe 2023-07-14 18:10:35 +02:00
parent c1d2f1d0d7
commit dbf197f17a
4 changed files with 22 additions and 1 deletions

View file

@ -439,7 +439,7 @@ accounts-allow-custom-css: __ACCOUNTS_ALLOW_CUSTOM_CSS__
# #
# Examples: [500, 5000, 9999] # Examples: [500, 5000, 9999]
# Default: 10000 # Default: 10000
accounts-custom-css-length: 10000 accounts-custom-css-length: __ACCOUNTS_CUSTOM_CSS_LENGTH__
######################## ########################
##### MEDIA CONFIG ##### ##### MEDIA CONFIG #####

View file

@ -65,6 +65,15 @@ Pour les instances avec des inscriptions publiques, il est **HAUTEMENT RECOMMAND
Quelle que soit la valeur de ce paramètre, tout CSS téléchargé ne sera pas fédéré à d'autres instances, il ne sera affiché que sur les profils et les statuts de *cette* instance.""" Quelle que soit la valeur de ce paramètre, tout CSS téléchargé ne sera pas fédéré à d'autres instances, il ne sera affiché que sur les profils et les statuts de *cette* instance."""
type = "select" type = "select"
[main.accounts.accounts_custom_css_length]
ask.en = "Custom CSS length?"
ask.fr = "Longueur du CSS personnalisé ?"
bind = "accounts-custom-css-length:__FINALPATH__/config.yaml"
default = "10000"
help.en = "If accounts-allow-custom-css is 'true', this is the permitted length in characters for CSS uploaded by accounts on this instance. No effect if accounts-allow-custom-css is 'false'. Default: 10000"
help.fr = "Si accounts-allow-custom-css est 'true', il s'agit de la longueur autorisée en caractères pour les feuilles de style CSS qui sont fournies par les comptes sur cette instance. Aucun effet si accounts-allow-custom-css est 'false'. Valeur par défaut : 10000"
type = "number"
################# #################
#### MEDIA CONFIG #### MEDIA CONFIG
################# #################

View file

@ -43,6 +43,7 @@ accounts_registration_open=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REGISTRATION_OP
accounts_approval_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_APPROVAL_REQUIRED") accounts_approval_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_APPROVAL_REQUIRED")
accounts_reason_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REASON_REQUIRED") accounts_reason_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REASON_REQUIRED")
accounts_allow_custom_css="false" accounts_allow_custom_css="false"
accounts_custom_css_length="10000"
instance_expose_peers="false" instance_expose_peers="false"
instance_expose_suspended="false" instance_expose_suspended="false"
@ -114,6 +115,7 @@ ynh_app_setting_set --app="$app" --key=accounts_registration_open --value="$acco
ynh_app_setting_set --app="$app" --key=accounts_approval_required --value="$accounts_approval_required" ynh_app_setting_set --app="$app" --key=accounts_approval_required --value="$accounts_approval_required"
ynh_app_setting_set --app="$app" --key=accounts_reason_required --value="$accounts_reason_required" ynh_app_setting_set --app="$app" --key=accounts_reason_required --value="$accounts_reason_required"
ynh_app_setting_set --app="$app" --key=accounts_allow_custom_css --value="$accounts_allow_custom_css" ynh_app_setting_set --app="$app" --key=accounts_allow_custom_css --value="$accounts_allow_custom_css"
ynh_app_setting_set --app="$app" --key=accounts_custom_css_length --value="$accounts_custom_css_length"
ynh_app_setting_set --app="$app" --key=instance_expose_peers --value="$instance_expose_peers" ynh_app_setting_set --app="$app" --key=instance_expose_peers --value="$instance_expose_peers"
ynh_app_setting_set --app="$app" --key=instance_expose_suspended --value="$instance_expose_suspended" ynh_app_setting_set --app="$app" --key=instance_expose_suspended --value="$instance_expose_suspended"

View file

@ -42,6 +42,7 @@ accounts_registration_open=$(ynh_app_setting_get --app="$app" --key=accounts_reg
accounts_approval_required=$(ynh_app_setting_get --app="$app" --key=accounts_approval_required) accounts_approval_required=$(ynh_app_setting_get --app="$app" --key=accounts_approval_required)
accounts_reason_required=$(ynh_app_setting_get --app="$app" --key=accounts_reason_required) accounts_reason_required=$(ynh_app_setting_get --app="$app" --key=accounts_reason_required)
accounts_allow_custom_css=$(ynh_app_setting_get --app="$app" --key=accounts_allow_custom_css) accounts_allow_custom_css=$(ynh_app_setting_get --app="$app" --key=accounts_allow_custom_css)
accounts_custom_css_length=$(ynh_app_setting_get --app="$app" --key=accounts_custom_css_length)
media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size) media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size)
media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size) media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size)
@ -295,6 +296,15 @@ then
fi fi
fi fi
# Upgrade from <0.10.0~ynh1:
if ynh_compare_current_package_version --comparison lt --version 0.10.0~ynh1 || [ -z "$accounts_custom_css_length" ]
then
# declaration of new parameter
accounts_custom_css_length="10000"
# registration of parameter
ynh_app_setting_set --app="$app" --key=accounts_custom_css_length --value="$accounts_custom_css_length"
fi
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================