mirror of
https://github.com/YunoHost-Apps/gotosocial_ynh.git
synced 2024-09-03 19:16:06 +02:00
add new version settings
This commit is contained in:
parent
01ba2df125
commit
8b6cf84ddb
4 changed files with 135 additions and 5 deletions
|
@ -186,6 +186,19 @@ instance-expose-peers: __INSTANCE_EXPOSE_PEERS__
|
|||
# Default: false
|
||||
instance-expose-suspended: __INSTANCE_EXPOSE_SUSPENDED__
|
||||
|
||||
# Bool. This flag tweaks whether GoToSocial will deliver ActivityPub messages
|
||||
# to the shared inbox of a recipient, if one is available, instead of delivering
|
||||
# each message to each actor who should receive a message individually.
|
||||
#
|
||||
# Shared inbox delivery can significantly reduce network load when delivering
|
||||
# to multiple recipients share an inbox (eg., on large Mastodon instances).
|
||||
#
|
||||
# See: https://www.w3.org/TR/activitypub/#shared-inbox-delivery
|
||||
#
|
||||
# Options: [true, false]
|
||||
# Default: true
|
||||
instance-deliver-to-shared-inboxes: __INSTANCE_DELIVER_TO_SHARED_INBOXES__
|
||||
|
||||
###########################
|
||||
##### ACCOUNTS CONFIG #####
|
||||
###########################
|
||||
|
@ -207,11 +220,27 @@ accounts-approval-required: __ACCOUNTS_APPROVAL_REQUIRED__
|
|||
# Default: true
|
||||
accounts-reason-required: __ACCOUNTS_REASON_REQUIRED__
|
||||
|
||||
# Bool. Allow accounts on this instance to set custom CSS for their profile pages and statuses.
|
||||
# Enabling this setting will allow accounts to upload custom CSS via the /user settings page,
|
||||
# which will then be rendered on the web view of the account's profile and statuses.
|
||||
#
|
||||
# For instances with public sign ups, it is **HIGHLY RECOMMENDED** to leave this setting on 'false',
|
||||
# since setting it to true allows malicious accounts to make their profile pages misleading, unusable
|
||||
# or even dangerous to visitors. In other words, you should only enable this setting if you trust
|
||||
# the users on your instance not to produce harmful CSS.
|
||||
#
|
||||
# Regardless of what this value is set to, any uploaded CSS will not be federated to other instances,
|
||||
# it will only be shown on profiles and statuses on *this* instance.
|
||||
#
|
||||
# Options: [true, false]
|
||||
# Default: false
|
||||
accounts-allow-custom-css: __ACCOUNTS_ALLOW_CUSTOM_CSS__
|
||||
|
||||
########################
|
||||
##### MEDIA CONFIG #####
|
||||
########################
|
||||
|
||||
# Config pertaining to user media uploads (videos, image, image descriptions).
|
||||
# Config pertaining to media uploads (videos, image, image descriptions, emoji).
|
||||
|
||||
# Int. Maximum allowed image upload size in bytes.
|
||||
# Examples: [2097152, 10485760]
|
||||
|
@ -244,6 +273,22 @@ media-description-max-chars: __MEDIA_DESCRIPTION_MAX_CHARS__
|
|||
# Default: 30
|
||||
media-remote-cache-days: __MEDIA_REMOTE_CACHE_DAYS__
|
||||
|
||||
# Int. Max size in bytes of emojis uploaded to this instance via the admin API.
|
||||
# The default is the same as the Mastodon size limit for emojis (50kb), which allows
|
||||
# for good interoperability. Raising this limit may cause issues with federation
|
||||
# of your emojis to other instances, so beware.
|
||||
# Examples: [51200, 102400]
|
||||
# Default: 51200
|
||||
media-emoji-local-max-size: __MEDIA_EMOJI_LOCAL_MAX_SIZE__
|
||||
|
||||
# Int. Max size in bytes of emojis to download from other instances.
|
||||
# By default this is 100kb, or twice the size of the default for media-emoji-local-max-size.
|
||||
# This strikes a good balance between decent interoperability with instances that have
|
||||
# higher emoji size limits, and not taking up too much space in storage.
|
||||
# Examples: [51200, 102400]
|
||||
# Default: 51200
|
||||
media-emoji-remote-max-size: __MEDIA_EMOJI_REMOTE_MAX_SIZE__
|
||||
|
||||
##########################
|
||||
##### STORAGE CONFIG #####
|
||||
##########################
|
||||
|
|
|
@ -48,6 +48,22 @@ help.en = "Are sign up requests required to submit a reason for the request (eg.
|
|||
help.fr = "Les demandes d'inscription doivent-elles être motivées (par exemple, par une explication de la raison pour laquelle la personne souhaite rejoindre l'instance) ?"
|
||||
type = "select"
|
||||
|
||||
[gotosocial.accounts.allow_custom_css]
|
||||
ask.en = "Allow custom CSS?"
|
||||
ask.fr = "Autoriser le CSS personnalisé ?"
|
||||
bind = "accounts-allow-custom-css:__FINALPATH__/config.yaml"
|
||||
choices = ["true", "false"]
|
||||
default = "false"
|
||||
help.en = """Allow accounts on this instance to set custom CSS for their profile pages and statuses.\
|
||||
Enabling this setting will allow accounts to upload custom CSS via the /user settings page, which will then be rendered on the web view of the account's profile and statuses.\
|
||||
For instances with public sign ups, it is **HIGHLY RECOMMENDED** to leave this setting on 'false', since setting it to true allows malicious accounts to make their profile pages misleading, unusable or even dangerous to visitors. In other words, you should only enable this setting if you trust the users on your instance not to produce harmful CSS.\
|
||||
Regardless of what this value is set to, any uploaded CSS will not be federated to other instances, it will only be shown on profiles and statuses on *this* instance."""
|
||||
help.fr = """Autoriser les comptes de cette instance à définir un CSS personnalisé pour leurs pages de profil et leurs statuts.\
|
||||
En activant ce paramètre, les comptes pourront télécharger des feuilles de style CSS personnalisées via la page de configuration de l'utilisateur-ice /user, qui seront ensuite affichées sur la page Web du profil et des statuts du compte.\
|
||||
Pour les instances avec des inscriptions publiques, il est **HAUTEMENT RECOMMANDÉ** de laisser ce paramètre sur "false", car le mettre sur "true" permet aux comptes malveillants de rendre leurs pages de profil trompeuses, inutilisables ou même dangereuses pour les visiteurs. En d'autres termes, vous ne devez activer ce paramètre que si vous avez confiance dans le fait que les utilisateurs de votre instance ne produisent pas de CSS dangereux.\
|
||||
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"
|
||||
|
||||
#################
|
||||
#### MEDIA CONFIG
|
||||
#################
|
||||
|
@ -98,20 +114,48 @@ ask.en = "Number of days to cache media from remote instances before they are re
|
|||
ask.fr = "Nombre de jours de mise en cache des médias des instances distantes avant qu'ils ne soient retirés du cache."
|
||||
bind = "media-remote-cache-days:__FINALPATH__/config.yaml"
|
||||
default = "30"
|
||||
help.en = """\
|
||||
Default: 30\
|
||||
help.en = """Default: 30\
|
||||
A job will run every day at midnight to clean up any remote media older than the given amount of days. \
|
||||
When remote media is removed from the cache, it is deleted from storage but the database entries for the media are kept so that it can be fetched again if requested by a user.\
|
||||
If this is set to 0, then media from remote instances will be cached indefinitely.\
|
||||
"""
|
||||
help.fr = """\
|
||||
Valeur par défaut : 30\
|
||||
help.fr = """Valeur par défaut : 30\
|
||||
Une tâche est exécutée tous les soirs à minuit pour nettoyer les médias distants datant de plus d'un certain nombre de jours.\
|
||||
Lorsque le média distant est supprimé du cache, il est supprimé du stockage mais les entrées de la base de données pour le média sont conservées afin qu'il puisse être récupéré si un utilisateur le demande.\
|
||||
Si la valeur 0 est attribuée à ce paramètre, les médias des instances distantes sont mis en cache indéfiniment.\
|
||||
"""
|
||||
type = "number"
|
||||
|
||||
[gotosocial.media.media_emoji_local_max_size]
|
||||
ask.en = "Number of days to cache media from remote instances before they are removed from the cache."
|
||||
ask.fr = "Nombre de jours de mise en cache des médias des instances distantes avant qu'ils ne soient retirés du cache."
|
||||
bind = "media-emoji-local-max-size:__FINALPATH__/config.yaml"
|
||||
default = "51200"
|
||||
help.en = """Default: 51200\
|
||||
Max size in bytes of emojis uploaded to this instance via the admin API.\
|
||||
The default is the same as the Mastodon size limit for emojis (50kb), which allows for good interoperability.\
|
||||
Raising this limit may cause issues with federation of your emojis to other instances, so beware."""
|
||||
help.fr = """Valeur par défaut : 51200\
|
||||
Taille maximale en octets des emojis téléchargés vers cette instance via l'API d'administration.\
|
||||
La valeur par défaut est la même que la limite de taille des emojis de Mastodon (50 ko), ce qui permet une bonne interopérabilité.\
|
||||
Si vous augmentez cette limite, vous risquez d'avoir des problèmes avec la fédération de vos emojis à d'autres instances, alors faites preuve de prudence."""
|
||||
type = "number"
|
||||
|
||||
[gotosocial.media.media_emoji_remote_max_size]
|
||||
ask.en = "Number of days to cache media from remote instances before they are removed from the cache."
|
||||
ask.fr = "Nombre de jours de mise en cache des médias des instances distantes avant qu'ils ne soient retirés du cache."
|
||||
bind = "media-emoji-remote-max-size:__FINALPATH__/config.yaml"
|
||||
default = "102400"
|
||||
help.en = """Default: 102400\
|
||||
Max size in bytes of emojis to download from other instances.\
|
||||
By default this is 100kb, or twice the size of the default for media-emoji-local-max-size.\
|
||||
This strikes a good balance between decent interoperability with instances that have higher emoji size limits, and not taking up too much space in storage."""
|
||||
help.fr = """Valeur par défaut : 102400\
|
||||
Taille maximale en octets des emojis à télécharger depuis d'autres instances.\
|
||||
Par défaut, cette taille est de 100 Ko, soit le double de la taille par défaut de media-emoji-local-max-size (le paramètre précédent).\
|
||||
Cette valeur représente un bon équilibre entre une interopérabilité décente avec les instances qui ont des limites de taille d'emoji plus élevées et le fait de ne pas prendre trop d'espace de stockage."""
|
||||
type = "number"
|
||||
|
||||
###################
|
||||
### STATUSES CONFIG
|
||||
###################
|
||||
|
@ -195,3 +239,17 @@ default = "false"
|
|||
help.en = "Allow unauthenticated users to make queries to /api/v1/instance/peers?filter=suspended in order to see a list of instances that this instance blocks/suspends. This will also allow unauthenticated users to see the list through the web UI. Even if set to 'false', then authenticated users (members of the instance) will still be able to query the endpoint."
|
||||
help.fr = "Permet aux utilisateurs non authentifiés d'effectuer des requêtes API sur /api/v1/instance/peers?filter=suspended afin de voir la liste des instances bloquées ou suspendues par votre instance. Cela permettra également aux utilisateurs non authentifiés de consulter la liste via l'interface Web. Même s'il est défini à 'false', les utilisateurs authentifiés (membres de l'instance) seront toujours en mesure d'interroger l'API."
|
||||
type = "select"
|
||||
|
||||
[gotosocial.instance.instance_deliver_to_shared_inboxes]
|
||||
ask.en = "Deliver to shared inboxes?"
|
||||
ask.fr = "Envoi en boites partagées ?"
|
||||
bind = "instance-deliver-to-shared-inboxes:__FINALPATH__/config.yaml"
|
||||
choices = ["true", "false"]
|
||||
default = "true"
|
||||
help.en = """This flag tweaks whether GoToSocial will deliver ActivityPub messages to the shared inbox of a recipient, if one is available, instead of delivering each message to each actor who should receive a message individually.\
|
||||
Shared inbox delivery can significantly reduce network load when delivering to multiple recipients share an inbox (eg., on large Mastodon instances).\
|
||||
See: https://www.w3.org/TR/activitypub/#shared-inbox-delivery"""
|
||||
help.fr = """Ce paramètre détermine si GoToSocial livrera les messages ActivityPub à la boîte de réception partagée d'un destinataire, si une boîte de réception est disponible, au lieu de livrer chaque message à chaque acteur qui devrait recevoir un message individuellement.\
|
||||
La livraison dans la boîte de réception partagée peut réduire de manière significative la charge du réseau lorsque la livraison à plusieurs destinataires partagent une boîte de réception (par exemple, sur les grandes instances Mastodon).\
|
||||
Voir : https://www.w3.org/TR/activitypub/#shared-inbox-delivery"""
|
||||
type = "select"
|
||||
|
|
|
@ -40,15 +40,19 @@ password="$YNH_APP_ARG_PASSWORD"
|
|||
accounts_registration_open=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REGISTRATION_OPEN")
|
||||
accounts_approval_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_APPROVAL_REQUIRED")
|
||||
accounts_reason_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REASON_REQUIRED")
|
||||
accounts_allow_custom_css="false"
|
||||
|
||||
instance_expose_peers="false"
|
||||
instance_expose_suspended="false"
|
||||
instance_deliver_to_shared_inboxes="true"
|
||||
|
||||
media_image_max_size="10485760"
|
||||
media_video_max_size="41943040"
|
||||
media_description_min_chars="0"
|
||||
media_description_max_chars="500"
|
||||
media_remote_cache_days="30"
|
||||
media_emoji_local_max_size="51200"
|
||||
media_emoji_remote_max_size="102400"
|
||||
|
||||
statuses_max_chars="5000"
|
||||
statuses_cw_max_chars="100"
|
||||
|
@ -86,15 +90,19 @@ ynh_app_setting_set --app="$app" --key=password --value="$password"
|
|||
ynh_app_setting_set --app="$app" --key=accounts_registration_open --value="$accounts_registration_open"
|
||||
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_allow_custom_css --value="$accounts_allow_custom_css"
|
||||
|
||||
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_deliver_to_shared_inboxes --value="$instance_deliver_to_shared_inboxes"
|
||||
|
||||
ynh_app_setting_set --app="$app" --key=media_image_max_size --value="$media_image_max_size"
|
||||
ynh_app_setting_set --app="$app" --key=media_video_max_size --value="$media_video_max_size"
|
||||
ynh_app_setting_set --app="$app" --key=media_description_min_chars --value="$media_description_min_chars"
|
||||
ynh_app_setting_set --app="$app" --key=media_description_max_chars --value="$media_description_max_chars"
|
||||
ynh_app_setting_set --app="$app" --key=media_remote_cache_days --value="$media_remote_cache_days"
|
||||
ynh_app_setting_set --app="$app" --key=media_emoji_local_max_size --value="$media_emoji_local_max_size"
|
||||
ynh_app_setting_set --app="$app" --key=media_emoji_remote_max_size --value="$media_emoji_remote_max_size"
|
||||
|
||||
ynh_app_setting_set --app="$app" --key=statuses_max_chars --value="$statuses_max_chars"
|
||||
ynh_app_setting_set --app="$app" --key=statuses_cw_max_chars --value="$statuses_cw_max_chars"
|
||||
|
|
|
@ -32,16 +32,20 @@ datadir=$(ynh_app_setting_get --app="$app" --key=datadir)
|
|||
|
||||
instance_expose_peers=$(ynh_app_setting_get --app="$app" --key=instance_expose_peers)
|
||||
instance_expose_suspended=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended)
|
||||
instance_expose_suspended=$(ynh_app_setting_get --app="$app" --key=instance_deliver_to_shared_inboxes)
|
||||
|
||||
accounts_registration_open=$(ynh_app_setting_get --app="$app" --key=accounts_registration_open)
|
||||
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_allow_custom_css)
|
||||
|
||||
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_description_min_chars=$(ynh_app_setting_get --app="$app" --key=media_description_min_chars)
|
||||
media_description_max_chars=$(ynh_app_setting_get --app="$app" --key=media_description_max_chars)
|
||||
media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_remote_cache_days)
|
||||
media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_emoji_local_max_size)
|
||||
media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_emoji_remote_max_size)
|
||||
|
||||
statuses_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_max_chars)
|
||||
statuses_cw_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_cw_max_chars)
|
||||
|
@ -166,6 +170,21 @@ then
|
|||
ynh_app_setting_delete --app="$app" --key=registration_reason
|
||||
fi
|
||||
|
||||
# Upgrade from <0.5.0~ynh1:
|
||||
if ynh_compare_current_package_version --comparison lt --version 0.5.0~ynh1 || [ -z "$accounts_allow_custom_css" ]
|
||||
then
|
||||
# declaration of new parameters
|
||||
accounts_allow_custom_css="false"
|
||||
instance_deliver_to_shared_inboxes="true"
|
||||
media_emoji_local_max_size="51200"
|
||||
media_emoji_remote_max_size="102400"
|
||||
# registration of new parameters
|
||||
ynh_app_setting_set --app="$app" --key=accounts_allow_custom_css --value="$accounts_allow_custom_css"
|
||||
ynh_app_setting_set --app="$app" --key=instance_deliver_to_shared_inboxes --value="$instance_deliver_to_shared_inboxes"
|
||||
ynh_app_setting_set --app="$app" --key=media_emoji_local_max_size --value="$media_emoji_local_max_size"
|
||||
ynh_app_setting_set --app="$app" --key=media_emoji_remote_max_size --value="$media_emoji_remote_max_size"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue