1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gotosocial_ynh.git synced 2024-09-03 19:16:06 +02:00
This commit is contained in:
Éric Gaspar 2023-10-24 08:24:18 +02:00
parent 124b058d5e
commit 0346c5283a
9 changed files with 80 additions and 677 deletions

View file

@ -1,39 +0,0 @@
# See here for more information
# https://github.com/YunoHost/package_check#syntax-check_process-file
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet
; Manifest
admin="xana"
email="user@example.com"
password="1Strong-Password"
port="8095"
; Checks
pkg_linter=1
setup_sub_dir=0
setup_root=1
setup_nourl=0
setup_private=0
setup_public=1
upgrade=1
upgrade=1 from_commit=29c7d0df5dd6e3d90070f242b74cce980676cd72
upgrade=1 from_commit=5c1c052995a10d899abcb0e4d4fa1c1dc35f84a5
upgrade=1 from_commit=1b6c1c62e022f04afa02bf128f419e77a72bf1e9
upgrade=1 from_commit=9a6d018337c7d83193282830ff9d9e9b0ae3a733
backup_restore=1
multi_instance=1
port_already_use=1
change_url=0
;;; Options
Email=
Notification=none
;;; Upgrade options
; commit=29c7d0df5dd6e3d90070f242b74cce980676cd72
name=0.3.6~ynh1
; commit=5c1c052995a10d899abcb0e4d4fa1c1dc35f84a5
name=v0.4.0~ynh1
; commit=1b6c1c62e022f04afa02bf128f419e77a72bf1e9
name=0.5.2~ynh2
; commit=9a6d018337c7d83193282830ff9d9e9b0ae3a733
name=0.6.0~ynh1

View file

