From b54a7046eb1dfe5851cb3c31aeedd062527cd877 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 4 Jul 2022 18:12:11 +0200 Subject: [PATCH] chores v0.3.7 --- check_process | 3 +++ conf/config.yaml | 57 ++++++++++++++++++++++++++++++++++++++++++++--- config_panel.toml | 30 +++++++++++++++++++++++++ manifest.json | 8 +++---- scripts/install | 18 ++++++++++----- scripts/upgrade | 35 ++++++++++++++++++++++++++--- 6 files changed, 135 insertions(+), 16 deletions(-) diff --git a/check_process b/check_process index 7755f17..c63c3c0 100644 --- a/check_process +++ b/check_process @@ -19,6 +19,7 @@ setup_public=1 upgrade=1 upgrade=1 from_commit=460048e78df8a195b1eca5994a4699079954b312 + upgrade=1 from_commit=29c7d0df5dd6e3d90070f242b74cce980676cd72 backup_restore=1 multi_instance=1 port_already_use=1 @@ -29,3 +30,5 @@ Notification=none ;;; Upgrade options ; commit=460048e78df8a195b1eca5994a4699079954b312 name=0.2.1~ynh3 + ; commit=29c7d0df5dd6e3d90070f242b74cce980676cd72 + name=0.3.6~ynh1 diff --git a/conf/config.yaml b/conf/config.yaml index e188be9..8bdbc8c 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -165,6 +165,27 @@ web-template-base-dir: "./web/template/" # Default: "./web/assets/" web-asset-base-dir: "./web/assets/" +########################### +##### INSTANCE CONFIG ##### +########################### + +# Config pertaining to instance federation settings, pages to hide/expose, etc. + +# Bool. 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. +# Options: [true, false] +# Default: false +instance-expose-peers: __INSTANCE_EXPOSE_PEERS__ + +# 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 +# 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. +# Options: [true, false] +# Default: false +instance-expose-suspended: __INSTANCE_EXPOSE_SUSPENDED__ + ########################### ##### ACCOUNTS CONFIG ##### ########################### @@ -174,17 +195,17 @@ web-asset-base-dir: "./web/assets/" # Bool. Do we want people to be able to just submit sign up requests, or do we want invite only? # Options: [true, false] # Default: true -accounts-registration-open: __REGISTRATION_OPEN__ +accounts-registration-open: __ACCOUNTS_REGISTRATION_OPEN__ # Bool. Do sign up requests require approval from an admin/moderator before an account can sign in/use the server? # Options: [true, false] # Default: true -accounts-approval-required: __REGISTRATION_APPROVAL__ +accounts-approval-required: __ACCOUNTS_APPROVAL_REQUIRED__ # Bool. Are sign up requests required to submit a reason for the request (eg., an explanation of why they want to join the instance)? # Options: [true, false] # Default: true -accounts-reason-required: __REGISTRATION_REASON__ +accounts-reason-required: __ACCOUNTS_REASON_REQUIRED__ ######################## ##### MEDIA CONFIG ##### @@ -242,6 +263,36 @@ storage-backend: "local" # Default: "/gotosocial/storage" storage-local-base-path: "__DATADIR__" +# String. API endpoint of the S3 compatible service. +# Only required when running with the s3 storage backend. +# Examples: ["minio:9000", "s3.nl-ams.scw.cloud", "s3.us-west-002.backblazeb2.com"] +# Default: "" +storage-s3-endpoint: "" + +# String. Access key part of the S3 credentials. +# Consider setting this value using environment variables to avoid leaking it via the config file +# Only required when running with the s3 storage backend. +# Examples: ["AKIAJSIE27KKMHXI3BJQ","miniouser"] +# Default: "" +storage-s3-access-key: "" +# String. Secret key part of the S3 credentials. +# Consider setting this value using environment variables to avoid leaking it via the config file +# Only required when running with the s3 storage backend. +# Examples: ["5bEYu26084qjSFyclM/f2pz4gviSfoOg+mFwBH39","miniopassword"] +# Default: "" +storage-s3-secret-key: "" +# String. Name of the storage bucket. +# +# If you have already encoded your bucket name in the storage-s3-endpoint, this +# value will be used as a directory containing your data. +# +# The bucket must exist prior to starting GoToSocial +# +# Only required when running with the s3 storage backend. +# Examples: ["gts","cool-instance"] +# Default: "" +storage-s3-bucket: "" + ########################### ##### STATUSES CONFIG ##### ########################### diff --git a/config_panel.toml b/config_panel.toml index e871ef4..ce36cb2 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -165,3 +165,33 @@ 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 +#################### + +[gotosocial.instance] + +name = "Instance config" + +help = "Config pertaining to instance federation settings, pages to hide/expose, etc." + +[gotosocial.instance.expose-peers] +ask.en = "API: Expose peers?" +ask.fr = "API : Exposer les pairs ?" +bind = "instance-expose-peers:__FINALPATH__/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 = "Voulez-vous que les gens puissent simplement envoyer des demandes d'inscription, ou voulez-vous qu'iels doivent être invité-e-s ?" +type = "select" + +[gotosocial.instance.expose-suspended] +ask.en = "API: Expose suspended?" +ask.fr = "API : Exposer les instances bloquées ?" +bind = "instance-expose-suspended:__FINALPATH__/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 = "Les demandes d'inscription doivent-elles être approuvées par un-e administrateur-ice/modérateur-ice avant qu'un compte puisse se connecter/utiliser le serveur ?" +type = "select" diff --git a/manifest.json b/manifest.json index 9d2a1e8..b99978b 100644 --- a/manifest.json +++ b/manifest.json @@ -74,7 +74,7 @@ } }, { - "name": "registration_open", + "name": "accounts_registration_open", "type": "boolean", "ask": { "en": "Open registration?", @@ -87,7 +87,7 @@ "default": false }, { - "name": "registration_approval", + "name": "accounts_approval_required", "type": "boolean", "ask": { "en": "Registration approval?", @@ -100,7 +100,7 @@ "default": true }, { - "name": "registration_reason", + "name": "accounts_reason_required", "type": "boolean", "ask": { "en": "Request registration reason?", @@ -114,4 +114,4 @@ } ] } -} +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 22bdc33..9eaa7ce 100755 --- a/scripts/install +++ b/scripts/install @@ -37,9 +37,12 @@ password="$YNH_APP_ARG_PASSWORD" # Config stuff: -registration_open=$(convert_bool "$YNH_APP_ARG_REGISTRATION_OPEN") -registration_approval=$(convert_bool "$YNH_APP_ARG_REGISTRATION_APPROVAL") -registration_reason=$(convert_bool "$YNH_APP_ARG_REGISTRATION_REASON") +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") + +instance_expose_peers="false" +instance_expose_suspended="false" media_image_max_size="2097152" media_video_max_size="10485760" @@ -80,9 +83,12 @@ ynh_app_setting_set --app="$app" --key=admin --value="$admin" ynh_app_setting_set --app="$app" --key=email --value="$email" ynh_app_setting_set --app="$app" --key=password --value="$password" -ynh_app_setting_set --app="$app" --key=registration_open --value="$registration_open" -ynh_app_setting_set --app="$app" --key=registration_approval --value="$registration_approval" -ynh_app_setting_set --app="$app" --key=registration_reason --value="$registration_reason" +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=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=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" diff --git a/scripts/upgrade b/scripts/upgrade index ece767f..51395bd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,9 +121,38 @@ then 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" # registration of converted parameters - ynh_app_setting_set --app="$app" --key=statuses_media_max_files --value="$registration_open" - ynh_app_setting_set --app="$app" --key=statuses_media_max_files --value="$registration_approval" - ynh_app_setting_set --app="$app" --key=statuses_media_max_files --value="$registration_reason" + ynh_app_setting_set --app="$app" --key=registration_open --value="$registration_open" + ynh_app_setting_set --app="$app" --key=registration_approval --value="$registration_approval" + ynh_app_setting_set --app="$app" --key=registration_reason --value="$registration_reason" +fi + +# Upgrade from <0.3.7~ynh1: +if ynh_compare_current_package_version --comparison lt --version 0.3.7~ynh1 || [ -z "$instance_expose_peers" ] +then + # declaration of new parameters + instance_expose_peers="false" + instance_expose_suspended="false" + # conversion of old parameters + if [ "$accounts_registration_open" = "true" ] || [ "$accounts_registration_open" = "false" ]; then + accounts_registration_open=$registration_open + accounts_approval_required=$registration_approval + accounts_reason_required=$registration_reason + else + accounts_registration_open="false" + accounts_approval_required="true" + accounts_reason_required="false" + fi + # registration of new parameters + 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" + # registration of converted parameters + 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" + # deletion of old parameters + ynh_app_setting_delete --app="$app" --key=registration_open + ynh_app_setting_delete --app="$app" --key=registration_approval + ynh_app_setting_delete --app="$app" --key=registration_reason fi #=================================================