diff --git a/README.md b/README.md index 13bca86..6d39ee8 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ With GoToSocial, you can keep in touch with your friends, post, read, and share Documentation is at [docs.gotosocial.org](https://docs.gotosocial.org). -**Shipped version:** 0.3.6~ynh1 +**Shipped version:** 0.3.7~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 3aec6b1..947300b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,7 +24,7 @@ Avec GoToSocial, vous pouvez rester en contact avec vos amis, publier, lire et p Vous pouvez consulter la documentation à l'adresse : [docs.gotosocial.org](https://docs.gotosocial.org). -**Version incluse :** 0.3.6~ynh1 +**Version incluse :** 0.3.7~ynh1 ## Captures d'écran 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/arm64.src b/conf/arm64.src index 1ddc695..58266ca 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.6/gotosocial_0.3.6_linux_arm64.tar.gz -SOURCE_SUM=4d582c01a7507ceca0302ddc6e4e15388797d89b0c1265609843a11349bf0990 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.7/gotosocial_0.3.7_linux_arm64.tar.gz +SOURCE_SUM=cb82b4f9f0ce92b66e4fa1e4ed079640f37450888c949e02afea9e3d67141aeb SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.3.6_linux_arm64.tar.gz +SOURCE_FILENAME=gotosocial_0.3.7_linux_arm64.tar.gz diff --git a/conf/armv6.src b/conf/armv6.src index f249dfe..234b3e5 100644 --- a/conf/armv6.src +++ b/conf/armv6.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.6/gotosocial_0.3.6_linux_armv6.tar.gz -SOURCE_SUM=f2eb9547e6f9ab97b860874266584333126af06756a875bfd6a291133358edb1 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.7/gotosocial_0.3.7_linux_armv6.tar.gz +SOURCE_SUM=52a29505265841a96e39a9f48ec3db6afe8182065900ecc2084127184248c1fd SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.3.6_linux_armv6.tar.gz +SOURCE_FILENAME=gotosocial_0.3.7_linux_armv6.tar.gz diff --git a/conf/armv7.src b/conf/armv7.src index 3b7a1d4..0094d63 100644 --- a/conf/armv7.src +++ b/conf/armv7.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.6/gotosocial_0.3.6_linux_armv7.tar.gz -SOURCE_SUM=96f10febc9d76a83d974f498eb1fb5e8117191dfeebd2797db8e46260c400c97 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.7/gotosocial_0.3.7_linux_armv7.tar.gz +SOURCE_SUM=10e08e0a35a46acfe3ae547d24d089494d06508a4383d9b00f6f6d52d9b8d525 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.3.6_linux_armv7.tar.gz +SOURCE_FILENAME=gotosocial_0.3.7_linux_armv7.tar.gz 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/conf/i386.src b/conf/i386.src index a37f4e7..5a1c434 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.6/gotosocial_0.3.6_linux_386.tar.gz -SOURCE_SUM=c8b285a62ff7e762b6ccb86f86d7a8ebc31d7c7e40f4988995fa533d595027d8 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.7/gotosocial_0.3.7_linux_386.tar.gz +SOURCE_SUM=f584c2a28c96fc5c1eef035652a202b43f966eb2d2ef4e4407b7c975395e22ea SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.3.6_linux_386.tar.gz +SOURCE_FILENAME=gotosocial_0.3.7_linux_386.tar.gz diff --git a/conf/x86-64.src b/conf/x86-64.src index efc344a..c7cd2c2 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.6/gotosocial_0.3.6_linux_amd64.tar.gz -SOURCE_SUM=eb0a75eea24d8f953296398eb652ec9888de354b349519f74dac7f02a73ed762 +SOURCE_URL=https://github.com/superseriousbusiness/gotosocial/releases/download/v0.3.7/gotosocial_0.3.7_linux_amd64.tar.gz +SOURCE_SUM=9257f5516548fef3de47799312829066d56c0819c3b2b6654d24d48604505c53 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_EXTRACT=true SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=gotosocial_0.3.6_linux_amd64.tar.gz +SOURCE_FILENAME=gotosocial_0.3.7_linux_amd64.tar.gz diff --git a/config_panel.toml b/config_panel.toml index e871ef4..4f68eb0 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 = "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" + +[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 = "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" diff --git a/manifest.json b/manifest.json index a38128d..b99978b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "An ActivityPub social network server, written in Golang.", "fr": "Un serveur de réseau social basé sur ActivityPub écrit en Golang." }, - "version": "0.3.6~ynh1", + "version": "0.3.7~ynh1", "url": "https://github.com/superseriousbusiness/gotosocial", "upstream": { "license": "AGPL-3.0-only", @@ -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..67edb38 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,9 +30,12 @@ db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd) datadir=$(ynh_app_setting_get --app="$app" --key=datadir) -registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) -registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) -registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) +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) + +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) 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) @@ -89,6 +92,10 @@ ynh_script_progression --message="Ensuring downward compatibility..." # Upgrade from <0.2.1~ynh4: if ynh_compare_current_package_version --comparison lt --version 0.2.1~ynh4 || [ -z "$db_user" ] then + # import old parameters + registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) + registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) + registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) # declaration of new parameters client_max_body_size="100M" media_image_max_size="2097152" @@ -121,9 +128,42 @@ 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 + # import old parameters + registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) + registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) + registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) + # declaration of new parameters + instance_expose_peers="false" + instance_expose_suspended="false" + # conversion of old parameters + if [ "$registration_open" = "true" ] || [ "$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 #=================================================