@ -43,7 +43,7 @@ application-name: "__APP__"
# String. The user that will be shown instead of the landing page. if no user is set, the landing page will be shown. # String. The user that will be shown instead of the landing page. if no user is set, the landing page will be shown.
# Examples: "admin" # Examples: "admin"
# Default: "" # Default: ""
landing-page-user: "__LANDING_PAGE_USER__" landing-page-user: ""
# String. Hostname that this server will be reachable at. Defaults to localhost for local testing, # String. Hostname that this server will be reachable at. Defaults to localhost for local testing,
# but you should *definitely* change this when running for real, or your server won't work at all. # but you should *definitely* change this when running for real, or your server won't work at all.
@ -238,7 +238,7 @@ cache:
# in-memory objects, and so NOT AT ALL EXACT. # in-memory objects, and so NOT AT ALL EXACT.
# Examples: ["100MiB", "200MiB", "500MiB", "1GiB"] # Examples: ["100MiB", "200MiB", "500MiB", "1GiB"]
# Default: "100MiB" # Default: "100MiB"
memory-target: __CACHE_MEMORY_TARGET__ memory-target: "100MiB"
###################### ######################
##### WEB CONFIG ##### ##### WEB CONFIG #####
@ -267,7 +267,7 @@ web-asset-base-dir: "./web/assets/"
# users (members of the instance) will still be able to query the endpoint. # users (members of the instance) will still be able to query the endpoint.
# Options: [true, false] # Options: [true, false]
# Default: false # Default: false
instance-expose-peers: __INSTANCE_EXPOSE_PEERS__ instance-expose-peers: false
# Bool. Allow unauthenticated users to make queries to /api/v1/instance/peers?filter=suspended in order # Bool. 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 # to see a list of instances that this instance blocks/suspends. This will also allow unauthenticated
@ -275,20 +275,20 @@ instance-expose-peers: __INSTANCE_EXPOSE_PEERS__
# of the instance) will still be able to query the endpoint. # of the instance) will still be able to query the endpoint.
# Options: [true, false] # Options: [true, false]
# Default: false # Default: false
instance-expose-suspended: __INSTANCE_EXPOSE_SUSPENDED__ instance-expose-suspended: false
# Bool. Allow unauthenticated users to view /about/suspended, # Bool. Allow unauthenticated users to view /about/suspended,
# showing the HTML rendered list of instances that this instance blocks/suspends. # showing the HTML rendered list of instances that this instance blocks/suspends.
# Options: [true, false] # Options: [true, false]
# Default: false # Default: false
instance-expose-suspended-web: __INSTANCE_EXPOSE_SUSPENDED_WEB__ instance-expose-suspended-web: false
# Bool. Allow unauthenticated users to make queries to /api/v1/timelines/public in order # Bool. Allow unauthenticated users to make queries to /api/v1/timelines/public in order
# to see a list of public posts on this server. Even if set to 'false', then authenticated # to see a list of public posts on this server. Even if set to 'false', then authenticated
# users (members of the instance) will still be able to query the endpoint. # users (members of the instance) will still be able to query the endpoint.
# Options: [true, false] # Options: [true, false]
# Default: false # Default: false
instance-expose-public-timeline: __INSTANCE_EXPOSE_PUBLIC_TIMELINE__ instance-expose-public-timeline: false
# Bool. This flag tweaks whether GoToSocial will deliver ActivityPub messages # Bool. This flag tweaks whether GoToSocial will deliver ActivityPub messages
# to the shared inbox of a recipient, if one is available, instead of delivering # to the shared inbox of a recipient, if one is available, instead of delivering
@ -301,7 +301,7 @@ instance-expose-public-timeline: __INSTANCE_EXPOSE_PUBLIC_TIMELINE__
# #
# Options: [true, false] # Options: [true, false]
# Default: true # Default: true
instance-deliver-to-shared-inboxes: __INSTANCE_DELIVER_TO_SHARED_INBOXES__ instance-deliver-to-shared-inboxes: true
# Bool. This flag will inject a Mastodon version into the version field that # Bool. This flag will inject a Mastodon version into the version field that
# is included in /api/v1/instance. This version is often used by Mastodon clients # is included in /api/v1/instance. This version is often used by Mastodon clients
@ -310,7 +310,7 @@ instance-deliver-to-shared-inboxes: __INSTANCE_DELIVER_TO_SHARED_INBOXES__
# #
# Options: [true, false] # Options: [true, false]
# Default: false # Default: false
instance-inject-mastodon-version: __INSTANCE_INJECT_MASTODON_VERSION__ instance-inject-mastodon-version: false
########################### ###########################
##### ACCOUNTS CONFIG ##### ##### ACCOUNTS CONFIG #####
@ -347,14 +347,14 @@ accounts-reason-required: __ACCOUNTS_REASON_REQUIRED__
# #
# Options: [true, false] # Options: [true, false]
# Default: false # Default: false
accounts-allow-custom-css: __ACCOUNTS_ALLOW_CUSTOM_CSS__ accounts-allow-custom-css: false
# Int. If accounts-allow-custom-css is true, this is the permitted length in characters for # Int. 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. # CSS uploaded by accounts on this instance. No effect if accounts-allow-custom-css is false.
# #
# Examples: [500, 5000, 9999] # Examples: [500, 5000, 9999]
# Default: 10000 # Default: 10000
accounts-custom-css-length: __ACCOUNTS_CUSTOM_CSS_LENGTH__ accounts-custom-css-length: 10000
######################## ########################
##### MEDIA CONFIG ##### ##### MEDIA CONFIG #####
@ -365,22 +365,22 @@ accounts-custom-css-length: __ACCOUNTS_CUSTOM_CSS_LENGTH__
# Int. Maximum allowed image upload size in bytes. # Int. Maximum allowed image upload size in bytes.
# Examples: [2097152, 10485760] # Examples: [2097152, 10485760]
# Default: 10485760 -- aka 10MB # Default: 10485760 -- aka 10MB
media-image-max-size: __MEDIA_IMAGE_MAX_SIZE__ media-image-max-size: 10485760
# Int. Maximum allowed video upload size in bytes. # Int. Maximum allowed video upload size in bytes.
# Examples: [2097152, 10485760] # Examples: [2097152, 10485760]
# Default: 41943040 -- aka 40MB # Default: 41943040 -- aka 40MB
media-video-max-size: __MEDIA_VIDEO_MAX_SIZE__ media-video-max-size: 41943040
# Int. Minimum amount of characters required as an image or video description. # Int. Minimum amount of characters required as an image or video description.
# Examples: [500, 1000, 1500] # Examples: [500, 1000, 1500]
# Default: 0 (not required) # Default: 0 (not required)
media-description-min-chars: __MEDIA_DESCRIPTION_MIN_CHARS__ media-description-min-chars: 0
# Int. Maximum amount of characters permitted in an image or video description. # Int. Maximum amount of characters permitted in an image or video description.
# Examples: [500, 1000, 1500] # Examples: [500, 1000, 1500]
# Default: 500 # Default: 500
media-description-max-chars: __MEDIA_DESCRIPTION_MAX_CHARS__ media-description-max-chars: 500
# Int. Number of days to cache media from remote instances before they are removed from the cache. # Int. Number of days to cache media from remote instances before they are removed from the cache.
# A job will run every day at midnight to clean up any remote media older than the given amount of days. # A job will run every day at midnight to clean up any remote media older than the given amount of days.
@ -391,7 +391,7 @@ media-description-max-chars: __MEDIA_DESCRIPTION_MAX_CHARS__
# If this is set to 0, then media from remote instances will be cached indefinitely. # If this is set to 0, then media from remote instances will be cached indefinitely.
# Examples: [30, 60, 7, 0] # Examples: [30, 60, 7, 0]
# Default: 7 # Default: 7
media-remote-cache-days: __MEDIA_REMOTE_CACHE_DAYS__ media-remote-cache-days: 7
# Int. Max size in bytes of emojis uploaded to this instance via the admin API. # 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 # The default is the same as the Mastodon size limit for emojis (50kb), which allows
@ -399,7 +399,7 @@ media-remote-cache-days: __MEDIA_REMOTE_CACHE_DAYS__
# of your emojis to other instances, so beware. # of your emojis to other instances, so beware.
# Examples: [51200, 102400] # Examples: [51200, 102400]
# Default: 51200 # Default: 51200
media-emoji-local-max-size: __MEDIA_EMOJI_LOCAL_MAX_SIZE__ media-emoji-local-max-size: 51200
# Int. Max size in bytes of emojis to download from other instances. # 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. # By default this is 100kb, or twice the size of the default for media-emoji-local-max-size.
@ -407,7 +407,7 @@ media-emoji-local-max-size: __MEDIA_EMOJI_LOCAL_MAX_SIZE__
# higher emoji size limits, and not taking up too much space in storage. # higher emoji size limits, and not taking up too much space in storage.
# Examples: [51200, 102400] # Examples: [51200, 102400]
# Default: 102400 # Default: 102400
media-emoji-remote-max-size: __MEDIA_EMOJI_REMOTE_MAX_SIZE__ media-emoji-remote-max-size: 102400
########################## ##########################
##### STORAGE CONFIG ##### ##### STORAGE CONFIG #####
@ -418,7 +418,7 @@ media-emoji-remote-max-size: __MEDIA_EMOJI_REMOTE_MAX_SIZE__
# String. Type of storage backend to use. # String. Type of storage backend to use.
# Examples: ["local", "s3"] # Examples: ["local", "s3"]
# Default: "local" (storage on local disk) # Default: "local" (storage on local disk)
storage-backend: "__STORAGE_BACKEND__" storage-backend: "local"
# String. Directory to use as a base path for storing files. # String. Directory to use as a base path for storing files.
# Make sure whatever user/group gotosocial is running as has permission to access # Make sure whatever user/group gotosocial is running as has permission to access
@ -434,12 +434,12 @@ storage-local-base-path: "__DATA_DIR__"
# GoToSocial uses "DNS-style" when accessing buckets. # GoToSocial uses "DNS-style" when accessing buckets.
# If you are using Scaleways object storage, please remove the "bucket name" from the endpoint address # If you are using Scaleways object storage, please remove the "bucket name" from the endpoint address
# Default: "" # Default: ""
storage-s3-endpoint: "__STORAGE_S3_ENDPOINT__" storage-s3-endpoint: ""
# Bool. If data stored in S3 should be proxied through GoToSocial instead of redirecting to a presigned URL. # Bool. If data stored in S3 should be proxied through GoToSocial instead of redirecting to a presigned URL.
# #
# Default: false # Default: false
storage-s3-proxy: __STORAGE_S3_PROXY__ storage-s3-proxy: false
# Bool. Use SSL for S3 connections. # Bool. Use SSL for S3 connections.
# #
@ -453,14 +453,14 @@ storage-s3-use-ssl: true
# Only required when running with the s3 storage backend. # Only required when running with the s3 storage backend.
# Examples: ["AKIAJSIE27KKMHXI3BJQ","miniouser"] # Examples: ["AKIAJSIE27KKMHXI3BJQ","miniouser"]
# Default: "" # Default: ""
storage-s3-access-key: "__STORAGE_S3_ACCESS_KEY__" storage-s3-access-key: ""
# String. Secret key part of the S3 credentials. # String. Secret key part of the S3 credentials.
# Consider setting this value using environment variables to avoid leaking it via the config file # Consider setting this value using environment variables to avoid leaking it via the config file
# Only required when running with the s3 storage backend. # Only required when running with the s3 storage backend.
# Examples: ["5bEYu26084qjSFyclM/f2pz4gviSfoOg+mFwBH39","miniopassword"] # Examples: ["5bEYu26084qjSFyclM/f2pz4gviSfoOg+mFwBH39","miniopassword"]
# Default: "" # Default: ""
storage-s3-secret-key: "__STORAGE_S3_SECRET_KEY__" storage-s3-secret-key: ""
# String. Name of the storage bucket. # String. Name of the storage bucket.
# #
@ -472,7 +472,7 @@ storage-s3-secret-key: "__STORAGE_S3_SECRET_KEY__"
# Only required when running with the s3 storage backend. # Only required when running with the s3 storage backend.
# Examples: ["gts","cool-instance"] # Examples: ["gts","cool-instance"]
# Default: "" # Default: ""
storage-s3-bucket: "__STORAGE_S3_BUCKET__" storage-s3-bucket: ""
########################### ###########################
##### STATUSES CONFIG ##### ##### STATUSES CONFIG #####
@ -484,31 +484,31 @@ storage-s3-bucket: "__STORAGE_S3_BUCKET__"
# Note that going way higher than the default might break federation. # Note that going way higher than the default might break federation.
# Examples: [140, 500, 5000] # Examples: [140, 500, 5000]
# Default: 5000 # Default: 5000
statuses-max-chars: __STATUSES_MAX_CHARS__ statuses-max-chars: 5000
# Int. Maximum amount of characters allowed in the CW/subject header of a status. # Int. Maximum amount of characters allowed in the CW/subject header of a status.
# Note that going way higher than the default might break federation. # Note that going way higher than the default might break federation.
# Examples: [100, 200] # Examples: [100, 200]
# Default: 100 # Default: 100
statuses-cw-max-chars: __STATUSES_CW_MAX_CHARS__ statuses-cw-max-chars: 100
# Int. Maximum amount of options to permit when creating a new poll. # Int. Maximum amount of options to permit when creating a new poll.
# Note that going way higher than the default might break federation. # Note that going way higher than the default might break federation.
# Examples: [4, 6, 10] # Examples: [4, 6, 10]
# Default: 6 # Default: 6
statuses-poll-max-options: __STATUSES_POLL_MAX_OPTIONS__ statuses-poll-max-options: 6
# Int. Maximum amount of characters to permit per poll option when creating a new poll. # Int. Maximum amount of characters to permit per poll option when creating a new poll.
# Note that going way higher than the default might break federation. # Note that going way higher than the default might break federation.
# Examples: [50, 100, 150] # Examples: [50, 100, 150]
# Default: 50 # Default: 50
statuses-poll-option-max-chars: __STATUSES_POLL_OPTION_MAX_CHARS__ statuses-poll-option-max-chars: 50
# Int. Maximum amount of media files that can be attached to a new status. # Int. Maximum amount of media files that can be attached to a new status.
# Note that going way higher than the default might break federation. # Note that going way higher than the default might break federation.
# Examples: [4, 6, 10] # Examples: [4, 6, 10]
# Default: 6 # Default: 6
statuses-media-max-files: __STATUSES_MEDIA_MAX_FILES__ statuses-media-max-files: 6
############################## ##############################
##### LETSENCRYPT CONFIG ##### ##### LETSENCRYPT CONFIG #####
@ -639,30 +639,30 @@ oidc-admin-groups: []
# If this is not set, smtp will not be used to send emails, and you can ignore the other settings. # If this is not set, smtp will not be used to send emails, and you can ignore the other settings.
# Examples: ["mail.example.org", "localhost"] # Examples: ["mail.example.org", "localhost"]
# Default: "" # Default: ""
smtp-host: "__SMTP_HOST__" smtp-host: "localhost"
# Int. Port to use to connect to the smtp server. # Int. Port to use to connect to the smtp server.
# Examples: [] # Examples: []
# Default: 0 # Default: 0
smtp-port: __SMTP_PORT__ smtp-port: 25
# String. Username to use when authenticating with the smtp server. # String. Username to use when authenticating with the smtp server.
# This should have been provided to you by your smtp host. # This should have been provided to you by your smtp host.
# This is often, but not always, an email address. # This is often, but not always, an email address.
# Examples: ["maillord@example.org"] # Examples: ["maillord@example.org"]
# Default: "" # Default: ""
smtp-username: "__SMTP_USERNAME__" smtp-username: "__APP__"
# String. Password to use when authenticating with the smtp server. # String. Password to use when authenticating with the smtp server.
# This should have been provided to you by your smtp host. # This should have been provided to you by your smtp host.
# Examples: ["1234", "password"] # Examples: ["1234", "password"]
# Default: "" # Default: ""
smtp-password: "__SMTP_PASSWORD__" smtp-password: "__MAIL_PWD__"
# String. 'From' address for sent emails. # String. 'From' address for sent emails.
# Examples: ["mail@example.org"] # Examples: ["mail@example.org"]
# Default: "" # Default: ""
smtp-from: "__SMTP_FROM__" smtp-from: "noreply@__DOMAIN__"
# Bool. If true, when an email is sent that has multiple recipients, each recipient # Bool. If true, when an email is sent that has multiple recipients, each recipient
# will be included in the To field, so that each recipient can see who else got the # will be included in the To field, so that each recipient can see who else got the
@ -674,7 +674,7 @@ smtp-from: "__SMTP_FROM__"
# It might be useful to change this setting to 'true' if you want to be able to discuss # It might be useful to change this setting to 'true' if you want to be able to discuss
# new moderation reports with other admins by 'replying-all' to the notification email. # new moderation reports with other admins by 'replying-all' to the notification email.
# Default: false # Default: false
smtp-disclose-recipients: __SMTP_DISCLOSE_RECIPIENTS__ smtp-disclose-recipients: false
######################### #########################
##### SYSLOG CONFIG ##### ##### SYSLOG CONFIG #####
@ -820,7 +820,7 @@ http-client:
# #
# Options: ["lax", "strict"] # Options: ["lax", "strict"]
# Default: "lax" # Default: "lax"
advanced-cookies-samesite: "__ADVANCED_COOKIES_SAMESITE__" advanced-cookies-samesite: "lax"
# Int. Amount of requests to permit per router grouping from a single IP address within # Int. Amount of requests to permit per router grouping from a single IP address within
# a span of 5 minutes. If this amount is exceeded, a 429 HTTP error code will be returned. # a span of 5 minutes. If this amount is exceeded, a 429 HTTP error code will be returned.
@ -836,7 +836,7 @@ advanced-cookies-samesite: "__ADVANCED_COOKIES_SAMESITE__"
# #
# Examples: [1000, 500, 0] # Examples: [1000, 500, 0]
# Default: 1000 # Default: 1000
advanced-rate-limit-requests: __ADVANCED_RATE_LIMIT_REQUESTS__ advanced-rate-limit-requests: 1000
# Int. Amount of open requests to permit per CPU, per router grouping, before applying http # Int. Amount of open requests to permit per CPU, per router grouping, before applying http
# request throttling. Any requests beyond the calculated limit are held in a backlog queue for # request throttling. Any requests beyond the calculated limit are held in a backlog queue for

View file

@ -10,7 +10,7 @@ location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__; proxy_pass http://127.0.0.1:__PORT__;
client_max_body_size __CLIENT_MAX_BODY_SIZE__; client_max_body_size 100M;
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
@ -31,7 +31,7 @@ location __PATH__/ {
} }
location /fileserver/ { location /fileserver/ {
alias /home/yunohost.app/__APP__/; alias __DATA_DIR__/;
autoindex off; autoindex off;
# 604800 = 1 week # 604800 = 1 week
more_set_headers "Cache-Control: private, immutable, max-age=604800"; more_set_headers "Cache-Control: private, immutable, max-age=604800";

View file

@ -9,9 +9,6 @@ name.fr = "Configuration principale"
help = "Here you can easily configure some things about your GoToSocial instance." help = "Here you can easily configure some things about your GoToSocial instance."
####################
#### ACCOUNTS CONFIG
####################
[main.accounts] [main.accounts]
@ -48,386 +45,3 @@ default = "true"
help.en = "Are sign up requests required to submit a reason for the request (eg., an explanation of why they want to join the instance)?" help.en = "Are sign up requests required to submit a reason for the request (eg., an explanation of why they want to join the instance)?"
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) ?" 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" type = "select"
[main.accounts.accounts_allow_custom_css]
ask.en = "Allow custom CSS?"
ask.fr = "Autoriser le CSS personnalisé ?"
bind = "accounts-allow-custom-css:__INSTALL_DIR__/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"
[main.accounts.accounts_custom_css_length]
ask.en = "Custom CSS length?"
ask.fr = "Longueur du CSS personnalisé ?"
bind = "accounts-custom-css-length:__INSTALL_DIR__/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
#################
[main.media]
name = "Media config"
help = "Config pertaining to user media uploads (videos, image, image descriptions)."
[main.media.media_image_max_size]
ask.en = "Maximum allowed image upload size in bytes."
ask.fr = "Taille maximale autorisée pour le téléchargement d'images, en octets."
bind = "media-image-max-size:__INSTALL_DIR__/config.yaml"
default = "2097152"
help.en = "Default: 2097152 -- aka 2MB"
help.fr = "Valeur par défaut : 2097152 (soit 2 Mo)"
type = "number"
[main.media.media_video_max_size]
ask.en = "Maximum allowed video upload size in bytes."
ask.fr = "Taille maximale autorisée pour le téléchargement de vidéos, en octets."
bind = "media-video-max-size:__INSTALL_DIR__/config.yaml"
default = "10485760"
help.en = "Default: 10485760 -- aka 10MB"
help.fr = "Valeur par défaut : 10485760 (soit 10 Mo)"
type = "number"
[main.media.media_description_min_chars]
ask.en = "Minimum amount of characters required as an image or video description."
ask.fr = "Nombre minimum de caractères requis pour la description d'une image ou d'une vidéo."
bind = "media-description-min-chars:__INSTALL_DIR__/config.yaml"
default = "0"
help.en = "Default: 0 (not required)"
help.fr = "Valeur par défaut : 0 (non obligatoire)"
type = "number"
[main.media.media_description_max_chars]
ask.en = "Maximum amount of characters permitted in an image or video description."
ask.fr = "Nombre maximum de caractères requis pour la description d'une image ou d'une vidéo."
bind = "media-description-max-chars:__INSTALL_DIR__/config.yaml"
default = "500"
help.en = "Default: 500"
help.fr = "Valeur par défaut : 500"
type = "number"
[main.media.media_remote_cache_days]
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-remote-cache-days:__INSTALL_DIR__/config.yaml"
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\
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"
[main.media.media_emoji_local_max_size]
ask.en = "Max size in bytes of emojis uploaded to this instance via the admin API."
ask.fr = "Taille maximale en octets des emojis téléchargés vers cette instance via l'API d'administration."
bind = "media-emoji-local-max-size:__INSTALL_DIR__/config.yaml"
default = "51200"
help.en = """Default: 51200\
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\
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"
[main.media.media_emoji_remote_max_size]
ask.en = "Max size in bytes of emojis to download from other instances."
ask.fr = "Taille maximale en octets des emojis téléchargeables à partir d'autres instances."
bind = "media-emoji-remote-max-size:__INSTALL_DIR__/config.yaml"
default = "102400"
help.en = """Default: 102400\
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\
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
###################
[main.statuses]
name = "Status config"
help = "Config pertaining to the creation of statuses/posts, and permitted limits."
[main.statuses.statuses_max_chars]
ask.en = "Maximum amount of characters permitted for a new status."
ask.fr = "Nombre maximal de caractères autorisés pour un nouveau statut."
bind = "statuses-max-chars:__INSTALL_DIR__/config.yaml"
default = "5000"
help.en = "Default: 5000. Note that going way higher than the default might break federation."
help.fr = "Valeur par défaut : 5000. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
type = "number"
[main.statuses.statuses_cw_max_chars]
ask.en = "Maximum amount of characters allowed in the CW/subject header of a status."
ask.fr = "Nombre maximum de caractères autorisés dans l'en-tête CW/sujet d'un statut."
bind = "statuses-cw-max-chars:__INSTALL_DIR__/config.yaml"
default = "100"
help.en = "Default: 100. Note that going way higher than the default might break federation."
help.fr = "Valeur par défaut : 100. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
type = "number"
[main.statuses.statuses_poll_max_options]
ask.en = "Maximum amount of options to permit when creating a new poll."
ask.fr = "Nombre maximum d'options autorisées lors de la création d'un nouveau sondage."
bind = "statuses-poll-max-options:__INSTALL_DIR__/config.yaml"
default = "6"
help.en = "Default: 6. Note that going way higher than the default might break federation."
help.fr = "Valeur par défaut : 6. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
type = "number"
[main.statuses.statuses_poll_option_max_chars]
ask.en = "Maximum amount of characters to permit per poll option when creating a new poll."
ask.fr = "Nombre maximal de caractères autorisés par option de sondage lors de la création d'un nouveau sondage."
bind = "statuses-poll-option-max-chars:__INSTALL_DIR__/config.yaml"
default = "50"
help.en = "Default: 50. Note that going way higher than the default might break federation."
help.fr = "Valeur par défaut : 50. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
type = "number"
[main.statuses.statuses_media_max_files]
ask.en = "Maximum amount of media files that can be attached to a new status."
ask.fr = "Quantité maximale de fichiers multimédias qui peuvent être joints à un nouveau statut."
bind = "statuses-media-max-files:__INSTALL_DIR__/config.yaml"
default = "6"
help.en = "Default: 6. Note that going way higher than the default might break federation."
help.fr = "Valeur par défaut : 6. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
type = "number"
####################
#### INSTANCE CONFIG
####################
[main.instance]
name = "Instance config"
help = "Config pertaining to instance federation settings, pages to hide/expose, etc."
[main.instance.landing_page_user]
ask.en = "Landing page user"
ask.fr = "Utilisateurice en tant que page d'accueil"
bind = "landing-page-user:__INSTALL_DIR__/config.yaml"
help.en = "The user that will be shown instead of the landing page. if no user is set, the landing page will be shown."
help.fr = "L'utilisateurice qui sera affiché-e à la place de la page d'accueil. Si le champ est laissé vide, la page d'accueil normale sera affichée."
type = "string"
[main.instance.instance_expose_peers]
ask.en = "API: Expose peers?"
ask.fr = "API : Exposer les pairs ?"
bind = "instance-expose-peers:__INSTALL_DIR__/config.yaml"
choices = ["true", "false"]
default = "false"
help.en = "Allow unauthenticated users to make queries to /api/v1/instance/peers?filter=open in order to see a list of instances that this instance 'peers' with. 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=open afin d'afficher la liste des instances avec lesquelles votre instance est en relation. 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"
[main.instance.instance_expose_suspended]
ask.en = "API: Expose suspended?"
ask.fr = "API : Exposer les instances bloquées ?"
bind = "instance-expose-suspended:__INSTALL_DIR__/config.yaml"
choices = ["true", "false"]
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"
[main.instance.instance_expose_suspended_web]
ask.en = "API: Expose suspended on Web (/about/suspended)?"
ask.fr = "API : Exposer les instances bloquées sur le Web (/about/suspended) ?"
bind = "instance-expose-suspended-web:__INSTALL_DIR__/config.yaml"
choices = ["true", "false"]
default = "false"
help.en = "Allow unauthenticated users to view /about/suspended, showing the HTML rendered list of instances that this instance blocks/suspends."
help.fr = "Permet aux utilisateurs non authentifiés d'afficher /about/suspended, montrant la liste rendue en HTML des instances que cette instance bloque ou suspend."
type = "select"
[main.instance.instance_expose_public_timeline]
ask.en = "API: Expose public timeline?"
ask.fr = "API : Exposer la timeline publique ?"
bind = "instance-expose-public-timeline:__INSTALL_DIR__/config.yaml"
choices = ["true", "false"]
default = "false"
help.en = "Allow unauthenticated users to make queries to /api/v1/timelines/public in order to see a list of public posts on this server. 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 sur /api/v1/timelines/public afin de voir la liste des messages publics sur ce serveur. 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"
[main.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:__INSTALL_DIR__/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"
[main.instance.instance_inject_mastodon_version]
ask.en = "Inject Mastodon version?"
ask.fr = "Injecter une version Mastodon ?"
bind = "instance-inject-mastodon-version:__INSTALL_DIR__/config.yaml"
choices = ["true", "false"]
default = "false"
help.en = """This flag will inject a Mastodon version into the version field that is included in /api/v1/instance.\
This version is often used by Mastodon clients to do API feature detection.\
By injecting a Mastodon compatible version, it is possible to cajole those clients to behave correctly with GoToSocial.\
Default: false"""
help.fr = """Ce paramètre injecte une version de Mastodon dans le champ version qui est inclus dans /api/v1/instance.\
Cette version est souvent utilisée par les clients Mastodon pour détecter les caractéristiques de l'API.\
En injectant une version compatible avec Mastodon, il est possible d'inciter ces clients à se comporter correctement avec GoToSocial.
Par défautl : false"""
type = "select"
################
#### SMTP CONFIG
################
[main.smtp]
name = "SMTP config"
help = "Config for sending emails via an smtp server."
[main.smtp.smtp_host]
ask.en = "SMTP Server Hostname"
ask.fr = "Nom d'hôte du serveur SMTP"
bind = "smtp-host:__INSTALL_DIR__/config.yaml"
default = "localhost"
help.en = "The hostname of the SMTP server you want to use. Examples: mail.example.org, localhost"
help.fr = "Le nom d'hôte du serveur SMTP que vous souhaitez utiliser. Exemples: mail.example.org, localhost"
type = "string"
[main.smtp.smtp_port]
ask.en = "SMTP Port"
ask.fr = "Port SMTP"
bind = "smtp-port:__INSTALL_DIR__/config.yaml"
default = "25"
help.en = "Port to use to connect to the SMTP server"
help.fr = "Port à utiliser pour se connecter au serveur SMTP"
type = "number"
[main.smtp.smtp_username]
ask.en = "SMTP Username"
ask.fr = "Nom d'utilisateur SMTP"
bind = "smtp-username:__INSTALL_DIR__/config.yaml"
default = ""
help.en = "Username to use when authenticating with the SMTP server"
help.fr = "Nom d'utilisateur à utiliser lors de l'authentification avec le serveur SMTP"
type = "string"
[main.smtp.smtp_password]
ask.en = "SMTP Password"
ask.fr = "Mot de passe SMTP"
bind = "smtp-password:__INSTALL_DIR__/config.yaml"
default = ""
help.en = "Password to use when authenticating with the SMTP server"
help.fr = "Mot de passe à utiliser lors de l'authentification avec le serveur SMTP"
type = "password"
[main.smtp.smtp_from]
ask.en = "SMTP From Address"
ask.fr = "Adresse d'expédition SMTP"
bind = "smtp-from:__INSTALL_DIR__/config.yaml"
default = "GoToSocial@__DOMAIN__"
help.en = "From address for sent emails"
help.fr = "L'adresse utilisée pour les e-mails envoyés"
type = "email"
[main.smtp.smtp_disclose_recipients]
ask.en = "SMTP Disclose Recipients"
ask.fr = "SMTP Divulguer les destinataires"
bind = "smtp-disclose-recipients:__INSTALL_DIR__/config.yaml"
choices = ["true", "false"]
default = "false"
help.en = """true: Disclose all recipients in the To field\
false: Email will be sent to Undisclosed Recipients"""
help.fr = """true : divulguer tous les destinataires dans le champ À\
false : l'e-mail sera envoyé sans divulguer les destinataires"""
type = "select"
####################
#### CACHE SETTINGS
####################
[main.cache]
name = "Cache settings"
help = "Settings pertaining to... the cache"
[main.cache.cache_memory_target]
ask.en = "Value of the cache target"
ask.fr = "Valeur du niveau de cache"
bind = "memory-target:__INSTALL_DIR__/config.yaml"
default = "100MiB"
help.en = """Sets a target limit that the application will try to keep it's caches within.\
This is based on estimated sizes of in-memory objects, and so NOT AT ALL EXACT.
Examples: 100MiB, 200MiB, 500MiB, 1GiB; Default: 100MiB"""
help.fr = """Définit une limite cible que l'application essaiera de ne pas dépasser pour ses caches.\
Cette limite est basée sur des estimations de la taille des objets en mémoire et N'EST DONC PAS DU TOUT EXACTE.
Exemples : 100MiB, 200MiB, 500MiB, 1GiB; Par défaut : 100MiB"""
type = "string"
####################
#### ADVANCED SETTINGS
####################
[main.advanced]
name = "Advanced settings"
help = "Settings pertaining to http timeouts, security, cookies, and more. ⚠️ ONLY ADJUST THESE SETTINGS IF YOU KNOW WHAT YOU ARE DOING! ⚠️"
[main.advanced.advanced_cookies_samesite]
ask.en = "Value of the SameSite attribute of cookies set by GoToSocial."
ask.fr = "Valeur de l'attribut SameSite des cookies définis par GoToSocial."
bind = "advanced-cookies-samesite:__INSTALL_DIR__/config.yaml"
choices = ["lax", "strict"]
default = "lax"
help.en = """Defaults to 'lax' to ensure that the OIDC flow does not break, which is fine in most cases.\
If you want to harden your instance against CSRF attacks and don't mind if some login-related things might break, you can set this to 'strict' instead.\
For an overview of what this does, see:\
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite"""
help.fr = ""
type = "select"
[main.advanced.advanced_rate_limit_requests]
ask.en = "Amount of requests to permit from a single IP address within a span of 5 minutes."
ask.fr = "Nombre de requêtes autorisées à partir d'une seule adresse IP dans un délai de 5 minutes."
bind = "advanced-rate-limit-requests:__INSTALL_DIR__/config.yaml"
default = "300"
help.en = """Default: 300\
If this amount is exceeded, a 429 HTTP error code will be returned.\
See https://docs.gotosocial.org/en/latest/api/swagger/#rate-limit.\
If you find yourself adjusting this limit because it's regularly being exceeded, you should first verify that your settings for `trusted-proxies` are correct.\
In many cases, when the rate limit is exceeded it is because your instance sees all incoming requests as coming from the *same IP address* (you can verify this by looking at the client IPs in your instance logs).\
If this is the case, try adding that IP address to your `trusted-proxies` *BEFORE* you go adjusting this rate limit setting!\
If you set this to 0 or less, rate limiting will be disabled entirely."""
help.fr = "Valeur par défaut : 1000"
type = "number"

View file

@ -54,10 +54,6 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
#================================================= #=================================================
# BACKUP THE POSTGRESQL DATABASE # BACKUP THE POSTGRESQL DATABASE
#================================================= #=================================================

View file

@ -13,114 +13,22 @@ source /usr/share/yunohost/helpers
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
landing_page_user=""
client_max_body_size="100M"
email=$(ynh_user_get_info --username=$admin --key=mail) email=$(ynh_user_get_info --username=$admin --key=mail)
# Config stuff: # Config stuff:
cache_memory_target="100MiB"
accounts_registration_open=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REGISTRATION_OPEN") accounts_registration_open=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REGISTRATION_OPEN")
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_custom_css_length="10000"
instance_expose_peers="false"
instance_expose_suspended="false"
instance_expose_suspended_web="false"
instance_expose_public_timeline="false"
instance_deliver_to_shared_inboxes="true"
instance_inject_mastodon_version="false"
media_image_max_size="10485760"
media_video_max_size="41943040"
media_description_min_chars="0"
media_description_max_chars="500"
media_remote_cache_days="7"
media_emoji_local_max_size="51200"
media_emoji_remote_max_size="102400"
storage_backend="local"
storage_s3_endpoint=""
storage_s3_proxy="false"
storage_s3_access_key=""
storage_s3_secret_key=""
storage_s3_bucket=""
statuses_max_chars="5000"
statuses_cw_max_chars="100"
statuses_poll_max_options="6"
statuses_poll_option_max_chars="50"
statuses_media_max_files="6"
smtp_host="localhost"
smtp_port="25"
smtp_username=""
smtp_password=""
smtp_from="noreply@$domain"
smtp_disclose_recipients="false"
advanced_cookies_samesite="lax"
advanced_rate_limit_requests="300"
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app="$app" --key=landing_page_user --value="$landing_page_user"
ynh_app_setting_set --app="$app" --key=client_max_body_size --value="$client_max_body_size"
ynh_app_setting_set --app="$app" --key=email --value="$email"
ynh_app_setting_set --app="$app" --key=cache_memory_target --value="$cache_memory_target"
ynh_app_setting_set --app="$app" --key=accounts_registration_open --value="$accounts_registration_open" 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_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_suspended --value="$instance_expose_suspended"
ynh_app_setting_set --app="$app" --key=instance_expose_suspended_web --value="$instance_expose_suspended_web"
ynh_app_setting_set --app="$app" --key=instance_expose_public_timeline --value="$instance_expose_public_timeline"
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=instance_inject_mastodon_version --value="$instance_inject_mastodon_version"
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=storage_backend --value="$storage_backend"
ynh_app_setting_set --app="$app" --key=storage_s3_endpoint --value="$storage_s3_endpoint"
ynh_app_setting_set --app="$app" --key=storage_s3_proxy --value="$storage_s3_proxy"
ynh_app_setting_set --app="$app" --key=storage_s3_access_key --value="$storage_s3_access_key"
ynh_app_setting_set --app="$app" --key=storage_s3_secret_key --value="$storage_s3_secret_key"
ynh_app_setting_set --app="$app" --key=storage_s3_bucket --value="$storage_s3_bucket"
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"
ynh_app_setting_set --app="$app" --key=statuses_poll_max_options --value="$statuses_poll_max_options"
ynh_app_setting_set --app="$app" --key=statuses_poll_option_max_chars --value="$statuses_poll_option_max_chars"
ynh_app_setting_set --app="$app" --key=statuses_media_max_files --value="$statuses_media_max_files"
ynh_app_setting_set --app="$app" --key=smtp_host --value="$smtp_host"
REMOVEME? ynh_app_setting_set --app="$app" --key=smtp_port --value="$smtp_port"
ynh_app_setting_set --app="$app" --key=smtp_username --value="$smtp_username"
REMOVEME? ynh_app_setting_set --app="$app" --key=smtp_password --value="$smtp_password"
ynh_app_setting_set --app="$app" --key=smtp_from --value="$smtp_from"
ynh_app_setting_set --app="$app" --key=smtp_disclose_recipients --value="$smtp_disclose_recipients"
ynh_app_setting_set --app="$app" --key=advanced_cookies_samesite --value="$advanced_cookies_samesite"
ynh_app_setting_set --app="$app" --key=advanced_rate_limit_requests --value="$advanced_rate_limit_requests"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE

View file

@ -10,10 +10,11 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# STANDARD REMOVE # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST # REMOVE SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status "$app" >/dev/null if ynh_exec_warn_less yunohost service status "$app" >/dev/null

View file

@ -121,33 +121,6 @@ then
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=media_emoji_remote_max_size --value="$media_emoji_remote_max_size"
fi fi
# Upgrade from <0.6.0~ynh1:
if ynh_compare_current_package_version --comparison lt --version 0.6.0~ynh1 || [ -z "$instance_expose_public_timeline" ]
then
# declaration of new parameters
landing_page_user=""
instance_expose_public_timeline="false"
storage_backend="local"
storage_s3_endpoint=""
storage_s3_proxy="false"
storage_s3_access_key=""
storage_s3_secret_key=""
storage_s3_bucket=""
advanced_cookies_samesite="lax"
advanced_rate_limit_requests="1000"
# registration of new parameters
ynh_app_setting_set --app="$app" --key=landing_page_user --value="$landing_page_user"
ynh_app_setting_set --app="$app" --key=instance_expose_public_timeline --value="$instance_expose_public_timeline"
ynh_app_setting_set --app="$app" --key=storage_backend --value="$storage_backend"
ynh_app_setting_set --app="$app" --key=storage_s3_endpoint --value="$storage_s3_endpoint"
ynh_app_setting_set --app="$app" --key=storage_s3_proxy --value="$storage_s3_proxy"
ynh_app_setting_set --app="$app" --key=storage_s3_access_key --value="$storage_s3_access_key"
ynh_app_setting_set --app="$app" --key=storage_s3_secret_key --value="$storage_s3_secret_key"
ynh_app_setting_set --app="$app" --key=storage_s3_bucket --value="$storage_s3_bucket"
ynh_app_setting_set --app="$app" --key=advanced_cookies_samesite --value="$advanced_cookies_samesite"
ynh_app_setting_set --app="$app" --key=advanced_rate_limit_requests --value="$advanced_rate_limit_requests"
fi
# Upgrade from <0.7.1~ynh1: # Upgrade from <0.7.1~ynh1:
if ynh_compare_current_package_version --comparison lt --version 0.7.1~ynh1 || [ -z "$instance_expose_suspended_web" ] if ynh_compare_current_package_version --comparison lt --version 0.7.1~ynh1 || [ -z "$instance_expose_suspended_web" ]
then then
@ -160,25 +133,6 @@ then
ynh_app_setting_set --app="$app" --key=instance_expose_suspended_web --value="$instance_expose_suspended_web" ynh_app_setting_set --app="$app" --key=instance_expose_suspended_web --value="$instance_expose_suspended_web"
fi fi
# Upgrade from <0.8.0~ynh2:
if ynh_compare_current_package_version --comparison lt --version 0.8.0~ynh2 || [ -z "$smtp_host" ]
then
# declaration of new parameter
smtp_host="localhost"
smtp_port="25"
smtp_username=""
smtp_password=""
smtp_from="noreply@$domain"
smtp_disclose_recipients="false"
# registration of parameters
ynh_app_setting_set --app="$app" --key=smtp_host --value="$smtp_host"
#REMOVEME? ynh_app_setting_set --app="$app" --key=smtp_port --value="$smtp_port"
ynh_app_setting_set --app="$app" --key=smtp_username --value="$smtp_username"
#REMOVEME? ynh_app_setting_set --app="$app" --key=smtp_password --value="$smtp_password"
ynh_app_setting_set --app="$app" --key=smtp_from --value="$smtp_from"
ynh_app_setting_set --app="$app" --key=smtp_disclose_recipients --value="$smtp_disclose_recipients"
fi
# Upgrade from <0.8.0~ynh3: # Upgrade from <0.8.0~ynh3:
if ynh_compare_current_package_version --comparison lt --version 0.8.0~ynh3 if ynh_compare_current_package_version --comparison lt --version 0.8.0~ynh3
then then
@ -237,14 +191,6 @@ then
ynh_app_setting_set --app="$app" --key=instance_inject_mastodon_version --value="$instance_inject_mastodon_version" ynh_app_setting_set --app="$app" --key=instance_inject_mastodon_version --value="$instance_inject_mastodon_version"
fi fi
#=================================================
# CREATE DEDICATED USER
#=================================================
#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
#REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -253,20 +199,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..."
# detect_arch comes from _common.sh / personnal helpers
architecture=$(detect_arch)
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="config.yaml" ynh_setup_source --dest_dir="$install_dir" --keep="config.yaml"
fi fi
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
# such that the appropriate users (e.g. maybe www-data) can access
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
@ -278,28 +214,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config for the main domain # Create a dedicated NGINX config for the main domain
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
#REMOVEME? ynh_script_progression --message="Upgrading dependencies..."
#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies"
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." ynh_script_progression --message="Updating a configuration file..."
### Same as during install
###
### The file will automatically be backed-up if it's found to be manually modified (because
### ynh_add_config keeps track of the file's checksum)
ynh_add_config --template="config.yaml" --destination="$install_dir/config.yaml" ynh_add_config --template="config.yaml" --destination="$install_dir/config.yaml"
# FIXME: this should be handled by the core in the future
# You may need to use chmod 600 instead of 400,
# for example if the app is expected to be able to modify its own config
chmod 400 "$install_dir/config.yaml" chmod 400 "$install_dir/config.yaml"
chown "$app:$app" "$install_dir/config.yaml" chown "$app:$app" "$install_dir/config.yaml"
@ -343,13 +264,6 @@ ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
#=================================================
# RELOAD NGINX
#=================================================
#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..."
#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -2,6 +2,15 @@ test_format = 1.0
[default] [default]
# -------------------------------
# Default args to use for install
# -------------------------------
args.accounts_registration_open = "false"
args.accounts_approval_required = "true"
args.accounts_reason_required = "true"
# ------------------------------- # -------------------------------
# Commits to test upgrade from # Commits to test upgrade from
# ------------------------------- # -------------------------------